paper-with-me

홈 › Papers

Rethinking and Improving Relative Position Encoding for Vision Transformer

2021-07-29 · ICCV 2021 10 · Kan Wu, Houwen Peng, Minghao Chen, Jianlong Fu, Hongyang Chao

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.

📄 PDF Abstract BibTeX arXiv:2107.14222

Code (1)

microsoft/cream 공식 구현 pytorch

Tasks

Image ClassificationObject DetectionPosition

Methods 이 논문이 사용한 방법론

Attention 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Absolute Position Encodings Absolute Position Encodings are a type of position embeddings for [Transformer-based models] where positional encodings are…
Position-Wise Feed-Forward Layer 설명 없음
Adam 설명 없음
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…
Residual Connection 설명 없음

Similar Papers 제목 키워드 기반

DPPE: Rethinking Camera-Based Positional Encoding for Scaling Multi-View Transformers

2026-06-30 · Shun Kenney, Teppei Suzuki arxiv

The remarkable scalability of Transformers has expanded their application to 3D computer vision, where camera-aware positional encoding is crucial for providing spatial cues in multi-view geometry. Recent advancements ha…

Novel View Synthesis

G-ray: Ray-Level Relative Geometric Position Encoding in Multi-View Vision Transformers under Camera Heterogeneity

2026-09-14 · Shuo Zhang, Xin Su, Wei Wang, Jun Liu 외 arxiv

We study relative position encoding for multi-view vision Transformers under camera heterogeneity, including varying fields of view (FoVs) or projection models. Existing rotary relative position encodings commonly use im…

3D Reconstruction

FastRPB: a Scalable Relative Positional Encoding for Long Sequence Tasks

2022-02-23 · Maksim Zubkov, Daniil Gavrilov

Transformers achieve remarkable performance in various domains, including NLP, CV, audio processing, and graph analysis. However, they do not scale well on long sequence tasks due to their quadratic complexity w.r.t. the…

Cameras as Relative Positional Encoding

2025-07-14 · RuiLong Li, Brent Yi, Junchen Liu, Hang Gao 외

Transformers are increasingly prevalent for multi-view computer vision tasks, where geometric relationships between viewpoints are critical for 3D perception. To leverage these relationships, multi-view transformers must…

Depth EstimationNovel View SynthesisStereo Depth Estimation

Linearized Relative Positional Encoding

2023-07-18 · Zhen Qin, Weixuan Sun, Kaiyue Lu, Hui Deng 외

Relative positional encoding is widely used in vanilla and linear transformers to represent positional information. However, existing encoding methods of a vanilla transformer are not always directly applicable to a line…

image-classificationImage ClassificationLanguage ModelingLanguage Modelling+2