Abstract
Post-OCR correction is essential for digitizing historical and low-resource language archives, yet it is often hindered by the scarcity of human-annotated training data. This study evaluates four synthetic data generation strategies to train transformer-based correction models. We introduce a novel "Glyph Similarity" approach that leverages computer vision to simulate visual character confusion. Our results demonstrate that models like ByT5, trained exclusively on synthetic data, can reduce Character Error Rates (CER) by up to 48%, providing a scalable solution for improving OCR accuracy without manual labels.
Introduction
Digital libraries contain vast amounts of cultural heritage preserved in image format. While Optical Character Recognition (OCR) is the standard tool for text extraction, its output frequently contains errors—particularly in historical documents with archaic fonts or in low-resource languages with complex scripts. Post-OCR correction aims to automatically rectify these errors. However, deep learning models for this task require massive parallel corpora of noisy and clean text, which are expensive to produce manually.
To address this, researchers utilize synthetic data. This study systematically compares various synthesis methods across eight languages, including high-resource (English, German, Spanish, Russian) and low-resource or specialized scripts (Frisian, Icelandic, Irish, Telugu), sourcing text from Project Gutenberg and CC100.
Methodology
The study evaluates four distinct strategies for generating synthetic OCR errors:
- Random Injection: Basic character-level perturbations (deletion, insertion, replacement).
- Image Creation: A "round-trip" approach where clean text is rendered into noisy images and re-processed by an OCR engine.
- Real-World Injection: Mimicking error distributions observed in small real-world samples.
- Glyph Similarity: A novel method using computer vision algorithms (ORB, AKAZE, SIFT) to calculate visual similarity between character shapes (glyphs).
By simulating errors based on visual confusion (e.g., swapping 'e' for 'd' or 'o'), the Glyph Similarity method creates a more realistic training signal. These datasets were used to train several architectures, with ByT5—a byte-level transformer—emerging as the most robust model due to its ability to process sub-word character structures.
Results and Discussion
The experiments revealed several key insights:
- The Efficacy of Visual Confusion: The Glyph Similarity method significantly outperformed random noise, confirming that OCR errors are fundamentally rooted in visual ambiguity.
- Model Performance: ByT5 consistently achieved the highest accuracy. Its byte-level processing prevents the "broken tokenizer" issues common in word-piece models when faced with heavy character-level noise.
- Augmentation Scaling: A 4× augmentation factor (four noisy versions per clean sentence) was identified as the optimal balance for performance.
- Language-Specific Gains: Significant Character Error Rate (CER) reductions were observed: Russian (48.18%), English (39.52%), Frisian (31.07%), and Telugu (25.91%). In Russian, nearly 60% of corrected sentences reached perfect accuracy.
Conclusion
This research demonstrates that high-quality post-OCR correction models can be developed using purely synthetic data. The Glyph Similarity approach provides a powerful, unsupervised way to model OCR noise. While computationally intensive for large character sets like Chinese, this method offers a path forward for digitizing the world's "long-tail" languages and historical archives where manual annotation is unfeasible.
Summary updated