Sam2Rad: A segmentation model for medical images with learnable prompts

The Segment Anything Model and its variants, such as MedSAM, have demonstrated potential for medical image segmentation. However, they heavily rely on high-quality manual prompts, which are both time-consuming and require domain expertise. Even when using manual prompts, including sparse prompts like boxes, points, or text, and dense prompts such as masks, SAM and its variants like MedSAM (fine-tuned on medical images) fail to segment bones in ultrasound images due to significant domain shift. To address these limitations, we propose Sam2 for Radiology (Sam2Rad), a framework that extends SAM and its recent iteration SAM2 to segment bony regions in ultrasound images without requiring manual prompts. At the core of our approach is a Prompt Predictor Network (PPN) that uses a lightweight cross-attention mechanism to generate bounding box coordinates, mask prompts, and high-dimensional embeddings to be used as prompts. Specifically, PPN leverages hierarchical feature maps extracted from SAM's image encoder as keys and values, and learnable object embeddings as queries. The output of the cross-attention is then used to predict the bounding box coordinates, mask prompts, and high-dimensional prompts. These predicted prompts are subsequently fed to SAM's mask decoder to generate the final segmentation mask. By aligning the learned prompts with SAM's original training scheme, PPN enhances compatibility with SAM's architecture, requiring no additional standalone encoders. To preserve SAM's extensive world knowledge, we keep all SAM modules frozen and train PPN only. This approach enables efficient parameter utilization while retaining SAM's generalization capabilities. Additionally, Sam2Rad can operate in three modes: fully autonomous without human supervision, semi-autonomous with human-in-the-loop for iterative refinement, and fully manual for tasks like data labeling. We tested the proposed model - Sam2Rad on 3 musculoskeletal US datasets - wrist (3822 images), shoulder rotator cuff (1605 images), and hip (4849 images). Without Sam2Rad, all SAM2 variants failed to segment shoulder US in zero-shot generalization with bounding box prompts. Our model, Sam2Rad, improved the performance of all SAM base networks in all datasets, without requiring manual prompts. The improvement in dice score ranged from a 2.2%-5.8% for hip, 19.6%-32.8% for wrist wrist, and up to 51.3% improvement in Dice score (from 25.2% to 76.5% Sam2 large) on shoulder data. Notably, Sam2Rad could be trained with as few as 10 labeled images and it is compatible with any SAM architecture. The code is available at https://github.com/aswahd/SamRadiology.

Authors

Institutions

Publication Details

Journal
Computers in Biology and Medicine
Published
2025-02-05
DOI
https://doi.org/10.1016/j.compbiomed.2025.109725
Citations
6
Primary Topic
AI in cancer detection
Type
article
Field-Weighted Citation Impact
14.89
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Sam2Rad: A segmentation model for medical images with learnable prompts

Yuyue Zhou, Angela McArthur, Shrimanti Ghosh, Jacob L. Jaremko et al.
6 citations
Computers in Biology and Medicine
AI in cancer detection
14.89
article

Sam2Rad: A segmentation model for medical images with learnable prompts

Yuyue Zhou, Angela McArthur, Shrimanti Ghosh, Jacob L. Jaremko, Banafshe Felfeliyan, Abhilash Rakkunedeth Hareendranathan, Assefa Seyoum Wahd, Jiechen Zhang
article en
6 citations

Abstract

The Segment Anything Model and its variants, such as MedSAM, have demonstrated potential for medical image segmentation. However, they heavily rely on high-quality manual prompts, which are both time-consuming and require domain expertise. Even when using manual prompts, including sparse prompts like boxes, points, or text, and dense prompts such as masks, SAM and its variants like MedSAM (fine-tuned on medical images) fail to segment bones in ultrasound images due to significant domain shift. To address these limitations, we propose Sam2 for Radiology (Sam2Rad), a framework that extends SAM and its recent iteration SAM2 to segment bony regions in ultrasound images without requiring manual prompts. At the core of our approach is a Prompt Predictor Network (PPN) that uses a lightweight cross-attention mechanism to generate bounding box coordinates, mask prompts, and high-dimensional embeddings to be used as prompts. Specifically, PPN leverages hierarchical feature maps extracted from SAM's image encoder as keys and values, and learnable object embeddings as queries. The output of the cross-attention is then used to predict the bounding box coordinates, mask prompts, and high-dimensional prompts. These predicted prompts are subsequently fed to SAM's mask decoder to generate the final segmentation mask. By aligning the learned prompts with SAM's original training scheme, PPN enhances compatibility with SAM's architecture, requiring no additional standalone encoders. To preserve SAM's extensive world knowledge, we keep all SAM modules frozen and train PPN only. This approach enables efficient parameter utilization while retaining SAM's generalization capabilities. Additionally, Sam2Rad can operate in three modes: fully autonomous without human supervision, semi-autonomous with human-in-the-loop for iterative refinement, and fully manual for tasks like data labeling. We tested the proposed model - Sam2Rad on 3 musculoskeletal US datasets - wrist (3822 images), shoulder rotator cuff (1605 images), and hip (4849 images). Without Sam2Rad, all SAM2 variants failed to segment shoulder US in zero-shot generalization with bounding box prompts. Our model, Sam2Rad, improved the performance of all SAM base networks in all datasets, without requiring manual prompts. The improvement in dice score ranged from a 2.2%-5.8% for hip, 19.6%-32.8% for wrist wrist, and up to 51.3% improvement in Dice score (from 25.2% to 76.5% Sam2 large) on shoulder data. Notably, Sam2Rad could be trained with as few as 10 labeled images and it is compatible with any SAM architecture. The code is available at https://github.com/aswahd/SamRadiology.

Computers in Biology and MedicineVol. 187
University of Alberta (CA), McGill University (CA)
Openalex Percentile: Top 1%
AI in cancer detection
14.89
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.