Learning to Read by Spelling: Towards Unsupervised Text Recognition

Ankush Gupta, Andrea Vedaldi, Andrew Zisserman

Introduction

Standard Optical Character Recognition (OCR) systems typically rely on supervised learning, requiring millions of images paired with precise transcriptions. This dependency creates a significant bottleneck for niche domains, such as historical archives or ancient manuscripts, where labeled data is scarce or non-existent. This paper presents a novel framework for unsupervised text recognition, enabling a system to learn to "read" by leveraging the statistical patterns of natural language without any paired training data.

Methodology: The Adversarial "Spell-Checker"

The core of the approach is an adversarial game between two primary components: a Recognizer (the Generator) and a Discriminator (the Spell-checker).

  1. The Recognizer: A fully-convolutional network translates an image into a character sequence. To ensure the model focuses on visual features rather than just memorizing strings, the authors enforce Prediction Locality. By limiting the receptive field to approximately 2.5 characters, the recognizer is forced to ground its predictions in local visual evidence.
  2. The Discriminator: This component evaluates whether a predicted string matches the statistical distribution of a target text corpus. It essentially acts as a learned spell-checker, providing a training signal that pushes the recognizer toward producing linguistically coherent output.
Unsupervised character mapping process

To handle the complexities of real-world historical documents, such as non-uniform character spacing, the authors introduced a Skip-RNN layer. This enhancement predicts residual updates to convolutional features, significantly improving character segmentation in challenging contexts.

Datasets and Experimental Setup

The model was evaluated on two distinct datasets:

  • Synthetic Data: 100,000 images using a mono-spaced font (VerilySerifMono) with text from the Hunspell English lexicon. This served as a controlled baseline to study the impact of word length and frequency.
  • Real-World Historical Data: Scanned pages from a 19th-century medical text, Observations on the Nature and Cure of Gout by James Parkinson. This dataset tested the system's robustness against historical printing artifacts and variable-width fonts.

Key Insights: Why Unsupervised Learning Works

The success of this method hinges on the inherent structure of natural language. For instance, while there are billions of possible 7-letter combinations, only a tiny fraction are valid English words. This "tight structure" provides the necessary constraints for the model to find the correct mapping between visual symbols and characters.

Interestingly, the authors found that longer text sequences are easier to learn. Longer strings offer more contextual "n-grams" for the discriminator, resulting in a stronger training signal. Additionally, the model exhibits a clear learning order, mastering high-frequency characters like 'e' and 's' well before rare ones like 'z' or 'q'.

Results and Performance

The unsupervised model demonstrated remarkable accuracy across both synthetic and real-world tests:

  • Synthetic Results: The system achieved ~99% character accuracy and ~95% word accuracy.
  • Historical Text Results: On the Parkinson medical text, the base model reached 85.6% character accuracy. With the addition of the skip-RNN layer to manage variable spacing, performance improved to 96.2% character accuracy and 84.8% word accuracy.
Comparison of ground truth and model predictions on historical text

Limitations and Future Directions

While highly effective, the system faces challenges with very short words (lengths 3-5) due to a lack of structural constraints. Performance also dips slightly on extremely long strings (e.g., 48 characters) because the current architecture lacks a long-range language model. Future work will focus on expanding the character set to include punctuation and case sensitivity, as well as improving robustness at image boundaries.

Summary updated

BibTeX
@inproceedings{gupta2018learning,
  author = {Ankush Gupta and Andrea Vedaldi and Andrew Zisserman},
  title = {{Learning to Read by Spelling: Towards Unsupervised Text Recognition}},
  booktitle = {ICVGIP},
  year = {2018},
  url = {https://openreview.net/forum?id=PfB971sGntu2},
}
Figure