# DeepBA and TFD-SfM: bundle adjustment from a cold start, learned and relaxed

> Satyajit Ghana — Head of Engineering @ Inkers Technology
> canonical: https://ai.satyajit.si/articles/deepba-tfd-sfm
> date: 2026-11-20
> tags: 3d, slam, benchmarks, diffusion

Three posts in one afternoon ([DeepBA](https://x.com/hectorandradel/status/2122724034517360673), [TFD-SfM](https://x.com/hectorandradel/status/2122722736913125491), [UGG](https://x.com/AmaniKiruga/status/2122706661899211231)) asked the same thing from different ends. Where
should the optimiser in a 3D reconstruction pipeline go? Hector
Andrade-Loarca posted two papers from Daniel Cremers' group at TUM, one after
the other. [TFD-SfM](https://arxiv.org/abs/2505.20858), accepted at WACV 2027,
runs structure from motion "from identity cameras and unit depths, without
building a single point track". [DeepBA](https://arxiv.org/abs/2611.18256)
asks whether a 2M-parameter network can learn bundle adjustment. An hour
earlier, Amani Kiruga posted [UGG](https://arxiv.org/abs/2611.14440) (NeurIPS
2026), a video diffusion model that generates frames, depth and camera motion
together.

I spend my time turning 360 and fisheye site walks into metric point clouds
for BIM, and bundle adjustment sits at the centre of that pipeline. The [last reconstruction roundup](/articles/3d-reconstruction-roundup-5)
ended on "put a bundle adjustment after it". These two papers ask what happens
if you take the classical solver's two crutches away: the good initial guess
and the point tracks. So this piece starts with what bundle adjustment does,
because both papers only make sense against it.

<Callout type="note">
Neither TUM paper has released code. Both project pages show a disabled "Code
(coming soon)" button, the two `cphjsn` GitHub repositories hold only those
pages, and DeepBA's paper says weights come "upon publication". So I ran
neither. Every number for them is the paper's, from the table named in the
sentence. What I did run is my own code: the two toys on this page, and a
reimplementation of TFD-SfM's synthetic experiment. UGG has code and weights,
but needs an 80 GB GPU; I read its weights header instead.
</Callout>

## What bundle adjustment minimises

Take $N$ images. Camera $i$ has a rotation $R_i$, a translation $t_i$ and
intrinsics $K_i$. Scene point $j$ is $X_j \in \mathbb{R}^3$. A feature matcher
says that point $j$ shows up at pixel $u_{ij}$ in image $i$. Bundle adjustment
picks every camera and every point at once to make the projections agree with
the pixels:

$$
\min_{\{R_i, t_i, K_i\},\,\{X_j\}} \; \frac{1}{2} \sum_{(i,j)} \rho\!\left( \big\lVert \pi\!\big(K_i (R_i X_j + t_i)\big) - u_{ij} \big\rVert^2 \right)
$$

Here $\pi([x, y, z]) = [x/z,\, y/z]$ is the perspective divide and $\rho$ is a
robust loss (Huber or Cauchy) so one bad match cannot pull the whole solution.
The residual is measured in pixels, which is where the noise actually lives.
That is why BA beats any closed-form triangulation given the same inputs: it
minimises the right error.

Two properties make this hard. The objective is non-convex, because of the
divide by depth and the rotations. And it has a gauge: you can rotate,
translate and scale the whole scene and every residual stays the same, so
seven directions of the solution are free.

The second hidden assumption is in the index $(i, j)$. The same 3D point $j$
has to be recognised in every image that sees it. That chain of observations
is a **track**, and a classical pipeline builds tracks before it optimises
anything: COLMAP links pairwise matches with union-find into multi-view
tracks and drops the inconsistent ones.

## Gauss-Newton, Levenberg-Marquardt and the arrow-shaped matrix

Stack every residual into a vector $r(x)$, where $x$ holds all camera and
point parameters, and linearise around the current guess:
$r(x + \delta) \approx r + J\delta$. Minimising $\tfrac12\lVert r + J\delta\rVert^2$
gives the Gauss-Newton step,

$$
(J^\top J)\,\delta = -J^\top r .
$$

Gauss-Newton trusts that linearisation completely. Levenberg-Marquardt adds a
damping term, $(J^\top J + \lambda\,\mathrm{diag}(J^\top J))\,\delta = -J^\top r$,
and adapts it: if a step lowers the cost, accept it and shrink $\lambda$ (closer
to Gauss-Newton); if not, reject it and grow $\lambda$ (closer to a short
gradient step). The damping also makes the matrix invertible despite the
gauge, whose directions are exactly the zero eigenvalues of $J^\top J$.

The trick that makes BA fast is the shape of $J^\top J$. Each residual
touches one camera and one point, so ordering the cameras first,

$$
J^\top J = \begin{bmatrix} B & E \\ E^\top & C \end{bmatrix},
$$

where $B$ couples cameras, $E$ couples cameras to the points they see, and $C$
is block-diagonal: each point only talks to itself, in a 3×3 block. Inverting
$C$ is trivial, so eliminate the points first. The **Schur complement**

$$
S = B - E\,C^{-1}E^\top
$$

is a system in the camera parameters alone. Solve
$S\,\delta_c = -(g_c - E C^{-1} g_p)$, then recover every point update
independently from $\delta_p = C^{-1}(-g_p - E^\top \delta_c)$. A scene with 300
cameras and three million points becomes a dense solve in 1,800 camera
unknowns plus three million tiny 3×3 inversions. Ceres, COLMAP and every
serious SLAM back end do this.

The widget below is that solver in flatland: five 1D cameras (each sees a
point as a single coordinate $u = x/z$) with full poses, and thirty points.
Camera 0 is held fixed, which removes three of the four gauge freedoms of a
2D similarity; scale stays free on purpose, and the damping copes. On the
right is the $J^\top J$ of the current step and the 12×12 camera system that
actually gets factored.

<LmStepper />

From a start near the truth it converges in a handful of steps. The cost
drops by orders of magnitude and $\lambda$ falls while steps succeed; once
there is nothing left to gain, every trial step is rejected and $\lambda$
climbs, which is LM's way of stopping. Then press "cold start", which puts
every camera on camera 0 and every point one unit down the first ray that
sees it, and turn the walk to 90°. This first scene still gets there; press
"new scene" once and the cold start ends with its headings more than 140°
off.

Over 20 random scenes with 1 px of noise, I counted how often LM reached the
same minimum it reaches from the true poses. With a walk that turns 40°, the
cold start gets there in all 20, and a start 30° off in 7. With a 90° turn,
the cold start gets there in 6 of 20, a 5° perturbation in 20 and a 15° one in
19. In this toy the identity is a decent guess as long as the cameras all
roughly face the same way, which is why forward-facing captures forgive a
lot. The more the views turn around the scene, the closer Gauss-Newton needs
to start.

So classical SfM is mostly machinery for getting a good start. COLMAP picks a
well-conditioned image pair, registers images one at a time and re-runs BA
after each. GLOMAP averages pairwise rotations first, then solves for
positions. And both need tracks, which is where modern dense matchers hurt
them. In TFD-SfM's Table 1, COLMAP on SIFT reaches RTA@5° of 89.2 on ETH3D.
Feed it DKM's dense matches instead (through the detector-free SfM track
builder) and it falls to 59.3. More, better matches made it worse, because the
track builder could not cope with their noise.

## TFD-SfM: give every match its own Gaussian

TFD-SfM drops the shared point. For a match between pixel $u$ in image $i$ and
pixel $v$ in image $j$, each pixel gets its own landmark: it is lifted to a
depth $d_u$ in its own camera, $p_u = \pi^{-1}(u, d_u, K_i)$, and modelled as an
isotropic Gaussian with its own variance $\sigma_u^2$. Depths and variances are
read from per-image 32×32 maps, so the parameter count stays small.

<Figure
  src="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/fig5.png?v=774b11913d810c1e"
  alt="TFD-SfM pipeline in five panels: input images of a red sphere; view-graph construction where LoFTR estimates overlap and a spanning tree is built with cam_5 as root; dense correspondences between connected images by DKM; the optimisation at t=0s, 20s, 100s and 200s, with cameras fanning out and edges turning from red to green; and the outputs: intrinsics, poses and a 3D reconstruction."
  caption="TFD-SfM's pipeline: coarse LoFTR scores which image pairs overlap, a spanning tree and extra edges form the view graph, DKM matches the connected pairs densely, and the optimisation runs from identity cameras for about 200 seconds on this scene (TFD-SfM paper, Figure 2)."
/>

Two terms score each match. The 2D term projects $u$'s Gaussian into image
$j$ and asks how likely the matched pixel is, with the projected covariance
$\Sigma_{2D} = \sigma_u^2 J J^\top$ ($J$ is the Jacobian of the projection):

$$
\mathcal{L}_{2D}^{i\to j} = \tfrac12\, r^\top \Sigma_{2D}^{-1} r + \tfrac12 \log\det \Sigma_{2D} .
$$

The 3D term asks the two Gaussians to overlap:
$\mathcal{L}_{3D} = \tfrac12 \lVert p_{u\to j} - p_v\rVert^2 / (\sigma_u^2 + \sigma_v^2) + \tfrac32\log(\sigma_u^2+\sigma_v^2)$.
The loss per edge is both 2D directions plus the 3D term, summed over its
matches.

Read the NLL as a reweighted least squares. The quadratic part is the
classical residual divided by a variance the optimiser chooses. A match that
cannot be fitted gets a large $\sigma^2$, which shrinks its pull; the log term
charges for that, so variances cannot grow for free. This is the same thing a
robust kernel does in classical BA, with the weight a free variable per match
instead of a fixed function of the residual. Early on, when every variance is
large, the loss surface is smooth, and that is what lets it start cold.

<Video
  src="https://ai.satyajit.si/articles/deepba-tfd-sfm/clip4"
  poster="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/clip4-poster.jpg?v=5e6a0520adc7bc14"
  alt="Left, a top view of a ring of cameras around a cloud of coloured circles that start huge and overlapping and shrink as the cameras fan out into a ring. Right, one match drawn as two blue discs whose sigma falls from 6.37 to 0.01 as the two discs slide together into one small dot by iteration 8,000."
  caption="One match, two Gaussians: as the ring of cameras resolves, the two discs move together and their variance collapses. Iteration counts are on screen (video from @hectorandradel's post on X)."
/>

Three more pieces make it work on real scenes:

- **Chained poses.** Following MASt3R-SfM, a camera's pose is stored
  relative to its parent in a spanning tree of the view graph, and absolute
  poses are the product down the chain (computed with a parallel prefix scan
  in $O(\log N)$ steps). Moving a parent moves its whole subtree, which the
  paper credits for cold-start stability.
- **Two mirrored worlds.** With weak perspective, a scene and its reflection
  through a fronto-parallel plane project almost identically, so a concave
  surface can come out convex. TFD-SfM optimises a second copy of everything,
  seeded with each relative pose conjugated by a 180° rotation about the
  optical axis, and keeps whichever world ends with lower NLL. On DTU this
  one switch takes RTA@5° from 18.4 to 83.1 (Table 3).
- **Edge weights.** Each view-graph edge gets a reliability from how its NLL
  compares with the other edges at the same camera, smoothed over time and
  frozen for the first 5,000 iterations.

<Figure
  src="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/fig7.png?v=2471cacaa5804afb"
  alt="Two rows of reconstructions of DTU objects. Top row, a toy figure reconstructed as a distorted concave shell with cameras on the wrong side, labelled NLL of solution 1: 1.47, and next to it the correct convex reconstruction under a dome of cameras, NLL 0.56. Bottom row, a set of packaged goods, mirrored solution with NLL 1.36 and correct solution with NLL 0.33."
  caption="The mirror ambiguity on DTU: the reflected reconstruction (left) and the true one (right) both fit, but the true one has the lower NLL (TFD-SfM paper, Figure 4)."
/>

<Video
  src="https://ai.satyajit.si/articles/deepba-tfd-sfm/clip5"
  poster="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/clip5-poster.jpg?v=916b3fca943ec5b9"
  alt="Two side-by-side reconstructions of a toy figure on a table, labelled world 2: convex and world 1: concave. The convex one has its cameras in a neat dome, labelled higher likelihood, 2D NLL 1.43, kept; the concave one has scattered cameras, labelled lower likelihood, 2D NLL 2.23, discarded."
  caption="The two worlds side by side: the mirrored hypothesis ends with a higher 2D NLL and is discarded (video from @hectorandradel's post on X)."
/>

The ablation in Table 3 is the clearest evidence in the paper. On ETH3D,
classical BA from the same cold start reaches RTA@5° of 1.6. The Gaussian 2D
term alone takes it to 45.1, adding the 3D overlap to 53.9, chained poses to
86.4 and edge weighting to 90.1.

The optimiser is plain AdamW at a learning rate of 0.0016 for 30,000
iterations, in a custom CUDA implementation on one H100, from identity poses,
a 45° field of view and every depth and variance at 1. One step takes about
2 ms at real-scene match counts; a full Mip-NeRF 360 run, including matching,
takes 10 to 25 minutes.

<Figure
  src="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/post2.jpg?v=099a20b7f07c4821"
  alt="Four TFD-SfM reconstructions with red camera frustums: a pig figurine under a dome of cameras, a room seen from above, a pipe assembly, and St Paul's cathedral facade, each beside small panels of sparse COLMAP and COLMAP plus DKM results with their RTA at 5 degrees."
  caption="TFD-SfM against COLMAP and COLMAP with DKM matches on four kinds of scene, with RTA@5° in the corners (image from @hectorandradel's post on X; TFD-SfM paper, Figure 1)."
/>

<Video
  src="https://ai.satyajit.si/articles/deepba-tfd-sfm/clip3"
  poster="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/clip3-poster.jpg?v=05fd69b8ff104a92"
  alt="Two reconstructions forming over iterations 1,000 to 10,000: a desk with objects, and a building facade with arched windows, with orange camera frustums settling into place as the point clouds sharpen."
  caption="Cameras and dense geometry emerging from a cold start over 10,000 iterations (video from @hectorandradel's post on X)."
/>

### My reimplementation of the toy

Section 3.2 tests the objective on a synthetic scene that Appendix A.6 fully
specifies: 100 landmarks on a sphere of radius 1.3, cameras on an orbit of
radius 4 spaced 15° apart, each landmark seen by a contiguous run of four to
six cameras, pixel noise, and every run started at identity poses and unit
depth. The paper crosses absolute against chained poses with shared points
against Gaussians, and reports that only chained poses with Gaussians recover
the cameras, across the full 360° ring.

I wrote that experiment from the paper's text: the same scene, Eq. 4 as the
loss, plain Adam at 0.0016 for 15,000 steps, three seeds at 1 and
4 px of noise. One choice is mine. Nothing in Eq. 4 fixes the scale, and the
log-variance terms reward shrinking the whole scene, so I hold the mean
log-depth at zero.

<TrackFreeReplay />

The replay is seed 1, which happens to show the paper's pattern on the
75° arc: chained poses with Gaussians converge, absolute poses with Gaussians
don't. Across all six runs at that arc the two came out even.

Part of the claim reproduces and part does not. Shared points (classical BA's model, here optimised by the same Adam, not by LM) never recovered at any arc length, in any seed. Gaussians did, on the
shortest arc: with six cameras over 75°, chained poses with Gaussians reached
a mean relative-rotation error under 1.4° in four of six runs. But absolute
poses with Gaussians did too, in four of six, so I could not separate the
two pose parameterisations. From nine cameras (120°) on, nothing converged in
my runs, and every run on the full 24-camera ring ended at least 69° off. Running 30,000 steps
instead of 15,000, or dropping my scale term, rescued none of the runs I
tried it on. Something in the
paper's setup that the text doesn't pin down (the scale handling, the step
count, a schedule) may well be the difference. I'd want the code before
reading Figure 3 as a basin-of-attraction result for wide arcs.

<Figure
  src="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/fig6.png?v=60fcd258bddb9569"
  alt="Four 3D panels of a camera ring experiment. Absolute poses with shared landmarks, absolute poses with Gaussian landmarks and chained poses with shared landmarks all show cameras collapsed near one spot with points scattered; chained poses with Gaussian landmarks shows the full ring of cameras recovered around a cluster of points."
  caption="The paper's version of the toy on the full 24-camera ring: only chained poses with Gaussian landmarks recover it (TFD-SfM paper, Figure 3)."
/>

My first attempt was a 2D version, with 1D cameras, and it failed for a reason
worth knowing. Two 1D cameras impose no constraint on each other: two rays in
a plane always intersect. A pairwise, track-free loss has nothing to grip in
flatland. In 3D two rays generally miss, and that miss is the epipolar
constraint every pairwise method lives on.

## DeepBA: learn the update instead of solving for it

DeepBA keeps TFD-SfM's track-free state: per image, an absolute pose, a log
field of view and a 32×32 log-depth map; per image pair, a relative pose
stored as a rotation vector and a unit translation direction. Then it throws
away the solver. A graph neural network looks at the current state and
predicts a change to it, $s_{k+1} = s_k \boxplus \Delta s_k$, and that is
applied 100 times from the same trivial start: identity poses, zero log-FOV,
zero log-depth.

<Figure
  src="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/fig2.png?v=2ac5c60b7bc97da1"
  alt="Left, a view graph of camera nodes joined by match edges, labelled as input. Right, the full 240-camera counter scene of Mip-NeRF 360: a dense point cloud of a kitchen counter with a ring of green estimated cameras around it, and per-image depth maps."
  caption="DeepBA on the full 240-camera Mip-NeRF 360 counter scene: a view graph from any matcher in, cameras, intrinsics and depth out, from a trivial start (DeepBA paper, Figure 1)."
/>

<Figure
  src="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/fig1.png?v=ad09c8ed67a69dff"
  alt="DeepBA architecture. Left, a state refinement block: hidden states for cameras, pairs and matches enter an MPC block repeated L times and are decoded into changes of absolute pose, focal length, relative pose and depth, which are added to the state; the whole block repeats K times. Right, the Match-Pair-Camera block: blue camera nodes, orange pair nodes and yellow-green match nodes, with three steps of message passing between them along covisibility edges."
  caption="One refinement iteration: geometric features of the current state go in, four Match-Pair-Camera blocks mix them over the view graph, heads emit the state change; the same weights run at every iteration (DeepBA paper, Figure 2)."
/>

The inputs are recomputed from scratch at every iteration, in closed form:

- per pair and direction, 14 numbers: the relative pose, both focal lengths,
  and the disagreement between the predicted relative pose and the one implied
  by the two absolute poses;
- per match and direction, 12 numbers: the two pixel positions, the offset from
  the epipolar line, the 2D reprojection residual, the 3D residual between the
  two lifted points, and the log distance of the lifted point.

Camera states start from one learned embedding shared by every camera. Four
Match-Pair-Camera blocks then pass messages: cameras broadcast to their pairs
and matches, matches are pooled into their pair by 4-head attention, and pairs
are attended into their cameras. Heads decode a pose change per camera, a
focal change, a relative-pose change per pair (antisymmetric by construction)
and a depth update, scattered from the match features onto each image's grid.
The hidden width is 128. The whole thing is 2.04M parameters.

No hidden state crosses iterations. Each step sees only the geometry, the way
a Gauss-Newton step sees only $J$ and $r$. That makes the iteration count a
test-time knob: the paper trains with 100 iterations, backpropagates through
24 of them, and runs 100 at test.

<Figure
  src="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/post1.png?v=083f528a55c4860e"
  alt="A banner titled The difference: classical BA updates by minus J transpose J inverse J transpose r, an analytic solve that needs a good init, with state cameras plus 3D points from tracks; DeepBA updates by a weight-shared GNN of the state and graph, learned, with a trivial init and state poses plus focal plus depth, no tracks."
  caption="The authors' one-line summary of the difference: the same update loop, with the Gauss-Newton solve swapped for a network (image from @hectorandradel's post on X)."
/>

<Video
  src="https://ai.satyajit.si/articles/deepba-tfd-sfm/clip1"
  poster="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/clip1-poster.jpg?v=f12920a2b8ab80e7"
  alt="Two scenes reconstructing over refinement iterations 0, 3, 9, 20, 70 and 100: a dog figurine with a ring of camera frustums forming around it, and a room, each with a strip of input images and depth maps above that sharpen from flat colour to structure."
  caption="DeepBA from a cold start: at iteration 0 every depth map is flat and every camera at the identity; by iteration 20 the ring of cameras is there (video from @hectorandradel's post on X)."
/>

Training is the clever part. Supervising absolute poses would need a common
frame and a metric scale, which a mix of MegaDepth, CO3Dv2, ScanNet,
BlendedMVS, DL3DV and Calle does not share. So DeepBA supervises only relative
rotations and translation *directions* against ground truth, with a
scale-free distance, and ties the absolute poses to the relative ones through
a stop-gradient: a learned pose-graph optimisation. Scale comes from
self-consistency losses on the 2D reprojection and 3D residuals, weighted per
match by a Cauchy kernel on the ground-truth Sampson distance so outliers are
ignored. A last term penalises the size of each update, because a trained
refiner otherwise keeps drifting the scene by pure gauge motions after it has
converged.

### Why 2M parameters can stand in for a solver

The question in the post sounds like it asks whether 2M parameters can hold a
3D reconstruction. They don't have to. DeepBA's state, the poses and depth
maps, is explicit and lives outside the network. The network is an update
rule, and update rules are small: the Gauss-Newton step $-(J^\top J)^{-1}J^\top r$
has zero learned parameters and still solves BA from a good start. What the
2.04M parameters buy is everything GN does not have. They decide how far to
trust each residual (the robust weighting), how big a step to take (the
damping), and how to move when the linearisation is useless, as it is from a
cold start. VGGT's 1.2B parameters, by contrast, have to see pixels and turn
them into geometry; DeepBA is handed matches by eLoFTR and only has to
reconcile them. The ~590× ratio in the post compares a solver with a
perception model. A widely shared Japanese
[summary by @tokufxug](https://x.com/tokufxug/status/2122501694894592511) puts
it as 2.04M parameters "approaching" VGGT's 1.2B, over a recut of the authors'
clips; the comparison is fair only in that sense.

The paper's own results show where the analogy stops, though.

- **Width matters a lot.** Halving the hidden width to 64 drops CO3Dv2
  AUC@30° from 78.6 to 58.9 (Table 4). This is not a model with capacity to
  spare.
- **It does not converge to the reprojection minimum.** Running a classical
  BA from DeepBA's output raises AUC@30° from 78.6 to 84.6. The authors say it
  "behaves similarly to BA but not identically".
- **Its fixed point drifts.** On Mip-NeRF 360's `bonsai`, every camera ends up
  pitched about 9° the same way. Started from the ground truth, DeepBA tilts
  the cameras to a median pitch error of 9.4° in 100 iterations. A real solver
  started at the minimum stays there.
- **More iterations are not free accuracy.** At 1,000 iterations instead of
  100, the Mip-NeRF 360 mean RRA@10° rises from 73.5 to 82.2 and RTA@10° falls
  from 86.5 to 84.5 (Appendix E).

<Figure
  src="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/fig4.jpg?v=270ace8fb0f852f7"
  alt="A 3D reconstruction of the bonsai scene with a ring of green estimated cameras and grey ground-truth cameras; the green ring is tilted relative to the grey one."
  caption="The bonsai failure: DeepBA's cameras (green) all pitch up by about the same angle against the ground truth (grey), a drift of the learned update itself (DeepBA paper, Figure 10b)."
/>

## The numbers, side by side

DeepBA's headline comparison is Table 1, ten frames per scene:

| CO3Dv2 and RealEstate10K, 10 frames | Params | CO3Dv2 RRA@15° | CO3Dv2 AUC@30° | RE10K AUC@30° | Time on one H100 |
|---|---|---|---|---|---|
| COLMAP (SIFT) | – | 86.3 | 74.9 | 46.5 | ~2 + 3 s |
| COLMAP (same eLoFTR matches) | – | 89.7 | 77.0 | 80.9 | ~7 + 11 s |
| GASfM (eLoFTR, given true intrinsics) | 145.2M | 79.9 | 71.2 | 82.8 | ~7 + 2 s |
| VGGT | ~1.2B | 99.3 | 85.1 | 85.3 | ~0.2 s |
| DeepBA | 2.04M | 97.4 | 78.6 | 84.0 | ~7 + 3 s |

The post's "97.4 vs 99.3 RRA@15 on CO3Dv2" is in that table. So is the fact
that VGGT leads AUC@30°, the stricter joint metric, by 6.5 points on CO3Dv2.
On RealEstate10K DeepBA is within 1.3 of it. Against the classical pipelines
on the same matches, DeepBA wins every column here.

<Figure
  src="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/fig9.jpg?v=294084e3b3fb8c62"
  alt="A grid of reconstructions, four rows (DTU scan82 with 49 images, Mip-NeRF 360 bicycle with 194, ETH3D delivery_area with 44, IMC2021 london_bridge with 25) by four columns (COLMAP with eLoFTR, RESfM, GASfM, DeepBA), showing points with green estimated and grey true cameras."
  caption="The same eLoFTR matches through COLMAP, RESfM, GASfM and DeepBA; the number after each dataset is the image count (DeepBA paper, Figure 3)."
/>

The four multi-view benchmarks in Table 2 are tighter, and there the picture
turns. On ETH3D, COLMAP with the same eLoFTR matches reaches RTA@10° of 75.5
against DeepBA's 49.1, and COLMAP on SIFT 96.4. On Mip-NeRF 360, with 125 to
311 images a scene, both classical mappers are at 100 RRA@10° and DeepBA at
73.5. DeepBA's best showing is DTU and IMC2021, where it comes close to the
mappers at 10° and falls behind at 3°.

What the DeepBA paper never prints is its own group's other method. TFD-SfM
reports the same four benchmarks. Here they are at 5°, from TFD-SfM's Table 1
and DeepBA's Table 2:

| RRA@5° / RTA@5° | DTU | Mip-NeRF 360 | ETH3D | IMC2021 |
|---|---|---|---|---|
| TFD-SfM (DKM matches) | 97.9 / 83.1 | 99.6 / 98.5 | 96.9 / 90.1 | 71.2 / 39.5 |
| DeepBA (eLoFTR) | 95.6 / 90.8 | 66.7 / 68.2 | 53.4 / 28.8 | 95.6 / 68.9 |
| DeepBA (DKM, Table 5) | 92.9 / 95.7 | 68.9 / 71.3 | 52.4 / 41.4 | 95.2 / 70.3 |

Three caveats before reading it. The matchers differ, so I added DeepBA's DKM
row from its Table 5. The metrics are defined differently: TFD-SfM's appendix
counts poses, DeepBA's counts all image pairs. And the two papers do not even
agree on a shared baseline: VGGT's ETH3D RTA@5° is 81.1 in TFD-SfM's table
and 65.0 in DeepBA's. So this is a rough map, not a ranking.

The map is still clear. The per-scene optimiser is far more accurate on the
big, wide scenes: ETH3D and Mip-NeRF 360. The thread's "best on ETH3D" is narrow, though: TFD-SfM's ETH3D AUC@10° is 85.0 against COLMAP's 84.8, COLMAP leads at 1° (90.5 / 80.1 against 86.3 / 77.4), and on IMC2021 COLMAP's 85.3 / 65.3 at 5° is well ahead of TFD-SfM's 71.2 / 39.5. The learned refiner is better on IMC2021's small bags of five to
25 tourist photos with different cameras, which is exactly where TFD-SfM's
focal-depth ambiguity bites and where amortised experience helps.

On time, the two are closer than they look. TFD-SfM quotes 10 to 25 minutes a
Mip-NeRF 360 scene end to end, but at about 2 ms a step its 30,000 steps are
about a minute of optimisation (my arithmetic on its numbers); the rest is
LoFTR and DKM matching. DeepBA's runtime figure times the solvers alone
on the same eLoFTR matches of `bonsai`: at 292 images and 3.4M matches, 100
iterations take 56 s with a 24 GB memory peak, against 988 s for COLMAP and
793 s for GLOMAP. Matching itself takes 279 s there, so DeepBA's end to end is about 335 s. Against COLMAP the solver gap is real; against TFD-SfM it is the front end that differs. The post says DeepBA is
faster "beyond ~15 views"; the paper says from 10 on. The per-iteration cost
is linear, 25 ms plus 155 ns per match.

<Figure
  src="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/fig3.png?v=c5f7d20be0bbf6e7"
  alt="Two log-log plots. Left, time in seconds after matching against number of images N for DeepBA, COLMAP and GLOMAP on the same matches, plus eLoFTR matching time dashed: COLMAP and GLOMAP rise to about 1,000 seconds at around 300 images, DeepBA to about 60. Right, milliseconds per iteration against number of matches, a straight line rising to about 550 ms at 3.4 million matches."
  caption="Solver time on the first N images of bonsai with the same eLoFTR matches on one H100, and DeepBA's per-iteration cost against match count (DeepBA paper, Figure 5)."
/>

### Against VGGT plus bundle adjustment

The [last roundup](/articles/3d-reconstruction-roundup-5) checked a slide
showing VGGT with a BA on top: 85.3 to 93.5 AUC@30° on RealEstate10K and 88.2
to 91.8 on CO3Dv2, VGGT's own Table 1. It is tempting to set those beside
DeepBA's 84.0 and 78.6. Don't. DeepBA's table runs feed-forward VGGT on its
own frame lists and gets 85.1 on CO3Dv2, not 88.2, so the protocols differ by
three points before any BA. The like-for-like row is DeepBA's own ablation:
with a classical BA started from its output, 78.6 becomes 84.6 on CO3Dv2. The
lesson matches the roundup's. A learned stage gets you into the basin, and a
real bundle adjustment finishes the job.

### A camera on a frozen map

DeepBA's state is explicit geometry, so part of it can be frozen. Build a map,
hold its cameras and depths fixed, and run the same network on a new image:
it registers the query from the mean pose of the map cameras, without its
intrinsics and without PnP.

<Video
  src="https://ai.satyajit.si/articles/deepba-tfd-sfm/clip2"
  poster="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/clip2-poster.jpg?v=3601f409b6477677"
  alt="A CO3D hydrant scene with a frozen arc of blue map cameras and points. A green query camera starts at the mean map pose with a camera-centre error of 10.478 and a rotation error of 109.2 degrees, and over 50 iterations moves onto the arc, ending with a camera-centre error of 0.126 and a rotation error of 3.4 degrees."
  caption="Localising one camera against a frozen 25-image map: from the mean map pose to 3.4° of rotation error in 50 iterations (video from @hectorandradel's post on X)."
/>

On 7-Scenes (Table 6), with a 200-image DeepBA map, DeepBA localises `chess`
to a median 3 cm and 1.66°. Focal-solving PnPf with RANSAC on the same map
gets 6 cm and 1.66°; PnP given the true intrinsics, 12 cm and 1.91°. HLoc on
its usual map of about 4,000 images gets 2 cm and 0.79°. The fair reading is
that DeepBA is a better registration step on a small map, not a better
localiser.

## UGG: the same geometry, from a video model

UGG comes at the problem from the other side. Its authors take a video
diffusion model, Wan2.2-TI2V-5B, and teach it to produce depth and cameras as
two more "videos" alongside RGB. Cameras become images through Plücker ray
maps: each pixel stores its ray direction $d$ and moment $m = o \times d$, so a
camera is a six-channel image aligned with the RGB frame.

<Figure
  src="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/fig8.png?v=9b664a775d823164"
  alt="UGG architecture: RGB, depth and ray-map inputs, some tokens hatched as noisy, enter a unified model repeated L times with separate QKV projections per modality, joint multi-modal self-attention, cross-attention to text and separate feed-forward networks per modality, with a diffusion timestep modulating each; outputs are RGB frames, depth maps and ray maps."
  caption="UGG's mixture-of-transformers: separate projections and feed-forward layers per modality, one shared self-attention, and a timestep per token (UGG paper, Figure 2)."
/>

Every token has its own noise level. Observed tokens are clean; missing ones
are noise to denoise. That one rule (Diffusion Forcing, extended across
modalities) turns a generator into an any-to-any model: give it a video and it
fills in depth and cameras, give it two photos and a camera path and it fills
in the frames between, give it only a camera path and it imagines a scene. It
also lets one model train on datasets that lack depth or cameras: the missing
modality is simply left out of the loss.

<Figure
  src="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/post3.jpg?v=e17db91acfa319e0"
  alt="A table of tasks as noise patterns: text-to-4D generation, image-conditioned generation, camera-conditioned generation and geometric prediction, each a row of text, RGB, depth and ray-map tokens with the observed ones clean and the rest hatched as noisy, all feeding a Unified Generative Geometry Model that outputs a completed scene."
  caption="Every task is a pattern of clean and noisy tokens over text, RGB, depth and ray maps (image from @AmaniKiruga's thread on X; UGG paper)."
/>

<Figure
  src="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/post4.jpg?v=c026c5abd5871e64"
  alt="Heterogeneous training: four datasets with RGB, depth and camera columns, where datasets B, C and D have depth or camera masked, all feeding UGG with a masked loss."
  caption="Datasets missing depth or cameras still train the model: the missing modality is masked out of the loss (image from @AmaniKiruga's thread on X)."
/>

<Video
  src="https://ai.satyajit.si/articles/deepba-tfd-sfm/clip6"
  poster="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/clip6-poster.jpg?v=04d4f0a0fcfa0c1b"
  alt="UGG's overview video: an in-the-wild clip of a doorway with its predicted depth, then a backward and an inside-left view the video never showed, then panels for image to 4D and first plus last image to 4D on a staircase and a bedroom."
  caption="The first 15 seconds of UGG's overview: depth and pose from a casual video, then views the video never showed (video from @AmaniKiruga's post on X)."
/>

The thread says "one model". The weights are larger than the base. I read the
header of `ugg_release.safetensors` from Hugging Face by HTTP range request:
2,340 tensors, 14,820,947,808 parameters, all bf16. Each of the 30 blocks
carries three copies of the query, key, value and output projections and of
the feed-forward network (width 3,072, hidden 14,336), one per modality. So it
is three 5B-scale experts sharing attention, about 14.8B in all, with roughly
5B active per token. That is what "each modality gets its own projections and
FFNs" means in parameters, and why the README asks for an 80 GB GPU.

The geometry results are real but come with a narrow baseline set. In Table 2
(dense video), UGG cuts ATE on ScanNet++ from Geo4D's 0.190 to 0.087, and it
leads ATE and translational RPE across all five datasets. The baselines are
Geo4D, RayDiffusion, Gen3R and Aether. There is no VGGT, no MASt3R, no COLMAP,
though VGGT is in the reference list. "Beats models built only for pose
estimation" is true of RayDiffusion; it is untested against the models people
actually use for poses. With only the first and last frame, rotation error is
still 21 to 43° on Sintel, ScanNetV2 and ScanNet++.

Test-time search is the one idea here that classical SfM cannot copy: sample
16 completions and keep the one whose depth and cameras best agree with RAFT
flow between the observed frames. It helps sparse depth and pose on all five
benchmarks. It is a proxy, though; on dense ScanNet++ it makes rotation error
worse, 3.861 to 4.105 degrees.

<Figure
  src="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/post5.jpg?v=0dd6667035c29506"
  alt="Test-time search: an input photo of a room goes into UGG, which produces 16 parallel generations scored for 3D consistency without ground-truth depth or camera; the best candidate, outlined in green, is picked."
  caption="Test-time search: 16 completions, scored against the observed frames, the most consistent kept (image from @AmaniKiruga's thread on X)."
/>

<Video
  src="https://ai.satyajit.si/articles/deepba-tfd-sfm/clip7"
  poster="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/clip7-poster.jpg?v=c1ef11de7b551ba4"
  alt="Video to 4D: a man walking in an office, with the input frames on the left, a colour point cloud of the room in the middle and a depth video and camera path on the right."
  caption="Video to 4D: a handheld clip in, depth and a camera path out (video from @AmaniKiruga's thread on X)."
/>

<Video
  src="https://ai.satyajit.si/articles/deepba-tfd-sfm/clip8"
  poster="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/clip8-poster.jpg?v=ee8253cbc299ed8f"
  alt="First plus last image to 4D: two photos of a bedroom on the left, a generated walkthrough between them as a coloured point cloud in the middle, and the novel view, depth and camera path on the right."
  caption="Two photos and a camera path in, the walk between them out, with depth (video from @AmaniKiruga's thread on X)."
/>

<Video
  src="https://ai.satyajit.si/articles/deepba-tfd-sfm/clip9"
  poster="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/clip9-poster.jpg?v=1c029335a74e6632"
  alt="World generation: for a wooden doorway, a backward view and an inside-left view the source video never showed, each with depth, a point cloud and a camera path; then a gallery generated from a camera trajectory alone."
  caption="Generating what the video never showed, and a scene from a camera path alone (video from @AmaniKiruga's thread on X)."
/>

The costs are a different order from the TUM papers: training on 128 H200s
for two weeks, inference at 288×384 on 50-frame clips, about 20 seconds per
clip for 40 denoising steps on one H100. The authors' own limitations section
says specialised geometry models stay stronger on several indoor depth
metrics. The code is public at
[amanikiruga/UGG](https://github.com/amanikiruga/UGG) and the weights at
[amanim71/UGG](https://huggingface.co/amanim71/UGG).

<ModelCard repo="amanim71/UGG" />

## What this changes for a 360 walk to BIM

My captures are Insta360 dual-fisheye walks through buildings under
construction, solved as a rig with IMU scale and gravity, for scan-to-BIM.
Read against that, both TUM papers hit their own limitations sections almost
one for one.

- **Pinhole only.** Both papers say it. TFD-SfM's appendix says wide-angle
  or action-camera footage "must be undistorted beforehand", and DeepBA's
  intrinsics are a single field of view. A fisheye frame would have to be
  split into perspective crops, which multiplies the view count and throws
  away the fact that the crops share a rigid rig.
- **Flat walls.** DeepBA's ETH3D `terrains` failure is 18 of 42 views facing a
  flat wall head-on, with the focal length overestimated and the cameras put
  too far back. TFD-SfM's IMC2021 numbers show the same focal-depth ambiguity.
  An interior under construction is mostly flat walls seen head-on.
- **Repeated windows.** DeepBA's `courtyard` and `facade` failures are
  eLoFTR matching one wall's window grid to another's. A floor of identical
  bays is the same trap.
- **Weakly linked rooms.** DeepBA's `room` failure is a view graph that splits
  into 136 and 175 cameras joined by only 128 pairs; each half is fine and the
  two are placed independently. That is two rooms joined by a doorway.
- **No metric scale, no gravity, no rig.** Both solve up to a similarity.
  I'd still need the IMU for scale and gravity, and a classical BA with rig
  constraints to use it.

<Figure
  src="https://media.thesatyajit.com/ai/articles/deepba-tfd-sfm/fig10.jpg?v=433ec0e2367abcbd"
  alt="ETH3D terrains: two wall-facing views and one corridor view on top; below, DeepBA's reconstruction in red over the ground truth in grey, with the wall-facing cameras placed too far from the wall and their estimated focal lengths larger than the true ones."
  caption="The focal-depth ambiguity on ETH3D terrains: views facing a flat wall get too long a focal length and are pushed back from it (DeepBA paper, Figure 8)."
/>

The 24 GB peak at 292 views is exactly an RTX 3090's memory, so a site walk of a few hundred frames would sit at the limit of a consumer card. The part I would take now is TFD-SfM's idea rather than
either method: the per-match variance as a free variable is a robust kernel
that adapts per match, and that could sit inside a rig BA that already uses the IMU for scale and gravity.

My position: DeepBA is the more interesting paper and TFD-SfM the more
accurate method. DeepBA shows a small, explicit-state refiner can get from
nothing to the basin of attraction in seconds, then lose to a classical
finisher on the tight thresholds, as its own ablation admits. For a capture
pipeline that is the right division of labour: learned cold start, classical
finish. Until either releases code, it stays a paper result. UGG is a strong
demo of one model doing generation and geometry, but I would not take its pose
claims seriously until it is measured against VGGT.

For more on the pipeline side, see [Gaussian-splat capture in
practice](/articles/3dgs-capture-pipelines), [GoFish's fisheye
splatting](/articles/gofish-fisheye-gaussian-splatting), and two other
learned solvers: [Solv3R](/articles/solv3r) and [HiP3R](/articles/hip3r).

<Callout type="note">
What I ran: the Levenberg-Marquardt stepper on this page (my code, in the
browser), its 20-seed basin sweep, and a TypeScript reimplementation of
TFD-SfM's toy from its Appendix A.6, 96 runs over four arc lengths, two noise
levels and three seeds plus four longer or unscaled reruns, on a laptop CPU. What I read: all three papers in
full, the two project pages, the X threads, UGG's README and its
`safetensors` header. I did not run DeepBA, TFD-SfM or UGG.
</Callout>
