TinySAM 2: Extreme Memory Compression for Efficient Track Anything Model
作者: Zhaoyuan Ding, Yijing Yang, Han Shu, Xinghao Chen
分类: cs.CV, cs.AI
发布日期: 2026-05-18
备注: 12 pages, 6 figures
💡 一句话要点
TinySAM 2:面向高效Track Anything模型的极低内存压缩
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 视频分割 轻量化模型 内存压缩 Token压缩 RepViT Track Anything SAM 2 资源受限设备
📋 核心要点
- SAM 2在视频分割任务中表现优异,但其高计算复杂度和内存需求限制了实际部署。
- TinySAM 2通过记忆质量管理和联合时空token压缩,在保证性能的同时显著降低了内存占用和计算量。
- 实验表明,TinySAM 2仅用少量资源即可达到SAM 2.1接近90%的性能,有效降低了部署成本。
📝 摘要(中文)
Segment Anything Model 2 (SAM 2) 是视频分割领域的核心基础模型。它在原始SAM模型的基础上引入了记忆库机制,并在半监督视频对象分割和跟踪等任务中表现出色。然而,SAM 2多阶段图像编码器和记忆模块的复杂计算特性增加了模型在实际应用中部署的难度。为了解决这个问题,我们提出了TinySAM 2,一个在性能和效率之间取得平衡的轻量级视频分割模型。首先,引入记忆质量管理机制来选择和保留信息量高的历史帧作为记忆。此外,提出了一种联合时空token压缩方法,以减少内存存储和计算成本。具体来说,采用平均池化首先压缩空间域中的冗余token。在时间域中,基于token级别的相似性度量,在记忆库中跨帧选择信息丰富的token。此外,我们采用RepViT作为轻量级图像编码器,进一步减少了模型参数。在具有挑战性的数据集(如DAVIS和SA-V)上的大量实验表明,TinySAM 2仅使用7%的内存token和3%的训练数据,就达到了SAM 2.1 90%的性能。这项研究有效地缓解了与SAM 2相关的参数数量、计算负载和部署成本方面的瓶颈,为视频分割模型在设备上的广泛应用提供了一种资源高效的解决方案。
🔬 方法详解
问题定义:SAM 2虽然在视频分割和跟踪任务上表现出色,但其庞大的模型参数和计算量使其难以在资源受限的设备上部署。现有的方法难以在性能、效率和部署成本之间取得平衡,限制了其广泛应用。
核心思路:TinySAM 2的核心思路是在保证分割性能的前提下,通过减少模型参数、压缩内存占用和降低计算复杂度来实现轻量化。通过记忆质量管理机制筛选关键帧,并采用联合时空token压缩方法,减少冗余信息,从而降低资源消耗。
技术框架:TinySAM 2的整体框架包括:1) 轻量级图像编码器(RepViT),用于提取图像特征;2) 记忆质量管理模块,用于选择和保留信息量高的历史帧;3) 联合时空token压缩模块,用于压缩空间和时间维度上的冗余token;4) 分割解码器,用于生成最终的分割结果。整个流程旨在以最小的资源消耗实现高效的视频分割。
关键创新:TinySAM 2的关键创新在于联合时空token压缩方法。传统方法通常独立处理空间和时间维度上的压缩,而TinySAM 2同时考虑两者,通过平均池化压缩空间冗余,并通过token相似性度量选择时间维度上的关键token,从而更有效地减少内存占用和计算量。
关键设计:在时间域token选择中,使用token级别的相似性度量来选择信息丰富的token。具体而言,计算当前帧token与记忆库中历史帧token的相似度,选择相似度高的token进行保留。空间域压缩则采用简单的平均池化操作。RepViT作为轻量级图像编码器,其具体参数设置遵循原始论文。
🖼️ 关键图片
📊 实验亮点
TinySAM 2在DAVIS和SA-V等数据集上取得了显著成果,仅使用7%的内存token和3%的训练数据,就达到了SAM 2.1 90%的性能。这表明TinySAM 2在大幅降低资源消耗的同时,仍然保持了较高的分割精度,验证了其轻量化设计的有效性。
🎯 应用场景
TinySAM 2具有广泛的应用前景,包括移动设备上的实时视频分割、低功耗机器人视觉、以及资源受限环境下的智能监控等。该研究降低了视频分割模型的部署门槛,使其能够在更多场景下发挥作用,加速了相关技术的普及和应用。
📄 摘要(原文)
Segment Anything Model 2 (SAM 2) serves as a core foundation model in the field of video segmentation. Building upon the original SAM model, it introduces a memory bank mechanism and demonstrates outstanding performance in tasks such as semi-supervised video object segmentation and tracking anything. However, the complex computational characteristics of SAM 2's multi-stage image encoder and memory module have raised the barrier to the model's deployment in practical applications. To address this issue, we propose TinySAM 2, a lightweight video segmentation model that balances performance and efficiency. First, a memory quality management mechanism is introduced to select and retain high-informative historical frames as the memory. In addition, a joint-spatial-temporal token compression is proposed that reduces the memory storage and computational cost. Specifically, average pooling is employed to first compress redundancy tokens in the spatial domain. In the temporal domain, informative tokens are selected across frames in the memory bank based on token-level similarity measurement. Besides, we take RepViT as the lightweight image encoder, which further reduces the model parameters. Extensive experiments on challenging datasets such as DAVIS and SA-V demonstrate that TinySAM 2 achieves 90% of the performance of SAM 2.1, with only 7% memory tokens and 3% training data. This study effectively alleviates the bottlenecks in parameter count, computational load, and deployment costs associated with SAM 2, providing a resource-efficient solution for the widespread application of video segmentation models on devices.