Manuscript Offprint

arXiv:2608.28191

EXPOSE: Explainable and Domain-Robust Embeddings from Pathology Vision Foundation Models using Sparse Autoencoders

Anja Witte, Maximilian Lennartz, Jan Baumbach, Guido Sauter, Stefan Bonn, Patrick Fuhlert, Marina Zimmermann

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Anja Witte 1^{1} ID^{ID}, Maximilian Lennartz 2^{2} ID^{ID}, Jan Baumbach 3^{3} ID^{ID}, Guido Sauter 2^{2} ID^{ID}, Stefan Bonn 1,4^{1,4} ID^{ID}, Patrick Fuhlert ∗1^{*1} ID^{ID}, and Marina Zimmermann ∗1,5^{*1,5} ID^{ID}

1^{1} Institute of Medical Systems Bioinformatics, Center for Biomedical AI (bAIome), Center for Molecular Neurobiology Hamburg (ZMNH), Hamburg Center for Translational Immunology (HCTI), University Medical Center Hamburg-Eppendorf, Hamburg, Germany

2^{2} Institute of Pathology, University Medical Center Hamburg-Eppendorf, Hamburg, Germany

3^{3} Institute of Computational Systems Biology, University of Hamburg, Hamburg, Germany

4^{4} German Center for Child and Adolescent Health (DZKJ), Hamburg, Germany

5^{5} III. Department of Medicine, University Medical Center Hamburg-Eppendorf, Hamburg, Germany

  • shared last author

marina.zimmermann@zmnh.uni-hamburg.de

Abstract. Vision Foundation Models (VFMs) are widely used in computational pathology but remain sensitive to domain shifts arising from variations in staining, tissue preparation, and scanner hardware. A key limitation is that VFM embeddings entangle biological with domain-specific information, hindering cross-domain generalization. We propose Explainable Probing of Cross-Domain Sparse Embeddings (EXPOSE), a framework that uses Sparse Autoencoders (SAEs) as an explainable bottleneck to identify and suppress domain-specific components in VFM embeddings. We train a sparse representation of VFM features, use a linear classifier to identify domain-specific latent dimensions, and mask these features prior to downstream relapse prediction without retraining the backbone model. Experiments on a large prostate cancer dataset with multiple acquisition domains show that SAE features capture both domain- and task-specific information, which are partially disentangled in the latent space. Removing domain-specific features improves cross-domain performance and increases embedding robustness as measured by the Domain Robustness Index (DoRI). Code is available at https://github.com/imsb-uke/expose.

Keywords: Explainability · Vision Foundation Models · Robustness · Sparse Autoencoder · Computational Pathology

A. Witte et al.

1 Introduction

Vision Foundation Models (VFMs) have become the de-facto standard for computational pathology, providing powerful transferable representations that achieve strong performance across a wide range of downstream tasks [2,25]. Their success is driven by large-scale models that are pretrained on massive and diverse datasets, which enable effective feature reuse in data-scarce medical settings [7,27,33,41]. Despite this progress, VFMs remain sensitive to domain shifts – a key challenge in computational pathology [35]. Such domain shifts arise from variations in tissue preparation, staining protocols, and scanner hardware and often negatively impact machine learning models [18]. Consequently, the performance of VFMs can degrade substantially when deployed in external domains [5,23,38].

One key limitation underlying this behaviour is that VFMs often encode biologically relevant information together with domain-specific factors in feature representations [23]. While biological signals are essential for diagnostic tasks, domain-specific features can limit model generalization and reduce reliability. Disentangling these factors in high-dimensional representation spaces is challenging because learned features lack semantic meaning, making it difficult to identify which dimensions encode biological or domain-specific information.

Sparse Autoencoders (SAEs) have recently emerged as a promising tool for transforming dense foundation model embeddings into sparse and more explainable representations [9,31]. By learning an overcomplete and sparse latent basis, SAEs have been shown to recover features that often align with semantically meaningful concepts [3,16]. This provides a mechanism for analysing the internal structure of foundation model representations, enabling analysis and selection of individual latent features [9,30].

Recent studies in computer vision and computational pathology have shown that SAE features can capture biologically meaningful structures that are consistent across datasets, suggesting that sparse representations may separate stable semantic information from dataset-specific variation [10,24,37]. At the same time, sparse features have been shown to be amenable to post-hoc manipulation, as individual latent dimensions can be selectively modified or suppressed [22,37]. However, it remains an open question whether domain-specific information is distinctly represented within the sparse latent space, and whether such information can be explicitly identified and removed to improve robustness.

In this work, we address this question with EXPOSE, a framework for Explainable Probing of Cross-Domain Sparse Embeddings (see Fig. 1). EXPOSE transforms VFM embeddings into a sparse latent space, automatically identifies features associated with domain-specific information, and masks these features before training the downstream model on the resulting filtered representations. In contrast to prior work that uses sparse representations primarily for explainability or semantic feature manipulation, EXPOSE uses SAE features as an explainable bottleneck for removing domain-specific information to improve robustness under domain shift. Our contributions are summarized as follows:

Figure

Fig. 1: Overview of EXPOSE. (A) An SAE is trained in an unsupervised manner on VFM patch embeddings of two domains to learn cross-domain and disentangled representations. (B) The SAE encoded features are mean-pooled and a linear classifier is trained to predict the domain of these slide-level representations. Feature dimensions are ranked according to their weights in the domain classifier. The features with the top-k highest weights are defined as domain-specific features. (C) The mean-pooled features identified as domain-specific are set to zero. A linear classifier is trained to predict the binary downstream task of relapse prediction. The most relevant features for both domain and relapse classes are linked to visual features.

– We propose EXPOSE, a framework that leverages SAEs to obtain explainable feature representations of VFM embeddings and enables domain-aware feature masking.

– We introduce an automatic mechanism for identifying domain-specific latent features in the SAE space and show that the mechanism relates to domain-specific feature activation patterns.

– We demonstrate that masking domain-specific features improves cross-domain robustness and provides evidence that biological and domain-specific information are partially separated in the learned sparse representation. The optimal masking level depends on whether data is drawn from the training domain, in-domain (ID), or a shifted target domain, out-of-domain (OoD).

– We further show that progressively removing domain features increases biological clustering structure in the latent space, indicating improved separation of semantic and domain-specific information.

References (41)