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 View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 9 code samples harvested from 1 repository linked to this paper: 9 ran (of which 0 constructed an object rather than computing a result; 9 with no instrument failure: 0 honoured, 0 violated, 9 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code; here there are none.

By repository: official repository: 9 samples from 1 repository, 9 ran (9 with no instrument failure; 0 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 2 of its repositories that Syntology harvested for other papers:

Levels written between 2026-09-24 and 2026-09-25 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

wofmanaf/ResT officialmentioned in papermentioned on GitHubpytorchApache-2.0Syntology: 9 samples, 9 ran (0 instrument-failed) · 0 unverified report
sithu31296/semantic-segmentation mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers (arXiv:2105.15203; that paper's own run record: 66 ran (of which 22 constructed an object rather than computing a result; 52 with no instrument failure: 1 honoured, 2 violated, 49 with no contract checked; 14 where Syntology's instrument failed) · 20 unverified), FaPN: Feature-aligned Pyramid Network for Dense Image Prediction (arXiv:2108.07058; that paper's own run record: 2 ran (of which 0 constructed an object rather than computing a result; 2 with no instrument failure: 0 honoured, 0 violated, 2 with no contract checked; 0 where Syntology's instrument failed) · 2 unverified) and A ConvNet for the 2020s (arXiv:2201.03545; that paper's own run record: 57 ran (of which 39 constructed an object rather than computing a result; 49 with no instrument failure: 2 honoured, 0 violated, 47 with no contract checked; 8 where Syntology's instrument failed) · 23 unverified); nothing checks that they implement this paper's method. report
xmu-xiaoma666/External-Attention-pytorch mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Attention Is All You Need (arXiv:1706.03762; that paper's own run record: 610 ran (of which 293 constructed an object rather than computing a result; 529 with no instrument failure: 45 honoured, 15 violated, 469 with no contract checked; 81 where Syntology's instrument failed) · 336 unverified), RepVGG: Making VGG-style ConvNets Great Again (arXiv:2101.03697; that paper's own run record: 13 ran (of which 7 constructed an object rather than computing a result; 8 with no instrument failure: 0 honoured, 0 violated, 8 with no contract checked; 5 where Syntology's instrument failed) · 3 unverified), Involution: Inverting the Inherence of Convolution for Visual Recognition (arXiv:2103.06255; that paper's own run record: 7 ran (of which 7 constructed an object rather than computing a result; 7 with no instrument failure: 0 honoured, 0 violated, 7 with no contract checked; 0 where Syntology's instrument failed) · 2 unverified; every one of the 7 samples that ran constructed an object rather than computing a result) and 4 more (every one in this page's JSON twin); nothing checks that they implement this paper's method. report
BR-IDL/PaddleViT paddleSyntology: not harvested report
mindspore-courses/External-Attention-MindSpore mindsporeSyntology: not harvested 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.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

9 samples harvested: 9 ran (of which 0 constructed an object rather than computing a result; 9 with no instrument failure: 0 honoured, 0 violated, 9 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

9ran

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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

wofmanaf/ResT official repository 9 samples, 9 ran (0 instrument-failed) · 0 unverified
attn_flops get_flops.py ran fingerprinted Apache-2.0 recorded; this copy not marked cleared · pointer only · 3c6688ac878a6fe8 · report fixture: signature h:int/0/int, w:int/0/int, r:int/0/int, dim:int/0/int · returned int · level recorded 2026-09-25
build_dataset in 151 papers datasets.py ran Apache-2.0 recorded; this copy not marked cleared · pointer only · 8f9624e6bef0eeae · report fixture: signature is_train:bool/0/bool, args:ArgsConfig/0/? · returned tuple · level recorded 2026-09-25
build_transform in 170 papers datasets.py ran Apache-2.0 recorded; this copy not marked cleared · pointer only · 6a0317bfd6be9557 · report fixture: signature is_train:bool/0/bool, args:Namespace/0/? · returned Compose · level recorded 2026-09-24
fourier fourier_analysis.py ran fingerprinted Apache-2.0 recorded; this copy not marked cleared · pointer only · ae74acedd042c1b1 · report fixture: signature x:Tensor/4/float · returned Tensor · level recorded 2026-09-25
get_flops in 14 papers get_flops.py ran Apache-2.0 recorded; this copy not marked cleared · pointer only · de5fef9f979995e1 · report fixture: returned tuple · level recorded 2026-09-25
get_layer_id_for_rest optim_factory.py ran Apache-2.0 recorded; this copy not marked cleared · pointer only · e761e05ddc7ffc66 · report fixture: signature model:callable/0/?, name:str/0/str · returned int · level recorded 2026-09-25
get_parameter_groups in 30 papers optim_factory.py ran Apache-2.0 recorded; this copy not marked cleared · pointer only · 7de76b9d1b1f4ea4 · report fixture: signature model:callable/0/?, weight_decay:float/0/float, skip_list:tuple/1/empty, get_num_layer:callable/0/?, get_layer_scale:callable/0/? · returned list · level recorded 2026-09-25
make_segments fourier_analysis.py ran Apache-2.0 recorded; this copy not marked cleared · pointer only · 983d59bb1110637b · report fixture: signature x:ndarray/1/float, y:ndarray/1/float · returned ndarray · level recorded 2026-09-25
shift in 22 papers
census: 5 implementations from 5 papers, 5 distinct outputs across 4 buckets, one shared input per bucket
fourier_analysis.py ran fingerprinted Apache-2.0 recorded; this copy not marked cleared · pointer only · 4250eda6a35c9d8c · report fixture: signature x:Tensor/4/float · returned Tensor · level recorded 2026-09-25

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