DeepFactors

Czarnowski 2020 · Paper

One-line summary — DeepFactors (RA-L 2020) turns CodeSLAM’s learned compact depth codes into the first real-time probabilistic dense monocular SLAM system, using photometric, reprojection, and sparse geometric errors simultaneously as factors in standard factor-graph software.

Problem

Monocular SLAM had fragmented along three axes: scene geometry representation (sparse landmarks vs dense maps), the consistency metric used to optimize the multi-view problem (photometric vs reprojection vs geometric), and whether learned priors are used. Sparse methods allow real-time joint probabilistic inference but yield maps useless for interaction; dense methods discard cross-correlations and alternate tracking/mapping; CodeSLAM proved the compact-code idea but “lacked features of full SLAM, was not capable of real-time performance and did not generalise to real handheld camera scenes”. DeepFactors unifies these paradigms “in a probabilistic framework while still maintaining real-time performance”.

Method & architecture

Each keyframe carries a pose variable pip_i and a code variable ci\mathbf{c}_i; depth decodes linearly from the code so factors never need costly relinearization:

Di=f(ci,Ii)=Di0+J(Ii)ci,D_i = f(\mathbf{c}_i, I_i) = D_i^0 + J(I_i)\,\mathbf{c}_i ,

where Di0D_i^0 is the zero-code depth and J(Ii)=Di/ciJ(I_i) = \partial D_i / \partial \mathbf{c}_i is an image-conditioned Jacobian. The network (U-Net feature extractor + linear-decoder VAE, plus an explicit code-prediction encoder for initialization and a per-pixel uncertainty bb) is trained on ~1.4M ScanNet images at 256×192 with code size 32.

Three pairwise consistency errors become factors, all built on the warp ωji(x,ci,Ii)=π(Tjiπ1(x,Di(x)))\omega_{ji}(\mathbf{x}, \mathbf{c}_i, I_i) = \pi(T_{ji}\,\pi^{-1}(\mathbf{x}, D_i(\mathbf{x}))) with TjiSE(3)T_{ji} \in SE(3):

ephoij=xΩiIi(x)Ij(ωji(x,ci,Ii))2(dense, direct)e_{pho}^{ij} = \sum_{\mathbf{x}\in\Omega_i} \| I_i(\mathbf{x}) - I_j(\omega_{ji}(\mathbf{x}, \mathbf{c}_i, I_i)) \|^2 \qquad \text{(dense, direct)}

erepij=(x,y)Mijωji(x,ci,Ii)y2(BRISK matches, Cauchy robust cost)e_{rep}^{ij} = \sum_{(\mathbf{x},\mathbf{y})\in M_{ij}} \| \omega_{ji}(\mathbf{x}, \mathbf{c}_i, I_i) - \mathbf{y} \|^2 \qquad \text{(BRISK matches, Cauchy robust cost)}

egeoij=xΩi[Tjiπ1(x,Di(x))]zDj(x^)2(depth consistency, Huber, sparse pixel samples)e_{geo}^{ij} = \sum_{\mathbf{x}\in\Omega_i} \| \left[ T_{ji}\,\pi^{-1}(\mathbf{x}, D_i(\mathbf{x})) \right]_z - D_j(\hat{\mathbf{x}}) \|^2 \qquad \text{(depth consistency, Huber, sparse pixel samples)}

Zero-code prior factors keep codes inside the VAE’s Gaussian latent region. The system flow: incoming frames are tracked against the nearest keyframe with a GPGPU SE(3) Lucas–Kanade aligner (~250 Hz); new keyframes are initialized from the code-prediction network and connected to the last N keyframes with pairwise factors; the whole map is optimized as a batch MAP problem with iSAM2’s incremental Bayes-tree updates (GTSAM). Lightweight “one-way” frames (no own depth) feed extra photometric evidence into the latest keyframe and are then marginalized out. Local loops (pose criteria within the last 10 keyframes) and global loops (bag-of-words + tracking verification, reprojection factors only) are closed online.

Results

Why it matters for SLAM

DeepFactors is the bridge between the latent-code mapping line (CodeSLAM) and mainstream factor-graph SLAM engineering: it showed learned dense geometry can live inside the same probabilistic back-end as classical constraints rather than in a bespoke optimizer. Practically, it demonstrated that combining direct, feature-based, and learned-prior cues makes dense monocular SLAM both more robust and uncertainty-aware — and its standard-factor-graph design makes adding other sensor modalities straightforward, a design philosophy echoed by later hybrid systems.