让视频分割模型在手机上流畅运行,精度接近顶级水平。
EdgeTAM: On-Device Track Anything Model
- 用轻量级2D空间感知器替代原模型的内存注意力模块,降低计算开销。
- 在iPhone 15 Pro Max上实现16帧/秒推理速度,关键数据集上精度达70%以上。
- 适合移动端部署、对实时性要求高的视频分割应用开发者使用。
在图像分割基础模型SAM的基础上,SAM 2通过引入记忆库机制实现了对视频输入的支持,性能显著优于以往方法,成为视频分割任务的通用基础模型。本文旨在进一步提升SAM 2的效率,使其能在移动设备上运行且保持相近性能。尽管已有工作尝试优化SAM的效率,但均聚焦于压缩图像编码器,而我们的基准测试表明,新引入的内存注意力模块同样是延迟瓶颈。为此,我们提出EdgeTAM,采用一种新颖的2D空间感知器来降低计算成本。该感知器使用轻量Transformer对密集存储的帧级记忆进行编码,包含一组固定可学习查询。考虑到视频分割是密集预测任务,我们发现保留记忆的空间结构至关重要,因此将查询分为全局与局部块组。此外,我们设计了一种无推理开销的知识蒸馏流程,进一步提升性能。最终,EdgeTAM在DAVIS 2017、MOSE、SA-V val和SA-V test四个数据集上的J&F得分分别为87.7、70.0、72.3和71.7,同时在iPhone 15 Pro Max上实现16 FPS的运行速度。
原文摘要 · Abstract (English)
On top of Segment Anything Model (SAM), SAM 2 further extends its capability from image to video inputs through a memory bank mechanism and obtains a remarkable performance compared with previous methods, making it a foundation model for video segmentation task. In this paper, we aim at making SAM 2 much more efficient so that it even runs on mobile devices while maintaining a comparable performance. Despite several works optimizing SAM for better efficiency, we find they are not sufficient for SAM 2 because they all focus on compressing the image encoder, while our benchmark shows that the newly introduced memory attention blocks are also the latency bottleneck. Given this observation, we propose EdgeTAM, which leverages a novel 2D Spatial Perceiver to reduce the computational cost. In particular, the proposed 2D Spatial Perceiver encodes the densely stored frame-level memories with a lightweight Transformer that contains a fixed set of learnable queries. Given that video segmentation is a dense prediction task, we find preserving the spatial structure of the memories is essential so that the queries are split into global-level and patch-level groups. We also propose a distillation pipeline that further improves the performance without inference overhead. As a result, EdgeTAM achieves 87.7, 70.0, 72.3, and 71.7 J&F on DAVIS 2017, MOSE, SA-V val, and SA-V test, while running at 16 FPS on iPhone 15 Pro Max.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。