[论文解读] Space-time Mixing Attention for Video Transformer
提出了一种具有时空混合注意力的视频 Transformer,通过将时间注意力限制在局部窗口并高效混合时空信息,加上轻量级的时间聚合机制,使帧数线性缩放。
This paper is on video recognition using Transformers. Very recent attempts in this area have demonstrated promising results in terms of recognition accuracy, yet they have been also shown to induce, in many cases, significant computational overheads due to the additional modelling of the temporal information. In this work, we propose a Video Transformer model the complexity of which scales linearly with the number of frames in the video sequence and hence induces no overhead compared to an image-based Transformer model. To achieve this, our model makes two approximations to the full space-time attention used in Video Transformers: (a) It restricts time attention to a local temporal window and capitalizes on the Transformer's depth to obtain full temporal coverage of the video sequence. (b) It uses efficient space-time mixing to attend jointly spatial and temporal locations without inducing any additional cost on top of a spatial-only attention model. We also show how to integrate 2 very lightweight mechanisms for global temporal-only attention which provide additional accuracy improvements at minimal computational cost. We demonstrate that our model produces very high recognition accuracy on the most popular video recognition datasets while at the same time being significantly more efficient than other Video Transformer models. Code will be made available.
研究动机与目标
- 解决视频 Transformer 中全时空注意力的计算瓶颈。
- 提出局部时间窗口与时空混合机制以实现 O(TS^2) 复杂度。
- 在减少 FLOPs 的同时维持或提高与同期视频 Transformer 的准确性。
- 通过轻量级全局时间注意力和摘要令牌实现高效时间聚合。
提出的方法
- 对每帧计算基于补丁的 token 表示,带有空间和时间位置编码。
- 引入局部时间窗口注意力: y^l_{s,t} = sum_{t' in window} sum_s' Softmax(q^l_{s,t}·k^l_{s',t'}) v^l_{s',t'}.
- 应用 shift 技巧通过从相邻帧构造一个单一的 attended key 向量来实现时空混合(方程 9–10)。
- 实现每层 O(TS^2) 的复杂度,匹配仅空间注意力的成本。
- 可选地在类别令牌上整合轻量级全局时间注意力(Temporal Attention)以提高准确性。
- 探索 Summary token 机制以总结帧信息,并在 key/value 计算时对其进行注意。
实验结果
研究问题
- RQ1局部时间窗口加上时空混合是否能在视频 Transformer 中高效接近全时空注意力?
- RQ2提出的注意力方案在保持或降低 FLOPs 的同时,是否能保持与现有视频 Transformer 相竞争的准确性?
- RQ3局部窗口大小、TA 层放置和时间聚合对性能有何影响?
- RQ4轻量级时间聚合和摘要令牌在成本极小的情况下是否带来有意义的收益?
主要发现
- 达到 O(TS^2) 的复杂度,与仅空间注意力相匹配,并优于其他注重效率的 Video Transformer。
- 在测试设置中最佳的局部窗口大小 t_w = 1,相比 t_w = 0(仅空间)有显著提升,且 t_w = 2 因边界效应略有下降。
- 对 key 和 value 向量进行时空混合的变体在混合方式中提供了最强的准确性提升。
- 使用一个 Temporal Attention 层进行时间聚合比简单的时间平均提高了 Top-1 约 2 个百分点;更多 TA 层并无进一步帮助。
- 在 SSv2、Kinetics-400、Kinetics-600 和 Epic Kitchens 上,X-ViT 与现有最先进方法持平或超越,同时比 TimeSformer 和 ViViT 变体显著更高效。
- 将输入帧从 8 帧增加到 16 帧,在 SSv2 上带来约 1.8% 的 Top-1 增益;32 帧带来更小的额外增益。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。