Papers › CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image Classification

CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image Classification

27 Mar 2021ICCV 2021 10arXiv:2103.14899archive 2025-07-28

Chun-Fu Chen, Quanfu Fan, Rameswar Panda

The recently developed vision transformer (ViT) has achieved promising results on image classification compared to convolutional neural networks. Inspired by this, in this paper, we study how to learn multi-scale feature representations in transformer models for image classification. To this end, we propose a dual-branch transformer to combine image patches (i.e., tokens in a transformer) of different sizes to produce stronger image features. Our approach processes small-patch and large-patch tokens with two separate branches of different computational complexity and these tokens are then fused purely by attention multiple times to complement each other. Furthermore, to reduce computation, we develop a simple yet effective token fusion module based on cross attention, which uses a single token for each branch as a query to exchange information with other branches. Our proposed cross-attention only requires linear time for both computational and memory complexity instead of quadratic time otherwise. Extensive experiments demonstrate that our approach performs better than or on par with several concurrent works on vision transformer, in addition to efficient CNN models. For example, on the ImageNet1K dataset, with some architectural changes, our approach outperforms the recent DeiT by a large margin of 2% with a small to moderate increase in FLOPs and model parameters. Our source codes and models are available at https://github.com/IBM/CrossViT.

PaperPDFConference PDFCodeCode Syntology ranMethod as code

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 26 code samples harvested from 4 repositories linked to this paper: 17 ran (of which 10 constructed an object rather than computing a result; 17 with no instrument failure: 0 honoured, 1 violated, 16 with no contract checked; 0 where Syntology's instrument failed) · 9 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code; here there are none.

By repository: official repository: 6 samples from 1 repository, 4 ran (4 with no instrument failure; 0 where Syntology's instrument failed); community (archive-listed): 20 samples from 3 repositories, 13 ran (13 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 5 of its repositories that Syntology harvested for other papers:

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

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

IBM/CrossViT officialmentioned in papermentioned on GitHubpytorchSyntology: 6 samples, 4 ran (0 instrument-failed) · 2 unverified report
SforAiDl/vformer mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Vision Transformers for Dense Prediction (arXiv:2103.13413; that paper's own run record: 65 ran (of which 19 constructed an object rather than computing a result; 32 with no instrument failure: 0 honoured, 0 violated, 32 with no contract checked; 33 where Syntology's instrument failed) · 51 unverified) and ViViT: A Video Vision Transformer (arXiv:2103.15691; that paper's own run record: 14 ran (of which 10 constructed an object rather than computing a result; 13 with no instrument failure: 1 honoured, 0 violated, 12 with no contract checked; 1 where Syntology's instrument failed) · 7 unverified); nothing checks that they implement this paper's method. report
ahmedelmahy/myownvit mentioned on GitHubpytorchSyntology: 7 samples, 5 ran (0 instrument-failed) · 2 unverified report
conceptofmind/CrossViT-flax mentioned on GitHubjaxSyntology: 8 samples, 5 ran (0 instrument-failed) · 3 unverified report
kit-mrt/masked-fusion-360 mentioned on GitHubpytorchSyntology: not harvested report
kit-mrt/red-motion mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to RedMotion: Motion Prediction via Redundancy Reduction (arXiv:2306.10840; that paper's own run record: 1 ran (of which 0 constructed an object rather than computing a result; 0 with no instrument failure: 0 honoured, 0 violated, 0 with no contract checked; 1 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
kit-mrt/road-barlow-twins mentioned on GitHubpytorchSyntology: not harvested report
rishikksh20/CrossViT-pytorch mentioned on GitHubpytorchSyntology: 5 samples, 3 ran (0 instrument-failed) · 2 unverified 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
ttt496/vit-pytorch mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet (arXiv:2101.11986; that paper's own run record: 21 ran (of which 16 constructed an object rather than computing a result; 21 with no instrument failure: 1 honoured, 0 violated, 20 with no contract checked; 0 where Syntology's instrument failed) · 5 unverified), Rethinking Spatial Dimensions of Vision Transformers (arXiv:2103.16302; that paper's own run record: 10 ran (of which 6 constructed an object rather than computing a result; 10 with no instrument failure: 2 honoured, 0 violated, 8 with no contract checked; 0 where Syntology's instrument failed) · 10 unverified) and LeViT: a Vision Transformer in ConvNet's Clothing for Faster Inference (arXiv:2104.01136; that paper's own run record: 23 ran (of which 16 constructed an object rather than computing a result; 21 with no instrument failure: 3 honoured, 1 violated, 17 with no contract checked; 2 where Syntology's instrument failed) · 7 unverified); nothing checks that they implement this paper's method. report
2023-MindSpore-1/ms-code-145 mindsporeSyntology: not harvested report
BR-IDL/PaddleViT paddleSyntology: 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
mindspore-courses/External-Attention-MindSpore mindsporeSyntology: not harvested report
gitlab.com/birder/birder pytorchSyntology: 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

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

Licence: 0 of the 26 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 4 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. “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”. For 4 samples that ran, the graph records a signature this page does not show: for a class the fixture built without calling, the harness called the object with inputs it made up itself, so the recorded signature is the harness's probe, not the fixture's arguments. “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.

IBM/CrossViT official repository 6 samples, 4 ran (0 instrument-failed) · 2 unverified
CrossAttention in 85 papers models/crossvit.py ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 9811d06fb8557fa5 · report fixture: returned CrossAttention · level recorded 2026-09-22
CrossAttentionBlock in 16 papers models/crossvit.py ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 185cacf0bed5e23b · report fixture: returned CrossAttentionBlock · level recorded 2026-09-22
PatchEmbed in 123 papers
census: 9 implementations from 9 papers, 6 distinct outputs on one shared input
models/crossvit.py ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 2562a86d027ed434 · report fixture: returned PatchEmbed · level recorded 2026-09-22
_compute_num_patches models/crossvit.py ran · violated contract fingerprinted Apache-2.0 (permissive) · 54f90cefd4fe4358 · report fixture: signature img_size:list/1/int, patches:list/1/int · returned list · level recorded 2026-09-22
MultiScaleBlock models/crossvit.py unverified Apache-2.0 (permissive) · 6eb91fffc193bc8d · report
VisionTransformer in 53 papers models/crossvit.py unverified Apache-2.0 (permissive) · b05cff1db97d5001 · report
ahmedelmahy/myownvit community (archive-listed) 7 samples, 5 ran (0 instrument-failed) · 2 unverified
Attention in 344 papers
census: 13 implementations from 12 papers, 10 distinct outputs across 4 buckets, one shared input per bucket
vit_pytorch/cross_vit.py ran · metamorphic tier: invariant fingerprinted MIT (permissive) · 39b524cdd79f5d2e · report fixture: signature x:Tensor/3/float, context:NoneType/0/?, kv_include_self:bool/0/bool · returned Tensor · level recorded 2026-09-22
CrossTransformer in 6 papers vit_pytorch/cross_vit.py ran · metamorphic tier: deterministic MIT (permissive) · 7909555e0d7a8a93 · report fixture: signature sm_tokens:Tensor/3/float, lg_tokens:Tensor/3/float · returned tuple · level recorded 2026-09-22
ImageEmbedder vit_pytorch/cross_vit.py ran · metamorphic tier: invariant MIT (permissive) · 0a16f340785793af · report fixture: signature img:Tensor/4/float · returned Tensor · level recorded 2026-09-22
ProjectInOut vit_pytorch/cross_vit.py ran · metamorphic tier: invariant fingerprinted MIT (permissive) · 5c51a399079da30b · report fixture: signature x:Tensor/2/float · returned Tensor · level recorded 2026-09-22
Transformer in 173 papers vit_pytorch/cross_vit.py ran · metamorphic tier: invariant MIT (permissive) · 139bcf50e1423e16 · report fixture: signature x:Tensor/3/float · returned Tensor · level recorded 2026-09-22
CrossViT vit_pytorch/cross_vit.py unverified MIT (permissive) · 74763df32bbe08b3 · report
MultiScaleEncoder vit_pytorch/cross_vit.py unverified MIT (permissive) · 6f5a3f2db3ea4ac5 · report
conceptofmind/CrossViT-flax community (archive-listed) 8 samples, 5 ran (0 instrument-failed) · 3 unverified
ImageEmbedder cross_vit_flax/cross_vit_flax.py ran · metamorphic tier: deterministic MIT (permissive) · 541e36b2edd2e342 · report fixture: returned ImageEmbedder · level recorded 2026-09-22
MultiScaleEncoder cross_vit_flax/cross_vit_flax.py ran · metamorphic tier: deterministic MIT (permissive) · 18ea900a9c20be8f · report fixture: returned MultiScaleEncoder · level recorded 2026-09-22
PreNorm in 34 papers cross_vit_flax/cross_vit_flax.py ran · metamorphic tier: deterministic MIT (permissive) · d7aaba5132053213 · report fixture: returned PreNorm · level recorded 2026-09-22
ProjectInOut cross_vit_flax/cross_vit_flax.py ran · metamorphic tier: deterministic MIT (permissive) · 395f410c7cd053df · report fixture: returned ProjectInOut · level recorded 2026-09-22
Transformer in 173 papers cross_vit_flax/cross_vit_flax.py ran · metamorphic tier: deterministic MIT (permissive) · 0415c013e361e191 · report fixture: returned Transformer · level recorded 2026-09-22
CrossTransformer in 6 papers cross_vit_flax/cross_vit_flax.py unverified MIT (permissive) · fcda9506e4ba0369 · report
CrossViT cross_vit_flax/cross_vit_flax.py unverified MIT (permissive) · 54eeb67b517aba4e · report
rishikksh20/CrossViT-pytorch community (archive-listed) 5 samples, 3 ran (0 instrument-failed) · 2 unverified
Attention in 344 papers
census: 13 implementations from 12 papers, 10 distinct outputs across 4 buckets, one shared input per bucket
crossvit.py ran · metamorphic tier: deterministic MIT (permissive) · 411c4d270072eb2e · report fixture: returned Attention · level recorded 2026-09-22
CrossAttention in 85 papers crossvit.py ran MIT (permissive) · 8abca80f7f8a5dda · report fixture: signature x_qkv:Tensor/3/float · returned Tensor · level recorded 2026-09-24
Transformer in 173 papers crossvit.py ran · metamorphic tier: deterministic MIT (permissive) · 45127327251f05d5 · report fixture: returned Transformer · level recorded 2026-09-22
CrossViT crossvit.py unverified MIT (permissive) · e9810edd3a725477 · report
MultiScaleTransformerEncoder crossvit.py unverified MIT (permissive) · 00453bc8eaf62cc7 · report

Method as code Syntology

What Syntology's graph records as this paper's claimed method, lifted into code: each assembly names its bricks (functions and classes), each with its own role and its own verification level. An assembly is not a check that the code implements the method correctly or reproduces the paper's results. Levels are each brick's own verification level in Syntology's graph (level 0: no recorded run), listed brick by brick and never combined into one level; “ran” means the brick executed on a synthesized input, not that its output is correct, and the instrument figure counts failures of Syntology's instrument, not of the code. Where a model read the code against the paper's claim, each assembly's label verdict is one model's judgement, kept in this page's JSON twin; it is not calibrated, so no card prints it. Siblings are assemblies lifted from this paper in the same batch for the same method: alternative readings kept side by side; none replaces or supersedes another.

4 assemblies on this paper: 4 harvested, 0 generated, listed in 1 groups (siblings lifted in one batch form one group).

4 sibling assemblies for CrossViT (harvested), lifted in the same batch on 2026-09-09: alternative readings kept side by side; none replaces or supersedes another.

harvested Assembly for CrossViT (graph method: CrossViT). 7 bricks; individually on a fixture: 5 ran (of which 3 constructed an object rather than computing a result; 5 with no instrument failure: 0 honoured, 0 violated, 5 with no contract checked; 0 where Syntology's instrument failed) · 2 unverified. The assembly has not been run end-to-end.

one of 4 siblings

  1. CrossViT entry · level 0 · unverified · e9810edd3a725477
  2. MultiScaleTransformerEncoder model · level 0 · unverified · 00453bc8eaf62cc7
  3. CrossAttention helper · level 1 · ran · 8abca80f7f8a5dda
  4. PreNorm helper · level 1 · ran · c40137bc5259e649
  5. Transformer helper · level 1 · ran · 45127327251f05d5
  6. Attention helper · level 1 · ran · 411c4d270072eb2e
  7. FeedForward helper · level 1 · ran · d7f6c1668eb9259b

harvested Assembly for CrossViT (graph method: CrossViT). 6 bricks; individually on a fixture: 4 ran (of which 3 constructed an object rather than computing a result; 4 with no instrument failure: 0 honoured, 1 violated, 3 with no contract checked; 0 where Syntology's instrument failed) · 2 unverified. The assembly has not been run end-to-end.

one of 4 siblings

  1. VisionTransformer entry · level 0 · unverified · b05cff1db97d5001
  2. MultiScaleBlock model · level 0 · unverified · 6eb91fffc193bc8d
  3. PatchEmbed model · level 1 · ran · 2562a86d027ed434
  4. _compute_num_patches helper · level 1 · ran · violated contract · 54f90cefd4fe4358
  5. CrossAttentionBlock model · level 1 · ran · 185cacf0bed5e23b
  6. CrossAttention model · level 1 · ran · 9811d06fb8557fa5

harvested Assembly for CrossViT (graph method: CrossViT). 11 bricks; individually on a fixture: 8 ran (of which 6 constructed an object rather than computing a result; 8 with no instrument failure: 0 honoured, 2 violated, 6 with no contract checked; 0 where Syntology's instrument failed) · 3 unverified. The assembly has not been run end-to-end.

one of 4 siblings

  1. CrossViT entry · level 0 · unverified · 54eeb67b517aba4e
  2. ImageEmbedder model · level 1 · ran · 541e36b2edd2e342
  3. MultiScaleEncoder model · level 1 · ran · 18ea900a9c20be8f
  4. CrossTransformer model · level 0 · unverified · fcda9506e4ba0369
  5. Transformer model · level 1 · ran · 0415c013e361e191
  6. Attention model · level 0 · unverified · 695e0238d8d29d65
  7. PreNorm helper · level 1 · ran · d7aaba5132053213
  8. ProjectInOut helper · level 1 · ran · 395f410c7cd053df
  9. FeedForward model · level 1 · ran · b261477eb5f9d3a4
  10. default helper · level 1 · ran · violated contract · 60fff7c3c400d7ff
  11. exists helper · level 1 · ran · violated contract · aa5486a3650902d8

harvested Assembly for CrossViT (graph method: CrossViT). 11 bricks; individually on a fixture: 9 ran (of which 1 constructed an object rather than computing a result; 9 with no instrument failure: 0 honoured, 2 violated, 7 with no contract checked; 0 where Syntology's instrument failed) · 2 unverified. The assembly has not been run end-to-end.

one of 4 siblings

  1. CrossViT entry · level 0 · unverified · 74763df32bbe08b3
  2. ImageEmbedder model · level 1 · ran · 0a16f340785793af
  3. MultiScaleEncoder model · level 0 · unverified · 6f5a3f2db3ea4ac5
  4. CrossTransformer model · level 1 · ran · 7909555e0d7a8a93
  5. Transformer model · level 1 · ran · 139bcf50e1423e16
  6. Attention model · level 1 · ran · 39b524cdd79f5d2e
  7. PreNorm helper · level 1 · ran · c40137bc5259e649
  8. ProjectInOut helper · level 1 · ran · 5c51a399079da30b
  9. FeedForward model · level 1 · ran · d7f6c1668eb9259b
  10. default helper · level 1 · ran · violated contract · 60fff7c3c400d7ff
  11. exists helper · level 1 · ran · violated contract · aa5486a3650902d8

Each brick ends with its code_sha256, Syntology's identity for that exact code; click one to copy the get_code call that returns it. For agents, on Syntology's MCP service: assembly(arxiv_id="2103.14899") returns these assemblies with each brick's role and wiring (how to connect).

Tasks

General ClassificationImage Classificationimage-classification

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Classification ImageNet CrossViT-18+ GFLOPs 9.5 #501 of 1060 Archive leaderboard report
Image Classification ImageNet CrossViT-18+ Number of params 44.3M #501 of 1060 Archive leaderboard report
Image Classification ImageNet CrossViT-18+ Top 1 Accuracy 82.8% #501 of 1060 Archive leaderboard report
Image Classification ImageNet CrossViT-18 GFLOPs 9 #532 of 1060 Archive leaderboard report
Image Classification ImageNet CrossViT-18 Number of params 43.3M #532 of 1060 Archive leaderboard report
Image Classification ImageNet CrossViT-18 Top 1 Accuracy 82.5% #532 of 1060 Archive leaderboard report
Image Classification ImageNet CrossViT-15+ GFLOPs 6.1 #553 of 1060 Archive leaderboard report
Image Classification ImageNet CrossViT-15+ Number of params 28.2M #553 of 1060 Archive leaderboard report
Image Classification ImageNet CrossViT-15+ Top 1 Accuracy 82.3% #553 of 1060 Archive leaderboard report
Image Classification ImageNet CrossViT-15 GFLOPs 5.8 #637 of 1060 Archive leaderboard report
Image Classification ImageNet CrossViT-15 Number of params 27.4M #637 of 1060 Archive leaderboard report
Image Classification ImageNet CrossViT-15 Top 1 Accuracy 81.5% #637 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

Introduced by this paper: CrossViT

AttentionAttention DropoutConcatenated Skip ConnectionCrossViTDeiTDense ConnectionsDropoutFeedforward NetworkLayer NormalizationLinear LayerMulti-Head AttentionResidual ConnectionSoftmaxVision Transformer

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