BA-Net

Tang 2019 · Paper

One-line summary — BA-Net (ICLR 2019) made bundle adjustment a differentiable network layer, solving dense SfM via feature-metric BA with a learned feature pyramid and a compact basis-depth-map parameterization, trained end-to-end.

Problem

Traditional SfM pipelines are modular — feature extraction, matching, and bundle adjustment are designed and optimized independently — so the features are never optimized for the geometric estimation they serve. Geometric BA uses only corners/blobs and suffers from matching outliers; photometric (direct) BA uses all pixels but its objective is highly non-convex, so it is sensitive to initialization, exposure changes, and moving objects. The obstacle to unifying learning and BA is that BA is an iterative Levenberg–Marquardt (LM) procedure with two non-differentiable if-else decisions: the convergence-threshold termination and the raise/lower update of the damping factor λ\lambda. BA-Net asks: can dense SfM be solved through a differentiable BA layer, so gradients from the reconstruction loss train the features themselves?

Method & architecture

The network takes multiple images and outputs camera poses T\mathbb{T} and a dense depth map D\mathbb{D}; a shared DRN-54 backbone feeds two heads, whose outputs meet in the BA-Layer.

ei,jf(X)=Fi(π(Ti,djqj))F1(qj),e^{f}_{i,j}(\mathcal{X}) = F_i\big(\pi(\mathbf{T}_i,\, d_j \cdot \mathbf{q}_j)\big) - F_1(\mathbf{q}_j),

where π\pi projects 3D points to the image, qj\mathbf{q}_j is a normalized pixel in image I1I_1 with depth djd_j, and Ti\mathbf{T}_i the pose of image IiI_i. Trained through BA, the learned features develop a clear global minimum with a smooth basin (unlike RGB distance or pretrained-classification features), enlarging the convergence radius.

D=ReLU(wB),\mathbb{D} = \mathrm{ReLU}(\mathbf{w}^{\top}\mathbf{B}),

so BA optimizes only the combination weights w\mathbf{w} (with a learned initial w0\mathbf{w}_0), while ReLU keeps depth non-negative and dense per-pixel depth is still recovered.

ΔX=(J(X)J(X)+λD(X))1J(X)E(X).\Delta\mathcal{X} = \big(J(\mathcal{X})^{\top}J(\mathcal{X}) + \lambda D(\mathcal{X})\big)^{-1} J(\mathcal{X})^{\top} E(\mathcal{X}).

The two non-differentiable decisions are removed by (i) fixing the iteration count (“incomplete optimization”: 5 LM iterations per pyramid level, coarse-to-fine over 3 levels = 15 total, with feature warping each iteration), and (ii) predicting λ\lambda with an MLP: global average pooling of E(X)|E(\mathcal{X})| over pixels gives a 128-D vector fed to four FC layers with ReLU. Each step is then a differentiable function ΔX=g(X;F)\Delta\mathcal{X} = g(\mathcal{X}; \mathbb{F}), and the solution update Xk=g(Xk1;F)Xk1\mathcal{X}_k = g(\mathcal{X}_{k-1};\mathbb{F}) \circ \mathcal{X}_{k-1} (addition for depth weights, SE(3) exponential map for poses) backpropagates from poses/depth to the feature pyramids. Poses are initialized to identity rotation and zero translation.

Results

Why it matters for SLAM

BA-Net is the founding paper of “differentiable bundle adjustment”: it demonstrated that the classical geometric optimization at the heart of SfM/SLAM can live inside a network and be trained through, hard-coding multi-view geometry as structure while learning only what geometry cannot supply (features and depth basis). This recipe became the backbone of DROID-SLAM and DPVO (differentiable dense BA layers) and general differentiable optimization libraries like Theseus, and the low-dimensional optimizable-depth idea is closely related to CodeSLAM-style latent depth codes. If you want to understand modern learned SLAM back-ends, start here.