# HAPS: Rethinking Image Similarity for Virtual Staining

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

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 10 of its 29 references that are in the map.
- First posted on arXiv 19 May 2026.

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

- [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)
- [Adaptive Supervised PatchNCE Loss for Learning H&E-to-IHC Stain Translation with Inconsistent Groundtruth Image Pairs](https://mlsanity.com/paper/2303.06193/) (2023)
- [GAN-based Virtual Re-Staining: A Promising Solution for Whole Slide Image Analysis](https://mlsanity.com/paper/1901.04059/) (2019)
- [Pathological Semantics-Preserving Learning for H&E-to-IHC Virtual Staining](https://mlsanity.com/paper/2407.03655/) (2024)
- [A study of why we need to reassess full reference image quality assessment with medical images](https://mlsanity.com/paper/2405.19097/) (2024)
- [StainDiffuser: MultiTask Dual Diffusion Model for Virtual Staining](https://mlsanity.com/paper/2403.11340/) (2024)
- [Weakly Supervised Fine Tuning Approach for Brain Tumor Segmentation Problem](https://mlsanity.com/paper/1911.01738/) (2019)
- [Conditional Consistency Guided Image Translation and Enhancement](https://mlsanity.com/paper/2501.01223/) (2025)
- [Pathology-Guided Virtual Staining Metric for Evaluation and Training](https://mlsanity.com/paper/2507.12624/) (2025)

## Abstract (arXiv)

Virtual staining of histopathology images (e.g., H&E-IHC) is an emerging tool in digital pathology, enabling faster and cheaper workflows by synthesizing target stains from routinely acquired slides. Yet, the quality of virtual staining models is still predominantly assessed with generic metrics such as SSIM, PSNR, and LPIPS. Originally developed for natural images, these metrics are inherently misaligned with the domain-specific characteristics of histological data, failing to capture tissue morphology preservation and biomarker expression patterns. Consequently, a robust, domain-specific standard for quantifying similarity across diverse histological modalities remains a critical gap in the field. In this work, we formalize histology image similarity as a standalone problem and systematically evaluate a broad set of full-reference metrics against a dataset of H&E-IHC patch pairs annotated with expert similarity scores. We further analyze metrics sensitivity to controlled geometric distortions (shifts, rotations and non-rigid deformations) that mimic realistic registration errors between serial sections. Guided by these observations, we propose the Histology-Aware Perceptual Similarity (HAPS) metric. HAPS computes distances in the feature space of a frozen encoder pretrained on histopathology data, adding a linear head to aggregate feature-level differences into a final score that aligns with expert assessments. Finally, we demonstrate the practical value of HAPS for quality control of training data. By quantifying the similarity of training pairs in the MIST dataset and filtering low-scoring samples, we create a cleaner training set. Virtual staining models trained on this refined data outperform those trained on the original, unfiltered dataset.
