Papers
Topics
Authors
Recent
Search
2000 character limit reached

Multi-Teacher Contrastive Distillation for Edge-Efficient Pathology Foundation Models

Published 6 Jul 2026 in cs.CV | (2607.05533v1)

Abstract: Computational pathology foundation models (PFMs) have advanced whole-slide image analysis. However, their size and inference cost hinder local deployment in pathology departments. We propose MuCoDi, a pretraining framework that distills frozen tile embeddings from multiple PFMs into compact edge-oriented encoders. Instead of regressing individual teacher features, MuCoDi trains lightweight MobileOne and RepViT students with a contrastive distillation objective adapted from MoCo v3, where cached Virchow2, UNI2, and H-Optimus-1 embeddings replace momentum-encoder keys. We pretrain students on 14.3M TCGA tiles from only 11.8K WSIs and evaluate frozen encoders on 23 clinically curated downstream classification tasks. RepViT-based MuCoEdge students retain near-teacher performance while reducing model size by orders of magnitude: MuCoEdge-R2.3 and MuCoEdge-R1.5 reach 71.0% external AUROC, within 0.8 percentage points of the best teacher (Virchow2, 71.8%), while MuCoEdge-R2.3 obtains the best external F1 and the second-best AUPRC (51.8% and 53.3%). MuCoEdge-R1.0 reaches 70.9% AUROC with only 6.4M parameters and 1.12 GFLOPs. On a Raspberry Pi 5, sub-million-parameter MobileOne students achieve up to 605-fold single-tile speedup over Virchow2 while retaining 66.5% to 66.9% external AUROC, demonstrating that PFM-quality pathology representations can be moved toward practical edge deployment. Code is available at https://anonymous.4open.science/r/mucodi-6243.

Summary

  • The paper introduces MuCoDi, a method that distills diverse teacher representations into compact student models for efficient edge pathology deployment.
  • The approach leverages a multi-teacher contrastive objective with precomputed embeddings, reducing data requirements and achieving an AUROC gap of less than 0.8% compared to teachers.
  • MuCoDi models deliver dramatic speedup (up to 605× on Raspberry Pi 5) and parameter efficiency, enabling real-time pathology inference on low-cost hardware.

Multi-Teacher Contrastive Distillation for Edge-Efficient Pathology Foundation Models

Motivation and Background

The deployment of computational pathology foundation models (PFMs) in real-world clinical workflows has been fundamentally constrained by their considerable memory footprint, high inference cost, and reliance on specialized hardware. Large vision transformer-based PFMs, while achieving state-of-the-art performance for histopathologic whole-slide image (WSI) analysis, demand dedicated GPUs and high-power compute, which are typically inaccessible in frontline pathology departments. To bridge this gap, direct edge deployment—embedding models within the existing departmental infrastructure or microscope-attached devices—has become a pressing requirement for practical AI integration in pathology.

Prior studies, such as LitePath and open-source low-cost microscopy platforms, have highlighted the potential of distilled, parameter-efficient architectures for clinical use. However, existing approaches primarily rely on standard vision transformers and do not fully exploit complementary teacher representations or explicitly optimize for edge hardware constraints.

Methodological Contributions

MuCoDi (Multi-Teacher Contrastive Distillation) introduces a pretraining strategy that distills diverse, morphology-aware feature representations from multiple large PFMs into compact student encoders specifically engineered for efficient edge inference. The key methodological innovation is the use of a multi-teacher contrastive objective inspired by MoCo v3, in which student encoders—based on MobileOne and RepViT backbones—learn to match the relational structure of teacher embedding spaces, rather than regressing individual teacher feature vectors. This approach preserves information distributed across multiple teacher models (Virchow2, UNI2, H-Optimus-1).

The distillation pipeline operates on a set of 14.3M tiles derived from only 11.8K TCGA WSIs, substantially reducing the scale of pretraining data relative to prior art. Teacher model tile embeddings are precomputed and cached, allowing the student to access these as fixed keys during training. For each training example, two random augmentations are encoded via the student, projected into the teacher-specific space, and compared to the cached teacher embedding using an InfoNCE contrastive loss. The student network and projection heads are optimized conjointly.

Training is performed using mixed precision on large batches distributed across four GPUs. The augmentation and loss formulation are closely aligned with contemporary self-supervised vision transformer pretraining, with careful temperature scaling for stable optimization.

Experimental Design and Evaluation

Performance and efficiency are jointly benchmarked on comprehensive weakly supervised downstream classification tasks. Students are pretrained without labels and evaluated by extracting frozen tile embeddings—which serve as input to downstream slide-level multiple-instance learning (MIL) classifiers. The protocol includes 23 distinct binary endpoints spanning breast, colon, brain, kidney, lung, and uterine carcinomas. The primary test sets are TCGA (internal) and matched CPTAC (external) cohorts, with performance measured as AUROC, F1, and AUPRC.

Crucially, edge inference efficiency is quantified on a Raspberry Pi 5, providing concrete empirical evidence of real-world deployability. This involves measuring single-tile inference latency and speedup over PFMs such as Virchow2, with all models executed in single-threaded float32 mode and batch size 1.

Results

Performance:

RepViT-based MuCoEdge student models demonstrate minimal external AUROC loss relative to their teacher PFMs. Specifically, MuCoEdge-R2.3 and MuCoEdge-R1.5 attain 71.0% external AUROC on CPTAC, within 0.8 percentage points of the strongest teacher (Virchow2, 71.8%), along with competitive external F1 and AUPRC (up to 51.8% and 53.3%, respectively). MuCoEdge-R1.0 achieves 70.9% AUROC with only 6.4M parameters and 1.12 GFLOPs, underscoring the parameter-efficiency of the approach.

Efficiency:

MuCoEdge models, particularly the sub-million-parameter MobileOne variants, deliver dramatic latency reductions. On Raspberry Pi 5, these student models exhibit up to 605× single-tile speedup over Virchow2 while retaining 66.5–66.9% external AUROC. Notably, MuCoEdge-R0.9 surpasses LiteFM-L across all external metrics while using 18× fewer parameters and 21× fewer GFLOPs, and running 12.9× faster. Even the most compact MobileOne-Mμ0 (0.2M parameters) retains considerable discriminative power with only a moderate drop in external AUROC.

Sample and Data Efficiency:

Models achieve these results using only 11.8K WSIs for distillation—an order of magnitude less than LiteFM and over 260× less than Virchow2—demonstrating high data efficiency. Unlike LiteFM, MuCoDi excludes CPTAC data from pretraining, highlighting robust generalization.

Theoretical and Practical Implications

MuCoDi empirically validates that multi-teacher contrastive distillation is effective for transferring complementary, multi-source pathology information into resource-constrained student models. This framework moves the field closer to practical, privacy-preserving edge deployment by enabling PFM-quality morphological representations to execute on ubiquitous, low-cost hardware without reliance on external servers or specialized GPUs.

From a technical perspective, this approach delineates a trade-off surface spanning model size, inference cost, and predictive accuracy, enabling clinics to prioritize latency or discriminative power in accordance with their operational context. The substantial compression rates in both parameters and FLOPs illuminate the scope for further model architecture co-design with downstream hardware.

MuCoDi's open-source release, precomputed teacher feature sharing, and detailed latency benchmarking lower the barrier for the broader community to experiment with efficient, foundational pathology models in decentralized settings.

Future Directions

Several avenues remain for continued research. Extending MuCoDi’s framework to broader disease spectrums, alternative tissue modalities, and domain-adaptive multi-resolution tiles may further enhance utility. Integrating dynamic patch selection during inference, on-the-fly quantization, or hardware-specific optimization could further lower inference costs. Downstream, pairing such compact representations with local explainability or uncertainty quantification would be beneficial for regulatory and clinical acceptance. Finally, closing the modest residual performance gap between the most efficient students and their teacher PFMs remains an open frontier, possibly addressable via more sophisticated contrastive objectives or richer teacher ensembles.

Conclusion

MuCoDi demonstrates that multi-teacher contrastive distillation can produce compact pathology encoders that closely match PFM performance while enabling practical edge deployment. By achieving high AUROC and latency gains on commodity hardware, MuCoDi enables the integration of high-quality, privacy-preserving AI support directly within pathology workflows. This paradigm shift has the potential to accelerate widespread clinical adoption of computational pathology, especially in settings with limited computational infrastructure.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.