CodeSLAM - Learning a Compact, Optimisable Representation for Dense Visual SLAM

Michael Bloesch, Jan Czarnowski, Ronald Clark, Stefan Leutenegger, Andrew J. Davison

Abstract

The representation of geometry in real-time 3D perception systems continues to be a critical research issue. Dense maps capture complete surface shape and can be augmented with semantic labels, but their high dimensionality makes them computationally costly to store and process, and unsuitable for rigorous probabilistic inference. Sparse feature-based representations avoid these problems, but capture only partial scene information and are mainly useful for localisation only. We present a new compact but dense representation of scene geometry which is conditioned on the intensity data from a single image and generated from a code consisting of a small number of parameters. We are inspired by work both on learned depth from images, and auto-encoders. Our approach is suitable for use in a keyframe-based monocular dense SLAM system: While each keyframe with a code can produce a depth map, the code can be optimised efficiently jointly with pose variables and together with the codes of overlapping keyframes to attain global consistency. Conditioning the depth map on the image allows the code to only represent aspects of the local geometry which cannot directly be predicted from the image. We explain how to learn our code representation, and demonstrate its advantageous properties in monocular SLAM.

Introduction

In the field of Visual SLAM (Simultaneous Localization and Mapping), researchers have traditionally faced a trade-off between sparse and dense representations. Sparse SLAM tracks a limited number of points, allowing for efficient probabilistic optimization of camera poses and landmarks, but fails to provide complete surface information. Conversely, dense SLAM maps every pixel, offering rich environmental data at the cost of massive dimensionality. Optimizing millions of depth values alongside camera poses is computationally staggering, often forcing systems to sacrifice global consistency for real-time performance.

CodeSLAM addresses this "curse of dimensionality" by introducing a compact representation that is dense enough to describe surfaces but small enough to be optimized in real-time. By leveraging learned geometric priors, the system enables joint optimization of structure and motion, a capability previously reserved for sparse systems.

Methodology: Intensity Conditioned Depth Auto-Encoding

The core of the proposed approach is a Variational Auto-Encoder (VAE) architecture designed to compress dense geometry into a low-dimensional "code."

The CodeSLAM network architecture: A U-Net extracts image features to condition a depth auto-encoder, compressing geometry into a 128-dimensional code.

Conditioning and Optimization

A key innovation is conditioning the depth decoder on the intensity image. A U-Net processes the input image to extract high-level features, which are then used by the decoder alongside the geometric code. This allows the code to represent only the geometric details that cannot be predicted directly from the image (e.g., the exact distance to a flat wall). The authors found that a vector of just 128 parameters is sufficient to reconstruct high-quality depth maps from $256 \times 192$ images.

Because the geometry is defined by this small code, it can be treated as a variable in a Gauss-Newton optimizer. During the mapping phase, the system minimizes both photometric and geometric errors by simultaneously adjusting camera poses and the codes of multiple keyframes, ensuring global consistency across the map.

Experimental Results

The system was trained on the SceneNet RGB-D dataset and validated on real-world data from the EuRoC MAV and NYU V2 datasets.

Reconstruction and Compression

CodeSLAM achieves a massive reduction in dimensionality, representing nearly 50,000 pixels with just 128 parameters. As shown in the comparison below, the reconstructed depth maps closely approximate ground truth while maintaining surface continuity and capturing essential scene structures.

Comparison between reconstructed depth from a compact code and the ground truth.

SLAM Performance

  • Real-Time Operation: The mapping system achieves an update rate of 5 Hz in a 4-keyframe setup, suitable for real-time robotics.
  • Refinement over Time: Root Mean Square Error (RMSE) of depth estimates consistently drops as more overlapping frames are integrated into the joint optimization (e.g., from $2.65 \times 10^{-2}$ with one frame to $2.14 \times 10^{-2}$ with six frames).
  • Generalization: Despite being trained on synthetic data, the model generalizes well to real-world industrial environments (EuRoC) and standard indoor scenes (NYU V2).

Conclusion

CodeSLAM demonstrates that a compact, learned representation can enable dense, globally consistent monocular SLAM. By conditioning geometry on image intensity, the system reduces the optimization space to a manageable size for real-time robotics. While current implementations face bottlenecks in image warping, the approach offers a path toward robust, real-time dense mapping with probabilistic uncertainty estimation. Future work will focus on improving computational efficiency and integrating semantic labels directly into the geometric code space.

Summary updated

BibTeX
@inproceedings{bloesch2018codeslam,
  author = {Michael Bloesch and Jan Czarnowski and Ronald Clark and Stefan Leutenegger and Andrew J. Davison},
  title = {{CodeSLAM - Learning a Compact, Optimisable Representation for Dense Visual SLAM}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  url = {https://openreview.net/forum?id=ry-vU6bdWS},
}
Figure