STEAM: Squeeze and Transform Enhanced Attention Module

Ram Samarth B B, Rishabh Sabharwal, Parikshit Singh Rathore, Punit RathorearXiv 2024 · DOI

Abstract

STEAM (Squeeze and Transform Enhanced Attention Module) is an ultra-efficient attention mechanism designed for Convolutional Neural Networks (CNNs). By leveraging graph-based relational modeling, STEAM captures both channel and spatial dependencies with a parameter footprint that remains constant regardless of the input channel count. This module achieves significant accuracy improvements—such as a +2% gain on ResNet-50—while maintaining extreme computational efficiency, often reducing additional GFLOPs by three-fold compared to existing state-of-the-art modules.

Introduction: Addressing the "Goldilocks" Problem in Attention

Convolutional Neural Networks (CNNs) are foundational to computer vision but often struggle with long-range dependencies due to their local receptive fields. Existing attention mechanisms like Squeeze-and-Excitation (SE) and CBAM attempt to mitigate this by recalibrating features. However, these methods often face a trade-off: they are either parameter-heavy, scaling linearly with the number of channels (like SE), or they focus too narrowly on a single dimension (like ECA).

Furthermore, many modules rely on dimensionality reduction, which can destroy critical feature relationships. STEAM addresses these limitations by modeling both channel and spatial attention comprehensively through a graph-based approach that ensures minimal overhead and a fixed parameter count.

Methodology: Graph-Based Attention

The core innovation of STEAM is treating attention as a relational modeling problem on graphs. The module consists of two primary components: Channel Interaction Attention (CIA) and Spatial Interaction Attention (SIA).

Overview of the STEAM architecture showing Channel Interaction Attention (CIA) and Spatial Interaction Attention (SIA) components.

Channel Interaction Attention (CIA)

In CIA, each channel is modeled as a node in a cyclic graph. Instead of utilizing heavy Multi-Layer Perceptrons (MLPs), CIA employs a multi-head scaled dot-product attention mechanism inspired by Graph Transformers. This allows channels to interact with their immediate neighbors, capturing local correlations that are sufficient for global recalibration without the parameter explosion typical of fully connected layers.

Spatial Interaction Attention (SIA)

SIA treats spatial units as nodes in a grid-like graph. To maintain efficiency across varying input resolutions, the authors introduce Output Guided Pooling (OGP). OGP compresses the feature map into a fixed $7 \times 7$ spatial representation, ensuring the spatial graph size remains constant. To prevent "over-smoothing"—a common issue in Graph Neural Networks where node features become indistinguishable—an Edge Drop technique is used during training to force the model to learn more robust spatial representations.

Key Insights

  • Channel Independence: Unlike traditional methods, STEAM's parameters are derived from projection matrices ($W_K, W_Q$) operating on a fixed hidden dimension ($d$). This makes the module's size independent of the input channel count ($C$). For instance, STEAM adds only 320 parameters to a ResNet-50.
  • Sequential Processing: Empirical results show that a sequential CIA $\rightarrow$ SIA pipeline outperforms parallel or reversed configurations.
  • The Power of Sparsity: In the channel graph, connecting a node only to its immediate 1-hop neighbors (degree of 2) performed better than denser connections, suggesting local channel correlations are sufficient for global recalibration.
  • Fixed-Size Spatial Context: By standardizing spatial attention to a $7 \times 7$ grid via OGP, STEAM provides consistent high-level context even in early, high-resolution network layers.

Experimental Results

STEAM was evaluated on ImageNet-1K for classification and MS COCO for detection and segmentation tasks.

Comparison of STEAM against SOTA attention modules on ImageNet-1K across various backbones.

ImageNet-1K Classification

On ResNet-50, STEAM achieved a 77.20% Top-1 accuracy, representing a 1.98% improvement over the baseline. It consistently outperformed other state-of-the-art modules like ECA, GCT, and MCA while requiring significantly fewer additional GFLOPs (up to a three-fold reduction compared to ECA).

Object Detection and Segmentation

On the MS COCO benchmark, STEAM improved the Average Precision (AP) of a Faster R-CNN (ResNet-50) by 1.9% over the baseline. Similar gains were observed in instance segmentation with Mask R-CNN, demonstrating the module's strong generalization capabilities for localization-heavy tasks.

Conclusion

STEAM represents a significant step forward in efficient attention design. By reframing attention as graph-based interaction, it achieves superior performance with a negligible and constant parameter cost. Future work may involve dynamic graph construction and the integration of positional encodings to further enhance spatial understanding.

Summary updated

BibTeX
@misc{b2024steam,
  author = {Ram Samarth B B and Rishabh Sabharwal and Ram Samarth B. B. and Parikshit Singh Rathore and Punit Rathore},
  title = {{STEAM: Squeeze and Transform Enhanced Attention Module}},
  year = {2024},
  eprint = {2412.09023},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.09023},
}
Figure