Papers › Incorporating Convolution Designs into Visual Transformers

Incorporating Convolution Designs into Visual Transformers

22 Mar 2021ICCV 2021 10arXiv:2103.11816archive 2025-07-28

Kun Yuan, Shaopeng Guo, Ziwei Liu, Aojun Zhou, Fengwei Yu, Wei Wu

Motivated by the success of Transformers in natural language processing (NLP) tasks, there emerge some attempts (e.g., ViT and DeiT) to apply Transformers to the vision domain. However, pure Transformer architectures often require a large amount of training data or extra supervision to obtain comparable performance with convolutional neural networks (CNNs). To overcome these limitations, we analyze the potential drawbacks when directly borrowing Transformer architectures from NLP. Then we propose a new \textbf{Convolution-enhanced image Transformer (CeiT)} which combines the advantages of CNNs in extracting low-level features, strengthening locality, and the advantages of Transformers in establishing long-range dependencies. Three modifications are made to the original Transformer: \textbf{1)} instead of the straightforward tokenization from raw input images, we design an \textbf{Image-to-Tokens (I2T)} module that extracts patches from generated low-level features; \textbf{2)} the feed-froward network in each encoder block is replaced with a \textbf{Locally-enhanced Feed-Forward (LeFF)} layer that promotes the correlation among neighboring tokens in the spatial dimension; \textbf{3)} a \textbf{Layer-wise Class token Attention (LCA)} is attached at the top of the Transformer that utilizes the multi-level representations. Experimental results on ImageNet and seven downstream tasks show the effectiveness and generalization ability of CeiT compared with previous Transformers and state-of-the-art CNNs, without requiring a large amount of training data and extra CNN teachers. Besides, CeiT models also demonstrate better convergence with 3× fewer training iterations, which can reduce the training cost significantly\footnote{Code and models will be released upon acceptance.}.

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

Code

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

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

coeusguo/ceit officialmentioned on GitHubpytorch report
rishikksh20/CeiT-pytorch 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

11 samples harvested; 9 ran; 0 honoured the contract we drafted; 2 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.

9ran
2unverified

Licence: 0 of the 11 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 2 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.

Attention coeusguo/ceit/ceit_model.py official repository ran Apache-2.0 (permissive) · 88ac331124a64a60 · report
AttentionLCA coeusguo/ceit/ceit_model.py official repository ran Apache-2.0 (permissive) · ef3f1eb732093bcb · report
Block coeusguo/ceit/ceit_model.py official repository ran Apache-2.0 (permissive) · e5a66231dac09f8c · report
HybridEmbed coeusguo/ceit/ceit_model.py official repository ran Apache-2.0 (permissive) · 531854dd3e8dc7b0 · report
LocallyEnhancedFeedForward coeusguo/ceit/ceit_model.py official repository ran Apache-2.0 (permissive) · ceb88739eac75055 · report
CeIT coeusguo/ceit/ceit_model.py official repository unverified Apache-2.0 (permissive) · f706125b2848bd36 · report
LCA rishikksh20/CeiT-pytorch/ceit.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · f7134b0e48a1485d · report
LCAttention rishikksh20/CeiT-pytorch/ceit.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 218a36c2869e1755 · report
LeFF rishikksh20/CeiT-pytorch/ceit.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · 35eefd450a0413e9 · report
TransformerLeFF rishikksh20/CeiT-pytorch/ceit.py community (archive-listed) ran · metamorphic tier: deterministic MIT (permissive) · bbca7f007eecf184 · report
CeiT rishikksh20/CeiT-pytorch/ceit.py community (archive-listed) unverified MIT (permissive) · 779c5d5035c71712 · report

Tasks

Image Classification

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Classification CIFAR-10 CeiT-S (384 finetune resolution) Percentage correct 99.1 #16 of 265 Archive leaderboard report
Image Classification CIFAR-10 CeiT-S Percentage correct 99 #23 of 265 Archive leaderboard report
Image Classification CIFAR-10 CeiT-T Percentage correct 98.5 #40 of 265 Archive leaderboard report
Image Classification CIFAR-100 CeiT-S Percentage correct 91.8 #16 of 211 Archive leaderboard report
Image Classification CIFAR-100 CeiT-S (384 finetune resolution) Percentage correct 91.8 #17 of 211 Archive leaderboard report
Image Classification CIFAR-100 CeiT-T Percentage correct 89.4 #31 of 211 Archive leaderboard report
Image Classification CIFAR-100 CeiT-T (384 finetune resolution) Percentage correct 88 #40 of 211 Archive leaderboard report
Image Classification Flowers-102 CeiT-S (384 finetune resolution) Accuracy 98.6 #22 of 52 Archive leaderboard report
Image Classification Flowers-102 CeiT-S Accuracy 98.2 #28 of 52 Archive leaderboard report
Image Classification Flowers-102 CeiT-T (384 finetune resolution) Accuracy 97.8 #35 of 52 Archive leaderboard report
Image Classification Flowers-102 CeiT-T Accuracy 96.9 #40 of 52 Archive leaderboard report
Image Classification ImageNet CeiT-S (384 finetune res) GFLOPs 12.9 #437 of 1060 Archive leaderboard report
Image Classification ImageNet CeiT-S (384 finetune res) Number of params 24.2M #437 of 1060 Archive leaderboard report
Image Classification ImageNet CeiT-S (384 finetune res) Top 1 Accuracy 83.3% #437 of 1060 Archive leaderboard report
Image Classification ImageNet CeiT-S GFLOPs 4.5 #579 of 1060 Archive leaderboard report
Image Classification ImageNet CeiT-S Top 1 Accuracy 82% #579 of 1060 Archive leaderboard report
Image Classification ImageNet CeiT-T (384 finetune res) GFLOPs 3.6 #801 of 1060 Archive leaderboard report
Image Classification ImageNet CeiT-T (384 finetune res) Top 1 Accuracy 78.8% #801 of 1060 Archive leaderboard report
Image Classification ImageNet CeiT-T GFLOPs 1.2 #914 of 1060 Archive leaderboard report
Image Classification ImageNet CeiT-T Number of params 6.4M #914 of 1060 Archive leaderboard report
Image Classification ImageNet CeiT-T Top 1 Accuracy 76.4% #914 of 1060 Archive leaderboard report
Image Classification ImageNet ReaL CeiT-S (384 finetune res) Accuracy 88.1% #28 of 57 Archive leaderboard report
Image Classification ImageNet ReaL CeiT-S Accuracy 87.3% #34 of 57 Archive leaderboard report
Image Classification ImageNet ReaL CeiT-T Accuracy 83.6% #47 of 57 Archive leaderboard report
Image Classification Oxford-IIIT Pets CeiT-S (384 finetune resolution) Accuracy 94.9 #1 of 6 Archive leaderboard report
Image Classification Oxford-IIIT Pets CeiT-S Accuracy 94.6 #3 of 6 Archive leaderboard report
Image Classification Oxford-IIIT Pets CeiT-T (384 finetune resolution) Accuracy 94.5 #4 of 6 Archive leaderboard report
Image Classification Oxford-IIIT Pets CeiT-T Accuracy 93.8 #5 of 6 Archive leaderboard report
Image Classification Stanford Cars CeiT-S (384 finetune resolution) Accuracy 94.1 #7 of 24 Archive leaderboard report
Image Classification Stanford Cars CeiT-S Accuracy 93.2 #10 of 24 Archive leaderboard report
Image Classification Stanford Cars CeiT-T (384 finetune resolution) Accuracy 93 #12 of 24 Archive leaderboard report
Image Classification Stanford Cars CeiT-T Accuracy 90.5 #14 of 24 Archive leaderboard report
Image Classification iNaturalist 2018 CeiT-S (384 finetune resolution) Top-1 Accuracy 79.4% #19 of 60 Archive leaderboard report
Image Classification iNaturalist 2018 CeiT-S Top-1 Accuracy 73.3% #32 of 60 Archive leaderboard report
Image Classification iNaturalist 2018 CeiT-T (384 finetune resolution) Top-1 Accuracy 72.2% #34 of 60 Archive leaderboard report
Image Classification iNaturalist 2018 CeiT-T Top-1 Accuracy 64.3% #50 of 60 Archive leaderboard report
Image Classification iNaturalist 2019 CeiT-S (384 finetune resolution) Top-1 Accuracy 82.7 #9 of 22 Archive leaderboard report
Image Classification iNaturalist 2019 CeiT-S Top-1 Accuracy 78.9 #12 of 22 Archive leaderboard report
Image Classification iNaturalist 2019 CeiT-T (384 finetune resolution) Top-1 Accuracy 77.9 #13 of 22 Archive leaderboard report
Image Classification iNaturalist 2019 CeiT-T Top-1 Accuracy 72.8 #16 of 22 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 EncodingsAdamAttentionBPECeiTDense 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