[Paper Review] Efficient Attention Network: Accelerate Attention by Searching Where to Plug
This paper proposes Efficient Attention Network (EAN), a reinforcement learning-based method to search for optimal sparse connections between a shared attention module and a CNN backbone, achieving faster inference, reduced parameter growth, and maintained accuracy. EAN accelerates attention networks by minimizing redundant module connections while preserving performance across image classification, crowd counting, and semantic segmentation tasks.
Recently, many plug-and-play self-attention modules are proposed to enhance the model generalization by exploiting the internal information of deep convolutional neural networks (CNNs). Previous works lay an emphasis on the design of attention module for specific functionality, e.g., light-weighted or task-oriented attention. However, they ignore the importance of where to plug in the attention module since they connect the modules individually with each block of the entire CNN backbone for granted, leading to incremental computational cost and number of parameters with the growth of network depth. Thus, we propose a framework called Efficient Attention Network (EAN) to improve the efficiency for the existing attention modules. In EAN, we leverage the sharing mechanism (Huang et al. 2020) to share the attention module within the backbone and search where to connect the shared attention module via reinforcement learning. Finally, we obtain the attention network with sparse connections between the backbone and modules, while (1) maintaining accuracy (2) reducing extra parameter increment and (3) accelerating inference. Extensive experiments on widely-used benchmarks and popular attention networks show the effectiveness of EAN. Furthermore, we empirically illustrate that our EAN has the capacity of transferring to other tasks and capturing the informative features. The code is available at https://github.com/gbup-group/EAN-efficient-attention-network.
Motivation & Objective
- To address the inefficiency of existing plug-and-play attention modules that increase computational cost and parameters with network depth.
- To reduce inference time and parameter increment in attention-enhanced CNNs without sacrificing accuracy.
- To develop a method that intelligently selects sparse, optimal connection points for shared attention modules within a CNN backbone.
- To evaluate transferability of the learned attention connection schemes to downstream tasks like crowd counting and semantic segmentation.
- To demonstrate that sparse, learned attention connections can capture more discriminative features than dense or fixed connection patterns.
Proposed method
- EAN employs a shared attention module across all blocks in a CNN stage to minimize parameter growth.
- A reinforcement learning agent searches for the optimal sparse connection pattern between the backbone and the shared attention module.
- The search policy is trained using a proxy reward function based on validation accuracy and inference time, enabling efficient architecture search.
- The method uses a differentiable relaxation of the discrete search space to allow gradient-based optimization during training.
- The final architecture is pruned to a sparse connection pattern, reducing FLOPs and inference time while maintaining performance.
- The approach is evaluated on ImageNet, Shanghai Tech, and Pascal VOC 2012, showing transferability and robustness.
Experimental results
Research questions
- RQ1Can a reinforcement learning-based method effectively search for sparse, optimal connection patterns between a shared attention module and a CNN backbone to improve efficiency?
- RQ2Does the proposed EAN method reduce inference time and parameter increment while maintaining or improving accuracy compared to dense or full-connection attention modules?
- RQ3Can the attention connection scheme learned on ImageNet be successfully transferred to other vision tasks such as crowd counting and semantic segmentation?
- RQ4Do the learned sparse connections enhance feature discrimination, as evidenced by Grad-CAM visualizations?
- RQ5How does EAN compare to existing attention modules in terms of efficiency-accuracy trade-offs across multiple benchmarks?
Key findings
- EAN reduces relative inference time increment by over 40% compared to baseline full-connection attention networks on the Shanghai Tech crowd counting dataset.
- On Pascal VOC 2012, EAN-SE achieves 73.68% mIoU with only 16.43% time increment, compared to 48.16% for Share-full-SE, reducing latency by 31.73 percentage points.
- EAN-SE outperforms both vanilla ResNet and Share-full-SE in Grad-CAM visualization, highlighting more discriminative and accurate attention regions for classification.
- The EAN-SE model maintains comparable or better accuracy than full-connection and shared-baseline models while significantly reducing computational cost and parameter growth.
- The connection schemes learned via EAN generalize well to downstream tasks, demonstrating strong transferability to crowd counting and semantic segmentation.
- The RL-based search converges in under 100 iterations, significantly faster than conventional NAS methods requiring hundreds or thousands of iterations.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.