Abstract
Depth from differential defocus (DfDD) is a physics-based depth estimation technique featuring high efficiency and simple optics. However, depth from defocus relies on scene texture, and existing DfDD methods produce sparse, noisy metric depth maps that lead to low accuracy when directly combined with existing depth refinement methods. In this work, we present Dense Depth from Differential Defocus (\(\mathbf{D^4}\)), a novel framework producing SOTA dense metric depth from a physics-based initialization and a data-driven depth prior. We combine an improved DfDD confidence equation with a physics-augmented lightweight network. Specifically, our network embeds DfDD's confidence-weighted depth map, augments a compressed ViT encoder with optics-conditioned frame-pair attention, and decodes depth with a DfDD-prompted head. We train for robustness to novel optics via on-the-fly approximate rendering and demonstrate zero-shot generalization across simulated and real-world datasets, including top-ranked performance on the real-world ZEDD benchmark.
Interactive Demo
Drag the line to compare any two depth maps on simulated indoor scenes from the Infinigen test split and real-world scenes from the ZEDD validation split. Note that ZEDD's ground-truth depth is measured with LiDAR and contains artifacts; black pixels have no valid measurement. For results on the ZEDD test split, see the ZEDD leaderboard.
Method
Overall pipeline of \(\mathbf{D^4}\). We first feed the RAW image pair into DfDD to compute depth ẑ and confidence C. We fine-tune a pretrained DAv2-Tiny backbone (green) with several new modules (purple) that are tailored to encode DfDD's physical information and trained from scratch. The network first takes in the defocused image pair and converts them into tokens, which are fed into the ViT encoder blocks (B0–B7) and averaged into a single branch after B2. The frame-pair attention blocks (FP0, FP1) apply self-attention to the image tokens at corresponding locations to exchange blur information across the pair. We condition FP0 and FP1 by converting DfDD's depth into blur sizes σ0, σ1 for each image and encoding them into the token space, normalized by confidence. We prompt the depth decoder with confidence-weighted metric depth from DfDD.
Results
Quantitative results across depth range on synthetic Infinigen rooms (100 images). (a) Our method (purple) has the lowest depth error among all types of methods. The gray bar chart shows the pixel depth distribution in this test set. (b) A histogram of depth predictions shows that most pixels fall within the 10% relative error range (white dashed line). (c) Ablation studies. The ViT conditioning and frame-pair attention provide the largest gains.
Quantitative results on Hypersim, Infinigen, and ZEDD (validation set). The number of test images is given in parentheses. Bold: best; underline: second best.
| Method | Hypersim (200) | Infinigen (100) | ZEDD (50) | Model size (M) |
Inference time (ms) |
|||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| AbsRel↓ | δ1↑ | MAE (m)↓ | AbsRel↓ | δ1↑ | MAE (m)↓ | AbsRel↓ | δ1↑ | MAE (m)↓ | ||||
| Monocular | DAv2 metric (ViT-S) | 0.413 | 0.132 | 2.419 | 0.394 | 0.060 | 1.584 | 0.314 | 0.325 | 1.255 | 24.8 | 19.4 |
| UniDepthV2 (ViT-L) | 0.314 | 0.542 | 1.538 | 0.168 | 0.796 | 0.630 | 0.328 | 0.381 | 1.025 | 353.8 | 42.5 | |
| UniK3D (ViT-L) | 0.329 | 0.571 | 1.629 | 0.231 | 0.643 | 0.856 | 0.328 | 0.470 | 1.032 | 358.8 | 44.1 | |
| DA3 metric (ViT-L) | 0.217 | 0.636 | 1.164 | 0.097 | 0.910 | 0.363 | 0.221 | 0.695 | 0.731 | 334.2 | 36.6 | |
| MoGe-3 (ViT-L) | 0.269 | 0.246 | 1.439 | 0.286 | 0.200 | 1.116 | 0.327 | 0.314 | 1.117 | 370.3 | 537.0 | |
| Depth refinement | OMNI-DC (v1.1) | 0.255 | 0.772 | 1.016 | 0.090 | 0.899 | 0.394 | 0.167 | 0.804 | 0.698 | 420.7 | 380.0 |
| Marigold-DC | 0.258 | 0.774 | 0.977 | 0.093 | 0.881 | 0.395 | 0.156 | 0.820 | 0.668 | 1290.0 | 14168.7 | |
| PromptDA (ViT-S) | 0.279 | 0.680 | 1.305 | 0.147 | 0.774 | 0.652 | 0.213 | 0.691 | 0.980 | 25.1 | 38.4 | |
| PriorDA (ViT-S) | 0.237 | 0.796 | 0.930 | 0.085 | 0.889 | 0.381 | 0.139 | 0.837 | 0.613 | 49.6 | 778.8 | |
| LingBot-Depth | 0.126 | 0.865 | 0.683 | 0.066 | 0.919 | 0.268 | 0.135 | 0.836 | 0.669 | 321.2 | 107.7 | |
| Defocus-based | Focal Split (ρ = 0.2) | 0.089 | 0.933 | 0.410 | 0.042 | 0.988 | 0.161 | 0.113 | 0.900 | 0.381 | N/A | 3.3 |
| Focal Split (ρ = 1.0) | 0.306 | 0.686 | 1.320 | 0.163 | 0.762 | 0.682 | 0.228 | 0.674 | 0.956 | N/A | 3.3 | |
| Blurry-Edges (sparse) | 0.159 | 0.851 | 0.750 | 0.081 | 0.925 | 0.381 | 0.118 | 0.845 | 0.551 | 8.3 | 61815.7 | |
| Blurry-Edges (dense) | 0.343 | 0.701 | 1.181 | 0.176 | 0.789 | 0.632 | 0.276 | 0.677 | 0.833 | 39.4 | 62445.6 | |
| FOSSA (ViT-S) | 0.091 | 0.924 | 0.572 | 0.057 | 0.982 | 0.260 | 0.103 | 0.881 | 0.496 | 42.5 | 63.1 | |
| FOSSA (ViT-B) | 0.085 | 0.948 | 0.544 | 0.062 | 0.986 | 0.292 | 0.102 | 0.906 | 0.489 | 168.4 | 168.1 | |
| FOSSA (2-stack, ViT-S) | 0.063 | 0.957 | 0.431 | 0.030 | 0.998 | 0.130 | 0.102 | 0.903 | 0.426 | 42.5 | 35.3 | |
| Ours (ViT-S) | 0.046 | 0.969 | 0.271 | 0.022 | 0.998 | 0.089 | 0.052 | 0.975 | 0.215 | 32.0 | 32.4 | |
| Ours (ViT-Tiny) | 0.038 | 0.972 | 0.198 | 0.022 | 0.996 | 0.090 | 0.058 | 0.970 | 0.229 | 23.6 | 27.3 | |
Qualitative results on Hypersim, Infinigen, and ZEDD. Our method shows accurate depth in challenging cases such as small plants (Hypersim), dim regions with low contrast (Infinigen), and real-world data (ZEDD).
BibTeX
@misc{li2026d4,
title={{$\mathbf{D^4}$}: Dense Depth from Differential Defocus},
author={Tianao Li and Mairui Li and Hongyu Wen and Praneeth Chakravarthula and Qi Guo and Emma Alexander},
year={2026},
eprint={2612.02375},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2612.02375},
}
Acknowledgements
We gratefully acknowledge the support of the NSF-Simons AI Institute for the Sky (SkAI) via grants NSF AST-2421845 and Simons Foundation MPS-AI-00010513. Praneeth Chakravarthula is supported by a DARPA Disruptive Idea Award seed grant on neuro-symbolic systems. Qi Guo is supported by the National Science Foundation (NSF) under grants No. 2431505 and 2544069. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the U.S. National Science Foundation. The authors would like to thank Yiming Zuo for help with the ZEDD data, Wei Xu for help with the Blurry-Edges evaluation, and Haiqian Han for helpful discussions.