Abstract
Medical image segmentation models often struggle with domain shifts caused by variations in scanner hardware and acquisition protocols. This study evaluates the robustness of foundation models, specifically MedSAM, against traditional architectures pre-trained on ImageNet. We demonstrate that foundation models exhibit superior generalization across diverse medical modalities. Furthermore, we introduce a novel post-hoc Bayesian uncertainty estimator that accurately predicts out-of-distribution (OOD) performance using only unlabeled data, significantly outperforming existing metrics from the natural image domain.
Introduction
In clinical settings, "domain shift" remains a significant barrier to the reliable deployment of deep learning models. A segmentation model optimized for MRI scans at one institution may fail when applied to scans from another due to differences in demographics or scanner manufacturers. This Out-of-Distribution (OOD) problem necessitates models that are inherently robust and methods that can estimate performance drops without requiring manual labeling of new datasets.
While foundation models—large-scale models pre-trained on vast, diverse datasets—have revolutionized natural language processing and computer vision, their robustness in the high-stakes context of medical segmentation is not yet fully characterized. This research benchmarks these models and proposes a reliable indicator for their OOD performance.
Methodology
Robustness Benchmarking
The study compares MedSAM (a medical-specific adaptation of the Segment Anything Model) against standard architectures including UNet, UNet++, and TransUNet. While the latter are typically pre-trained on ImageNet, MedSAM leverages extensive pre-training on medical data, potentially capturing more universal anatomical features.
Bayesian Uncertainty Estimation
To predict performance on unlabeled OOD data, the authors developed a post-hoc uncertainty estimator, $\delta$. Unlike standard methods that rely solely on the predicted mask ($\hat{y}$), this estimator incorporates both the input image ($x$) and the predicted mask.
Key technical innovations include:
- Generalized Gaussian Distribution (GGD): Used to model uncertainty, GGD better accounts for the heavy-tailed noise and artifacts prevalent in medical imaging compared to standard Gaussian distributions.
- Otsu’s Thresholding: Instead of global averaging, the method applies Otsu’s thresholding to isolate the most uncertain pixel clusters, which serves as a more sensitive indicator of model failure.
Experimental Setup
The models were evaluated across three distinct medical modalities to ensure the generalizability of the findings:
- Prostate Segmentation: 3D MRI data from four sources (BMC, BIDMC, RUNMC, and HK).
- Diabetic Retinopathy (DR) Lesion Segmentation: 2D Fundus images (FGADR and IDRiD).
- Liver Segmentation: 3D CT scans (FLARE and LiTS).
Key Results and Discussion
Superior Generalization of Foundation Models
Foundation models demonstrated a clear advantage in robustness. In a cross-domain prostate segmentation task (BIDMC $\to$ BMC), MedSAM achieved a 5.7% IoU increase, whereas a standard UNet (ResNet50) experienced a catastrophic 44.4% performance drop. Across nearly all tests, MedSAM maintained higher Dice scores and lower degradation than ImageNet-based counterparts.
Failure of Natural Image Metrics
Common OOD indicators used in computer vision, such as "accuracy on the line" (which assumes linear correlation between in-distribution and OOD performance), showed poor Pearson correlation in medical tasks. This highlights the necessity of domain-specific uncertainty quantification.
Enhanced Error Prediction
The proposed Bayesian uncertainty method achieved the lowest Mean Squared Error (MSE) in predicting actual segmentation errors. For instance, in the BMC $\to$ RUNMC task, the method reached an MSE of 0.012, outperforming baselines like BayesCap (0.015) and Test-Time Data Augmentation (0.247).
Conclusion
Foundation models like MedSAM represent a significant step forward for robust medical image segmentation. By combining these models with the proposed Bayesian uncertainty estimator, practitioners can better predict when a model is likely to fail in a new clinical environment. Future work will explore integrating these uncertainty signals into active learning loops to streamline human-in-the-loop review processes.
Summary updated