Backtracking Regression Forests for Accurate Camera Relocalization

Lili Meng, Jianhui Chen, Frederick Tung, James J. Little, Julien Valentin, Clarence W. de Silva

Introduction

Camera relocalization—the task of determining the 6-degree-of-freedom (6-DOF) pose of a camera from a single image—is a fundamental challenge in robotics and augmented reality. While Random Forests (RF) are a popular choice for this task due to their ability to map 2D pixels directly to 3D world coordinates, they often suffer from two critical flaws. First, greedy splitting during training can lead to "unbalanced" trees that generalize poorly. Second, standard RFs are prone to the "wrong turn" problem: if a test pixel is misdirected at a high-level node, it reaches an incorrect leaf node with no mechanism for recovery.

Methodology

To address these limitations, this paper introduces Backtracking Regression Forests (BTBRF). The approach incorporates two primary innovations: a sample-balanced training objective and a novel backtracking search during inference.

Sample-Balanced Objective

In the upper levels of the decision trees, the model employs a new objective function that penalizes uneven data splits. By forcing an approximately equal number of samples into left and right sub-trees, the forest achieves better regularization and faster training. This prevents the model from over-specializing in specific spatial clusters too early in the process.

Backtracking Scheme

Unlike standard RFs that follow a single path to a leaf, BTBRF uses a priority queue to explore multiple promising branches. If a split decision is ambiguous (i.e., the feature value is close to the threshold), the algorithm can backtrack to explore the alternative branch. By examining up to $N_{max}$ leaf nodes, the system can recover from early misclassifications and find more accurate 3D coordinate predictions.

Illustration of balanced vs. unbalanced nodes and the backtracking path in a decision tree.

Experimental Results

The BTBRF model was evaluated on the 4 Scenes (indoor) and Cambridge Landmarks (outdoor) datasets. The results demonstrate significant improvements over both traditional RF methods and modern deep learning baselines.

Indoor and Outdoor Performance

On the 4 Scenes dataset, BTBRF achieved an average of 92.7% "correct" frames (within 5cm/5°), a substantial leap from the 69.3% achieved by previous state-of-the-art methods. In outdoor environments like King’s College, BTBRF outperformed PoseNet by an order of magnitude, achieving a median error of 0.39 meters compared to PoseNet's 1.92 meters.

Efficiency of Backtracking

A key finding is that the accuracy of the model saturates relatively quickly as the number of explored leaf nodes increases. As shown in the performance analysis, checking approximately 10 to 15 leaf nodes provides the majority of the precision boost, allowing for a favorable trade-off between computational cost and relocalization accuracy.

Performance improvement as a function of the number of leaf nodes explored during backtracking.

Conclusion and Future Work

Backtracking Regression Forests demonstrate that structured classical models, when enhanced with smart search heuristics, remain highly competitive with—and often superior to—end-to-end deep learning for precise camera relocalization. While the current implementation faces some memory and speed constraints, future work focusing on GPU acceleration and adaptive backtracking (searching multiple paths only when confidence is low) promises to make this approach viable for real-time robotics applications.

Summary updated

BibTeX
@inproceedings{meng2017backtracking,
  author = {Lili Meng and Jianhui Chen and Frederick Tung and James J. Little and Julien Valentin and Clarence W. de Silva},
  title = {{Backtracking Regression Forests for Accurate Camera Relocalization}},
  booktitle = {IEEE/RSJ International Conference on Intelligent Robots and Systems},
  year = {2017},
  doi = {10.1109/iros.2017.8206611},
}
Figure