TL;DR
PrimeDepth achieves high-quality, zero-shot monocular depth estimation by extracting a rich "preimage" from a frozen Stable Diffusion model in just a single denoising step. This approach makes it over 100× faster than iterative diffusion-based methods like Marigold while preserving intricate structural details and significantly improving robustness in challenging real-world scenes.
What Problem Does This Paper Address?
Monocular depth estimation—predicting 3D depth from a single 2D image—is a foundational task in computer vision. Recently, two competing paradigms have emerged for "zero-shot" settings (where the model generalizes to unseen environments):
- Data-driven methods (e.g., Depth Anything): These models are fast at inference but require massive datasets (millions of labeled and unlabeled images) and often produce blurry depth maps that miss fine structural details.
- Diffusion-based methods (e.g., Marigold): These repurpose generative Text-to-Image foundation models like Stable Diffusion. Because these foundation models already "understand" the 3D world, they require very little training data and produce highly detailed depth maps. However, they are incredibly slow at test time because they require running the diffusion denoising process iteratively (often 50+ steps) across an ensemble of outputs.
PrimeDepth bridges this gap, delivering the rich, detailed depth maps characteristic of diffusion models but at a fraction of the computational cost.
Methods
The core innovation of PrimeDepth is the preimage, a rich image representation extracted from Stable Diffusion (SD 2.1) using only a single denoising step.
Instead of iteratively generating a depth map from noise, the authors pass the input image through a frozen SD U-Net for just one step ($f(z_1)$). They extract all intermediate multi-scale feature maps, cross-attention maps, and self-attention maps from this single pass.
To make the massive self-attention maps computationally tractable, PrimeDepth introduces a regional pooling strategy, dividing the maps into $8 \times 8$ regions and averaging within them.
Unlike previous methods that alter the foundation model's weights or flatten features into a single block, PrimeDepth keeps the base SD model completely frozen to preserve its generalization power. The extracted preimage is then fed into a preimage refiner network designed with an architectural inductive bias—it mirrors the architecture of the SD decoder but at 50% of the channel size, processing the preimage features gradually across resolution scales. Finally, downstream heads predict both the depth map (optimized in the pixel domain via a scale-and-shift invariant loss) and a semantic segmentation map used for regularization.
Datasets
PrimeDepth is trained efficiently on a fraction of the data used by purely data-driven approaches:
- Pre-training: 600K images from the LAION-Aesthetics dataset using pseudo-ground truth.
- Training: Just 74K synthetic images from Hypersim and Virtual KITTI 2.
For evaluation, the authors test on five unseen datasets: KITTI, NYUv2, ETH3D, rabbitai, and a manually curated benchmark introduced in this paper called nuScenes-C. The nuScenes-C dataset contains 3,489 images split into 6 challenging real-world categories (e.g., Day Rain, Night, Night Dark, Night Rain) to evaluate model robustness against adverse weather and lighting.
Key Insights and Ideas
- The Power of the Single Step: The final step of a diffusion model contains the most structurally coherent and semantic information with the least amount of generative "hallucination." Iterative denoising isn't necessary for discriminative downstream tasks.
- Don't Touch the Weights: Fine-tuning the internal weights of a foundation model (as Marigold does) can actually degrade its generic representation capabilities. Keeping Stable Diffusion frozen retains its robustness, especially in extreme conditions like nighttime scenes.
- Architectural Inductive Bias Matters: Feeding multi-scale features into a refiner network that mirrors the original decoder structure performs significantly better than flat block aggregation methods used in prior work.
- Complementary Strengths: Diffusion-based features and transformer-based data-driven features (like Depth Anything) fail in different ways. Because their errors are uncorrelated, a simple pixel-wise average of their predictions yields a massive performance boost.
Key Results
- Speedup: PrimeDepth is over 100× faster than Marigold. For a $512 \times 512$ image on an NVIDIA A100 GPU, PrimeDepth takes 0.39 seconds compared to Marigold's 43.16 seconds. It is only about 4× slower than Depth Anything, effectively closing the speed gap between diffusion and transformer-based approaches.
- Robustness: On the challenging nuScenes-C dataset, PrimeDepth consistently outperforms Marigold, particularly in nighttime and rainy conditions where Marigold's performance drops sharply.
- New State-of-the-Art: While Depth Anything remains the top standalone model due to its massive training corpus, a simple pixel-wise average of Depth Anything and PrimeDepth outperforms both, setting a new state-of-the-art in zero-shot monocular depth estimation.
Limitations and Future Work
The authors note a few remaining failure modes:
- Like many monocular depth estimators, PrimeDepth occasionally struggles to correctly place the sky region at infinity.
- Physical obstructions on the lens, such as water drops during rain scenes, can be misinterpreted as actual round objects within the 3D environment.
For future work, the authors suggest that large-scale data-driven models could benefit significantly from integrating the Stable Diffusion preimage directly into their architectures.
Summary updated