Recently, vision transformers have become very popular. However, deploying them in many applications is computationally expensive partly due to the Softmax layer in the attention block. We introduce a simple but effective, Softmax-free attention block, SimA, which normalizes query and key matrices with simple $\ell_1$-norm instead of using Softmax layer. Then, the attention block in SimA is a simple multiplication of three matrices, so SimA can dynamically change the ordering of the computation at the test time to achieve linear computation on the number of tokens or the number of channels. We empirically show that SimA applied to three SOTA variations of transformers, DeiT, XCiT, and CvT, results in on-par accuracy compared to the SOTA models, without any need for Softmax layer. Interestingly, changing SimA from multi-head to single-head has only a small effect on the accuracy, which simplifies the attention block further. The code is available here: https://github.com/UCDvision/sima
Compute-Efficient Medical Image Classification with Softmax-Free Transformers and Sequence Normalization
University Hospital Aachen(亚琛大学医院);Else Kroener Fresenius Center for Digital Health(埃尔瑟·克勒纳·弗雷森纽斯数字健康中心);Medical Faculty Carl Gustav Carus(卡尔·古斯塔夫·卡鲁斯医学院);Technical University Dresden(德累斯顿工业大学);University Hospital and Faculty of Medicine Carl Gustav Carus, TUD Dresden University of Technology(德累斯顿工业大学卡尔·古斯塔夫·卡鲁斯大学医院及医学院);National Center for Tumor Diseases (NCT)(国家肿瘤疾病中心);University Hospital Heidelberg(海德堡大学医院)
Copy the Same, Distill the Difference: Initializing Linear Vision Transformers
Institute of Advanced Intelligence and Computing (IAIC), A*STAR(先进智能与计算研究所(IAIC),新加坡科技研究局);Nanyang Technological University(南洋理工大学);ST Engineering Geo-Insights(新科工程地理信息公司);Sichuan University(四川大学);Shanghai Jiao Tong University(上海交通大学);University of Science and Technology of China(中国科学技术大学)
Reweighting Framewise Attention in Video Transformers for Facial Expression Understanding
Inria, Université Côte d’Azur, France(法国国家信息与自动化研究所、法国滨海阿尔卑斯大学);Hanyang University, South Korea(韩国家阳大学);Pusan National University, South Korea(韩国釜山国立大学)
ViT-LSLA: Vision Transformer with Light Self-Limited-Attention
Southwest University(西南大学)
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.9…
DopQ-ViT: Towards Distribution-Friendly and Outlier-Aware Post-Training Quantization for Vision Transformers
Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);Department of Computer Science, City University of Hong Kong(香港城市大学计算机科学系)
MB-TaylorFormer: Multi-branch Efficient Transformer Expanded by Taylor Formula for Image Dehazing
Sun Yat-sen University(中山大学);Australian National University(澳大利亚国立大学);Guangdong Provincial Key Laboratory of Robotics and Digital Intelligent Manufacturing Technology(广东省机器人与数字智能制造技术重点实验室)