微调让MedSAM在罕见病灶上更差,关键在解码器表征漂移
When Adaptation Hurts: Connecting Representational Drift to OOD Failures in MedSAM Fine-Tuning

- 仅微调编码器可更好保留解码器稳定性,提升远端分布泛化能力
- 全模型微调效果最好,但参数效率低;编码器LoRA是高效替代方案
- 提示加噪能提升鲁棒性,适合临床实际中的不完美输入场景
基于提示的医学图像分割基础模型(如MedSAM)在跨领域、跨模态任务中表现良好,常在零样本或少样本设置下运行。本文系统评估了MedSAM在六种微调策略下的泛化能力:全模型微调、仅编码器LoRA、浅层与深层视觉提示微调(VPT)、仅解码器微调。模型在ISIC 2018数据集上训练,并在干净及逐步加噪的提示下,在IN和分布外(OOD)数据集上评估:近似OOD的PH2(皮肤镜)、远端OOD的BUSI(乳腺超声)和CBIS-DDSM(数字筛查乳腺影像子集)。结果表明,微调虽提升IN与近似OOD性能,却常导致远端OOD性能下降。全微调提供最佳权衡,而仅编码器LoRA是最优参数高效方法,优于标准LoRA与VPT。通过中心核对齐(CKA)分析发现,远端OOD退化与解码器表征漂移强相关,编码器相似性无法解释鲁棒性。这表明仅编码器微调通过适应视觉特征分布偏移,同时保留解码器路径,实现更强鲁棒性。此外,随机添加0-100像素位移的提示可生成更鲁棒、更优模型。结论:稳健的MedSAM微调需综合考虑提示噪声暴露、域偏移与表征保持。代码已开源:https://github.com/ImSounic/medsam-vpt
原文摘要 · Abstract (English)
Foundation models for medical image segmentation, like prompt-based MedSAM, generalize well across domains and modalities, often in zero or few-shot setups. However, their performance depends on the quality of prompts and the adaptation of the models to custom datasets. This work systematically examines how MedSAM generalizes across diverse medical imaging benchmarks, with six adaptation strategies: full-model and encoder-only LoRA, shallow and deep visual prompt tuning (VPT), and decoder-only and full fine-tuning. Models are trained on the International Skin Imaging Collaboration Challenge (ISIC 2018) dataset and evaluated under clean and increasingly noisy prompts on IN and Out-of-Distribution (OOD) datasets: close-OOD PH2 (dermoscopy), far-OOD BUSI (Breast Ultrasound Images Dataset) and CBIS-DDSM (Curated Breast Imaging Subset of the Digital Database for Screening Mammography). We show that adaptation improves performance on IN and close-OOD data but often reduces performance on far-OOD data. Full fine-tuning provides the best tradeoff, while encoder-only LoRA is the strongest parameter-efficient alternative, outperforming standard LoRA and VPT under far-OOD shifts. Using Centered Kernel Alignment (CKA), we show that far-OOD degradation is strongly associated with drift in decoder representations, whereas encoder similarity alone does not explain robustness. This suggests encoder-only LoRA provides stronger robustness than standard LoRA by adapting the encoder to distribution shift in visual features, while preserving the decoder pathway. We further show that random 0-100 pixel jitter on prompts produces more robust and better performing models. We thus conclude that robust MedSAM adaptation requires the combined consideration of prompt noise exposure, domain shift, and representation preservation. We release our code: https://github.com/ImSounic/medsam-vpt
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。