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

Fcaformer:混合视觉Transformer中的前向交叉注意

Fcaformer: Forward Cross Attention in Hybrid Vision Transformer

Intellifusion(云天励飞);Harbin Institute of Technology (Shenzhen)(哈尔滨工业大学(深圳))

Haokui Zhang, Wenze Hu, Xiaoyu Wang

摘要:

目前,设计更高效的视觉Transformer的一个主要研究方向是通过采用稀疏注意或使用局部注意窗口来降低自注意模块的计算成本。相比之下,我们提出了一种不同的方法,旨在通过增加注意力模式来提高基于transformer的架构的性能。具体来说,我们提出了混合视觉Transformer(FcaFormer)的前向交叉注意,其中来自同一阶段中的先前块的令牌被二次使用。为了实现这一点,FcaFormer利用了两个创新组件:可学习的比例因子(LSF)和令牌合并和增强模块(TME)。LSF使得能够有效处理交叉令牌,而TME生成代表性的交叉令牌。通过集成这些组件,建议FcaFormer增强了跨块的令牌与潜在的不同语义的相互作用,并鼓励更多的信息流到较低的水平。基于前向交叉注意(FCA),我们设计了一系列FcaFormer模型,实现了模型大小,计算成本,内存成本和准确性之间的最佳权衡。例如,在不需要知识蒸馏来加强训练的情况下,我们的FcaFormer在Imagenet上仅用1630万个参数和约36亿个MAC就达到了83.1%的top-1准确率。这节省了几乎一半的参数和一些计算成本,同时与蒸馏的EfficientFormer相比,精度提高了0.7%。

英文摘要:

Currently, one main research line in designing a more efficient vision transformer is reducing the computational cost of self attention modules by adopting sparse attention or using local attention windows. In contrast, we propose a different approach that aims to improve the performance of transformer-based architectures by densifying the attention pattern. Specifically, we proposed forward cross attention for hybrid vision transformer (FcaFormer), where tokens from previous blocks in the same stage are secondary used. To achieve this, the FcaFormer leverages two innovative components: learnable scale factors (LSFs) and a token merge and enhancement module (TME). The LSFs enable efficient processing of cross tokens, while the TME generates representative cross tokens. By integrating these components, the proposed FcaFormer enhances the interactions of tokens across blocks with potentially different semantics, and encourages more information flows to the lower levels. Based on the forward cross attention (Fca), we have designed a series of FcaFormer models that achieve the best trade-off between model size, computational cost, memory cost, and accuracy. For example, without the need for knowledge distillation to strengthen training, our FcaFormer achieves 83.1% top-1 accuracy on Imagenet with only 16.3 million parameters and about 3.6 billion MACs. This saves almost half of the parameters and a few computational costs while achieving 0.7% higher accuracy compared to distilled EfficientFormer.

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

↑