How to Efficiently Adapt Large Segmentation Model(SAM) to Medical Images

Xinrong Hu, Xiaowei Xu, Yiyu ShiarXiv 2023 · DOI

Abstract

The Segment Anything Model (SAM) has demonstrated remarkable zero-shot performance on natural images but faces significant challenges when applied to the medical domain. This paper introduces an efficient adaptation strategy by freezing SAM's massive image encoder and adding lightweight, prompt-free prediction heads. Our results show that this approach allows SAM to outperform traditional models like UNet, particularly in low-data regimes, achieving superior performance with as little as a single labeled medical volume.

The Challenge: SAM's Medical Blind Spot

While SAM has revolutionized general image segmentation, its performance on medical imaging (MRI, CT, Ultrasound) is often suboptimal. This "medical blind spot" stems from the stark differences in contrast, noise, and texture between the natural images in SAM's training set and clinical scans. Furthermore, medical objects frequently possess ambiguous boundaries that require domain-specific expertise to delineate.

Beyond accuracy, a significant usability gap exists. SAM's reliance on manual prompts (clicks or bounding boxes) is impractical in high-throughput clinical workflows where segmenting multiple organs across 3D volumes is required.

t-SNE visualization of the domain shift between natural and medical image embeddings.

As shown in Figure 1, t-SNE plots of image embeddings reveal that medical datasets (like ACDC and Synapse) occupy distinct clusters far removed from natural image datasets (COCO and ADE20K). This visualization confirms the significant domain shift that hinders SAM's out-of-the-box utility for medicine.

Methodology: The "Freeze-and-Adapt" Strategy

To address these issues without the prohibitive cost of full retraining, the researchers propose a "freeze-and-adapt" strategy. By freezing the weights of the SAM image encoder, the model retains its powerful feature extraction capabilities learned from millions of natural images while drastically reducing the number of parameters that need to be updated.

The study explored three distinct prompt-free prediction heads to replace SAM’s original mask decoder:

  1. AutoSAM (ViT Head): A modified version of SAM’s decoder that removes prompt token requirements and enables multi-class segmentation in a single pass.
  2. CNN Head: A standard convolutional decoder that up-samples SAM’s embeddings to full resolution, similar to the expansive path of a UNet.
  3. Linear Head: A minimal layer used to establish a baseline for the information content inherent in the frozen embeddings.

Key Results and Insights

The adaptation strategy proves highly effective, especially in "few-shot" scenarios where labeled data is scarce.

  • Few-Shot Superiority: With only one labeled volume, AutoSAM achieved a Dice score of 39.32%, nearly doubling the performance of a standard UNet (17.55%).
  • Scaling Performance: With five labeled volumes, the CNN-based head reached a Dice score of 67.21%, significantly outpacing the UNet's 51.83%.
  • Automatic vs. Manual: AutoSAM outperformed the original SAM even when the latter was provided with manual bounding boxes (~31% Dice), highlighting that domain-specific fine-tuning is more critical than interactive prompting.
Qualitative comparison of segmentation results across different models on cardiac MRI.

Figure 6 illustrates these qualitative differences. While the original SAM with boxes struggles with cardiac structures, the adapted models (AutoSAM and Encoder+CNN) produce masks that closely align with the ground truth labels, even outperforming the traditional UNet baseline.

Conclusion

Efficiently adapting SAM by freezing its encoder and adding lightweight heads provides a powerful path forward for medical image segmentation. This approach bridges the domain gap and eliminates the need for manual prompting, making large foundation models viable for clinical use even with limited labeled data. Future work should expand these tests to diverse modalities like CT and ultrasound to further validate generalizability.

Summary updated

BibTeX
@misc{hu2023how,
  author = {Xinrong Hu and Xiaowei Xu and Yiyu Shi},
  title = {{How to Efficiently Adapt Large Segmentation Model(SAM) to Medical Images}},
  year = {2023},
  eprint = {2306.13731},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.13731},
}
Figure