UniFormer: Unified Transformer for Efficient Spatiotemporal Representation Learning

Kunchang Li, Yali Wang, Peng Gao, Guanglu Song, Yu Liu +2 more
1/12/2022
403 citations
cs.CV
transformer-attention

Official code: Sense-X/UniFormer (913 stars, Python, Apache-2.0, last commit 2024-03-29).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

Sense-X/UniFormerOfficial100%
Apache-2.0

[ICLR2022] official implementation of UniFormer

913115Python, Jupyter NotebookJan 12, 20222 years agoApache-2.0
image-classificationobject-detectionpose-estimationsemantic-segmentationvideo-classification

Similar Papers

Cite this paper

@article{li2022uniformer,
  title  = {UniFormer: Unified Transformer for Efficient Spatiotemporal Representation Learning},
  author = {Kunchang Li and Yali Wang and Peng Gao and Guanglu Song and Yu Liu and Hongsheng Li and Yu Qiao},
  year   = {2022},
  eprint = {2201.04676},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2201.04676}
}

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/2201.04676.svg)](https://codeofpaper.com/paper/2201.04676)

Discussion