AttentionNAS: Spatiotemporal Attention Cell Search for Video Classification

Xiaofang Wang, Xuehan Xiong, Maxim Neumann, A. J. Piergiovanni, Michael S. Ryoo, Anelia Angelova, Kris M. Kitani, Wei Hua

Introduction

Convolutional Neural Networks (CNNs) are the standard for video classification, yet they are constrained by two inherent properties: locality and uniformity. Standard convolutions focus on small, local neighborhoods, making it difficult to capture long-range spatiotemporal dependencies essential for understanding complex actions. Additionally, they apply the same filters across all positions, regardless of the relative importance of different regions. While attention mechanisms like Non-Local Blocks have been proposed to mitigate these issues, manually designing these blocks for video is a complex task often characterized by sub-optimal trial and error.

AttentionNAS addresses this by introducing the first framework to apply Neural Architecture Search (NAS) to the design of spatiotemporal attention cells. By automating the discovery of how and where to apply attention, the researchers achieved significant performance gains over manually designed backbones like I3D and S3D.

The AttentionNAS Search Space

The authors define a hierarchical search space that operates at two levels: the operation level and the cell level.

Operation Level

The search space includes two primary types of attention primitives:

  • Map-based attention: This operation learns a weighting factor for each position, effectively "focusing" the model on salient regions or frames.
  • Dot-product attention: This models long-range interactions between distant pixels or frames by computing a similarity matrix, similar to the self-attention mechanism in Transformers.

The algorithm also selects the target dimension (Temporal, Spatial, or Spatiotemporal) and the activation function (ReLU, Sigmoid, Softmax, or None) for each operation.

Overview of map-based and dot-product attention primitives within the search space.

Cell Level

At the cell level, the algorithm determines the connectivity of $K$ primitive operations to form a single "Attention Cell." This allows the search to discover multi-branch structures that can capture diverse spatiotemporal features more effectively than a single operation.

The structure of a searched Attention Cell, illustrating the combination of multiple primitive operations.

Search Algorithms

The paper explores two distinct methodologies for architecture discovery:

  1. Gaussian Process Bandit (GPB): A Bayesian optimization approach that treats the architecture as a black box and iteratively predicts performance to guide the search.
  2. Differentiable Architecture Search (DARTS): This gradient-based method represents the search space as a "supergraph" where all possible connections exist simultaneously with continuous weights. This allows the model to "learn" the optimal architecture through standard backpropagation while simultaneously learning video features.

Key Insights and Results

The AttentionNAS framework yielded several critical insights into the nature of attention in video models:

  • Position-Specific Architectures: A major finding was that the "best" attention cell depends on its depth in the network. Using differentiable search, the authors discovered that placing specialized, different cells at different depths consistently outperformed using a uniform cell throughout.
  • Generalization and Transferability: Cells discovered on RGB frames generalized remarkably well to Optical Flow data. Furthermore, cells found for one backbone (e.g., S3D) provided significant gains when transferred to different backbones like I3D-ResNet50.

Performance Benchmarks

Evaluated on the massive Kinetics-600 and Moments in Time (MiT) datasets, AttentionNAS established new state-of-the-art results:

  • Accuracy Gains: Integrating searched cells into an I3D backbone improved Top-1 accuracy by 2.28% on Kinetics-600 and 2.20% on MiT.
  • State-of-the-Art Comparison: An I3D-ResNet50 backbone enhanced with AttentionNAS cells achieved 79.83% on Kinetics-600 and 32.48% on MiT, outperforming more complex architectures like SlowFast-R50 and AssembleNet-50.

Conclusion and Future Work

AttentionNAS demonstrates that automated search can find more efficient and accurate attention configurations than manual design. While current limitations include a fixed cell complexity and increased inference overhead, the framework paves the way for future end-to-end NAS that jointly optimizes both the convolutional backbone and the attention mechanisms for video understanding.

Summary updated

BibTeX
@inproceedings{wang2020attentionnas,
  author = {Xiaofang Wang and Xuehan Xiong and Maxim Neumann and A. J. Piergiovanni and Michael S. Ryoo and Anelia Angelova and Kris M. Kitani and Wei Hua},
  title = {{AttentionNAS: Spatiotemporal Attention Cell Search for Video Classification}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58598-3\_27},
}
Figure