Learning Single Image Defocus Deblurring with Misaligned Training Pairs

Yu Li, Dongwei Ren, Xinya Shu, Wangmeng Zuo

Abstract

Single image defocus deblurring is a critical task in computational photography, yet its progress is often hampered by the quality of training data. Existing models frequently produce geometric distortions because they are trained on "misaligned" image pairs where the blurry input and sharp ground-truth (GT) do not perfectly overlap. We present Joint Deblurring and Reblurring Learning (JDRL), a training framework designed to handle these spatial shifts. By combining an adaptive deblurring module that utilizes optical flow for alignment with a spatially invariant reblurring module constrained by isotropic kernels, JDRL significantly reduces artifacts and improves deblurring performance across multiple benchmarks.

Introduction

Defocus deblurring aims to recover a sharp image from a capture with a shallow depth of field. To train deep learning models for this task, researchers typically rely on pairs of images: a blurry input ($I_B$) and a sharp ground-truth ($I_S$). However, capturing these pairs is technically challenging. Even with stabilized setups, changing the aperture between shots often introduces subtle mechanical shifts or focal length variations. When models are trained using standard pixel-wise losses (like MSE or L1) on such misaligned data, they inadvertently learn to compensate for spatial shifts, leading to warped edges and distorted shapes in the final output.

The Challenge of Misalignment

The core issue in defocus deblurring datasets is that the spatial relationship between the blurry and sharp images is not purely a matter of focus. Mechanical movement of the lens during capture creates tiny "shifts" or "zooms."

Figure 5: Misalignment in the DPDD dataset. The zoom-ins highlight spatial shifts between the blurry input (IB) and sharp ground-truth (IS), which can lead to training artifacts.

As shown in Figure 5, even high-quality datasets like DPDD exhibit these subtle misalignments. Standard training forces the network to map a pixel in the blurry image to a spatially offset pixel in the sharp image, causing the network to learn a "deformation" rather than a pure "deblurring" function.

Proposed Method: JDRL

The JDRL framework addresses this by decoupling the learning process into two cooperative modules:

1. Adaptive Deblurring Module ($M_d$)

To tolerate misalignment, the framework estimates the optical flow between the deblurred result and the GT image. It then warps the GT image to align with the deblurred output before calculating the loss. To ensure the flow estimation does not introduce new errors, the authors implement a calibration mask to ignore regions with unreliable flow and a cycle deformation check for consistency.

2. Spatially Invariant Reblurring Module ($M_r$)

To maintain physical consistency, the framework "reblurs" the deblurred result back to the original blurry state. Crucially, this module predicts isotropic (circularly symmetric) blur kernels in polar coordinates. Because these kernels are symmetric, the module cannot "cheat" by shifting pixels to match the input; it is forced to model the actual physics of defocus, ensuring the deblurring module focuses purely on sharpness rather than spatial correction.

Datasets and Evaluation

The study evaluates JDRL on three primary datasets:

  • DPDD: The standard real-world defocus deblurring benchmark.
  • RealDOF: A dual-camera dataset used for testing generalization.
  • SDD (Single Image Defocus Deblurring): A new dataset introduced in this work, containing 150 high-resolution (4K) pairs with intentional, diverse misalignments to serve as a rigorous benchmark.
Figure 1: Example of a real-world scene from the training data, showing the blurry input (IB) and the corresponding sharp ground-truth (IS).

Key Results

JDRL acts as a "plug-and-play" framework that improves existing architectures like MPRNet and UNet. On the SDD dataset, applying JDRL to MPRNet boosted the PSNR from 26.28 dB to 26.88 dB and significantly improved perceptual similarity (LPIPS). Visually, JDRL-trained models preserve the original geometry of scenes, avoiding the "bending" of straight lines common in vanilla-trained models. Furthermore, models trained with JDRL on DPDD showed superior generalization when tested on the RealDOF dataset, indicating that the framework learns more fundamental features of blur.

Conclusion

By acknowledging that misalignment is an inherent property of real-world data acquisition, JDRL shifts the focus from building "perfect" datasets to designing robust training objectives. The combination of flow-based alignment and isotropic reblurring constraints provides a powerful solution for high-fidelity defocus deblurring without geometric distortion.

Summary updated

BibTeX
@inproceedings{li2023learning,
  author = {Yu Li and Dongwei Ren and Xinya Shu and Wangmeng Zuo},
  title = {{Learning Single Image Defocus Deblurring with Misaligned Training Pairs}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i2.25235},
}
Figure