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

By Meng-Hao Guo, Zheng-Ning Liu, Tai-Jiang Mu, Shimin Hu. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021

709 citations recorded by the source corpus.

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.

Subfields: Computer Vision and Pattern Recognition

View Paper: https://www.semanticscholar.org/paper/fc92009ab34045f9e6d490684c7761f768e88c54

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Computer Vision and Pattern Recognition

  1. Dacheng Tao
  2. Ming-Ming Cheng
  3. Yunhe Wang
  4. Qibin Hou
  5. Kai Han
  6. Jing Zhang
  7. Jianyuan Guo
  8. Chunjing Xu

Citations in the corpus