Hierarchical Joint Scene Coordinate Classification and Regression for Visual Localization

Xiaotian Li, Jakob Verbeek, Juho Kannala

TL;DR

This paper introduces a hierarchical "coarse-to-fine" neural network that significantly improves visual localization—the task of determining a camera's exact position and orientation from a single image. By combining discrete scene classification with continuous coordinate regression, the authors created a model that is more robust to large, ambiguous environments and more memory-efficient than previous state-of-the-art methods.

What Problem Does This Paper Address?

Visual localization is the "where am I?" problem for robots and AR devices. Traditionally, this is done by matching local features (like SIFT) in a query image to a massive 3D point cloud. Recently, Scene Coordinate Regression (SCR) has emerged as a sleeker alternative: a neural network learns to map pixels directly to 3D coordinates in the scene, effectively "memorizing" the environment in its weights.

However, SCR has a scaling problem. To generalize well, these networks usually look at small image patches (limited receptive fields). In large or repetitive environments (like a long hallway), many patches look identical, leading to "perceptual aliasing" or ambiguity. If you increase the network's field of view to see more context, it tends to overfit the training data. The authors tackle this "precision vs. context" trade-off.

Methods

The authors propose a Hierarchical Scene Coordinate Network (HSCNet). Instead of jumping straight from pixels to 3D coordinates, the network works in stages:

  1. Hierarchical Partitioning: During training, the 3D scene is clustered (using k-means) into coarse regions, then sub-regions, and finally individual points.
  2. Coarse-to-Fine Prediction: The network has multiple output branches. The first branch predicts a coarse region label for each pixel. This prediction is then used to "condition" the next branch, which predicts a finer sub-region label.
  3. Conditioned Regression: The final layer regresses the actual 3D coordinates. Crucially, this regression is conditioned on the previous classification labels using a technique inspired by FiLM (Feature-wise Linear Modulation). This allows the network to use global context (the region label) to disambiguate local features without needing a massive receptive field that causes overfitting.
  4. Global-to-Local Design: Coarser layers have larger receptive fields to capture context, while finer layers focus on local details for precision.
Overview of the HSCNet pipeline showing hierarchical partitioning and coarse-to-fine prediction.

Datasets

The model was evaluated on several standard benchmarks:

  • 7-Scenes & 12-Scenes: Small-scale indoor datasets.
  • Cambridge Landmarks: An outdoor dataset of five university scenes.
  • Combined Scenes (i7S, i12S, i19S): The authors merged individual scenes into single, large-scale coordinate systems to test how well the model scales when the environment grows significantly.
  • Aachen Day-Night: A challenging outdoor dataset used to test a hybrid version of their approach for large-scale localization under varying lighting.

Key Insights and Ideas

  • Classification as a Compass: Discrete classification is better at handling ambiguity than pure regression because it can represent multiple possibilities (multi-modal) through probability distributions.
  • The Power of Conditioning: By feeding the predicted region labels back into the feature maps (via FiLM), the network effectively "zooms in" on the relevant part of the 3D model, ignoring visually similar but distant parts of the scene.
  • Efficiency at Scale: Because the model uses a single network to represent multiple scenes (in the combined datasets), it is much more compact than "ensemble" methods like ESAC, which require a separate network for every sub-region.

Key Results

  • State-of-the-Art Performance: HSCNet outperformed the previous leader, DSAC++, on the 7-Scenes and 12-Scenes datasets. For example, it achieved 80.5% accuracy (under 5cm/5° error) on the "Complete" 7-Scenes benchmark, compared to DSAC++'s 76.1%.
  • Robust Scaling: On the combined i19-Scenes dataset, the baseline regression-only model's accuracy plummeted to 20.3%, while HSCNet maintained a high accuracy of 82.1% (and up to 92.6% in specific configurations).
  • Model Compression: The hierarchical approach allowed for a "compact" version of the model that is 7x smaller than competing ensemble methods while maintaining comparable accuracy.
  • Outdoor Success: On the Aachen Day-Night dataset, their hybrid approach significantly reduced the performance gap between scene coordinate regression and traditional feature-matching methods.
Performance comparison on combined scene datasets (i7, i12, i19) showing the robustness of HSCNet compared to regression-only baselines.

Limitations and Future Work

While the model performs exceptionally well, the authors note a few areas for improvement:

  • Dense Model Requirement: Training requires a dense 3D model of the environment, which isn't always available for large outdoor scenes.
  • Hybrid Necessity for Outdoors: For the Aachen dataset, they had to switch from raw RGB input to sparse local features to handle the extreme scale and sparsity of the data.
  • Partitioning Strategy: The current hierarchical labels are generated via k-means; the authors suggest that exploring more optimal ways to partition the scene could further boost performance.

Summary updated

BibTeX
@inproceedings{li2020hierarchical,
  author = {Xiaotian Li and Jakob Verbeek and Juho Kannala},
  title = {{Hierarchical Joint 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