Papers › ResT: An Efficient Transformer for Visual Recognition

ResT: An Efficient Transformer for Visual Recognition

28 May 2021NeurIPS 2021 12arXiv:2105.13677archive 2025-07-28

Qinglong Zhang, YuBin Yang

This paper presents an efficient multi-scale vision Transformer, called ResT, that capably served as a general-purpose backbone for image recognition. Unlike existing Transformer methods, which employ standard Transformer blocks to tackle raw images with a fixed resolution, our ResT have several advantages: (1) A memory-efficient multi-head self-attention is built, which compresses the memory by a simple depth-wise convolution, and projects the interaction across the attention-heads dimension while keeping the diversity ability of multi-heads; (2) Position encoding is constructed as spatial attention, which is more flexible and can tackle with input images of arbitrary size without interpolation or fine-tune; (3) Instead of the straightforward tokenization at the beginning of each stage, we design the patch embedding as a stack of overlapping convolution operation with stride on the 2D-reshaped token map. We comprehensively validate ResT on image classification and downstream tasks. Experimental results show that the proposed ResT can outperform the recently state-of-the-art backbones by a large margin, demonstrating the potential of ResT as strong backbones. The code and models will be made publicly available at https://github.com/wofmanaf/ResT.

PaperPDFConference PDFCodeCode 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="2105.13677")

Code

Syntology Ran 1 of 9 code samples harvested from 1 repository linked to this paper; 8 have no recorded run. Of those that ran: 1 ran with no contract checked.

By repository: official repository: 9 samples from 1 repository, 1 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

wofmanaf/ResT officialmentioned in papermentioned on GitHubpytorchApache-2.0 report
sithu31296/semantic-segmentation mentioned on GitHubpytorch 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

9 samples harvested; 1 ran; 0 honoured the contract we drafted; 8 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
8unverified

Licence: 9 of the 9 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 wofmanaf/ResT. “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.

build_transform wofmanaf/ResT/datasets.py official repository ran Apache-2.0 recorded; this copy not marked cleared · pointer only · 6a0317bfd6be9557 · report
attn_flops wofmanaf/ResT/get_flops.py official repository unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 3c6688ac878a6fe8 · report
build_dataset wofmanaf/ResT/datasets.py official repository unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 8f9624e6bef0eeae · report
fourier wofmanaf/ResT/fourier_analysis.py official repository unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · ae74acedd042c1b1 · report
get_flops wofmanaf/ResT/get_flops.py official repository unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · de5fef9f979995e1 · report
get_layer_id_for_rest wofmanaf/ResT/optim_factory.py official repository unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · e761e05ddc7ffc66 · report
get_parameter_groups wofmanaf/ResT/optim_factory.py official repository unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 7de76b9d1b1f4ea4 · report
make_segments wofmanaf/ResT/fourier_analysis.py official repository unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 983d59bb1110637b · report
shift wofmanaf/ResT/fourier_analysis.py official repository unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 4250eda6a35c9d8c · report

Tasks

DiversityImage Classificationimage-classification

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Classification ImageNet ResT-Large GFLOPs 7.9 #415 of 1060 Archive leaderboard report
Image Classification ImageNet ResT-Large Number of params 51.63M #415 of 1060 Archive leaderboard report
Image Classification ImageNet ResT-Large Top 1 Accuracy 83.6% #415 of 1060 Archive leaderboard report
Image Classification ImageNet ResT-Small GFLOPs 1.9 #749 of 1060 Archive leaderboard report
Image Classification ImageNet ResT-Small Number of params 13.66M #749 of 1060 Archive leaderboard report
Image Classification ImageNet ResT-Small Top 1 Accuracy 79.6% #749 of 1060 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionBPEConvolutionDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

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