[论文解读] ASR: Attention-alike Structural Re-parameterization
本文提出ASR(Attention-alike Structural Re-parameterization),一种新颖方法,通过利用一种统计现象——Stripe Observation(条带观测)——实现通道注意力模块的结构重参数化,该现象表现为在训练过程中通道注意力值收敛为常数向量。ASR在不增加参数量或推理开销的前提下,实现了与标准注意力模块相当的性能提升,从而使得注意力机制能够高效部署于实际应用场景。
The structural re-parameterization (SRP) technique is a novel deep learning technique that achieves interconversion between different network architectures through equivalent parameter transformations. This technique enables the mitigation of the extra costs for performance improvement during training, such as parameter size and inference time, through these transformations during inference, and therefore SRP has great potential for industrial and practical applications. The existing SRP methods have successfully considered many commonly used architectures, such as normalizations, pooling methods, and multi-branch convolution. However, the widely used attention modules which drastically slow inference speed cannot be directly implemented by SRP due to these modules usually act on the backbone network in a multiplicative manner and the modules' output is input-dependent during inference, which limits the application scenarios of SRP. In this paper, we conduct extensive experiments from a statistical perspective and discover an interesting phenomenon Stripe Observation, which reveals that channel attention values quickly approach some constant vectors during training. This observation inspires us to propose a simple-yet-effective attention-alike structural re-parameterization (ASR) that allows us to achieve SRP for a given network while enjoying the effectiveness of the attention mechanism. Extensive experiments conducted on several standard benchmarks demonstrate the effectiveness of ASR in generally improving the performance of existing backbone networks, attention modules, and SRP methods without any elaborated model crafting. We also analyze the limitations and provide experimental and theoretical evidence for the strong robustness of the proposed ASR.
研究动机与目标
- 解决现有结构重参数化(SRP)方法与注意力模块不兼容的问题,原因在于注意力模块具有输入依赖的乘法操作。
- 探究是否可在不增加推理开销的前提下,将注意力机制集成到SRP框架中。
- 发现并验证一种统计现象——Stripe Observation,即在训练过程中通道注意力值收敛为常数向量。
- 提出一种简单而有效的方法ASR,使注意力模块能够实现SRP,同时保留其性能优势。
- 在不修改网络架构的前提下,证明ASR在多种主干网络和基准测试中均具备鲁棒性与泛化能力。
提出的方法
- 提出Stripe Observation:通过注意力图的统计分析,观察到不同输入的通道注意力值在训练过程中迅速收敛为常数向量。
- 设计ASR,训练阶段使用可学习向量作为注意力模块的输入,以模拟常数注意力值的行为。
- 推理阶段,通过等价参数变换将注意力模块合并到主干网络中,从而消除额外参数与计算开销。
- 利用注意力模块输出与可学习缩放向量之间的等价性,在SRP范式下实现结构重参数化。
- 将该方法应用于多种注意力模块(如SE、IE、SRM)和主干网络(如ResNet、ViT),验证其兼容性与性能增益。
- 该方法与具体注意力模块无关,可灵活集成复杂注意力机制,且无推理开销。
实验结果
研究问题
- RQ1尽管注意力模块具有输入依赖的乘法特性,是否仍可有效集成到结构重参数化(SRP)框架中?
- RQ2如Stripe Observation所示,通道注意力值在训练过程中是否收敛为常数向量?
- RQ3在训练阶段,是否可用可学习向量替代动态注意力图,以实现SRP且不造成性能下降?
- RQ4ASR是否在不增加推理成本的前提下,保持或提升多种基准测试中的模型准确率?
- RQ5与标准注意力或基线模型相比,ASR在对抗性噪声和分布偏移下的鲁棒性如何?
主要发现
- Stripe Observation表明,所有输入的通道注意力值在训练过程中均收敛为近乎常数向量,标准差趋近于零,一阶差分迅速稳定。
- 在CIFAR100上,ASR使用IE模块时,Top-1准确率相比ResNet164最高提升1.26%,且不增加参数量或推理时间。
- 在ImageNet上,ASR使用SE模块时,准确率相比基线提升0.46%,同时相比标准注意力模块,FPS损失降低36.4%。
- ASR增强的模型在恒定噪声和随机噪声攻击下表现出更优的鲁棒性,Top-1准确率方差更小,性能下降更少。
- 在ASR中移除注意力模块,仅使用可学习向量时性能有所提升,但远低于使用完整注意力模块的性能,证实了注意力结构的重要性。
- ASR无法直接迁移至空间注意力或基于Transformer的注意力机制,因为其注意力图仍保持输入依赖性,且不表现出Stripe Observation。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。