Making Vision Transformers Truly Shift-Equivariant

Renán A. Rojas-Gómez, Teck-Yian Lim, Minh N. Do, Raymond A. Yeh
5/1/2023
transformer-attention

No confident code implementation found for this paper.

Abstract

In the field of computer vision, Vision Transformers (ViTs) have emerged as a prominent deep learning architecture. Despite being inspired by Convolutional Neural Networks (CNNs), ViTs are susceptible to small spatial shifts in the input data - they lack shift-equivariance.

Show full abstract

To address this shortcoming, we introduce novel data-adaptive designs for each of the ViT modules that break shift-equivariance, such as tokenization. self-attention, patch merging, and positional encoding. With our proposed modules, we achieve perfect circular shift-equivariance across four prominent ViT ar-chitectures: Swin, SwinV2, CvT, and MViTv2. Additionally, we leverage our design to further enhance consistency under standard shifts. We evaluate our adaptive ViT models on image classification and semantic segmentation tasks. Our models achieve competitive performance across three diverse datasets, showcasing perfect (100%) circular shift consistency while improving standard shift consistency. 11Project website: https://renanrojasg.github.io/shifteq_vit.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{rojasgmez2023making,
  title  = {Making Vision Transformers Truly Shift-Equivariant},
  author = {Renán A. Rojas-Gómez and Teck-Yian Lim and Minh N. Do and Raymond A. Yeh},
  year   = {2023},
  eprint = {2305.16316},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2305.16316},
  journal = {CVPR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.16316.svg)](https://codeofpaper.com/paper/2305.16316)

Discussion