SPEM: Self-adaptive Pooling Enhanced Attention Module for Image Recognition

Shanshan Zhong, Wushao Wen, Jinghui Qin

TL;DR

Most modern attention mechanisms rely on Global Average Pooling (GAP) to summarize feature maps, but this paper argues that GAP is often suboptimal. The authors introduce SPEM (Self-adaptive Pooling Enhanced Attention Module), which uses a learnable linear combination of global max-pooling and global min-pooling to significantly boost performance with minimal computational overhead.

What Problem Does This Paper Address?

Attention mechanisms in Convolutional Neural Networks (CNNs) generally follow a three-stage pipeline: pooling (compressing features), excitation (generating attention weights), and recalibration (applying weights back to features).

The three stages of a typical attention module: pooling, excitation, and recalibration.

For years, researchers have focused on refining the "excitation" and "recalibration" stages while treating the "pooling" stage as a solved problem, almost universally defaulting to Global Average Pooling (GAP). The authors argue that by simply averaging all spatial information, we lose critical details that could better inform the attention map. They set out to prove that a more flexible pooling strategy—specifically one that considers both the most prominent (max) and least prominent (min) features—can yield superior results.

Methods

The authors propose the Self-adaptive Pooling Enhanced Attention Module (SPEM). The architecture consists of three core components:

  1. Self-adaptive Pooling Module: Instead of averaging, it calculates both Global Max-Pooling ($f_{Max}$) and Global Min-Pooling ($f_{Min}$). It then combines them using a learnable parameter $\lambda$: $$u = \lambda f_{Max} + (1 - \lambda) f_{Min}$$ This allows the network to decide for itself how much weight to give to extreme values versus background values for a given task.

  2. Excitation Module: A lightweight linear transformation that produces an initial attention map ($v_{exc}$) from the pooled embedding.

  3. Reweight Module: This module further refines the attention map by using $f_{Max}$ and $f_{Min}$ again to generate a "reweighting" vector ($v_{rew}$), which is then element-wise multiplied with $v_{exc}$.
The overall architecture of SPEM, showing the parallel paths for max and min pooling.

To ensure training stability, the authors include a constraint in the loss function to prevent the learnable parameters used to calculate $\lambda$ from exploding.

Datasets

The effectiveness of SPEM was evaluated on two standard computer vision benchmarks:

  • CIFAR-10: 50,000 training images and 10,000 test images across 10 classes.
  • CIFAR-100: The same image count as CIFAR-10, but distributed across 100 classes, making it a more challenging task.

The authors integrated SPEM into various ResNet architectures (ResNet83, 164, 245, and 326) to test scalability.

Key Insights and Ideas

  • GAP is not the Ceiling: The most striking insight is that a simple linear combination of Max and Min pooling consistently outperforms the standard GAP baseline across different values of $\lambda$.
  • The Power of Min-Pooling: While Max-pooling is common for capturing salient features, the authors show that Min-pooling provides crucial context about "ignored" parts of an image. Combining both allows for a more nuanced representation than simple averaging.
  • Dataset-Specific Pooling: The optimal balance between Max and Min pooling isn't universal. For example, the authors found that a $\lambda$ of 0.7 worked best for CIFAR-10, while 0.5 was better for CIFAR-100. This justifies their "self-adaptive" approach, where the model learns the best $\lambda$ during training.
Performance of ResNet164-SPEM across different λ values, showing that many combinations of Max and Min pooling exceed the GAP baseline.

Key Results

SPEM demonstrated significant improvements over both baseline ResNets and other popular attention modules like SE (Squeeze-and-Excitation), CBAM, and ECA:

  • Accuracy Boost: On ResNet164, SPEM improved Top-1 accuracy by 1.41% on CIFAR-10 and 2.01% on CIFAR-100 compared to the baseline.
  • Efficiency: SPEM achieves these gains while remaining lightweight. For instance, ResNet164 + SPEM uses 1.74M parameters, which is significantly fewer than ResNet164 + SE (1.91M) or CBAM (1.92M), yet it delivers higher accuracy.
  • Scalability: The benefits of SPEM become even more pronounced as networks get deeper. On ResNet326, SPEM improved CIFAR-100 accuracy by a massive 5.46% over the baseline.

Limitations and Future Work

The paper focuses exclusively on the CIFAR datasets, which consist of low-resolution (32x32) images. While the results are impressive, it remains to be seen how well this strategy scales to high-resolution datasets like ImageNet or more complex tasks like object detection and segmentation.

The authors suggest that future work could involve exploring even more sophisticated pooling strategies beyond simple linear combinations of Max and Min, potentially incorporating frequency-domain analysis or other statistical descriptors.

Summary updated

BibTeX
@inproceedings{zhong2023spem,
  author = {Shanshan Zhong and Wushao Wen and Jinghui Qin},
  title = {{SPEM: Self-adaptive Pooling Enhanced Attention Module for Image Recognition}},
  booktitle = {MMM},
  year = {2023},
  url = {https://openreview.net/forum?id=r1fBQpOI8t},
}
Figure