
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 research team from the School of Engineering at the Hong Kong University of Science and Technology (HKUST) has developed a novel generative artificial intelligence (GenAI) framework that can produce high-fidelity virtually stained images even when training image pairs are imperfectly aligned, paving the way for faster, more tissue-saving histopathology workflows.
The study, titled “Generative AI for misalignment-resistant virtual staining to accelerate histopathology workflows,” is published in Nature Communications.
The study is led by 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 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 Southern Medical University in Guangzhou, the Chinese University of Hong Kong and other collaborative partners.
Staining’s cost in time and tissue
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, while 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, 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.
Misalignment undermines virtual staining
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 rely 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 nonrigid: 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.
DGR separates generation from registration
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.
Benefits extend to AI analysis
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.
Chen, 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 Ph.D. students in the Department of Computer Science and Engineering at HKUST and members of Chen’s research team.
Publication details
Jiabo Ma et al, Generative AI for misalignment-resistant virtual staining to accelerate histopathology workflows, Nature Communications (2026). DOI: 10.1038/s41467-026-71038-2
Journal information:
Nature Communications
Key medical concepts
Clinical categories
The content is provided for information purposes only.
