Abstract
Out-of-distribution (OOD) generalization, especially for medical setups, is a key challenge in modern machine learning which has only recently received much attention. We investigate how different convolutional pre-trained models perform on OOD test data—that is data from domains that have not been seen during training—on histopathology repositories attributed to different trial sites. Different trial site repositories, pre-trained models, and image transformations are examined as specific aspects of pre-trained models. A comparison is also performed among models trained entirely from scratch (i.e., without pre-training) and models already pre-trained. The OOD performance of pre-trained models on natural images, i.e., (1) vanilla pre-trained ImageNet, (2) semi-supervised learning (SSL), and (3) semi-weakly-supervised learning (SWSL) models pre-trained on IG-1B-Targeted are examined in this study. In addition, the performance of a histopathology model (i.e., KimiaNet) trained on the most comprehensive histopathology dataset, i.e., TCGA, has also been studied. Although the performance of SSL and SWSL pre-trained models are conducive to better OOD performance in comparison to the vanilla ImageNet pre-trained model, the histopathology pre-trained model is still the best in overall. In terms of top-1 accuracy, we demonstrate that diversifying the images in the training using reasonable image transformations is effective to avoid learning shortcuts when the distribution shift is significant. In addition, XAI techniques—which aim to achieve high-quality human-understandable explanations of AI decisions—are leveraged for further investigations.
Introduction: The Challenge of Domain Shift
In medical AI, a model that performs perfectly in one hospital often fails when deployed in another. This is the "Out-of-Distribution" (OOD) generalization problem, frequently caused by domain shift: differences in tissue preparation, staining protocols, or scanning hardware between sites.
This study specifically tackles shortcut learning, where a neural network achieves high accuracy by latching onto "easy" but irrelevant features (like a specific stain color or background texture) instead of the actual biological markers of disease. When the model encounters a new hospital where those shortcuts don't exist, its performance collapses.
Methods and Experimental Design
The researchers conducted a systematic comparison using a "leave-one-hospital-out" cross-validation strategy on the CAMELYON17 dataset, which contains 1,000 Whole Slide Images (WSIs) from five different medical centers. They evaluated several pre-training regimes:
- Vanilla ImageNet: Standard supervised pre-training on natural images.
- SSL & SWSL: Semi-supervised and Semi-weakly-supervised models trained on massive datasets (up to 940 million images).
- KimiaNet: A domain-specific model pre-trained on the TCGA (The Cancer Genome Atlas) histopathology dataset.
These models were tested under three training scenarios: raw images (Scenario 1), fixed-policy augmentations like HED jitter for stain invariance (Scenario 2), and intentional shortcut injection via overlaid digits (Scenario 3). Finally, GradCAM was used to visualize the decision-making process of the models.
Key Insights
Domain-Specific Pre-training vs. Scale
Even though SWSL models are trained on nearly a billion natural images, KimiaNet (trained on histopathology) generally performed best. This suggests that the unique textures and structures of cells are more important than sheer data volume from unrelated domains. KimiaNet reached an average OOD top-1 accuracy of approximately 98.1% when fine-tuned with augmentations.
The "In-Distribution" Trap
Improving performance on the training hospital data sometimes decreased performance on unseen hospitals. High accuracy is not a proxy for robustness; it can actually be a sign that the model is over-fitting to local shortcuts. Models trained from scratch performed significantly worse on unseen hospitals than any pre-trained model, confirming that pre-training provides a necessary anchor against hospital-specific noise.
Augmentation as a Shortcut-Breaker
Scenario 2 (diversifying images) was effective at forcing models to learn semantic features (like cell morphology) rather than non-semantic ones (like stain color). GradCAM heatmaps showed that models trained with augmentations correctly focused on tumor cells and immune cells, whereas Scenario 1 models often focused on irrelevant fibrous tissue or background artifacts.
Conclusion
This research demonstrates that while massive-scale general pre-training helps, a domain-specific model and strategic data augmentation are the most effective tools for overcoming shortcut learning and hospital-to-hospital variability. Future work should explore more advanced domain generalization algorithms and quantitative metrics for explainability to further bridge the OOD gap in clinical settings.
Summary updated