2D Attentional Irregular Scene Text Recognizer

Pengyuan Lyu, Zhicheng Yang, Xinhang Leng, Xiaojun Wu, Ruiyu Li, Xiaoyong ShenarXiv 2019

Abstract: Irregular scene text, which has complex layout in 2D space, is challenging to most previous scene text recognizers. Recently, some irregular scene text recognizers either rectify the irregular text to regular text image with approximate 1D layout or transform the 2D image feature map to 1D feature sequence. Though these methods have achieved good performance, the robustness and accuracy are still limited due to the loss of spatial information in the process of 2D to 1D transformation. Different from all of previous, we in this paper propose a framework which transforms the irregular text with 2D layout to character sequence directly via 2D attentional scheme. We utilize a relation attention module to capture the dependencies of feature maps and a parallel attention module to decode all characters in parallel, which make our method more effective and efficient. Extensive experiments on several public benchmarks as well as our collected multi-line text dataset show that our approach is effective to recognize regular and irregular scene text and outperforms previous methods both in accuracy and speed.

Introduction: The Challenge of Irregular Text

Traditional scene text recognizers are primarily designed for "regular" text—straight, horizontal lines. However, real-world scene text is often "irregular," featuring curves, tilts, or multi-line layouts. Most existing models attempt to handle this complexity through two main strategies: image rectification (flattening the text) or 2D-to-1D feature transformation (collapsing spatial features into a sequence for an RNN).

Comparison of different scene text recognition architectures, highlighting the proposed 2D parallel approach.

These approaches have inherent flaws. Rectification often fails on highly complex layouts, and collapsing 2D features into 1D inevitably loses vital spatial information. Furthermore, standard RNN-based decoders process characters sequentially, creating a significant computational bottleneck during inference.

Proposed Architecture

The proposed framework moves away from sequential processing in favor of a fully 2D, parallel approach that preserves spatial integrity throughout the pipeline.

Detailed architecture of the proposed model featuring the Relation Attention and Parallel Attention modules.

Key Components:

  • CNN Encoder: Extracts high-level semantic features from the input image while maintaining their 2D structure.
  • Relation Attention Module: Instead of using an RNN to capture context, the model employs a multi-layer bidirectional Transformer-style encoder. This allows every pixel in the feature map to "attend" to every other pixel, capturing global dependencies in parallel without losing spatial context.
  • Parallel Attention Module: Unlike standard attention mechanisms that look for one character at a time, this module generates $n$ attention masks simultaneously. Each mask corresponds to a specific character position in the output sequence.
  • Two-stage Decoder: To ensure the "flow" between characters is maintained despite parallel mask generation, a second stage uses another relation attention module to model dependencies between predicted character "glimpses" before final decoding.

Datasets and Evaluation

The model was trained on massive synthetic datasets (Synth90K and SynthText) and evaluated on a wide array of benchmarks, including regular text (IIIT5K, SVT, IC03, IC13) and irregular text (SVTP, IC15, CUTE80).

Notably, the authors introduced MLT280, a new benchmark consisting of 280 license plate images with one-line and two-line text. This dataset specifically tests a model's ability to handle multi-line layouts without explicit line segmentation, a task where traditional 1D-based models often struggle.

Key Results and Performance

The 2D attentional approach demonstrates superior performance in both accuracy and efficiency:

  • State-of-the-Art Accuracy: The model outperformed previous bests on irregular datasets, specifically beating existing benchmarks on SVTP by 3.8% and CUTE80 by 3.5%.
  • Multi-line Superiority: On the MLT280 dataset, this model outperformed popular models like ASTER (rectification-based) and SAR (recurrent 2D attention) by massive margins of 18.2% and 29.6%, respectively.
  • Inference Speed: By avoiding the sequential nature of RNNs, the model is 2.1x faster than ASTER and 4.4x faster than SAR.

Conclusion and Future Work

By maintaining spatial integrity and utilizing parallel attention, this architecture robustly handles curved and multi-line text that baffles traditional recognizers. While highly effective, the authors noted that the model currently struggles with vertical text due to its absence in the training data. Future work will focus on expanding training diversity to include more orientations and even more complex spatial layouts.

Summary updated

BibTeX
@misc{lyu2019d,
  author = {Pengyuan Lyu and Zhicheng Yang and Xinhang Leng and Xiaojun Wu and Ruiyu Li and Xiaoyong Shen},
  title = {{2D Attentional Irregular Scene Text Recognizer}},
  year = {2019},
  eprint = {1906.05708},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1906.05708},
}
Figure