[Paper Review] NAM: Normalization-based Attention Module
This paper proposes NAM (Normalization-based Attention Module), a lightweight attention mechanism that enhances model efficiency by leveraging batch normalization scaling factors to suppress less salient features. By applying an $l_1$ regularization on these scaling factors, NAM achieves higher accuracy than SE, BAM, CBAM, and TAM on ResNet and MobileNet with comparable FLOPs and parameters.
Recognizing less salient features is the key for model compression. However, it has not been investigated in the revolutionary attention mechanisms. In this work, we propose a novel normalization-based attention module (NAM), which suppresses less salient weights. It applies a weight sparsity penalty to the attention modules, thus, making them more computational efficient while retaining similar performance. A comparison with three other attention mechanisms on both Resnet and Mobilenet indicates that our method results in higher accuracy. Code for this paper can be publicly accessed at https://github.com/Christian-lyc/NAM.
Motivation & Objective
- To address the lack of consideration for weight contributing factors in existing attention mechanisms.
- To improve model efficiency by suppressing less salient channels and spatial features without adding extra layers.
- To develop a lightweight attention module that maintains high performance with minimal computational overhead.
- To explore the use of batch normalization statistics as a proxy for feature importance in attention mechanisms.
Proposed method
- NAM uses the scaling factor $\gamma$ from batch normalization as a measure of channel importance, replacing MLPs used in SE and CBAM.
- The channel attention submodule computes attention weights as $W_{\gamma} = \gamma_i / \sum_j \gamma_j$, normalized across channels.
- A spatial attention submodule applies the same principle using spatial batch normalization to assess pixel-level importance via $\lambda$.
- An $l_1$ norm regularization is applied to $\gamma$ and $\lambda$ in the loss function to encourage sparsity and suppress less salient weights.
- The module is integrated into residual blocks, following the sequential design of CBAM, enabling channel and spatial attention in sequence.
- The method avoids additional fully connected or convolutional layers, reducing parameter count and FLOPs compared to SE and CBAM.
Experimental results
Research questions
- RQ1Can batch normalization scaling factors be effectively used to identify and suppress less salient features in attention mechanisms?
- RQ2How does NAM compare in accuracy and efficiency to existing attention modules like SE, BAM, CBAM, and TAM?
- RQ3What is the impact of applying $l_1$ regularization on the scaling factors $\gamma$ and $\lambda$ in improving model sparsity and performance?
- RQ4Does NAM maintain high performance while reducing model complexity on both deep and lightweight networks like ResNet and MobileNet?
- RQ5How do different integration strategies (channel-only, spatial-only, or combined) affect the final accuracy and efficiency of NAM?
Key findings
- On CIFAR-100, NAM with only channel attention (NAM(ch*)) achieved a top-1 error of 19.09%, outperforming SE (20.29%), BAM (19.97%), CBAM (19.44%), and TAM (20.15%).
- On CIFAR-100, NAM with only spatial attention (NAM(sp*)) achieved a top-1 error of 19.38%, surpassing SE, BAM, and TAM, though slightly below the channel-only variant.
- On ImageNet, NAM combined with MobileNet V2 achieved a top-1 error of 29.34%, outperforming SE (29.77%), BAM (29.91%), and CBAM (29.74%) with nearly identical FLOPs and parameters.
- NAM maintained a minimal parameter increase (3.51M vs. 3.54M for CBAM) while delivering better accuracy, demonstrating its efficiency.
- The $l_1$ regularization on $\gamma$ and $\lambda$ successfully induced sparsity in less salient weights, contributing to improved generalization and efficiency.
- The ablation study confirmed that using BN scaling factors as attention weights is both effective and computationally efficient, avoiding the need for additional MLP or convolutional layers.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.