Coordinate Attention for Efficient Mobile Network Design
arXiv:2103.02907
Abstract
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.
CVPR2021
References in corpus (10)
- PyTorch: An Imperative Style, High-Performance Deep Learning Library
- MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications
- Rethinking Atrous Convolution for Semantic Image Segmentation
- Recurrent Models of Visual Attention
- The Cityscapes Dataset for Semantic Urban Scene Understanding
- CCNet: Criss-Cross Attention for Semantic Segmentation
- Searching for Efficient Multi-Scale Architectures for Dense Image Prediction
- MixConv: Mixed Depthwise Convolutional Kernels
- Axial-DeepLab: Stand-Alone Axial-Attention for Panoptic Segmentation
- Learning what and where to attend
Cited by in corpus (6)
- DeepViT: Towards Deeper Vision Transformer
- FcaNet: Frequency Channel Attention Networks
- Improved YOLOv7 model for insulator defect detection
- Attention-Guided NIR Image Colorization via Adaptive Fusion of Semantic and Texture Clues
- Introduce the Result Into Self-Attention
- Auto-outlier Fusion Technique for Chest X-ray classification with Multi-head Attention Mechanism