NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Repurposing Diffusion-Based Image Generators for Monocular Depth Estimation

Bingxin Ke, Anton Obukhov, Shengyu Huang, Nando Metzger, Rodrigo Caye Daudt, Konrad Schindler

Introduction

Monocular depth estimation—predicting 3D distance from a single 2D image—is a fundamentally ill-posed problem. To solve it effectively, a model needs more than just geometric rules; it requires a deep, "encyclopedic" understanding of the visual world. While traditional deep learning models have made progress, they often struggle to generalize to unfamiliar scenes because they lack the broad visual priors necessary to interpret complex environments.

Marigold addresses this by repurposing the massive visual knowledge stored in generative models like Stable Diffusion. By fine-tuning a pre-trained image generator, the researchers created a tool that generalizes to real-world scenes far better than models trained on millions of real-world depth samples.

Methods: Leveraging Generative Priors

The core innovation of Marigold is shifting the strategy from learning depth from scratch to extracting it from a model that already understands scene layouts.

  1. Foundation: The system uses a pre-trained Stable Diffusion (v2) model, which has already learned complex visual relationships from billions of internet images.
  2. Latent Space Adaptation: Marigold operates within the latent space of a Variational Autoencoder (VAE). Both the input RGB image and the target depth map are encoded into this compressed representation.
  3. Fine-Tuning the U-Net: The central denoising U-Net is modified to accept a concatenated input: the latent code of a noisy depth map and the latent code of the input image. Only the U-Net is fine-tuned, preserving the generative "prior" knowledge of the rest of the architecture.
Marigold training pipeline: The model fine-tunes the Stable Diffusion U-Net to predict depth by concatenating the latent representations of the input image and a noisy depth map.
  1. Annealed Multi-Resolution Noise: A novel noise schedule is used during training to help the model converge faster and produce more consistent results across different scales.
  2. Test-Time Ensembling: Since diffusion is stochastic, Marigold runs multiple inference passes with different starting noise. These predictions are then aligned and merged using a specialized optimization algorithm to produce a single, high-quality depth map.

Training on Synthetic Data

Remarkably, Marigold was trained exclusively on synthetic data, specifically the Hypersim (indoor) and Virtual KITTI (outdoor) datasets. Despite never seeing a real-world depth map during training, the model's reliance on pre-existing generative priors allows it to achieve exceptional zero-shot generalization on real-world benchmarks like NYUv2, KITTI, and ETH3D.

Key Results and Performance

Marigold achieved state-of-the-art performance across nearly all zero-shot benchmarks. On the NYUv2 dataset, it reached an Absolute Relative Error (AbsRel) of 5.5%, a significant improvement over the previous best of 6.9%.

Qualitative comparison of Marigold against existing state-of-the-art models across various real-world datasets. Marigold demonstrates superior detail and geometric consistency.

Beyond numerical metrics, Marigold exhibits high geometric fidelity. It produces sharp edges and flat surfaces (like walls) where other models often generate "wavy" or blurry artifacts. This is attributed to the generative model "knowing" the typical structure of objects and environments. Furthermore, the model is affine-invariant, meaning it can handle various camera lenses and scenes without requiring specific calibration data.

Limitations and Future Work

The primary trade-off for Marigold's accuracy is speed. As a diffusion-based model, it requires multiple iterations (typically 50 steps) to generate a result, making it significantly slower than single-pass CNN or Transformer models. This currently limits its application in real-time robotics. Additionally, the stochastic nature of the process necessitates ensembling for peak performance, further increasing computational costs. Future research aims to "distill" Marigold into a faster, single-step model to combine its high accuracy with real-time feasibility.

Summary updated

BibTeX
@inproceedings{ke2023repurposing,
  author = {Bingxin Ke and Anton Obukhov and Shengyu Huang and Nando Metzger and Rodrigo Caye Daudt and Konrad Schindler},
  title = {{Repurposing Diffusion-Based Image Generators for Monocular Depth Estimation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
}
Figure