Papers › Can CNNs Be More Robust Than Transformers?

Can CNNs Be More Robust Than Transformers?

7 Jun 2022arXiv:2206.03452archive 2025-07-28

Zeyu Wang, Yutong Bai, Yuyin Zhou, Cihang Xie

The recent success of Vision Transformers is shaking the long dominance of Convolutional Neural Networks (CNNs) in image recognition for a decade. Specifically, in terms of robustness on out-of-distribution samples, recent research finds that Transformers are inherently more robust than CNNs, regardless of different training setups. Moreover, it is believed that such superiority of Transformers should largely be credited to their self-attention-like architectures per se. In this paper, we question that belief by closely examining the design of Transformers. Our findings lead to three highly effective architecture designs for boosting robustness, yet simple enough to be implemented in several lines of code, namely a) patchifying input images, b) enlarging kernel size, and c) reducing activation layers and normalization layers. Bringing these components together, we are able to build pure CNN architectures without any attention-like operations that are as robust as, or even more robust than, Transformers. We hope this work can help the community better understand the design of robust neural architectures. The code is publicly available at https://github.com/UCSC-VLAA/RobustCNN.

PaperPDFCodeCode 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="2206.03452")

Code

Syntology Ran 2 of 15 code samples harvested from 1 repository linked to this paper; 13 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · fixture could not drive it.

By repository: official repository: 15 samples from 1 repository, 2 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

ucsc-vlaa/robustcnn officialmentioned in papermentioned on GitHubpytorchMIT 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

15 samples harvested; 2 ran; 1 honoured the contract we drafted; 13 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
1ran · fixture could not drive it
13unverified

Licence: 0 of the 15 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 ucsc-vlaa/robustcnn. “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.

adapt_input_conv ucsc-vlaa/robustcnn/timm/models/helpers.py official repository ran · fixture could not drive it MIT (permissive) · c58578dcfe39d5e3 · report
get_padding ucsc-vlaa/robustcnn/timm/models/robust_resnet.py official repository ran · honoured contract fingerprinted MIT (permissive) · 9b02c1068795fd5b · report
create_model ucsc-vlaa/robustcnn/timm/models/factory.py official repository unverified MIT (permissive) · 983c6a8ed9b9f1e3 · report
download_cached_file ucsc-vlaa/robustcnn/timm/models/hub.py official repository unverified MIT (permissive) · 32933dcf801320f2 · report
downsample_avg ucsc-vlaa/robustcnn/timm/models/robust_resnet.py official repository unverified MIT (permissive) · 9f91aef11975b7e7 · report
downsample_conv ucsc-vlaa/robustcnn/timm/models/robust_resnet.py official repository unverified MIT (permissive) · ae25309d30fc2b83 · report
get_cache_dir ucsc-vlaa/robustcnn/timm/models/hub.py official repository unverified MIT (permissive) · da3ccccf419f89e7 · report
has_hf_hub ucsc-vlaa/robustcnn/timm/models/hub.py official repository unverified MIT (permissive) · 4169528fccdf4859 · report
is_model ucsc-vlaa/robustcnn/timm/models/registry.py official repository unverified MIT (permissive) · cd2a47ded9dd84cf · report
list_models ucsc-vlaa/robustcnn/timm/models/registry.py official repository unverified MIT (permissive) · d14a6ca5ff9d530e · report
load_state_dict ucsc-vlaa/robustcnn/timm/models/helpers.py official repository unverified MIT (permissive) · a5729ac034a0df02 · report
register_model ucsc-vlaa/robustcnn/timm/models/registry.py official repository unverified MIT (permissive) · e13039fb1c347452 · report
resume_checkpoint ucsc-vlaa/robustcnn/timm/models/helpers.py official repository unverified MIT (permissive) · 102b75f3481035d1 · report
safe_model_name ucsc-vlaa/robustcnn/timm/models/factory.py official repository unverified MIT (permissive) · dcad83d71e6ab634 · report
split_model_name ucsc-vlaa/robustcnn/timm/models/factory.py official repository unverified MIT (permissive) · 8b170a922ca9e2f3 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

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