arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2207.07284cs.CVcs.AI
收藏

基于相对位置编码的视觉跨标记关系参数化方法MLP

Parameterization of Cross-Token Relations with Relative Positional Encoding for Vision MLP

University of Science and Technology of China(中国科学技术大学);Institute of Microelectronics, Chinese Academy of Sciences(中国科学院微电子研究所);Singapore Management University(新加坡管理大学);University of Manchester(曼彻斯特大学)

Zhicai Wang, Yanbin Hao, Xingyu Gao, Hao Zhang, Shuo Wang, Tingting Mu, Xiangnan He

摘要:

视觉多层感知器(MLP)在计算机视觉任务中表现出了良好的性能,并成为CNN和视觉Transformer的主要竞争对手。它们使用令牌混合层来捕获跨令牌交互,而不是Transformers使用的多头自我注意力机制。然而,严重参数化的令牌混合层自然缺乏捕获局部信息和多粒度非局部关系的机制,因此它们的区分能力受到限制。为了解决这个问题,我们提出了一个新的位置空间门控单元(PoSGU)。它利用经典的相对位置编码(RPE)中使用的注意公式,有效地编码跨令牌的令牌混合关系。它可以成功地将视觉MLP的当前二次参数复杂度$O(N^2)$降低到$O(N)$和$O(1)$。我们实验了两个RPE机制,并进一步提出了一个组明智的扩展,以提高他们的表达能力与多粒度上下文的完成。然后,这些作为一种新型视觉MLP的关键构建块,称为PosMLP。我们评估所提出的方法的有效性进行彻底的实验,证明了改进的或可比的性能,降低参数的复杂性。例如,对于在ImageNet1K上训练的模型,我们实现了从72.14\%到74.02\%的性能提高,以及从$19.4M$到$18.2M$的可学习参数减少。代码可以在https://github.com/Zhicaiwww/PosMLP上找到。

英文摘要:

Vision multi-layer perceptrons (MLPs) have shown promising performance in computer vision tasks, and become the main competitor of CNNs and vision Transformers. They use token-mixing layers to capture cross-token interactions, as opposed to the multi-head self-attention mechanism used by Transformers. However, the heavily parameterized token-mixing layers naturally lack mechanisms to capture local information and multi-granular non-local relations, thus their discriminative power is restrained. To tackle this issue, we propose a new positional spacial gating unit (PoSGU). It exploits the attention formulations used in the classical relative positional encoding (RPE), to efficiently encode the cross-token relations for token mixing. It can successfully reduce the current quadratic parameter complexity $O(N^2)$ of vision MLPs to $O(N)$ and $O(1)$. We experiment with two RPE mechanisms, and further propose a group-wise extension to improve their expressive power with the accomplishment of multi-granular contexts. These then serve as the key building blocks of a new type of vision MLP, referred to as PosMLP. We evaluate the effectiveness of the proposed approach by conducting thorough experiments, demonstrating an improved or comparable performance with reduced parameter complexity. For instance, for a model trained on ImageNet1K, we achieve a performance improvement from 72.14\% to 74.02\% and a learnable parameter reduction from $19.4M$ to $18.2M$. Code could be found at https://github.com/Zhicaiwww/PosMLP.

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

↑