Source-linked AI summary

Visual Attention Methods in Deep Learning: An In-Depth Survey

Mohammed Hassanin, Saeed Anwar, Ibrahim Radwan, Fahad S Khan, Ajmal Mian

arXiv:2204.07756v3cs.CVcs.AIcs.LGeess.IV

TL;DR

The paper addresses the lack of a comprehensive survey of deep learning attention mechanisms for vision. It reviews and categorizes attention techniques by their dominant characteristics, discusses their building blocks, applications, strengths, limitations, and open challenges, and concludes with future research directions. The survey’s supported conclusion is that organizing methods by attention-score computation provides a useful hierarchical framework for understanding model construction and training strategies.

  • Problem

    The literature lacks a comprehensive survey of deep learning-based attention techniques for visual inputs, while transformer surveys cover only one self-attention category among many.

  • Method

    The paper reviews more than 70 vision-related articles and classifies attention mechanisms by their dominant methodology and attention-score computation.

  • Results

    The survey comprehensively discusses attention techniques, including their building blocks, applications, strengths, limitations, challenges, and future directions.

  • Takeaways & Limitations

    Grouping attention techniques by attention-score calculation helps determine how attention-based models are built and which training strategies they employ.

  • Takeaways & Limitations

    Attention models face high computational costs, substantial training-data requirements, generalization difficulties, and efficiency challenges in practical vision settings.

Abstract

from arXiv · show

Inspired by the human cognitive system, attention is a mechanism that imitates the human cognitive awareness about specific information, amplifying critical details to focus more on the essential aspects of data. Deep learning has employed attention to boost performance for many applications. Interestingly, the same attention design can suit processing different data modalities and can easily be incorporated into large networks. Furthermore, multiple complementary attention mechanisms can be incorporated into one network. Hence, attention techniques have become extremely attractive. However, the literature lacks a comprehensive survey on attention techniques to guide researchers in employing attention in their deep models. Note that, besides being demanding in terms of training data and computational resources, transformers only cover a single category in self-attention out of the many categories available. We fill this gap and provide an in-depth survey of 50 attention techniques, categorizing them by their most prominent features. We initiate our discussion by introducing the fundamental concepts behind the success of the attention mechanism. Next, we furnish some essentials such as the strengths and limitations of each attention category, describe their fundamental building blocks, basic formulations with primary usage, and applications specifically for computer vision. We also discuss the challenges and general open questions related to attention mechanisms. Finally, we recommend possible future research directions for deep attention. All the information about visual attention methods in deep learning is provided at \href{https://github.com/saeed-anwar/VisualAttention}{https://github.com/saeed-anwar/VisualAttention}

1. Introduction

Attention methods have expanded across deep learning and computer vision, motivating a broad survey that categorizes techniques by their dominant characteristics and guides method selection. The survey also addresses attention’s computational, data, generalization, and efficiency challenges.

  • Attention background: Attention mechanisms range from implicit neural-network attention to explicit encoder-decoder, self-attention, pixel-level, and global image representations.Transformers encode sequence items in parallel as keys, queries, and values, while vision methods may compare pixel representations or learn global attention maps.
  • Research gap: Existing surveys often focus on specific branches, whereas this work provides a high-level overview of attention methods for visual inputs.The paper distinguishes its attention-type focus from application-specific surveys of NLP, transformers, graph approaches, and limited basic vision mechanisms.
  • Survey organization: The survey categorizes attention techniques by methodology, assigning methods that span categories to their most dominant characteristic and primary application.This organization is intended to expose shared mechanism characteristics and inform the design of new attention techniques.
  • Contributions: The paper surveys attention methods, provides a categorization, and discusses challenges and future research directions for computer vision and machine learning.Its stated contributions include a broad survey rather than coverage of a single attention branch.
  • Motivation: Attention-related publications have increased substantially, supporting the need for a comprehensive survey of visual attention methods.The survey aims to help researchers select suitable mechanisms, avoid duplicated methodologies, identify research gaps, and pursue future directions.
  • Scope and challenges: Transformers offer high accuracy but require substantial computational resources and training data, and cover only one category among the survey’s 50 self-attention categories.These constraints can hinder deployment on mobile and embedded systems and motivate examining broader attention designs.

2. Attention in Vision

The survey categorizes vision attention methods according to the main function used to generate attention scores, connecting each category with applications, strengths, and limitations.

  • Categorization: Vision attention methods are categorized by the main function used to generate attention scores, such as softmax or sigmoid.Table 1 summarizes each category’s applications, strengths, and limitations.

2.1. Soft (Deterministic) Attention

Soft deterministic attention methods generate scores from feature channels, spatial regions, self-similarity, arithmetic operations, or related representations to emphasize informative content. The survey describes their structures, efficiency trade-offs, and applications across vision tasks.

  • Channel Attention: Channel attention calculates channel-wise scores so each feature map can attend to specific input content.SE uses global average pooling, dimensionality reduction, nonlinear transformation, and sigmoid gating; ECA instead uses local cross-channel interaction without reduction.
  • Spatial Attention: Spatial attention generates scores over spatial patches or regions, emphasizing informative image locations rather than channels.Such region-focused attention supports object detection, semantic segmentation, and person re-identification.
  • Other Soft Attention Designs: Several mechanisms use specialized operations or learned structures, including split attention, automatic attention-module search, dropout-based masking, and sequential attention.HOGA represents heterogeneous attention operations as nodes and edges in a DAG, while attention-based dropout hides discriminative regions to improve whole-object localization.
  • Applications and Outcomes: Reported applications and outcomes show attention supporting discriminative representation, localization, captioning, and category-sensitive feature selection.A2-Nets capture second-order statistics and were reported as more effective than SE and non-local networks while also improving memory and time efficiency; GAINS improved over the state of the art without recursive runs.
  • Self-attention: Self-attention measures similarity between representations from the same input, but implementations differ in architecture and computational cost.Standalone self-attention uses local n × n patches with complexity O(hwn^2), while efficient attention reorders matrix multiplication to avoid quadratic n × n processing.
  • Limitations: Attention methods retain practical limitations, including high resource demands, positional-information weaknesses, data requirements, and bias or history dependence.The survey notes transformer complexity and training-data demands, standalone self-attention’s positional encoding issue, and Kalman Filtering Attention’s motivation to address past-training and query-frequency bias.

2.2. Hard (Stochastic) Attention

Hard attention selects discrete states or regions rather than weighted averages, using stochastic, Bayesian, reinforced, Gaussian, and expectation-maximization designs to focus representations.

  • Hard attention foundations: Hard attention selects one hidden state as the attention score instead of averaging hidden states, making modeling and gradient-preserving training central design questions.The survey covers Bayesian, variational, reinforced, and Gaussian hard-attention mechanisms.
  • Bayesian attention: Bayesian Attention Modules align keys and queries into latent attention-weight distributions, train through reparameterization, and regularize with KL divergence.Lognormal or Weibull distributions are used for weight normalization.
  • Bayesian attention: Repulsive Attention uses stochastic Bayesian inference and particle optimization to keep multi-head attention heads diverse and reduce attention collapse.Each head is treated as a posterior-distribution sample separated from the others.
  • Reinforced attention: Reinforced attention combines soft and hard attention, while self-critic attention uses REINFORCE to generate and re-evaluate attention maps with supervisory guidance.These methods address soft attention's diffuse assignments and weak supervision of attention maps.
  • Gaussian attention: Gaussian attention replaces softmax with a 2D Gaussian kernel that discriminates important features while reducing parameters by avoiding additional fully connected layers or convolutions.The kernel predicts attention scores for individual feature-map elements.
  • Expectation Maximization attention: Expectation Maximization attention iteratively learns a compact basis set whose weighted sum produces the output, reducing the need to compare every pixel with every other pixel.The bases are learning parameters and latent variables serve as attention maps.

3. Attention for Vision Tasks

Attention mechanisms are matched to vision-task requirements: spatial attention focuses on image regions, channel attention reweights feature channels, and spatio-temporal attention extends focus to video.

  • Task-specific attention: Spatial attention is commonly used for image captioning because it attends to relevant image regions while descriptions are generated.
  • Task-specific attention: Channel attention emphasizes informative channels and suppresses less relevant ones, supporting feature representation in image classification and object detection.
  • Task-specific attention: Spatio-temporal attention extends attention across spatial regions in video data.

4. Open Problems and Challenges

Vision attention models face practical challenges in generalization, efficiency, training-data and computational demands, interpretability, and transferring methods across task settings.

  • Practical limitations: Practical adoption is also constrained by high computational costs, substantial training-data requirements, model-efficiency concerns, and difficulty visualizing and interpreting attention blocks.
  • Generalization: Many attention models are application-specific and generalize poorly beyond their proposed settings, especially on low-level vision tasks.Channel and spatial attention have performed better in classification but fail when applied directly to low-level vision tasks.
  • Generalization: Data quality influences the generalization and robustness of attention models, leaving pretrained attention models difficult to extend to generalized low-level vision tasks.
  • Efficiency: Efficiency remains challenging because attention models prioritize performance over computational cost in real-time computer vision applications.The base ViT is reported at 18 billion FLOPs versus 600 million FLOPs for comparable CNN models with similar image-processing performance.

5. Conclusions

The survey reviews and hierarchically organizes vision attention mechanisms by how they compute attention scores, while identifying unresolved challenges and research questions.

  • Conclusions: The paper reviews more than 70 articles on attention mechanisms used in vision applications and discusses their strengths and limitations.
  • Conclusions: Grouping techniques by attention-score calculation clarifies how attention-based models are built and which training strategies they use.
  • Conclusions: The survey identifies unresolved challenges and open questions in computer vision despite attention methods' ability to model salient features and improve performance.
Loading 2204.07756v3…