decomposes the attention computation in three distinct steps:
over time, width and height. A decomposed attention over
the two spatial axes of the image was proposed in (Ho
et al., 2019; Huang et al., 2019; Wang et al., 2020b) and
our (T+W+H) adds a third dimension (time) for the case
of video. All these models are implemented by learning
distinct query/key/value matrices for each attention step.
4. Experiments
We evaluate TimeSformer on four popular action recognition datasets: Kinetics-400 (Carreira & Zisserman, 2017),
Kinetics-600 (Carreira et al., 2018), Something-SomethingV2 (Goyal et al., 2017b), and Diving-48 (Li et al., 2018). We
adopt the “Base” ViT architecture (Dosovitskiy et al., 2020)
pretrained on either ImageNet-1K or ImageNet-21K (Deng
et al., 2009), as speciﬁed for each experiment. Unless differently indicated, we use clips of size 8224224, with
frames sampled at a rate of 1=32. The patch size is 1616
pixels. During inference, unless otherwise noted, we sample a single temporal clip in the middle of the video. We
We present a convolution-free approach to video classification built
exclusively on self-attention over space and time. Our method, named
"TimeSformer," adapts the standard Transformer architecture to video by
enabling spatiotemporal feature learning directly from a sequence of
frame-level patches. Our experimental study compares different self-attention
schemes and suggests that "divided attention," where temporal attention and
spatial attention are separately applied within each block, leads to the best
video classification accuracy among the design choices considered. Despite the
radically new design, TimeSformer achieves state-of-the-art results on several
action recognition benchmarks, including the best reported accuracy on
Kinetics-400 and Kinetics-600. Finally, compared to 3D convolutional networks,
our model is faster to train, it can achieve dramatically higher test
efficiency (at a small drop in accuracy), and it can also be applied to much
longer video clips (over one minute long). Code and models are available at:
https://github.com/facebookresearch/TimeSformer.
Gedas Bertasius Heng Wang Lorenzo Torresani