Papers › Bottleneck Transformers for Visual Recognition

Bottleneck Transformers for Visual Recognition

27 Jan 2021CVPR 2021 1arXiv:2101.11605archive 2025-07-28

Aravind Srinivas, Tsung-Yi Lin, Niki Parmar, Jonathon Shlens, Pieter Abbeel, Ashish Vaswani

We present BoTNet, a conceptually simple yet powerful backbone architecture that incorporates self-attention for multiple computer vision tasks including image classification, object detection and instance segmentation. By just replacing the spatial convolutions with global self-attention in the final three bottleneck blocks of a ResNet and no other changes, our approach improves upon the baselines significantly on instance segmentation and object detection while also reducing the parameters, with minimal overhead in latency. Through the design of BoTNet, we also point out how ResNet bottleneck blocks with self-attention can be viewed as Transformer blocks. Without any bells and whistles, BoTNet achieves 44.4% Mask AP and 49.7% Box AP on the COCO Instance Segmentation benchmark using the Mask R-CNN framework; surpassing the previous best published single model and single scale results of ResNeSt evaluated on the COCO validation set. Finally, we present a simple adaptation of the BoTNet design for image classification, resulting in models that achieve a strong performance of 84.7% top-1 accuracy on the ImageNet benchmark while being up to 1.64x faster in compute time than the popular EfficientNet models on TPU-v3 hardware. We hope our simple and effective approach will serve as a strong baseline for future research in self-attention models for vision

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="2101.11605")

Code

Syntology Ran 26 of 49 code samples harvested from 9 repositories linked to this paper; 23 have no recorded run. Of those that ran: 1 ran · honoured contract; 2 ran · our draft was wrong; 5 ran · fixture could not drive it; 18 ran with no contract checked.

By repository: community (archive-listed): 49 samples from 9 repositories, 26 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

13 repositories listed; official and paper-mentioned ones first.

BIGBALLON/distribuuuu mentioned on GitHubpytorch report
BR-IDL/PaddleViT mentioned on GitHubpaddleApache-2.0 report
NZ99/bottleneck-transformer-flax mentioned on GitHubjax report
kevin-ssy/ViP mentioned on GitHubpytorchMIT report
leaderj1001/BottleneckTransformers mentioned on GitHubpytorch report
nachiket273/VisTrans mentioned on GitHubpytorch report
rwightman/pytorch-image-models mentioned on GitHubpytorch report
scheshmi/BottleneckTransformers 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

49 samples harvested; 26 ran; 1 honoured the contract we drafted; 23 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
2ran · our draft was wrong
5ran · fixture could not drive it
18ran
23unverified

Licence: 8 of the 49 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 9 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.

AbsPosEmb BIGBALLON/distribuuuu/distribuuuu/models/botnet.py community (archive-listed) ran MIT (permissive) · bf90d53646507d1c · report
AbsPosEmb CandiceD17/Bottleneck-Transformers-for-Visual-Recognition/model/botnet.py community (archive-listed) ran · metamorphic tier: invariant no licence file found · pointer only · abdfbeb02321716b · report
AbsPosEmb lucidrains/bottleneck-transformer-pytorch/bottleneck_transformer_pytorch/bottleneck_transformer_pytorch.py community (archive-listed) ran · metamorphic tier: invariant MIT (permissive) · 55cdbdffabd748b8 · report
Attention lucidrains/bottleneck-transformer-pytorch/bottleneck_transformer_pytorch/bottleneck_transformer_pytorch.py community (archive-listed) ran · metamorphic tier: invariant MIT (permissive) · 1ee91139c3f9ceb2 · report
Block scheshmi/BottleneckTransformers/model.py community (archive-listed) ran no licence file found · pointer only · 5f213d496b96f84d · report
BoTBlock BIGBALLON/distribuuuu/distribuuuu/models/botnet.py community (archive-listed) ran MIT (permissive) · 3f06d18fc36f803d · report
BoTNet_Layer MartinGer/Bottleneck-Transformers-for-Visual-Recognition/BoTNet_Layer.py community (archive-listed) ran no licence file found · pointer only · eda28b8215e9ff22 · report
Bottleneck leaderj1001/BottleneckTransformers/model.py community (archive-listed) ran MIT (permissive) · a1c9f8ce96f754a0 · report
BottleneckAttention The-AI-Summer/self_attention/self_attention_cv/bottleneck_transformer/bot_block.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 47c97b7ed35a625f · report
GroupPointWise nachiket273/VisTrans/vistrans/models/botnet.py community (archive-listed) ran fingerprinted MIT (permissive) · 228f55a9b608179b · report
MHSA BIGBALLON/distribuuuu/distribuuuu/models/botnet.py community (archive-listed) ran MIT (permissive) · 3d387b9ea3a491be · report
MHSA leaderj1001/BottleneckTransformers/model.py community (archive-listed) ran · metamorphic tier: invariant MIT (permissive) · b4f23ec7b5e89157 · report
MHSA scheshmi/BottleneckTransformers/model.py community (archive-listed) ran · metamorphic tier: invariant fingerprinted no licence file found · pointer only · e3afa08cab48c4cf · report
RelPosEmb BIGBALLON/distribuuuu/distribuuuu/models/botnet.py community (archive-listed) ran MIT (permissive) · 1e8e321a97002a33 · report
RelPosEmb CandiceD17/Bottleneck-Transformers-for-Visual-Recognition/model/botnet.py community (archive-listed) ran no licence file found · pointer only · 90d22099bc8bc6ad · report
RelPosEmb lucidrains/bottleneck-transformer-pytorch/bottleneck_transformer_pytorch/bottleneck_transformer_pytorch.py community (archive-listed) ran · metamorphic tier: invariant MIT (permissive) · 5f7d1c16442b0f3c · report
RelPosEmb1D The-AI-Summer/self_attention/self_attention_cv/bottleneck_transformer/bot_block.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 612b904217f4544b · report
RelPosEmb2D The-AI-Summer/self_attention/self_attention_cv/bottleneck_transformer/bot_block.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 22fb48daf7ae0cc4 · report
_conv2d1x1 The-AI-Summer/self_attention/self_attention_cv/bottleneck_transformer/bot_block.py community (archive-listed) ran · our draft was wrong MIT (permissive) · b4c16d4e84a73b3d · report
expand_dim BIGBALLON/distribuuuu/distribuuuu/models/botnet.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · ddac376537265a32 · report
pair lucidrains/bottleneck-transformer-pytorch/bottleneck_transformer_pytorch/bottleneck_transformer_pytorch.py community (archive-listed) ran · honoured contract fingerprinted MIT (permissive) · 3e27684df29ad41d · report
rel_pos_emb_1d The-AI-Summer/self_attention/self_attention_cv/bottleneck_transformer/bot_block.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · 227b65e34b12edd5 · report
rel_to_abs BIGBALLON/distribuuuu/distribuuuu/models/botnet.py community (archive-listed) ran · fixture could not drive it MIT (permissive) · 560641da841eeb15 · report
relative_logits nachiket273/VisTrans/vistrans/models/botnet.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · bb969778cf283586 · report
relative_logits_1d BIGBALLON/distribuuuu/distribuuuu/models/botnet.py community (archive-listed) ran · fixture could not drive it MIT (permissive) · 93ec7f5a59863d1a · report
relative_to_absolute The-AI-Summer/self_attention/self_attention_cv/bottleneck_transformer/bot_block.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · c692e058b3b543f2 · report
AbsolutePosEmb nachiket273/VisTrans/vistrans/models/botnet.py community (archive-listed) unverified MIT (permissive) · 60b38ccc9cd86edd · report
BoTBlock CandiceD17/Bottleneck-Transformers-for-Visual-Recognition/model/botnet.py community (archive-listed) unverified no licence file found · pointer only · c89f1a9517a0905e · report
BoTBlock NZ99/bottleneck-transformer-flax/bottleneck_transformer_flax/botnet.py community (archive-listed) unverified MIT (permissive) · 635303b35edfe8e2 · report
BoTMHSA NZ99/bottleneck-transformer-flax/bottleneck_transformer_flax/botnet.py community (archive-listed) unverified MIT (permissive) · 4246cb32d13d3b98 · report
BoTNet scheshmi/BottleneckTransformers/model.py community (archive-listed) unverified no licence file found · pointer only · 14a63975366ccc24 · report
BoTNet NZ99/bottleneck-transformer-flax/bottleneck_transformer_flax/botnet.py community (archive-listed) unverified MIT (permissive) · 93c353b1b05ef701 · report
BoTNetConfig NZ99/bottleneck-transformer-flax/bottleneck_transformer_flax/botnet.py community (archive-listed) unverified MIT (permissive) · 58200aabf211669a · report
BotNet nachiket273/VisTrans/vistrans/models/botnet.py community (archive-listed) unverified MIT (permissive) · 771d64f60cf10b0d · report
BotnetX nachiket273/VisTrans/vistrans/models/botnet.py community (archive-listed) unverified MIT (permissive) · 3d7d4980902b0da3 · report
BottleBlock lucidrains/bottleneck-transformer-pytorch/bottleneck_transformer_pytorch/bottleneck_transformer_pytorch.py community (archive-listed) unverified MIT (permissive) · 957f9748a5caf504 · report
Bottleneck nachiket273/VisTrans/vistrans/models/botnet.py community (archive-listed) unverified MIT (permissive) · 6fd5faa3cfeccf67 · report
BottleneckBlock The-AI-Summer/self_attention/self_attention_cv/bottleneck_transformer/bot_block.py community (archive-listed) unverified MIT (permissive) · 31358a487667e5f1 · report
BottleneckResNetBlock NZ99/bottleneck-transformer-flax/bottleneck_transformer_flax/botnet.py community (archive-listed) unverified MIT (permissive) · 685fb6581dbbfbec · report
MHSA nachiket273/VisTrans/vistrans/models/botnet.py community (archive-listed) unverified MIT (permissive) · 4a8e8eb7d2edff3d · report
MHSA CandiceD17/Bottleneck-Transformers-for-Visual-Recognition/model/botnet.py community (archive-listed) unverified no licence file found · pointer only · 0eb9211a00bd7524 · report
RelativeLogits NZ99/bottleneck-transformer-flax/bottleneck_transformer_flax/botnet.py community (archive-listed) unverified MIT (permissive) · c92dd55c1dc2fa04 · report
RelativePosEmb nachiket273/VisTrans/vistrans/models/botnet.py community (archive-listed) unverified MIT (permissive) · e1685f603e910d5a · report
SELayer NZ99/bottleneck-transformer-flax/bottleneck_transformer_flax/botnet.py community (archive-listed) unverified MIT (permissive) · 09e1a6a94cc17376 · report
absolute_logits nachiket273/VisTrans/vistrans/models/botnet.py community (archive-listed) unverified MIT (permissive) · 8c47eb5f2d30130b · report
rel_to_abs nachiket273/VisTrans/vistrans/models/botnet.py community (archive-listed) unverified MIT (permissive) · 1d5fc659fc20f4b8 · report
rel_to_abs lucidrains/bottleneck-transformer-pytorch/bottleneck_transformer_pytorch/bottleneck_transformer_pytorch.py community (archive-listed) unverified MIT (permissive) · 2c273760ec522435 · report
relative_logits_1d nachiket273/VisTrans/vistrans/models/botnet.py community (archive-listed) unverified MIT (permissive) · dde3921cad5d0cc0 · report
relative_logits_1d lucidrains/bottleneck-transformer-pytorch/bottleneck_transformer_pytorch/bottleneck_transformer_pytorch.py community (archive-listed) unverified MIT (permissive) · 5b41b7a682f4c678 · report

Tasks

Image ClassificationInstance SegmentationObject DetectionSegmentationimage-classificationobject-detection

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Classification ImageNet BoTNet T7 Number of params 75.1M #298 of 1060 Archive leaderboard report
Image Classification ImageNet BoTNet T7 Top 1 Accuracy 84.7% #298 of 1060 Archive leaderboard report
Image Classification ImageNet BoTNet T7-320 Top 1 Accuracy 84.2% #333 of 1060 Archive leaderboard report
Image Classification ImageNet BoTNet T6 Number of params 53.9M #369 of 1060 Archive leaderboard report
Image Classification ImageNet BoTNet T6 Top 1 Accuracy 84% #369 of 1060 Archive leaderboard report
Image Classification ImageNet SENet-350 Top 1 Accuracy 83.8% #385 of 1060 Archive leaderboard report
Image Classification ImageNet BoTNet T5 GFLOPs 19.3 #421 of 1060 Archive leaderboard report
Image Classification ImageNet BoTNet T5 Top 1 Accuracy 83.5% #421 of 1060 Archive leaderboard report
Image Classification ImageNet BoTNet T4 GFLOPs 10.9 #504 of 1060 Archive leaderboard report
Image Classification ImageNet BoTNet T4 Number of params 54.7M #504 of 1060 Archive leaderboard report
Image Classification ImageNet BoTNet T4 Top 1 Accuracy 82.8% #504 of 1060 Archive leaderboard report
Image Classification ImageNet SENet-152 Number of params 66.6M #568 of 1060 Archive leaderboard report
Image Classification ImageNet SENet-152 Top 1 Accuracy 82.2% #568 of 1060 Archive leaderboard report
Image Classification ImageNet BoTNet T3 GFLOPs 7.3 #619 of 1060 Archive leaderboard report
Image Classification ImageNet BoTNet T3 Number of params 33.5M #619 of 1060 Archive leaderboard report
Image Classification ImageNet BoTNet T3 Top 1 Accuracy 81.7% #619 of 1060 Archive leaderboard report
Image Classification ImageNet SENet-101 Number of params 49.2M #645 of 1060 Archive leaderboard report
Image Classification ImageNet SENet-101 Top 1 Accuracy 81.4% #645 of 1060 Archive leaderboard report
Image Classification ImageNet ResNet-101 Number of params 44.4M #727 of 1060 Archive leaderboard report
Image Classification ImageNet ResNet-101 Top 1 Accuracy 80% #727 of 1060 Archive leaderboard report
Image Classification ImageNet SENet-50 Number of params 28.02M #762 of 1060 Archive leaderboard report
Image Classification ImageNet SENet-50 Top 1 Accuracy 79.4% #762 of 1060 Archive leaderboard report
Image Classification ImageNet ResNet-50 Number of params 25.5M #805 of 1060 Archive leaderboard report
Image Classification ImageNet ResNet-50 Top 1 Accuracy 78.8% #805 of 1060 Archive leaderboard report
Instance Segmentation COCO minival BoTNet 200 (Mask R-CNN, single scale, 72 epochs) mask AP 44.4 #55 of 93 Archive leaderboard report
Instance Segmentation COCO minival BoTNet 152 (Mask R-CNN, single scale, 72 epochs) mask AP 43.7 #59 of 93 Archive leaderboard report
Instance Segmentation COCO minival BoTNet 50 (72 epochs) mask AP 40.7 #71 of 93 Archive leaderboard report
Object Detection COCO minival BoTNet 200 (Mask R-CNN, single scale, 72 epochs) AP50 71.3 #83 of 220 Archive leaderboard report
Object Detection COCO minival BoTNet 200 (Mask R-CNN, single scale, 72 epochs) AP75 54.6 #83 of 220 Archive leaderboard report
Object Detection COCO minival BoTNet 200 (Mask R-CNN, single scale, 72 epochs) box AP 49.7 #83 of 220 Archive leaderboard report
Object Detection COCO minival BoTNet 152 (Mask R-CNN, single scale, 72 epochs) AP50 71 #84 of 220 Archive leaderboard report
Object Detection COCO minival BoTNet 152 (Mask R-CNN, single scale, 72 epochs) AP75 54.2 #84 of 220 Archive leaderboard report
Object Detection COCO minival BoTNet 152 (Mask R-CNN, single scale, 72 epochs) box AP 49.5 #84 of 220 Archive leaderboard report
Object Detection COCO minival BoTNet 50 (72 epochs) box AP 45.9 #111 of 220 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

Introduced by this paper: Bottleneck Transformer Block

1x1 ConvolutionAttentionAverage PoolingBatch NormalizationBottleneck TransformerBottleneck Transformer BlockConvolutionCosine AnnealingDense ConnectionsLabel SmoothingMask R-CNNMax PoolingPointwise ConvolutionRPNRandAugmentRandom Resized CropReLUResNeStResidual ConnectionRoIAlignSGD with MomentumSiLUSigmoid ActivationSoftmaxSplit AttentionSqueeze-and-Excitation BlockWeight Decay

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