DualFocus: Unsupervised DP Deblurring
- DualFocus is an unsupervised method that jointly estimates a defocus map and recovers an all-in-focus image from a single dual-pixel capture using an explicit optical model.
- It uses a one-time, device-specific calibration to capture spatially varying, non-parametric PSFs, accounting for real-world lens aberrations and vignetting.
- The joint optimization framework integrates bias-correction and robust regularizers, achieving superior reconstruction quality compared to prior DP deblurring methods.
Searching arXiv for the primary paper and closely related dual-pixel defocus deblurring work. DualFocus is an unsupervised computational photography method for jointly estimating a defocus map and recovering an all-in-focus image from a single dual-pixel (DP) capture. It is built around an explicit optical model of DP sensing, device-specific calibration of spatially varying point-spread functions (PSFs), and a joint optimization over latent sharp appearance and per-pixel defocus. Within the DP deblurring literature, its distinguishing feature is that it treats defocus-map estimation and blur removal as a single coupled inverse problem rather than as two independently trained tasks (Xin et al., 2021).
1. Position within dual-pixel imaging
Dual-pixel sensors split each photosite into two sub-pixels that observe complementary halves of the aperture. As a result, a single exposure contains two sub-aperture views whose relative displacement encodes defocus disparity. This sensing model was introduced for autofocus, but later work used DP data for depth estimation, reflection removal, and defocus deblurring (Abuolaim et al., 2021).
DualFocus belongs to the defocus-deblurring branch of this line of work, but it differs materially from several neighboring approaches. The Multi-task DP Network (MDP) uses a single blurry combined image and jointly predicts the left and right DP views together with the all-in-focus image in a multi-task U-Net-style architecture (Abuolaim et al., 2021). MCCNet instead assumes access to the left and right DP views and inserts explicit multi-scale row-wise cross-correlation modules so that horizontal disparity cues guide deblurring (Swami, 16 Feb 2025). ATTSF also consumes the two DP sub-images directly, but relies on dual-attention encoders and triple-local/global-local bottleneck modules (Vo, 2021). By contrast, DualFocus is optimization-based, uses a one-time calibration on the target device, and is entirely unsupervised after calibration (Xin et al., 2021).
This placement is significant because the method addresses two longstanding difficulties simultaneously: the ill-posedness of single-image defocus removal and the scarcity of labeled defocus maps or paired all-in-focus ground truth. The DP observation model provides additional geometric structure, and DualFocus exploits that structure through calibrated rendering and regularized inference rather than through purely feed-forward supervised regression (Xin et al., 2021).
2. Optical model and calibrated PSFs
The method starts from a DP image-formation model in which the latent all-in-focus radiance and the signed defocus map jointly generate the observed left and right DP images:
Here and are the left- and right-half-aperture PSFs, and the sign of indicates whether a point lies in front of or behind the focal plane. Equivalently, the two PSFs can be written as with and (Xin et al., 2021).
A central design decision is that DualFocus does not impose a strong parametric PSF model such as a Gaussian. Instead, it performs a one-time calibration on the target device. A dense grid of small bright disks is displayed on a monitor at fixed focus distance, both DP images are captured, and an spatially varying grid of non-parametric PSFs is estimated at a reference blur size 0 using the method of Mannan and Langer. PSFs at other blur sizes are then obtained by spatial rescaling:
1
with the same construction for 2. Left/right vignetting is corrected by dividing by per-channel white-sheet responses 3 and 4 (Xin et al., 2021).
This calibration strategy is consequential because real DP optics deviate from ideal half-disk PSFs. The calibrated, spatially varying, non-parametric kernels absorb real-lens aberrations and vignetting, so the forward model used during optimization more closely matches the device than an idealized thin-lens approximation would (Xin et al., 2021).
3. Joint estimation of sharp image and defocus map
DualFocus formulates deblurring and defocus-map estimation as a single optimization problem. A naive least-squares data term,
5
is explicitly rejected as insufficient for three reasons stated in the method description: it is biased toward artificially small kernels in the presence of noise, the inverse problem is underconstrained, and spatial regularity must be enforced (Xin et al., 2021).
To address the small-kernel bias, the method derives an analytic bias-correction term 6 that approximates the tendency of the 7 objective under Gaussian noise of variance 8 to prefer small 9. The resulting data term uses a robust Charbonnier penalty:
0
Here 1 is the DP view rendered from the current estimate, and 2 is assembled from per-layer bias corrections weighted by defocus transmittance (Xin et al., 2021).
The method then introduces a multiplane image (MPI) representation with 3 fronto-parallel planes at defocus levels 4. Each plane consists of an in-focus image 5 and opacity 6. The all-in-focus estimate is
7
Each DP view is rendered by convolving 8 with the corresponding half-aperture PSF 9, modulating by the defocused transmittance 0, and summing over planes (Xin et al., 2021).
The full objective is
1
The auxiliary term 2 encourages each layer’s blurred content to match the observations when weighted by transmittance. 3 imposes edge-aware total variation on 4 and on each 5. 6 regularizes 7 and the defocused transmittance. 8 is a per-pixel Renyi collision-entropy penalty that pushes each pixel toward a single dominant depth plane (Xin et al., 2021).
The significance of this construction is methodological rather than merely architectural. The DP views are not treated as auxiliary channels for a learned predictor; they appear directly in a calibrated rendering objective. The defocus map and the deblurred image are therefore mutually constrained by the same physical model, and the regularizers are designed to produce spatially smooth yet edge-aligned depth and appearance (Xin et al., 2021).
4. Unsupervised inference and numerical solver
Because the loss depends only on the observed DP images and the pre-calibrated PSFs, the method requires no labeled defocus maps and no paired sharp targets. After calibration, any DP image can be processed in an entirely unsupervised manner (Xin et al., 2021).
The implementation is in JAX and optimizes the MPI parameters 9 with Adam. The reported settings are 0 planes, a front-plane kernel of approximately 1, a back-plane kernel of approximately 2, and planes uniformly spaced in diopters. Optimization runs for 3 iterations with a learning rate decayed from 4 to 5, uses one Titan RTX GPU, and requires approximately two hours per image (Xin et al., 2021).
Two additional preprocessing details are part of the method specification. First, the input DP images are denoised with a burst-denoiser to reduce Poisson-Gaussian noise before optimization. Second, input intensities are normalized so that their mean is approximately 6 (Xin et al., 2021).
These details indicate that DualFocus is not a real-time deployment method in its original form. It is a calibrated inverse solver whose emphasis is physical fidelity and unsupervised recoverability rather than throughput. A plausible implication is that its main value lies in high-quality reconstruction and accurate defocus estimation on devices where a one-time calibration is feasible.
5. Empirical results
The reported evaluation uses a newly captured Pixel 4 dataset containing 17 indoor and outdoor scenes, with ground truth obtained from a 36-slice focus stack. On this dataset, DualFocus achieves all-in-focus reconstruction quality of 26.69 dB PSNR and 0.804 SSIM. The same benchmark reports Wiener deconvolution at 25.81 dB PSNR and 0.704 SSIM, and DPDNet at 25.59 dB PSNR and 0.777 SSIM (Xin et al., 2021).
| Method | All-in-focus quality |
|---|---|
| Wiener deconvolution | 25.81 dB PSNR, 0.704 SSIM |
| DPDNet | 25.59 dB PSNR, 0.777 SSIM |
| DualFocus | 26.69 dB PSNR, 0.804 SSIM |
For defocus-map estimation, DualFocus reports 7, 8, and 9. The comparison given for Garg et al. [ICCV’19] is 0.079, 0.102, and 0.208 respectively (Xin et al., 2021).
The qualitative characterization in the method summary is equally specific. DualFocus is reported to recover sharper textures with fewer ringing artifacts and to produce depth maps that remain accurate in textureless regions. Ablation studies identify the bias-correction term and each regularizer as necessary components. The paper’s summary concludes that the method improves upon prior work for both defocus-map estimation and blur removal despite being entirely unsupervised (Xin et al., 2021).
These results matter because they show that a calibrated unsupervised formulation can compete directly with supervised DP deblurring methods on both image restoration and defocus inference. In the paper’s framing, the gain comes from solving the two tasks jointly rather than from treating either as an isolated regression problem.
6. Relation to adjacent methods and reuse of the name
Within computational photography, DualFocus sits alongside several distinct DP-based or dual-camera methods. MDP pretrains on unpaired DP imagery, jointly synthesizes left and right DP views from a single blurry image, and reports 25.35 dB PSNR, with synthesized DP views at approximately 39 dB PSNR on ground-truth DP data (Abuolaim et al., 2021). MCCNet operates directly on the two DP views, computes explicit multi-scale cross-correlation, and reports 25.85 dB PSNR, 0.802 SSIM, and 0.037 MAE on DPDD with 5.52 M parameters (Swami, 16 Feb 2025). ATTSF uses dual-attention encoders and reports 25.98 dB PSNR, 0.8115 SSIM, and 0.0377 MAE on the NTIRE 2021 challenge benchmark (Vo, 2021). DC0 is adjacent in application but not in sensing model: it fuses a primary wide camera and an ultra-wide camera to enable defocus control, refocus, and bokeh synthesis rather than single-DP unsupervised inference (Alzayer et al., 2023).
The name “DualFocus” is also used in unrelated later work. It names a macro/micro perspective mechanism for multi-modal LLMs (Cao et al., 2024), a text-based person re-identification framework built around positive and negative descriptors (Deng et al., 2024), and a depth-from-focus method with spatio-focal dual variational constraints (Woo et al., 26 Sep 2025). This establishes that “DualFocus” is a polysemous research label rather than a uniquely identifying term across arXiv.
In the narrower context of dual-pixel defocus recovery, however, the term refers specifically to the unsupervised method described above: a calibrated, physics-based, MPI-regularized optimization framework for jointly estimating defocus and restoring all-in-focus imagery from a single DP capture (Xin et al., 2021).