4.8 Article

Beyond Self-Attention: External Attention Using Two Linear Layers for Visual Tasks

Journal

Publisher

IEEE COMPUTER SOC
DOI: 10.1109/TPAMI.2022.3211006

Keywords

Task analysis; Visualization; Transformers; Computer architecture; Semantics; Point cloud compression; Image synthesis; Deep learning; computer vision; attention; transformer; multi-layer perceptrons

Ask authors/readers for more resources

Attention mechanisms, especially self-attention, are crucial for deep feature representation in visual tasks. This article proposes a novel attention mechanism called external attention, which uses shared memories to capture correlations between samples and has lower computational and memory costs compared to self-attention. Experimental results demonstrate that our method achieves comparable or superior results in various visual tasks.
Attention mechanisms, especially self-attention, have played an increasingly important role in deep feature representation for visual tasks. Self-attention updates the feature at each position by computing a weighted sum of features using pair-wise affinities across all positions to capture the long-range dependency within a single sample. However, self-attention has quadratic complexity and ignores potential correlation between different samples. This article proposes a novel attention mechanism which we call external attention, based on two external, small, learnable, shared memories, which can be implemented easily by simply using two cascaded linear layers and two normalization layers; it conveniently replaces self-attention in existing popular architectures. External attention has linear complexity and implicitly considers the correlations between all data samples. We further incorporate the multi-head mechanism into external attention to provide an all-MLP architecture, external attention MLP (EAMLP), for image classification. Extensive experiments on image classification, object detection, semantic segmentation, instance segmentation, image generation, and point cloud analysis reveal that our method provides results comparable or superior to the self-attention mechanism and some of its variants, with much lower computational and memory costs.

Authors

I am an author on this paper
Click your name to claim this paper and add it to your profile.

Reviews

Primary Rating

4.8
Not enough ratings

Secondary Ratings

Novelty
-
Significance
-
Scientific rigor
-
Rate this paper

Recommended

No Data Available
No Data Available