TransVPR: Transformer-Based Place Recognition with Multi-Level Attention Aggregation

Ruotong Wang, Yanqing Shen, Weiliang Zuo, Sanping Zhou, Nanning Zheng

TL;DR

This paper introduces TransVPR, a novel Transformer-based model for visual place recognition that effectively integrates information from multiple levels of attention to generate robust global and local features. By adaptively focusing on task-relevant regions and combining multi-level insights, TransVPR achieves state-of-the-art performance on challenging benchmarks while maintaining computational efficiency.

What Problem Does This Paper Address?

Visual Place Recognition (VPR) is crucial for autonomous systems like self-driving cars and robots, enabling them to identify their location based on camera imagery. A major challenge in VPR is dealing with "distracting elements" in scenes – things like changing weather, dynamic objects, or untextured surfaces – which can confuse algorithms and lead to incorrect place identification. Traditional methods often rely on either global image features (which can be too general) or local patch descriptors (which can be sensitive to viewpoint changes). While some approaches combine these, they often unselectively process all image information, potentially including irrelevant details. This paper aims to develop a more robust VPR system that can intelligently focus on the most informative parts of an image.

Methods

TransVPR leverages the power of Vision Transformers (ViTs) for VPR. Here's a breakdown of its key components:

  • Patch Embedding: An input image is first processed by a CNN to extract multi-scale feature maps. These maps are then reshaped into sequences of "patch tokens."
  • Transformer Encoder: These patch tokens are fed into a Transformer encoder. Unlike standard ViTs that might add positional embeddings, TransVPR omits them, relying on the CNN to implicitly encode spatial information. This allows the model to be flexible with input image sizes.
  • Multi-Level Attention Aggregation: This is the core innovation. Instead of just using the final Transformer layer's output, TransVPR extracts tokens from multiple layers (low, mid, and high). For each level, it computes an "attention map" that highlights important regions. These maps are then fused to create a single, comprehensive attention map.
  • Global Image Features: The multi-level attention maps are used to weight the patch tokens, generating multi-level global features. These are then combined and processed to form a final global image representation.
  • Key-Patch Descriptors: The output tokens from the Transformer, filtered by the fused attention mask, are used as "key-patch descriptors." These are essentially robust local features that are more likely to correspond to distinctive and stable parts of a scene.
  • End-to-End Training: The entire TransVPR model is trained end-to-end with a single objective and only image-level supervision, simplifying the training process.

Datasets

The paper uses several public benchmark datasets for training and evaluation:

  • Training:
    • Places365: Used for initial pre-training of the feature extraction backbone (CNN and Transformer) for image classification.
  • MSLS (Mapillary Street Level Sequences): Used for initializing attention and dimensionality reduction modules.
  • MSLS and Pitts30k: Used for fine-tuning the model for the VPR task.
  • Evaluation:
    • MSLS (validation and challenge sets)
    • Nordland
    • Pitts30k
    • RobotCar Seasons v2 (RobotCar-S2)

Key Insights and Ideas

  • Transformers for VPR: Vision Transformers, with their inherent ability to aggregate global contextual information and dynamically select relevant features, are a natural fit for VPR, outperforming traditional CNNs in this domain.
  • Multi-Level Attention is Key: Simply using attention from one level of a Transformer isn't enough. Combining attention from low, mid, and high layers allows the model to capture a richer understanding of the scene, focusing on different scales of objects and structures.
  • Focusing on the "Distinctive": The model learns to ignore distracting elements (sky, untextured walls, etc.) and instead focuses on stable, informative regions for place recognition, even without explicit semantic constraints during training.
  • Unified Global and Local Features: TransVPR elegantly extracts both global representations (for initial retrieval) and local key-patch descriptors (for precise re-ranking) within a single, unified architecture.
  • Efficiency Gains: Despite its advanced capabilities, TransVPR is computationally efficient, offering significant speedups in feature encoding and matching compared to other state-of-the-art methods.

Key Results

  • State-of-the-Art Performance: TransVPR achieves state-of-the-art results on several benchmark datasets, including MSLS validation, MSLS challenge, and Nordland, outperforming strong baselines like DELG and Patch-NetVLAD. For instance, it shows an absolute increase of 3.6% on Recall@1 for MSLS validation compared to the best baseline.
  • Improved Retrieval and Re-ranking: The model excels in both the global retrieval stage and the subsequent re-ranking stage, demonstrating the effectiveness of its combined feature extraction approach.
  • Computational Efficiency: TransVPR is significantly faster than methods like DELG and Patch-NetVLAD-p, being 4.4x faster in feature encoding and 29.7x faster in spatial matching. It also has a lower memory footprint.
  • Qualitative Success: Visualizations show TransVPR successfully retrieving correct matches in challenging scenarios (e.g., severe viewpoint changes, occlusions) where other methods fail.

Limitations and Future Work

  • Camera Localization Precision: The authors acknowledge that the current TransVPR is limited in VPR tasks where camera localization might be imprecise due to sparse reference images.
  • Future Work: A promising direction is to extend TransVPR to estimate camera poses in a regression framework by exploiting its learned descriptors. This would directly address the limitation of precise localization.

Summary updated

BibTeX
@inproceedings{wang2022transvpr,
  author = {Ruotong Wang and Yanqing Shen and Weiliang Zuo and Sanping Zhou and Nanning Zheng},
  title = {{TransVPR: Transformer-Based Place Recognition with Multi-Level Attention Aggregation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
  doi = {10.1109/cvpr52688.2022.01328},
}
Figure