Abstract
Video transformers have recently emerged as an effective alternative to convolutional networks for action classification. However, most prior video transformers adopt either global space-time attention or hand-defined strategies to compare patches within and across frames. These fixed attention schemes not only have high computational cost but, by comparing patches at predetermined locations, they neglect the motion dynamics in the video. In this paper, we introduce the Deformable Video Transformer (DVT), which dynamically predicts a small subset of video patches to attend for each query location based on motion information, thus allowing the model to decide where to look in the video based on correspondences across frames. Crucially, these motion-based correspondences are obtained at zero-cost from information stored in the compressed format of the video. Our deformable attention mechanism is optimized directly with respect to classification performance, thus eliminating the need for suboptimal hand-design of attention strategies. Experiments on four large-scale video benchmarks (Kinetics-400, Something-Something-V2, EPIC-KITCHENS and Diving-48) demonstrate that, compared to existing video transformers, our model achieves higher accuracy at the same or lower computational cost, and it attains state-of-the-art results on these four datasets.
Introduction
Standard Vision Transformers (ViTs) are computationally intensive when applied to video data. The number of patches scales with both image resolution and frame count, leading to a global self-attention complexity of $O(S^2T^2)$. While previous models attempted to mitigate this via "divided attention" (e.g., fixed spatial locations across frames), these methods create a "time tube" effect that fails to account for object motion. The Deformable Video Transformer (DVT) addresses this by dynamically selecting a sparse subset of patches to attend to, guided by motion dynamics.
Methodology
The core innovation of DVT lies in its ability to track moving objects across time without the overhead of calculating optical flow.
Deformable Space-Time Attention (D-ST-A)
Instead of attending to all patches, DVT predicts a small set of $N$ locations (typically $N=8$) to sample. These locations are determined by combining patch appearance with motion displacements (MDs).
Zero-Cost Motion Cues
DVT leverages motion vectors already stored in compressed video formats (like H.264/MPEG-4). By extracting these vectors directly from the compressed stream, the model gains a "free" estimate of object movement between frames, which serves as a prior for the deformable attention mechanism.
Multi-Scale and Fusion
To handle varying object sizes, the model employs Deformable Multi-Scale Attention (D-MS-A) within individual frames. Temporal and spatial insights are then integrated using either linear projections or an MLP-Mixer module.
Experiments and Results
DVT was evaluated on four major benchmarks: Kinetics-400 (general action), Something-Something-V2 (motion-critical interactions), EPIC-KITCHENS-100 (egocentric), and Diving-48 (fine-grained maneuvers).
Performance and Efficiency
DVT demonstrates superior efficiency, achieving state-of-the-art results with significantly fewer GFLOPs. For instance, it is approximately 7 times more efficient than MotionFormer while maintaining higher accuracy.
Key results include:
- Kinetics-400: 84.7% Top-1 accuracy.
- Something-Something-V2: 68.5% Top-1 accuracy, a +2.8% improvement over the MViT baseline.
- Diving-48: 86.9% Top-1 accuracy.
Conclusion
DVT proves that sparsity in attention is sufficient for high-performance video classification. By utilizing "zero-cost" motion vectors from video codecs, the model effectively tracks salient objects through time. Future work may address the noise accumulation in codec-based motion vectors over longer temporal horizons to extend the model's effective memory.
Summary updated