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

动态令牌规范化改进视觉Transformer

Dynamic Token Normalization Improves Vision Transformers

The Chinese University of Hong Kong(香港中文大学);Tencent PCG(腾讯平台与内容事业群);The University of Hong Kong(香港大学)

Wenqi Shao, Yixiao Ge, Zhaoyang Zhang, Xuyuan Xu, Xiaogang Wang, Ying Shan, Ping Luo

摘要:

Vision Transformer(ViT)及其变体(例如,Swin,PVT)在各种计算机视觉任务中取得了巨大的成功,这归功于他们学习远程上下文信息的能力。层归一化(LN)是这些模型中的重要组成部分。然而,我们发现普通LN使不同位置的标记在大小上相似,因为它将每个标记内的嵌入归一化。对于Transformers来说,难以捕获电感偏差,例如具有LN的图像中的位置上下文。我们通过提出一种新的规范化器来解决这个问题,称为动态令牌规范化(DTN),其中规范化在每个令牌(令牌内)和不同令牌(令牌间)内执行。DTN有几个优点。首先,它是建立在一个统一的公式,因此可以代表各种现有的规范化方法。其次,DTN学习以令牌内和令牌间的方式规范化令牌,使得Transformers能够捕获全局上下文信息和局部位置上下文。{第三,通过简单地替换LN层,DTN可以很容易地插入到各种视觉Transformer中,例如ViT,Swin,PVT,LeViT,T2 T-ViT,BigBird和Reformer。大量的实验表明,配备DTN的Transformer始终优于基线模型,具有最小的额外参数和计算开销。例如,DTN在ImageNet上通过$0.5\%$ - $1.2\%$ top-1的准确性优于LN,在COCO基准测试中通过$1.2$ - $1.4$ box AP优于LN,在ImageNet-C上通过$2.3\%$ - $3.9\%$ mCE优于LN,在Long-Range Arena上通过长列表操作中通过$0.5\%$ - $0.8\%$准确性优于LN。}代码将在\url{https://github.com/wqshao126/DTN}上公布

英文摘要:

Vision Transformer (ViT) and its variants (e.g., Swin, PVT) have achieved great success in various computer vision tasks, owing to their capability to learn long-range contextual information. Layer Normalization (LN) is an essential ingredient in these models. However, we found that the ordinary LN makes tokens at different positions similar in magnitude because it normalizes embeddings within each token. It is difficult for Transformers to capture inductive bias such as the positional context in an image with LN. We tackle this problem by proposing a new normalizer, termed Dynamic Token Normalization (DTN), where normalization is performed both within each token (intra-token) and across different tokens (inter-token). DTN has several merits. Firstly, it is built on a unified formulation and thus can represent various existing normalization methods. Secondly, DTN learns to normalize tokens in both intra-token and inter-token manners, enabling Transformers to capture both the global contextual information and the local positional context. {Thirdly, by simply replacing LN layers, DTN can be readily plugged into various vision transformers, such as ViT, Swin, PVT, LeViT, T2T-ViT, BigBird and Reformer. Extensive experiments show that the transformer equipped with DTN consistently outperforms baseline model with minimal extra parameters and computational overhead. For example, DTN outperforms LN by $0.5\%$ - $1.2\%$ top-1 accuracy on ImageNet, by $1.2$ - $1.4$ box AP in object detection on COCO benchmark, by $2.3\%$ - $3.9\%$ mCE in robustness experiments on ImageNet-C, and by $0.5\%$ - $0.8\%$ accuracy in Long ListOps on Long-Range Arena.} Codes will be made public at \url{https://github.com/wqshao126/DTN}

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

↑