A Generative Map for Image-based Camera Localization

Mingpan Guo, Stefan Matthes, Jiaojiao Ye, Hao ShenarXiv 2019

Abstract

In image-based camera localization systems, information about the environment is usually stored in some representation, which can be referred to as a map. Conventionally, most maps are built upon hand-crafted features. Recently, neural networks have attracted attention as a data-driven map representation, and have shown promising results in visual localization. However, these neural network maps are generally hard to interpret by human. A readable map is not only accessible to humans, but also provides a way to be verified when the ground truth pose is unavailable. To tackle this problem, we propose Generative Map, a new framework for learning human-readable neural network maps, by combining a generative model with the Kalman filter, which also allows it to incorporate additional sensor information such as stereo visual odometry. For evaluation, we use real world images from the 7-Scenes and Oxford RobotCar datasets. We demonstrate that our Generative Map can be queried with a pose of interest from the test sequence to predict an image, which closely resembles the true scene. For localization, we show that Generative Map achieves comparable performance with current regression models. Moreover, our framework is trained completely from scratch, unlike regression models which rely on large ImageNet pretrained networks.

Introduction

Image-based camera localization—determining a camera's precise 6-DoF pose from a single image—is a fundamental task for autonomous driving and augmented reality. Traditional approaches rely on geometric maps like point clouds, which are interpretable but often brittle. Conversely, modern deep learning models like PoseNet achieve high accuracy by directly regressing poses from images. However, these neural network "maps" are essentially black boxes; their internal weights do not offer a human-interpretable view of the environment. This lack of transparency makes it difficult to verify map accuracy or diagnose failures in the absence of ground truth.

This paper introduces the Generative Map, a framework that bridges the gap between data-driven neural networks and interpretable geometric representations. By learning to generate images from poses, the system creates a map that can be visually queried and verified by humans.

Methodology

The core innovation of the Generative Map is inverting the standard localization problem. Instead of only learning a direct mapping from Image to Pose, the framework learns the generative process: Pose → Image.

Architecture

The system comprises three primary neural components:

  1. Image Encoder ($q(z|I)$): Compresses an input image into a low-dimensional latent representation ($z$).
  2. Pose Encoder ($p(z|p)$): Maps a 6-DoF camera pose into the same latent space ($z$).
  3. Image Decoder ($p(I|z)$): Reconstructs an image from the latent code.
The Generative Map architecture, showing the relationship between image, pose, and latent space.

Training and Localization

The model is trained using a modified Variational Auto-Encoder (VAE) objective that encourages the latent codes from the image and pose encoders to be consistent. This ensures the latent space captures the geometric relationship between viewpoints and scene appearance.

For localization, since the generative model does not output a pose directly, the authors integrate a Kalman filter. The camera pose is treated as the state, and the latent code from the image encoder serves as the observation. This probabilistic framework allows the system to incorporate temporal constraints and fuse external sensor data, such as Visual Odometry (VO), to stabilize pose estimation.

Evaluation and Results

The framework was evaluated on two benchmark datasets: 7-Scenes (indoor environments with motion blur and repetitive textures) and Oxford RobotCar (large-scale outdoor urban driving).

Localization Performance

Generative Map achieves localization accuracy comparable to state-of-the-art regression models like PoseNet. On the 7-Scenes dataset, it reached a median error of approximately 0.35m and 11°. In the RobotCar experiments, the integration of Visual Odometry via the Kalman filter significantly improved trajectory stability compared to pure VO, which tends to drift over long distances.

Visual Interpretability

The most significant advantage of this approach is its interpretability. By feeding a specific coordinate into the Pose Encoder and Decoder, the network generates a synthetic image of that location.

Comparison between real images (top) and images generated from the map (bottom) for an office scene.

As shown in the results, the generated images successfully capture the layout and key features of the environment, such as desks and stairs. This allows for visual verification of the robot's internal world model.

Discussion and Conclusion

The Generative Map offers several key insights:

  • Human-Readable Maps: The ability to "query" the map visually provides a layer of transparency missing in standard deep localization models.
  • Training from Scratch: Unlike many regressors that require ImageNet pre-training, the generative task provides sufficient supervision to learn robust features from scratch.
  • Robustness: The model acts as a natural filter; even when trained on noisy or overexposed images, the map learns the underlying scene structure.

While promising, the approach currently faces challenges in computational overhead due to the Kalman filter's Jacobian calculations and scalability to city-scale environments. Future work will explore hybrid models that combine generative interpretability with the speed of regression, and extending the framework to full Simultaneous Localization and Mapping (SLAM).

Summary updated

BibTeX
@misc{guo2019generative,
  author = {Mingpan Guo and Stefan Matthes and Jiaojiao Ye and Hao Shen},
  title = {{A Generative Map for Image-based Camera Localization}},
  year = {2019},
  eprint = {1902.11124},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1902.11124},
}
Figure