Locality-Attending Vision Transformer

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Hajimiri, Sina, Beizaee, Farzad, Shakeri, Fereshteh, Desrosiers, Christian, Ayed, Ismail Ben, Dolz, Jose
Natura: Preprint
Pubblicazione: 2026
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866917315398860800
author Hajimiri, Sina
Beizaee, Farzad
Shakeri, Fereshteh
Desrosiers, Christian
Ayed, Ismail Ben
Dolz, Jose
author_facet Hajimiri, Sina
Beizaee, Farzad
Shakeri, Fereshteh
Desrosiers, Christian
Ayed, Ismail Ben
Dolz, Jose
contents Vision transformers have demonstrated remarkable success in classification by leveraging global self-attention to capture long-range dependencies. However, this same mechanism can obscure fine-grained spatial details crucial for tasks such as segmentation. In this work, we seek to enhance segmentation performance of vision transformers after standard image-level classification training. More specifically, we present a simple yet effective add-on that improves performance on segmentation tasks while retaining vision transformers' image-level recognition capabilities. In our approach, we modulate the self-attention with a learnable Gaussian kernel that biases the attention toward neighboring patches. We further refine the patch representations to learn better embeddings at patch positions. These modifications encourage tokens to focus on local surroundings and ensure meaningful representations at spatial positions, while still preserving the model's ability to incorporate global information. Experiments demonstrate the effectiveness of our modifications, evidenced by substantial segmentation gains on three benchmarks (e.g., over 6% and 4% on ADE20K for ViT Tiny and Base), without changing the training regime or sacrificing classification performance. The code is available at https://github.com/sinahmr/LocAtViT/.
format Preprint
id arxiv_https___arxiv_org_abs_2603_04892
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Locality-Attending Vision Transformer
Hajimiri, Sina
Beizaee, Farzad
Shakeri, Fereshteh
Desrosiers, Christian
Ayed, Ismail Ben
Dolz, Jose
Computer Vision and Pattern Recognition
Vision transformers have demonstrated remarkable success in classification by leveraging global self-attention to capture long-range dependencies. However, this same mechanism can obscure fine-grained spatial details crucial for tasks such as segmentation. In this work, we seek to enhance segmentation performance of vision transformers after standard image-level classification training. More specifically, we present a simple yet effective add-on that improves performance on segmentation tasks while retaining vision transformers' image-level recognition capabilities. In our approach, we modulate the self-attention with a learnable Gaussian kernel that biases the attention toward neighboring patches. We further refine the patch representations to learn better embeddings at patch positions. These modifications encourage tokens to focus on local surroundings and ensure meaningful representations at spatial positions, while still preserving the model's ability to incorporate global information. Experiments demonstrate the effectiveness of our modifications, evidenced by substantial segmentation gains on three benchmarks (e.g., over 6% and 4% on ADE20K for ViT Tiny and Base), without changing the training regime or sacrificing classification performance. The code is available at https://github.com/sinahmr/LocAtViT/.
title Locality-Attending Vision Transformer
topic Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2603.04892