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

arXiv: https://arxiv.org/abs/2611.32591 · HTML: https://mlsanity.com/paper/2611.32591/

## Key facts

- No citing papers in the map yet (data through 24 Nov 2026).
- Builds on 22 of its 40 references that are in the map.
- Submitted 24 Nov 2026, announced 25 Nov 2026.

## Builds on (most cited first, 22 of 22)

- [High-Resolution Image Synthesis with Latent Diffusion Models](https://mlsanity.com/paper/2112.10752/) (2021)
- [Denoising Diffusion Implicit Models](https://mlsanity.com/paper/2010.02502/) (2020)
- [Image-to-Image Translation with Conditional Adversarial Networks](https://mlsanity.com/paper/1611.07004/) (2016)
- [Demystifying MMD GANs](https://mlsanity.com/paper/1801.01401/) (2018)
- [Contrastive Learning for Unpaired Image-to-Image Translation](https://mlsanity.com/paper/2007.15651/) (2020)
- [Continual Test-Time Domain Adaptation](https://mlsanity.com/paper/2203.13591/) (2022)
- [Efficient Test-Time Model Adaptation without Forgetting](https://mlsanity.com/paper/2204.02610/) (2022)
- [Towards Stable Test-Time Adaptation in Dynamic Wild World](https://mlsanity.com/paper/2302.12400/) (2023)
- [Test-Time Prompt Tuning for Zero-Shot Generalization in Vision-Language Models](https://mlsanity.com/paper/2209.07511/) (2022)
- [MEMO: Test Time Robustness via Adaptation and Augmentation](https://mlsanity.com/paper/2110.09506/) (2021)
- [Robust Test-Time Adaptation in Dynamic Scenarios](https://mlsanity.com/paper/2303.13899/) (2023)
- [Effectively Unbiased FID and Inception Score and where to find them](https://mlsanity.com/paper/1911.07023/) (2019)
- [Deep learning-based virtual histology staining using auto-fluorescence of label-free tissue](https://mlsanity.com/paper/1803.11293/) (2018)
- [StainGAN: Stain Style Transfer for Digital Histological Images](https://mlsanity.com/paper/1804.01601/) (2018)
- [BCI: Breast Cancer Immunohistochemical Image Generation through Pyramid Pix2pix](https://mlsanity.com/paper/2204.11425/) (2022)
- [Deep learning-based transformation of the H&E stain into special stains](https://mlsanity.com/paper/2008.08871/) (2020)
- [PhaseStain: Digital staining of label-free quantitative phase microscopy images using deep learning](https://mlsanity.com/paper/1807.07701/) (2018)
- [Deep Learning-enabled Virtual Histological Staining of Biological Samples](https://mlsanity.com/paper/2211.06822/) (2022)
- [Adaptive Supervised PatchNCE Loss for Learning H&E-to-IHC Stain Translation with Inconsistent Groundtruth Image Pairs](https://mlsanity.com/paper/2303.06193/) (2023)
- [Each Test Image Deserves A Specific Prompt: Continual Test-Time Adaptation for 2D Medical Image Segmentation](https://mlsanity.com/paper/2311.18363/) (2023)
- [Pathological Semantics-Preserving Learning for H&E-to-IHC Virtual Staining](https://mlsanity.com/paper/2407.03655/) (2024)
- [Unpaired Multi-Domain Histopathology Virtual Staining using Dual Path Prompted Inversion](https://mlsanity.com/paper/2412.11106/) (2024)

## Abstract (arXiv)

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.
