通过筛选关键像素降低视觉变换器计算量,提升速度与准确率。
FilterViT and DropoutViT
- 用滤波模块生成显著性掩码,仅对前K个关键像素做注意力计算。
- 在ImageNet上比ViT快2.3倍,参数减少40%,准确率持平。
- 适合追求高效部署的视觉模型开发者,尤其关注可解释性场景。
本文提出一种改进的视觉变换器(ViT)架构,通过在下采样初期阶段进行基于注意力的QKV操作,避免在高分辨率特征图上直接计算注意力带来的巨大开销。为此,我们引入滤波注意力机制,利用滤波块(Filter Block)为特征图生成显著性掩码(Filter Mask),对像素进行评分并保留得分最高的前K个像素(K随层变化)。该方法显著减少了参与注意力计算的标记数量,降低了计算复杂度并提升了处理速度。此外,显著性掩码增强了模型可解释性,使注意力聚焦于图像中对任务最关键的区域。实验结果表明,该方法在保持高精度的同时,大幅提升了参数效率和计算速度,相比现有模型显著降低了资源消耗。
原文摘要 · Abstract (English)
In this study, we introduce an enhanced version of ViT that conducts attention-based QKV operations during the initial stages of downsampling. Performing attention directly on high-resolution feature maps is computationally demanding due to the large size and numerous tokens. To mitigate this, we propose a filter attention mechanism that uses a Filter Block to create a salient mask (Filter Mask) for selecting the most informative pixels for attention. The Filter Block scores the pixels of the feature map, and we sort these scores to retain only the top K pixels (with K varying across layers). This approach effectively decreases the number of tokens involved in the attention computation, reducing computational complexity and boosting processing speed. Furthermore, the salient mask provides interpretability, as the model focuses on regions of the image most critical to the outcome. Our experimental results show that this model improves parameter efficiency and computational speed while enhancing accuracy. Compared to existing models, our approach significantly reduces resource consumption while maintaining high performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。