Skip to main content
QUICK REVIEW

[Paper Review] SAM 2: Segment Anything in Images and Videos

Nikhila Ravi, Valentin Gabeur|arXiv (Cornell University)|Aug 1, 2024
Generative Adversarial Networks and Image SynthesisComputer Science212 citations
TL;DR

SAM 2 extends the Segment Anything Model to videos with a streaming memory, building the SA-V dataset and achieving higher accuracy with fewer user interactions, plus faster image segmentation compared to SAM.

ABSTRACT

We present Segment Anything Model 2 (SAM 2), a foundation model towards solving promptable visual segmentation in images and videos. We build a data engine, which improves model and data via user interaction, to collect the largest video segmentation dataset to date. Our model is a simple transformer architecture with streaming memory for real-time video processing. SAM 2 trained on our data provides strong performance across a wide range of tasks. In video segmentation, we observe better accuracy, using 3x fewer interactions than prior approaches. In image segmentation, our model is more accurate and 6x faster than the Segment Anything Model (SAM). We believe that our data, model, and insights will serve as a significant milestone for video segmentation and related perception tasks. We are releasing our main model, dataset, as well as code for model training and our demo.

Motivation & Objective

  • Motivate a universal promptable visual segmentation system for both images and videos.
  • Develop a data engine to collect a large, diverse video segmentation dataset with minimal semantic constraints.
  • Propose a memory-augmented transformer model that processes video frames in a streaming fashion for real-time segmentation.
  • Demonstrate that SAM 2 achieves better accuracy with fewer user interactions across video and image tasks.
  • Release datasets, model, and an interactive demo to accelerate research in video segmentation and related perception tasks.

Proposed method

  • Introduce a promptable visual segmentation task (PVS) that accepts prompts on any video frame to define a target object and propagate a masklet across the video.
  • Use a memory-augmented streaming transformer architecture where a memory bank stores past predictions and prompts to condition current frame predictions.
  • Employ a memory encoder and memory attention to condition per-frame embeddings on past frames and object pointers.
  • Adopt a prompt encoder and mask decoder inspired by SAM, with the ability to output multiple masks when ambiguous prompts exist.
  • Train SAM 2 jointly on image and video data, simulating interactive prompting with ground-truth masklets and corrective prompts.
  • Build the SA-V dataset via a multi-phase data engine that gradually integrates SAM 2 in the loop to accelerate annotation and diversify masklets.

Experimental results

Research questions

  • RQ1How can a single model perform promptable segmentation across both images and videos?
  • RQ2Does introducing a streaming memory improve video segmentation accuracy with fewer user interactions?
  • RQ3Can a large, diverse video segmentation dataset (SA-V) enable zero-shot performance gains across video and image benchmarks?
  • RQ4How does SAM 2 compare to state-of-the-art video object segmentation baselines under interactive settings?
  • RQ5What are the fairness and generalization properties of SAM 2 across demographics and diverse video domains?

Key findings

  • SAM 2 delivers better video segmentation accuracy while using three times fewer interactions than prior approaches.
  • SAM 2 outperforms prior video object segmentation baselines (e.g., SAM+XMem++, SAM+Cutie) across 17 datasets in interactive and semi-supervised settings.
  • The SA-V dataset contains 50.9K videos and 35.5M masks (642.6K masklets), enabling 53× more masks than existing VOS datasets.
  • SAM 2 also improves image segmentation accuracy and is about 6× faster than SAM on standard image benchmarks.
  • No substantial fairness discrepancy observed in video segmentation across gender/age groups under evaluation prompts.
  • Training on SA-V and phase-wise data expansion yields consistent gains on zero-shot benchmarks (SA-V val and 9 zero-shot datasets).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.