Lean-SAM2: Target-Anchored Memory and Encoder Acceleration for SAM2

· Source: Computer Vision and Pattern Recognition · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Robotics & Autonomous Systems, Computer Vision · Depth: Expert, quick

Summary

Lean-SAM2 is a novel lightweight framework designed to enhance the efficiency of the Segment Anything Model 2 (SAM2) for temporal promptable segmentation, addressing its heavy memory cross-attention overhead and redundant full-frame visual feature extraction. Existing efficiency methods often suffer performance degradation in complex scenarios with occlusions and distractors. Lean-SAM2 integrates three collaborative mechanisms: Target-Anchored Memory Pruning (TAMP) for safeguarding target tokens, Temporal Condensation with Insurance Memory (TCIM) for condensing historical context, and Target-Anchored Risk-Aware Routing (TARR) for selectively activating the image encoder. On the LVOSv2 validation dataset, Lean-SAM2 achieves inference speedups of 1.412× on SAM2.1-Large and 1.417× on SAM2.1-Base+, while boosting ℬ&ℱ scores by 5.0% and 3.6% respectively, significantly outperforming Efficient-SAM2.

Key takeaway

For Machine Learning Engineers deploying temporal promptable segmentation models like SAM2, consider integrating Lean-SAM2's mechanisms to overcome memory and computational bottlenecks. Your deployments can achieve significant inference speedups, such as 1.412× on SAM2.1-Large, while boosting segmentation accuracy by up to 5.0%. This approach allows for more efficient operation in complex scenarios without catastrophic performance degradation.

Key insights

Lean-SAM2 improves SAM2 efficiency and accuracy by intelligently pruning memory, condensing temporal context, and selectively routing encoder activation.

Principles

Method

Lean-SAM2 employs Target-Anchored Memory Pruning (TAMP), Temporal Condensation with Insurance Memory (TCIM), and Target-Anchored Risk-Aware Routing (TARR) to optimize SAM2's memory and encoder usage.

In practice

Topics

Code references

Best for: Research Scientist, AI Scientist, Machine Learning Engineer, Computer Vision Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Computer Vision and Pattern Recognition.