Learning A Coarse-to-Fine Diffusion Transformer for Image Restoration

Liyan Wang, Qinyu Yang, Cong Wang, Wei Wang, Jinshan Pan, Zhixun Su · DOI

Introduction

Image restoration tasks, such as deraining, deblurring, and denoising, are fundamental challenges in computer vision. Traditional Convolutional Neural Networks (CNNs) often struggle with long-range dependencies due to their local receptive fields. While Transformers address this by modeling global context, they sometimes lack the generative capacity required for sharp texture reconstruction. Diffusion Models (DMs) have emerged as a powerful alternative for generating realistic details, but they face a significant hurdle: standard DMs predict noise, and even minor estimation errors can compound during iterative sampling, leading to blurry or artifact-heavy results.

To address these limitations, we present the Coarse-to-Fine Diffusion Transformer (C2F-DFT). This framework combines the generative power of Diffusion Models with the long-range modeling capabilities of Transformers through a novel two-stage training strategy.

Methodology

The C2F-DFT architecture utilizes a 4-level U-shaped Transformer backbone. Instead of standard UNet blocks, it employs Diffusion Transformer Blocks (DFTBs).

Architecture Components

As shown in the architecture diagram, each DFTB consists of two primary modules:

  1. Diffusion Self-Attention (DFSA): Designed to capture long-range dependencies across the image.
  2. Diffusion Feed-Forward Network (DFN): Learns hierarchical representations of the image features.

A critical feature of this design is the direct embedding of the diffusion time-step ($t$) into these modules. This "time-step awareness" allows the Transformer to adapt its behavior dynamically based on the current noise level in the denoising process.

The architecture of the Diffusion Transformer Model (DFT) and its internal components, including DFSA and DFN modules.

Two-Stage Training Strategy

The training process is divided into two distinct phases to bridge the gap between noise estimation and structural accuracy:

  • Coarse Training Stage: The model follows the standard diffusion approach, learning to estimate the noise ($\epsilon_t$) added to a clean image.
  • Fine Training Stage: To correct errors from imperfect noise estimation, the sampling process is fixed to 4 steps. The model is then optimized by comparing the final restored image directly against the ground truth using $L_1$ and SSIM losses. This "pixel-level" optimization ensures high-fidelity restoration.

Additionally, a Patch-Cycle Strategy is employed, cyclically training on different patch sizes (32x32, 64x64, and 128x128) to capture multi-scale context efficiently.

Experimental Results

The C2F-DFT was evaluated across several benchmarks for deraining (Rain13K), deblurring (GoPro), and denoising (SIDD, DND).

Quantitative Performance

C2F-DFT achieved state-of-the-art or highly competitive results:

  • Deraining: Outperformed the IR-SDE baseline by 6.81dB PSNR on average and surpassed Restormer on multiple benchmarks.
  • Deblurring: Achieved a PSNR of 36.34 dB on the RealBlur-R dataset.
  • Denoising: Reached 39.95 dB PSNR on the DND benchmark, exceeding the performance of NAFNet.

Qualitative Analysis

The impact of the two-stage training is most evident in visual comparisons. The "Fine" training stage effectively removes the "haze" and artifacts often present in standard coarse diffusion outputs, resulting in sharper and more accurate reconstructions.

Qualitative comparison showing the progression from the noisy input to coarse restoration, fine restoration, and the ground truth.

Discussion and Conclusion

The success of C2F-DFT highlights two key insights. First, while training on noise provides a strong prior, optimizing for pixels in a second stage is vital for high-fidelity restoration. Second, Transformers are exceptionally well-suited as diffusion backbones for restoration tasks due to their ability to relate distant pixels, which is essential for handling global degradation patterns like rain streaks.

Despite its performance, the model faces challenges common to diffusion frameworks, including slower sampling speeds compared to single-pass models and high computational overhead during training on large patches. Future work may focus on more efficient sampling algorithms or extending this coarse-to-fine logic to video restoration.

Summary updated

BibTeX
@misc{wang2023learning,
  author = {Liyan Wang and Qinyu Yang and Cong Wang and Wei Wang and Jinshan Pan and Zhixun Su},
  title = {{Learning A Coarse-to-Fine Diffusion Transformer for Image Restoration}},
  year = {2023},
  eprint = {2308.08730},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.08730},
}
Figure