Abstract
Scene Text Recognition (STR) is a challenging task due to variations in text style, shape, and background. Incorporating linguistic information is an effective way to enhance the robustness of STR models. Existing methods rely on permuted language modeling (PLM) or masked language modeling (MLM) to learn contextual information implicitly, either through an ensemble of permuted autoregressive (AR) LMs training or iterative non-autoregressive (NAR) decoding procedure. However, these methods exhibit limitations: PLM's AR decoding results in the lack of information about future characters, while MLM provides global information of the entire text but neglects dependencies among each predicted character. In this paper, we propose a Masked and Permuted Implicit Context Learning Network for STR, which unifies PLM and MLM within a single decoding architecture, inheriting the advantages of both approaches. We utilize the training procedure of PLM, and to integrate MLM, we incorporate word length information into the decoding process by introducing specific numbers of mask tokens. Experimental results demonstrate that our proposed model achieves state-of-the-art performance on standard benchmarks using both AR and NAR decoding procedures.
Introduction
Scene Text Recognition (STR) involves reading text in natural images, a task complicated by variations in font, orientation, and cluttered backgrounds. To enhance robustness, researchers often integrate internal Language Models (LMs) to provide linguistic context. However, existing LMs generally fall into two categories, both with inherent flaws. Permuted Language Modeling (PLM) is autoregressive and predicts characters sequentially, but lacks "foresight" regarding the remaining word structure. Conversely, Masked Language Modeling (MLM) utilizes masks to view the entire word structure at once but often overlooks dependencies between characters predicted in the same step. The proposed Masked and Permuted Implicit Context Learning (MPSTR) framework bridges this gap by creating a decoder that inherits the foresight of MLM and the dependency-tracking of PLM.
Proposed Method
The MPSTR architecture unifies PLM and MLM into a single decoding architecture through three primary components:
- ViT-based Encoder with Length Prediction: Unlike standard Vision Transformers that use a
[class]token, MPSTR introduces a learnable[len]token. This token explicitly predicts the word's length, which is critical for determining the number of mask tokens required in the decoding phase. - Masked and Permuted Decoder (MP-decoder): This core innovation utilizes the training procedure of PLM (training on various random character orders) but appends learnable mask tokens for all undetermined characters. This ensures that even when predicting the first character, the model possesses global positional context regarding the number of following characters.
- Perturbation Training: To ensure robustness against errors in length prediction, the authors intentionally perturb the ground truth length during training (adding or subtracting one). This teaches the decoder to handle slight inaccuracies during real-world inference.
Experimental Results
MPSTR was evaluated using a mix of synthetic (MJSynth, SynthText) and real-world data (Union14M-L). The model achieved state-of-the-art or comparable results across six common standard benchmarks (IIIT5k, IC13, SVT, IC15, SVTP, and CUTE80).
On the challenging Union14M benchmark, MPSTR demonstrated a significant performance leap. It achieved a 9.1% average improvement over previous state-of-the-art methods. Notably, on the "multi-oriented" subset—featuring text at irregular angles—it outperformed the previous best by 19.2%.
Beyond accuracy, MPSTR offers efficiency gains. The non-autoregressive (NAR) version, MPSTR-N, matches the accuracy of autoregressive models while reducing latency by approximately 5ms per image. Ablation studies confirmed that both mask tokens and explicit length prediction are vital; removing either component leads to a significant drop in performance.
Conclusion
MPSTR successfully unifies the strengths of PLM and MLM, providing a robust framework for scene text recognition. By treating permutations as a "re-masking strategy" and utilizing explicit word length as an anchor, the model maintains a global view of word layout while tracking character dependencies. Future work will focus on refining semantic dependencies in heavily occluded images and optimizing the number of permutations required during training.
Summary updated