cs.CVNov 24, 2026

FewRef-5: Fixed-Reference Test-Time Adaptation for Virtual Staining

Authors: Wenxuan Wang, Liwen Wang, Mingmin Wu, Xingbo Dong, Zhe Jin

Organizations: Anhui Provincial Key Laboratory of Secure Artificial Intelligence, Anhui Provincial International Joint Research Center for Advanced Technology in Medical Imaging, School of Artificial Intelligence, Anhui University, Hefei 230093, China.

Abstract

Virtual staining synthesizes special-stain images from routine hematoxylin and eosin (H&E), extending the information available from an existing digital slide. However, a fixed inference rule can leave available real target-stain references unused, limiting query-specific correction of stain appearance at deployment. Test-time adaptation (TTA) provides a mechanism for this reference-guided, query-specific refinement without retraining the generator. We therefore propose FewRef-5, a reference-assisted TTA method for virtual staining built on StainPromptInversion. We extract tissue-masked optical-density means and standard deviations from five real Masson's trichrome (MAS) training patches and average them into a fixed stain target. A scheduled statistic-matching loss introduces this target into per-query visual-prompt optimization alongside our edge/Gram consistency penalties and the inherited reconstruction objectives. The target remains unchanged across queries, avoiding recursive dependence on earlier generated outputs while the pretrained generator stays fixed. On recorded H&E-to-MAS outputs for 1,989 queries, FewRef-5 reduces target-set FID from 183.201 to 166.904 and increases source-referenced SSIM from 0.92787 to 0.94996 relative to our Edge+Gram variant. Source PSNR and MS-SSIM decrease, showing an endpoint trade-off rather than uniformly better reconstruction.

Figures & tables

Explore similar work

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

    Sep 1, 2026Baoshun Wang, Weiping Lin, Linwu Wang +3Computational PathologyImage-to-Image Translation

  2. UNIStainNet: Foundation-Model-Guided Virtual Staining of H&E to IHC

    Mar 13, 2026Jillur Rahman Saurav, Thuong Le Hoai Pham, Pritam Mukherjee +3Virtual StainingComputational Pathology

  3. SheafStain: Sheaf-Theoretic Schrödinger Bridge for Spatially and Biologically Coherent Virtual Staining

    Jun 10, 2026Hyeongyeol Lim, Hongjun Yoon, Eunjin Jang +3Computational PathologyVision Foundation Models