Enhance to read better: A Multi-Task Adversarial Network for Handwritten Document Image Enhancement

Sana Khamekhem Jemni, Mohamed Ali Souibgui, Yousri Kessentini, Alicia Fornés · DOI

Introduction

Historical handwritten documents are invaluable cultural artifacts, yet they are frequently plagued by degradation. Aging, ink bleed-through, physical wear, and poor scanning quality often render these texts difficult for both humans and machines to read. While Handwritten Text Recognition (HTR) systems are designed to digitize these records, their performance drops significantly on noisy images.

Traditional document enhancement, or binarization, typically focuses on pixel-level similarity to a "clean" ground truth. However, a visually clean image does not always equate to a readable one. Subtle distortions in character strokes can lead to high error rates in HTR engines. This paper introduces a multi-task Generative Adversarial Network (GAN) that optimizes for both visual quality and linguistic readability.

The Multi-Task Architecture

The core innovation of this research is the integration of a handwritten text recognizer directly into the training loop of a GAN. This forces the generator to produce outputs that are not only visually realistic but also preserve the structural integrity of the text.

The multi-task architecture featuring a Generator, Discriminator, and HTR component.

The architecture consists of three primary modules:

  1. The Generator: A U-Net-based auto-encoder that transforms degraded images into clean, binarized versions. Skip connections are utilized to maintain fine-grained details.
  2. The Discriminator: A standard adversarial component that distinguishes between generated images and real ground-truth binarized images.
  3. The Recognizer (HTR): A Convolutional Recurrent Neural Network (CRNN) using Gated Recurrent Units (GRU). It provides feedback to the generator via Connectionist Temporal Classification (CTC) loss.

By combining Adversarial Loss, Pixel-wise Binary Cross-Entropy (BCE) Loss, and CTC Loss, the model learns a "readability prior." This allows it to reconstruct missing or obscured strokes that purely visual models might ignore.

Datasets and Training

To evaluate the model across different scripts, the authors developed two synthetic benchmarks: Degraded-KHATT (Arabic) and Degraded-IAM (Latin). These datasets simulate real-world noise, such as historical backgrounds and vertical line artifacts, paired with ground-truth transcriptions.

Examples of diverse handwritten scripts and historical document degradations.

The researchers also employed a "progressive" training strategy. In this scenario, the HTR module is trained on the generator's evolving output rather than static ground truth, allowing the recognizer to adapt as the binarization quality improves.

Key Results and Insights

The multi-task approach demonstrated significant improvements over standard GAN-based binarization:

  • Improved Readability: On the Arabic Degraded-KHATT dataset, the model achieved a Character Error Rate (CER) of 24.33%, compared to 29.24% for a standard conditional GAN.
  • State-of-the-Art Performance: The model outperformed previous winners of the H-DIBCO (Handwritten Document Image Binarization Contest) challenges (2016 and 2018) and classic algorithms like Otsu and Sauvola.
  • Visual vs. Linguistic Quality: The study confirmed that high Peak Signal-to-Noise Ratio (PSNR) does not always correlate with low CER. By explicitly optimizing for the HTR task, the model bridges the gap between looking clean and being readable.

Conclusion

This multi-task adversarial framework represents a step forward in preserving historical documents for digital archives. By treating text as a structural prior, the model can "reconstruct" characters obscured by centuries of decay. Future work aims to explore unsupervised learning using unpaired data, which would eliminate the need for synthetic degradation and allow the model to learn directly from authentic historical artifacts.

Summary updated

BibTeX
@article{jemni2022enhance,
  author = {Sana Khamekhem Jemni and Mohamed Ali Souibgui and Yousri Kessentini and Alicia Fornés},
  title = {{Enhance to read better: A Multi-Task Adversarial Network for Handwritten Document Image Enhancement}},
  journal = {Pattern Recognition},
  year = {2022},
  doi = {10.1016/j.patcog.2021.108370},
}
Figure