Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

SAM 2: Segment Anything in Images and Videos

Segment Anything 2 extends prompted segmentation from images to videos

  • Problem Promptable segmentation works on single images, but video adds motion, deformation and disappearance across frames. Existing video models and datasets cover whole objects in fixed categories, so object parts are rarely segmented.
  • Method SAM 2 is a streaming transformer that segments each frame from clicks, boxes or masks. It keeps a memory bank of earlier frames, so a wrong masklet can be fixed with one prompt on a later frame.
  • Results On SA-V test with Hiera-L and a first-frame mask, SAM 2 scores 78.4, against 62.3 for XMem. On the 23 SAM datasets, 1-click mIoU reaches 58.9, against 58.1 for SAM.

Why video needs more than per-image masks

Segmenting an object in a single image does not capture how that object moves, deforms and disappears across frames. Video also brings lower quality from camera motion, blur and lower resolution, and efficient processing of many frames is a hard requirement. The authors argue that existing video segmentation models and datasets do not offer the same capability that image segmentation now has.

Most video segmentation datasets annotate whole objects in fixed categories such as people, vehicles and animals, so object parts are rarely covered. Earlier datasets were small, and later ones pushed difficulty along single axes such as occlusion, long duration or object diversity.

The paper answers this with a task, a model and a dataset, and it treats a single image as a one-frame video so that one system covers both.

The promptable video task and the masklet

The task accepts clicks, boxes or masks on any frame to define an object, and returns a spatio-temporal mask across the video, called a masklet. Positive and negative clicks, boxes and masks can each either define a new object or refine a prediction that already exists.

A masklet that goes wrong can be fixed by adding a prompt on a later frame, and the stored memory of the object lets the correction propagate forward from that point. The authors contrast this with a decoupled pipeline of a SAM image model and a video tracker, which must re-annotate the object from scratch with several clicks.

Semi-supervised video object segmentation is a special case of this task, in which only a mask on the first frame is given as the prompt.

How one frame is processed

A Hiera image encoder, pre-trained with MAE, runs once for each frame and produces feature embeddings that carry no conditioning. Because Hiera is hierarchical, the decoder can use features at several scales.

Memory attention then conditions these per-frame features on the past. It is a stack of L transformer blocks, and each block applies self-attention, cross-attention to frame memories and object pointers in the memory bank, and an MLP. Standard attention operations are used, so existing efficient attention kernels can be applied directly.

The prompt encoder is the same as in SAM, so clicks, boxes and masks are embedded in the same way. The mask decoder uses two-way transformer blocks. For an ambiguous single click it predicts several masks, and on video it keeps predicting several masks per frame, propagating only the one with the highest predicted IoU when later prompts do not resolve the ambiguity.

Since a video object can be absent from a frame, for example through occlusion, the decoder has an extra head that predicts whether the object is present. Skip connections from the hierarchical encoder go around memory attention and feed high-resolution features into mask decoding.

The memory encoder downsamples the predicted mask with a convolutional module, adds it element-wise to the unconditioned frame embedding, and fuses the result with light convolutional layers. The memory bank is two first-in, first-out queues: one holds up to N recent frames and the other up to M prompted frames, both kept as spatial feature maps.

Object pointers from the mask decoder output tokens are stored alongside them.

Temporal position information is added to the memories of recent frames so the model can track short-term motion, but not to prompted frames.

Training with simulated interaction

Training uses image and video data together, and imitates an interactive session: sequences of 8 frames are sampled, up to 2 frames are prompted, and corrective clicks are drawn from the ground-truth masklet and from the model's predictions. The training target is to predict the ground-truth masklet one step at a time in this interactive loop.

The loss terms listed in the appendix include an IoU loss with weight 1 and an occlusion loss with cross-entropy and weight 1, and the number of correction points is set to 7.

The data engine and the SA-V dataset

The data engine has three phases, and in each phase the level of model assistance given to annotators changes. The first phase uses the image SAM per frame, where annotators label the target object in every frame. Later phases put SAM 2 in the loop, so annotators can use it interactively and point out where it fails.

The protocol separates object selection, masklet tracking and quality verification into different annotator tasks.

The final SA-V dataset has 35.5M masks across 50.9K videos, which the authors describe as 53× more masks than any existing video segmentation dataset. The data engine with SAM 2 in the loop is reported as 8.4× faster than existing model-assisted approaches at comparable quality.

Components smaller than 200 pixels are removed, and holes smaller than 200 pixels are filled, before these masklets are combined with the manual ones.

Videos range from 240p to 4K, with an average resolution of 1,401×1,037 and an average duration of 13.8 seconds, totalling 4.2M frames.

Image segmentation against SAM

On the 23 datasets used by SAM, SAM 2 trained on SA-1B reaches 58.9 1-click mIoU, against 58.1 for SAM. The authors credit this to the smaller but stronger Hiera image encoder, and they say the gain comes without any extra data.

Training on the mix of SA-1B and video data raises the 23-dataset average further, to 61.4% in the text. Table 5 lists 61.9 for the same SA-23 All column with the mix, so the two reported values differ slightly.

In the speed measurement of Table 5, SAM 2 runs at 130.1 FPS and SAM at 21.7 FPS on the Segment Anything task. The image speed runs used batches of 10 images with compiled encoders, and SAM 2 is reported as 6× faster than SAM.

On the 14 additional zero-shot video datasets, the SAM 2 mix reaches 69.6 1-click mIoU, against 59.1 for SAM.

Video segmentation results

With a ground-truth mask on the first frame, SAM 2 with Hiera-L scores 78.4 on the SA-V test set, against 62.3 for XMem. On DAVIS 2017 val, the same Hiera-L model scores 90.7, against 86.0 for XMem. The Hiera-B+ model runs at 43.8 FPS and Hiera-L at 30.2 FPS on a single A100 with batch size one.

The authors note that most earlier methods peak at about the same accuracy on SA-V val and test, which they read as a gap to segmenting anything in video. SAM 2 also brings gains on the long-term LVOS benchmark.

Across 17 zero-shot video datasets with click prompts on the first frame, SAM 2 averages 64.7 with one click, against 56.7 for SAM+Cutie. The Table 4 scores use J&F for most datasets and the J metric for VOST, and the comparison with XMem++ and Cutie is made using their default settings with mask prompts.

Which training mix matters

The ablations use a reduced spatial resolution, SA-V manual labels and a 10% subset of SA-1B, and the main metric is J&F with 3 clicks on the first frame. Each mixture is trained from an SA-1B pre-training with a fixed 200k iterations and batch size 128, so only the data changes.

The VOS-only model in row 1 scores 59.7 on the 9 zero-shot datasets, against 71.8 for row 11, which adds SA-V data. The authors report a 12.1% average improvement on the 9 zero-shot datasets from adding the data engine data.

Adding SA-1B images improves the image results without degrading the VOS results, as seen in rows 3 against 4, 5 against 6, 9 against 10 and 11 against 12. Training only on SA-V and SA-1B in row 4 is strong on most benchmarks, except MOSE, which has specific object categories. The best configuration in this table is row 12, which mixes all datasets, scoring 63.1 on SA-V val and 58.9 on the SA-23 image average.

Fairness on people segmentation

The evaluation uses people clips from Ego-Exo4D third-person videos, with 1-click, 3-click and ground-truth mask prompts, and groups by self-reported gender and age. With 3 clicks, the J&F is 95.1 for male and 94.1 for female, and the age groups range from 94.7 to 95.1.

At 1 click the gap is wider, with 81.9 for male against 75.1 for female.

Limitations

Most evaluations use only the 9 densely annotated zero-shot datasets, while the 8 sparsely annotated ones enter the semi-supervised VOS evaluation. OVIS is not strictly zero-shot for SAM 2, because its videos are part of the MOSE training mix.

The 1-click fairness gap is not fully explained, since the model often chooses a part of the person.

Speed numbers use different batch settings: 10 images for the image task and a batch size of 1 for video, so they are not one controlled comparison with accuracy. The ablation models use a reduced resolution and fixed 200k iterations, so they are not full-scale training runs.

Paper info

Authors
Nikhila Ravi, Valentin Gabeur, Yuan-Ting Hu, Ronghang Hu, Chaitanya Ryali, Tengyu Ma, Haitham Khedr, Roman Rädle, Chloe Rolland, Laura Gustafson, Eric Mintun, Junting Pan, Kalyan Vasudev Alwala, Nicolas Carion, Chao-Yuan Wu, Ross Girshick, Piotr Dollár, Christoph Feichtenhofer
Venue
arXiv · Preprint
First published
2024-8-1
Added
2026-11-12
Updated
2024-10-28
Version
v2
arXiv
2408.00714
Category
cs.CV · cs.AI · cs.LG
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Nikhila Ravi, Valentin Gabeur, Yuan-Ting Hu, Ronghang Hu, Chaitanya Ryali, Tengyu Ma, Haitham Khedr, Roman Rädle, Chloe Rolland, Laura Gustafson, Eric Mintun, Junting Pan, Kalyan Vasudev Alwala, Nicolas Carion, Chao-Yuan Wu, Ross Girshick, Piotr Dollár, Christoph Feichtenhofer (2024). SAM 2: Segment Anything in Images and Videos. arXiv:2408.00714v2. https://arxiv.org/abs/2408.00714v2

BibTeX
@misc{ravi2024segment,
  title = {{SAM 2: Segment Anything in Images and Videos}},
  author = {Nikhila Ravi and Valentin Gabeur and Yuan-Ting Hu and Ronghang Hu and Chaitanya Ryali and Tengyu Ma and Haitham Khedr and Roman Rädle and Chloe Rolland and Laura Gustafson and Eric Mintun and Junting Pan and Kalyan Vasudev Alwala and Nicolas Carion and Chao-Yuan Wu and Ross Girshick and Piotr Dollár and Christoph Feichtenhofer},
  year = {2024},
  eprint = {2408.00714},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.00714v2}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up