Weatherproofing Retrieval for Localization with Generative AI and Geometric Consistency

Yannis Kalantidis, Mert Bülent Sarıyıldız, Rafael S. Rezende, Philippe Weinzaepfel, Diane Larlus, Gabriela Csurka

Abstract

Visual localization is a fundamental task for autonomous systems, yet its performance often degrades under significant environmental changes such as varying weather or lighting conditions. This paper introduces Ret4Loc, a novel training framework designed to enhance the robustness of image retrieval—the critical first step in localization pipelines. By leveraging generative AI to synthesize diverse environmental conditions and employing a geometric consistency filter to maintain structural integrity, Ret4Loc achieves state-of-the-art performance across challenging outdoor and indoor benchmarks.

Introduction

Determining a camera's precise position and orientation in a known environment, or visual localization, is essential for the safe operation of autonomous vehicles and robots. Most modern localization pipelines rely on a hierarchical approach: first, an image retrieval step identifies the most similar images from a pre-mapped database to provide a coarse estimate; second, local feature matching refines this estimate into a precise pose.

However, the retrieval step is highly sensitive to "long-term" appearance variations. A model trained on clear summer day images often fails to match a query image taken during a snowy winter night. While these environmental shifts are predictable, collecting and labeling real-world data for every possible combination of weather, season, and time of day is logistically and financially prohibitive. Ret4Loc addresses this data scarcity by using generative AI to "weatherproof" retrieval models.

Methodology: The Ret4Loc Framework

The Ret4Loc framework improves retrieval through three integrated innovations: tailored training techniques, generative data augmentation, and geometric consistency filtering.

1. Tailored Training Refinements

Starting with the HOW (Hard Online Weighting) method as a baseline, the authors modernize the training process. They incorporate the AdamW optimizer for better weight decay handling and AugMix, a data augmentation strategy that improves model generalization by blending multiple augmented versions of an image. These refinements ensure the model is receptive to the more complex synthetic data introduced in later steps.

2. Generative Data Augmentation

To simulate environmental diversity, the authors utilize InstructPix2Pix, a generative text-to-image model. For every image in the SfM-120K training dataset, they synthesize 11 "nameable" variations. By using natural language prompts such as "at dawn," "in winter," "with rain," and "at night," the framework distills the latent environmental knowledge of large-scale generative models into the localization task. This process resulted in an augmented training set of over 1 million synthetic images.

3. Geometric Consistency Filtering

Generative models can occasionally "hallucinate" or alter the underlying geometry of a scene—for instance, changing the shape of a building while adding snow. To prevent the model from learning these structural inaccuracies, the authors introduce a geometric consistency score. Using the LightGlue matching algorithm, they compare the original image with its synthetic counterpart.

Two variants of the model were developed based on this score:

  • Ret4Loc-HOW-Synth+: Filters out synthetic images that fall below a specific consistency threshold.
  • Ret4Loc-HOW-Synth++: Employs "geometry-aware sampling," which intentionally selects "harder" synthetic images—those with lower but still valid consistency scores—to force the model to learn more robust, invariant features.

Experimental Results

The framework was evaluated against a comprehensive suite of benchmarks, including the Aachen Day-Night v1.1, RobotCar Seasons, and indoor datasets like Gangnam Station.

Performance in Extreme Conditions

The most significant gains were observed in low-light and adverse weather scenarios. On the RobotCar Night benchmark, Ret4Loc achieved a +14.7% accuracy improvement over previous state-of-the-art methods. Similarly, it saw a +14.1% increase on Aachen Night. These results demonstrate that synthetic data can effectively bridge the gap between day and night domains.

Cross-Domain Robustness

Interestingly, the "weatherproofing" trained on outdoor data translated to indoor environments. On the Gangnam Station B2 dataset, the model achieved a +4.6% gain. This suggests that by learning to ignore transient weather effects, the model develops a more generalized understanding of lighting and shadow stability that applies even in the absence of actual weather.

Discussion and Key Insights

Language as a Bridge

A core insight of this work is that the most difficult domain shifts in localization are easily described in plain text. By using language as a bridge, researchers can generate targeted training data for specific failure modes (e.g., "foggy conditions") without needing to capture those conditions in the real world.

The Sanctity of Structure

In localization, while appearance is fluid, geometry is invariant. The use of a geometric consistency score acts as an automated quality control mechanism. It ensures that the model focuses on stable landmarks and structural features rather than the generative model's artistic interpretations of weather.

Conclusion and Future Work

Ret4Loc demonstrates that generative AI, when constrained by geometric principles, is a powerful tool for enhancing visual localization. While the computational cost of synthesizing millions of images is high (approximately 25 hours on a multi-GPU setup), it is a one-time investment that yields significant dividends in model robustness.

Future work may involve refining indoor synthesis, as generative models currently struggle with indoor-specific prompts (e.g., erroneously placing a "sunset" inside a hallway). As text-to-image models continue to evolve in realism and controllability, the potential for synthetic training to solve the "long-tail" problems of robotics and autonomous navigation will only expand.

Summary updated

BibTeX
@inproceedings{kalantidis2024weatherproofing,
  author = {Yannis Kalantidis and Mert Bülent Sarıyıldız and Rafael S. Rezende and Philippe Weinzaepfel and Diane Larlus and Gabriela Csurka},
  title = {{Weatherproofing Retrieval for Localization with Generative AI and Geometric Consistency}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=5EniAcsO7f},
}
Figure