NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Location-Aware Self-Supervised Transformers for Semantic Segmentation

Mathilde Caron, Neil Houlsby, Cordelia Schmid

TL;DR

This paper introduces LOCA, a novel self-supervised pre-training method for Vision Transformers (ViTs) that explicitly encourages spatial reasoning. By combining patch-level clustering with a relative position prediction task, LOCA learns dense, spatially-aware features that significantly improve performance on semantic segmentation tasks, outperforming existing self-supervised methods.

What Problem Does This Paper Address?

Semantic segmentation, a crucial task in computer vision that involves assigning a class label to every pixel in an image, requires models to understand both the identity of objects and their spatial arrangement. However, current dominant self-supervised learning (SSL) pre-training methods, such as image classification or image-text alignment, primarily focus on global image-level objectives. While these methods are effective for general image understanding, they often fail to capture the fine-grained spatial relationships necessary for tasks like semantic segmentation. This can lead to suboptimal performance when fine-tuning on downstream tasks that demand precise localization and understanding of object parts. The paper aims to bridge this gap by developing an SSL pre-training strategy that explicitly fosters spatial reasoning.

Methods

LOCA (Location-Aware Self-Supervised Transformers) is a patch-level SSL pre-training method designed to encourage spatial localization reasoning. It operates on a query-reference scheme:

  • Query and Reference View Generation: An image is augmented to create a "query" view and a "reference" view. These views have different image statistics (scale, region, color) to force the network to rely on more than just low-level cues.
  • Patch-Level Clustering: A clustering-based pseudo-labeling strategy is employed at the patch level. The network learns to predict cluster assignments for query patches based on their similarity to prototypes derived from the reference view. This is inspired by previous SSL works that use clustering for pseudo-supervision.
  • Relative Position Prediction: A key innovation is the relative position prediction task. Query patches learn to predict their corresponding location in the reference view. This is achieved using a cross-attention mechanism where query patch features attend to reference patch features.
  • Masking Reference Patches: To make the position prediction task more challenging and encourage stronger localization features, a ratio of reference patch features is randomly masked (dropped) before being fed into the cross-attention mechanism. This forces the network to rely more on spatial reasoning rather than just low-level cues.
  • Optimization: The training objective is a combination of the patch-level clustering loss and the relative position prediction loss. The reference view encoder parameters are updated via an exponential moving average of the query view encoder parameters, a common practice in SSL.

Datasets

The paper uses the following datasets:

  • Pre-training: ImageNet-1k and ImageNet-21k are used for pre-training.
  • Evaluation: The method is evaluated on 11 diverse semantic segmentation benchmarks: ADE20k, Pascal Context, Pascal VOC, Cityscapes, Berkeley Deep Drive (BDD), CamVid, India Driving Dataset (IDD), KITTI, SUN-RGB-D (SUN), ISPRS, and SUIM.

Key Insights and Ideas

  • Spatial Reasoning is Crucial for Segmentation: The paper strongly argues that global image-level pre-training is suboptimal for tasks like semantic segmentation, which inherently require spatial understanding.
  • Query-Reference Mechanism Enhances Difficulty: The query-reference approach for position prediction, compared to a single-view approach, makes the pre-training task more challenging and leads to better representations. This is attributed to the differing image statistics and the constrained interaction between query and reference patches.
  • Masking is Key to Improving Localization: Masking reference patches in the position prediction task significantly improves both localization and classification capabilities of the learned features, leading to better semantic segmentation performance. This suggests that forcing the network to infer location with partial information is beneficial.
  • Patch-Level Clustering Complements Position Prediction: Combining patch-level clustering with relative position prediction yields the best performance, demonstrating the complementary nature of these two spatially-aware objectives.
  • LOCA Scales Well: The method shows promising scalability with larger models and datasets, suggesting its potential for large-scale pre-training.

Key Results

  • State-of-the-Art Performance: LOCA achieves state-of-the-art performance on 11 semantic segmentation benchmarks, outperforming other self-supervised methods like DINO, MoCo-v3, iBOT, and MAE.
  • Significant Improvement over MAE: LOCA improves average relative performance by +4.3 points over MAE on semantic segmentation tasks, despite requiring only 1.1x more pre-training time.
  • Label-Efficient Transfer: LOCA features demonstrate improved label-efficiency, achieving better performance than previous methods when finetuning with very few training images.
  • Strong Localization: LOCA features excel at localization, outperforming even supervised pre-trained models in this aspect, which directly translates to better semantic segmentation performance.
  • Competitive with Supervised Methods: On semantic segmentation, LOCA is competitive with, and in some cases surpasses, supervised pre-training methods like DeiT-III.

Limitations and Future Work

  • Localization vs. Classification Trade-off: While LOCA excels at localization, supervised image-level pre-training methods still hold an advantage in pure classification. The paper suggests that combining dense, spatially-aware objectives with global objectives could be a promising direction.
  • Generalizability to Other Tasks: The paper explores LOCA's potential on depth estimation, showing promising results. However, further exploration of its applicability to other tasks requiring spatial reasoning is suggested.
  • Uncurated Data: While LOCA shows promise on large datasets, further investigation on large, uncurated datasets is needed to fully assess its scalability.
  • Hyperparameter Tuning: The paper notes that box regression for localization might require additional hyperparameter tuning, suggesting that further optimization could be explored.

Summary updated

BibTeX
@inproceedings{caron2024location,
  author = {Mathilde Caron and Neil Houlsby and Cordelia Schmid},
  title = {{Location-Aware Self-Supervised Transformers for Semantic Segmentation}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2024},
  doi = {10.1109/wacv57701.2024.00019},
}
Figure