Papers › UniFormer: Unified Transformer for Efficient Spatiotemporal Representation Learning

UniFormer: Unified Transformer for Efficient Spatiotemporal Representation Learning

12 Jan 2022arXiv:2201.04676archive 2025-07-28

Kunchang Li, Yali Wang, Peng Gao, Guanglu Song, Yu Liu, Hongsheng Li, Yu Qiao

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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2201.04676")

Code

Syntology Ran 27 of 37 code samples harvested from 3 repositories linked to this paper; 10 have no recorded run. Of those that ran: 1 ran · honoured contract; 8 ran · our draft was wrong; 3 ran · fixture could not drive it; 15 ran with no contract checked.

By repository: official repository: 5 samples from 1 repository, 4 ran; community (archive-listed): 30 samples from 1 repository, 23 ran; community: 2 samples from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

sense-x/uniformer officialmentioned in papermentioned on GitHubpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

37 samples harvested; 27 ran; 1 honoured the contract we drafted; 10 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
8ran · our draft was wrong
3ran · fixture could not drive it
15ran
10unverified

Licence: 0 of the 37 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 3 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

CBlock sense-x/uniformer/image_classification/models/uniformer.py official repository ran Apache-2.0 (permissive) · e8faab56f5f8df9b · report
SABlock sense-x/uniformer/image_classification/models/uniformer.py official repository ran Apache-2.0 (permissive) · 8a8dcc08ab9bfa65 · report
head_embedding sense-x/uniformer/image_classification/models/uniformer.py official repository ran fingerprinted Apache-2.0 (permissive) · 0c3842c98c1ef897 · report
middle_embedding sense-x/uniformer/image_classification/models/uniformer.py official repository ran fingerprinted Apache-2.0 (permissive) · 8f5a6c1aca9ba4de · report
UniFormer sense-x/uniformer/image_classification/models/uniformer.py official repository unverified Apache-2.0 (permissive) · 199ff8d54ab96603 · report
CBlock towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · f8b18bc5e8ba3ac5 · report
CMlp towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 3fca321b162e5063 · report
DropPath towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · metamorphic tier: deterministic fingerprinted Apache-2.0 (permissive) · 8f059bf3db11537b · report
Dropout towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 6b2146395f61d804 · report
Einsum towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · d2f31546ef368292 · report
GELU towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · d4114dbf5943332c · report
Linear towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 82f963c4eb1876d4 · report
Mlp towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 865f8893e93aa461 · report
PatchEmbed towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · e23cb083b2438d3d · report
Softmax towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 15c57dc641cf3d74 · report
SpeicalPatchEmbed towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran fingerprinted Apache-2.0 (permissive) · 68e7dd5cd494241b · report
_no_grad_trunc_normal_ towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · fixture could not drive it Apache-2.0 (permissive) · 607038475fdc388b · report
_ntuple towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · 2f3cf06bc7cb9815 · report
bn_3d towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · 5e851f59c9824316 · report
conv_1x1x1 towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · 84e3e49d2ae685c9 · report
conv_1xnxn towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · 0120a7f1a1e50907 · report
conv_3x3x3 towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · b7ed0955d5e0c6f0 · report
conv_3xnxn towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · 813d5682c2f6b672 · report
conv_3xnxn_std towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · 7e0fda53f432a9bd · report
conv_5x5x5 towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · b2472041187c554f · report
drop_path towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · fixture could not drive it Apache-2.0 (permissive) · 39eace7e2822504f · report
safe_divide towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · honoured contract fingerprinted Apache-2.0 (permissive) · 507e144112f81dc6 · report
trunc_normal_ towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) ran · fixture could not drive it Apache-2.0 (permissive) · f3e47c6e3250d13b · report
MultiHeadAttention towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) unverified Apache-2.0 (permissive) · e00c355740a3cab6 · report
RelProp towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) unverified Apache-2.0 (permissive) · e04c66afc6a652b1 · report
RelPropSimple towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) unverified Apache-2.0 (permissive) · 1bc2938f5a5b8e2e · report
SABlock towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) unverified Apache-2.0 (permissive) · 2e84a2e6147c7e87 · report
SplitSABlock towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) unverified Apache-2.0 (permissive) · 79921eebe00978bd · report
Uniformer towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) unverified Apache-2.0 (permissive) · 2e4559833b1c24b6 · report
forward_hook towhee-io/towhee/towhee/models/uniformer/uniformer.py community (archive-listed) unverified Apache-2.0 (permissive) · f1b1138b372a9b03 · report
FeedForward lucidrains/uniformer-pytorch/uniformer_pytorch/uniformer_pytorch.py community unverified MIT (permissive) · 298b1968dc3403b8 · report
exists lucidrains/uniformer-pytorch/uniformer_pytorch/uniformer_pytorch.py community unverified MIT (permissive) · 570499cd4f300cb8 · report

Tasks

Representation Learning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

3D ConvolutionConvolution

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections