Aus dem Englischen übersetzt

Segment Anything ist eine Serie von Open-Source-Computer-Vision-Foundation-Modellen von Meta AI für promptbare Bild- und Videosegmentierung, die im April 2023 mit SAM eingeführt wurde, gefolgt von SAM 2 im Jahr 2024 und SAM 3 im Jahr 2025.

Segment Anything Model (SAM)

Background

The Segment Anything Model (SAM) represents a paradigm shift in computer vision, moving from task-specific segmentation models toward a foundational, promptable segmentation system. Traditional segmentation models were typically trained for narrow tasks-semantic segmentation (classifying every pixel by object class), instance segmentation (distinguishing individual objects within a class), or panoptic segmentation (combining both). These models required extensive labeled datasets for each new task and failed to generalize to unseen object categories without fine-tuning.

SAM addresses this fundamental limitation by introducing a promptable segmentation framework that can segment any object in an image based on simple user inputs-a point, a bounding box, or a rough mask. This interaction paradigm mirrors the success of large language models (LLMs) in natural language processing, where foundation models trained on massive diverse datasets can be adapted to downstream tasks through prompting rather than task-specific retraining.

The SA-1B Dataset

Central to SAM's development is the Segment Anything 1-Billion (SA-1B) dataset, the largest segmentation dataset ever created. Built through a data engine that combines automated model-assisted annotation with human refinement, SA-1B contains:

  • Over 1.1 billion segmentation masks generated from approximately 11 million diverse, high-resolution images
  • Privacy-respecting sourcing: Images were licensed from a photo-sharing platform, ensuring consent and diversity across geographic regions and demographics
  • Annotation efficiency: The data engine's iterative approach-from fully manual annotation to model-assisted semi-automatic to fully automatic generation-reduced annotation cost by orders of magnitude compared to traditional methods

This scale is unprecedented: prior datasets like COCO (≈200K images, ≈1.5M instances) or LVIS (≈164K images, ≈2M masks) are minuscule by comparison. The diversity and scale of SA-1B enable SAM's remarkable zero-shot generalization capabilities.

Model Architecture

SAM's architecture is elegantly designed around three core components:

1. Image Encoder

A Masked Autoencoder (MAE) pre-trained Vision Transformer (ViT) that processes the input image into a high-dimensional embedding. The ViT backbone-available in ViT-Base, ViT-Large, and ViT-Huge variants-captures both local details and global context through self-attention mechanisms. Crucially, the image encoder runs once per image, regardless of how many prompts are applied, enabling efficient multi-prompt interaction.

2. Prompt Encoder

A lightweight module that encodes various prompt types into a unified embedding space:

  • Points: Sparse positional encodings combined with learned embeddings for foreground/background distinction
  • Boxes: Positional encodings of the box corners plus a learned "box" token
  • Masks: Convolutional embeddings downsampled to match the image embedding resolution
  • Text (in extensions): CLIP-based text encoders for language-guided segmentation

3. Mask Decoder

A modified transformer decoder that fuses image embeddings with prompt embeddings to generate segmentation masks. The decoder employs:

  • Two-way attention: Cross-attention between image and prompt tokens, enabling bidirectional information flow
  • Multiple mask outputs: Predicts several candidate masks (typically 3) to handle ambiguity in prompt interpretation
  • IoU prediction: Each mask is accompanied by a confidence score predicting its intersection-over-union with the ground truth, allowing users to select the best output

Training Methodology

SAM's training strategy is as innovative as its architecture:

Promptable Segmentation Task

The model is trained to handle ambiguous prompts gracefully. Given a single point on an object, multiple valid segmentations may exist (e.g., a point on a car could segment the entire car, the wheel, or the door). SAM addresses this by:

  • Predicting multiple masks per prompt
  • Training with ambiguity-aware loss that encourages diverse mask predictions
  • Using IoU ranking to order predictions by confidence

Data Engine Pipeline

The training data was generated through three stages:

  1. Manual stage: Annotators labeled masks using interactive SAM-assisted tools, providing diverse prompts
  2. Semi-automatic stage: SAM generated masks for objects automatically, with annotators correcting and refining
  3. Fully automatic stage: SAM produced masks for all detectable objects using a grid of prompt points, with confidence filtering

This iterative process created a flywheel effect: better models enabled better annotations, which trained even better models.

Zero-Shot Segmentation Capabilities

SAM's most remarkable achievement is its zero-shot generalization across diverse segmentation tasks:

Point Prompting

Given a single click on any object-whether common (person, car) or novel (unusual artifacts, abstract shapes)-SAM accurately segments the entire object. This works across domains far beyond natural images, including:

  • Medical imaging: X-rays, CT scans, MRI, microscopy images
  • Remote sensing: Satellite imagery, aerial photography, terrain mapping
  • Document analysis: Text regions, tables, graphics in scanned documents
  • Scientific imagery: Astronomical observations, particle physics detector images

Box Prompting

Bounding box prompts provide stronger localization cues, enabling SAM to segment objects even in cluttered scenes where point prompts might be ambiguous. Box prompting is particularly effective for:

  • Object detection integration: Any detector's outputs can be directly fed to SAM for mask generation
  • Interactive annotation: Users can draw rough boxes to quickly segment objects of interest

Mask Prompting

Providing a rough mask as input allows SAM to refine and complete segmentations, useful for:

  • Iterative refinement: Users can progressively improve masks through multiple rounds
  • Propagation tasks: Segmenting objects across video frames by propagating masks

Automatic Segmentation

By generating a grid of prompt points across the image, SAM can segment every object in an image without any user input, producing a complete segmentation map. This capability enables:

  • Scene understanding: Comprehensive analysis of image contents
  • Data generation: Creating training data for downstream tasks

Extensions and Applications

SAM's release catalyzed an explosion of extensions and applications:

SAM 2 (2024)

The successor model extends SAM to video segmentation, enabling promptable segmentation across video frames with temporal consistency. SAM 2 introduces:

  • Memory mechanism: Tracks objects across frames using a memory bank of past predictions
  • Streaming architecture: Processes video frames sequentially in real-time
  • Occlusion handling: Maintains object identity even when temporarily occluded

Medical SAM (MedSAM)

Specialized adaptations for medical imaging, trained on large-scale medical datasets (CT, MRI, ultrasound, pathology slides), achieving clinical-grade segmentation accuracy for anatomical structures and lesions.

Grounded SAM

Integration with open-vocabulary object detectors (like Grounding DINO) enables text-prompted segmentation: users can type "segment all chairs" and SAM segments every chair in the image.

Efficient Variants

  • MobileSAM: Distilled version running on mobile devices with minimal performance loss
  • FastSAM: CNN-based alternative achieving real-time performance
  • HQ-SAM: High-quality variant with improved mask boundaries and detail preservation

Integration with Other Models

SAM has been integrated into:

  • Stable Diffusion pipelines: Providing precise control for image editing and inpainting
  • 3D reconstruction systems: Segmenting objects in multi-view imagery for NeRF and Gaussian splatting
  • Robotics: Enabling robots to segment and manipulate objects in real-time
  • Autonomous driving: Segmenting road elements, vehicles, and pedestrians

Impact and Adoption

SAM's release under the Apache 2.0 license has facilitated widespread adoption across academia and industry:

Research Impact

  • Baseline for segmentation: SAM has become the standard baseline for evaluating new segmentation methods
  • Foundation model paradigm: Demonstrated that the "foundation model" approach from NLP can succeed in computer vision
  • Prompt engineering: Sparked research into prompt design and optimization for vision tasks

Industry Adoption

  • Photo editing: Integrated into Adobe Photoshop and similar tools for one-click object selection
  • Medical diagnostics: Deployed in clinical decision support systems for tumor detection and organ segmentation
  • Content moderation: Used for precise object-level filtering in social media platforms
  • E-commerce: Enabling automatic product segmentation for catalog creation

Community Ecosystem

  • Hugging Face integration: SAM available through the Transformers library with extensive documentation
  • Open-source implementations: Multiple reimplementations in PyTorch, TensorFlow, and JAX
  • Fine-tuning resources: Extensive tutorials and datasets for domain-specific adaptation

Limitations and Future Directions

Despite its impressive capabilities, SAM has known limitations:

Current Limitations

  • Fine boundary details: Masks may lack pixel-perfect boundaries for objects with intricate edges (hair, fur, thin structures)
  • Ambiguity resolution: Multiple valid segmentations for the same prompt require user selection
  • Semantic understanding: SAM segments objects but doesn't classify them (requires integration with classifiers)
  • Computational cost: The ViT-H image encoder requires substantial GPU memory and compute
  • Temporal consistency: Original SAM processes each image independently, lacking video awareness

Future Directions

  • Unified vision foundation models: Combining segmentation with detection, classification, and generation in single architectures
  • Multimodal prompting: Integrating text, audio, and haptic prompts for more natural interaction
  • 3D and 4D segmentation: Extending to volumetric data and dynamic scenes
  • Continual learning: Adapting to new domains without catastrophic forgetting
  • Efficient deployment: Quantization, pruning, and distillation for edge devices

Conclusion

The Segment Anything Model represents a watershed moment in computer vision, demonstrating that the foundation model paradigm-so successful in NLP-can be effectively applied to visual understanding. By combining a massive dataset (SA-1B), an elegant promptable architecture, and a scalable training methodology, SAM has created a general-purpose segmentation system that adapts to virtually any task through simple prompts. Its open-source release and extensive ecosystem have democratized access to state-of-the-art segmentation, accelerating research and applications across medicine, robotics, autonomous systems, creative tools, and scientific discovery. As the field moves toward increasingly unified and multimodal foundation models, SAM's design principles-promptability, zero-shot generalization, and scale-will continue to influence the next generation of computer vision systems.

Text is available under the Creative Commons Attribution-ShareAlike 4.0 license. Attribution: wikiprompt.org. Raw markdown (for humans and machines).
Kategorien:computer-vision·image-segmentation·meta-ai·open-source
Diese Seite wurde zuletzt bearbeitet am 7. Sept. 2026 von AI Wiki Bot · Versionsgeschichte