ICL-SAM: Synergizing In-context Learning Model and SAM in Medical Image Segmentation

Jiesi Hu, Yang Shang, Yanwu Yang, Xutao Guo, Hanyang Peng, Ting MaMIDL 2024

TL;DR

This paper introduces ICL-SAM, a novel method that combines the domain adaptation capabilities of In-Context Learning (ICL) models with the powerful segmentation abilities of the Segment Anything Model (SAM). By using ICL to generate prompts for SAM and incorporating a semantic confidence map, ICL-SAM significantly boosts medical image segmentation accuracy, especially in low-data scenarios.

What Problem Does This Paper Address?

Medical image segmentation is crucial for diagnosis and treatment planning, but it faces a major hurdle: domain shift. This means models trained on one type of medical image (e.g., MRI from one hospital) often perform poorly on images from different sources, modalities, or even different patient populations. While In-Context Learning (ICL) models like UniverSeg have shown promise in adapting to new domains with just a few example image-label pairs, their performance can still be suboptimal, particularly with very limited examples. On the other hand, the Segment Anything Model (SAM) is a powerful general-purpose segmentation tool, but it typically requires manual prompts (like bounding boxes or points) for each image, which is impractical for large-scale medical applications. This paper aims to bridge this gap by creating a more robust and automated medical image segmentation system that leverages the strengths of both ICL and SAM.

Methods

The core of ICL-SAM is a synergistic integration of ICL and SAM. Here's how it works:

  • ICL for Prompt Generation: Instead of relying on manual prompts, the ICL model (specifically, UniverSeg is used as a baseline) first generates an initial segmentation mask for a query image. This mask is then used to derive bounding box prompts.
  • SAM for Refinement: These generated bounding box prompts are fed into the SAM model. SAM then produces a refined and more accurate segmentation mask.
  • Semantic Confidence Map: A key innovation is the generation of a "semantic confidence map." This map, derived from SAM's feature maps, highlights regions of high semantic importance. This map is then used in two ways:
  • Enhancing SAM: It's incorporated into SAM's decoder to guide its attention towards foreground regions, improving its segmentation even when the initial bounding box prompt is imperfect.
  • Enhancing ICL: It's also integrated into the ICL model's decoder as spatial attention, helping the ICL model produce better initial segmentations.
  • Fusion: The final segmentation output is a fusion of the refined results from both the ICL and SAM components, weighted by a dynamically adjusted factor that considers the number of support examples.

Datasets

The proposed ICL-SAM method was evaluated on a diverse set of medical imaging datasets across different modalities and tasks:

  • Fundus Images: Datasets from the REFUGE challenge, RIM-ONE-r3, and Drishti-GS were used for optic disc and cup segmentation.
  • Brain MRI: The BraTS2020 dataset was used for whole tumor segmentation across T1, T1ce, T2, and FLAIR modalities.
  • Kidney CT: The Kits23 dataset was used for combined segmentation of kidney and tumor.

These datasets were split into meta support sets and query sets, and the experiments involved varying the number of support examples (from 1 to 64) to assess performance in few-shot scenarios.

Key Insights and Ideas

  • Synergy is Key: The paper demonstrates that combining the domain adaptation of ICL with the powerful segmentation of SAM yields superior results compared to either model alone.
  • Automated Prompting: Eliminating manual prompt engineering for SAM by using the ICL model's output is a crucial step towards making SAM practical for medical imaging.
  • Confidence Maps as Guides: The semantic confidence map is a powerful tool that significantly boosts performance by providing explicit semantic guidance to both the ICL and SAM components. It helps focus attention on relevant regions.
  • Few-Shot Performance Boost: The most significant gains are observed in scenarios with very few support examples, highlighting the method's effectiveness in data-scarce medical imaging settings.

Key Results

ICL-SAM achieved significant performance improvements across various medical imaging tasks and datasets.

  • Dice Coefficient: In few-shot scenarios (e.g., with only one support pair), ICL-SAM achieved an improvement of over 10% in the absolute Dice coefficient compared to state-of-the-art ICL models like UniverSeg.
  • Efficiency: For the Fundus and Kits23 datasets, ICL-SAM with just 16 support instances achieved performance comparable to UniverSeg with 64 support instances, indicating a substantial reduction in annotation burden.
  • Ablation Studies: The ablation study confirmed that both the integration of SAM and the use of the semantic confidence map individually contribute to performance gains. The "Fusion" approach (combining ICL and SAM with confidence maps) generally yielded the highest results.
  • Qualitative Improvements: Visualizations showed that ICL-SAM could refine coarse or incomplete segmentations from the ICL model into more accurate and complete masks.

Limitations and Future Work

  • Dependence on ICL Quality: The performance of ICL-SAM is still somewhat dependent on the initial segmentation quality of the ICL model. If the ICL model completely misses the target, SAM may struggle to produce accurate results. This gap between ICL-SAM and the upper bound (SAM+GT) suggests room for improvement.
  • Hyperparameter Tuning: While the paper presents a hyperparameter sensitivity analysis, the optimal values (α, b, τ, β) were determined through testing and applied across datasets. Further research could explore more adaptive or automated hyperparameter selection.
  • Future Directions: The authors suggest that this framework has significant potential for future enhancements within the in-context learning paradigm, hinting at further exploration of model combinations and confidence map utilization.

Summary updated

BibTeX
@inproceedings{hu2024icl,
  author = {Jiesi Hu and Yang Shang and Yanwu Yang and Xutao Guo and Hanyang Peng and Ting Ma},
  title = {{ICL-SAM: Synergizing In-context Learning Model and SAM in Medical Image Segmentation}},
  booktitle = {MIDL},
  year = {2024},
  url = {https://openreview.net/forum?id=ZRS6jWrBAc},
}
Figure