arXiv:2609.00984cs.CVSep 2026

Manuscript Offprint

arXiv:2609.00984

Semi-Supervised Virtual Staining via Morphology Preservation and Histopathological Realism Constraints

Baoshun Wang, Weiping Lin, Linwu Wang, Yihuang Hu, Baptiste Magnier, Liansheng Wang

Baoshun Wang, Weiping Lin, Linwu Wang, Yihuang Hu, Baptiste Magnier, Liansheng Wang, Member, IEEE

IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. XX, NO. XX, XXXX 2020

1

Abstract—Virtual staining aims to computationally generate target-stained histopathological images while reducing the cost and time associated with conventional staining procedures. However, existing methods rely predominantly on strictly paired and accurately registered training data, which are difficult and expensive to obtain in routine practice. To reduce this dependence, we propose a stable semi-supervised virtual staining framework that jointly exploits both limited paired data and abundant unpaired source images. Directly incorporating unpaired images is challenging because their generated results lack corresponding targets for supervision, potentially leading to unrealistic staining, morphological degradation, or even training collapse. To obtain reliable supervision from these images, Hessian-derived morphology preservation extracts structural cues from each source image and constrains the generated output to retain tissue morphology. Histopathological realism constraints further guide the output toward plausible target-stain characteristics, preventing the source-derived structural supervision from degenerating into contour enhancement or simple color transformation. Together, the two components suppress structural and appearance drift, stabilize semi-supervised stain translation, and promote the preservation of diagnostically relevant information. Extensive experiments on H&E-to-IHC translation for Ki67 and HER2, as well as FFPE-to-H&E translation, demonstrate consistent improvements in image quality, morphology preservation, robustness, and downstream diagnostic performance. Code will be available.

Index Terms—Computational pathology, Morphology preservation, Histopathological realism constraints, Semi-supervised learning, Virtual staining

I. INTRODUCTION

HISTOPATHOLOGICAL staining reveals tissue characteristics that are essential for disease diagnosis and treat-

This work was supported by the National Natural Science Foundation of China under Grant 62371409, Fujian Provincial Natural Science Foundation of China under Grant 2023J01005. (Corresponding author: Liansheng Wang.)

Baoshun Wang and Weiping Lin contributed equally.

Baoshun Wang, Weiping Lin, Linwu Wang, Yihuang Hu and Liansheng Wang are with Department of Computer Science, School of Informatics, Xiamen University, Xiamen 361005, China (e-mail: {bswang, wplin, lwwang, huyihuang}@stu.xmu.edu.cn; lswang@xmu.edu.cn).

Baptiste Magnier is with EuroMov Digital Health in Motion, Univ Montpellier, IMT Mines Ales, Ales, France, and also with Service de Médecine Nucléaire, Centre Hospitalier Universitaire de Nîmes, Université de Montpellier, Nîmes, France (e-mail: baptiste.magnier@mines-ales.fr).

Figure

Fig. 1. Motivation of the proposed framework. (a) Limited paired data constrain virtual staining performance. (b) Unpaired source images improve data utilization but lack direct cross-stain supervision. (c) Hessian-derived morphology preservation extracts structural supervision from source images, while histopathological realism constraints promote realistic target staining.

ment planning. Hematoxylin and eosin (H&E) staining primarily presents tissue organization, cellular morphology, and nuclear appearance [1], whereas immunohistochemistry (IHC) visualizes the expression and spatial distribution of specific biomarkers, such as HER2 and Ki67 [2]. These complementary staining patterns provide important evidence for tumor characterization and therapeutic decision-making. Conventional staining, however, involves multiple tissue-processing and chemical procedures, resulting in substantial labor, reagent consumption, and turnaround time. These limitations have motivated computational methods that generate a desired staining modality directly from an available pathological image, including conditional generative adversarial networks [3], [4].

With the digitization of pathological slides, virtual staining has emerged as a computational approach for translating tissue images between staining modalities [5]. Unpaired image-to-image translation methods, such as CycleGAN, CUT, and pathology-specific stain-transfer models, learn from independently collected source- and target-domain images without exact spatial correspondence [6]–[8]. This flexibility is attractive in pathology, where corresponding tissue sections are often unavailable. Nevertheless, virtual staining is not simply a style-transfer problem. A visually realistic image is

IEEE TRANSACTIONS ON MEDICAL IMAGING, VOL. XX, NO. XX, XXXX 2020

insufficient if tissue boundaries are distorted or biomarker-related staining appears in inappropriate regions. Because distribution-level matching cannot determine the correct local relationship between source tissue and target staining, paired supervision remains important for preserving morphology and diagnostically relevant staining patterns. Accordingly, supervised models such as Pix2Pix and Pix2PixHD remain widely used foundations for virtual staining [9], [10].

The reliability of paired supervision comes with a substantial data-acquisition burden. Cross-stain image pairs are commonly obtained from adjacent tissue sections or from tissue imaged before and after staining. Tissue deformation, missing regions, sectioning artifacts, staining variations, and registration errors can disrupt their spatial correspondence. Constructing a high-quality paired dataset therefore requires extensive registration, meticulous manual inspection, and exclusion of poorly aligned samples. Consequently, only a limited proportion of collected images can be retained as registered source–target pairs, whereas many independently acquired source-domain images remain available without corresponding target stains.

Semi-supervised learning has achieved considerable success in medical image classification, segmentation, and related tasks by combining limited annotated data with additional unannotated samples [11]−[14][11]-[14]. This paradigm is particularly promising for virtual staining because paired images are difficult to acquire, while unpaired source images are abundant. In this work, unpaired images refer specifically to source-domain images without corresponding target-stain images. Paired samples provide direct cross-stain supervision, including tissue correspondence and target-specific staining information, whereas unpaired samples increase the diversity of tissue appearances available during training.

Exploiting unpaired images in a generative task is nevertheless challenging. Unlike classification or segmentation, virtual staining must predict a high-dimensional target image, and an unpaired input provides no corresponding target with which to verify the generated result. Without appropriate supervision, the generator may deviate from the intended stain mapping, distort source-tissue morphology, produce unrealistic target staining, or even collapse during training. Consequently, reliable supervision must therefore be derived for unpaired samples without requiring additional target images.

To this end, we first introduce Hessian-derived morphology preservation to extract structural supervision directly from each source image. Second-order spatial responses capture morphology-related transitions around tissue interfaces, cellular boundaries, and nuclear contours and can be compared across staining modalities. This source-derived signal therefore constrains tissue morphology even when a paired target is unavailable. However, morphology preservation alone may encourage the generator to overemphasize contours or reduce stain translation to a simple color transformation, without ensuring a realistic target-stain appearance.

We consequently introduce histopathological realism constraints (HRC) as a complementary source of supervision. Based on a frozen CONCH vision (a language model [15]), HRC guides generated images toward plausible target-stain characteristics. For paired samples, the corresponding target image provides additional cross-stain representation guidance; for unpaired samples, the target-stain prompt serves as a stable reference. HRC therefore complements the source-derived morphology supervision and discourages structure-only shortcuts. Together, HRC and morphology preservation regulate both target-stain realism and source-tissue morphology, thereby stabilizing semi-supervised optimization and promoting the preservation of diagnostically relevant information.

The proposed framework uses a shared generator for paired and unpaired samples. Paired samples are optimized using conventional cross-stain supervision together with HRC and morphology preservation, whereas unpaired samples obtain supervision from the latter two components. We evaluate the framework on H&E-to-IHC virtual staining for Ki67 and HER2, as well as FFPE-to-H&E translation, under different unpaired-to-paired data ratios. The evaluation covers image quality, morphology preservation, pathology-informed measurements, robustness, and downstream diagnostic performance.

The main contributions of this work are summarized as:

  • We propose a stable semi-supervised virtual staining framework that jointly exploits limited registered source–target pairs and abundant unpaired source images, addressing optimization instability caused by the absence of corresponding targets.

  • We introduce Hessian-derived morphology preservation, which obtains structural supervision directly from source images and reduces alterations to tissue interfaces, cellular boundaries, and nuclear contours during stain translation.

  • We develop histopathological realism constraints based on a frozen CONCH model to promote plausible target-stain characteristics and prevent source-derived structural supervision from degenerating into contour enhancement or simple color transformation.

  • We validate the proposed framework on three virtual staining tasks under different unpaired-to-paired data ratios, demonstrating improvements in staining quality, morphology preservation, robustness, and downstream diagnostic performance.

References (36)