Stable Segment Anything Model

Qi Fan, Xin Tao, Lei Ke, Mingqiao Ye, Yuanhui Zhang +4 more
2/12/2026

No official code found. Best implementation: fanq15/Stable-SAM (72 stars, last commit 2023-12-06).

Abstract

The Segment Anything Model (SAM) achieves remarkable promptable segmentation given high-quality prompts which, however, often require good skills to specify. To make SAM robust to casual prompts, this paper presents the first comprehensive analysis on SAM's segmentation stability across a diverse spectrum of prompt qualities, notably imprecise bounding boxes and insufficient points. Our key finding reveals that given such low-quality prompts, SAM's mask decoder tends to activate image features that are biased towards the background or confined to specific object parts. To mitigate this issue, our key idea consists of calibrating solely SAM's mask attention by adjusting the sampling locations and amplitudes of image features, while the original SAM model architecture and weights remain unchanged. Consequently, our deformable sampling plugin (DSP) enables SAM to adaptively shift attention to the prompted target regions in a data-driven manner, facilitated by our effective robust training strategy (RTS). During inference, dynamic routing plugin (DRP) is proposed that toggles SAM between the deformable and regular grid sampling modes, conditioned on the input prompt quality. Thus, our solution, termed Stable-SAM, offers several advantages: 1) improved SAM's segmentation stability across a wide range of prompt qualities, while 2) retaining SAM's powerful promptable segmentation efficiency and generality, with 3) minimal learnable parameters (0.08 M) and fast adaptation (by 1 training epoch). Extensive experiments across multiple datasets validate the effectiveness and advantages of our approach, underscoring Stable-SAM as a more robust solution for segmenting anything. Codes will be released upon acceptance. https://github.com/fanq15/Stable-SAM

View on arXivView PDF

Code Implementations(1)

fanq15/Stable-SAMCommunity100%
721Nov 26, 20232 years ago

Similar Papers

Cite this paper

@article{fan2026stable,
  title  = {Stable Segment Anything Model},
  author = {Qi Fan and Xin Tao and Lei Ke and Mingqiao Ye and Yuanhui Zhang and Pengfei Wan and Zhong-ming Wang and Yu-Wing Tai and Chi-Keung Tang},
  year   = {2026},
  eprint = {2311.15776},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2311.15776},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2311.15776.svg)](https://codeofpaper.com/paper/2311.15776)

Discussion