DECDM: Document Enhancement using Cycle-Consistent Diffusion Models

Jiaxin Zhang, Joy Rimchala, Lalla Mouatadid, Kamalika Das, Kumar Sricharan

TL;DR

DECDM (Document Enhancement using Cycle-Consistent Diffusion Models) is a new unsupervised framework that cleans up degraded document images—removing noise, shadows, and watermarks—without requiring paired "before and after" training data. By leveraging the deterministic mapping of Denoising Diffusion Implicit Models (DDIMs), it achieves state-of-the-art restoration quality while inherently protecting data privacy through decoupled training.

Abstract

The performance of optical character recognition (OCR) heavily relies on document image quality, which is crucial for automatic document processing and document intelligence. However, most existing document enhancement methods require supervised data pairs, which raises concerns about data separation and privacy protection, and makes it challenging to adapt these methods to new domain pairs. To address these issues, we propose DECDM, an end-to-end document-level image translation method inspired by recent advances in diffusion models. Our method overcomes the limitations of paired training by independently training the source (noisy input) and target (clean output) models, making it possible to apply domain-specific diffusion models to other pairs. DECDM trains on one dataset at a time, eliminating the need to scan both datasets concurrently, and effectively preserving data privacy from the source or target domain. We also introduce simple data augmentation strategies to improve character-glyph conservation during translation. We compare DECDM with state-of-the-art methods on multiple synthetic data and benchmark datasets, such as document denoising and shadow removal, and demonstrate the superiority of performance quantitatively and qualitatively.

Introduction

Optical Character Recognition (OCR) is the backbone of document intelligence, but its performance plummets when faced with real-world "noise" such as coffee stains, shadows, fading, or complex watermarks. Most existing enhancement tools rely on supervised learning, which requires massive datasets of paired noisy and clean images—pairs that are incredibly hard to find in real-world scenarios.

DECDM demonstrates robust performance across various document enhancement tasks, including denoising, shadow removal, and watermark removal.

Furthermore, training models on joint datasets raises significant privacy concerns, especially for sensitive financial or medical documents. Standard generative models also struggle with high-resolution documents, frequently damaging the fine structure of text characters (glyphs) during the translation process. DECDM addresses these challenges by reimagining document restoration as an unpaired image-to-image translation task using diffusion models.

Methodology

DECDM utilizes a cycle-consistent framework powered by Denoising Diffusion Implicit Models (DDIMs). The methodology is built on four key pillars:

1. Cycle-Consistent Diffusion

Instead of training a single model to "fix" images, DECDM trains two independent diffusion models: one that understands the distribution of noisy documents (Source) and one that understands clean documents (Target).

2. Deterministic ODE Mapping

By treating the diffusion process as an Ordinary Differential Equation (ODE), the model can map a noisy image forward into a "latent" noise representation and then reverse that process using the target model to generate a clean version. Because the ODE is deterministic, the mapping is mathematically reversible and cycle-consistent.

The deterministic ODE mapping process in DECDM, translating a noisy source image to a clean target via a latent noise representation.

3. Decoupled Training and Privacy

Because the source and target models are trained separately on their respective datasets, the system doesn't need to "see" both domains simultaneously. This allows for a federated-style approach where data privacy is maintained. User A can encode their private noisy data to a latent state, and User B can decode it using a model trained on their private clean data.

4. Sub-window & Slide-window Augmentation

To handle high-resolution 1024x1024 images, the authors divide documents into smaller patches (e.g., 256x256). This makes training feasible and acts as a powerful data augmentation strategy that helps the model learn character distributions more effectively, ensuring glyph conservation.

Experimental Results

The researchers evaluated DECDM across several challenging benchmarks, including document denoising (DatasetA and DatasetB) and shadow removal (SDSRD, RDSRD, etc.).

  • Denoising Performance: On DatasetA, DECDM achieved a PSNR of 24.30 and an OCR Accuracy (AC) of 0.8714, significantly higher than the raw data's 0.6931.
  • Shadow Removal: It achieved a PSNR of 45.73 on the SDSRD dataset, beating the previous supervised SOTA (BEDSR-Net) which sat at 43.59.
  • Qualitative Superiority: Visual results show that DECDM is particularly effective at removing complex shadows and watermarks that leave "ghosting" artifacts in other models like CycleGAN or TransUNet. The latent space acts as a structural anchor that keeps the text content intact while the "style" (noise vs. clean) is swapped.

Limitations and Future Work

While powerful, the authors note that diffusion models require multiple steps to solve the ODE, making inference slower than single-pass GANs. Future work could integrate OCR engines directly into the diffusion training loop to further optimize for semantic readability rather than just visual cleanliness. Additionally, while the windowing strategy helps, the model still requires a variety of document styles to generalize perfectly to entirely new fonts or layouts.

Conclusion

DECDM represents a significant advancement in document intelligence by providing a high-fidelity, privacy-preserving, and unsupervised method for document enhancement. By decoupling the training process and utilizing deterministic ODE mapping, it offers a scalable solution for real-world document restoration tasks where paired data is unavailable.

Summary updated

BibTeX
@inproceedings{zhang2024decdm,
  author = {Jiaxin Zhang and Joy Rimchala and Lalla Mouatadid and Kamalika Das and Kumar Sricharan},
  title = {{DECDM: Document Enhancement using Cycle-Consistent Diffusion Models}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2024},
  url = {https://openreview.net/forum?id=kqOkxJ9v1C},
}
Figure