Skip to main content
archive Search
Submit Donate Log in

Press Enter to search · Advanced search

Computer Science > Computer Vision and Pattern Recognition

arXiv:2107.14222 (cs)
[Submitted on 29 Jul 2021]

Title:Rethinking and Improving Relative Position Encoding for Vision Transformer

Authors:Kan Wu, Houwen Peng, Minghao Chen, Jianlong Fu, Hongyang Chao
View a PDF of the paper titled Rethinking and Improving Relative Position Encoding for Vision Transformer, by Kan Wu and Houwen Peng and Minghao Chen and Jianlong Fu and Hongyang Chao
View PDF HTML (experimental)
Abstract: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 this https URL.
Comments: Accepted by ICCV 2021
Subjects: Computer Vision and Pattern Recognition (cs.CV)
Cite as: arXiv:2107.14222 [cs.CV]
  (or arXiv:2107.14222v1 [cs.CV] for this version)
  https://doi.org/10.48550/arXiv.2107.14222
arXiv-issued DOI via DataCite

Submission history

From: Houwen Peng [view email]
[v1] Thu, 29 Jul 2021 17:55:10 UTC (508 KB)
Full-text links:

Access Paper:

    View a PDF of the paper titled Rethinking and Improving Relative Position Encoding for Vision Transformer, by Kan Wu and Houwen Peng and Minghao Chen and Jianlong Fu and Hongyang Chao
  • View PDF
  • HTML (experimental)
  • TeX Source
license icon view license

Additional Features

  • Audio Summary

Current browse context:

cs.CV
< prev   |   next >
new | recent | 2021-07
Change to browse by:
cs

References & Citations

  • SciX
  • Google Scholar
  • Semantic Scholar

DBLP - CS Bibliography

listing | bibtex
Kan Wu
Houwen Peng
Jianlong Fu
Hongyang Chao
Loading...

BibTeX formatted citation

Data provided by:

Bookmark

BibSonomy Reddit

Bibliographic and Citation Tools

Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)

Code, Data and Media Associated with this Article

alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
ScienceCast (What is ScienceCast?)

Demos

Replicate (What is Replicate?)
Hugging Face Spaces (What is Spaces?)
TXYZ.AI (What is TXYZ.AI?)

Recommenders and Search Tools

Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
  • Author
  • Venue
  • Institution
  • Topic

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)
We gratefully acknowledge support from our major funders, member institutions, , and all contributors.
About · Help · Contact · Subscribe · Copyright · Privacy · Accessibility · Operational Status (opens in new tab)
Major funding support from
Simons Foundation (opens in new tab) Simons Foundation International (opens in new tab) Schmidt Sciences (opens in new tab)