Cited by 782Advanced Neural Network ApplicationsDomain Adaptation and Few-Shot LearningVisual Attention and Saliency Detection

ConViT: improving vision transformers with soft convolutional inductive biases

Open access
d’Ascoli, Stéphane, Touvron, Hugo, Leavitt, Matthew L, Morcos, Ari S, Biroli, Giulio, Sagun, Levent·2022·Journal of Statistical Mechanics: Theory and Experiment

Abstract

Convolutional architectures have proven to be extremely successful for vision tasks. Their hard inductive biases enable sample-efficient learning, but come at the cost of a potentially lower performance ceiling. Vision transformers rely on more flexible self-attention layers, and have recently outperformed CNNs for image classification. However, they require costly pre-training on large external datasets or distillation from pre-trained convolutional networks. In this paper, we ask the following question: is it possible to combine the strengths of these two architectures while avoiding their respective limitations? To this end, we introduce gated positional self-attention (GPSA), a form of positional self-attention which can be equipped with a ‘soft’ convolutional inductive bias. We initialize the GPSA layers to mimic the locality of convolutional layers, then give each attention head the freedom to escape locality by adjusting a gating parameter regulating the attention paid to position versus content information. The resulting convolutional-like ViT architecture, ConViT , outperforms the DeiT (Touvron et al 2020 arXiv: 2012.12877 ) on ImageNet, while offering a much improved sample efficiency. We further investigate the role of locality in learning by first quantifying how it is encouraged in vanilla self-attention layers, then analyzing how it has escaped in GPSA layers. We conclude by presenting various ablations to better understand the success of the ConViT. Our code and models are released publicly at https://github.com/facebookresearch/convit .

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

Crossref · 10.1088/1742-5468/ac9830

Cites

9 of 9 references verified0 citation errors · 0 not checkable

Statistics

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • RPE is often jointly used with absolute positional encodings, or the absolute position information is leaked in other ways.

    “Additionally, although RPE becomes popular recently, it is often jointly used with absolute positional encodings (e.g., in ConViT (d'Ascoli et al., 2021)), or the absolute position information is leaked in other ways (e.g., convolution paddings in CoAtNet (Dai et al., 2021)).”

    From Conditional Positional Encodings for Vision Transformers (2021) · cites this paper as d'Ascoli et al., 2021

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Cites

Flagged first, then by citations

Research works printed but not linked: 36

  1. Abnar S, Dehghani M and Zuidema W 2020 Transferring inductive biases through knowledge distillation (arXiv:2006.00555) · arXiv
  2. Anandkumar A, Deng Y, Ge R and Mobahi H 2016 Homotopy analysis for tensor PCA (arXiv:1610.09322) · arXiv
  3. Bahdanau D, Cho K and Bengio Y 2014 Neural machine translation by jointly learning to align and translate (arXiv:1409.0473) · arXiv
  4. Bello I, Zoph B, Vaswani A, Shlens J and Le Q V 2019 Attention augmented convolutional networks Proc. IEEE Int. Conf. Computer Vision pp 3286-95
  5. Chen Y, Kalantidis Y, Li J, Yan S and Feng J 2018 A2-nets: double attention networks (arXiv:1810.11579) · arXiv
  6. Chen Y-C, Li L, Yu L, El Kholy A, Ahmed F, Gan Z, Cheng Y and Liu J U 2020 UNITER: UNiversal image-TExt representation learning European Conf. Computer Vision (Springer) pp 104-20
  7. Cordonnier J-B, Loukas A and Jaggi M 2019 On the relationship between self-attention and convolutional layers (arXiv:1911.03584) · arXiv
  8. 'Ascoli S, Sagun L, Biroli G and Bruna J 2019 Finding the needle in the haystack with convolutions: on the benefits of architectural bias Advances in Neural Information Processing Systems pp 9334-45
  9. Devlin J, Chang M-W, Lee K and Toutanova K 2018 BERT: pre-training of deep bidirectional transformers for language understanding (arXiv:1810.04805) · arXiv
  10. Dong Y, Cordonnier J-B and Loukas A 2021 Attention is not all you need: pure attention loses rank doubly exponentially with depth (arXiv:2103.03404) · arXiv
  11. Elsayed G, Ramachandran P, Shlens J and Kornblith S 2020 Revisiting spatial invariance with low-rank local connectivity Int. Conf. Machine Learning (PMLR) pp 2868-79
  12. Goodfellow I, Bengio Y and Courville A 2016 Deep Learning (Cambridge, MA: MIT Press)
  13. Hinton G, Vinyals O and Dean J 2015 Distilling the knowledge in a neural network (arXiv:1503.02531) · arXiv
  14. Hu H, Gu J, Zhang Z, Dai J and Wei Y 2018a Relation networks for object detection Proc. IEEE Conf. Computer Vision and Pattern Recognition pp 3588-97
  15. Hu J, Shen L, Albanie S, Sun G and Vedaldi A 2018b Gather-excite: exploiting feature context in convolutional neural networks Advances in Neural Information Processing Systems vol 31 ed S Bengio, H Wallach, H Larochelle, K Grauman, N Cesa-Bianchi and R Garnett (Curran Associates) pp 9401-11
  16. Hu J, Shen L and Sun G 2018c Squeeze-and-Excitation networks 2018 IEEE/CVF Conf. Computer Vision and Pattern Recognition pp 7132-41
  17. Lecun Y, Bottou L, Bengio Y and Haffner P 1998 Gradient-based learning applied to document recognition Proc. IEEE 86 2278-324 · DOI · Paper page
  18. Locatello F, Weissenborn D, Unterthiner T, Mahendran A, Heigold G, Uszkoreit J, Dosovitskiy A and Kipf T 2020 Object-centric learning with slot attention (arXiv:2006.15055) · arXiv
  19. Neyshabur B 2020 Towards learning convolutions from scratch Advances in Neural Information Processing Systems vol 33
  20. Radosavovic I, Kosaraju R P, Girshick R, He K and Dollár P 2020 Designing network design spaces Proc. IEEE/CVF Conf. Computer Vision and Pattern Recognition pp 10428-36
  21. Ramachandran P, Parmar N, Vaswani A, Bello I, Levskaya A and Shlens J 2019 Stand-alone self-attention in vision models (arXiv:1906.05909) · arXiv
  22. Ruderman D L and Bialek W 1994 Statistics of natural images: scaling in the woods Phys. Rev. Lett. 73 814 · DOI
  23. Scherer D, Müller A and Behnke S 2010 Evaluation of pooling operations in convolutional architectures for object recognition Artificial Neural Networks-ICANN 2010 Lecture Notes in Computer Science ed K Diamantaras, W Duch and L S Iliadis (Berlin: Springer) pp 92-101
  24. Schmidhuber J 2015 Deep learning in neural networks: an overview Neural Netw. 61 85-117 · DOI · Paper page
  25. Srinivas A, Lin T-Y, Parmar N, Shlens J, Abbeel P and Vaswani A 2021 Bottleneck transformers for visual recognition (arXiv:2101.11605) · arXiv
  26. Sukhbaatar S, Grave E, Bojanowski P and Joulin A 2019 Adaptive attention span in transformers (arXiv:1905.07799) · arXiv
  27. Sun C, Myers A, Vondrick C, Murphy K and Schmid C V 2019 A joint model for video and language representation learning Proc. IEEE Int. Conf. Computer Vision pp 7464-73
  28. Sundermeyer M, Schlüter R and Ney H 2012 LSTM neural networks for language modeling 13th Annual Conf. Int. Speech Communication Association
  29. Tolstikhin I et al 2021 MLP-mixer: an all-MLP architecture for vision (arXiv:2105.01601) · arXiv
  30. Touvron H, Cord M, Douze M, Massa F, Sablayrolles A and Jégou H 2020 Training data-efficient image transformers & distillation through attention (arXiv:2012.12877) · arXiv
  31. Touvron H et al 2021a ResMLP: feedforward networks for image classification with data-efficient training (arXiv:2105.03404) · arXiv
  32. Touvron H, Cord M, Sablayrolles A, Synnaeve G and Jégou H 2021b Going deeper with image transformers Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez A N, Kaiser L and Polosukhin I 2017 Attention is all you need Advances in Neural Information Processing Systems pp 5998-6008
  33. Wu B, Xu C, Dai X, Wan A, Zhang P, Tomizuka M, Keutzer K and Vajda P 2020 Visual transformers: token-based image representation and processing for computer vision (arXiv:2006.03677) · arXiv
  34. Yuan L, Chen Y, Wang T, Yu W, Shi Y, Tay F E, Feng J and Yan S 2021 Tokens-to-token ViT: training vision transformers from scratch on imagenet (arXiv:2101.11986) · arXiv
  35. Zhai X, Oliver A, Kolesnikov A and Beyer L 2019 S4L: self-supervised semi-supervised learning Proc. IEEE/CVF Int. Conf. Computer Vision pp 1476-85
  36. Zhao S, Zhou L, Wang W, Cai D, Lam T L and Xu Y 2020 Splitnet: divide and co-training (arXiv:2011.14660) https://doi.org/10.1088/1742-5468/ac9830 · arXiv

Cited by

Sorted by citations

Authors
d’Ascoli, S., Touvron, H., Leavitt, M. L., Morcos, A. S., Biroli, G., & Sagun, L.
Affiliations
  • École Normale Supérieure - PSL (FR)
  • Meta (United States) (US)
Corresponding author
  • d’Ascoli, Stéphane
  • Leavitt, Matthew L
Venue
Journal of Statistical Mechanics: Theory and Experiment
Published
2022-11-01
Volume
2022
Issue
11
Pages
114005
ISSN
1742-5468 (ISSN-L)
OpenAlex
W3137278571
Cited by
782
References
9
Citations by year
2026: 65 · 2025: 137 · 2024: 189 · 2023: 210 · 2022: 135 · 2021: 46
FWCI
54.88
Type
journal article
Language
en
Open access
Locations
  • Journal of Statistical Mechanics Theory and Experiment (publishedVersion)
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Funders
Agence Nationale de la Recherche (ANR‐19, ANR-19-P3IA-0001)
Topics
  • Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Advanced Neural Network Applications
  • Physical Sciences › Computer Science › Artificial Intelligence › Domain Adaptation and Few-Shot Learning
  • Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Visual Attention and Saliency Detection
Keywords
vision transformer, locality, sample efficiency, attention heads, image classification, CNN-Transformer hybrid, pre-training

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review