[Paper Review] DeepLens: Shallow Depth Of Field From A Single Image
This paper proposes DeepLens, a deep learning framework that generates high-resolution, controllable shallow depth-of-field (DoF) effects from a single all-in-focus image using a neural network with three differentiable modules: depth prediction, lens blur, and guided upsampling. Trained on a combination of real RGB-D data and synthetic DoF images, the method achieves perceptually comparable results to iPhone Portrait Mode while enabling interactive control over focal plane and aperture size, with significantly fewer artifacts than prior single-image methods.
We aim to generate high resolution shallow depth-of-field (DoF) images from a single all-in-focus image with controllable focal distance and aperture size. To achieve this, we propose a novel neural network model comprised of a depth prediction module, a lens blur module, and a guided upsampling module. All modules are differentiable and are learned from data. To train our depth prediction module, we collect a dataset of 2462 RGB-D images captured by mobile phones with a dual-lens camera, and use existing segmentation datasets to improve border prediction. We further leverage a synthetic dataset with known depth to supervise the lens blur and guided upsampling modules. The effectiveness of our system and training strategies are verified in the experiments. Our method can generate high-quality shallow DoF images at high resolution, and produces significantly fewer artifacts than the baselines and existing solutions for single image shallow DoF synthesis. Compared with the iPhone portrait mode, which is a state-of-the-art shallow DoF solution based on a dual-lens depth camera, our method generates comparable results, while allowing for greater flexibility to choose focal points and aperture size, and is not limited to one capture setup.
Motivation & Objective
- To enable high-resolution, controllable shallow depth-of-field (DoF) image synthesis from a single all-in-focus image without requiring dual-lens hardware.
- To address the challenge of limited real-world paired data (all-in-focus and DoF images) by combining real RGB-D data for depth prediction with synthetic DoF data for blur and upsampling training.
- To improve boundary accuracy in depth maps by jointly training with salient object segmentation, enhancing performance on object edges.
- To achieve end-to-end differentiable training despite domain gaps between real and synthetic data by modularly training depth prediction on real data and blur/upsampling on artifact-free synthetic data.
- To enable interactive user control over focal plane and aperture size, allowing refocusing and blur adjustment after capture.
Proposed method
- The network architecture consists of three end-to-end differentiable modules: a depth prediction module trained on 2,462 real RGB-D images from dual-lens mobile phones, a lens blur module for spatially-varying blur prediction, and a guided upsampling module for high-resolution output generation.
- The depth prediction module is jointly trained with an auxiliary foreground segmentation task using existing salient object datasets to improve boundary accuracy and generalization.
- The lens blur and guided upsampling modules are jointly trained on a synthetic dataset with known depth and occlusion, enabling artifact-free supervision and robustness to depth errors via random depth distortion during training.
- The guided upsampling module is designed to be recurrently applied to generate high-resolution outputs (up to 2k) from low-resolution feature maps, enabling arbitrary resolution synthesis at test time.
- The system is trained in a piecewise manner: depth prediction on real data to generalize to real scenes, while blur and upsampling are trained on synthetic data to avoid artifacts from rendering pipelines.
- A hybrid training strategy is used to balance domain shift: real data for depth estimation and synthetic data for blur and upsampling, avoiding the propagation of rendering artifacts into the network.
Experimental results
Research questions
- RQ1Can a deep neural network generate high-resolution, controllable shallow DoF effects from a single all-in-focus image without dual-lens hardware?
- RQ2How can we train a system to produce realistic DoF effects when real paired training data (all-in-focus and DoF) is scarce and prone to rendering artifacts?
- RQ3To what extent can a model trained on synthetic DoF data generalize to real-world images when combined with real depth data for initial estimation?
- RQ4Can a modular training strategy—separating depth prediction from blur and upsampling—improve performance and reduce artifacts compared to end-to-end training on mixed data?
- RQ5How does the perceptual quality of the proposed method compare to state-of-the-art solutions like iPhone Portrait Mode, which rely on measured depth from dual-lens cameras?
Key findings
- The proposed method produces high-resolution shallow DoF images (up to 2048×2048) with user-controllable focal plane and aperture size, achieving interactive inference times of approximately 0.7 seconds for 2048×2048 resolution.
- User studies show that the method performs comparably to iPhone Portrait Mode in perceptual quality, despite relying on predicted depth rather than measured depth maps.
- The method significantly outperforms the state-of-the-art MegaDepth + RGB-D lens blur baseline in user preference studies, particularly on diverse and complex scenes.
- The use of a synthetic dataset with known depth and occlusion information enables artifact-free supervision for the lens blur and guided upsampling modules, reducing artifacts compared to baselines.
- The guided upsampling module can be applied recurrently to generate high-resolution outputs of arbitrary resolution, enabling scalable synthesis beyond the initial network resolution.
- Failure cases are primarily due to depth estimation errors, particularly on fine or complex structures like bird legs and grass, indicating that depth accuracy remains a key bottleneck.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.