# Pathology Foundation Models are Scanner Sensitive: Benchmark and Mitigation with Contrastive ScanGen Loss

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

## Key facts

- Cited by 7 papers in the map (data through 14 Oct 2026).
- Builds on 11 of its 25 references that are in the map.
- First posted on arXiv 29 Jul 2025.

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

- [UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction](https://mlsanity.com/paper/1802.03426/) (2018)
- [Attention-based Deep Multiple Instance Learning](https://mlsanity.com/paper/1802.04712/) (2018)
- [Dual-stream Multiple Instance Learning Network for Whole Slide Image Classification with Self-supervised Contrastive Learning](https://mlsanity.com/paper/2011.08939/) (2020)
- [Virchow2: Scaling Self-Supervised Mixed Magnification Models in Pathology](https://mlsanity.com/paper/2408.00738/) (2024)
- [StainGAN: Stain Style Transfer for Digital Histological Images](https://mlsanity.com/paper/1804.01601/) (2018)
- [Current Pathology Foundation Models are unrobust to Medical Center Differences](https://mlsanity.com/paper/2501.18055/) (2025)
- [StainNet: a fast and robust stain normalization network](https://mlsanity.com/paper/2012.12535/) (2020)
- [H&E-based Computational Biomarker Enables Universal EGFR Screening for Lung Adenocarcinoma](https://mlsanity.com/paper/2206.10573/) (2022)
- [EXAONEPath 1.0 Patch-level Foundation Model for Pathology](https://mlsanity.com/paper/2408.00380/) (2024)
- [Slot-Mixup with Subsampling: A Simple Regularization for WSI Classification](https://mlsanity.com/paper/2311.17466/) (2023)
- [End-to-end Learning for Image-based Detection of Molecular Alterations in Digital Pathology](https://mlsanity.com/paper/2207.00095/) (2022)

## Built on by (most cited first, 7 of 7)

- [Scanner-Induced Domain Shifts Undermine the Robustness of Pathology Foundation Models](https://mlsanity.com/paper/2601.04163/) (2026)
- [Atlas 2 -- Foundation models for clinical deployment](https://mlsanity.com/paper/2601.05148/) (2026)
- [Discrepancy Minimization Improves Cross-Hospital Robustness in Digital Pathology](https://mlsanity.com/paper/2605.25175/) (2026)
- [Robustifying pathology foundation models via fine-tuning](https://mlsanity.com/paper/2607.22861/) (2026)
- [Can You Trust Frozen Hematology Foundation Models under Acquisition Shift?](https://mlsanity.com/paper/2608.25148/) (2026)
- [EXPOSE: Explainable and Domain-Robust Embeddings from Pathology Vision Foundation Models using Sparse Autoencoders](https://mlsanity.com/paper/2608.28191/) (2026)
- [HERO: Histology Encoder for Robust Representation in Oncology](https://mlsanity.com/paper/2609.35943/) (2026)

## Abstract (arXiv)

Computational pathology (CPath) has shown great potential in mining actionable insights from Whole Slide Images (WSIs). Deep Learning (DL) has been at the center of modern CPath, and while it delivers unprecedented performance, it is also known that DL may be affected by irrelevant details, such as those introduced during scanning by different commercially available scanners. This may lead to scanner bias, where the model outputs for the same tissue acquired by different scanners may vary. In turn, it hinders the trust of clinicians in CPath-based tools and their deployment in real-world clinical practices. Recent pathology Foundation Models (FMs) promise to provide better domain generalization capabilities. In this paper, we benchmark FMs using a multi-scanner dataset and show that FMs still suffer from scanner bias. Following this observation, we propose ScanGen, a contrastive loss function applied during task-specific fine-tuning that mitigates scanner bias, thereby enhancing the models' robustness to scanner variations. Our approach is applied to the Multiple Instance Learning task of Epidermal Growth Factor Receptor (EGFR) mutation prediction from H&E-stained WSIs in lung cancer. We observe that ScanGen notably enhances the ability to generalize across scanners, while retaining or improving the performance of EGFR mutation prediction.
