Abstract
Blending representation learning approaches with simultaneous localization and mapping (SLAM) systems is an open question, because of their highly modular and complex nature. Functionally, SLAM is an operation that transforms raw sensor inputs into a distribution over the state(s) of the robot and the environment. If this transformation (SLAM) were expressible as a differentiable function, we could leverage task-based error signals to learn representations that optimize task performance. However, several components of a typical dense SLAM system are non-differentiable. In this work, we propose gradSLAM, a methodology for posing SLAM systems as differentiable computational graphs, which unifies gradient-based learning and SLAM. We propose differentiable trust-region optimizers, surface measurement and fusion schemes, and raycasting, without sacrificing accuracy. This amalgamation of dense SLAM with computational graphs enables us to backprop all the way from 3D maps to 2D pixels, opening up new possibilities in gradient-based learning for SLAM. TL;DR: We leverage the power of automatic differentiation frameworks to make dense SLAM differentiable.
Introduction
Simultaneous Localization and Mapping (SLAM) is a fundamental capability for autonomous agents, yet it has remained largely isolated from the revolution in gradient-based deep learning. Traditional SLAM pipelines are composed of numerous non-differentiable components—discrete branching logic in optimizers, hard data associations during mapping, and non-differentiable ray-marching—which act as "gradient killers." This lack of differentiability prevents the end-to-end optimization of internal representations (such as depth or feature maps) based on the final quality of the 3D reconstruction.
gradSLAM addresses this gap by transforming traditional dense SLAM pipelines into fully differentiable computational graphs. By replacing non-differentiable operations with smooth, differentiable alternatives, it enables gradient flow from 3D maps back to 2D pixels, allowing SLAM systems to be integrated directly as layers within modern deep learning frameworks like PyTorch.
Methodology
The core innovation of gradSLAM is the realization of SLAM as a computational graph. This requires the development of differentiable versions of several key SLAM components:
- Differentiable Levenberg-Marquardt ($\nabla$LM): Standard LM optimizers use discrete logic to decide whether to damp or undamp the system. gradSLAM replaces this with smooth gating functions based on generalized logistic functions, allowing gradients to flow through the optimization steps.
- Differentiable Mapping: Instead of hard associations between pixels and map elements, gradSLAM employs soft associations. This allows a surface measurement to contribute to multiple map elements based on a falloff function, ensuring differentiability during the fusion process.
- Differentiable Raycasting: Standard ray-marching is non-differentiable at surface boundaries. gradSLAM utilizes ray differentials and a Gaussian pooling strategy to approximate the derivative of the ray potential with respect to the pixel neighborhood.
Experiments and Results
The authors evaluated gradSLAM across several standard benchmarks, including ICL-NUIM, TUM RGB-D, and ScanNet, as well as real-world data captured with an Intel RealSense D435.
Performance Parity
A key finding is that the differentiable versions of KinectFusion, PointFusion, and ICP-SLAM perform nearly identically to their non-differentiable counterparts. For instance, $\nabla$ICP-Odometry achieved an Absolute Trajectory Error (ATE) of 0.0166m, compared to 0.029m for the non-differentiable baseline. This demonstrates that the smooth approximations introduced for differentiability do not sacrifice the accuracy of classical SLAM.
Gradient Analysis and Applications
The differentiability of the system allows for novel analyses, such as identifying which specific pixels contribute to reconstruction artifacts. The authors also demonstrated a "depth completion" application, where a neural network could minimize a 3D reconstruction loss via gradient descent to fill in holes in noisy depth maps.
Discussion and Conclusion
gradSLAM provides a unified library for differentiable SLAM, supporting multiple paradigms including voxel-based (KinectFusion), surfel-based (PointFusion), and point-cloud-based (ICP-SLAM) systems. While the current implementation faces challenges regarding memory overhead and computational speed compared to optimized C++ baselines, it opens the door to "task-driven SLAM."
By enabling backpropagation through the entire SLAM pipeline, researchers can now optimize SLAM front-ends specifically for downstream tasks like semantic segmentation or reinforcement learning-based navigation. Future work will focus on improving memory efficiency and incorporating robust kernels in a differentiable form to further enhance the system's utility in complex, real-world environments.
Summary updated