arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2109.05422cs.CV
收藏

图像识别的稀疏MLP:自我注意真的有必要吗?

Sparse MLP for Image Recognition: Is Self-Attention Really Necessary?

MSRA(微软亚洲研究院)

Chuanxin Tang, Yucheng Zhao, Guangting Wang, Chong Luo, Wenxuan Xie, Wenjun Zeng

摘要:

Transformers在计算机视觉领域异军突起。在这项工作中,我们探讨了Transformer中的核心自我注意模块是否是实现图像识别卓越性能的关键。为此,我们基于现有的基于MLP的视觉模型构建了一个称为sMLPNet的无注意力网络。具体来说,我们取代MLP模块在令牌混合步骤与一个新的稀疏MLP(sMLP)模块。对于2D图像令牌,sMLP沿轴向方向应用1D MLP,并且参数在行或列之间共享。通过稀疏连接和权值共享,sMLP模块显著减少了模型参数数量和计算复杂性,避免了困扰MLP类模型性能的常见过拟合问题。当仅在ImageNet-1 K数据集上训练时,所提出的sMLPNet仅用24 M个参数就达到了81.9%的top-1准确率,这比相同模型大小约束下的大多数CNN和视觉Transformer要好得多。当扩展到66 M参数时,sMLPNet达到83.4%的top-1精度,与最先进的Swin Transformer相当。sMLPNet的成功表明,自我注意力机制不一定是计算机视觉中的银弹。代码和模型可在https://github.com/microsoft/SPACH上公开获取

英文摘要:

Transformers have sprung up in the field of computer vision. In this work, we explore whether the core self-attention module in Transformer is the key to achieving excellent performance in image recognition. To this end, we build an attention-free network called sMLPNet based on the existing MLP-based vision models. Specifically, we replace the MLP module in the token-mixing step with a novel sparse MLP (sMLP) module. For 2D image tokens, sMLP applies 1D MLP along the axial directions and the parameters are shared among rows or columns. By sparse connection and weight sharing, sMLP module significantly reduces the number of model parameters and computational complexity, avoiding the common over-fitting problem that plagues the performance of MLP-like models. When only trained on the ImageNet-1K dataset, the proposed sMLPNet achieves 81.9% top-1 accuracy with only 24M parameters, which is much better than most CNNs and vision Transformers under the same model size constraint. When scaling up to 66M parameters, sMLPNet achieves 83.4% top-1 accuracy, which is on par with the state-of-the-art Swin Transformer. The success of sMLPNet suggests that the self-attention mechanism is not necessarily a silver bullet in computer vision. The code and models are publicly available at https://github.com/microsoft/SPACH

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑