Inferensys

Glossary

Segment Anything Model (SAM)

A promptable foundation model developed by Meta AI for general-purpose image segmentation, capable of generating masks for arbitrary objects with zero-shot transfer.
ML engineer working on model compression and quantization, laptop showing performance benchmarks, technical workspace.
FOUNDATION MODEL

What is Segment Anything Model (SAM)?

A promptable foundation model developed by Meta AI for general-purpose image segmentation, capable of generating masks for arbitrary objects with zero-shot transfer.

The Segment Anything Model (SAM) is a promptable vision foundation model that generates high-quality object masks from input prompts such as points, boxes, or coarse masks. Trained on the massive SA-1B dataset of over 1 billion masks across 11 million images, SAM achieves zero-shot generalization, meaning it can segment objects it has never explicitly seen during training without additional fine-tuning.

SAM's architecture consists of a heavyweight image encoder that computes a one-time embedding, and a lightweight prompt encoder paired with a mask decoder that predicts segmentation masks in real-time. This decoupled design enables amortized inference: the expensive image encoding happens once, after which interactive, prompt-driven mask generation occurs in approximately 50 milliseconds on a GPU.

ARCHITECTURE & CAPABILITIES

Key Features of SAM

The Segment Anything Model (SAM) is a promptable foundation model for general-purpose image segmentation. It introduces a novel architecture that decouples heavy image encoding from lightweight prompt encoding, enabling real-time, zero-shot mask generation for arbitrary objects.

04

Automatic Mask Generation Mode

Beyond interactive prompting, SAM can operate in a fully automatic mode that segments every distinct object in an image without human input.

  • Grid prompting: A regular grid of point prompts is sampled across the image.
  • Multi-scale processing: Overlapping image crops are processed to handle objects at different scales.
  • Post-processing: Non-max suppression and filtering by predicted IoU score remove duplicate and low-quality masks.
  • Output: Generates a panoptic-like segmentation with hundreds of masks, each with a stability score, bounding box, and predicted IoU.
SEGMENT ANYTHING MODEL

Frequently Asked Questions

Explore the core mechanics, zero-shot capabilities, and architectural innovations of Meta AI's promptable foundation model for universal image segmentation.

The Segment Anything Model (SAM) is a promptable foundation model developed by Meta AI that performs general-purpose image segmentation, capable of generating valid segmentation masks for arbitrary objects with zero-shot transfer. SAM operates on a vision transformer (ViT)-based image encoder that generates a one-time image embedding, a prompt encoder that handles sparse (points, boxes) and dense (masks) prompts, and a lightweight mask decoder that predicts segmentation masks from the combined embeddings. This architecture enables real-time, interactive segmentation where users can click on an object, draw a bounding box, or provide a coarse mask to instantly generate a precise pixel-level delineation. Trained on the SA-1B dataset containing over 1 billion masks across 11 million images, SAM demonstrates robust generalization to unfamiliar objects and scenes without task-specific fine-tuning.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.