LS-HDIB: A Large Scale Handwritten Document Image Binarization Dataset

Kaustubh Sadekar, Ashish Tiwari, Prajwal Singh, Shanmuganathan RamanarXiv 2021

TL;DR

The paper introduces LS-HDIB, a massive dataset of over one million handwritten document images designed to train deep learning models for document binarization. By combining classical adaptive thresholding with seamless cloning, the authors automatically generate highly realistic document images with perfect ground truths, drastically improving model generalization on complex, real-world degradations without requiring manual annotation.

What Problem Does This Paper Address?

Document image binarization—the process of separating foreground text from the background—is a critical first step for downstream tasks like Optical Character Recognition (OCR), document translation, and digital archiving.

While deep learning models excel at this task, they are notoriously data-hungry. Existing public datasets (such as the DIBCO series) are small, often containing fewer than a thousand images. Furthermore, they lack environmental diversity, typically featuring text on plain backgrounds. Real-world historical documents, however, are plagued by complex page styles (ruled lines, grids) and severe degradations (ink bleed-through, stains, wrinkles, shadow gradients, and uneven lighting). This paper addresses this severe data scarcity and lack of diversity.

Methods

Instead of relying on expensive and artifact-prone generative models (like GANs) or tedious manual labeling, the authors propose a clever, automated pipeline that pairs classical computer vision techniques:

  1. Content Extraction: The authors collected clean handwritten text ($I_{doc}$) across 13 languages, various fonts, and technical domains (e.g., chemical structures, circuit diagrams). They applied standard adaptive thresholding to extract clean foreground text patches ($I_c$) and their corresponding perfect ground truths ($I_{gt}$).
  2. Background Generation: They manually captured real-world page styles ($I_p$, like graph paper or lined notebooks) and degradation effects ($I_d$, like stains or wrinkles). These were blended using mixed-gradient seamless cloning (Poisson image editing) to create photorealistic backgrounds ($I_{bg}$).
  3. Final Composition: The content patches ($I_c$) were seamlessly cloned onto the generated backgrounds ($I_{bg}$) to produce the final degraded input images ($I_{in}$).
Fig. 2. Block schematic of the proposed method for generating LS- HDIB dataset.

This pipeline requires zero manual annotation and can theoretically scale up to 200 times larger by combining all background and content permutations.

Datasets

  • LS-HDIB (New): Contains 1.09 million synthetic but highly realistic handwritten document images spanning diverse languages, page styles, and degradations.
  • Evaluation Benchmarks: The models were tested on standard unseen real-world datasets to evaluate generalization, including the Bickley Diary dataset, the Palm Leaf Manuscript dataset, and various DIBCO/H-DIBCO test sets.

Key Insights and Ideas

  • Classical Vision as a Data Engine: Rather than using deep learning to generate data for deep learning, the authors show that classical techniques (adaptive thresholding + Poisson cloning) are computationally cheaper, highly controllable, and free from generative artifacts.
  • Background Diversity Matters Most: The core bottleneck in binarization isn't the text itself, but the network's ability to separate text from background noise. By explicitly modeling diverse background styles and degradations, models learn robust features that generalize to completely unseen historical documents.
Examples of diverse page styles, degradations, and content domains included in LS-HDIB

Key Results

The authors benchmarked eight popular deep learning architectures (including U-Net, DeepLabV3+, and Feature Pyramid Networks) across three training regimes:

  • Regime 1: Trained only on combined standard public datasets (~6,000 augmented patches).
  • Regime 2: Trained only on a small subset (5,000 images) of the new LS-HDIB dataset.
  • Regime 3: Trained on a hybrid mix of both.

Quantitative Performance: Models trained only on LS-HDIB (Regime 2) achieved the highest F-measure, pseudo F-measure, and PSNR on the unseen real-world Bickley Diary dataset. For instance, on the Bickley Diary, U-Net's F-score jumped from 0.74 (Regime 1) to 0.83 (Regime 2).

Qualitative Performance: Models trained on LS-HDIB successfully ignored complex background artifacts like liquid stains, non-uniform shadows, and even physical holes/threads in the paper, cleanly isolating only the handwritten text.

The authors also demonstrated a clear scaling law: model performance steadily improves as the training dataset scales from 5k up to 100k images.

Limitations and Future Work

While LS-HDIB significantly boosts performance, the authors noted a minor trade-off: on highly unique historical mediums like the Palm Leaf Manuscript dataset, models trained purely on LS-HDIB occasionally introduced minor discontinuities (gaps) in text strokes compared to models trained on baseline data.

Future work could explore fine-tuning strategies to preserve ultra-fine stroke continuity or expanding the dataset's content generation to include more specialized historical scripts and writing instruments.

Summary updated

BibTeX
@misc{sadekar2021ls,
  author = {Kaustubh Sadekar and Ashish Tiwari and Prajwal Singh and Shanmuganathan Raman},
  title = {{LS-HDIB: A Large Scale Handwritten Document Image Binarization Dataset}},
  year = {2021},
  eprint = {2101.11674},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2101.11674},
}
Figure