Hierarchical Scene Coordinate Classification and Regression for Visual Localization

Xiaotian Li, Shuzhe Wang, Yi Zhao, Jakob Verbeek, Juho Kannala

Abstract

Visual localization in large-scale environments faces significant challenges due to visual ambiguity and the scaling limitations of standard scene coordinate regression (SCR) methods. This paper introduces the Hierarchical Scene Coordinate Network (HSCNet), a "coarse-to-fine" approach that predicts 3D scene coordinates from a single RGB image. By first classifying pixels into discrete hierarchical regions before regressing exact 3D positions, HSCNet leverages global context to resolve local ambiguities. Our method achieves state-of-the-art performance on standard benchmarks and demonstrates superior scalability in massive, combined environments while maintaining a compact model size.

Introduction

Determining the 6-degree-of-freedom (6-DoF) pose of a camera within a known environment is a fundamental task for robotics and augmented reality. While traditional methods rely on matching local features to a 3D map, Scene Coordinate Regression (SCR) has emerged as a powerful alternative. SCR uses a neural network to directly map image pixels to 3D world coordinates.

However, SCR methods struggle with scalability. In large environments, distinct locations often appear visually similar—a problem known as visual ambiguity. If a network's receptive field is too small, it cannot distinguish between identical-looking patches (e.g., white walls in different rooms). Conversely, simply increasing the receptive field can lead to overfitting. HSCNet addresses this by decomposing the regression task into a hierarchical classification and regression problem.

Methodology

The core of HSCNet is a hierarchical "coarse-to-fine" architecture that processes a query image through several stages of spatial refinement.

Overview of the HSCNet pipeline, illustrating the transition from hierarchical region labels to precise scene coordinate prediction.

Hierarchical Partitioning and Joint Prediction

The 3D space is initially partitioned into coarse regions using k-means clustering, which are further subdivided into finer subregions. The network features multiple output branches:

  1. Coarse Classification: Predicts a broad region label for each pixel.
  2. Fine Classification: Predicts a specific subregion label.
  3. Regression: Predicts the final 3D coordinate.

Conditioning with FiLM

To effectively use global context, HSCNet employs Feature-wise Linear Modulation (FiLM). Predictions from coarser levels are fed back into finer levels, allowing the network to modulate its internal features based on the predicted global region. This mechanism enables the network to disambiguate local patches by "nudging" features according to the broader spatial context.

Global-to-Local Design

The architecture balances context and precision by using larger receptive fields for coarse classification and smaller, more focused receptive fields for the final regression layer. This design avoids the traditional trade-off between context-awareness and local detail.

Experiments and Results

HSCNet was evaluated on standard indoor (7-Scenes, 12-Scenes) and outdoor (Cambridge Landmarks) datasets, as well as large-scale "Combined" scenes (i7, i12, i19) designed to test scalability.

Performance comparison on combined scenes (i7, i12, i19). HSCNet (Ours) significantly outperforms regression-only baselines and matches or exceeds ensemble-based methods like ESAC.

Key Findings

  • Scalability: On combined scenes where standard SCR methods failed (dropping to ~5% accuracy), HSCNet maintained high accuracy (80-99%). It outperformed ESAC, an ensemble-based method, while being significantly more efficient.
  • Efficiency: The "Ours capacity-" variant achieved high accuracy with a model size of only 73MB, compared to the hundreds of megabytes required by competing ensembles like ESAC.
  • State-of-the-Art: HSCNet set new performance standards across 7-Scenes, 12-Scenes, and Cambridge Landmarks, outperforming both previous SCR methods like DSAC++ and traditional feature-based approaches. On the Aachen Day-Night dataset, a hybrid version of HSCNet significantly narrowed the gap between coordinate regression and explicit feature matching in extreme outdoor conditions.

Conclusion

HSCNet represents a significant step forward in making scene coordinate regression viable for large-scale visual localization. By treating classification as a prior for regression and using a hierarchical conditioning mechanism, the model resolves visual ambiguities that previously limited SCR methods. Future work includes optimizing 3D scene partitioning and integrating the network into end-to-end pose optimization frameworks.

Summary updated

BibTeX
@inproceedings{li2020hierarchical,
  author = {Xiaotian Li and Shuzhe Wang and Yi Zhao and Jakob Verbeek and Juho Kannala},
  title = {{Hierarchical Scene Coordinate Classification and Regression for Visual Localization}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr42600.2020.01200},
}
Figure