MapNet: Geometry-Aware Learning of Maps for Camera Localization

Samarth Brahmbhatt, Jinwei Gu, Kihwan Kim, James Hays, Jan Kautz

TL;DR

MapNet redefines camera localization by representing environmental maps as deep neural networks trained with geometric constraints. By fusing images with cheap, ubiquitous sensory inputs like visual odometry (VO) and GPS, MapNet enables self-supervised map updates using unlabeled video sequences and achieves state-of-the-art localization accuracy across both indoor and large-scale outdoor environments.

What Problem Does This Paper Address?

Traditional visual SLAM (Simultaneous Localization and Mapping) and image-based localization methods rely heavily on hand-crafted map representations, such as 3D point clouds, lines, planes, or bags of visual words. These representations are highly application-specific and brittle; a map designed for a texture-rich indoor room will fail in a featureless outdoor corridor. Furthermore, updating these maps as new data arrives is computationally cumbersome.

While recent deep learning approaches (like PoseNet) bypass hand-crafted features by directly regressing 6-DoF camera poses from single images, they suffer from a major flaw: they treat images independently. By ignoring the sequential, geometric constraints between consecutive video frames, these networks produce noisy, globally inconsistent trajectories and cannot easily incorporate unlabeled data.

Methods

The authors introduce MapNet, a geometry-aware framework that forces a deep neural network to learn the underlying structure of a scene.

Figure 2: Left: MapNet learns a general map representation directly from input data, including images, visual odometry (VO), and other sensory inputs. Right: Data flow for our proposed algorithms. MapNet enforces geometric constraints between relative poses and absolute poses in network training. MapNet+ fuses other inputs such as visual odometry to update maps with self-supervised learning. MapNet+PGO performs PGO at testing time to further improve accuracy.

Key methodological innovations include:

  • Geometry-Aware Loss Function: Unlike standard pose-regression networks that only minimize absolute pose errors, MapNet minimizes a joint loss function. It enforces consistency between pairs of frames by penalizing deviations from relative pose constraints (derived from visual odometry or ground truth).
  • Log-Quaternion Rotation Parameterization: Deep networks struggle to regress standard 4D unit quaternions because the required normalization step disrupts optimization. MapNet parameterizes camera rotation using the 3D logarithm of a unit quaternion ($\log q$). This avoids over-parameterization and wrapping issues (like Euler angles), allowing direct $L_1$ or $L_2$ optimization.
  • Self-Supervised Updates (MapNet+): To exploit unlabeled video sequences, MapNet+ fine-tunes a pre-trained model by minimizing the discrepancy between the network's predicted relative poses and the relative poses estimated by an off-the-shelf VO algorithm or raw GPS data.
  • Real-Time Smoothing (MapNet+PGO): At inference time, the system fuses the drift-free (but locally noisy) absolute pose predictions from the neural network with locally smooth (but drifty) visual odometry using a moving-window Pose Graph Optimization (PGO).

Datasets

The approach was validated on two widely recognized benchmarks:

  1. 7-Scenes Dataset: A small-scale, indoor RGB-D dataset featuring seven distinct environments (e.g., Chess, Office, Red Kitchen) captured via a Kinect sensor. Poses are tracked using KinectFusion.
  2. Oxford RobotCar Dataset: A large-scale, challenging outdoor autonomous driving dataset. The authors extracted two subsets: a LOOP route (1,120 meters long) and a massive FULL route (9,562 meters long), capturing diverse weather conditions, traffic, and lighting variations.

Key Insights and Ideas

  • Enforcing Geometry Forces Semantic Spatial Awareness: By visualizing the network's internal feature space using Multi-Dimensional Scaling (MDS), the authors discovered that PoseNet features do not naturally correlate with the true spatial layout of a scene. In contrast, MapNet’s geometry-aware loss forces the network to learn a feature space that beautifully maps to the physical trajectory.
Figure 3: 2D multi-dimensional scaling (MDS) of penultimate layer features for various models trained on the LOOP sequence from Oxford RobotCar [40]. Input images are from a held-out test sequence (see Fig. 1 for ground-truth camera poses). The points are chronologically colored. Features learned by PoseNet do not correlate with the distribution of ground truth camera poses, while those learned by MapNet and MapNet+ show successively better correlation with the ground truth camera poses (see Fig. 5).
  • Unlabeled Data is a First-Class Citizen: MapNet+ proves that cheap, imperfect sensors (like noisy visual odometry or sparse GPS) can act as effective self-supervised labels. As more unlabeled video sequences are fed into MapNet+, localization performance consistently improves, offering a scalable path for autonomous fleets to improve their maps over time.

Key Results

  • Indoor Performance (7-Scenes): MapNet+PGO achieved an average median translation error of 0.18 meters and a rotation error of 6.55° across all scenes, outperforming the baseline PoseNet (0.23m, 8.12°) and traditional Direct Sparse Odometry (DSO) which suffered from catastrophic drift on several sequences.
  • Outdoor Performance (Oxford RobotCar): On the 9.5 km FULL route, MapNet dramatically outperformed the baselines.
Localization performance comparison on the 9.5km FULL Oxford RobotCar route.

As shown above, standard Stereo VO drifted severely, accumulating a mean translation error of 222.0 meters. PoseNet achieved 125.6 meters. MapNet+PGO slashed this error down to just 29.5 meters, demonstrating its viability for long-range autonomous driving localization.

Limitations and Future Work

  • Inability to Explore Unknown Spaces: Unlike traditional SLAM systems that dynamically expand a point cloud map into unmapped territory, MapNet is bounded by its training data. It cannot localize in or map completely novel environments without a prior training phase.
  • Sensitivity to Extreme Visual Artifacts: The authors noted occasional outlier predictions, which typically occurred in images containing severe over-exposure (e.g., direct sunlight glare) or when the camera view was entirely blocked by large moving objects like trucks.
  • Future Directions: The authors suggest exploring a tighter integration with traditional SLAM frameworks to handle unknown regions, as well as incorporating high-level semantic scene composition (object-level context) to make the network even more robust to environmental changes.

Summary updated

BibTeX
@inproceedings{brahmbhatt2018mapnet,
  author = {Samarth Brahmbhatt and Jinwei Gu and Kihwan Kim and James Hays and Jan Kautz},
  title = {{MapNet: Geometry-Aware Learning of Maps for Camera Localization}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  doi = {10.1109/cvpr.2018.00277},
}
Figure