Pay Attention to Your Neighbours: Training-Free Open-Vocabulary Semantic Segmentation

Sina Hajimiri, Ismail Ben Ayed, Jose Dolz
4/12/2024
cs.CV

Official code: sinahmr/NACLIP (75 stars, MIT, last commit 2024-09-23).

Abstract

Despite the significant progress in deep learning for dense visual recognition problems, such as semantic segmentation, traditional methods are constrained by fixed class sets. Meanwhile, vision-language foundation models, such as CLIP, have showcased remarkable effectiveness in numerous zero-shot image-level tasks, owing to their robust generalizability. Recently, a body of work has investigated utilizing these models in open-vocabulary semantic segmentation (OVSS). However, existing approaches often rely on impractical supervised pre-training or access to additional pre-trained networks. In this work, we propose a strong baseline for training-free OVSS, termed Neighbour-Aware CLIP (NACLIP), representing a straightforward adaptation of CLIP tailored for this scenario. Our method enforces localization of patches in the self-attention of CLIP's vision transformer which, despite being crucial for dense prediction tasks, has been overlooked in the OVSS literature. By incorporating design choices favouring segmentation, our approach significantly improves performance without requiring additional data, auxiliary pre-trained networks, or extensive hyperparameter tuning, making it highly practical for real-world applications. Experiments are performed on 8 popular semantic segmentation benchmarks, yielding state-of-the-art performance on most scenarios. Our code is publicly available at https://github.com/sinahmr/NACLIP.

View on arXivView PDF

Code Implementations(1)

sinahmr/NACLIPOfficial100%
MIT

PyTorch Implementation of NACLIP in "Pay Attention to Your Neighbours: Training-Free Open-Vocabulary Semantic Segmentation"

756Shell, PythonApr 3, 20242 years agoMIT
open-vocabularyopen-vocabulary-semantic-segmentationsemantic-segmentationtraining-free

Cite this paper

@article{hajimiri2024attention,
  title  = {Pay Attention to Your Neighbours: Training-Free Open-Vocabulary Semantic Segmentation},
  author = {Sina Hajimiri and Ismail Ben Ayed and Jose Dolz},
  year   = {2024},
  eprint = {2404.08181},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2404.08181v2}
}

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/2404.08181.svg)](https://codeofpaper.com/paper/2404.08181)

Discussion