[Paper Review] UniFormer: Unified Transformer for Efficient Spatiotemporal Representation Learning
UniFormer integrates 3D convolution and spatiotemporal self-attention into a unified transformer to efficiently learn local redundancy and global dependency in video representations, achieving strong accuracy with substantially fewer GFLOPs.
It is a challenging task to learn rich and multi-scale spatiotemporal semantics from high-dimensional videos, due to large local redundancy and complex global dependency between video frames. The recent advances in this research have been mainly driven by 3D convolutional neural networks and vision transformers. Although 3D convolution can efficiently aggregate local context to suppress local redundancy from a small 3D neighborhood, it lacks the capability to capture global dependency because of the limited receptive field. Alternatively, vision transformers can effectively capture long-range dependency by self-attention mechanism, while having the limitation on reducing local redundancy with blind similarity comparison among all the tokens in each layer. Based on these observations, we propose a novel Unified transFormer (UniFormer) which seamlessly integrates merits of 3D convolution and spatiotemporal self-attention in a concise transformer format, and achieves a preferable balance between computation and accuracy. Different from traditional transformers, our relation aggregator can tackle both spatiotemporal redundancy and dependency, by learning local and global token affinity respectively in shallow and deep layers. We conduct extensive experiments on the popular video benchmarks, e.g., Kinetics-400, Kinetics-600, and Something-Something V1&V2. With only ImageNet-1K pretraining, our UniFormer achieves 82.9%/84.8% top-1 accuracy on Kinetics-400/Kinetics-600, while requiring 10x fewer GFLOPs than other state-of-the-art methods. For Something-Something V1 and V2, our UniFormer achieves new state-of-the-art performances of 60.9% and 71.2% top-1 accuracy respectively. Code is available at https://github.com/Sense-X/UniFormer.
Motivation & Objective
- Motivate efficient spatiotemporal learning from high-dimensional video data by addressing local redundancy and long-range dependency.
- Propose a unified transformer (UniFormer) that blends local 3D-convolution-like operations with global self-attention in a task-optimized architecture.
- design a multi-head relation aggregator that handles local and global token relations in shallow and deep layers, respectively.
- Demonstrate state-of-the-art performance on Kinetics-400/600 and Something-Something V1/V2 with reduced GFLOPs.
- Provide ablations and analyses to understand the effects of unified attention, dynamic position embedding, and staging on performance.
Proposed method
- Introduce UniFormer blocks comprising Dynamic Position Embedding (DPE), Multi-Head Relation Aggregator (MHRA), and Feed-Forward Network (FFN).
- MHRA learns local relations in shallow layers via a local token affinity matrix resembling a spatiotemporal convolution, and learns global relations in deep layers via content-based similarity (Q/K) akin to self-attention.
- DPE extends conditional position encoding using 3D depthwise convolution to maintain spatiotemporal ordering and handle variable clip lengths.
- Stack UniFormer blocks in a hierarchical four-stage network with stage-wise local MHRA in early stages and global MHRA in later stages, enabling joint spatiotemporal context modeling.
- Provide a convolution-like interpretation for the local MHRA as PWConv-DWConv-PWConv blocks and demonstrate efficiency gains over purely attention-based designs.
- Show experimental results across Kinetics-400/600 and Something-Something V1/V2 with ImageNet-1K pretraining, achieving high accuracy at substantially lower GFLOPs.
Experimental results
Research questions
- RQ1Can a unified transformer architecture jointly optimize local spatiotemporal redundancy reduction and global dependency modeling for efficient video understanding?
- RQ2Does combining 3D-convolution-like local relations with global self-attention in a single MHRA module yield better computation-accuracy trade-offs than existing video transformers?
- RQ3How do dynamic position embeddings and block-level design choices (local vs. global MHRA across stages) impact performance and transferability?
- RQ4What are the effects of pretraining, input tube size, and sampling strategies on UniFormer’s robustness and transfer learning?
- RQ5How does UniFormer perform on standard video benchmarks (Kinetics-400/600, Something-Something V1/V2) compared to state-of-the-art methods?
Key findings
- Achieves 82.9% top-1 on Kinetics-400 and 84.8% on Kinetics-600 with ImageNet-1K pretraining and 10x fewer GFLOPs than many SOTA methods.
- Surpasses previous state-of-the-art on Something-Something V1 (60.9% top-1) and V2 (71.2% top-1).
- Local MHRA in shallow layers effectively reduces local redundancy with low computation, while global MHRA in deep layers captures long-range dependencies with high discriminative power.
- Joint spatiotemporal MHRA outperforms divided spatial/temporal attention and improves transfer learning performance.
- Dynamic Position Embedding (DPE) improves accuracy (up to ~1.7% top-1 on Kinetics-400) by encoding spatiotemporal position information.
- Ablations show a favorable balance when using local MHRA in early stages and global MHRA in later stages, outperforming purely local or purely global configurations.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.