When a patient's biopsy tissue is precious and time is short, waiting for chemical stains to reveal cell structures can feel unbearable. Now, researchers at the Hong Kong University of Science and Technology have built an AI system that could eliminate that wait — even when the training data isn't perfectly aligned.
The team, led by Assistant Professor Chen Hao from the Department of Computer Science and Engineering and Associate Professor Terence Wong from the Department of Chemical and Biological Engineering, developed a generative AI framework called Decoupled Generation and Registration (DGR). It can produce high-fidelity virtual stains for medical images despite imperfections in how the training image pairs are aligned. Their work appears in Nature Communications.
In traditional pathology, tissue samples are soaked in chemical stains — like hematoxylin and eosin (H&E) — to reveal nuclei and tissue structures. More specialized stains, such as Periodic Acid Schiff-Alcian Blue (PAS-AB), can highlight specific biological components useful for diagnosing disease. But each stain requires time, labor, and precious tissue that cannot be reused. Virtual staining, which uses AI to digitally transform label-free or routinely stained images into target-stained images, promises to reduce that burden — preserving samples while generating additional diagnostic channels.
The catch, however, was a quietly assumed problem: virtual staining models typically required input images and their stained counterparts to be pixel-perfectly aligned. In real pathology slides, that assumption almost never holds. Tissue sections shift during sectioning, staining, scanning, and mounting. Folds and local damage introduce deformation. When an AI model generates a correctly placed cell nucleus, it might still be "penalized" simply because the corresponding nucleus in the target image drifted slightly during preparation.
DGR tackles this by separating the task of image generation from the task of spatial registration. Rather than assuming training pairs are perfectly aligned, the framework explicitly accounts for residual registration errors during training. The generative model learns how one stain's appearance transforms into another — say, converting an H&E image into a PAS-AB special stain — while the registration mechanism simultaneously handles spatial deviations caused by tissue deformation. The team validated DGR across five datasets and four stain-related tasks, including H&E-to-PAS-AB translation, H&E-to-multiplex immunohistochemistry conversion, and virtual H&E staining from label-free autofluorescence images.
For patients, the implications could mean fewer repeat biopsies and faster diagnoses. For researchers, it opens new possibilities for multimodal analysis and tissue-preserving workflows that don't sacrifice accuracy when the images aren't perfectly lined up. Wong noted that the approach could accelerate histopathology in settings where repeated chemical staining is impractical or tissue is scarce.
The research was conducted in collaboration with Southern Medical University in Guangzhou and the Chinese University of Hong Kong, among other partners. As AI continues to bridge the gap between what machines can learn and what medicine actually needs, this framework suggests that some of the most stubborn bottlenecks aren't in the algorithm — they're in the slides themselves.
