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

ViT-LSLA:具有光自限注意力的视觉Transformer

ViT-LSLA: Vision Transformer with Light Self-Limited-Attention

Southwest University(西南大学)

Zhenzhe Hechen, Wei Huang, Yixin Zhao

摘要:

Transformers在广泛的视觉任务中表现出具有竞争力的性能,但计算全局自我注意力的成本非常高。许多方法将注意力的范围限制在局部窗口内以降低计算复杂度。然而,他们的方法不能节省参数的数量;同时,自我关注和内部位置偏差(在softmax函数内部)导致每个查询都关注相似和接近的补丁。因此,本文提出了一种轻型自限制注意机制(LSLA),它由轻型自注意力机制(LSA)和自限制注意力机制(SLA)组成,前者节省了计算量和参数数目,后者提高了性能。首先,LSA用X(原点输入)替换自注意力的K(关键)和V(价值)。将其应用于具有编码器结构和自注意力机制的视觉Transformer中,可以简化计算。第二,二语习得有位置信息模块和有限注意模块。前者包含一个动态尺度和一个内部位置偏差,用于调整自我注意分数的分布,增强位置信息。后者在softmax函数之后使用外部位置偏差来限制一些大的注意力权重值。最后,提出了一种具有光自限制注意的层次化视觉Transformer(ViT-LSLA)。实验表明,ViT-LSLA在IP 102上达到了71.6%的top-1准确率(Swin-T的绝对提高2.4%);在Mini-ImageNet上达到了87.2%的top-1准确率(Swin-T的绝对提高3.7%)。此外,它大大降低了FLOPs(3.5GFLOPs vs. Swin-T的4.5GFLOPs)和参数(18.9M vs. Swin-T的27.6M)。

英文摘要:

Transformers have demonstrated a competitive performance across a wide range of vision tasks, while it is very expensive to compute the global self-attention. Many methods limit the range of attention within a local window to reduce computation complexity. However, their approaches cannot save the number of parameters; meanwhile, the self-attention and inner position bias (inside the softmax function) cause each query to focus on similar and close patches. Consequently, this paper presents a light self-limited-attention (LSLA) consisting of a light self-attention mechanism (LSA) to save the computation cost and the number of parameters, and a self-limited-attention mechanism (SLA) to improve the performance. Firstly, the LSA replaces the K (Key) and V (Value) of self-attention with the X(origin input). Applying it in vision Transformers which have encoder architecture and self-attention mechanism, can simplify the computation. Secondly, the SLA has a positional information module and a limited-attention module. The former contains a dynamic scale and an inner position bias to adjust the distribution of the self-attention scores and enhance the positional information. The latter uses an outer position bias after the softmax function to limit some large values of attention weights. Finally, a hierarchical Vision Transformer with Light self-Limited-attention (ViT-LSLA) is presented. The experiments show that ViT-LSLA achieves 71.6% top-1 accuracy on IP102 (2.4% absolute improvement of Swin-T); 87.2% top-1 accuracy on Mini-ImageNet (3.7% absolute improvement of Swin-T). Furthermore, it greatly reduces FLOPs (3.5GFLOPs vs. 4.5GFLOPs of Swin-T) and parameters (18.9M vs. 27.6M of Swin-T).

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

↑