mlsanityData to 7 Oct 2026

Are Transformers More Robust Than CNNs?

arXiv 2111.05464 ↗First posted 10 Nov 2021cs.CVcited by 187

Not on the map. Why?

Abstract (arXiv)

Transformer emerges as a powerful tool for visual recognition. In addition to demonstrating competitive performance on a broad range of visual benchmarks, recent works also argue that Transformers are much more robust than Convolutions Neural Networks (CNNs). Nonetheless, surprisingly, we find these conclusions are drawn from unfair experimental settings, where Transformers and CNNs are compared at different scales and are applied with distinct training frameworks. In this paper, we aim to provide the first fair & in-depth comparisons between Transformers and CNNs, focusing on robustness evaluations. With our unified training setup, we first challenge the previous belief that Transformers outshine CNNs when measuring adversarial robustness. More surprisingly, we find CNNs can easily be as robust as Transformers on defending against adversarial attacks, if they properly adopt Transformers' training recipes. While regarding generalization on out-of-distribution samples, we show pre-training on (external) large-scale datasets is not a fundamental request for enabling Transformers to achieve better performance than CNNs. Moreover, our ablations suggest such stronger generalization is largely benefited by the Transformer's self-attention-like architectures per se, rather than by other training setups. We hope this work can help the community better understand and benchmark the robustness of Transformers and CNNs. The code and models are publicly available at https://github.com/ytongbai/ViTs-vs-CNNs.

Key facts. Cited by 187 papers in the map (data through 7 Oct 2026). Builds on 54 of its 61 references that are in the map. First posted on arXiv 10 Nov 2021.

Builds on

54 of 61 references.

References · 54

  1. 2017Attention Is All You Needcited by 59,932
  2. 2015Deep Residual Learning for Image Recognitioncited by 51,809
  3. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  4. 2020Language Models are Few-Shot Learnerscited by 32,199
  5. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  6. 2014Microsoft COCO: Common Objects in Contextcited by 17,498
  7. 2014Very Deep Convolutional Networks for Large-Scale Image Recognitioncited by 15,267
  8. 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,082
  9. 2015Distilling the Knowledge in a Neural Networkcited by 10,076
  10. 2014ImageNet Large Scale Visual Recognition Challengecited by 8,441
  11. 2014Explaining and Harnessing Adversarial Examplescited by 7,287
  12. 2016Densely Connected Convolutional Networkscited by 6,691
38 more
  1. 2017Towards Deep Learning Models Resistant to Adversarial Attackscited by 6,326
  2. 2017mixup: Beyond Empirical Risk Minimizationcited by 5,155
  3. 2013Intriguing properties of neural networkscited by 5,114
  4. 2020Training data-efficient image transformers & distillation through attentioncited by 4,560
  5. 2014Going Deeper with Convolutionscited by 4,231
  6. 2016Gaussian Error Linear Units (GELUs)cited by 3,431
  7. 2021SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformerscited by 2,923
  8. 2019CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Featurescited by 2,875
  9. 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,801
  10. 2021Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutionscited by 1,960
  11. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
  12. 2017Accurate, Large Minibatch SGD: Training ImageNet in 1 Hourcited by 1,479
  13. 2020Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attackscited by 1,442
  14. 2021MLP-Mixer: An all-MLP Architecture for Visioncited by 1,441
  15. 2018ImageNet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustnesscited by 1,430
  16. 2019Natural Adversarial Examplescited by 1,401
  17. 2019Self-training with Noisy Student improves ImageNet classificationcited by 1,304
  18. 2021Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNetcited by 1,096
  19. 2021Scaling Vision Transformerscited by 993
  20. 2020Designing Network Design Spacescited by 954
  21. 2017Revisiting Unreasonable Effectiveness of Data in Deep Learning Eracited by 916
  22. 2021Going deeper with Image Transformerscited by 759
  23. 2020Fast is better than free: Revisiting adversarial trainingcited by 723
  24. 2019Square Attack: a query-efficient black-box adversarial attack via random searchcited by 682
  25. 2019Adversarial Training for Free!cited by 638
  26. 2019Stand-Alone Self-Attention in Vision Modelscited by 542
  27. 2021Intriguing Properties of Vision Transformerscited by 446
  28. 2021Pay Attention to MLPscited by 367
  29. 2019Attention Augmented Convolutional Networkscited by 363
  30. 2019Minimally distorted Adversarial Examples with a Fast Adaptive Boundary Attackcited by 333
  31. 2020Exploring Self-attention for Image Recognitioncited by 313
  32. 2021When Vision Transformers Outperform ResNets without Pre-training or Strong Data Augmentationscited by 259
  33. 2021Understanding Robustness of Transformers for Image Classificationcited by 250
  34. 2020Understanding the Difficulty of Training Transformerscited by 210
  35. 2021Vision Transformers are Robust Learnerscited by 208
  36. 2021Revisiting ResNets: Improved Training and Scaling Strategiescited by 158
  37. 2021Long-Short Transformer: Efficient Transformers for Language and Visioncited by 102
  38. 2018Benchmarking Neural Network Robustness to Common Corruptions and Surface Variationscited by 99

50 most cited of 54 All 54 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2021: 4; 2022: 54; 2023: 60; 2024: 38; 2025: 17; 2026: 14.

187 papers.

Sort:

By area:

  1. 2022Diffusion Models for Adversarial Purificationcited by 469
  2. 2022Dawn of the transformer era in speech emotion recognition: closing the valence gapcited by 155
  3. 2022Understanding The Robustness in Vision Transformerscited by 144
  4. 2022Diffusion Visual Counterfactual Explanationscited by 96
  5. 2022Guided Diffusion Model for Adversarial Purificationcited by 90
  6. 2022InvPT: Inverted Pyramid Multi-task Transformer for Dense Scene Understandingcited by 89
  7. 2023A Comprehensive Study on Robustness of Image Classification Models: Benchmarking and Rethinkingcited by 85
  8. 2021TransMix: Attend to Mix for Vision Transformerscited by 79
  9. 2023Revisiting Adversarial Training for ImageNet: Architectures, Training and Generalization across Threat Modelscited by 79
  10. 2022Benchmarking Robustness of 3D Point Cloud Recognition Against Common Corruptionscited by 78
  11. 2022Delving into Masked Autoencoders for Multi-Label Thorax Disease Classificationcited by 65
  12. 2023How Deep Learning Sees the World: A Survey on Adversarial Attacks & Defensescited by 65
38 more
  1. 2022A Broad Study of Pre-training for Domain Generalization and Adaptationcited by 64
  2. 2022A Light Recipe to Train Robust Vision Transformerscited by 64
  3. 2022When Adversarial Training Meets Vision Transformers: Recipes from Training to Architecturecited by 64
  4. 2023Swallowing the Bitter Pill: Simplified Scalable Conformer Generationcited by 55
  5. 2022Assaying Out-Of-Distribution Generalization in Transfer Learningcited by 53
  6. 2022ViewFool: Evaluating the Robustness of Visual Recognition to Adversarial Viewpointscited by 48
  7. 2022MulT: An End-to-End Multitask Learning Transformercited by 47
  8. 2021OOD-CV: A Benchmark for Robustness to Out-of-Distribution Shifts of Individual Nuisances in Natural Imagescited by 46
  9. 2023Robust Principles: Architectural Design Principles for Adversarially Robust CNNscited by 46
  10. 2021Are Vision Transformers Robust to Patch Perturbations?cited by 39
  11. 2022Can CNNs Be More Robust Than Transformers?cited by 38
  12. 2023Understanding the Robustness of 3D Object Detection with Bird's-Eye-View Representations in Autonomous Drivingcited by 37
  13. 2022Are Vision Transformers Robust to Spurious Correlations?cited by 36
  14. 2022MTTrans: Cross-Domain Object Detection with Mean-Teacher Transformercited by 35
  15. 2022An Impartial Take to the CNN vs Transformer Robustness Contestcited by 34
  16. 2023COCO-O: A Benchmark for Object Detectors under Natural Distribution Shiftscited by 34
  17. 2024Revisiting Adversarial Training at Scalecited by 33
  18. 2023Making Substitute Models More Bayesian Can Enhance Transferability of Adversarial Examplescited by 32
  19. 2024Touchstone Benchmark: Are We on the Right Way for Evaluating AI Algorithms for Medical Segmentation?cited by 31
  20. 2023ImageNet-E: Benchmarking Neural Network Robustness via Attribute Editingcited by 30
  21. 2022Towards Efficient Adversarial Training on Vision Transformerscited by 29
  22. 2023Survey on Unsupervised Domain Adaptation for Semantic Segmentation for Visual Perception in Automated Drivingcited by 29
  23. 2023Improving Adversarial Transferability via Intermediate-level Perturbation Decaycited by 29
  24. 2022Revisiting Residual Networks for Adversarial Robustness: An Architectural Perspectivecited by 28
  25. 2022Benchmarking the Robustness of Deep Neural Networks to Common Corruptions in Digital Pathologycited by 26
  26. 2022Proximal Splitting Adversarial Attacks for Semantic Segmentationcited by 23
  27. 2022Exploring the Relationship between Architecture and Adversarially Robust Generalizationcited by 23
  28. 2023InvPT++: Inverted Pyramid Multi-Task Transformer for Visual Scene Understandingcited by 22
  29. 2023WBCAtt: A White Blood Cell Dataset Annotated with Detailed Morphological Attributescited by 22
  30. 2023Robustifying Token Attention for Vision Transformerscited by 19
  31. 2023ConvNet vs Transformer, Supervised vs CLIP: Beyond ImageNet Accuracycited by 19
  32. 2023TWINS: A Fine-Tuning Framework for Improved Transferability of Adversarial Robustness and Generalizationcited by 18
  33. 2023Distilling Efficient Vision Transformers from CNNs for Semantic Segmentationcited by 18
  34. 2024Structure-based drug design by denoising voxel gridscited by 18
  35. 2022Evaluating Out-of-Distribution Performance on Document Image Classifierscited by 16
  36. 2023Reliability in Semantic Segmentation: Are We on the Right Track?cited by 16
  37. 2024LookupViT: Compressing visual information to a limited number of tokenscited by 16
  38. 2023On the Adversarial Robustness of Camera-based 3D Object Detectioncited by 15

50 most cited of 187 All 187 (JSON)