Segment Anything

Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alexander C. Berg, Wan-Yen Lo, Piotr Dollár, Ross Girshick

2023 · ICCV

Segment Anything

Problem

Framing

Open-vocabulary segmentation lacked a promptable model that transfers without task-specific fine-tuning and has data at foundation-model scale. SAM closes this with a prompt encoder plus lightweight mask decoder trained on SA-1B, a dataset of 11M images and 1.1B masks.

Currently Used Methods

Foundational

Proposed Method

Architecture

SAM uses a heavyweight ViT image encoder, a prompt encoder for points, boxes, text, and masks, and a lightweight mask decoder. The image embedding is computed once, then queried by prompts to emit multiple valid masks and an IoU confidence score.

SAM overview: image encoder, prompt encoder, and mask decoder producing multiple valid masks with scores.

Loss / Objective

The decoder optimizes mask quality and mask ranking jointly.

L=Lfocal+Ldice+Liou\mathcal{L} = \mathcal{L}_{\mathrm{focal}} + \mathcal{L}_{\mathrm{dice}} + \mathcal{L}_{\mathrm{iou}}

Algorithm

For ambiguous prompts, SAM predicts several candidate masks and selects by predicted IoU.

(m^1,s1),,(m^k,sk)=fθ(I,p),m^=m^argmaxisi(\hat{\mathbf{m}}_1, s_1), \ldots, (\hat{\mathbf{m}}_k, s_k) = f_{\theta}(\mathbf{I}, \mathbf{p}), \qquad \hat{\mathbf{m}} = \hat{\mathbf{m}}_{\arg\max_i s_i}

Training Procedure

Evaluation

Datasets

Metrics

Headline results

SA-1B examples: diverse images with dense overlaid masks, grouped by masks per image.

Ablations

Method Strengths and Weaknesses

Strengths

Weaknesses

Suggestions from the authors

Links

Prior Papers

Further Papers