arXiv (Cornell University) · 2021 · 328 citations · 34 references
ComputingInformation TechnologyMobile ComputingMobile SystemsVisual AttentionAttention NetworksDeep LearningFeature-based AttentionMobile NetworkingMobile NetworksSpatial AttentionAttentionAttention MechanismsAttention-based Feature AggregationFeature PoolingGlobal PoolingLearned Feature EmbeddingsSpatial Attention Networks
Mobile network design has benefited from channel attention, yet positional information is often overlooked, limiting spatial selectivity. This work introduces coordinate attention, a novel mechanism that embeds positional cues into channel attention for mobile networks. Coordinate attention factorizes channel attention into two 1D encodings along spatial axes, capturing long‑range dependencies while preserving precise positional information, and produces direction‑aware and position‑sensitive maps that can be applied to feature maps with negligible computational cost. Experiments demonstrate that coordinate attention improves ImageNet classification and yields superior performance on downstream tasks such as object detection and semantic segmentation. Code is available at https://github.com/Andrew-Qibin/CoordAttention.
Recent studies on mobile network design have demonstrated the remarkable effectiveness of channel attention (e.g., the Squeeze-and-Excitation attention) for lifting model performance, but they generally neglect the positional information, which is important for generating spatially selective attention maps. In this paper, we propose a novel attention mechanism for mobile networks by embedding positional information into channel attention, which we call "coordinate attention". Unlike channel attention that transforms a feature tensor to a single feature vector via 2D global pooling, the coordinate attention factorizes channel attention into two 1D feature encoding processes that aggregate features along the two spatial directions, respectively. In this way, long-range dependencies can be captured along one spatial direction and meanwhile precise positional information can be preserved along the other spatial direction. The resulting feature maps are then encoded separately into a pair of direction-aware and position-sensitive attention maps that can be complementarily applied to the input feature map to augment the representations of the objects of interest. Our coordinate attention is simple and can be flexibly plugged into classic mobile networks, such as MobileNetV2, MobileNeXt, and EfficientNet with nearly no computational overhead. Extensive experiments demonstrate that our coordinate attention is not only beneficial to ImageNet classification but more interestingly, behaves better in down-stream tasks, such as object detection and semantic segmentation. Code is available at https://github.com/Andrew-Qibin/CoordAttention.
34
Deep Residual Learning for Image Recognition
Kaiming He, Xiangyu Zhang, Shaoqing Ren et al. · 2016 · 222.1K citations · Full text
ImageNet Large Scale Visual Recognition Challenge
Olga Russakovsky, Jia Deng, Hao Su et al. · International Journal of Computer Vision · 2015 · 40.2K citations
MobileNetV2: Inverted Residuals and Linear Bottlenecks
Mark Sandler, Andrew Howard, Menglong Zhu et al. · 2018 · 25.4K citations
Grad-CAM: Visual Explanations from Deep Networks via Gradient-Based Localization
Ramprasaath R. Selvaraju, Michael Cogswell, Abhishek Das et al. · 2017 · 21.6K citations
PyTorch: An Imperative Style, High-Performance Deep Learning Library
Adam Paszke, Sam Gross, Francisco Massa et al. · arXiv (Cornell University) · 2019 · 16.2K citations · Full text