轻量级框架提升SAM2的实时分割效率与准确性
Lean-SAM2: Target-Anchored Memory and Encoder Acceleration for SAM2

- 通过目标锚定记忆剪枝,防止干扰注意力误判
- 历史上下文压缩并保留高置信度记忆,提速1.4倍以上
- 仅对目标区域激活高开销编码器,适合复杂场景应用
Segment Anything Model 2 (SAM2) 虽在时序可提示分割上取得进展,但部署仍受限于高昂的记忆交叉注意力开销和冗余全图视觉特征提取。现有方法虽尝试通过启发式记忆剪枝和窗口稀疏路由提升效率,但在存在遮挡与干扰物的复杂场景中常出现性能骤降。为此,本文提出 extbf{Lean-SAM2},一个系统性消除计算冗余的轻量化框架。该框架融合三项协同机制:(1) 目标锚定记忆剪枝(TAMP)通过语义一致性调节原始注意力权重,保护目标标记免受误导;(2) 带保险记忆的时间压缩(TCIM)基于可见性门控融合历史信息,并将高置信度条目存入并行保险存储;(3) 目标锚定风险感知路由(TARR)根据锚点相似性选择性激活图像编码器,结合风险感知回退策略,在剧烈变化时触发全图刷新。在多个挑战性基准测试中,Lean-SAM2 实现精度与效率的更优平衡。例如,在 LVOSv2 验证集上,对 SAM2.1-Large 和 SAM2.1-Base+ 分别实现 1.412× 和 1.417× 的推理加速,显著优于 Efficient-SAM2,同时分别提升 $/mathcal{J}ackslash&ackslashmathcal{F}$ 分数 5.0% 和 3.6%。
原文摘要 · Abstract (English)
The Segment Anything Model 2 (SAM2) has advanced temporal promptable segmentation, yet its deployment remains hindered by heavy memory cross-attention overhead and redundant full-frame visual feature extraction. While recent methods explore efficiency via heuristic memory pruning and window-based sparse routing, they typically suffer from catastrophic performance degradation in complex segmentation scenarios replete with occlusions and distractors. To resolve these limitations, we propose \textbf{Lean-SAM2}, a holistic lightweight framework designed to address the above vulnerabilities while systematically eliminating computational redundancies. Specifically, Lean-SAM2 integrates three collaborative mechanisms: (1) Target-Anchored Memory Pruning (TAMP) safeguards target tokens against deceptive attention by modulating raw attention significance with semantic consistency against prompt-derived foreground anchors; (2) Temporal Condensation with Insurance Memory (TCIM) condenses historical context via a visibility-gated fusion while conditionally archiving high-confidence entries in a parallel insurance bank; and (3) Target-Anchored Risk-Aware Routing (TARR) selectively activates the heavy image encoder for target-related windows based on anchor similarity, utilizing a risk-aware fallback policy to trigger full-frame refreshes during volatile transitions. Extensive evaluations across multiple challenging benchmarks demonstrate that Lean-SAM2 establishes a superior balance between accuracy and efficiency. For example, on the LVOSv2 validation dataset, Lean-SAM2 achieves overall inference speedups of $1.412\times$ and $1.417\times$ on the SAM2.1-Large and SAM2.1-Base+, respectively, significantly outperforming Efficient-SAM2 while boosting the corresponding $\mathcal{J}\&\mathcal{F}$ scores by $5.0\%$ and $3.6\%$. Code is available at https://github.com/DeawhaleQwQ/Lean-SAM2.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。