Segment Anything Model (SAM)

Segment Anything Model (SAM) is a foundational image segmentation model developed by Meta AI. It introduces a zero-shot segmentation capability, allowing it to segment any object in any image with minimal prompting, without requiring task-specific training.

Core Architecture & Capabilities

  • Zero-Shot Generalization: Trained on the SA-1B dataset (1 billion masks on 11 million images), SAM generalizes to new image distributions and tasks without fine-tuning.
  • Promptable Interface: Supports multiple prompt types:
    • Points (positive/negative)
    • Bounding boxes
    • Text prompts (via integration with CLIP or similar models)
    • Automatic mask generation (no prompts required)
  • Real-Time Performance: Designed for efficiency, enabling real-time segmentation on standard hardware.
  • Hierarchical Mask Output: Generates multiple masks per prompt to handle ambiguity and varying levels of granularity.

Applications & Integrations

Key Technical Details

  • Image Encoder: ViT-H (Vision Transformer) backbone for feature extraction.
  • Prompt Encoder: Processes sparse (points/boxes) and dense (masks) prompts.
  • Mask Decoder: Lightweight transformer that combines image and prompt embeddings to predict segmentation masks.

References