Abstract: Modern neural networks often employ independent attention modules for each layer, leading to parameter redundancy and a lack of inter-layer context. This paper introduces the Dense-and-Implicit Attention (DIA) unit, a novel framework that shares a single attention module across all layers within a network stage. By utilizing a modified Long Short-Term Memory (LSTM) unit as the shared module, DIANet captures complex inter-layer dependencies and maintains a persistent "memory" of the network's state. Experimental results on CIFAR and ImageNet demonstrate that DIANet achieves superior accuracy with fewer parameters compared to standard attention models like SENet. Furthermore, the DIA unit acts as a powerful stabilizer, enabling the training of deep networks even in the absence of Batch Normalization or skip connections.
Introduction
In modern computer vision, "attention" modules like Squeeze-and-Excitation (SE) blocks are typically treated as independent plug-ins. If a network has 50 layers, it usually has 50 separate attention modules, each with its own set of learnable parameters. The authors identify two main drawbacks to this approach: parameter inefficiency and isolated information. Standard attention modules only look at the features within their specific layer, ignoring the "layer-wise" context—how information evolves from the bottom of the network to the top.
The Dense-and-Implicit Attention (DIA) Framework
DIANet aims to create a "dense and implicit" connection between layers by forcing them to share the same attention logic and a persistent memory of the network's state. Instead of placing a unique module at each layer, the authors place a single, shared module parallel to the network backbone. This shared unit creates an implicit dense connection because every layer in a stage influences and is influenced by the same evolving state.
The DIA-LSTM Architecture
While many modules could be shared, the authors focus on a modified Long Short-Term Memory (LSTM) unit. LSTMs are naturally suited for this because they are designed to process sequences and maintain a hidden state. In DIANet, the "sequence" is the stack of layers. The process follows three main steps:
- Extraction: A layer’s features are compressed via Global Average Pooling (GAP).
- Processing (The Shared LSTM): This compressed vector is fed into the shared LSTM. The LSTM also receives the hidden state ($h_{t-1}$) and cell state ($c_{t-1}$) from the previous layer.
- Recalibration: The LSTM outputs a new hidden state ($h_t$), which acts as an attention mask to rescale the original layer's features.
To optimize the LSTM, the authors added a shared linear transformation to shrink the input dimension and replaced the standard Tanh output activation with a Sigmoid function, which is better suited for generating attention weights between 0 and 1.
Key Insights and Results
- Depth Awareness: By using an LSTM, the attention mask for any layer is informed by what happened in all preceding layers. This allows the network to adapt its attention strategy based on its current depth.
- The "Stabilizer" Effect: One of the most striking findings is that DIANet is incredibly robust. While standard ResNets often fail to converge if Batch Normalization or skip connections are removed, DIANet-equipped versions can still train successfully. The shared attention unit acts as a powerful regularizer.
- Performance Gains: On CIFAR-100, a ResNet-164 with a DIA-LSTM achieved 76.67% accuracy, significantly outperforming both the original backbone (73.43%) and the standard SE-Net (75.03%). On ImageNet, DIANet improved ResNet-50 top-1 accuracy to 77.24%.
- Efficiency: Sharing parameters allows for the benefits of attention across deep networks with roughly the same parameter cost as much shallower networks. A DIA-SE module achieved better results than a standard SE-Net while using significantly fewer parameters (1.74M vs 1.93M).
Conclusion
DIANet introduces a paradigm shift in attention mechanisms by moving from independent, layer-specific modules to a shared, stateful architecture. By capturing inter-layer dependencies through a shared LSTM, the network achieves higher accuracy and remarkable training stability with a reduced parameter footprint. Future work may explore applying DIA units to other domains like object detection or video processing where temporal and layer-wise consistency are critical.
Summary updated