Source-linked AI summary

A Scalable Handwritten Text Recognition System

R. Reeve Ingle, Yasuhisa Fujii, Thomas Deselaers, Jonathan Baccash, Ashok C. Popat

arXiv:1904.09150v2cs.CV

TL;DR

Large-scale HTR faces costly training-data collection and challenges in scaling recurrent models. This paper reuses online handwriting data to train image recognizers, proposes a feed-forward alternative, and integrates HTR into an OCR system. The authors report gains from combining generated data with a small amount of real imagery, comparable GRCL and LSTM performance, and strong dual-head OCR/HTR results.

  • Problem

    Collecting and labeling large handwritten line-image corpora is costly and difficult, complicating expansion to new domains and languages.

    Source: §I · p. 1
  • Method

    The paper renders and degrades online handwriting data for offline HTR, compares LSTM and feed-forward GRCL recognizers, and integrates HTR into an OCR system.

    Source: §I · p. 1, 2) Recurrence-free model · p. 2
  • Results

    Generated data improved models when combined with a small amount of real imagery, GRCL was comparable to LSTM with abundant data, and the dual-head system yielded the best accuracy on printed and handwritten text.

    Source: §VII · p. 7
  • Takeaways & Limitations

    The paper demonstrates a route to adding HTR to a full OCR system using online data and a dual-head printed/handwritten model.

    Source: §I · p. 1, §VII · p. 7

Abstract

from arXiv · show

Many studies on (Offline) Handwritten Text Recognition (HTR) systems have focused on building state-of-the-art models for line recognition on small corpora. However, adding HTR capability to a large scale multilingual OCR system poses new challenges. This paper addresses three problems in building such systems: data, efficiency, and integration. Firstly, one of the biggest challenges is obtaining sufficient amounts of high quality training data. We address the problem by using online handwriting data collected for a large scale production online handwriting recognition system. We describe our image data generation pipeline and study how online data can be used to build HTR models. We show that the data improve the models significantly under the condition where only a small number of real images is available, which is usually the case for HTR models. It enables us to support a new script at substantially lower cost. Secondly, we propose a line recognition model based on neural networks without recurrent connections. The model achieves a comparable accuracy with LSTM-based models while allowing for better parallelism in training and inference. Finally, we present a simple way to integrate HTR models into an OCR system. These constitute a solution to bring HTR capability into a large scale OCR system.

I. INTRODUCTION

The paper tackles the data and scaling challenges of adding handwritten text recognition to large-scale OCR. It reuses online handwriting data, compares recurrent and feed-forward recognizers, and describes integration into a full OCR system.

I. INTRODUCTION

  • Large, labeled image corpora are costly and difficult to collect, making new domains and languages challenging to support.The paper identifies obtaining sufficient high-quality training data as the biggest HTR development challenge.Source: §I · p. 1
  • The system reuses online handwriting data to train an offline line recognizer, rendering and degrading stroke trajectories into training images.The authors report this as the first use of an existing online handwriting dataset to build a full HTR system, and enrich the data with handwriting synthesis.Source: §I · p. 1
  • A fully feed-forward recognizer is proposed as an alternative to LSTM-based models, with comparable accuracy and better suitability for parallel hardware.The paper notes that recurrent architectures do not train and run as easily on GPUs and TPUs as feed-forward networks.Source: §I · p. 1
  • The HTR model is integrated into an end-to-end OCR system alongside text detection, direction identification, and script identification.The paper describes additional steps for integrating HTR into the system.Source: §I · p. 1

II. HANDWRITTEN TEXT LINE RECOGNITION

The line recognizer maps a variable-width image to a character sequence using neural-network logits, CTC training, and language-model-assisted decoding. Its architectures include stacked BLSTMs and a feed-forward GRCL alternative.

A. Model

  • Images are resized to 40 pixels high and converted to grayscale; a neural network produces character and blank logits, trained with CTC and decoded with an n-gram language model.Variable image width is handled naturally, and beam search finds the result using a log-linear combination of model and language-model costs.Source: A. Model · p. 2

1) LSTM-based model:

  • The LSTM-based architecture uses one to four stacked bidirectional LSTM layers above inception-style convolutional layers.The model is inspired by the CLDNN architecture.Source: 1) LSTM-based model · p. 2

2) Recurrence-free model:

  • GRCL layers replace LSTMs with feed-forward connections, using depth-wise recurrence and gates to propagate information while retaining comparable accuracy.This design targets parallelism on GPUs and TPUs; the CNN layers remain unchanged.Source: 2) Recurrence-free model · p. 2

B. Training Data

The training data combines online handwriting, synthetic handwriting and typeset text, historical images, and a small set of labeled modern handwriting images. The pipeline renders online strokes into line images and expands short samples into longer lines.

B. Training Data

  • Manually labeled handwriting images are valuable but costly to annotate and difficult to obtain at scale, especially for multilingual support.The paper uses a large online handwriting corpus to support new scripts at substantially lower cost.Source: B. Training Data · p. 2

III. DATA SYNTHESIS, RENDERING, AND DEGRADATION PIPELINE

  • The final training mix includes rendered and degraded online ink, synthesized handwriting, degraded synthetic typeset text, historical datasets, and a small modern handwriting image set.The work focuses on Latin script while planning expansion to other scripts and languages.Source: §III · p. 2

A. Rendering Images from Stroke Data

  • CNN-only feed-forward models performed significantly worse than LSTM-based models on handwritten text, so the authors did not explore them further.The paper distinguishes these CNN-only models from its GRCL alternative to LSTMs.Source: A. Rendering Images from Stroke Data · p. 2
  • Online samples are character-aligned, split into single lines when needed, and short inks are randomly concatenated into longer labeled lines before rendering.Rendered lines use randomized stroke width, slant, and boundary size; target lengths are roughly uniform from 500 to 2500 at height 100.Source: A. Rendering Images from Stroke Data · p. 3

B. Synthesis of Handwriting Stroke Data

Online handwriting data tends to contain short, well-separated writing, limiting its representation of long lines and varied styles. A synthesis pipeline adds controllable style and neatness, including cursive samples.

B. Synthesis of Handwriting Stroke Data

  • Online samples are often short and have well-separated characters, unlike the longer, varied print and cursive styles needed for image-based handwriting recognition.Concatenating short items creates longer lines but does not produce realistic text samples or consistent writing style within a line.Source: B. Synthesis of Handwriting Stroke Data · p. 4
  • The synthesis pipeline adds a style embedding to the handwriting generator, trained as part of its normal procedure without an extra loss function.Two LSTM layers produce a style embedding that is passed to the original model's mixture-density output layer.Source: B. Synthesis of Handwriting Stroke Data · p. 4
  • Style embeddings from selected cursive samples generate additional cursive data, while reduced sampling temperature produces neater handwriting.For neat samples, lower temperature keeps sampling close to the mean handwriting for a given style.Source: B. Synthesis of Handwriting Stroke Data · p. 4

C. Image Degradation Pipeline

The image degradation pipeline makes rendered ink appear realistic through ordered steps that use randomness to vary their transformations.

IV. INTEGRATION INTO THE OCR SYSTEM

The integration adds handwritten recognition to a line-based multilingual OCR system. A dual-head classifier identifies script and writing style to select the appropriate recognition model.

A. Line-based Multilingual OCR System

  • The OCR pipeline extracts lines, identifies direction and script, recognizes each line as Unicode points, then infers text layout.Recognition results can also be filtered by confidence or overlapping lines.Source: A. Line-based Multilingual OCR System · p. 4

B. Dual-Head Script and Style Identification

A. Data

The experiments use offline and online IAM handwriting databases alongside an internal handwriting dataset, with separate data described for full-system experiments.

  • The experiments use the IAM offline database, the IAM online database, and an internal dataset of online and offline handwriting samples.Source: A. Data · pp. 4–5
  • IAM-Off contains scanned handwritten pages from 500 writers and provides 6,161 training, 976 validation, and 2,915 test lines.Source: A. Data · p. 5
  • IAM-On contains trajectory data from 221 writers; IAM-On-Long adds 500,000 training and 20,000 validation lines made by random concatenation.Source: A. Data · p. 5
  • The internal data include online samples, concatenated long lines, synthetic samples, and a smaller set of scanned or photographed handwriting; full-system experiments use 433 handwritten images with 2,555 lines.Source: A. Data · p. 5

B. Models

The models combine BLSTM or GRCL recognition architectures with a dual-head script-and-style identifier; evaluation uses line-recognition and full-system metrics.

B. Models

  • Recognition models used one, two, or four BLSTM layers or a GRCL topology, with a character n-gram language model using n = 9.Source: B. Models · p. 6
  • The dual-head classifier adds a summarizer to a shared inception-style encoder, while printed data train style identification and the OCR model receives some handwritten data.Source: B. Models · p. 6

C. Evaluation

  • Line-recognition evaluation uses character error rate and word error rate, each defined as edit distance divided by the corresponding reference length.Source: C. Evaluation · p. 6
  • Full-system evaluation uses word recall and precision with an IoU threshold of 0.01, and computes AUC as the confidence threshold varies.Source: C. Evaluation · p. 6

A. Line Recognition

The section compares line-recognition models and training-data mixtures, reporting gains from online handwriting data, combined sources, and tuning across the evaluated datasets.

A. Line Recognition

B. Integration to the OCR System

The paper integrates handwritten recognition into a full OCR system and reports results for its dual-head script-and-style identifier. It also concludes that generated data, feed-forward GRCLs, and Latin-only evaluation define the approach’s contributions and scope.

B. Integration to the OCR System

  • The dual-head model yielded the best accuracy on printed and handwritten text; 98.9% of printed lines and 59.6% of handwritten lines were classified as such.The reported handwritten classification rate reflects a high threshold and handwritten images that can contain printed lines.Source: Table V · p. 7, §VII · p. 7, B. Integration to the OCR System · p. 7

VII. CONCLUSION

  • Generated handwriting data improved models, with the best model combining generated data and a small amount of real images.The paper describes a data-generation pipeline and techniques for improving the generated data.Source: §VII · p. 7
  • With large amounts of data, GRCL models were comparable to LSTM models and are an alternative when feed-forward networks are preferred for performance reasons.Source: §VII · p. 7
  • The techniques were applied only to Latin script; their effectiveness on other scripts remains future work.Source: §VII · p. 7

APPENDIX

The line recognizers share an Inception-style CNN, while the dual-head script-and-style identifier uses an encoder. The figures specify the component layers and modules.

A. Line Recognition Model

  • All line recognizers use an Inception-style CNN; LSTM models add stacked BLSTMs, while GRCL models add GRCL layers above the same network.Source: A. Line Recognition Model · p. 8

B. Dual-head Script and Style Identifier Model

A. Line Recognition Model

Loading 1904.09150v2…