PreprintCited by 977Advanced Neural Network ApplicationsVisual Attention and Saliency DetectionDomain Adaptation and Few-Shot Learning

Stand-Alone Self-Attention in Vision Models

Open access
Ramachandran, Prajit, Parmar, Niki, Vaswani, Ashish, Bello, Irwan, Levskaya, Anselm, Shlens, Jonathon·2019·arXiv

Abstract

Convolutions are a fundamental building block of modern computer vision systems. Recent approaches have argued for going beyond convolutions in order to capture long-range dependencies. These efforts focus on augmenting convolutional models with content-based interactions, such as self-attention and non-local means, to achieve gains on a number of vision tasks. The natural question that arises is whether attention can be a stand-alone primitive for vision models instead of serving as just an augmentation on top of convolutions. In developing and testing a pure self-attention vision model, we verify that self-attention can indeed be an effective stand-alone layer. A simple procedure of replacing all instances of spatial convolutions with a form of self-attention applied to ResNet model produces a fully self-attentional model that outperforms the baseline on ImageNet classification with 12% fewer FLOPS and 29% fewer parameters. On COCO object detection, a pure self-attention model matches the mAP of a baseline RetinaNet while having 39% fewer FLOPS and 34% fewer parameters. Detailed ablation studies demonstrate that self-attention is especially impactful when used in later layers. These results establish that stand-alone self-attention is an important addition to the vision practitioner's toolbox.

Integrity signals

Registry

DataCite · 10.48550/arxiv.1906.05909

Cites

Statistics

Recomputing p-values needs the paper’s full text.

Claims the paper makes

We couldn’t retrieve this paper’s full text, so its claims and self-check weren’t run. The registry and citation checks still apply.

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?

  • Models that replace convolutions entirely with self-attention have not yet been scaled effectively on modern hardware accelerators due to the use of specialized attention patterns.

    “The latter models, while theoretically efficient, have not yet been scaled effectively on modern hardware accelerators due to the use of specialized attention patterns.”

    From An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale (2020) · cites this paper as Ramachandran et al., 2019

  • Deformable attention is just slightly slower than traditional convolution under the same FLOPs.

    “Different from Ramachandran et al. (2019); Hu et al. (2019), deformable attention is just slightly slower than the traditional convolution under the same FLOPs.”

    From Deformable DETR: Deformable Transformers for End-to-End Object Detection (2020) · cites this paper as Ramachandran et al. (2019)

  • The locality of convolutional layers in FCNNs limits their capability of learning long-range spatial dependencies.

    “Despite their success, the locality of convolutional layers in FCNNs, limits the capability of learning long-range spatial dependencies.”

    From UNETR: Transformers for 3D Medical Image Segmentation (2022) · cites this paper as [35]

No citation lists for this paper

No citation lists for this paper yet — checked again daily.

References 63 · Cited by 977

Authors
Ramachandran, P., Parmar, N., Vaswani, A., Bello, I., Levskaya, A., & Shlens, J.
Affiliations
Google (United States) (US)
Venue
arXiv
Publisher
arXiv
Published
2019
Volume
32
Pages
68-80
ISSN
2331-8422 (ISSN-L)
OpenAlex
W2949718784
Cited by
977
References
63
Citations by year
2026: 2 · 2025: 104 · 2024: 163 · 2023: 238 · 2022: 217 · 2021: 203 · 2020: 44 · 2019: 6
Type
posted content
Language
en
Open access
Locations
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Topics
  • Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Advanced Neural Network Applications
  • Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Visual Attention and Saliency Detection
  • Physical Sciences › Computer Science › Artificial Intelligence › Domain Adaptation and Few-Shot Learning
Keywords
self-attention, long-range dependencies, ResNet, ImageNet classification, RetinaNet, FLOPs reduction, parameter efficiency

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