Learning models for visual 3D localization with implicit mapping

Dan Rosenbaum, Frederic Besse, Fabio Viola, Danilo J. Rezende, S. M. Ali EslamiarXiv 2018

Abstract

We consider learning based methods for visual localization that do not require the construction of explicit maps in the form of point clouds or voxels. The goal is to learn an implicit representation of the environment at a higher, more abstract level. We propose to use a generative approach based on Generative Query Networks (GQNs), asking the following questions: 1) Can GQN capture more complex scenes than those it was originally demonstrated on? 2) Can GQN be used for localization in those scenes? To study this approach we consider procedurally generated Minecraft worlds, for which we can generate images of complex 3D scenes along with camera pose coordinates. We first show that GQNs, enhanced with a novel attention mechanism can capture the structure of 3D scenes in Minecraft, as evidenced by their samples. We then apply the models to the localization problem, comparing the results to a discriminative baseline, and comparing the ways each approach captures the task uncertainty.

Introduction

Traditional visual localization and Simultaneous Localization and Mapping (SLAM) systems rely heavily on hand-engineered features and explicit map structures like 3D point clouds. While discriminative machine learning models (e.g., PoseNet) have been developed to predict camera poses directly from images, they often lack the robust uncertainty reasoning inherent in traditional generative methods. This research explores bridging that gap by building a generative neural network that learns an implicit, abstract map of a complex 3D scene to perform accurate localization.

Methods: Generative Query Networks with Attention

The core of this approach is the Generative Query Network (GQN). A standard GQN takes "context" images and their corresponding camera poses to generate a new image from a queried target pose. However, standard GQNs struggle with visually complex environments because they compress the entire scene into a single vector.

To address this, we introduce a sequential patch-based attention mechanism. Instead of a single vector, the model stores patches from context images in a dictionary. The generation network uses soft attention to pull relevant features layer-by-layer based on the queried pose.

The GQN localization framework: context images and target pose visualization.

For localization, we utilize Maximum a Posteriori (MAP) inference. By freezing the target image and running an optimization loop, we find the camera pose that maximizes the likelihood of the model generating that specific image. This is compared against a discriminative baseline—a "reversed-GQN"—which outputs a probability distribution over the target camera pose in a single forward pass.

The Minecraft Dataset

To test these models, we introduced a custom dataset generated in Minecraft using the Malmo platform. This dataset contains 6,000 sequences of 100 images each, paired with 5D camera poses (x, y, z, yaw, pitch). Minecraft provides a visually rich environment with complex 3D structures like mountains and trees, serving as an ideal intermediate step between simple geometric shapes and photorealistic real-world data.

Diverse visual environments in the Minecraft dataset showing various biomes and structures.

Key Insights and Results

Our experiments yielded several critical findings regarding the behavior of implicit mapping models:

  1. Attention Mimics Traditional SLAM: The learned attention mechanism naturally focuses on sparse, high-contrast areas like horizons or tree edges, effectively learning feature extraction and pruning organically.
  2. Generative vs. Discriminative Priors: Discriminative models tend to learn the spatial priors of the dataset (e.g., assuming target images are near context images). Generative models, by modeling the likelihood of the image given the pose, avoid this bias and correctly assign probability to unexplored areas.
  3. Accuracy: The generative model with attention achieved superior point estimate accuracy (MSE of 0.07 for x,y position) compared to the discriminative baseline (MSE of 0.09).
  4. Scaling: Qualitatively, the generative model successfully rendered novel views of complex Minecraft scenes, demonstrating that GQNs can scale beyond simple geometric rooms.

Conclusion and Future Work

While the generative approach offers superior accuracy and unbiased uncertainty modeling, it is limited by inference speed, as localization requires an optimization loop at test time. Future work may involve combining these approaches—using fast discriminative models to generate proposal distributions that are then refined by the generative model—to achieve both speed and precision in 3D localization.

Summary updated

BibTeX
@misc{rosenbaum2018learning,
  author = {Dan Rosenbaum and Frederic Besse and Fabio Viola and Danilo J. Rezende and S. M. Ali Eslami},
  title = {{Learning models for visual 3D localization with implicit mapping}},
  year = {2018},
  eprint = {1807.03149},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1807.03149},
}
Figure