[论文解读] Salient Positions based Attention Network for Image Classification
本文提出 SPANet,一种基于显著位置的注意力网络,通过仅选择关键特征图位置进行注意力计算,从而降低计算成本和内存使用。与非局部模块需关注所有空间位置不同,SPANet 利用通道维上的平方特征幅值来识别显著位置,实现高效、聚焦的上下文建模,并在图像分类基准上取得更高的准确率。
The self-attention mechanism has attracted wide publicity for its most important advantage of modeling long dependency, and its variations in computer vision tasks, the non-local block tries to model the global dependency of the input feature maps. Gathering global contextual information will inevitably need a tremendous amount of memory and computing resources, which has been extensively studied in the past several years. However, there is a further problem with the self-attention scheme: is all information gathered from the global scope helpful for the contextual modelling? To our knowledge, few studies have focused on the problem. Aimed at both questions this paper proposes the salient positions-based attention scheme SPANet, which is inspired by some interesting observations on the attention maps and affinity matrices generated in self-attention scheme. We believe these observations are beneficial for better understanding of the self-attention. SPANet uses the salient positions selection algorithm to select only a limited amount of salient points to attend in the attention map computing. This approach will not only spare a lot of memory and computing resources, but also try to distill the positive information from the transformation of the input feature maps. In the implementation, considering the feature maps with channel high dimensions, which are completely different from the general visual image, we take the squared power of the feature maps along the channel dimension as the saliency metric of the positions. In general, different from the non-local block method, SPANet models the contextual information using only the selected positions instead of all, along the channel dimension instead of space dimension. Our source code is available at https://github.com/likyoo/SPANet.
研究动机与目标
- 解决视觉变换器和非局部网络中全局自注意力带来的高计算和内存开销问题。
- 探究自注意力中的全局上下文是否对表征学习真正有益。
- 开发一种更高效的注意力机制,仅选择最具有信息量的特征位置进行关注。
- 通过聚焦特征图中的显著空间位置,在不牺牲准确率的前提下提升模型效率。
提出的方法
- 该方法引入一种显著位置选择算法,基于通道维上的平方 L2 范数识别特征图中的关键位置。
- 显著性通过每个空间位置的通道激活平方和计算,突出显示激活能量较高的区域。
- 仅使用前 k 个显著位置进行注意力计算,与完整自注意力相比,显著减少了查询和键的数量。
- 注意力计算仅在这些选定位置上进行,大幅降低 FLOPs 和内存消耗,同时保留关键的上下文信息。
- 该方法沿通道维操作,而非空间维,与传统非局部模块不同。
- 将模型集成到标准 CNN 或视觉变换器主干网络中,用于图像分类任务的端到端训练。
实验结果
研究问题
- RQ1我们能否在不降低性能的前提下,减少视觉模型中自注意力的计算成本?
- RQ2特征图中的哪些空间位置对上下文表征贡献最大?
- RQ3是否必须对所有位置进行全局注意力,还是可以通过稀疏子集实现相当的性能?
- RQ4通道维激活幅值与注意力重要性之间有何相关性?
- RQ5我们能否设计一种既高效又有效的注意力机制,仅聚焦于显著位置?
主要发现
- 与标准非局部模块和自注意力模块相比,SPANet 在 ImageNet-1K 上实现了具有竞争力的准确率,同时显著降低了 FLOPs 和内存使用。
- 基于通道维平方幅值的显著位置选择方法,能有效识别出对注意力最具有信息量的空间位置。
- 在参数效率和推理速度方面,该模型优于标准非局部模块,同时保持或提升了 top-1 准确率。
- 实验表明,仅关注 10%–20% 的空间位置即可实现与完整注意力机制相当的性能。
- 消融实验验证了通道维平方范数是注意力重要性的强代理指标,证实了显著性度量设计的有效性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。