Histopathology is a cornerstone of clinical diagnosis, especially in cancer care. However, conventional chemical staining is often time-consuming and labor-intensive and may consume precious tissue samples. A cross-disciplinary research team at The Hong Kong University of Science and Technology (HKUST) has developed a novel generative AI (GenAI) framework that can produce high-fidelity virtually stained images even when training image pairs are imperfectly aligned, paving the way for faster and more tissue-saving histopathology workflows. The study titled "Generative AI for misalignment-resistant virtual staining to accelerate histopathology workflows" was recently published in the international journal Nature Communications.
The study is led by Prof. CHEN Hao, Assistant Professor in the Department of Computer Science and Engineering, Director of the Collaborative Center for Medical and Engineering Innovation and SmartX Lab, in collaboration with Prof. Terence WONG, Associate Head and Associate Professor in the Department of Chemical and Biological Engineering and Associate Director of the Collaborative Center for Medical and Engineering Innovation, along with researchers from the Southern Medical University in Guangzhou, The Chinese University of Hong Kong, and other collaborative partners.
In routine pathology, tissue samples are commonly processed with chemical stains such as hematoxylin and eosin (H&E) to reveal cell nuclei and tissue structures; whereas techniques that combine two special stains, such as Periodic Acid Schiff- Alcian Blue (PAS-AB), can further highlight specific biological components. These procedures are crucial for disease diagnosis and biomedical research, but preparing multiple stained sections is usually time-consuming and may also consume limited and precious biopsy tissue samples.
Virtual staining offers a promising alternative to improve traditional pathology workflows. By applying AI, researchers can digitally transform label-free images or routinely stained images into target-stained images. For example, virtual staining can generate H&E-like images from autofluorescence images, convert H&E images into PAS-AB-like special stains, and generate multiplex immunohistochemistry images. This approach could reduce the need for repeated chemical staining, preserve tissue samples, and provide additional "virtual channels" for diagnosis, research analysis, and multimodal modeling.
However, for virtual staining to become reliable, an often-underestimated assumption must be addressed: that the input image and its target-stained counterpart are truly aligned. Many previous studies reply on registered image pairs and assume they are accurate enough for pixel-level alignment. In pathology, however, this assumption is rarely realistic. Tissue sections are non-rigid: sectioning, staining, scanning, slide mounting, tissue folding, and local damage can all introduce spatial deformation. If an image pair is not perfectly aligned, a correctly generated nucleus may be unfairly penalized simply because the corresponding nucleus in the target image is slightly shifted. For pathology AI, this is not a minor error, as the value of virtual staining depends on reliable cell structures, glandular boundaries, immune cell localization, and the spatial distribution of staining signals.
To address this issue, the research team proposed Decoupled Generation and Registration (DGR). Instead of assuming that training image pairs are perfectly registered, DGR explicitly accounts for residual registration errors during model training. The framework decouples image generation from spatial registration: the generative model focuses on learning appearance and signal transformation between different stains, while the registration mechanism handles spatial deviations caused by tissue deformation.
The team evaluated DGR across five datasets and four stain-related tasks, including virtual H&E staining from label-free autofluorescence images, H&E to PAS-AB special stain translation, H&E to multiplex immunohistochemistry conversion, and H&E stain normalization. Compared with state-of-the-art virtual staining models, DGR demonstrated stronger overall performance in image quality and structural fidelity across multiple tasks.
To further assess visual quality, the researchers enlisted experienced pathologists to perform blind evaluations. Pathologists randomly evaluated 500 H&E-stained images and 500 PAS-AB-stained images, comparing DGR-generated virtual stains with the corresponding real chemical stains. Their accuracy in distinguishing virtual stains from chemical stains was about 52%, close to chance, suggesting that the two were visually difficult to distinguish in this evaluation.
The team also explored the value of DGR-generated virtual stains for downstream pathology AI analysis. When DGR-generated virtual multiplex immunohistochemistry images were combined with H&E images, model performance improved for colorectal polyp classification and gastric cancer tissue classification tasks. These results suggest that DGR-generated virtual stains are not only visually similar to real stains but also preserve morphological and spatial information that is useful for downstream analysis.
Prof. Chen Hao, corresponding author of the paper, said, "This work addresses a key barrier to bringing virtual staining closer to real clinical workflows. By enabling high-quality virtual staining from imperfectly aligned pathology images, GenAI provides a more scalable path toward faster and more cost-effective pathology diagnosis."
The co-first authors of the study are MA Jiabo and LI Wenqiang, both PhD students in the Department of Computer Science and Engineering at HKUST and members of Prof. Chen's research team.