OCR Error Correction Using Statistical Machine Translation

Haithem Afli, Loïc Barrault, Holger SchwenkInt. J. Comput. Linguistics Appl 2016

Abstract

Digitizing historical archives often results in text riddled with Optical Character Recognition (OCR) errors due to aged documents, faded ink, and complex layouts. This research proposes a post-processing framework that treats OCR error correction as a translation task, using Statistical Machine Translation (SMT) to "translate" noisy OCR output into clean text. By evaluating both word-level and character-level SMT models on a massive dataset from the National Library of France (BNF), the authors demonstrate a 60% relative reduction in word-level errors. This engine-agnostic approach provides a scalable solution for cleaning large-scale historical digital libraries without requiring access to original images or internal OCR engine confidence scores.

The Challenge of Historical OCR

Digitizing historical archives is a massive undertaking, but the results are frequently marred by three main types of noise: non-word errors (e.g., "diarge" instead of "charge"), segmentation errors (e.g., "mais on" instead of "maison"), and real-word errors where a word is correctly spelled but contextually incorrect (e.g., "de là cuisse" instead of "de la cuisse").

Examples of common OCR errors and their corresponding reference corrections.

While manual correction remains the gold standard, it is prohibitively expensive for millions of pages. Traditional automated fixes often rely on static dictionaries, which fail when encountering archaic spellings, technical jargon, or obscure proper nouns. The authors sought a "black-box" solution that focuses entirely on cleaning the text output, regardless of how the OCR was generated.

Methodology: SMT for Error Correction

The core innovation lies in applying Statistical Machine Translation (SMT) to the problem. In this framework, the "source language" is the noisy OCR text, and the "target language" is the corrected version of that same language. The researchers explored two primary architectures using the Moses SMT toolkit:

  • Word-level SMT: This model treats whole words as the basic unit. It is highly effective at capturing context but struggles with "Out-of-Vocabulary" (OOV) words—misspellings it has never seen during training.
  • Character-level SMT: This model breaks text down into individual letters and spaces. While it struggles with long-distance dependencies, it is far more flexible at fixing unique typos and handling OOV words.
Comparison of word-level and character-level representations used for SMT training.

A significant finding was that the reordering models standard in traditional translation (e.g., German to English) are unnecessary here. Since the source and target are the same language, word order rarely changes, allowing for a simpler and faster model.

Datasets and Experimental Setup

The study utilized a massive dataset provided by the National Library of France (BNF), comprising 90 million words of OCR output from documents spanning the 17th to the 21st century. This data was manually corrected by annotators to create a "ground truth" for training. To account for the evolution of language, the corpus was categorized by century, allowing the model to adapt to varying historical writing styles.

Key Results and Insights

The SMT approach significantly outperformed the baseline OCR across multiple metrics:

  • Word-Level Performance: Achieved a 60% relative reduction in Word Error Rate (WER), dropping from 4.9% to 1.9%.
  • Character-Level Performance: Achieved a 54% relative reduction in Character Error Rate (CER), dropping from 1.3% to 0.6%.
  • System Synergy: The researchers discovered that the two systems are complementary. By passing the output of the character-level system through the word-level system, they achieved superior results compared to using either model in isolation.

Conclusion and Future Work

This research demonstrates that SMT is a powerful tool for OCR post-processing, particularly for historical documents where traditional dictionary-based methods fail. While the word-level system remains sensitive to OOV errors and character-level models are computationally intensive to train, the combined approach offers a robust path forward for large-scale digitization. Future work will investigate the portability of these models to other domains, such as legal or medical documents, and their effectiveness across different language pairs.

Summary updated

BibTeX
@article{afli2016ocr,
  author = {Haithem Afli and Loïc Barrault and Holger Schwenk},
  title = {{OCR Error Correction Using Statistical Machine Translation}},
  journal = {Int. J. Comput. Linguistics Appl},
  year = {2016},
}
Figure