[论文解读] Efficient Attention Network: Accelerate Attention by Searching Where to Plug
本文提出高效注意力网络(EAN),一种基于强化学习的方法,用于搜索共享注意力模块与CNN主干网络之间的最优稀疏连接,实现更快的推理速度、更少的参数增长并保持准确率。EAN通过最小化冗余模块连接,在图像分类、人群计数和语义分割等任务中保持性能的同时加速注意力网络。
Recently, many plug-and-play self-attention modules are proposed to enhance the model generalization by exploiting the internal information of deep convolutional neural networks (CNNs). Previous works lay an emphasis on the design of attention module for specific functionality, e.g., light-weighted or task-oriented attention. However, they ignore the importance of where to plug in the attention module since they connect the modules individually with each block of the entire CNN backbone for granted, leading to incremental computational cost and number of parameters with the growth of network depth. Thus, we propose a framework called Efficient Attention Network (EAN) to improve the efficiency for the existing attention modules. In EAN, we leverage the sharing mechanism (Huang et al. 2020) to share the attention module within the backbone and search where to connect the shared attention module via reinforcement learning. Finally, we obtain the attention network with sparse connections between the backbone and modules, while (1) maintaining accuracy (2) reducing extra parameter increment and (3) accelerating inference. Extensive experiments on widely-used benchmarks and popular attention networks show the effectiveness of EAN. Furthermore, we empirically illustrate that our EAN has the capacity of transferring to other tasks and capturing the informative features. The code is available at https://github.com/gbup-group/EAN-efficient-attention-network.
研究动机与目标
- 为解决现有即插即用注意力模块在模型深度增加时计算成本和参数量上升的问题。
- 在不牺牲准确率的前提下,减少注意力增强型CNN的推理时间和参数增长。
- 开发一种智能选择共享注意力模块在CNN主干中稀疏最优连接点的方法。
- 评估所学习的注意力连接方案在人群计数和语义分割等下游任务中的可迁移性。
- 证明稀疏且学习得到的注意力连接能够捕捉比密集或固定连接模式更具判别性的特征。
提出的方法
- EAN在CNN阶段的所有模块中使用共享注意力模块,以最小化参数增长。
- 强化学习智能体用于搜索主干网络与共享注意力模块之间的最优稀疏连接模式。
- 搜索策略基于基于验证准确率和推理时间的代理奖励函数进行训练,实现高效的架构搜索。
- 该方法使用离散搜索空间的可微松弛,以在训练期间支持基于梯度的优化。
- 最终架构被剪枝为稀疏连接模式,从而减少FLOPs和推理时间,同时保持性能。
- 该方法在ImageNet、Shanghai Tech和Pascal VOC 2012上进行了评估,展示了良好的可迁移性和鲁棒性。
实验结果
研究问题
- RQ1基于强化学习的方法能否有效搜索共享注意力模块与CNN主干之间的稀疏最优连接模式,以提升效率?
- RQ2与密集连接或全连接注意力模块相比,所提出的EAN方法是否能在保持或提升准确率的同时减少推理时间和参数增长?
- RQ3在ImageNet上学习到的注意力连接方案是否能成功迁移至人群计数和语义分割等其他视觉任务?
- RQ4所学习的稀疏连接是否通过Grad-CAM可视化增强了特征判别性?
- RQ5在多个基准测试中,EAN与现有注意力模块相比,在效率-准确率权衡方面表现如何?
主要发现
- 在Shanghai Tech人群计数数据集上,与基线全连接注意力网络相比,EAN将相对推理时间增量减少了40%以上。
- 在Pascal VOC 2012上,EAN-SE实现73.68%的mIoU,时间增量仅为16.43%,而Share-full-SE为48.16%,延迟降低31.73个百分点。
- 在Grad-CAM可视化中,EAN-SE优于原始ResNet和Share-full-SE,突出显示了更具有判别性和准确的注意力区域。
- EAN-SE模型在显著降低计算成本和参数增长的同时,保持了与全连接模型或共享基线模型相当或更优的准确率。
- 通过EAN学习到的连接方案在下游任务中具有良好的泛化能力,展示了在人群计数和语义分割任务中的强大可迁移性。
- 基于强化学习的搜索在100次迭代内收敛,显著快于传统NAS方法所需的数百甚至数千次迭代。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。