arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2111.10017cs.CV
收藏

小模型约束下视觉Transformer中查询、键与值嵌入的再思考

Rethinking Query, Key, and Value Embedding in Vision Transformer under Tiny Model Constraints

Kyungpook National University(庆北国立大学);Korea Advanced Institute of Science and Technology(韩国科学技术院)

Jaesin Ahn, Jiuk Hong, Jeongwoo Ju, Heechul Jung

AI总结:

针对小模型下ViT的QKV嵌入语义不足问题,提出三种非线性QKV嵌入结构,在低参数量下实现了优于XCiT-N12的图像分类与迁移学习性能。

摘要:

视觉Transformer(ViT)是计算机视觉领域的主流模型。尽管已有大量研究主要聚焦于处理归纳偏置与复杂度问题,但寻找更优的Transformer网络仍是待解难题。例如,传统基于Transformer的模型通常在多头自注意力之前,为每个查询(Q)、键(K)和值(V)嵌入使用一个投影层。对语义Q、K、V嵌入的考虑不足可能导致性能下降。本文提出了三种Q、K、V嵌入结构。第一种结构采用两层带ReLU的网络,实现Q、K、V的非线性嵌入;第二种结构共享其中一个非线性层,以在Q、K、V之间共享知识;第三种提出的结构通过编码参数共享所有非线性层,这些编码是可训练的,其取值决定了Q、K、V之间要执行的嵌入过程。实验证明,与多种当前最优方法相比,所提方法在图像分类任务上表现更优:在ImageNet-1k数据集上,该方法仅用3.1M的少量参数就达到了71.4%的准确率,优于原始XCiT-N12 Transformer模型的69.9%;此外,在CIFAR-10、CIFAR-100、Stanford Cars和STL-10数据集的迁移学习中,该方法仅用2.9M参数就取得了93.3%的平均准确率,高于原始XCiT-N12模型的92.2%准确率。

英文摘要:

A vision transformer (ViT) is the dominant model in the computer vision field. Despite numerous studies that mainly focus on dealing with inductive bias and complexity, there remains the problem of finding better transformer networks. For example, conventional transformer-based models usually use a projection layer for each query (Q), key (K), and value (V) embedding before multi-head self-attention. Insufficient consideration of semantic $Q, K$, and $V$ embedding may lead to a performance drop. In this paper, we propose three types of structures for $Q$, $K$, and $V$ embedding. The first structure utilizes two layers with ReLU, which is a non-linear embedding for $Q, K$, and $V$. The second involves sharing one of the non-linear layers to share knowledge among $Q, K$, and $V$. The third proposed structure shares all non-linear layers with code parameters. The codes are trainable, and the values determine the embedding process to be performed among $Q$, $K$, and $V$. Hence, we demonstrate the superior image classification performance of the proposed approaches in experiments compared to several state-of-the-art approaches. The proposed method achieved $71.4\%$ with a few parameters (of $3.1M$) on the ImageNet-1k dataset compared to that required by the original transformer model of XCiT-N12 ($69.9\%$). Additionally, the method achieved $93.3\%$ with only $2.9M$ parameters in transfer learning on average for the CIFAR-10, CIFAR-100, Stanford Cars datasets, and STL-10 datasets, which is better than the accuracy of $92.2\%$ obtained via the original XCiT-N12 model.

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

↑