Sam2Rad: A segmentation model for medical images with learnable prompts

IF 7 2区 医学 Q1 BIOLOGY
Assefa Seyoum Wahd , Banafshe Felfeliyan , Yuyue Zhou , Shrimanti Ghosh , Adam McArthur , Jiechen Zhang , Jacob L. Jaremko , Abhilash Hareendranathan
{"title":"Sam2Rad: A segmentation model for medical images with learnable prompts","authors":"Assefa Seyoum Wahd ,&nbsp;Banafshe Felfeliyan ,&nbsp;Yuyue Zhou ,&nbsp;Shrimanti Ghosh ,&nbsp;Adam McArthur ,&nbsp;Jiechen Zhang ,&nbsp;Jacob L. Jaremko ,&nbsp;Abhilash Hareendranathan","doi":"10.1016/j.compbiomed.2025.109725","DOIUrl":null,"url":null,"abstract":"<div><div>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.</div><div>To address these limitations, we propose <strong>Sam2</strong> for <strong>Rad</strong>iology (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.</div><div>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 <em>human-in-the-loop</em> for iterative refinement, and fully manual for tasks like data labeling.</div><div>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.</div><div>The code is available at <span><span>https://github.com/aswahd/SamRadiology</span><svg><path></path></svg></span>.</div></div>","PeriodicalId":10578,"journal":{"name":"Computers in biology and medicine","volume":"187 ","pages":"Article 109725"},"PeriodicalIF":7.0000,"publicationDate":"2025-02-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Computers in biology and medicine","FirstCategoryId":"5","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0010482525000757","RegionNum":2,"RegionCategory":"医学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"BIOLOGY","Score":null,"Total":0}
引用次数: 0

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.
求助全文
约1分钟内获得全文 求助全文
来源期刊
Computers in biology and medicine
Computers in biology and medicine 工程技术-工程:生物医学
CiteScore
11.70
自引率
10.40%
发文量
1086
审稿时长
74 days
期刊介绍: Computers in Biology and Medicine is an international forum for sharing groundbreaking advancements in the use of computers in bioscience and medicine. This journal serves as a medium for communicating essential research, instruction, ideas, and information regarding the rapidly evolving field of computer applications in these domains. By encouraging the exchange of knowledge, we aim to facilitate progress and innovation in the utilization of computers in biology and medicine.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信