Differentiability

To train a neural network you need gradients flowing from the loss back to the parameters. But classical SLAM is full of operations that block gradients: RANSAC makes a discrete hypothesis selection (argmax), keypoint detection applies non-maximum suppression and top-kk selection, and optimization solvers like bundle adjustment are iterative procedures rather than closed-form functions. Differentiability research asks: how do we make these classical geometric algorithms differentiable, so a network can be trained through them — optimizing for the final pose or map quality rather than for some proxy label?

Why classical SLAM blocks gradients

Consider the standard relocalization pipeline: a network predicts 2D-3D correspondences, RANSAC samples minimal sets, PnP solves each hypothesis, an inlier count scores them, and the argmax hypothesis wins. Three of those steps are non-differentiable:

If any link in the chain kills gradients, everything upstream of it must be trained with proxy losses (imitate ground-truth depth, imitate hand-labeled matches) that may not align with what the system is supposed to do.

The main techniques

Each technique is attached to a landmark system, so you can study them concretely:

The payoff: task-level training

The point of all this machinery is task-level training: instead of teaching a network to imitate ground-truth depth or hand-labeled matches, you train it so that, after RANSAC/PnP/BA does its job, the final camera pose is accurate. The training objective and the system objective become the same thing. This alignment is why differentiable-geometry systems (the DSAC-to-ACE relocalization line, DROID-SLAM) generalize better than naive end-to-end pose regression like PoseNet — the geometry is still enforced by an exact solver; the network only learns the parts that benefit from learning.

A second payoff is self-supervision: with a differentiable projection and solver, a reprojection loss through known camera poses can replace 3D ground truth entirely — the trick that DSAC++ introduced and that the ACE family relies on for minutes-scale mapping.

Common pitfalls

Much of the engineering in this literature is about managing exactly these issues.

Why it matters for SLAM

Differentiability is the bridge between the two halves of Level 5: it lets learned front-ends be trained with the geometric back-end in the loop, producing hybrid systems that keep the rigor of classical optimization while learning everything around it. Understanding soft selection, solver unrolling, and Lie-group autodiff will let you read papers from DSAC to DROID-SLAM as variations on one idea.