arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.08224cs.CV
收藏

Efficient-SAM2: 通过对象感知视觉编码和内存检索加速SAM2

Efficient-SAM2: Accelerating SAM2 with Object-Aware Visual Encoding and Memory Retrieval

Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院)

Jing Zhang, Zhikai Li, Xuewen Liu, Qingyi Gu

AI总结:

Efficient-SAM2通过对象感知的视觉编码和内存检索技术,显著提升SAM2的推理效率,实现1.68倍加速且仅损失1.0%的准确性。

摘要:

Segment Anything Model 2(SAM2)在视频对象分割任务中表现出色;然而,其沉重的计算负担阻碍了其在实时视频处理中的应用。尽管已有努力提高SAM2的效率,但大多数方法集中在重新训练轻量级主干网络,对训练后加速的探索较少。本文发现SAM2表现出稀疏感知模式,这为消除冗余计算和加速提供了机会:i)在掩码解码器中,注意力主要集中在前景对象上,而早期阶段的图像编码器具有广谱注意力,导致对背景区域的不必要的计算。ii)在内存银行中,每个帧中只有少量token对内存注意力有显著贡献,而显著区域表现出时间一致性,使全token计算冗余。基于这些见解,我们提出了Efficient-SAM2,使SAM2能够自适应地聚焦于对象区域,同时消除任务无关的计算,从而显著提高推理效率。具体而言,对于图像编码器,我们提出了对象感知的稀疏窗口路由(SWR),这是一种基于前一帧解码器的一致性和显著性线索的窗口级计算分配机制,将背景区域路由到轻量级快捷分支。此外,对于内存注意力,我们提出了对象感知的稀疏内存检索(SMR),只允许每个帧中显著的内存token参与计算,其显著性模式复用自其首次回忆。几乎不增加额外参数和最小训练开销,Efficient-SAM2在SAM2.1-L模型上实现了1.68倍的加速,仅在SA-V测试集上损失了1.0%的准确性。

英文摘要:

Segment Anything Model 2 (SAM2) shows excellent performance in video object segmentation tasks; however, the heavy computational burden hinders its application in real-time video processing. Although there have been efforts to improve the efficiency of SAM2, most of them focus on retraining a lightweight backbone, with little exploration into post-training acceleration. In this paper, we observe that SAM2 exhibits sparse perception pattern as biological vision, which provides opportunities for eliminating redundant computation and acceleration: i) In mask decoder, the attention primarily focuses on the foreground objects, whereas the image encoder in the earlier stage exhibits a broad attention span, which results in unnecessary computation to background regions. ii) In memory bank, only a small subset of tokens in each frame contribute significantly to memory attention, and the salient regions exhibit temporal consistency, making full-token computation redundant. With these insights, we propose Efficient-SAM2, which promotes SAM2 to adaptively focus on object regions while eliminating task-irrelevant computations, thereby significantly improving inference efficiency. Specifically, for image encoder, we propose object-aware Sparse Window Routing (SWR), a window-level computation allocation mechanism that leverages the consistency and saliency cues from the previous-frame decoder to route background regions into a lightweight shortcut branch. Moreover, for memory attention, we propose object-aware Sparse Memory Retrieval (SMR), which allows only the salient memory tokens in each frame to participate in computation, with the saliency pattern reused from their first recollection. With negligible additional parameters and minimal training overhead, Efficient-SAM2 delivers 1.68x speedup on SAM2.1-L model with only 1.0% accuracy drop on SA-V test set.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑