GradSLAM

Murthy 2020 · Paper

One-line summary — A PyTorch framework that poses dense SLAM as a fully differentiable computational graph — smooth reparameterizations of trust-region optimization, surface measurement, fusion, and raycasting — so gradients can flow end-to-end from 3D maps back to 2D pixels.

Problem

Blending representation learning with SLAM is an open question because SLAM systems are highly modular and complex. Functionally, SLAM transforms raw sensor inputs into a distribution over the states of the robot and the environment — if that map M=GSLAM(s)\mathcal{M}=\mathcal{G}_{SLAM}(s) were differentiable, the gradient sM\nabla_{s}\mathcal{M} would answer “how much does a specific pixel measurement contribute to the resulting 3D map?”, and task-based error signals could train representations end-to-end. But several components of dense SLAM are non-differentiable or have gradients that are zero almost everywhere: LM solvers make discrete damp/undamp decisions, mapping involves clipping/indexing/thresholding and hard new-vs-existing element decisions, and raycasting marches discretely along rays.

Method & architecture

GradSLAM replaces each non-smooth block with an as-exact-as-possible differentiable counterpart, then composes them into full pipelines.

Differentiable LM (\nablaLM). For objectives 12r(x)2\frac{1}{2}\sum r(x)^{2}, an LM step must decide between damping and undamping by comparing error norms r0=r(x0)Tr(x0)r_{0}=r(x_{0})^{T}r(x_{0}) and r1=r(x1)Tr(x1)r_{1}=r(x_{1})^{T}r(x_{1}) at the current and lookahead iterates. GradSLAM replaces the discrete switch with smooth gating functions built on the generalized logistic function:

λ1=Qλ(r0,r1)=λmin+λmaxλmin1+Deσ(r1r0),Qx(r0,r1)=x0+δx01+e(r1r0),\lambda_{1}=Q_{\lambda}(r_{0},r_{1})=\lambda_{min}+\frac{\lambda_{max}-\lambda_{min}}{1+De^{-\sigma(r_{1}-r_{0})}},\qquad Q_{x}(r_{0},r_{1})=x_{0}+\frac{\delta x_{0}}{1+e^{-(r_{1}-r_{0})}},

where D,σD,\sigma control the falloff and [λmin,λmax][\lambda_{min},\lambda_{max}] bounds the damping — the whole optimizer becomes one differentiable graph.

Differentiable mapping and fusion. Surface measurement is smoothed three ways: each valid pixel’s measurement is a kernel function K(p,nbd(p))K(p, nbd(p)) of its neighborhood (bilinear in 2D); the association of a live measurement to map elements is soft, spreading over closest candidates with a depth-sensor-motivated Gaussian falloff exp(r(P)2/2σ2)\exp(-r(P)^{2}/2\sigma^{2}) where r(P)r(P) is radial depth from the camera ray; and every measurement is by default a new element handed to a differentiable fusion step. Fusion (which keeps map size proportional to explored volume, not time) uses a logistic falloff to smooth the abrupt truncation thresholds of classic weighted-averaging schemes.

Differentiable raycasting. Rays pool over all voxels they pierce with a Gaussian falloff centered at the pixel’s depth measurement; ray derivatives w.r.t. pixel position use Igehy-style finite differences over neighboring rays, vc/pc((vrvl)/2,  (vuvd)/2)T\partial v_{c}/\partial p_{c}\approx\big((v_{r}-v_{l})/2,\;(v_{u}-v_{d})/2\big)^{T}.

Case studies. Three classic dense systems are recomposed from these blocks: \nablaKinectFusion (TSDF volume; the truncated SDF sdf(p)=trunc(K1x21tp2depth(x))sdf(p)=trunc(\lVert K^{-1}x\rVert_{2}^{-1}\lVert t-p\rVert_{2}-depth(x)) gets a smooth logistic truncation, since both the floor operator in x=π(Kp)x=\lfloor\pi(Kp)\rfloor and hard truncation at μ\mu block gradients), \nablaPointFusion (surfel map with the paper’s soft-association mapping and PointFusion’s fusion rules), and \nablaICP-SLAM (frame-to-frame ICP-Odometry and frame-to-model variants). All run fully on GPU and expose gradients w.r.t. any intermediate variable — camera poses, pixel intensities/depths, optimizer parameters, camera intrinsics.

Results

Why it matters for SLAM

GradSLAM was the first general differentiable SLAM framework, turning “SLAM as a layer” from a slogan into runnable research code. It sits in the same movement as BA-Net, Theseus, and LieTorch — embedding geometric optimization inside networks — and it opened the door to training perception modules (depth priors, sensor noise models, cost functions) with supervision that comes from downstream mapping quality rather than per-frame labels. The open-source PyTorch library remains a common starting point for differentiable robot perception research.