Abstract
Estimating depth from a single RGB image is a fundamental computer vision task typically addressed through supervised deep learning. However, supervised models often overfit to dataset-specific semantic cues. This work introduces an unsupervised approach that leverages depth-from-defocus (DfD) cues. By utilizing a novel, differentiable Point Spread Function (PSF) convolutional layer, we train a network to predict depth maps that facilitate the "re-rendering" of focused images. Our method achieves results on par with supervised techniques on the KITTI and Make3D datasets and demonstrates superior cross-dataset generalization by relying on universal optical physics rather than scene semantics.
Introduction: The Challenge of Monocular Depth
Monocular depth estimation is inherently ill-posed. While supervised models can achieve high accuracy, they often rely on "semantic shortcuts"—for instance, learning that the bottom of an image usually represents a nearby road. This leads to poor performance when the model encounters unfamiliar environments.
To address this, we turn to defocus blur, a physical property of optics. The amount of blur, or the Circle of Confusion (CoC), is directly related to an object's distance from the lens. By grounding depth estimation in these physical laws, we create a model that is more robust and generalizes better across diverse scenes, from indoor rooms to outdoor highways.
Methodology
Differentiable PSF Convolutional Layer
The core of our approach is a differentiable PSF layer that simulates camera lens behavior. This layer takes an all-in-focus image, a predicted depth map, and camera parameters (aperture, focal length) to apply location-specific Gaussian kernels. This process renders a version of the scene with depth-dependent blur.
Training Pipeline
During training, the network (an encoder-decoder based on DeepLabV3+) predicts a depth map from an input image. This map is passed to the PSF layer to generate a reconstructed focused image. The loss is then calculated by comparing this reconstruction to a target focused image from the training set. This allows the network to learn depth by minimizing the error in its predicted blur.
To capture both local blur details and global context, we enhance the architecture with a Dense ASPP (Atrous Spatial Pyramid Pooling) module and self-attention mechanisms. The entire rendering process is implemented in CUDA, enabling efficient backpropagation.
Experiments and Results
We evaluated our method across five major benchmarks, including the Lightfield, DSLR, KITTI, NYU DepthV2, and Make3D datasets. For datasets like KITTI that lack natural focus stacks, we utilized ground-truth depth to render synthetic focus images for training.
Performance and Generalization
Our method significantly outperformed previous DfD baselines on the Lightfield dataset (PSNR of 38.33 vs. 36.90). On KITTI and Make3D, our unsupervised approach performed on par with top-tier fully supervised methods.
The most significant advantage was observed in cross-domain generalization. When trained on indoor scenes (NYU) and tested on outdoor scenes (KITTI), our model consistently outperformed supervised models like DORN. This confirms that defocus cues provide a more universal and robust signal for depth than semantic recognition.
Conclusion
By integrating the physics of defocus into the training loop of a neural network, we have developed a monocular depth estimator that is both accurate and highly generalizable. While challenges remain—such as the inherent depth ambiguity in the Circle of Confusion and the computational cost of large kernels—this work demonstrates that differentiable physical rendering is a powerful tool for unsupervised computer vision.
Summary updated