Introduction
Scene Text Recognition (STR) involves transcribing text from natural images, a task complicated by diverse fonts, complex backgrounds, and varying orientations. Modern STR systems often rely on Language Models (LMs) to provide context, especially when visual signals are degraded. However, existing approaches typically fall into two categories: slow, unidirectional Autoregressive (AR) models or two-stage models that use an external "spell-checker" LM. The latter often suffers from "erroneous rectification," where the LM overrides correct visual evidence in favor of common dictionary words.
PARSeq (Permuted Autoregressive Sequence models) addresses these challenges by introducing a unified architecture that learns an internal, bidirectional language model grounded in the image.
Architecture and Methodology
PARSeq utilizes a "deep-shallow" Transformer design. The backbone is a heavy 12-layer Vision Transformer (ViT) encoder that extracts rich visual features from the input image. This is paired with a lightweight 1-layer visio-lingual decoder.
The core innovation is Permutation Language Modeling (PLM). Instead of training the model to predict characters strictly from left to right, PARSeq is trained on random permutations of character sequences. By using specific attention masks, the model learns to predict any character given an arbitrary subset of its neighbors. This approach decouples character position from context, allowing the model to function as an ensemble of internal language models.
Unified Decoding Strategies
A significant advantage of the PLM training is that a single trained model can be deployed using various decoding schemes at inference time, depending on the desired balance between speed and accuracy.
- Non-Autoregressive (NAR): The model predicts all characters simultaneously. This is the fastest mode, suitable for real-time applications.
- Autoregressive (AR): The model predicts characters one by one, using previous predictions as context. This mode typically yields the highest accuracy.
- Iterative Refinement: The model first performs an NAR pass and then uses the initial output as context to refine its predictions in subsequent passes, effectively combining the speed of NAR with the contextual awareness of AR.
Key Insights and Performance
PARSeq demonstrates that internal LMs are superior to external ones. Because the decoder has direct access to the encoder's visual features, it is less likely to produce "hallucinations" or incorrect corrections based solely on linguistic probability. Furthermore, the use of position queries as the primary decoder input is essential for enabling permutation-based training.
In terms of performance, PARSeq achieves state-of-the-art results across standard benchmarks. When trained on synthetic data, it reaches an average accuracy of 91.9%; with real-world data, this increases to 96.0%. Notably, PARSeq is Pareto optimal, providing a better trade-off between accuracy and computational latency than previous leading models like ABINet. Its reliance on attention mechanisms also makes it inherently robust to distorted or curved text without requiring specialized spatial transformation modules.
Conclusion
PARSeq represents a significant step forward in STR by unifying different decoding paradigms into a single, efficient architecture. By leveraging Permutation Language Modeling, it creates a robust internal language model that remains grounded in visual evidence, overcoming the limitations of traditional AR and two-stage recognition systems.
Summary updated