\(\mathbf{D^4}\): Dense Depth from Differential Defocus

1Northwestern University, 2UNC Chapel Hill, 3Princeton University, 4Purdue University, 5NSF-Simons AI Institute for the Sky (SkAI)
arXiv preprint, 2026
(a) Depth and relative error maps of D4, Focal Split, FOSSA, LingBot-Depth, and DA3 metric on a ZEDD scene. (b) AbsRel versus inference time on ZEDD for all compared methods.

\(\mathbf{D^4}\) generates dense depth from differential defocus. (a) Our method combines the advantages of physics- and data-driven depth prediction, outperforming SOTA dense metric depth estimation methods across several categories: network-free (Focal Split), defocus-based networks (FOSSA), depth refinement networks (LingBot-Depth), and monocular prediction networks (DA3). (b) \(\mathbf{D^4}\) shows strong zero-shot generalization to the real-world ZEDD dataset, with SOTA accuracy and high computational efficiency.

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

Depth color scale in meters

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.

Infinigen
ZEDD
Left
Right

Method

Overall pipeline of D4: DfDD computes depth and confidence from the RAW image pair, which condition a lightweight ViT with frame-pair attention and a prompted depth decoder.

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

Depth error versus depth on Infinigen, depth prediction histogram, and ablation 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)↓
MonocularDAv2 metric (ViT-S)0.4130.1322.4190.3940.0601.5840.3140.3251.25524.819.4
UniDepthV2 (ViT-L)0.3140.5421.5380.1680.7960.6300.3280.3811.025353.842.5
UniK3D (ViT-L)0.3290.5711.6290.2310.6430.8560.3280.4701.032358.844.1
DA3 metric (ViT-L)0.2170.6361.1640.0970.9100.3630.2210.6950.731334.236.6
MoGe-3 (ViT-L)0.2690.2461.4390.2860.2001.1160.3270.3141.117370.3537.0
Depth refinementOMNI-DC (v1.1)0.2550.7721.0160.0900.8990.3940.1670.8040.698420.7380.0
Marigold-DC0.2580.7740.9770.0930.8810.3950.1560.8200.6681290.014168.7
PromptDA (ViT-S)0.2790.6801.3050.1470.7740.6520.2130.6910.98025.138.4
PriorDA (ViT-S)0.2370.7960.9300.0850.8890.3810.1390.8370.61349.6778.8
LingBot-Depth0.1260.8650.6830.0660.9190.2680.1350.8360.669321.2107.7
Defocus-basedFocal Split (ρ = 0.2)0.0890.9330.4100.0420.9880.1610.1130.9000.381N/A3.3
Focal Split (ρ = 1.0)0.3060.6861.3200.1630.7620.6820.2280.6740.956N/A3.3
Blurry-Edges (sparse)0.1590.8510.7500.0810.9250.3810.1180.8450.5518.361815.7
Blurry-Edges (dense)0.3430.7011.1810.1760.7890.6320.2760.6770.83339.462445.6
FOSSA (ViT-S)0.0910.9240.5720.0570.9820.2600.1030.8810.49642.563.1
FOSSA (ViT-B)0.0850.9480.5440.0620.9860.2920.1020.9060.489168.4168.1
FOSSA (2-stack, ViT-S)0.0630.9570.4310.0300.9980.1300.1020.9030.42642.535.3
Ours (ViT-S)0.0460.9690.2710.0220.9980.0890.0520.9750.21532.032.4
Ours (ViT-Tiny)0.0380.9720.1980.0220.9960.0900.0580.9700.22923.627.3
Qualitative depth results on Hypersim. Qualitative depth results on Infinigen. Qualitative depth results on the real-world ZEDD dataset.

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.