Papers › CoAtNet: Marrying Convolution and Attention for All Data Sizes

CoAtNet: Marrying Convolution and Attention for All Data Sizes

9 Jun 2021NeurIPS 2021 12arXiv:2106.04803archive 2025-07-28

Zihang Dai, Hanxiao Liu, Quoc V. Le, Mingxing Tan

Transformers have attracted increasing interests in computer vision, but they still fall behind state-of-the-art convolutional networks. In this work, we show that while Transformers tend to have larger model capacity, their generalization can be worse than convolutional networks due to the lack of the right inductive bias. To effectively combine the strengths from both architectures, we present CoAtNets(pronounced "coat" nets), a family of hybrid models built from two key insights: (1) depthwise Convolution and self-Attention can be naturally unified via simple relative attention; (2) vertically stacking convolution layers and attention layers in a principled way is surprisingly effective in improving generalization, capacity and efficiency. Experiments show that our CoAtNets achieve state-of-the-art performance under different resource constraints across various datasets: Without extra data, CoAtNet achieves 86.0% ImageNet top-1 accuracy; When pre-trained with 13M images from ImageNet-21K, our CoAtNet achieves 88.56% top-1 accuracy, matching ViT-huge pre-trained with 300M images from JFT-300M while using 23x less data; Notably, when we further scale up CoAtNet with JFT-3B, it achieves 90.88% top-1 accuracy on ImageNet, establishing a new state-of-the-art result.

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 5 code samples: 4 from 2 repositories linked to this paper, 1 identical to code harvested from another paper's repository. Across all 5: 2 ran (of which 0 constructed an object rather than computing a result; 1 with no instrument failure: 1 honoured, 0 violated, 0 with no contract checked; 1 where Syntology's instrument failed) · 3 unverified. Where Syntology's instrument failed: 1 where our contract draft was wrong; failures of Syntology's instrument, not of the code.

By repository: community (archive-listed): 4 samples from 2 repositories, 1 ran (0 with no instrument failure; 1 where Syntology's instrument failed); 1 identical to code first harvested elsewhere. 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 5 of its repositories that Syntology harvested for other papers:

No date is recorded for any of the 2 samples that ran: their levels were written before Syntology's graph kept the date.

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

Burf/CoAtNet-Tensorflow2 mentioned on GitHubtfMITSyntology: 3 samples, 0 ran · 3 unverified report
LongLeCE/CoAtNet-PyTorch mentioned on GitHubpytorchSyntology: not harvested report
chinhsuanwu/coatnet-pytorch mentioned on GitHubpytorchSyntology: 1 sample, 1 ran (1 instrument-failed) · 0 unverified report
nqt228/CoAtNet-tensorflow mentioned on GitHubtfSyntology: not harvested report
pranavsinghps1/dedl mentioned on GitHubpytorchSyntology: not harvested report
rwightman/pytorch-image-models mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to AdamP: Slowing Down the Slowdown for Momentum Optimizers on Scale-invariant Weights (arXiv:2006.08217; that paper's own run record: 4 ran (of which 1 constructed an object rather than computing a result; 2 with no instrument failure: 1 honoured, 0 violated, 1 with no contract checked; 2 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
tyeso/Image_Classification_with_CoAtNet_and_ResNet18 mentioned on GitHubpytorchSyntology: not harvested report
MS-Mind/MS-Code-02 mindsporeSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to EdgeNeXt: Efficiently Amalgamated CNN-Transformer Architecture for Mobile Vision Applications (arXiv:2206.10589; that paper's own run record: 7 ran (of which 0 constructed an object rather than computing a result; 7 with no instrument failure: 0 honoured, 1 violated, 6 with no contract checked; 0 where Syntology's instrument failed) · 3 unverified); nothing checks that they implement this paper's method. report
Mind23-2/MindCode-19 mindsporeSyntology: not harvested report
canturan10/satellighte pytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Deep Residual Learning for Image Recognition (arXiv:1512.03385; that paper's own run record: 254 ran (of which 108 constructed an object rather than computing a result; 163 with no instrument failure: 3 honoured, 1 violated, 159 with no contract checked; 91 where Syntology's instrument failed) · 123 unverified), MobileNetV2: Inverted Residuals and Linear Bottlenecks (arXiv:1801.04381; that paper's own run record: 85 ran (of which 40 constructed an object rather than computing a result; 64 with no instrument failure: 8 honoured, 0 violated, 56 with no contract checked; 21 where Syntology's instrument failed) · 26 unverified) and EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks (arXiv:1905.11946; that paper's own run record: 198 ran (of which 73 constructed an object rather than computing a result; 157 with no instrument failure: 26 honoured, 2 violated, 129 with no contract checked; 41 where Syntology's instrument failed) · 104 unverified); nothing checks that they implement this paper's method. report
hw666666666666/CoAtNet mindsporeNOASSERTIONSyntology: not harvested report
leondgarse/keras_cv_attention_models tfSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to RepViT: Revisiting Mobile CNN From ViT Perspective (arXiv:2307.09283; that paper's own run record: 6 ran (of which 0 constructed an object rather than computing a result; 3 with no instrument failure: 0 honoured, 0 violated, 3 with no contract checked; 3 where Syntology's instrument failed) · 6 unverified); nothing checks that they implement this paper's method. report
mindspore-courses/External-Attention-MindSpore mindsporeSyntology: not harvested report
xmu-xiaoma666/External-Attention-pytorch pytorchSyntology: 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

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

5 samples harvested: 2 ran (of which 0 constructed an object rather than computing a result; 1 with no instrument failure: 1 honoured, 0 violated, 0 with no contract checked; 1 where Syntology's instrument failed) · 3 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.

1ran · honoured contract
1ran · our draft was wrong
3unverified

Licence: 1 of the 5 samples is 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 2 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. 1 sample is listed last, in a group without a repository. “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.

Burf/CoAtNet-Tensorflow2 community (archive-listed) 3 samples, 0 ran · 3 unverified
coatnet coatnet/coatnet.py unverified MIT (permissive) · 8aeee8782df9ac39 · report
coatnet0 coatnet/coatnet.py unverified MIT (permissive) · 9dbc2c10a3104a03 · report
coatnet1 coatnet/coatnet.py unverified MIT (permissive) · db9a51f9739f40ea · report
chinhsuanwu/coatnet-pytorch community (archive-listed) 1 sample, 1 ran (1 instrument-failed) · 0 unverified
conv_3x3_bn in 21 papers coatnet.py ran · our draft was wrong MIT (permissive) · c825b672e6f0b3bc · report fixture: signature inp:int/0/int, oup:int/0/int, image_size:int/0/int, downsample:bool/0/bool · returned Sequential · level recorded, date not recorded
Repository not located 1 sample, 1 ran (0 instrument-failed) · 0 unverified
1 sample is identical to code Syntology harvested from another paper's repository; this paper's own copy was not located, so no repository is named and no licence is recorded.
count_parameters in 278 papers repository not located ran · honoured contract licence of this copy not recorded · f6b944f50d3f15ae · report fixture: signature model:callable/0/? · returned int · level recorded, date not recorded

Tasks

AllImage ClassificationInductive Bias

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Classification GasHisSDB CoAtNet-1 Accuracy 98.74 #1 of 8 Archive leaderboard report
Image Classification GasHisSDB CoAtNet-1 F1-Score 99.38 #1 of 8 Archive leaderboard report
Image Classification GasHisSDB CoAtNet-1 Precision 99.97 #1 of 8 Archive leaderboard report
Image Classification ImageNet CoAtNet-3 @384 GFLOPs 114 #40 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-3 @384 Top 1 Accuracy 88.52% #40 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-3 (21k) Top 1 Accuracy 87.6% #78 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-2 (21k) Top 1 Accuracy 87.1% #103 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-3 GFLOPs 34.7 #314 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-3 Number of params 168M #314 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-3 Top 1 Accuracy 84.5% #314 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-2 GFLOPs 15.7 #358 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-2 Number of params 75M #358 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-2 Top 1 Accuracy 84.1% #358 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-1 GFLOPs 8.4 #443 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-1 Number of params 42M #443 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-1 Top 1 Accuracy 83.3% #443 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-0 GFLOPs 4.2 #627 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-0 Number of params 25M #627 of 1060 Archive leaderboard report
Image Classification ImageNet CoAtNet-0 Top 1 Accuracy 81.6% #627 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

ConvolutionDepthwise Convolution

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