Space-time Mixing Attention for Video Transformer

Adrian Bulat, Juan-Manuel Perez-Rua, Swathikiran Sudhakaran, Brais Martinez, Georgios Tzimiropoulos
6/10/2021
cs.CVcs.AIcs.LG
transformer-attention

Official code: 1adrianb/video-transformers (47 stars, Python, Apache-2.0, last commit 2022-04-14).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

Apache-2.0
477PythonOct 31, 20214 years agoApache-2.0

Similar Papers

Cite this paper

@article{bulat2021spacetime,
  title  = {Space-time Mixing Attention for Video Transformer},
  author = {Adrian Bulat and Juan-Manuel Perez-Rua and Swathikiran Sudhakaran and Brais Martinez and Georgios Tzimiropoulos},
  year   = {2021},
  eprint = {2106.05968},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2106.05968}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2106.05968.svg)](https://codeofpaper.com/paper/2106.05968)

Discussion