《Medical SAM适配器:将分割一切模型适配于医学图像分割》|文献速递-深度学习医疗AI最新文献
Title
题目
Medical SAM adapter: Adapting segment anything model for medical imagesegmentation
《Medical SAM适配器:将分割一切模型适配于医学图像分割》
01
文献速递介绍
近年来,分割一切模型(SAM)(Kirillov等人,2023)作为一种强大且通用的视觉分割模型备受关注。它能根据用户提示生成多样化且精细的分割掩码。尽管在自然图像上表现出色,但近期研究(Deng等人,2023b;Roy等人,2023)表明,SAM在医学图像分割中性能欠佳。将医学图像分割交互化(如采用SAM这类技术)具有巨大临床价值——交互式系统可根据临床医生标注的感兴趣区域优先处理,提供更沉浸式的个性化体验。例如,在单张眼底图像中,血管、视盘、视杯和黄斑等结构常相互重叠交织,交互式分割能帮助医生高效区分目标组织与复杂结构。同时,考虑到获取大规模标注医学数据集的难度,采用SAM等现有基础模型用于临床显得尤为重要。 SAM在医学图像上的局限性源于其缺乏医学特定知识,难以应对低图像对比度、组织边界模糊和微小病变区域等挑战。当前解决该问题的主流方法是对原始SAM模型在医学数据上进行全量微调(Ma和Wang,2023),但这在计算和内存占用上成本高昂。此外,鉴于已有研究表明预训练视觉模型对医学图像具有较强迁移能力(Raghu等人,2019;Xie和Richmond,2018),全量微调的必要性值得商榷。 本文尝试以最小成本将预训练SAM适配至医学图像分割,核心目标是开发一种简洁高效的适配器技术,在确保强泛化能力的同时实现SAM的医学领域适配。技术层面,我们采用参数高效微调(PEFT)技术“Adaption”(Hu等人,2021)对预训练SAM进行优化。该技术在自然语言处理(NLP)中常用于对基础预训练模型进行下游任务微调,核心思路是在原始模型中插入含部分参数的适配器模块,仅更新少量额外参数而冻结主体预训练模型。然而,将Adaption直接应用于医学场景存在两大挑战:其一,医学图像多为3D(如CT、MRI扫描),与自然图像的2D模态不兼容,如何将2D SAM适配至3D医学分割尚不明确;其二,尽管Adaption在NLP中成功,但在视觉模型(尤其是SAM这类交互式视觉模型)中的应用研究有限,如何将用户提供的视觉提示与Adaption结合仍待探索。 为应对上述挑战,我们提出医学SAM适配器(Med-SA)框架。具体而言: 1. 空间-深度转置(SD-Trans):通过将输入嵌入的空间维度与深度维度转置,使同一自注意力模块可处理不同维度信息,实现2D到3D的模态适配。 2. 超提示适配器(HyP-Adpt):利用视觉提示生成一系列权重并作用于适配嵌入,促进提示与适配的深度交互,实现基于提示的条件自适应。 我们在5个数据集的17项医学图像分割任务(涵盖CT、MRI、超声、眼底和皮肤镜图像)上开展综合实验。结果表明,Med-SA仅更新2%的SAM参数(13M)即可超越原始SAM及全量微调的MedSAM(Ma和Wang,2023),并优于nnUNet、TransUNet、UNetr和Swin-UNetr等专为医学分割设计的先进方法。在广泛使用的腹部多器官分割BTCV基准测试中,Med-SA的Dice分数比Swin-UNetr高2.9%,比原始SAM高34.8%,比全量微调的MedSAM高9.4%。 主要贡献: • 提出适用于通用医学图像分割的Adaption方法,Med-SA作为SAM架构的轻量扩展,仅更新2%参数即可显著提升医学应用能力。 • 设计SD-Trans技术解决医学图像的高维模态挑战,实现2D到3D分割的有效适配。 • 开发HyP-Adpt模块,强化交互式提示与模型适配的深度融合,提升临床场景的适应性。 • 通过跨模态、多任务的大规模对比实验,验证Med-SA在医学分割中的优越性,为医学基础模型的发展提供重要参考。
Aastract
摘要
The Segment Anything Model (SAM) has recently gained popularity in the field of image segmentation dueto its impressive capabilities in various segmentation tasks and its prompt-based interface. However, recentstudies and individual experiments have shown that SAM underperforms in medical image segmentation dueto the lack of medical-specific knowledge. This raises the question of how to enhance SAM’s segmentationcapability for medical images. We propose the Medical SAM Adapter (Med-SA), which is one of the firstmethods to integrate SAM into medical image segmentation. Med-SA uses a light yet effective adaptationtechnique instead of fine-tuning the SAM model, incorporating domain-specific medical knowledge into thesegmentation model. We also propose Space-Depth Transpose (SD-Trans) to adapt 2D SAM to 3D medicalimages and Hyper-Prompting Adapter (HyP-Adpt) to achieve prompt-conditioned adaptation. Comprehensiveevaluation experiments on 17 medical image segmentation tasks across various modalities demonstrate thesuperior performance of Med-SA while updating only 2% of the SAM parameters (13M).
分割一切模型(SAM)近期因其在各种分割任务中的出色能力和基于提示的交互界面,在图像分割领域广受欢迎。然而,近期研究和独立实验表明,由于缺乏医学特定知识,SAM在医学图像分割中表现不佳。这就提出了一个问题:如何提升SAM在医学图像中的分割能力?为此,我们提出了医学SAM适配器(Med-SA),这是首批将SAM集成到医学图像分割中的方法之一。Med-SA采用轻量级但高效的适配技术而非微调SAM模型,将领域特定的医学知识融入分割模型。我们还提出了空间-深度转置(SD-Trans)技术,将2D SAM适配到3D医学图像,以及超提示适配器(HyP-Adpt)以实现提示条件下的自适应。在17个不同模态的医学图像分割任务上进行的综合评估实验表明,Med-SA仅更新2%的SAM参数(13M)即可展现出优越性能。
Method
方法
3.1. Preliminary: SAM architecture
To begin with, we provide an overview of the SAM architecture.SAM comprises three main components: an image encoder, a promptencoder, and a mask decoder. The image encoder is based on a standardVision Transformer (ViT) pre-trained by MAE. Specifically, we use theViT-H/16 variant, which employs 14 × 14 windowed attention andfour equally-spaced global attention blocks, as shown in Fig. 1(a). Theoutput of the image encoder is a 16× downsampled embedding of theinput image. The prompt encoder can be either sparse (points, boxes)or dense (masks). In this paper, we focus only on the sparse encoder,which represents points and boxes as positional encodings summedwith learned embeddings for each prompt type. The mask decoderis a Transformer decoder block modified to include a dynamic maskprediction head. The decoder uses two-way cross-attention to learnthe interaction between the prompt and image embeddings. After that,SAM upsamples the image embedding, and an MLP maps the outputtoken to a dynamic linear classifier, which predicts the target mask ofthe given image.
3.1 预备知识:SAM架构 首先,我们对SAM的架构进行概述。SAM主要包含三个核心组件:图像编码器、提示编码器和掩码解码器。 图像编码器 基于通过掩码自动编码(MAE)预训练的标准视觉Transformer(ViT)。具体而言,我们使用ViT-H/16变体,该变体采用14×14窗口注意力机制和四个等距分布的全局注意力块,如图1(a)所示。图像编码器的输出是输入图像的16倍下采样嵌入。 提示编码器 分为稀疏型(点、框)和密集型(掩码)两种。本文仅关注稀疏编码器,其将点和框表示为位置编码,并与每种提示类型的学习嵌入相加。 掩码解码器 是一个经过修改的Transformer解码器块,包含动态掩码预测头。解码器使用双向交叉注意力机制学习提示与图像嵌入之间的交互。随后,SAM对图像嵌入进行上采样,通过多层感知机(MLP)将输出标记映射到动态线性分类器,最终预测目标图像的分割掩码。
Conclusion
结论
In this paper, we extend SAM, a powerful general segmentationmodel, to address medical image segmentation, introducing Med-SA.Using parameter-efficient adaptation with simple yet effective SD-Transand HyP-Adpt, we achieve substantial improvements over the originalSAM model. Our approach result in SOTA performance across 17 medical image segmentation tasks spanning 5 different image modalities. Weanticipate this work will serve as a stepping stone towards advancingfoundation medical image segmentation and inspire the developmentof novel fine-tuning techniques.
在本文中,我们将功能强大的通用分割模型SAM扩展至医学图像分割领域,提出了Med-SA。通过采用参数高效的适配方法——简单而有效的SD-Trans(空间-深度转置)和HyP-Adpt(超提示适配器),我们对原始SAM模型进行了显著改进。我们的方法在横跨5种不同图像模态的17项医学图像分割任务中均实现了SOTA(state-of-the-art,最先进)性能。我们期望这项工作能成为推动基础医学图像分割研究的基石,并为新型微调技术的开发提供启发。
Figure
图
Fig. 1. Med-SA architecture. We use (b) as the encoder with a standard Adapter to process 2D medical images, and (c) incorporating SD-Trans to process 3D images. Then weuse (d) as the decoder with HyP-Adpt to incorporate the prompts.
图1. Med-SA架构图。我们使用(b)作为带有标准适配器的编码器来处理2D医学图像,使用(c)结合空间-深度转置(SD-Trans)来处理3D图像。然后使用(d)作为带有超提示适配器(HyP-Adpt)的解码器来整合提示信息。
Fig. 2. HyP-Adpt architecture. We utilize Prompt Embedding to generate the weightsapplied to the Adapter Embedding
图2. HyP-Adpt架构图。我们利用提示嵌入(Prompt Embedding)生成应用于适配器嵌入(Adapter Embedding)的权重。
Fig. 3. Visual comparison of Med-SA and SAM on abdominal multi-organ segmentation. We use a Checkmark to represent SAM correctly found the organ and a Cross to representit lost
图3. Med-SA与SAM在腹部多器官分割中的可视化对比。我们使用对勾(Checkmark)表示SAM正确分割出器官,叉号(Cross)表示SAM未能正确分割。
Fig. 4. Visual comparison of Med-SA and SAM on medical image segmentation with four different modalities. Top-left: optic disc and cup segmentation from the fundus image.Top-right: Brain tumor segmentation from the Brain MRI. Bottom-left: melanoma segmentation from the dermoscopic image. Bottom-right: thyroid nodule segmentation from theultrasound image
图4. Med-SA与SAM在四种不同模态医学图像分割中的可视化对比。左上:眼底图像的视盘和视杯分割;右上:脑MRI的肿瘤分割;左下:皮肤镜图像的黑色素瘤分割;右下:超声图像的甲状腺结节分割。
Fig. 5. The accuracy and inference time of different adapter ranks. The white numberswithin the circles indicate the adapter ranks. The scale of the circles indicates the scaleof parameters
图5. 不同适配器秩的精度与推理时间对比。圆圈内的白色数字表示适配器的秩(rank),圆圈大小表示参数规模。
Fig. 6. The impact of prompt accuracy on segmentation performance.
图6. 提示精度对分割性能的影响
Fig. 7. Comparison of clinician and synthesized prompts on optic-cup segmentationtask, evaluated by Dice
图7. 临床医生提示与合成提示在视杯分割任务上的Dice分数对比
Fig. 8. A case that the users have to contain aorta while intending to box the pancreas.Med-SA would fail under ambiguous prompts by segmenting all possible organs.
图8. 用户尝试用边界框框选胰腺时需包含主动脉的案例。在模糊提示下,Med-SA可能因分割所有可能器官而失败。
Table
表
Table 1The comparison of Med-SA with SOTA methods over the BTCV dataset evaluated by Dice Score (%) and average HD95. Best results are denoted in bold.
表1 基于BTCV数据集的Med-SA与SOTA方法对比(Dice分数(%)与平均HD95评估),最佳结果以粗体标注。
Table 2The comparison of Med-SA with other methods and 3D-based SAM methods over the BTCV dataset evaluated by Dice Score (%) and average HD95.
表2 基于BTCV数据集的Med-SA与其他方法及基于3D的SAM方法对比(Dice分数(%)与平均HD95评估)。
Table 3The comparison of Med-SA with SAM and SOTA segmentation methods on different image modalities. The grey backgrounddenotes the methods proposed for that/those particular tasks
表3 Med-SA与SAM及SOTA分割方法在不同图像模态上的对比。灰色背景表示针对特定任务提出的方法。
Table 4The comparison of Med-SA with SAM and other interactive segmentation methods on different image modalities. Performance is omitted (–) ifthe algorithm fails over 70% of the samples.
表4 Med-SA与SAM及其他交互式分割方法在不同图像模态上的对比。若算法在70%以上的样本中失败,则性能标注为(–)。
Table 5An ablation study on SD-Trans and HyP-Adpt
表5 关于SD-Trans和HyP-Adpt的消融研究
Table 6Results with different adapter positions
表6 不同适配器位置的实验结果
Table 7Ablation on different hyper-parameters settings
表7 不同超参数设置的消融实验
Table 8Comparison of information fusion methods in the SD-Trans module
表8 SD-Trans模块中信息融合方法的比较
Table 9Different SAM variants applied in Med-SA evaluated by Dice score (%) and mIoU (%). Best results are denoted in bold.
表9 应用于Med-SA的不同SAM变体在Dice分数(%)和mIoU(%)上的评估结果,最佳结果以粗体标注。
Table 10Standard deviation across five repeated experiments for all settings of Med-SA
表10 Med-SA所有设置下五次重复实验的标准差
Table 11Comparison with MedSAM-2 evaluated by Dice score (%)
表11 与MedSAM-2在Dice分数(%)上的对比