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

Visual Localization Using Semantic Segmentation and Depth Prediction

Huanhuan Fan, Yuhao Zhou, Ang Li, Shuang Gao, Jijunnan Li, Yandong GuoarXiv 2020

Abstract

Visual localization is a fundamental task for autonomous systems, yet it remains challenging under varying environmental conditions. This paper presents a robust monocular visual localization pipeline that enhances 6-DoF pose estimation by integrating high-level scene understanding. By leveraging semantic segmentation and monocular depth prediction, the proposed method filters inconsistent keypoint matches and improves image retrieval ranking. Evaluation on the Long-Term Visual Localization benchmark demonstrates that incorporating semantic and geometric constraints significantly reduces outlier matches, achieving state-of-the-art performance.

Introduction

Determining the precise 6-DoF pose of a camera is essential for applications such as augmented reality (AR) and autonomous driving. However, "long-term" localization—where the query image and the reference map differ significantly in lighting, season, or viewpoint—often causes traditional feature-based methods to fail. Deep-learning-based descriptors have improved robustness, but they still produce false positives that standard outlier rejection methods like RANSAC struggle to handle when the inlier ratio is low. This work addresses these challenges by introducing semantic and geometric "sanity checks" to ensure 2D-3D matches are physically plausible.

Methodology

The proposed pipeline enhances the standard retrieval-based localization framework through several novel modules designed to prune search spaces and validate matches.

Overview of the proposed visual localization pipeline, showing the integration of semantic and depth information for pose optimization.

Semantic and Geometric Constraints

  1. Semantic Consistency Weight (SCW): During image retrieval, results are ranked based on the ratio of matched keypoints that share the same semantic label (e.g., matching a "building" pixel to a "building" 3D point).
  2. Hybrid Feature Extraction: The system combines multiple learning-based extractors, specifically R2D2 and SuperPoint. A modified R2D2 descriptor is utilized, which incorporates detection confidence directly into the matching process.
  3. Semantic Consistency Check (SCC): This module filters individual matches if the query pixel's semantic label (e.g., "road") contradicts the label of the corresponding 3D map point. It also automatically discards matches on dynamic objects like pedestrians.
  4. Depth Consistency Verification (DCV): Using MegaDepth for monocular depth prediction, the system compares predicted depth to the depth estimated from the 3D map. To account for scale inconsistencies in monocular depth, an Adaptive Ordinal Cost (AOC) is used to validate the relative ordering of points.
  5. Weighted-RANSAC: The RANSAC threshold is dynamically adjusted based on semantic confidence, allowing for more permissive matching when semantic labels are highly consistent.

Experimental Results

The pipeline was evaluated using the Long-Term Visual Localization Benchmark 2020 and the HPatches dataset. Semantic segmentation models were trained on PASCAL VOC 2012 and Cityscapes, while MegaDepth provided the foundation for geometric verification.

Performance comparison of various descriptors across Overall, Illumination, and Viewpoint categories on the HPatches dataset.

Key Findings

  • Benchmark Superiority: The integrated pipeline outperformed existing state-of-the-art approaches on the 2020 benchmark.
  • Descriptor Performance: As shown in the HPatches evaluation, the modified R2D2 descriptor (incorporating detection confidence) consistently achieved higher Mean Matching Accuracy (MMA) across varying reprojection error thresholds compared to standard R2D2, D2-Net, and DELF.
  • Robustness to Appearance Change: While visual appearance changes drastically (e.g., day to night), semantic categories remain constant. Utilizing semantics as a "hard constraint" proved highly effective at pruning the search space and eliminating fallacious matches that would otherwise lead to incorrect pose estimates.

Conclusion and Future Work

By treating semantics and ordinal depth as robust validators, this research demonstrates a significant leap in long-term localization accuracy. While the system currently depends on the accuracy of underlying prediction networks and involves high computational complexity, it establishes a powerful framework for multi-cue integration. Future work will explore end-to-end trainable architectures to further optimize the synergy between these semantic and geometric signals.

Summary updated

BibTeX
@misc{fan2020visual,
  author = {Huanhuan Fan and Yuhao Zhou and Ang Li and Shuang Gao and Jijunnan Li and Yandong Guo},
  title = {{Visual Localization Using Semantic Segmentation and Depth Prediction}},
  year = {2020},
  eprint = {2005.11922},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2005.11922},
}
Figure