跳到主要导航 跳到搜索 跳到主要内容

BA-SAM: Scalable Bias-Mode Attention Mask for Segment Anything Model

  • Yiran Song
  • , Qianyu Zhou
  • , Xiangtai Li
  • , Deng Ping Fan
  • , Xuequan Lu*
  • , Lizhuang Ma*
  • *此作品的通讯作者
  • Shanghai Jiao Tong University
  • Nanyang Technological University
  • Nankai International Advanced Research Institute (SHENZHEN FUTIAN)
  • Nankai University
  • La Trobe University

科研成果: 书/报告/会议事项章节 › 会议稿件 › 同行评审

摘要

In this paper, we address the challenge of image resolution variation for the Segment Anything Model (SAM). SAM, known for its zero-shot generalizability, exhibits a performance degradation when faced with datasets with varying image sizes. Previous approaches tend to resize the image to a fixed size or adopt structure modifications, hindering the preservation of SAM's rich prior knowledge. Besides, such task-specific tuning necessitates a complete retraining of the model, which is cost-expensive and unacceptable for deployment in the downstream tasks. In this paper, we reformulate this challenge as a length extrapolation problem, where token sequence length varies while maintaining a consistent patch size for images with different sizes. To this end, we propose a Scalable Bias-Mode Attention Mask (BA-SAM) to enhance SAM's adaptability to varying image resolutions while eliminating the need for structure modifications. Firstly, we introduce a new scaling factor to ensure consistent magnitude in the attention layer's dot product values when the token sequence length changes. Secondly, we present a bias-mode attention mask that allows each token to prioritize neighboring information, mitigating the impact of untrained distant information. Our BA-SAM demonstrates efficacy in two scenarios: zero-shot and finetuning. Extensive evaluation of diverse datasets, including DIS5K, DUTS, ISIC, COD10K, and COCO, reveals its ability to significantly mitigate performance degradation in the zero-shot setting and achieve state-of-the-art performance with minimal fine-tuning. Furthermore, we propose a generalized model and benchmark, showcasing BA-SAM's generalizability across all four datasets simultaneously.

源语言英语
主期刊名Proceedings - 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2024
出版商IEEE Computer Society
页3162-3173
页数12
ISBN(电子版)9798350353006
ISBN(印刷版)9798350353006
DOI
出版状态已出版 - 2024
已对外发布是
活动2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2024 - Seattle, 美国
期限: 16 6月 2024 → 22 6月 2024

丛书

姓名Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition
ISSN(印刷版)1063-6919

会议

会议2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2024
国家/地区美国
市Seattle
时期16/06/24 → 22/06/24

学术指纹

探究 'BA-SAM: Scalable Bias-Mode Attention Mask for Segment Anything Model' 的科研主题。它们共同构成独一无二的学术指纹。

引用此