Introduction
MoSAM (Motion-Guided Segment Anything Model) enhances the popular SAM2 framework by introducing "motion awareness" and "memory hygiene." By predicting object trajectories through sparse and dense motion cues and dynamically filtering the memory bank to remove noisy or inaccurate features, MoSAM achieves state-of-the-art results in long-term video object segmentation and tracking.
Addressing the Blind Spots of SAM2
While Meta’s Segment Anything Model 2 (SAM2) set a new bar for video segmentation, it suffers from two critical "blind spots":
- Motion Blindness: SAM2 relies on a memory bank of past frames but doesn't explicitly model how an object moves. If an object moves rapidly or disappears behind an obstacle (occlusion), SAM2 often loses the trail because it lacks a predictive sense of where the object should be.
- Memory Poisoning: SAM2 indiscriminately stores features from a fixed window of past frames. If the model makes a mistake in one frame—or if the object is partially occluded—those "noisy" or "empty" features are saved into memory, leading to error accumulation that degrades performance over time.
MoSAM aims to fix these issues by teaching the model to "look ahead" using motion cues and "curate" its own memory.
Methodology
The authors introduce two primary modules to the SAM2 architecture: Motion-Guided Prompting (MGP) and Spatial-Temporal Memory Selection (ST-MS).
1. Motion-Guided Prompting (MGP)
Instead of just looking at past masks, MGP forecasts the object's future location and feeds that prediction back into the model as a prompt.
- Sparse Motion: The model tracks five geometric keypoints (the center and four cardinal edges). It uses linear interpolation to estimate where these points will be in the next frame, providing "point prompts."
- Dense Motion: The model uses an optical flow network to calculate pixel-level movement. It warps the current mask into the estimated position for the next frame, providing a "box prompt."
By combining these, MoSAM gives the underlying SAM2 engine a "hint" of where to focus its attention before it even sees the next frame.
2. Spatial-Temporal Memory Selection (ST-MS)
This module acts as a quality control filter for the memory bank. It consists of Temporal Selection, which ranks past frames based on predicted IoU and occlusion scores to keep only reliable frames, and Spatial Selection, which filters out low-confidence pixel predictions to ensure the memory bank contains high-quality features.
Evaluation and Results
The model was trained on DAVIS2017 and evaluated across several rigorous benchmarks including LVOS v1 & v2, SA-V, and LV-VIS.
Key Results
MoSAM consistently outperforms the baseline SAM2 and other concurrent improvements:
- Performance Boost: On the challenging LVOS v1 dataset, MoSAM-L achieved an 84.6% J&F score, a significant +4.4% improvement over the baseline SAM2.
- State-of-the-Art: It achieved top-tier results on the SA-V test set (81.5% J&F) and outperformed specialized models in open-vocabulary tasks (OpenVIS).
Qualitative results show MoSAM successfully re-identifying objects after long periods of total disappearance, where standard SAM2 typically fails due to drift or memory poisoning.
Key Insights
- Motion as a Prompt: By converting motion predictions into point and box prompts, MoSAM leverages SAM2’s existing strengths in prompt-based segmentation without requiring a fundamental redesign of the transformer.
- The "Reliability" Heuristic: Actively discarding low-confidence frames and pixels makes the model significantly more robust against the "drift" that usually plagues long-term tracking.
- Sparse + Dense Synergy: Sparse keypoints provide a robust geometric skeleton, while dense optical flow handles fine-grained shape deformations.
Limitations and Future Work
The inclusion of an optical flow network and keypoint tracking adds computational complexity, which might impact real-time performance. Additionally, the current use of linear interpolation for motion forecasting might struggle with highly erratic movements. Future directions include more sophisticated motion modeling or tighter integration of motion features directly into the transformer backbone.
Summary updated