DSAC*

Brachmann 2021 · Paper

One-line summary — The consolidated TPAMI version of the DSAC line: one unified scene-coordinate-regression framework for visual relocalization from RGB or RGB-D images, with substantially improved training stability and efficiency.

Problem

By 2020 the DSAC line had accumulated separate recipes for different settings — RGB vs RGB-D input, training with vs without a 3D scene model — each with its own initialization stages and stability caveats. DSAC* consolidates these variants into a single, reliable framework, so that scene coordinate regression can be applied uniformly across input modalities and supervision regimes.

Method & architecture

Scene coordinate regression + robust pose solving. A fully convolutional network ff maps a grayscale image II to dense scene coordinates Y=f(I;w)\mathcal{Y}=f(I;\mathbf{w}) — the 3D point in scene space observed by each pixel, related to camera-space points by yi=hei\mathbf{y}_i = \mathbf{h}\mathbf{e}_i. The output is subsampled 8x, each prediction has an 81 px receptive field, and the map is the 28 MB of network weights. Pose optimization is classical RANSAC: sample M=64M{=}64 hypotheses with a minimal solver hj=g(Cj)\mathbf{h}_j = g(\mathcal{C}_j) — a P3P/PnP solver on 2D-3D correspondences for RGB (residual rRGB(yi,h)=piKh1yir^{\text{RGB}}(\mathbf{y}_i,\mathbf{h}) = ||\mathbf{p}_i - K\mathbf{h}^{-1}\mathbf{y}_i||), or the Kabsch solver on 3D-3D correspondences for RGB-D (rRGB-D(yi,h)=eih1yir^{\text{RGB-D}}(\mathbf{y}_i,\mathbf{h}) = ||\mathbf{e}_i - \mathbf{h}^{-1}\mathbf{y}_i||) — then choose the hypothesis with maximal inlier count s(h,Y)=yiY1[r(yi,h)<τ]s(\mathbf{h},\mathcal{Y})=\sum_{\mathbf{y}_i\in\mathcal{Y}}\mathbf{1}[\,r(\mathbf{y}_i,\mathbf{h})<\tau\,] (τ=10\tau{=}10 px RGB / 10 cm RGB-D) and refine it iteratively on its inliers (Levenberg-Marquardt PnP or Kabsch).

One initialization objective for three settings. DSAC* trains in any of: RGB-D; RGB + 3D model (rendered ground-truth coordinates yi\mathbf{y}^*_i); or RGB only. The unified per-pixel loss switches dynamically per pixel from 3D distance to reprojection error once a prediction becomes valid:

RGB+M(yi,yi,h)={r^RGB(yi,h)if yiVyiyiotherwise,\ell^{\text{RGB+M}}(\mathbf{y}_{i},\mathbf{y}^{*}_{i},\mathbf{h}^{*})=\begin{cases}\hat{r}^{\text{RGB}}(\mathbf{y}_{i},\mathbf{h}^{*})&\text{if }\mathbf{y}_{i}\in\mathcal{V}\\ ||\mathbf{y}^{*}_{i}-\mathbf{y}_{i}||&\text{otherwise},\end{cases}

where r^RGB\hat{r}^{\text{RGB}} soft-clamps the reprojection error (square root beyond 100 px). Without a 3D model, yi\mathbf{y}^*_i is replaced by heuristic targets yˉi=heˉi\bar{\mathbf{y}}_i = \mathbf{h}^*\bar{\mathbf{e}}_i hallucinated at constant 10 m depth. This replaces DSAC++‘s two wasteful separate initialization stages, halving pre-training from 4 to 2 days.

End-to-end training through differentiable RANSAC. The whole pipeline is then trained on the pose loss Pose(h^,h)=t^t+γ(θ^,θ)\ell^{\text{Pose}}(\hat{\mathbf{h}},\mathbf{h}^{*})=||\hat{\mathbf{t}}-\mathbf{t}^{*}||+\gamma\measuredangle(\hat{\bm{\theta}},\bm{\theta}^{*}) with γ=100\gamma{=}100. Every component is made differentiable: Kabsch via SVD gradients; PnP via analytical gradients of the last Gauss-Newton iteration, Yh(Y)Jr+YrI(Y,ht=)\frac{\partial}{\partial\mathcal{Y}}\mathbf{h}(\mathcal{Y})\approx-J_{\mathbf{r}}^{+}\frac{\partial}{\partial\mathcal{Y}}\mathbf{r}_{\mathcal{I}}(\mathcal{Y},\mathbf{h}^{t=\infty}); inlier counting via a sigmoid relaxation s(h,Y)=iσ[βτβr(yi,h)]s(\mathbf{h},\mathcal{Y})=\sum_{i}\sigma[\beta\tau-\beta r(\mathbf{y}_{i},\mathbf{h})] with β=5/τ\beta = 5/\tau; and hypothesis selection via DSAC — sampling jp(jY)j\sim p(j|\mathcal{Y}) from a softmax over scores and minimizing the expected pose loss

LPose(Y,h)=Ejp(jY)[^Pose(R(),h)],\mathcal{L}^{\text{Pose}}(\mathcal{Y},\mathbf{h}^{*})=\mathbb{E}_{j\sim p(j|\mathcal{Y})}\left[\hat{\ell}^{\text{Pose}}(\mathbf{R}(\cdot),\mathbf{h}^{*})\right],

whose gradient combines a score-function term ^Pose()Ylogp(jY)\hat{\ell}^{\text{Pose}}(\cdot)\,\partial_{\mathcal{Y}}\log p(j|\mathcal{Y}) with the pathwise derivative. Geometric data augmentation (±30° rotations, 66-150% rescaling) is added during training.

Results

Why it matters for SLAM

Relocalization — recovering the 6-DoF camera pose inside a previously mapped scene — is what SLAM systems need after tracking loss or when restarting in a known environment. DSAC* is the mature form of the scene-coordinate-regression answer: the map is stored implicitly in network weights while a geometric PnP/Kabsch + RANSAC solver stays in the loop, giving centimeter-level indoor accuracy from a single image. Its stable, consolidated training recipe became the reference baseline that the ACE family later accelerated by orders of magnitude.