Relative position encoding (RPE) is important for transformer to capture sequence ordering of input tokens. General efficacy has been proven in natural language processing. However, in computer vision, its efficacy is not well studied and even remains controversial, e.g., whether relative position encoding can work equally well as absolute position? In order to clarify this, we first review existing relative position encoding methods and analyze their pros and cons when applied in vision transformers. We then propose new relative position encoding methods dedicated to 2D images, called image RPE (iRPE). Our methods consider directional relative distance modeling as well as the interactions between queries and relative position embeddings in self-attention mechanism. The proposed iRPE methods are simple and lightweight. They can be easily plugged into transformer blocks. Experiments demonstrate that solely due to the proposed encoding methods, DeiT and DETR obtain up to 1.5% (top-1 Acc) and 1.3% (mAP) stable improvements over their original versions on ImageNet and COCO respectively, without tuning any extra hyperparameters such as learning rate and weight decay. Our ablation and analysis also yield interesting findings, some of which run counter to previous understanding. Code and models are open-sourced at https://github.com/microsoft/Cream/tree/main/iRPE.


翻译:相对位置编码( RPE) 对变压器来说非常重要 。 一般效果在自然语言处理中已经证明。 但是,在计算机视觉中,其功效没有得到很好研究,甚至仍然有争议,例如,相对位置编码能否同样和绝对位置发挥作用? 为了澄清这一点,我们首先审查现有的相对位置编码方法,并在对变压器应用时分析其利弊。然后我们提议2D图像的新的相对位置编码方法,称为图像 RPE( IRPE ) 。我们的方法考虑到方向相对模型以及查询和嵌入自留机制的相对位置之间的相互作用。提议的 iRPE 方法简单而轻重。 它们很容易被插入变压区块。 实验表明,仅仅由于拟议的编码方法, DeiT 和DETR 获得高达1.5%( 顶 - 1 Acc) 和 1. 3 % ( mAP) 的稳定改进。 我们的方法考虑方向相对距离的模型以及查询速度和重量衰减等任何额外参数。 提议的 iRPE, 我们的 ablationalation and eximal resmal amalalalalalalal resmalationalationsupalationsal 。

0
下载
关闭预览

相关内容

专知会员服务
29+阅读 · 2021年7月30日
自然语言处理顶会COLING2020最佳论文出炉!
专知会员服务
23+阅读 · 2020年12月12日
[综述]深度学习下的场景文本检测与识别
专知会员服务
77+阅读 · 2019年10月10日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
99+阅读 · 2019年10月9日
最新BERT相关论文清单,BERT-related Papers
专知会员服务
52+阅读 · 2019年9月29日
RoBERTa中文预训练模型:RoBERTa for Chinese
PaperWeekly
57+阅读 · 2019年9月16日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
(TensorFlow)实时语义分割比较研究
机器学习研究会
9+阅读 · 2018年3月12日
条件GAN重大改进!cGANs with Projection Discriminator
CreateAMind
8+阅读 · 2018年2月7日
计算机视觉近一年进展综述
机器学习研究会
8+阅读 · 2017年11月25日
Capsule Networks解析
机器学习研究会
10+阅读 · 2017年11月12日
自然语言处理(二)机器翻译 篇 (NLP: machine translation)
DeepLearning中文论坛
10+阅读 · 2015年7月1日
Arxiv
0+阅读 · 2021年9月24日
Arxiv
20+阅读 · 2021年9月21日
Arxiv
19+阅读 · 2020年12月23日
Arxiv
8+阅读 · 2018年11月21日
VIP会员
相关资讯
RoBERTa中文预训练模型:RoBERTa for Chinese
PaperWeekly
57+阅读 · 2019年9月16日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
(TensorFlow)实时语义分割比较研究
机器学习研究会
9+阅读 · 2018年3月12日
条件GAN重大改进!cGANs with Projection Discriminator
CreateAMind
8+阅读 · 2018年2月7日
计算机视觉近一年进展综述
机器学习研究会
8+阅读 · 2017年11月25日
Capsule Networks解析
机器学习研究会
10+阅读 · 2017年11月12日
自然语言处理(二)机器翻译 篇 (NLP: machine translation)
DeepLearning中文论坛
10+阅读 · 2015年7月1日
相关论文
Arxiv
0+阅读 · 2021年9月24日
Arxiv
20+阅读 · 2021年9月21日
Arxiv
19+阅读 · 2020年12月23日
Arxiv
8+阅读 · 2018年11月21日
Top
微信扫码咨询专知VIP会员