Marigold

Ke 2024 · Paper

One-line summary — Repurposes Stable Diffusion as an affine-invariant monocular depth estimator by fine-tuning only its U-Net to denoise depth latents conditioned on the image, trained purely on 74K synthetic samples in ~2.5 GPU-days, with per-pixel uncertainty available by ensembling multiple diffusion samples.

Problem

Recovering 3D depth from a single image is geometrically ill-posed — it requires scene understanding, not just geometry. Discriminative depth estimators, from modest CNNs up to large Transformers, remain limited by the visual world seen during training and struggle zero-shot on unfamiliar content and layout. Meanwhile, Stable Diffusion has distilled internet-scale image collections (LAION-5B) into a rich prior of the visual world. Marigold asks: if a comprehensive representation of the visual world is the cornerstone of monocular depth, can a broadly applicable depth estimator be derived from a pretrained image diffusion model without unlearning that prior?

Method & architecture

Depth estimation is posed as conditional denoising diffusion: model the conditional distribution D(dx)D(\mathbf{d}\,|\,\mathbf{x}) over depth dRW×H\mathbf{d}\in\mathbb{R}^{W\times H} given RGB image xRW×H×3\mathbf{x}\in\mathbb{R}^{W\times H\times 3}. The forward process corrupts depth at levels t{1,,T}t\in\{1,\dots,T\}:

dt=αˉtd0+1αˉtϵ,ϵN(0,I),  αˉt:=s=1t(1βs)\mathbf{d}_t=\sqrt{\bar{\alpha}_t}\,\mathbf{d}_0+\sqrt{1-\bar{\alpha}_t}\,\boldsymbol{\epsilon},\qquad \boldsymbol{\epsilon}\sim\mathcal{N}(0,I),\ \ \bar{\alpha}_t:=\textstyle\prod_{s=1}^{t}(1-\beta_s)

and the U-Net ϵθ\boldsymbol{\epsilon}_\theta is trained with the standard denoising objective L=Ed0,ϵ,tϵϵ^22\mathcal{L}=\mathbb{E}_{\mathbf{d}_0,\boldsymbol{\epsilon},t}\lVert\boldsymbol{\epsilon}-\hat{\boldsymbol{\epsilon}}\rVert_2^2. Everything runs in Stable Diffusion v2’s latent space, keeping that space intact:

Results

Zero-shot on five real datasets never seen in training (metrics in %, AbsRel lower / δ1\delta_1 higher better):

Why it matters for SLAM

Marigold demonstrated that internet-scale generative priors transfer to geometric tasks, opening the diffusion-based depth family. For SLAM specifically, its sampled uncertainty is the standout feature: fusing monocular depth priors into a SLAM back-end requires a noise model, and Marigold provides one per pixel for free from the ensemble variance. Its iterative inference keeps it out of real-time front-ends, but it is valuable for offline mapping, dense prior generation, and as the fine-detail quality reference that faster models (e.g., Depth Anything V2) are compared against.