SAM2LONG: Enhancing SAM 2 for Long Video Segmentation with a Training-Free Memory Tree
Shuangrui Ding, Rui Qian, Xiaoyi Dong, Pan Zhang, Yuhang Zang, Yuhang Cao, Yuwei Guo, Dahua Lin, Jiaqi Wang
Abstract
The Segment Anything Model 2 (SAM 2) has emerged as a powerful foundation model for object segmentation in both images and videos. The crucial design of SAM 2 for video segmentation is its memory module, which prompts object-aware memories from previous frames for current frame prediction. However, its greedy-selection memory design suffers from the "error accumulation" problem, where an errored or missed mask will cascade and influence the segmentation of the subsequent frames, which limits the performance of SAM 2 toward complex long-term videos. To this end, we introduce SAM2Long, an improved trainingfree video object segmentation strategy, which considers the segmentation uncertainty within each frame and chooses the video-level optimal results from multiple segmentation pathways in a constrained tree search manner. In practice, we maintain a fixed number of segmentation pathways throughout the video. For each frame, multiple masks are proposed based on the existing pathways, creating various candidate branches. We then select the same fixed number of branches with higher cumulative scores as the new pathways for the next frame. After processing the final frame, the pathway with the highest cumulative score is chosen as the final segmentation result. Benefiting from its heuristic search design, SAM2Long is robust toward occlusions and object reappearances, and can effectively segment and track objects for complex long-term videos. Without further training, SAM2Long significantly and consistently outperforms SAM 2 on nine VOS benchmarks and three VOT benchmarks. Notably, SAM2Long achieves an average improvement of 3.7 points across all 12 direct comparisons, with gains of up to 5.3 points in J &F on long-term video object segmentation benchmarks such as SA-V and LVOS. The code is released at https://github.com/Mark12Ding/SAM2Long.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
19 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Rethinking Space-Time Networks with Improved Memory Coverage for Efficient Video Object Segmentation cites Video Object Segmentation Using Space-Time Memory Networks
- SAM 3: Segment Anything with Concepts cites SAM2MOT: A Novel Paradigm of Multi-Object Tracking by Segmentation
- SAM 3: Segment Anything with Concepts cites Segment Anything
- MixFormer: End-to-End Tracking with Iterative Mixed Attention cites Video Object Segmentation Using Space-Time Memory Networks
- Vanish into Thin Air: Cross-prompt Universal Adversarial Attacks for SAM2 cites Segment Anything
- Refer-Agent: A Collaborative Multi-Agent System with Reasoning and Reflection for Referring Video Object Segmentation cites Segment Anything
- Refer-Agent: A Collaborative Multi-Agent System with Reasoning and Reflection for Referring Video Object Segmentation cites Advancing Complex Video Object Segmentation via Progressive Concept Construction
- Advancing Complex Video Object Segmentation via Progressive Concept Construction cites Rethinking Space-Time Networks with Improved Memory Coverage for Efficient Video Object Segmentation
- Advancing Complex Video Object Segmentation via Progressive Concept Construction cites Video Object Segmentation Using Space-Time Memory Networks
Cited by top-tier papers19
- SAM 3: Segment Anything with ConceptsNicolas Carion, Laura Gustafson, Yuan-Ting Hu, Shoubhik Debnath et al.ICLR 2026 · 1,103 citations
- SAM2MOT: A Novel Paradigm of Multi-Object Tracking by SegmentationJunjie Jiang, Zelin Wang, Manqi Zhao, Yin Li et al.AAAI 2026 · 19 citations
- Vanish into Thin Air: Cross-prompt Universal Adversarial Attacks for SAM2Ziqi Zhou, Yifan Hu, Yufei Song, Zijing Li et al.NeurIPS 2025 · 17 citations
- Advancing Complex Video Object Segmentation via Progressive Concept ConstructionZhixiong Zhang, Shuangrui Ding, Xiaoyi Dong, Songxin He et al.ICLR 2026 · 17 citations
- Refer-Agent: A Collaborative Multi-Agent System with Reasoning and Reflection for Referring Video Object SegmentationHaichao Jiang, Tianming Liang, Wei-Shi Zheng, Jian-Fang HuCVPR 2026 · 7 citations
Builds on33
- Segment AnythingAlexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao et al.ICCV 2023 · 13,211 citations
- Video Object Segmentation Using Space-Time Memory NetworksSeoung Wug Oh, Joon-Young Lee, Ning Xu, Seon Joo KimICCV 2019 · 845 citations
- MixFormer: End-to-End Tracking with Iterative Mixed AttentionYutao Cui, Cheng Jiang, Limin Wang, Gangshan WuCVPR 2022 · 746 citations
- Rethinking Space-Time Networks with Improved Memory Coverage for Efficient Video Object SegmentationHo Kei Cheng, Yu-Wing Tai, Chi-Keung TangNeurIPS 2021 · 403 citations
- Transforming Model Prediction for TrackingChristoph Mayer, Martin Danelljan, Goutam Bhat, Matthieu Paul et al.CVPR 2022 · 399 citations
Related papers
- SAM-I2V: Upgrading SAM to Support Promptable Video Segmentation with Less than 0.2% Training CostHaiyang Mei, Pengyu Zhang, Mike Zheng ShouCVPR 2025
- MPG-SAM 2: Adapting SAM 2 with Mask Priors and Global Context for Referring Video Object SegmentationFu Rong, Meng Lan, Qian Zhang, Lefei ZhangICCV 2025 · 4 citations
- Efficient Track AnythingYunyang Xiong, Chong Zhou, Xiaoyu Xiang, Lemeng Wu et al.ICCV 2025 · 5 citations
- Autoregressive Universal Video Segmentation ModelMiran Heo, Sukjun Hwang, Min-Hung Chen, Yu-Chiang Frank Wang, Albert Gu, Seon Joo Kim, Ryo HachiumaCVPR Findings 2026
- SAMWISE: Infusing Wisdom in SAM2 for Text-Driven Video SegmentationClaudia Cuttano, Gabriele Trivigno, Gabriele Rosi, Carlo Masone et al.CVPR 2025
