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

优化 ViViT 训练:面向动作识别的时间与内存缩减

Optimizing ViViT Training: Time and Memory Reduction for Action Recognition

University of Edinburgh(爱丁堡大学);Google Research(谷歌研究院)

Shreyank N Gowda, Anurag Arnab, Jonathan Huang

AI总结:

针对 ViViT Factorised Encoder 动作识别训练耗时耗内存的问题,本文通过冻结空间 transformer、合理初始化时间 transformer 并加入紧凑 adapter,在 6 个基准上以约 50% 的训练成本降低实现同等或更优性能。

摘要:

在本文中,我们应对视频 transformer 所带来的巨大训练时间和内存消耗挑战,重点关注 ViViT(Video Vision Transformer,视频视觉 Transformer)模型,尤其是 Factorised Encoder(分解编码器)版本,并将其作为我们动作识别任务的基线。分解编码器变体遵循许多最先进方法所采用的后融合方案。尽管它在 ViViT 的不同变体中凭借良好的速度/准确率权衡脱颖而出,但其可观的训练时间和内存需求仍构成显著的入门障碍。我们的方法旨在降低这一障碍,其基本思路是在训练期间冻结空间 transformer。如果简单直接地这样做,会得到一个低准确率模型。但我们表明,通过(1)恰当地初始化时间 transformer(负责处理时间信息的模块),(2)引入一个紧凑的 adapter 模型,将冻结的空间表示(一个选择性关注输入图像区域的模块)连接到时间 transformer,我们就可以在不牺牲准确率的情况下享受冻结空间 transformer 带来的好处。通过在 6 个基准测试上的大量实验,我们证明所提出的训练策略显著降低了训练成本(约 50%)和内存消耗,同时与基线模型相比保持或略微提升了最高达 1.79% 的性能。此外,我们的方法还解锁了利用更大图像 transformer 模型作为空间 transformer,并在相同内存消耗下访问更多帧的能力。

英文摘要:

In this paper, we address the challenges posed by the substantial training time and memory consumption associated with video transformers, focusing on the ViViT (Video Vision Transformer) model, in particular the Factorised Encoder version, as our baseline for action recognition tasks. The factorised encoder variant follows the late-fusion approach that is adopted by many state of the art approaches. Despite standing out for its favorable speed/accuracy tradeoffs among the different variants of ViViT, its considerable training time and memory requirements still pose a significant barrier to entry. Our method is designed to lower this barrier and is based on the idea of freezing the spatial transformer during training. This leads to a low accuracy model if naively done. But we show that by (1) appropriately initializing the temporal transformer (a module responsible for processing temporal information) (2) introducing a compact adapter model connecting frozen spatial representations ((a module that selectively focuses on regions of the input image) to the temporal transformer, we can enjoy the benefits of freezing the spatial transformer without sacrificing accuracy. Through extensive experimentation over 6 benchmarks, we demonstrate that our proposed training strategy significantly reduces training costs (by $\sim 50\%$) and memory consumption while maintaining or slightly improving performance by up to 1.79\% compared to the baseline model. Our approach additionally unlocks the capability to utilize larger image transformer models as our spatial transformer and access more frames with the same memory consumption.

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

↑