Abstract
Automated document processing is frequently hindered by real-world degradations such as stains, wrinkles, and watermarks. This paper presents DE-GAN, an end-to-end framework based on Conditional Generative Adversarial Networks (cGANs) designed for document restoration. By employing a U-Net generator with skip connections and a specialized hybrid loss function, DE-GAN preserves fine textual details while effectively removing noise. Evaluations across standard benchmarks like DIBCO and a custom watermark dataset demonstrate that DE-GAN significantly outperforms existing methods, notably reducing OCR character error rates from 37% to 1%.
Introduction
The digitization of historical and modern documents is often complicated by physical noise—coffee stains, faded ink, or poor lighting conditions. Traditional document binarization methods, which rely on thresholding to separate text from background, often fail when noise intensity matches that of the ink. While deep learning models like auto-encoders have shown promise, they frequently suffer from information loss during the bottleneck phase, leading to blurred or missing characters. DE-GAN addresses these issues by treating document enhancement as an image-to-image translation task, capable of handling diverse degradations including binarization, deblurring, and watermark removal.
Methodology
DE-GAN utilizes a conditional GAN (cGAN) architecture, where the generator is conditioned on the degraded input image rather than random noise.
The Generator (U-Net)
The generator uses a U-Net architecture to mitigate the information loss typical of standard auto-encoders. Skip connections transfer high-resolution features directly from the encoder to the decoder, ensuring that fine strokes and character details are preserved in the output. This architecture allows the model to maintain spatial consistency while reconstructing the clean image.
Discriminator and Loss Function
A Fully Convolutional Network (FCN) acts as the discriminator, learning to distinguish between the generator's restored images and ground-truth clean documents. The training objective combines adversarial loss with a weighted pixel-wise log loss. This hybrid approach ensures spatial and textual fidelity, preventing the model from generating artifacts or "hallucinating" incorrect characters.
Experiments and Results
The model was evaluated on several benchmarks, including the Noisy Office Database and various DIBCO datasets. Key results include:
- Binarization: On the DIBCO 2013 dataset, DE-GAN achieved a PSNR of 24.9, surpassing the previous state-of-the-art of 21.4.
- Watermark Removal: Using a custom dataset of 1,000 synthetic watermarked pairs, the model reached a PSNR of 40.98, significantly higher than general-purpose image restoration methods.
- OCR Performance: The ultimate test of document enhancement is machine readability. Using the Tesseract OCR engine, the Character Error Rate (CER) on degraded documents was slashed from 37% to just 1% after processing with DE-GAN.
Conclusion
DE-GAN provides a robust, end-to-end solution for document restoration without requiring complex pre- or post-processing. By leveraging the adversarial training of cGANs and the detail-preserving nature of U-Nets, it sets a new standard for document binarization and cleaning. Future work will explore integrating OCR feedback directly into the training loop and optimizing the model for geometric distortions common in mobile photography.
Summary updated