Segment Anything

The paper turns segmentation into a promptable foundation-model interface: encode the image once, encode prompts cheaply, and decode masks interactively.

Metadata

FieldValue
PaperSegment Anything
AuthorsAlexander 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
Year2023
VenueICCV 2023
arXiv2304.02643
PaperCVF Open Access
Statusseed note started

One-Line Takeaway

SAM separates image encoding, prompt encoding, and mask decoding so the same image representation can answer many segmentation prompts without retraining on each downstream segmentation dataset.

Question

Classical segmentation models are often trained for one label space or one dataset:

SAM changes the interface:

where is a prompt such as:

  • point;
  • box;
  • coarse mask;
  • text in broader promptable segmentation framing, although the released SAM model focuses on visual prompts.

The model asks:

Can segmentation be treated as a general promptable task rather than a fixed closed-set prediction problem?

Architecture Contract

ComponentInputOutputRole
image encoderimage dense image embedding expensive reusable representation
prompt encoderpoints, boxes, maskssparse and dense prompt embeddings condition segmentation on user/task intent
mask decodermasks and quality scoresproduce candidate masks for the prompt

The interface is:

Here estimates mask quality for candidate mask .

Image Encoder

The image encoder is the heavy backbone. It maps the image into a spatial embedding:

This is the expensive part, so SAM’s system design encourages reuse:

That is an architecture decision, not just an implementation detail. Interactive segmentation requires low prompt-to-mask latency.

Prompt Encoder

Prompt inputs are heterogeneous:

PromptRepresentation Need
pointcoordinate plus positive/negative label
boxtwo corner coordinates
maskdense spatial prior

The prompt encoder maps them into embeddings that can condition the decoder:

The important abstraction:

This is why SAM belongs in an architecture shelf, not only a segmentation task page. It changes the model’s input contract.

Mask Decoder

The mask decoder combines image and prompt information:

A simplified attention view is:

where:

  • comes from prompt or output tokens;
  • come from image embeddings;
  • the decoder uses the prompt to retrieve relevant image regions.

SAM produces multiple masks for ambiguous prompts:

This matters because a single point can correspond to several valid masks, such as part, object, or group.

Promptable Segmentation vs Instance Segmentation

Mask R-CNN predicts masks for proposed object instances:

SAM predicts masks conditioned by prompts:

AxisMask R-CNNSAM
Object proposalRPN/RoI pipelineuser or algorithmic prompt
Outputclass, box, maskmask candidates and quality
Class labelsexplicit categoriesclass-agnostic masks
Main interfacedetectorpromptable segmenter
Transfer routesupervised task adaptationzero-shot prompt transfer

Why It Matters

SAM is a foundation-model architecture pattern for vision:

The central lesson is that architecture can define a reusable user-facing interface, not only a better benchmark model. This connects SAM to broader patterns in Architectures, Tool Use, and interactive annotation systems.

What To Watch

  • SAM is not a semantic classifier; it returns masks, not category labels.
  • Strong zero-shot behavior depends on the model, data engine, and SA-1B scale together.
  • Prompt choice changes the output; evaluation must specify prompt protocol.
  • Domain-specific images can fail when visual priors differ from natural-image training data.
  • Mask quality and downstream usefulness are different claims.