Sam2Rad: A segmentation model for medical images with learnable prompts
Bibliographic record
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.
Fetched live from OpenAlex and de-inverted. Abstracts are not stored in this database: the inverted indexes are 8.6 GB of the frame’s 9.3 GB of text, and the host has 13 GB free.
How this classification was reachedexpand
Full frame machine prediction
Teacher imitationNot calibrated prevalence, not ground truth. Human validation pending. The Gemma side is a direct model label for every work in the frame, read from the title-only record. The Codex side is a classifier learned from the 10,348 direct Codex labels and calibrated to design-weighted sample rates; fields without enough sample support carry no Codex call. Candidate is the union of the two sides; consensus is their intersection. These outputs are machine_predicted_unvalidated and are not human labels.
Distilled classifier scores by category (both heads)
| Category | Codex | Gemma |
|---|---|---|
| Metaresearch | 0.001 | 0.003 |
| Meta-epidemiology (narrow) | 0.001 | 0.001 |
| Meta-epidemiology (broad) | 0.001 | 0.001 |
| Bibliometrics | 0.001 | 0.001 |
| Science and technology studies | 0.000 | 0.001 |
| Scholarly communication | 0.001 | 0.002 |
| Open science | 0.002 | 0.001 |
| Research integrity | 0.002 | 0.002 |
| Insufficient payload (model declined to judge) | 0.005 | 0.002 |
Machine scores (provisional)
The two teacher heads of the student model, read on this work. A score orders the frame for review; it never asserts a category, and the validation status ships verbatim with every row.
Baseline scores from an immature model (maturity gate not passed, 7 training rounds). Scores rank; they never assert a category.
score_only:v0-immature-baseline · verbatim from the scoring run: score_only means the number may rank works, and no category label ships from itClassification
machine, unvalidatedMachine predicted; a candidate call from one source (direct Gemma or distilled Codex), not a consensus.
How this classification was reached, model by model and score by score, is at the end of the page under "How this classification was reached".