Generative Shape Models: Joint Text Recognition and Segmentation with Very Little Training Data

Xinghua Lou, Ken Kansky, Wolfgang Lehrach, C. C. Laan, Bhaskara Marthi, D. Scott Phoenix, Dileep George

TL;DR

Researchers at Vicarious have developed a generative shape model for scene text recognition that outperforms massive deep learning models while using three orders of magnitude less training data. By encoding structural priors and geometric invariance directly into the model, they achieved state-of-the-art results on standard benchmarks using only 1,406 training images, compared to the millions required by competing discriminative methods.

What Problem Does This Paper Address?

Recognizing text in the wild (scene text) is significantly harder than traditional OCR for scanned documents. Real-world images suffer from extreme variations in font, lighting, perspective distortion, and cluttered backgrounds.

Examples of challenging scene text from standard benchmarks.

At the time of this paper (2016), the dominant solution was to use "data-hungry" discriminative models—specifically Convolutional Neural Networks (CNNs)—trained on millions of synthetic and manually labeled images. These models are effective but act as "black boxes" that require massive supervision to learn invariance to simple transformations like rotation or scaling. The authors sought to prove that a generative approach, which understands the underlying "shape" of a character, could be more efficient, interpretable, and robust.

Methods

The authors propose a two-stage pipeline: Character Detection followed by Word Parsing.

  1. Generative Shape Model (The "Skeleton"):
    • Instead of learning from raw pixels, the model is built from clean font images. It uses 16 oriented edge filters to detect "landmark" features.
  2. Lateral Constraints: This is the "secret sauce." The model connects these landmarks with "elastic" constraints. Short-range constraints preserve the contour, while long-range constraints maintain the global structure. This allows the model to "stretch" and "bend" to fit different fonts and distortions without losing the essence of the character.
  3. Greedy Font Selection: To avoid training on every font in existence, they used a greedy algorithm to select a small subset of representative fonts (776 images) that could "cover" 90% of a large database.
  4. Word Parsing (The "Context"):
    • Once candidate characters are detected, a high-order factor graph determines the most likely word.
  5. This model accounts for character transitions (n-grams), spacing consistency, and color similarity between adjacent letters. It was trained using max-margin structured output learning, which helps the model distinguish the true word from "false positive" character detections.

Datasets

The model was evaluated on two primary scene text benchmarks:

  • ICDAR 2013: A standard dataset for robust reading and segmentation.
  • Street View Text (SVT): Images harvested from Google Street View, known for low resolution and high variability.
  • Training Data: Unlike competitors using ~8 million images, this method used only 1,406 images (776 font images for characters + 630 word images for the parser).

Key Insights and Ideas

  • Invariance by Design, Not by Data: Traditional CNNs learn to be "invariant" to rotation or scaling by seeing millions of examples. This model encodes that invariance into the lateral constraints of the graph. If a letter is tilted, the graph simply shifts its internal state to match, requiring no extra training data.
  • Segmentation as a First-Class Citizen: Because the model is generative, it doesn't just "classify" a box as an 'A'; it actually finds the pixels that belong to the 'A'. This fine-grained instance segmentation provides a level of interpretability that discriminative models lack.
The generative model performing fine-grained instance segmentation on the word "STUFF".
  • "Explaining Away": The generative nature allows for better handling of noise. If the model can "explain" a set of edges as belonging to a specific character, it is less likely to be confused by background clutter that doesn't fit the structural prior.

Key Results

The results were a wake-up call for the "more data is always better" philosophy:

  • Accuracy: On ICDAR 2013, the model achieved 86.2% accuracy, surpassing Google’s PhotoOCR (84.3%). On SVT, it reached 80.7% (vs. PhotoOCR's 78.0%).
  • Efficiency: The model achieved these SOTA results using ~5,000x less data than PhotoOCR.
  • Robustness: The shape model showed robust fitting even when characters were scaled between 70% and 130% or rotated by +/- 20 degrees.

Limitations and Future Work

While highly efficient, the model has clear boundaries:

  • Severe Corruption: The system struggles when images are extremely blurry, over-exposed, or heavily obscured by noise, as the edge features it relies on begin to disappear.
  • Handwriting: The current model is tuned for fonts. Because handwriting lacks the consistent structural "skeleton" of printed fonts, the generative priors don't translate well.
  • Future Directions: The authors suggest moving toward a hierarchical model with reusable features (rather than flat landmark graphs) and improving the parser to better handle missing edge evidence in low-quality images.

Summary updated

BibTeX
@inproceedings{lou2016generative,
  author = {Xinghua Lou and Ken Kansky and Wolfgang Lehrach and C. C. Laan and Bhaskara Marthi and D. Scott Phoenix and Dileep George},
  title = {{Generative Shape Models: Joint Text Recognition and Segmentation with Very Little Training Data}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2016},
  url = {https://openreview.net/forum?id=BJb1cwWuZS},
}
Figure