CSA-Net: Channel-wise Spatially Autocorrelated Attention Networks

Yongsheng Gao, Nick Nikzad, Yongsheng Gao 0001, Jun ZhouarXiv 2024 · DOI

Abstract

Modern Convolutional Neural Networks (CNNs) often utilize channel attention mechanisms to prioritize informative features. However, standard approaches like Squeeze-and-Excitation (SE) rely on Global Average Pooling (GAP), which discards spatial structure. We introduce CSA-Net, which incorporates the geographical principle of spatial autocorrelation via the Moran’s I metric. By capturing topological relationships within feature maps, CSA-Net provides a more discriminative channel descriptor. Our experiments on ImageNet and MS COCO demonstrate that CSA-Net significantly improves classification and detection performance with minimal computational overhead.

Introduction

The "First Law of Geography" states that near things are more related than distant things. While CNNs are designed to exploit local spatial patterns, current channel attention modules often become "spatially blind" by reducing 2D feature maps to single scalars through averaging. This "squeeze" operation is a significant bottleneck; two feature maps with identical averages can represent vastly different spatial configurations—one might contain a centered object of interest, while another contains scattered noise.

CSA-Net addresses this by replacing simple first-order statistics with a descriptor based on spatial autocorrelation. This allows the network to distinguish between coherent structures and disorganized signals, leading to more effective feature recalibration.

Methodology

The core of our approach is the Channel-wise Spatially Autocorrelated (CSA) attention module. Unlike traditional pooling, the CSA module calculates how much a variable is spatially clustered or dispersed using a modified Moran’s I metric.

Architecture of the CSA Module

The process involves several key steps:

  1. Spatial Contiguity Matrix: We define the "closeness" between spatial locations in a feature map using a negative exponential distance function.
  2. Unitary Normalization: To ensure computational efficiency and stability during training, we implement a unitary spatial weight matrix. This simplifies the autocorrelation calculation into efficient matrix operations.
  3. Attention Mapping: The resulting spatially-aware descriptor is processed by a small Multi-Layer Perceptron (MLP) to generate the final channel attention weights.

Experimental Results

We evaluated CSA-Net across major benchmarks, including ImageNet-1K for classification and MS COCO 2017 for object detection and instance segmentation.

Classification Performance

Integrating CSA into a ResNet-50 architecture reduced the top-1 error on ImageNet to 21.41%, a substantial improvement over the baseline ResNet-50 (24.70%) and the SE-ResNet (23.14%). Notably, this gain is achieved with only a negligible increase in parameters (~0.6M) and GFLOPs.

Object Detection and Localization

On the MS COCO dataset using Faster R-CNN, CSA-Net achieved a mean Average Precision (mAP) of 39.7%, outperforming other advanced attention mechanisms like GSoP and ECA-Net. Qualitative analysis via Grad-CAM visualizations reveals that CSA-Net focuses more accurately on target objects compared to baseline models.

Grad-CAM Visualizations comparing ResNet-50, SE-ResNet-50, and CSA-ResNet-50

As shown in the visualizations, CSA-Net exhibits sharper attention on discriminative regions (e.g., the 'husky' or 'zebra') and reduces "leaky" attention on irrelevant background pixels.

Discussion and Conclusion

CSA-Net demonstrates that spatial structure within a channel is a powerful proxy for its importance. In deeper layers, the module learns to prioritize features that are discriminative for final classification, often those with specific spatial autocorrelation profiles.

While the current implementation uses a fixed distance-based contiguity matrix, future work could explore parametric embedding methods to allow the network to learn these spatial relationships dynamically. Furthermore, the success of this spatial autocorrelation schema suggests it could potentially serve as a more robust alternative to Global Average Pooling in various network architectures.

Summary updated

BibTeX
@misc{gao2024csa,
  author = {Yongsheng Gao and Nick Nikzad and Yongsheng Gao and Jun Zhou},
  title = {{CSA-Net: Channel-wise Spatially Autocorrelated Attention Networks}},
  year = {2024},
  eprint = {2405.05755},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.05755},
}
Figure