Visual attention models for scene text recognition

Suman K. Ghosh, Ernest Valveny, Andrew D. BagdanovarXiv 2017

Introduction

Scene text recognition remains a challenging task in computer vision due to the high variability in fonts, complex backgrounds, and environmental conditions like blur or uneven lighting. While traditional Optical Character Recognition (OCR) systems excel at scanned documents, they often struggle with "text in the wild." Most contemporary solutions mitigate these challenges by relying on predefined lexicons to constrain predictions. However, this dependency limits their utility for out-of-vocabulary words such as brand names or street signs. This paper proposes a novel, lexicon-free approach to scene text recognition using an LSTM-based soft visual attention model.

Proposed Methodology

The core of the proposed system is an encoder-decoder framework that utilizes a visual attention mechanism to process images without explicit character segmentation.

Encoder-decoder architecture with visual attention mechanism.

Encoder and Attention Mechanism

The encoder uses a standard Convolutional Neural Network (CNN) to extract a grid of spatial feature vectors from the input image. Unlike methods that compress the image into a single vector, this approach preserves local spatial information. A soft visual attention mechanism then dynamically weights these features at each time step, effectively teaching the model "where to look" to identify the next character.

Decoder and Language Modeling

The decoder is an LSTM network that generates a sequence of characters based on the attended features and its internal state. To further improve accuracy in unconstrained settings, the authors integrate a weak n-gram language model into the beam search algorithm. This serves as a language prior, penalizing improbable character sequences without restricting the output to a fixed dictionary.

Datasets and Evaluation

The models were trained on Synth90k, a large-scale synthetic dataset containing 9 million text images. Evaluation was performed on two benchmark datasets: Street View Text (SVT) and ICDAR'03. These benchmarks allow for testing both unconstrained recognition and lexicon-based recognition (using 50-word or full-image dictionaries).

Results and Discussion

A key finding is that the attention mechanism acts as an implicit segmentation tool. By visualizing the attention weights, it becomes clear that the model learns to scan the image from left to right, identifying characters sequentially.

Visualization of the attention model sequentially identifying characters in the word 'MARKET'.

Ablation studies on the SVT dataset demonstrate the effectiveness of each component. A baseline LSTM without attention achieved 61.7% accuracy. Incorporating the soft attention model increased this to 68.16%, and adding the explicit language model further boosted performance to 75.57%. When trained on the full 9M dataset, the model achieved state-of-the-art unconstrained results, reaching 80.4% on SVT and 94.1% on ICDAR'03.

Conclusion

This research demonstrates that combining standard CNN features with a robust attention mechanism and a weak language model can achieve state-of-the-art results in unconstrained scene text recognition. While the current model faces limitations regarding fixed receptive fields for varying text scales, future work aims to incorporate multi-layer features and extend the model to include end-to-end text detection.

Summary updated

BibTeX
@misc{ghosh2017visual,
  author = {Suman K. Ghosh and Ernest Valveny and Andrew D. Bagdanov},
  title = {{Visual attention models for scene text recognition}},
  year = {2017},
  eprint = {1706.01487},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1706.01487},
}
Figure