mlsanityData to 7 Oct 2026

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

arXiv 2401.02317 ↗First posted 4 Jan 2024cs.CVcited by 15

Not on the map. Why?

Abstract (arXiv)

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 issue as a length extrapolation problem, where token sequence length varies while maintaining a consistent patch size for images of different sizes. To this end, we propose 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 fine-tuning. Extensive evaluation on 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. Code is available at https://github.com/zongzi13545329/BA-SAM

Key facts. Cited by 15 papers in the map (data through 7 Oct 2026). Builds on 89 of its 103 references that are in the map. First posted on arXiv 4 Jan 2024.

Builds on

89 of 103 references.

References · 89

  1. 2017Attention Is All You Needcited by 59,932
  2. 2015Deep Residual Learning for Image Recognitioncited by 51,809
  3. 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
  4. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  5. 2014Microsoft COCO: Common Objects in Contextcited by 17,498
  6. 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,082
  7. 2023Segment Anythingcited by 8,158
  8. 2021Masked Autoencoders Are Scalable Vision Learnerscited by 7,339
  9. 2022Hierarchical Text-Conditional Image Generation with CLIP Latentscited by 6,539
  10. 2017Squeeze-and-Excitation Networkscited by 4,763
  11. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
  12. 2014Going Deeper with Convolutionscited by 4,231
38 more
  1. 2021On the Opportunities and Risks of Foundation Modelscited by 3,961
  2. 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,878
  3. 2021Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervisioncited by 3,848
  4. 2020Deformable DETR: Deformable Transformers for End-to-End Object Detectioncited by 3,410
  5. 2020Exploring Simple Siamese Representation Learningcited by 2,853
  6. 2018CBAM: Convolutional Block Attention Modulecited by 2,463
  7. 2017Non-local Neural Networkscited by 2,290
  8. 2021Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutionscited by 1,960
  9. 2022Visual Prompt Tuningcited by 1,674
  10. 2019Generating Long Sequences with Sparse Transformerscited by 1,523
  11. 2022DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detectioncited by 1,306
  12. 2019LVIS: A Dataset for Large Vocabulary Instance Segmentationcited by 1,215
  13. 2021Swin Transformer V2: Scaling Up Capacity and Resolutioncited by 1,215
  14. 2021SimMIM: A Simple Framework for Masked Image Modelingcited by 1,147
  15. 2018Self-Attention with Relative Position Representationscited by 1,112
  16. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  17. 2016Semantic Understanding of Scenes through the ADE20K Datasetcited by 1,063
  18. 2021Towards a Unified View of Parameter-Efficient Transfer Learningcited by 863
  19. 2019Once-for-All: Train One Network and Specialize it for Efficient Deploymentcited by 778
  20. 2018Image Transformercited by 770
  21. 2022AdaptFormer: Adapting Vision Transformers for Scalable Visual Recognitioncited by 714
  22. 2022EVA: Exploring the Limits of Masked Visual Representation Learning at Scalecited by 685
  23. 2017Convolutional Sequence to Sequence Learningcited by 550
  24. 2017Skin Lesion Analysis Toward Melanoma Detection: A Challenge at the 2017 International Symposium on Biomedical Imaging (ISBI), Hosted by the International Skin Imaging Collaboration (ISIC)cited by 549
  25. 2023Medical SAM Adapter: Adapting Segment Anything Model for Medical Image Segmentationcited by 485
  26. 2021LeViT: a Vision Transformer in ConvNet's Clothing for Faster Inferencecited by 475
  27. 2020ResNeSt: Split-Attention Networkscited by 445
  28. 2019Selective Kernel Networkscited by 401
  29. 2017Residual Attention Network for Image Classificationcited by 385
  30. 2021Bottleneck Transformers for Visual Recognitioncited by 364
  31. 2019Attention Augmented Convolutional Networkscited by 363
  32. 2022Pix2Struct: Screenshot Parsing as Pretraining for Visual Language Understandingcited by 360
  33. 2019Dynamic Convolution: Attention over Convolution Kernelscited by 355
  34. 2023Faster Segment Anything: Towards Lightweight SAM for Mobile Applicationscited by 345
  35. 2020Visual Transformers: Token-based Image Representation and Processing for Computer Visioncited by 333
  36. 2020Exploring Self-attention for Image Recognitioncited by 313
  37. 2023Customized Segment Anything Model for Medical Image Segmentationcited by 277
  38. 2022TinyViT: Fast Pretraining Distillation for Small Vision Transformerscited by 232

50 most cited of 89 All 89 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 11; 2025: 2; 2026: 2.

15 papers.

Sort:

By area: