HASD: Hierarchical Adaption for pathology Slide-level Domain-shift
Extracted source text · arXiv 2506.23673
\documentclass[runningheads]{llncs}
\usepackage{booktabs}
\usepackage[T1]{fontenc}
\usepackage{graphicx,verbatim}
\usepackage{amssymb}
\usepackage{pdfpages}
\usepackage{makecell}
\usepackage{caption}
\usepackage{amsmath}
\usepackage{adjustbox}
\usepackage{xcolor}
\usepackage{hyperref}
% Used for displaying a sample figure. If possible, figure files should
% be included in EPS format.
%
% If you use the hyperref package, please uncomment the following two lines
% to display URLs in blue roman font according to Springer's eBook style:
%\usepackage{color}
%\renewcommand\UrlFont{\color{blue}\rmfamily}
%\urlstyle{rm}
%
\begin{document}
%
% \title{Bridging Domain Shifts in Pathology Slides via Optimal Transport}
\title{HASD: Hierarchical Adaption for Pathology Slide-Level Domain-Shift}
%HBSLDS: Hierarchical Bridge/Adaption for slide-level domain shift
%HASD: Hierarchical Adaption for Slide-level Domain-shift
\author{
Jingsong Liu\textsuperscript{‡}\inst{1,3} \and
Han Li\textsuperscript{‡}\inst{1,2} \and
Chen Yang\inst{2,4} \and
Michael Deutges\inst{2,4} \and
Ario Sadafi\inst{2,4} \and
Xin You\inst{2} \and
Katharina Breininger\inst{5} \and
Nassir Navab\inst{2,3} \and
Peter J. Schüffler\inst{1,3} \thanks{Corresponding author: \email{peter.schueffler@tum.de}}
}
%index{Liu, Jingsong}
%index{Han, Li}
%index{Yang, Chen}
%index{Deutges, Michael}
%index{Sadafi, Ario}
%index{Breininger, Katharina}
%index{Navab, Nassir}
%index{Schüffler, Peter}
% A list of institutions
\institute{
Institute of Pathology, Technical University of Munich, TUM School of Medicine and Health, Munich, Germany
\and
Computer Aided Medical Procedures (CAMP), TU Munich, Munich, Germany
\and
Munich Center for Machine Learning (MCML), Munich, Germany
%\and
%Munich Data Science Institute (MDSI), Munich, Germany
\and
Institute of AI for Health, Computational Health Center, Helmholtz Munich, Munich, Germany
\and
Center for AI and Data Science (CAIDAS), Julius-Maximilians-Universität Würzburg, Würzburg, Germany
}
% --- 页眉作者缩写 ---
\authorrunning{Liu et al.}
\maketitle
\footnotetext[1]{\textsuperscript{‡}These authors contributed equally to this work.}
\begin{abstract}
\input{components/abstract}
%Edit in the last hour
\keywords{Domain shift \and Pathology slide-level tasks}
\end{abstract}
\section{Introduction}
\input{components/introduction}
\section{Methods}
\input{components/methods}
\section{Experiments and Results}
\input{components/experiment}
% \section{Results and Discussion}
% \input{components/results and discussion}
\section{Conclusion}
% Domain shift is a critical problem for pathology AI as pathology data is heavily influenced by center-specific conditions. Current domain adaptation methods focus on image patches rather than WSI, thus failing to capture global WSI features required in typical clinical scenarios. We, for the first time, introduced a slide-level domain adaption method HASD, which incorporates a hierarchical adaptation design to maintain multi-scale feature consistency and a prototype selection mechanism to enable computationally efficient domain alignment. Our method outperformed conventional DA methods in two tasks (Her2 grading and Survival) by 4.1\% and 3.9\%, when models were trained and tested in different centers, while preserving in-domain performance. We believe that our research on slide-level domain adaptation will improve the generalizability of future clinical AI models. Code is available at anonymous.
\input{components/conclusion}
% \begin{credits}
% \subsubsection{\ackname}
% \input{components/acknowledgements}
% \subsubsection{\discintname}
% \input{components/interests}
% \end{credits}
\bibliographystyle{splncs04}
\bibliography{ref.bib}
\end{document}
%Domain shift is a critical challenge in digital pathology, where variations in staining protocols, scanning devices, and label distributions across different hospitals can substantially degrade model performance.
% Domain shift in digital pathology can substantially impact model performance. While most of the methods focus on addressing domain shifts in patch-level tasks, real-world pathology usually requires a global understanding of the whole slides (i.e., cancer grading and survival prediction task).
% In this work, we tackle the multi-scale challenges of slide-level domain adaptation and propose a practical solution that accounts for both image variances and label-prevalence discrepancies across centers.
% Specifically, (1) we introduce a hierarchical adaptation framework comprising a Domain-level Alignment Solver with an entropic Sinkhorn–Knopp solver for feature alignment, a Slide-level Geometric Invariance Regularization to preserve morphological structure within each slide, and a Patch-level Attention Consistency Regularization to maintain critical diagnostic cues. (2) We further incorporate a prototype selection mechanism that reduces the computational overhead. Our method is validated on four public datasets and one internal cohort, achieving a 4.1\% improvement in AUROC in a Breast Cancer HER2 Grading cohort and a 3.9\% gain in C-index in a UCEC survival prediction cohort.
% Our method provides a practical and reliable domain alignment solution for pathology institutions, minimizing both computational and annotation costs in real-world pathology tasks.
Domain shift is a critical problem for artificial intelligence (AI) in pathology as it is heavily influenced by center-specific conditions. Current pathology domain adaptation methods focus on image patches rather than whole-slide images (WSI), thus failing to capture global WSI features required in typical clinical scenarios.
In this work, we address the challenges of slide-level domain shift by proposing a Hierarchical Adaptation framework for Slide-level Domain-shift (HASD). HASD achieves multi-scale feature consistency and computationally efficient slide-level domain adaptation through two key components: (1) a hierarchical adaptation framework that integrates a Domain-level Alignment Solver for feature alignment, a Slide-level Geometric Invariance Regularization to preserve the morphological structure, and a Patch-level Attention Consistency Regularization to maintain local critical diagnostic cues; and (2) a prototype selection mechanism that reduces computational overhead. We validate our method on two slide-level tasks across five datasets, achieving a 4.1\% AUROC improvement in a Breast Cancer HER2 Grading cohort and a 3.9\% C-index gain in a UCEC survival prediction cohort.
Our method provides a practical and reliable slide-level domain adaption solution for pathology institutions, minimizing both computational and annotation costs. Code is available at \href{https://github.com/TumVink/HASD}{https://github.com/TumVink/HASD}.
% We model for the first time slide-level domain shift in pathology as a multi-scale Optimal Transport (OT) problem and leverage a hierarchical adaption framework to align source and target feature distributions while keeping the heavy FM frozen. Our contributions include: (1) introducing a purely feature-level OT formulation that operates without additional supervision or generative networks, (2) enhancing stability and pathological relevance through an attention-based regularization mechanism, and (3) adapting an unbalanced solver to handle label prevalence variances across centers. We demonstrate the robustness of our approach on multi-center Breast Cancer Grading and UCEC survival prediction tasks, highlighting its effectiveness even under significant label distribution shifts. Our unsupervised method can help institutions leverage pretrained FMs in new clinical environments without requiring additional annotations from pathologists.
%Background
%Ditigal pathology labs are getting more and more popular these years, enable the share of digital slides among different labs under policies supervision more convenient and frequent than physical material whole slides tissus. Along with the increasing usage of Deep learning, people expect that a global deployed model could benefit everywhere of the world; However, In digital pathology, domain shift is manifested as variability in terms of staining and digitalization protocols, specifically between different hospitals. Those domain shift would cause severe performance downgrade.
% Digital pathology laboratories have undergone rapid growth in recent years, propelled by the widespread adoption of whole-slide imaging (WSI) scanners and advances in artificial intelligence (AI) research \cite{detection}. This has led to notable successes in tasks such as ... However, a pressing challenge remains: domain shift—the variability in staining protocols and digitization processes among different medical centers—often causes significant degradation in model performance \cite{enhancing1} \cite{enhancing2}. Such variability can lead to biased or inconsistent predictions, potentially affecting patient care if a model is transferred from one hospital setting to another without proper adaptation \cite{unrobust} \cite{outlier_detection}.
\begin{figure}
\begin{center}
\includegraphics[width=\textwidth]{viz/Figure1_test.pdf}
\end{center}
\caption{(a)(b): Existing methods rely on patch-level labels from the source domain and pseudo labels from the target domain for patch-level domain adaptation. (c)(d): In slide-level tasks, patches lack individual labels. We propose a \textbf{hierarchical} adaption framework that leverages \textbf{domain-level} alignment solver with \textbf{slide-level} structure and \textbf{patch-level} diagnostic features preserved.} \label{Figure 1}
% This is placeholder figure, in final figure, there should be a integrated figure with AUC and C-Index.
\end{figure}
Digital pathology has experienced significant attention in recent years, driven by the widespread adoption of whole-slide imaging (WSI) scanners and rapid progress in artificial intelligence (AI) research~\cite{ffd}. This trend has facilitated notable advancements in many AI-based pathology tasks \cite{yin2024histosyn,fan2024pathmamba}.
% Deep learning applications in pathology, such as cancer detection, survival prediction, and inflammation analysis in digital tissue samples—have advanced rapidly in recent years.
However, a major challenge in pathology is \textbf{domain shift}, arising from differences in pathology centers, including \textbf{imaging variances} (varying staining protocols, digitization procedures), \textbf{label discrepancies} (patient populations), and other factors. Domain shift can downgrade model performances when transferring a model to a different clinical site, potentially compromising patient safety \cite{unrobust,DAUD,xiong2023prior,xu2025nerf}.
% Digital pathology laboratories have experienced significant growth in recent years, driven by the widespread adoption of whole-slide imaging (WSI) scanners and rapid progress in artificial intelligence (AI) research\cite{ffd}. This trend has facilitated notable advancements in skin cancer detection [9], survival outcome prediction [10], and inflammation assessment [11] through deep learning algorithms.
% Despite the successes, a major challenge persists in the form of \textbf{domain shift}, which arises from variations like staining protocols, digitization procedures, and other center-specific factors.
% Such discrepancies can substantially degrade model performance when deployed across different clinical sites, potentially affecting patient diagnoses and treatment due to non-biological differences in image data. \cite{unrobust} \cite{DAUD}.
% To address these limitations, foundation models (FMs) tailored for histopathology have emerged. These large-scale models, often pretrained on diverse unlabeled WSIs, are designed to learn transferable representations that are ostensibly more robust to center-specific variability. Usually, the patch-level FMs work together with Multi Instance Learning (MIL) as an aggregation to output clinical predictions. Nonetheless, FMs can still exhibit sensitivity to domain shifts \cite{unrobust}, and fine-tuning such large models can be computationally expensive and energy-intensive—especially when confronted with limited data or diverse target centers \cite{finetune_vit}.
%1. 没有关联句,如to this issue
Domain adaptation (DA) is a method to mitigate domain shift commonly used in histology image analysis, leveraging adversarial training or generative models \cite{DANN,scanner,DAUD,patho_gan,sharma2022mani,wang2021instance,falahkheirkhah2023domain}. By extracting domain-invariant features or synthesizing target-like samples, DA helps to align distributions between different datasets, improving model robustness and generalization. However, most methods focus on \textbf{patch-level adaption}, making them misaligned with real-world applications where clinical decisions require a global understanding of the slide (e.g., cancer grading or survival prediction) that patch-level adaptation methods fail to capture. An intuitive approach to extend patch-level DA methods to the slides-level is by decomposing slide-level tasks into many patch-level predictions~\cite{wang2022classification,yale_her2}, applying DA at the patch level, and then aggregating the slides-level results. However, this often requires extensive patch-level annotations from pathologists, which is very time-consuming. Another naive approach aggregates patch embeddings via simple integration techniques (e.g., mean pooling) \cite{enhancing1}. However, this treats all patches equally, failing to emphasize diagnostically relevant regions.
% e.g., and 不同patch带来的diverse information of a whole slide is oversimplified that may lead to disaster performance.
% Moreover, the annotation of the gigapixel resolution WSIs poses unique challenges for slide-level DA, as generating extensive expert annotations for each patch is for pathologists daily workload extremely time-consuming. Consequently, there is a growing need for domain adaptation strategies that can operate effectively at the \textbf{slide level} without incurring expensive annotation costs or sacrificing holistic information.
% In the broader literature, \textbf{domain adaptation (DA)} techniques have been widely explored to mitigate data distribution mismatches between a training (source) domain and a testing (target) domain. Exsisting DA methods often relied on adversarial training \cite{DANN} \cite{saito2018maximum} to extract domain-invariant features or on generative models \cite{cGan}\cite{UDA} that synthesize target-like samples to augment the source data.
%not sure if add this or not.
% Very recently, there are some works to bridge domain gaps in slide-level tasks with the powerful of language model\cite{enhancing2} \cite{MI_zero}. They try to make the use of language prompts to insert a domain signature to features, however it still exhibits a notable reliance on textual prompts.
% \textbf{Foundation models (FMs)} tailored for histopathology have emerged to address some of these challenges \cite{rudolf} \cite{ctranspath} \cite{chief} \cite{prism}. These large-scale models, frequently pretrained on diverse, unlabeled WSIs, are designed to learn representations that are ostensibly more robust to center-specific variability. In practice, patch-level FMs are commonly paired with a Multi-Instance Learning (MIL) framework to produce clinical predictions from aggregated patch features \cite{MIL_overview}. Nonetheless, FMs can remain sensitive to domain shifts \cite{unrobust}, and fine-tuning such models can be computationally expensive and energy-intensive—particularly when target-domain data is limited or heterogeneous \cite{finetune_vit}.
%Introduce the previous works
%In a more general definition, domain shift occurs when ...; Previous works focus on (1) Domain adaption (2) Using DANN style. -> Several works transfered to Pathology tasks. -> However most of them focus on patch-level tasks, like . In real-world clinial pathology lab, slides level tasks are more realistiv.
%Very recently there are few works focus on this scenario. They either depend on language prompt guidance or mean-pooling the slide into vetor, and apply the patch-domain adaption with the loss of global information of all pathces.
%Introduce the Pathology FMs and emphasis the shortness.
%FM were proposed to solve this problem. FM usually applies self-supervised learning framework on a huge number of unlabeled diverse slides from different centers, to extract semantic transferable features from the patches, to alleviate the variance between different centers.
%however so far FM are still sensitive to domain shift\cite{unrobust}. Finetuning the ViT based FM could cause huge computational and energy costs with only obtaining very limited performance.
% The Hierarchical Version
Instead, we propose to realize\textbf{ slide-level} pathology DA by adopting the more adaptive attention-based aggregation (ABMIL).
% Specifically, we use the state-of-the-art (SOTA)foundation model (UNI) \cite{uni} to extract embeddings from all patches of a slide and perform slide-level domain adaptation collectively on their features, rather than adapting each patch individually.
This presents two major challenges: \textbf{(1) The distortion of multi-scale feature distributions}: The success of ABMIL relies on the domain-level feature distributions, intra-slide patch relations, and patch-level attention patterns. Without a structured adaptation framework, DA can distort slide morphology and misalign critical diagnostic features. \textbf{(2) Computational and structural challenges:} The large number of patches per slide, varying across different slides, introduces significant computational overhead, necessitating an efficient adaptation strategy.
% Using all patch embeddings requires immense computational resources, and the inability to maintain a fixed, uniform input size further complicates the adaptation process.
To solve these problems,
we propose in this work an efficient Hierarchical Adaption framework for Slide-level Domain-shift (HASD).
% we focus on a \textbf{clinical routine} setting where a slide-level classifier, trained on source-domain WSIs, is expected to perform reliably on \textbf{out-of-distribution (OOD)} target slides without any additional fine-tuning.
%We propose a domain adaption strategy that uses the state-of-the-art (SOTA) foundation model (UNI) \cite{uni} as a feature extractor in the context of Multi-Instance Learning (MIL) framework, for histopathology slide-level task.
Specifically,
% for the first time, we model slide-level domain shift across pathology centers as a \textbf{Optimal Transport} (OT) problem \cite{sb} and proposed the framework, Hierarchical Adaption framework for Slide-level Domain-shift (HASD),based on
HASD achieves multi-scale feature consistency and computationally efficient DA through two key components (Fig. \ref{Figure 1}): \textbf{(1) Hierarchical Adaptation Framework}: \underline{Domain-level} Alignment Solver, where an entropic Sinkhorn-Knopp solver \cite{sink} ensures effective alignment of feature distributions between domains; \underline{Slide-level} Geometric Invariance Regularization, ensuring that slides are adapted as a whole without structural distortions; \underline{Patch-level} Attention Consistency Regularization, which stabilizes domain adaptation by ensuring critical diagnostic features remain consistently focused across domains. \textbf{(2) Efficient Prototype Selection}: To mitigate the computational burden of the HASD, we select the $K$ most informative prototypes per slide, reducing redundancy while preserving essential slide-level information. Patch-level features are extracted using a pre-trained foundation model (UNI) \cite{uni}, ensuring robust representation learning.
We demonstrate our method's DA capabilities in addressing imaging variances and label discrepancies with two slide-level tasks across five datasets. Compared to SOTA methods, our hierarchy adaption framework achieves an average \textbf{4.1\% } \textbf{AUROC} gain for Breast Cancer Grading and a \textbf{3.9\%} \textbf{C-index} gain in UCEC Survival Prediction task, \textbf{without} requiring additional pathologist annotations.
As such, our method provides a practical solution for pathology institutions seeking to transfer models from a source center to a target center while addressing domain shift, ensuring reliable adaptation with minimal computational overhead and annotation costs for slide-level tasks.
%The old version
% In this work, we focus on a \textbf{clinical routine} setting where a slide-level classifier, trained on source-domain WSIs, is expected to perform reliably on \textbf{out-of-distribution (OOD)} target slides without any additional fine-tuning. We propose a \textbf{slide-level adaptation} strategy that uses the\textbf{ state-of-the-art foundation model (UNI)} \cite{uni} purely as a feature extractor, combined with an Attention-Based Multi-Instance Learning (ABMIL) framework \cite{abmil}. Our contributions are threefold: %refer to the Regensburg paper
% \begin{enumerate}
% \item \textbf{Domain} adaption for slide level task:
% We model the slide-level domain shift across pathology centers as a Schroedinger Bridge (SB) problem within MIL context and leverage an entropic skinhorn-knopp solver \cite{SB} to bridge the source and target domain, all while keeping the large FM frozen. This allows direct adaptation at the slide level, circumventing the need for ... in prior methods. %patch-wise pseudo-labeling used
% % propose leveraging the Schroedinger Bridge (SB) to align the slide domain shift in the common MIL context, aiming to address the domain shift problem in the slide-level tasks across different pathology centers. Specifically, We employ an entropic skinhorn-knop solver \cite{SB} to align source and target distributions, all while keeping the large FM frozen.
% % To the best of our knowledge, we are the first to explore domain adaptation for slide-level tasks in a MIL framework. We model slide-level domain shifts in pathology as an \textbf{Optimal Transport (OT)} problem \cite{OT} and employ an \textbf{entropic Schrödinger Bridge (SB)} solver \cite{SB} to align source and target feature distributions, all while keeping the large FM frozen.
% \item \textbf{Slide} Geometric Invariance Regularization (SGIR):
% Unlike existing adaptation methods that treat patches independently, we treat the slide as a whole during SB-based transformation. By enforcing the intra-slide geometric (relative distance and angles between patches) consistency before and after adaption, our method prevents distortions in the slide’s intrinsic histological structure, leading to more reliable and interpretable domain adaptation across centers.
% % or
% % While during the transport, the structure inside the slide could be wrested. To ensure that intra-slide spatial structure is maintained despite domain shifts.
% \item \textbf{Patch} Attention Consistency Regularization (PACR):
% To further stabilize domain adaptation, We further introduce a patch-level attention consistency regularizer to enhance the stability and pathology-specific relevance of the transformation, ensuring critical diagnostic features are focused during adaptation.
% % under the assumption that any patch receiving great attention before transformation should continue to receive the same attention after the transformation and vice versa.
% % enhances the stability and pathology-specific relevance of our transport mechanism, ensuring critical diagnostic features are preserved during adaptation.
% \item {Task }Agnostic Framework:
% Our method is applicable for both classification and regression slide-level tasks. We evaluated our method in the Breast Cancer Grading task and UCEC survival prediction task.
% \item \textbf{Robustness across multiple cohorts:}
% We demonstrate the robustness of our \textit{Bridge} across four public and one in-house cohort. Compared to state-of-the-art methods, our POT framework achieves an average 4\% improvement in accuracy for Breast Cancer Grading and a 3\% C-index gain in UCEC survival prediction, \textbf{without} requiring additional pathologist annotations. As such, our method provides a practical solution for institutions looking to leverage pretrained FMs in new clinical environments while minimizing both computational overhead and annotation costs.
% \end{enumerate}
%or move this to ablation study
% \subsection{Slide-level distribution}:
% how and why we select KNN patches as prototypes?-> contruct a diverse domain. Considering computational cost
\begin{figure}[htbp]
\centering
\includegraphics[width=\textwidth]{viz/Figure2.pdf}
\caption{ HASD is designed for scenarios where UNI model extracts the patch features from both centers, and the attention aggregation with the MLP classifier are trained on the source domain. (a): The training process of HASD includes the selection of label-free prototypes in each slide and domain adaption in the hierarchical framework, including domain-, slide- and patch-level regularization. (b): Inference with or without HASD.} \label{Figure 2}
\end{figure}
% We focus on a realistic scenario where a FM is applied to out-of-distribution (OOD) slide-level tasks, and the aggregation mechanism plus the MLP classifier are pretrained on the source domain. (a) A foundation model extracts features for each patch from both source and target slides. Label-free prototypes are then obtained by clustering patch embeddings with k-means. (b) During bridging time, a transportation matrix $T$ is learned to align source features to the target domain under OT cost and attention constraints. (c) The learned transport $T$ i is subsequently applied to predict slide-level clinical outputs for target slides using the frozen aggregation and MLP layers. Notably, our method does not require direct access to source slides, only their feature embeddings for constructing the domain adaption.
\subsection{Problem Definition} \label{subsec:problem-definition}
%introduce ABMIL and Optimal transport
\subsubsection{Multiple Instance Learning.}In a slide-level task with a cohort of $N$ slides, each slide is treated as a bag $B$ containing a different number of $P$ patches
% $\{x_1,x_2,...,x_p\}$
extracted by a pretrained encoder into vectors $\{r_1,r_2,...,r_p\} \in \mathbb{R}^M$. Under the MIL assumption, each slide $B$ carries a single label $y$ (e.g., a cancer diagnosis), while individual patches lack direct labels. ABMIL \cite{abmil} learns an attention mechanism $Atten(\cdot)$ to aggregate the set of patch features into a slide-level prediction $\hat{y}$.
\subsubsection{Slide-Level Domain Shift.} We consider two domains: a source domain $\mathbf{R}^{src}$ where the model is trained, and a target domain $\mathbf{R}^{tgt}$ where the model is tested. Slide-level domain shift
%arises when systematic variations in staining protocols, scanner settings, or patient populations
cause the distribution of features in $\mathbf{R}^{src}$ to differ from that in $\mathbf{R}^{tgt}$. Formally, we represent the source and target domains as:
$$
\mathbf{R}^{src} = \{\mathbf{r}_{1,1}^{src},\, \mathbf{r}_{1,2}^{src},
\ldots,\, \mathbf{r}_{n,p}^{src}\},
\quad
\mathbf{R}^{tgt} = \{\mathbf{r}_{1,1}^{tgt},\, \mathbf{r}_{1,2}^{tgt},
\ldots,\, \mathbf{r}_{n,p}^{tgt}\},
$$
where $\mathbf{r}_{n,p}^{src}$ denotes the $p^{th}$ patch vector of the $n^{th}$ slide.
% We aim to find a transformation function $T$ to map $R^{src}$ into a transition domain as similar as possible to $R^{tgt}$: $T(\mathbf{R}^{src}) \rightarrow \mathbf{R}^{tgt}$, so that the model trained on $\mathbf{R}^{src}$ generalizes better to $\mathbf{R}^{tgt}$.
%TODO: try to merge 2.1 and 2.2, add a new subsubsection to introduce some knowledge of Optimal transport, which may cause the reduction of 2.2.1 DAS
\subsubsection{Optimal Transport} (OT) \cite{OT} provides a solution for learning a mapping between $\mathbf{R}^{src}$ and $\mathbf{R}^{tgt}$ while minimizing the overall cost:
$
\gamma\, c~\!(\mathbf{R}^{src},\, {\mathbf{R}^{tgt}}),
$
with $c(\cdot,\cdot)$ measures the feature distance (e.g., cosine similarity) and $\gamma$ matches samples from source to target.
Traditional OT is not well-suited for pathology slide-level domain adaptation, as it incurs significant computational overhead \cite{yeaton2022hierarchical,xu2023multimodal} and treats each patch as an isolated point, thereby ignoring the structured slide morphology and failing to preserve multi-scale feature consistency \cite{OT_trend}. In the following section, we introduce our method to address these challenges.
% Traditional OT enforces mass preservation, often leading to one-to-one matching \cite{yeaton2022hierarchical}. This assumption is unrealistic for pathology, where differences in staining protocols, scanning conditions, and tissue structures make it challenging to establish a single, perfect matching between patches.
% To address this, we later adopted the Schrödinger Bridge (SB), which introduces entropic relaxation terms for flexible and computationally efficient adaptation.
\subsection{Hierarchical Alignment Framework}
\subsubsection{Domain-level Alignment Solver (DAS).}
Instead of directly using OT for domain adaptation, we propose optimizing a transformation function $T$ that maps $\mathbf{R}^{src}$ into a transition domain while minimizing the transport costs between $T(\mathbf{R}^{src})$ and $\mathbf{R}^{tgt}$. To efficiently compute the transport costs, we adopt a Sinkhorn–Knopp (SK) solver \cite{sink} by introducing an entropic regularization term $\mathcal{H}(\gamma)$.
%$\varepsilon \sum_{i,j} \gamma_{ij}\,\log\!\bigl(\gamma_{ij}\bigr)$.
Besides image variance, label discrepancy also poses a further challenge in slide-level domain adaptation. To this end, we further introduce a partial mass relaxation $\mathcal{R}_{\text{partial}}(\gamma)$, allowing for samples to be excluded from matching by relaxing the marginal constraints via Kullback–Leibler (KL) divergence. Accordingly, we learn the transformation $T$ under the guidance of the total transport cost:
$$
% \mathcal{L}_{\mathrm{DAS}}^{\text{partial}} (T, \gamma) =
% \gamma_{ij}\, c \!\bigl(T\bigl(\mathbf{R}^{src}),\, {\mathbf{R}^{tgt}})
% \;+\;
% \varepsilon \sum_{i,j} \gamma_{ij}\,\log\!\bigl(\gamma_{ij}\bigr),
\mathcal{L}_{\mathrm{DAS}}(T, \gamma)
\;=\;
\sum_{i,j}
\gamma_{ij}\, c ~\!\bigl(T\bigl(\mathbf{R}^{src}),\, \mathbf{R}^{tgt})
\;+\;
\varepsilon \mathcal{H}(\gamma)) +
\tau \mathcal{R}_{\text{partial}}(\gamma),
$$
where $\gamma$ and $\tau$ control the strength of entropic regularization and partial relaxation, respectively. In our method, $\gamma$ is fixed as $0.001$, and we only activate the partial mass relaxation term (i.e. set $\tau \not = 0$) when label prevalence discrepancies occur across centers. In such cases (Fig. \ref{tsne} for an example), we refer to the resulting approach as \textbf{Partial DAS}.
% While $\gamma$ is updated via the SK algorithm for each fixed $T$, the $T$ are optimized in an outer loop using gradient-based methods.
% \subsubsection{Domain-level Alignment Solver.}
% To bridge the distribution gap between $\mathbf{R}^{src}$ and $\mathbf{R}^{tgt}$, we adopt an entropic Schrödinger Bridge (SB) formulation. Specifically, we introduce a transport plan $\gamma \in \mathbb{R}^{[N^{src} \times P^{src},N^{tgt} \times P^{tgt}]}$ that matches each source domain sample $r_{n,p}^{src}$ to \textbf{one or more} target domain samples $r_{n,p}^{tgt}$. While the $\gamma$ is iterated via the Sinkhorn–Knopp solver \cite{sink}, the final transport cost serves as a loss $\mathcal{L}_{\mathrm{DAS}}$ to guide the adaptation. Concretely:
% $$
% \mathcal{L}_{\mathrm{DAS}}(\theta, \gamma)
% \;=\;
% \gamma_{ij}\, c \!\bigl(T_{\theta}\bigl(\mathbf{R}^{src}),\, {\mathbf{R}^{tgt}})
% \;+\;
% \varepsilon \sum_{i,j} \gamma_{ij}\,\log\!\bigl(\gamma_{ij}\bigr),
% $$
% % $$
% % \mathcal{L}_{\mathrm{DAS}}(\theta, \gamma)
% % \;=\;
% % \sum_{i=1}^{N_{\mathrm{src}}} \sum_{j=1}^{N_{\mathrm{tgt}}}
% % \gamma_{ij}\, c \!\bigl(T_{\theta}\bigl(r_{i}^{\mathrm{src}}\bigr),\, r_{j}^{\mathrm{tgt}}\bigr)
% % \;+\;
% % \varepsilon \sum_{i,j} \gamma_{ij}\,\log\!\bigl(\gamma_{ij}\bigr).
% % $$
% where $\varepsilon$ controls the strength of the entropic regularization term, smoothing $\gamma$ and speeds convergence. While $\gamma$ is updated via the Sinkhorn–Knopp algorithm for each fixed $T_{\theta}$, the parameters $\theta$ are optimized in an outer loop using gradient-based methods.
% This alternating procedure continues until convergence or until a maximum number of epochs is reached.
\subsubsection{Slide-level Geometric Invariance Regularization (SGIR).}
While DAS allows us to handle domain-level disparities, it operates on each patch independently, and we risk losing the local relationship between patches that belong to the same slide. %, which can be crucial for maintaining morphological context.
Therefore, rather than treating patches as isolated points during alignment, we treat the slide as a whole and incorporate a slide-level constraint to enforce structural consistency in feature space. For this, we define our SGIR loss as:
$$
\mathcal{L}_{\mathrm{SGIR}}(T)
\;=\;
\sum_{n}^{N} \bigl\| G(B_n^{src}) - G(T(B_n^{src})) \|_F,
\quad \text{where} \quad B_n^{src} = \{r_{n,1}^{src},\ldots, r_{n,p}^{src}\},
$$
where $ \| \cdot \|_F $ denotes the Frobenius norm and the Gram matrix $G(X)=XX^T$. By preserving patch pairwise distance within the same slide, we ensure the slide-level structural consistency.
\subsubsection{Patch-level Attention Consistency Regularization (PACR).}
While domain-level and slide-level constraints preserve global structure, the adaptation can be over-warped, causing clinically essential patch-level local cues to be overlooked \cite{OT_trend}. To address this, we introduce PACR to preserve the aggregator’s patch-level attention distributions learned on the source domain. Intuitively, a patch with high attention in the source domain should maintain high attention after transformation by $T$. Formally, we define
% . Specifically, we penalize large deviations in attention weights for corresponding slides or regions, promoting a stable focus on the most diagnostically relevant aspects of the issue:
$$
\mathcal{L}_{\mathrm{PACR}}(T)
\;=\;
\sum_{n}^N \sum_{p}^P \bigl\|Atten(T(r_{n,p}^{src})) \;-\; Atten(r_{n,p}^{src})\bigr\|^{2}.
$$
We thus form the total optimization objective as:
$$
\mathcal{L}_{total}(T,\gamma) = \mathcal{L}_{DAS}(T,\gamma) + \lambda_1 \mathcal{L}_{\mathrm{SGIR}}(T) + \lambda_2 \mathcal{L}_{\mathrm{PACR}}(T),
$$
with $\lambda_1$ and $\lambda_2$ balancing the domain alignment and regularization.
Overall, with our hierarchical adaption framework, we learn a transformation function $T: \mathbf{R}^{src} \rightarrow \mathbf{R}^{tgt},$ by minimizing the total objective function $L_{total}$, so that the model trained on $\mathbf{R}^{src}$ generalizes better to $\mathbf{R}^{tgt}$.
% achieve a hierarchical alignment strategy that balances the global alignment power of the entropic solver with safeguards that preserve internal slide structure and clinically significant patch relevance.
\subsection{Label-free Prototype Selection}
% A WSI usually contains $N>10000$ patches, resulting in extremely large feature sets $\mathbf{R}^{src}$ %\in \mathbb{R}^{N \times M}$
% and $\mathbf{R}^{tgt}$. %\in \mathbb{R}^{N' \times M}$ .
% Directly applying our framework to all patches in both domains leads to an unaffordable computational complexity. % on the order of $O(N_{src} \times N_{tgt})$.
% Instead, we cluster each slide’s patches into $k$ groups (with $k \ll N$, see ablation study for selection of $k$) at the feature level, using each cluster’s centroid as a \textbf{label-free prototype}. This approach improves the efficiency of our adaption framework while retaining slide-level information crucial for alignment.
To be computationally efficient, we cluster each slide’s patches into $k$ groups and use the clusters' centroids as label-free prototypes (see ablation for $k$-selection) before applying HASD. This strategy significantly reduces complexity while preserving crucial slide-level information for alignment. An overview of our method is illustrated in Fig \ref{Figure 2}.
% \subsubsection{Adaptation Network.}
% Our linear mapping $T_{\theta}:\mathbb{R}^M \rightarrow \mathbb{R}^M$ is trained alongside the OT-loss. Upon convergence, it is applied directly at inference time to map newly observed target slides back to source space, minimizing the impact of domain shift without revisiting the entire OT procedure.
% \subsection{Patch and slide level Regularization: Attention Consistency Regularization and Geometric Invariance Regularization}
% Relying solely on the OT-loss may align feature distributions but can risk “over-warping”\cite{OT_trend} (i.e., altering embeddings in ways that neglect clinically relevant cues). To this end, we introduce an \textbf{attention-based penalty} to preserve the aggregator's patch-level attention distributions learned on the source domain. Our key assumption is that any patch receiving great attention before transformation should continue to receive great attention after being mapped by $T$, and vice versa. Formally, we define
% % . Specifically, we penalize large deviations in attention weights for corresponding slides or regions, promoting a stable focus on the most diagnostically relevant aspects of the issue:
% $$
% \mathcal{L}_{\mathrm{att}}(\theta)
% \;=\;
% \sum_{i}^N \bigl\|Atten(T_{\theta}(r_{i}^{src})) \;-\; Atten(r_{i}^{src})\bigr\|^{2}.
% $$
% where $Atten()$ denotes the same attention mechanism used for aggregation. We thus form the total training objective as
% $$
% \mathcal{L}_{total}(\theta,\gamma) = \mathcal{L}_{OT}(\theta,\gamma) + \lambda \mathcal{L}_{\mathrm{att}}(\theta)
% $$
% with $\lambda$ balancing the OT alignment and attention consistency. Both $\lambda$ and $\theta$ are updated in alternating steps, ensuring that the adaptation layer preserves clinically meaningful attention patterns while also achieving robust cross-domain alignment.
% \subsction{Smoothness/Attention regularization}
%Illusrate how attention regularization works
% In the MIL paradigm, each slide $B$ in both source and target domains is tiled into an arbitrary number $K$ of patches to form the patches bank $B={b_k}_{k=1}^N$. Each patch bank is assigned to a label $S$ depending on the slide-level task. A prediction model $F$ is trained by taking the patches bank embeddings $Z$ as input and $S$ as supervision signal. Let $Z_src$ and $Z_tgt$ be the slides from source and target domains but sharing the same label $S$. The objective of slide-level adaption is to find the transformation $T$ so that $T(Z_src)=Z_tgt$, so that the prediction function $F_src$ could also work in the target domain.
% to map source domains $X_src$ to target domain so that the prediction model $F_src$ could also transfer to target domain $X_tgt$
% obtain slide-level prediction by taking the slide-level features
% \subsection{OT Solver and Implement Details}
% \label{subsec:ot_solver}
% In this subsection, we detail our practical approach for solving the Optimal Transport (OT) problem introduced in Section~\ref{subsec:problem-definition}.
% \paragraph{Sinkhorn--Knopp Algorithm.}
% To compute the transport plan $\mathbf{T}_{src\_tgt}$, we employ the entropic-regularized OT formulation, which can be efficiently solved using the Sinkhorn--Knopp algorithm \cite{SB}. Specifically, we minimize the following objective:
% $$
% \min_{T}
% \sum_{i=1}^{N_{\mathrm{src}}}
% \sum_{j=1}^{N_{\mathrm{tgt}}}
% T_{ij}\, c\bigl(\mathbf{r}_i^{\mathrm{src}}, \mathbf{r}_j^{\mathrm{tgt}}\bigr)
% \;+\;
% \varepsilon \sum_{i,j} T_{ij}\log(T_{ij}),
% $$
% where \(\varepsilon\) controls the strength of the entropic regularization term. This regularization stabilizes and accelerates the transport plan convergence. We iterate the Sinkhorn--Knopp updates until convergence or until a preset iteration limit is reached.
% In the method section, I have already define the problem by introducing the Multi Instance Learning setup and slide-level domain shift. Following in the second subsection, I want to 1)introduce OT problem 2)sinkhorn-knapp algorithm 3) label-free prototype selection 4) adaption network 5)
% $$
% \widehat{\mathbf{r}}_i^{\mathrm{src}}
% =
% G_{\theta}\bigl(\mathbf{r}_i^{\mathrm{src}}\bigr).
% $$
% We train \(G_{\theta}\) jointly with the OT objective by minimizing:
% $$
% \mathcal{L}_{\mathrm{OT}}(G_{\theta})
% =
% \min_{T}
% \sum_{i,j}
% T_{ij}\;
% c\Bigl(G_{\theta}\bigl(\mathbf{r}_i^{\mathrm{src}}\bigr),
% \mathbf{r}_j^{\mathrm{tgt}}\Bigr)
% \;+\;
% \varepsilon \sum_{i,j} T_{ij}\log(T_{ij}).
% $$
% Here, \(T\) and \(G_{\theta}\) are updated alternately or via a single end-to-end procedure, depending on implementation details.
% \paragraph{Attention-Based Regularization.}
% Once the OT alignment (and adaptation network, if used) is learned, we aim to map any new target-domain slide back into the source domain for classification. Denote this inverse mapping by
% $$
% \mathbf{T}^{-1}.
% $$
% In practice, \(\mathbf{T}\) may be implicitly defined by \(T\) or by the learned parameters \(\theta\). For a new embedding \(\mathbf{r}^{\mathrm{tgt}}\), we can approximate:
% $$
% \widehat{\mathbf{r}}^{\mathrm{tgt}}
% =
% \mathbf{T}^{-1}\bigl(\mathbf{r}^{\mathrm{tgt}}\bigr),
% $$
% so that the source-trained classifier \(f(\cdot)\) can be directly applied, i.e.,
% \(\hat{y} = f\bigl(\widehat{\mathbf{r}}^{\mathrm{tgt}}\bigr)\).
% If no explicit network is used, we derive \(\mathbf{T}^{-1}\) by selecting the best-matched source embeddings under \(T\), effectively relocating target samples into the source feature space. This approach preserves the classifier’s original decision boundary while reducing domain-induced feature shifts.
% We validate the robustness of our method to two slide-level tasks: \textbf{Breast cancer Her2 Grading} and \textbf{UCEC survival prediction}. We follow an \textbf{OOD} setup, ensuring that for each task at least two centers are included in the cohort to introduce real-world domain shift. Below, we describe our datasets, comparison methods, and implementation details.
\newcommand{\greenup}{\textcolor{green}{$\uparrow$}}
\newcommand{\reddown}{\textcolor{red}{$\downarrow$}}
We validate our method with two slide-level tasks across five datasets:
\subsubsection{Breast Cancer HER2 Status.}
%The HER2 status in breast cancer is typically determined via immunohistochemistry (\textbf{IHC}). However, models that predict HER2 status from hematoxylin \& eosin (\textbf{H\&E}) stained tumor slides would be beneficial in reducing costs \cite{bci}.
The prediction of the HER2 status in breast cancer from hematoxylin \& eosin (\textbf{H\&E}) stained tumor tissue is a challenging slide-level task \cite{bci}.
We use AUROC to evaluate our method on multi-institutional breast cancer slides from three centers: Yale Hospital (\textbf{Yale}, n=192) \cite{yale_her2}, The Cancer Genome Atlas (\textbf{TCGA}, n=182) \cite{tcga}, and Technical University Munich hospital (\textbf{TUM}, n=77).
% \begin{itemize}
% \item \textbf{Yale Hospital (Yale)}: 192 slides \cite{yale_her2}
% \item \textbf{The Cancer Genome Atlas (TCGA)}: 182 slides \cite{tcga}
% \item \textbf{Technical University of Munich (TUM)}: 77 slides (internal).
% \end{itemize}
% Each dataset maintains a balanced label distribution, with approximately a 1:1 ratio of low-grade to high-grade Her2 samples.
%We evaluate grading performance using Area Under the Receiver Operating Characteristic Curve (\textbf{AUROC}).
\subsubsection{UCEC Survival Prediction.} Uterine corpus endometrial carcinoma (UCEC) is a significant form of gynecological cancer \cite{ucec}. Reliable survival prediction for personalized treatment planning is limited by domain shift across different centers. To evaluate our method, we employ UCEC cases from two independent centers: \textbf{TCGA-UCEC} (n=504) and \textbf{CPTAC-UCEC} (n=205) \cite{cptac}.
% \begin{itemize}
% \item \textbf{TCGA-UCEC}: 504 cases
% \item \textbf{CPTAC-UCEC}: 205 cases\cite{cptac}
% \end{itemize}
% This cohort also presents label prevalence shifts besides the common slide variances. The survival times of patients in the TCGA cohort are significantly longer than in the CPTAC cohort (Fig. \ref{fig:km}). This setup reflects the prevalence differences across real-world pathology labels across institutions.
We use disease-specific survival (\textbf{DSS}) and the Concordance Index (\textbf{C-Index}) to evaluate performances. In this cohort, domain shift arises not only from image variances (scanners, standings, etc.) but also from\textbf{ label prevalence variances} (Fig. \ref{tsne}a), posing an additional challenge for adaptation.
We conduct the domain adaption experiments in a \textbf{cross-validation} manner: for each center, 80\% data is used to train a source-domain model, which is then evaluated on (1) the rest 20\% in-domain test splits (\textbf{ID}) or (2) the entirety (100\%) of each out-of-domain target datasets in the same cohort, completely held-out from the source training split (\textbf{OOD}, denoted as $source \rightarrow target$).
% \subsubsection{Domain Variance Analysis.}
% %Slide-level variance and label prevalence variance are two .... 引用
% In the Breast Cancer Grading cohort, the primary source of domain shift is \textbf{slide-level variance} across centers. However, in the Survival Prediction cohort, domain shift arises from slide-level variance and \textbf{label prevalence} differences. Patients in the TCGA cohort have significantly longer survival times than those in CPTAC (Fig. \ref{tsne}a), reflecting real-world institutional label prevalence differences and posing an additional challenge for adaptation.
% For all slides mentioned above, we used a modified version of the CLAM preprocessing pipeline \cite{clam} to segment and crop into patches of 256x256 px at 10x magnification. We utilized UNI model for feature extraction at the patch level. The overall count of WSI for each center in breast cancer grading task and the KM curves for both centers in survival prediction task are presented in Table 1 and Figure 3.
% Besides, for each OOD experiment, we trained 5 ABMIL models to predict slide-level labels using 5-fold cross-validation (CV) on each training data, while all the data from the test center was used for all 5 models
% \begin{minipage}{.5\linewidth}
% \begin{table}
% \begin{tabular}[.5\linewidth]{c| c |c |c}
% \caption{Label distribution of Breast Cancer Her2 Grading cohort is almost 1:1 balanced.}
% \hline
% & total& low & high\\
% \hline
% Yale & 192 & 99 & 93 \\
% TCGA & 182 & 90 & 92 \\
% TUM & 77 & 40 & 37 \\
% \hline
% All centers & 451 &229 &222\\
% \hline
% \end{tabular}
% \end{table}
% \end{minipage}\,%
% \hfill
% \begin{figure}[!htbp]
% \begin{minipage}{.5\linewidth}
% \caption{Unbalanced label distribution in survival prediction task. The patients from TCGA corhort survives much longer than CPTAC cohort, which sets challenge to adaption method.} \label{Figure 3}
% \includegraphics[width=6cm] {viz/KM_curve.png}
% \end{minipage}
% \end{figure}
% \begin{tabular}{c|c|c|c}
% \hline
% Centers & Total& HER2-Low & HER2-High\\ \hline
% Yale & 192 & 99 & 93 \\ \hline
% TCGA & 182 & 90 & 92 \\ \hline
% TUM & 77 & 40 & 37 \\ \hline
% All & 451 &229 &222\\ \hline
% \end{tabular}
% \begin{figure}[htbp]
% \centering
% % Left minipage: Table
% \begin{minipage}[t]{0.45\textwidth}
% \vspace{-10pt}
% \centering
% \captionof{table}{Label distribution of Breast Cancer Her2 Grading cohort.}
% \vspace{3pt}
% \begin{tabular}{c|c|c|c}
% \hline
% Centers & Total& Low & High\\ \hline
% Yale & 192 & 99 & 93 \\ \hline
% TCGA & 182 & 90 & 92 \\ \hline
% TUM & 77 & 40 & 37 \\ \hline
% All & 451 &229 &222\\ \hline
% \end{tabular}
% \label{tab:dist_bc}
% \end{minipage}\hfill
% % Right minipage: Figure
% \begin{minipage}[t]{0.45\textwidth}
% \vspace{-10pt}
% \centering
% \captionof{figure}{Kaplan–Meier curve of survival prediction cohort. }
% \vspace{-10pt}
% \includegraphics[width=0.8\textwidth]{viz/KM_curve.png} % Replace with your figure file
% \label{fig:km}
% \end{minipage}
% \end{figure}
% In this section, we report the results and analyze the performance of different methods in breast cancer Her2 Grading and UCEC survival prediction.
\subsection{Quantitative Evaluation}
We exhaustively compare HASD in eight OOD and five ID setups with the following four existing methods:
% In both cohorts, we qualitatively evaluated the effectiveness of our method in dealing with image variance and alleviating label prevalence problems and compared the performance with other methods across eight OOD setups (Fig. \ref{fig:radar}).
% performance across eight test settings and report the average performance in both OOD and ID (in-distribution) setups for reference (Table. \ref{results}).
(1) Attention Based Multi Instance Learning \textbf{(ABMIL)}. We include a native ABMIL approach trained on the source data and directly applied to the target data.
(2)\textbf{ Patch-level Stain Normalization.} Widely used to mitigate domain shift on patch-level. We apply the Reinhard stain normalization \cite{reinhard}, instead of Macenko due to its much higher runtime, to transform all target patches into the source domain’s color space.
(3) Multi Instance SimpleShot\textbf{ (MI-SimpleShot).} Handles domain shifts by constructing class prototypes from slide features obtained by mean pooling of patch-level features \cite{uni}.
(4)\textbf{ Supervised Contrastive Domain Adaptation (SCDA).} Builds upon MI-SimpleShot with supervised contrastive learning on the source domain to refine class prototypes \cite{enhancing1}.
% \begin{table}
% \caption{AUROC performance of Breast Cancer Her2 Grading task and C-Index performance for UCEC survival prediction tasks. %The detailed OOD performance for each setting can be found at Fig. \ref{radar}.
% We also report each method's in-distribution (ID) performance as a reference.}
% \centering
% \vspace{5pt}
% \begin{tabular}[\linewidth]{c | c c | c c}
% \hline
% {}&\multicolumn{2}{c|}{Breast Cancer Her2 Grading}&\multicolumn{2}{c}{UCEC Survival Prediction}\\
% \hline
% {Methods}&\makecell[c]{ID\\Average} & \makecell[c]{OOD\\Average}
% &\makecell[c]{ID\\Average} & \makecell[c]{OOD\\Average} \\
% \hline
% {ABMIL}&85.8&75.8&68.1&57.5\\
% {Stain Norm}&75.3&{58.3}&{}&56.3\\
% {MI-SimpleShot}&81.6&65.9&64.9&52.9\\
% {SCDA}&{82.5}&76.3&{65.3}&{54.7}\\
% \hline
% {Ours}&{}&79.6&{ }&{ 61.0}\\
% \bottomrule
% \end{tabular}
% \label{results}
% \end{table}
% \begin{figure}[htbp]
% \centering
% \includegraphics[width=0.8\textwidth]{viz/radar_2tasks.pdf}
% \caption{Our method generally outperforms other models across eight OOD setups in Her2 Grading and UCEC survival prediction, with an average gain of 3.6 (AUC) and 3.1 (C-Index) higher than the next-best method.}
% % This is placeholder figure, in final figure, there should be a integrated figure with AUC and C-Index.
% \label{radar}
% \end{figure}
\begin{figure}[htbp]
\centering
% Left minipage: Table
\begin{minipage}[t]{0.35\textwidth}
\centering
\captionof{table}{ID vs. OOD performance gap.}
%\vspace{10pt}
\begin{adjustbox}{width=1\columnwidth}
%\fontsize{6}{8}\selectfont
\begin{tabular}[\linewidth]{c c c }
\multicolumn{3}{c}{Her2 Grading Task}\\
\hline
{Methods}&\makecell[c]{ID\\Average} & \makecell[c]{OOD\\Average} \\
\hline
{MI-SimpleShot}&81.6&70.8(10.8\reddown)\\
{SCDA}&{82.5}&72.0(10.5\reddown)\\
{ABMIL}&85.8&75.8(10.0\reddown)\\
{ReinhardNorm}&{85.3}&75.3(10.0\reddown)\\
\hline
{Ours}&{\textbf{86.1}}&\textbf{79.9}(\textbf{6.2}\reddown)\\
\bottomrule
\\
\\
\multicolumn{3}{c}{Survival Prediction Task}\\
\hline
{Methods}&\makecell[c]{ID\\Average} & \makecell[c]{OOD\\Average} \\
\hline
{MI-SimpleShot}&64.9&52.9(12.0\reddown)\\
{SCDA}&{65.3}&54.7(10.6\reddown)\\
{ABMIL}&68.1&57.5(10.6\reddown)\\
{ReinhardNorm}&{\textbf{68.5}}&56.3(12.2\reddown)\\
\hline
{Ours}&{68.1}&{\textbf{61.4}(\textbf{6.7}\reddown)}\\
\bottomrule
\end{tabular}
\end{adjustbox}
\label{tab:results}
\end{minipage}\hfill
% Right minipage: Figure
\begin{minipage}[t]{0.60\textwidth}
\centering
\captionof{figure}{OOD Performances on HER2 Grading (\textcolor{red}{red}) and Survival Prediction (\textcolor{cyan}{cyan}).}
\vspace{0pt}
\includegraphics[width=1.0\textwidth]{viz/Radar_deanonymize.pdf}
\label{fig:radar}
\end{minipage}
\end{figure}
% \subsubsection{Experiment details}
% We extract the patch features of all slides using the UNI model \cite{uni} to be available for all models. We conduct the experiments with OOD setups, where a slide-level classifier is trained on the source center's training set and subsequently deployed on the target domain with or without adaptation depending on the models, denoted as $source \rightarrow target.$
% \begin{table}
% \caption{AUROC scores for breast cancer Her2 Grading task. Mean results over 3 runs. We also include ID validation for each dataset as a reference.}
% \begin{tabular}[\linewidth]{c| c c c| c c c| c c c| c c}
% \hline
% {}&\multicolumn{9}{c}{Breast Cancer Her2 Grading}\\
% \hline
% {Test Center:}&\multicolumn{3}{c|}{Yale} & \multicolumn{3}{c|}{TCGA}&\multicolumn{3}{c|}{TUM} \\
% \hline
% {}&\multicolumn{1}{c|}{ID} & \multicolumn{2}{c|}{OOD} &\multicolumn{1}{c|}{ID} & \multicolumn{2}{c|}{OOD}& \multicolumn{1}{c|}{ID} & \multicolumn{2}{c|}{OOD}& \multicolumn{1}{c}{ID}& \multicolumn{1}{|c}{OOD}\\
% {Train Center:}&\multicolumn{1}{c|}{Yale} & TCGA&TUM &\multicolumn{1}{c|}{TCGA}&Yale &TUM&\multicolumn{1}{c|}{TUM} & YALE&\multicolumn{1}{c|}{TCGA}&\multicolumn{1}{c}{\textbf{Overall}}& \multicolumn{1}{|c}{\textbf{Overall}}\\
% \hline
% {ABMIL}&91.2 & 79.9&78.7&83.6 & 69.5&71.8& 82.6 & 74.5&80.1&85.8&75.8\\
% {Stain Norm}&{}&{76.3}&{78.9}&{}&{68.8}&{71.6}&{}&{78.6}&{79.3}&{}&75.3\\
% {MI-SimpleShot}&{89.0}&70.0&76.0&74.5&58.4&63.1&{81.3}&{55.0}&{77.4}&81.6&65.9\\
% {SCDA}&{89.3}&{79.5}&{77.3}&{77.2}&{67.2}&{ 70.8}&{81.1}&{ 73.2}&{ 80.9}&{82.5}&76.3\\
% \hline
% {Ours}&{}&{ 89.5}&{ 83.2}&{}&{ 71.4}&{ 75.5}&{}&{ 80.0}&{ 81.6}&{}&79.6\\
% \bottomrule
% \end{tabular}
% \end{table} \label{tab2}
% \centering
% \begin{table}
% \caption{C-Index for UCEC survival prediction tasks. Like table \ref{tab2}, we report the mean values across three consecutive runs. }
% \begin{tabular}[\linewidth]{c| c c| c c|cc}
% \hline
% {}&\multicolumn{6}{c}{UCEC Survival Prediction}\\
% \hline
% {Test Center:}&\multicolumn{2}{c|}{TCGA} & \multicolumn{2}{c|}{CPTAC} \\
% \hline
% {Train Center:}&\makecell[c]{ID\\TCGA}&\makecell[c]{OOD\\CPTAC}&\makecell[c]{ID\\CPTAC}&\makecell[c]{OOD\\TCGA}&\makecell[c]{ID\\ \textbf{Overall}}&\makecell[c]{OOD\\ \textbf{Overall}}\\
% \hline
% {ABMIL}&67.2 & 54.5&69.0&60.5& 68.1&57.5\\
% {Stain Norm}&{}&{54.3}&{}&{58.3}&{}&56.3\\
% {MI-SimpleShot}&{60.1}&52.8&69.7&53.0&64.9&52.9\\
% {SCDA}&{60.3}&{53.1}&{69.6}&{56.3}&{65.0}&{54.7}\\
% \hline
% {Ours}&{}&{57.3}&{}&{64.6}&{ }&{61.0}\\
% \bottomrule
% \end{tabular}
% \end{table}
\subsubsection{Measuring Slide-level Domain Adaption.}
We report the performance of all evaluated methods under various OOD setups (see Fig. \ref{fig:radar}). In the HER2 Grading task, our method consistently outperforms others except for setup $TGCA \rightarrow TUM$, where stain normalization achieves the best result. Our model surpasses the next-best method by $\mathbf{6.0\%}$ \textbf{AUC in the most favorable case}, with an average improvement of $\mathbf{4.1\%}$ \textbf{across all setups}. For the Survival Prediction task, our method, enhanced by partial DAS to address label prevalence differences, consistently outperforms all baselines, achieving an average \textbf{CI improvement} $\mathbf{3.9\%}$ over the next-best method.
% Compared to the attention-aggregated methods (ABMIL, ReinhardNorm, our method), the mean-pooling aggregated methods (MI-SimpleShot and SCDA), though with a robust prototype design to deal with domain shift problem, struggle significantly in OOD scenarios, highlighting the fragility of mean-pooling aggregation under domain shift. In the HER2 grading task,
% While having a domain-robust class-prototype-based classifier system, MI-SimpleShot struggles significantly in OOD scenarios, highlighting the fragility of mean-pooling aggregation under domain shift. SCDA performs well in ID settings but proves less effective for slide-level alignment in OOD conditions.
% ABMIL performs generally better than the mean-pooling method thanks to its adaptive attention-based aggregation.
% Stain normalization improves performance only in Yale-TUM and TUM-Yale cases, suggesting that color differences contribute to the shift between these centers. However, it fails to address the variations in other setups. Our method (SLOT) consistently outperforms baselines, successfully bridging train-test distributions in a zero-shot manner.
% Our method performs much better on survival prediction tasks where label prevalence variances are involved ($4.5$ higher than the next-best method) because of the design of a partial SB solver.
%\centering
\subsubsection{ID vs. OOD Gap Robustness Analysis.}
% The performance degradation between ID to OOD of different slide-level methods is a matter of research topic and of real-world pathology clinical value. We report
% We also show the gap between ID and OOD setups via 5 different slide-level methods to align with real-work clinical concerns.
% All models exhibit performance degradation from in-domain (ID) and out-of-domain (OOD) evaluations on both tasks. Compared to Her2 Grading tasks, survival prediction suffers more severe (around 10$\%$ drop $v.s.$)
% as reflected in the gap between in-domain (ID) and out-of-domain (OOD)
% results.
Evaluating the ID vs. OOD gap is essential for assessing \textbf{domain shift robustness}. A smaller gap indicates better generalization. Table \ref{tab:results} summarizes the differences.
For HER2 Grading, MI-SimpleShot suffers the largest drop ($10.8\%$ AUC), while our method maintains the smallest gap ($6.2\%$ AUC) with the highest OOD score, demonstrating strong generalization.
In Survival Prediction, domain shift is further influenced by \textbf{label prevalence differences}. All other methods drops $> 10\%$ CI, while our method, aided by \textbf{partial DAS}, achieves the best OOD performance with a smaller gap ($6.7\%$ CI), proving its effectiveness.
% In OOD setup, we leverage a pre-trained model in the train center slides and aim to maximize the performance on test center slides. We report our experiments on two tasks with Figure \ref{Figure 4}.
%\subsubsection{Observation.}
\subsection{Ablation study} %to validate of Hierarchical components and the number of selected prototypes
We summarize the impact of hierarchical components, including DAS, PACR, and SGIR, and the number of prototypes on both slide-level tasks in Table \ref{ablation_study}. Due to GPU memory constraints, the prototype number is limited to $10$.
\newsavebox{\tablebox}
\begin{table}[t]
\centering
% \setlength{\abovecaptionskip}{0.cm}
\caption{Ablation Study for Parameter Selection. } %on the testing set of DeepLesion \cite{yan18deeplesion}.}
% \label{ablation_study}
% \begin{lrbox}{\tablebox}
% \begin{tabular}{c c c c c c c c c }
% \toprule
% \fontsize{8}{10}\selectfont
% DAS&\makecell[c]{\# Prototype\\$k$}& \makecell[c]{PACR}&\makecell[c]{SGIR} &\makecell[c]{Partial \\ DAS}& \makecell[c]{ Grading\\Average} & \makecell[c]{Survial Prediction\\Average}\\
% \hline
% $\checkmark$&1&&&&75.4&58.2\\ \hline
% $\checkmark$&5&&&&76.2(0.8\greenup)&58.6(0.4\greenup)\\ \hline
% $\checkmark$&10&&&&76.1(0.1\reddown)&59.1(0.5\greenup)\\ \hline
% $\checkmark$&10&$\checkmark$&&&79.6(3.5\greenup)&58.6(0.5\reddown)\\ \hline
% $\checkmark$&10&$\checkmark$&$\checkmark$&&79.9(0.3\greenup)&60.1(1.5\greenup)\\ \hline
% &10&$\checkmark$&$\checkmark$&$\checkmark$&-&61.4(1.3\greenup)\\
% \bottomrule
% \end{tabular}
% \end{lrbox}
% \scalebox{0.8}{\usebox{\tablebox}}
% \end{table}
\label{ablation_study}
\begin{lrbox}{\tablebox}
% \begin{tabular}{p{24mm}<{\centering}p{24mm}<{\centering}p{26mm}<{\centering}p{20mm}<{\centering}p{20mm}<{\centering}p{22mm}p{22mm}}
% \begin{tabular}{p{20mm}<{\centering}p{5mm}\<{\centering}p{10mm}\<{\centering}p{24mm}\<{\centering}p{22mm}\<{\centering}p{22mm}\<{\centering}}
\begin{tabular}{c c c c c c c c c }
\toprule
\fontsize{8}{10}\selectfont
DAS&\makecell[c]{\# Prototype\\$k$}& \makecell[c]{PACR}&\makecell[c]{SGIR} &\makecell[c]{Memory \\Usage (GB)}& \makecell[c]{ Grading\\Average} & \makecell[c]{Survial Prediction\\Average}\\
\hline
$\checkmark$&1&&&0.6&75.4&58.2\\ \hline
$\checkmark$&5&&&13.2&76.2(0.8\greenup)&58.6(0.4\greenup)\\ \hline
$\checkmark$&10&&&52.9&76.1(0.1\reddown)&59.1(0.5\greenup)\\ \hline
$\checkmark$&10&$\checkmark$&&52.9&79.6(3.5\greenup)&58.6(0.5\reddown)\\ \hline
$\checkmark$&10&$\checkmark$&$\checkmark$&53.0&79.9(0.3\greenup)&60.1(1.5\greenup)\\ \hline
Partial DAS&10&$\checkmark$&$\checkmark$&53.0&-&61.4(1.3\greenup)\\
\bottomrule
\end{tabular}
\end{lrbox}
\scalebox{0.8}{\usebox{\tablebox}}
\end{table}
\subsection{Quantitative Evaluation of Image \& Label Variance Alignment} \label{label_var}
We illustrate how our method addresses \textbf{image variances} and alleviates \textbf{label prevalence variance} in t-SNE plots (Fig. \ref{tsne}) visualizing the aggregated slide-level features in the Survival Prediction task before and after adaptation. %For clarity, we subsampled the cohort.
% the impact of unbalanced Schrödinger Bridge (SB) solvers in domain adaptation, we use t-SNE plots to visualize the distribution of aggregated slide-level features in the UCEC survival prediction task before and after adaptation. For clarity, we simplify the task by subsampling the cohort.
\begin{figure}
\begin{center}
\includegraphics[width=1\textwidth]{viz/tsne.pdf}
\end{center}
\caption{T-SNE for the Survival task. (a) The TCGA data contain more long-surviving patients than CPTAC. (b) A clear domain shift exists between centers. (c) Balanced SB solver misaligns long-surviving TCGA samples with CPTAC, leading to poor adaptation. (d) Partial SB solver allows unmatched long-survival samples to remain unaligned, preserving clinical label relevance.} \label{tsne}
% This is placeholder figure, in final figure, there should be a integrated figure with AUC and C-Index.
\end{figure}
%\subsubsection{Vision-Language empowered methods} \textbf{MI-Zero.}
% \subsection{Implementation Details}
% We extract $r \in \mathbb{R}^{1024}$ patch embeddings using the UNI model for all methods. Since MI-SimpleShot and SCDA were originally designed for \textbf{classification}, we adapted them for survival prediction by discretizing survival times into four bins and predicting hazard factors via similarity scoring.
% For our method, the adaption layer is trained for 200 epochs using Adam \cite{adam}.
% The entropic SB solver runs for 100 iterations per epoch, terminating early if the transport plan difference falls below $1e-2$ to enhance efficiency and stability.
% To deal with the label prevalence in survival prediction task, we apply the unbalanced SB solver with a relaxation factor of $0.1$.
% \subsection{Results}
% \subsection{Ablation Study}
% \subsection{Comparison with SOTA methods}
% Overall, the conclusion of this ablation is that our dataset provides a good balance of different types of
% images that leads to the best performance overall.
Domain shift is a critical problem for pathology AI as pathology data is heavily influenced by center-specific conditions. Current pathology domain adaptation methods focus on image patches rather than WSI, thus failing to capture global WSI features required in typical clinical scenarios. We, for the first time, introduced a slide-level domain adaption method HASD, which incorporates a hierarchical adaptation design to maintain multi-scale feature consistency and a prototype selection mechanism to achieve computationally efficiency. Our method outperformed conventional DA methods in two tasks (Her2 grading and Survival) by 4.1\% and 3.9\%, when models were trained and tested in different centers, while preserving in-domain performance. We believe that our research on slide-level domain adaptation will improve the generalizability of future clinical AI models.
\begin{thebibliography}{10}
\providecommand{\url}[1]{\texttt{#1}}
\providecommand{\urlprefix}{URL }
\providecommand{\doi}[1]{https://doi.org/#1}
\bibitem{enhancing1}
Carretero, I., Meseguer, P., del Amor, R., Naranjo, V.: Enhancing whole slide image classification through supervised contrastive domain adaptation. arXiv preprint arXiv:2412.04260 (2024)
\bibitem{uni}
Chen, R.J., Ding, T., Lu, M.Y., Williamson, D.F., Jaume, G., Song, A.H., Chen, B., Zhang, A., Shao, D., Shaban, M., et~al.: Towards a general-purpose foundation model for computational pathology. Nature Medicine \textbf{30}(3), 850--862 (2024)
\bibitem{sink}
Cuturi, M.: Sinkhorn distances: Lightspeed computation of optimal transport. Advances in neural information processing systems \textbf{26} (2013)
\bibitem{cptac}
Edwards, N.J., Oberti, M., Thangudu, R.R., Cai, S., McGarvey, P.B., Jacob, S., Madhavan, S., Ketchum, K.A.: The cptac data portal: a resource for cancer proteomics research. Journal of proteome research \textbf{14}(6), 2707--2713 (2015)
\bibitem{falahkheirkhah2023domain}
Falahkheirkhah, K., Lu, A., Alvarez-Melis, D., Huynh, G.: Domain adaptation using optimal transport for invariant learning using histopathology datasets. arXiv preprint arXiv:2303.02241 (2023)
\bibitem{fan2024pathmamba}
Fan, J., Lv, T., Di, Y., Li, L., Pan, X.: Pathmamba: Weakly supervised state space model for multi-class segmentation of pathology images. In: International Conference on Medical Image Computing and Computer-Assisted Intervention. pp. 500--509. Springer (2024)
\bibitem{yale_her2}
Farahmand, S., Fernandez, A.I., Ahmed, F.S., Rimm, D.L., Chuang, J.H., Reisenbichler, E., Zarringhalam, K.: Deep learning trained on hematoxylin and eosin tumor region of interest predicts her2 status and trastuzumab treatment response in her2+ breast cancer. Modern Pathology \textbf{35}(1), 44--51 (2022)
\bibitem{DANN}
Ganin, Y., Ustinova, E., Ajakan, H., Germain, P., Larochelle, H., Laviolette, F., March, M., Lempitsky, V.: Domain-adversarial training of neural networks. Journal of machine learning research \textbf{17}(59), 1--35 (2016)
\bibitem{scanner}
Ganz, J., Puget, C., Ammeling, J., Parlak, E., Kiupel, M., Bertram, C.A., Breininger, K., Klopfleisch, R., Aubreville, M.: Assessment of scanner domain shifts in deep multiple instance learning. In: BVM Workshop. pp. 137--142. Springer (2024)
\bibitem{abmil}
Ilse, M., Tomczak, J., Welling, M.: Attention-based deep multiple instance learning. In: International conference on machine learning. pp. 2127--2136. PMLR (2018)
\bibitem{unrobust}
de~Jong, E.D., Marcus, E., Teuwen, J.: Current pathology foundation models are unrobust to medical center differences. arXiv preprint arXiv:2501.18055 (2025)
\bibitem{bci}
Liu, S., Zhu, C., Xu, F., Jia, X., Shi, Z., Jin, M.: Bci: Breast cancer immunohistochemical image generation through pyramid pix2pix. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops. pp. 1815--1824 (June 2022)
\bibitem{DAUD}
Naranjo, V.: Domain adaptation for unsupervised cancer detection: An application for skin whole slides images from an interhospital dataset. In: International Conference on Medical Image Computing and Computer-Assisted Intervention. Springer (2024)
\bibitem{OT_trend}
Peyr{\'e}, G., Cuturi, M., et~al.: Computational optimal transport: With applications to data science. Foundations and Trends{\textregistered} in Machine Learning \textbf{11}(5-6), 355--607 (2019)
\bibitem{ffd}
Pocevi{\v{c}}i{\=u}t{\.e}, M., Eilertsen, G., Garvin, S., Lundstr{\"o}m, C.: Detecting domain shift in multiple instance learning for digital pathology using fr{\'e}chet domain distance. In: International Conference on Medical Image Computing and Computer-Assisted Intervention. pp. 157--167. Springer (2023)
\bibitem{reinhard}
Reinhard, E., Adhikhmin, M., Gooch, B., Shirley, P.: Color transfer between images. IEEE Computer graphics and applications \textbf{21}(5), 34--41 (2001)
\bibitem{patho_gan}
Reisenb{\"u}chler, D., Luttner, L., Schaadt, N.S., Feuerhake, F., Merhof, D.: Unsupervised latent stain adaptation for computational pathology. In: International Conference on Medical Image Computing and Computer-Assisted Intervention. pp. 755--765. Springer (2024)
\bibitem{sharma2022mani}
Sharma, Y., Syed, S., Brown, D.E.: Mani: Maximizing mutual information for nuclei cross-domain unsupervised segmentation. In: International Conference on Medical Image Computing and Computer-Assisted Intervention. pp. 345--355. Springer (2022)
\bibitem{ucec}
Somasegar, S., Bashi, A., Lang, S.M., Liao, C.I., Johnson, C., Darcy, K.M., Tian, C., Kapp, D.S., Chan, J.K.: Trends in uterine cancer mortality in the united states: a 50-year population-based analysis. Obstetrics \& Gynecology \textbf{142}(4), 978--986 (2023)
\bibitem{OT}
Thorpe, M.: Introduction to optimal transport. Notes of Course at University of Cambridge (2018)
\bibitem{wang2022classification}
Wang, P., Li, P., Li, Y., Xu, J., Jiang, M.: Classification of histopathological whole slide images based on multiple weighted semi-supervised domain adaptation. Biomedical Signal Processing and Control \textbf{73}, 103400 (2022)
\bibitem{wang2021instance}
Wang, Z., Zhu, X., Su, L., Meng, G., Zhang, J., Li, A., Wang, M.: Instance-aware feature alignment for cross-domain cell nuclei detection in histopathology images. In: Medical Image Computing and Computer Assisted Intervention--MICCAI 2021: 24th International Conference, Strasbourg, France, September 27--October 1, 2021, Proceedings, Part VIII 24. pp. 499--508. Springer (2021)
\bibitem{tcga}
Weinstein, J.N., Collisson, E.A., Mills, G.B., Shaw, K.R., Ozenberger, B.A., Ellrott, K., Shmulevich, I., Sander, C., Stuart, J.M.: The cancer genome atlas pan-cancer analysis project. Nature genetics \textbf{45}(10), 1113--1120 (2013)
\bibitem{xiong2023prior}
Xiong, Y., Liu, J., Zaripova, K., Sharifzadeh, S., Keicher, M., Navab, N.: Prior-radgraphformer: A prior-knowledge-enhanced transformer for generating radiology graphs from x-rays. In: International Conference on Medical Image Computing and Computer-Assisted Intervention. pp. 54--63. Springer (2023)
\bibitem{xu2023multimodal}
Xu, Y., Chen, H.: Multimodal optimal transport-based co-attention transformer with global structure consistency for survival prediction. In: Proceedings of the IEEE/CVF international conference on computer vision. pp. 21241--21251 (2023)
\bibitem{xu2025nerf}
Xu, Z., Li, H., Sun, D., Li, Z., Li, Y., Kong, Q., Cheng, Z., Navab, N., Zhou, S.K.: Nerf-based cbct reconstruction needs normalization and initialization. arXiv preprint arXiv:2506.19742 (2025)
\bibitem{yeaton2022hierarchical}
Yeaton, A., Krishnan, R.G., Mieloszyk, R., Alvarez-Melis, D., Huynh, G.: Hierarchical optimal transport for comparing histopathology datasets. arXiv preprint arXiv:2204.08324 (2022)
\bibitem{yin2024histosyn}
Yin, C., Liu, S., Wong, V.W.S., Yuen, P.C.: Histosyn: Histomorphology-focused pathology image synthesis. In: International Conference on Medical Image Computing and Computer-Assisted Intervention. pp. 200--210. Springer (2024)
\end{thebibliography}