NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

All Centers Are at most a Few Tokens Apart: Knowledge Distillation with Domain Invariant Prompt Tuning

Amir Mohammad Ezzati, Alireza Malekhosseini, Armin Khosravi, Mohammad Hossein RohbanarXiv 2025 · DOI

Introduction

In computational pathology (CPath), "domain shift" remains a significant barrier to the clinical deployment of AI. A model trained on biopsies from one hospital often fails when applied to another due to variations in scanners, staining protocols, and tissue preparation. While Vision-Language Models (VLMs) like CLIP offer a path forward, they are highly sensitive to prompting. In pathology, where semantic domain labels (like "sketch" or "oil painting") are absent, creating generic prompts that generalize across clinical centers is a major challenge.

Researchers have introduced Domain Invariant Prompt Tuning (DIPT) to address this. By learning a small set of domain-specific tokens for each center and distilling this knowledge into a student model, DIPT enables robust generalization to unseen medical data.

Methodology

The DIPT framework operates in two distinct stages to bridge the gap between disparate clinical domains.

Stage 1: Domain-Specific Prompt Learning

Instead of relying on manually crafted prompts, the system learns them. For each training domain (e.g., a specific hospital), the model learns a set of "continuous tokens"—mathematical vectors that capture the unique stylistic characteristics of that center. These are concatenated with fixed, class-generic tokens.

Stage 1 of the DIPT framework: Learning domain-specific prompts through a dual-loss approach.

As shown in Figure 1, the optimization uses a dual-loss approach. The discriminative loss ($L_{DS}$) ensures prompts can accurately identify classes within a specific domain, while the linguistic loss ($L_G$) prevents the learned prompts from deviating too far from general linguistic knowledge, preserving the semantic integrity of the VLM.

Stage 2: Knowledge Distillation (KD)

Following the learning phase, domain-specific prompts are averaged across all training centers to create a Domain-Invariant Embedding. This embedding serves as a "gold standard" representation that filters out hospital-specific noise. A smaller, more efficient "student" model (such as a ResNet-50) is then trained to align its visual features with these invariant text embeddings, effectively distilling the robust knowledge of the large VLM into a portable architecture.

Experimental Evaluation

The method was evaluated on two primary histopathology benchmarks:

  • Camelyon17-WILDS: A dataset featuring tissue patches from five different hospitals, specifically focusing on breast cancer metastases in lymph nodes. This serves as a rigorous "out-of-distribution" test.
  • Kather19: A collection of colorectal tissue patches from three centers, encompassing nine distinct tissue types.

Key Results and Insights

The core philosophy of DIPT is that the differences between clinical centers are not fundamental biological changes but rather "style" shifts that can be captured by a few learnable tokens. By using text as an anchor—since the concept of "cancer" remains constant even when visual features vary—the model learns features resistant to scanner-induced noise.

Performance comparison on the Camelyon17-WILDS dataset, highlighting improvements in mean and worst-case accuracy.

As detailed in the results for Camelyon17-WILDS (Figure 4), DIPT demonstrated substantial gains over existing state-of-the-art (SOTA) methods:

  • Robustness: The method improved accuracy by up to 6.43% over standard baselines in specific centers.
  • Reliability: Crucially, the worst-case F1-score (performance on the most challenging hospital) saw an improvement of 6.05%, indicating significantly higher reliability in real-world, multi-center scenarios.
  • Versatility: These improvements were consistent across different student architectures, including both traditional CNNs (ResNet-50) and modern Vision Transformers (ViT).

Discussion and Future Work

While DIPT represents a significant step forward, it is not without limitations. The method's performance is inherently tied to the quality of the underlying teacher VLM (e.g., PLIP). Furthermore, the "averaging" strategy is most effective when multiple source domains are available; its utility may decrease if training data is limited to only one or two centers.

Future research may explore extending this domain-invariant approach to more complex tasks such as image segmentation or survival prediction, where domain shift continues to pose a significant challenge to clinical AI adoption.

Summary updated

BibTeX
@misc{ezzati2025all,
  author = {Amir Mohammad Ezzati and Alireza Malekhosseini and Armin Khosravi and Mohammad Hossein Rohban},
  title = {{All Centers Are at most a Few Tokens Apart: Knowledge Distillation with Domain Invariant Prompt Tuning}},
  year = {2025},
  eprint = {2511.22739},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.22739},
}
Figure