Quo Vadis Handwritten Text Generation for Handwritten Text Recognition?

Vittorio Pippi, Konstantina Nikolaidou, Silvia Cascianelli, George Retsinas, Giorgos Sfikas, Rita Cucchiara, Marcus Liwicki · DOI

Introduction

Modern Handwritten Text Recognition (HTR) systems have reached impressive levels of accuracy, provided they are trained on massive, diverse datasets. However, these systems often struggle in "low-resource" scenarios common in historical archives, where researchers may only have access to a few dozen pages from a specific 9th-century scribe or an 18th-century diarist. Digitizing these collections is fundamentally a "small data" problem.

Traditionally, researchers have relied on basic data augmentation or simple synthetic fonts to bridge this gap. However, these methods often fail to capture the complex nuances of real ink-on-paper. This paper investigates whether modern Handwritten Text Generation (HTG) models—using GAN, Diffusion, and Autoregressive paradigms—can effectively "hallucinate" training data to boost HTR performance in these challenging, data-scarce environments.

Methodology

The authors developed a systematic pipeline to evaluate the utility of synthetic data. The process involves using an HTG model to generate a large volume of synthetic training data based on a small set of style samples from a target author. This synthetic data is then used to pre-train an HTR model before it is fine-tuned on a minimal amount of real-world data.

The proposed pipeline for HTR training using synthetic data generation and filtering.

The HTG Contenders

Three distinct generative paradigms were compared:

  • VATr++ (Generative Adversarial Network): A GAN-based framework designed to produce word or line images by competing a generator against a discriminator.
  • DiffPen (Diffusion Model): A latent diffusion model that synthesizes images conditioned on text prompts and specific style features extracted from the target.
  • Emuru (Autoregressive Model): An autoregressive model that iteratively generates visual embeddings, which are then decoded into styled images, allowing for flexible, variable-length text.

HTR Architecture and Filtering

For the recognition task, the researchers utilized DefCRNN, a variant of the Convolutional Recurrent Neural Network that employs deformable convolutions to better adapt to the irregular shapes of handwritten characters.

Crucially, the authors implemented a filtering strategy to ensure the quality of the synthetic data. They tested two criteria: Readability, measured by the Character Error Rate (CER) using an off-the-shelf TrOCR model, and Style Fidelity, measured by Handwriting Distance (HWD). They found that filtering for readability—ensuring the model can actually "read" the synthetic text—was far more beneficial than filtering for aesthetic style similarity.

Experimental Setup

The study focused on three distinct historical datasets, each representing a single author or scribe:

  1. Leopardi: 19th-century Italian prose written with ink on historical paper.
  2. Washington: 18th-century English from George Washington’s diaries (binarized).
  3. Saint Gall: 9th-century Latin manuscript from a single scribe (binarized).

To maintain linguistic consistency, synthetic text was drawn from relevant sources, such as a Latin Bible for the Saint Gall style.

Results and Discussion

The evaluation revealed a critical trade-off between style fidelity and data diversity. The visual quality of the synthetic lines varies significantly across the models, as shown in the comparison below.

Visual comparison of real handwriting samples versus synthetic outputs from Emuru, DiffPen, and VATr++ across three historical datasets.

The "Style vs. Diversity" Trade-off

A key finding of the paper is that the optimal HTG model depends on the volume of real data available for fine-tuning:

  • Zero-Resource Regime: When no real data is available for training (zero-shot), the Autoregressive model (Emuru) performs best due to its high style fidelity. It achieved a CER of 15.3% on Washington and 18.1% on Saint Gall without seeing a single real training line.
  • Low-Resource Regime: As soon as a small amount of real data (approx. 130 lines) becomes available for fine-tuning, the Diffusion model (DiffPen) often takes the lead. The authors suggest that DiffPen produces more diverse, "noisier" samples that, while perhaps less aesthetically perfect, force the HTR model to become more robust.

Impact of Pre-training

Synthetic pre-training consistently outperformed training from scratch. For example, using only 16 lines (1.25%) of the Leopardi dataset, pre-training with Emuru reduced the CER from a baseline of ~62% to just 21.7%. While the gap between different HTG methods narrows as more real data is added, the benefits of synthetic pre-training remain evident even at 100% data availability.

Conclusion

This research demonstrates that HTG is a powerful tool for overcoming the data scarcity bottleneck in historical text recognition. While high-fidelity models like Emuru are essential for zero-shot applications, the diversity offered by diffusion models like DiffPen provides superior results as more real-world samples are integrated. Future work will likely focus on controlling the diversity of generative outputs and creating user-friendly pipelines for archivists and historians to digitize rare manuscripts with minimal manual transcription.

Summary updated

BibTeX
@inproceedings{pippi2025quo,
  author = {Vittorio Pippi and Konstantina Nikolaidou and Silvia Cascianelli and George Retsinas and Giorgos Sfikas and Rita Cucchiara and Marcus Liwicki},
  title = {{Quo Vadis Handwritten Text Generation for Handwritten Text Recognition?}},
  booktitle = {SynData4CV @ CVPR},
  year = {2025},
  url = {https://openreview.net/forum?id=ltOF4AqwvU},
}
Figure