Abstract
The attention-based encoder-decoder framework has recently achieved impressive results for scene text recognition, and many variants have emerged with improvements in recognition quality. However, it performs poorly on contextless texts (e.g., random character sequences) which is unacceptable in most of real application scenarios. In this paper, we first deeply investigate the decoding process of the decoder. We empirically find that a representative character-level sequence decoder utilizes not only context information but also positional information. Contextual information, which the existing approaches heavily rely on, causes the problem of attention drift. To suppress such side-effect, we propose a novel position enhancement branch, and dynamically fuse its outputs with those of the decoder attention module for scene text recognition. Specifically, it contains a position aware module to enable the encoder to output feature vectors encoding their own spatial positions, and an attention module to estimate glimpses using the positional clue (i.e., the current decoding time step) only. The dynamic fusion is conducted for more robust feature via an element-wise gate mechanism. Theoretically, our proposed method, dubbed RobustScanner, decodes individual characters with dynamic ratio between context and positional clues, and utilizes more positional ones when the decoding sequences with scarce context, and thus is robust and practical. Empirically, it has achieved new state-of-the-art results on popular regular and irregular text recognition benchmarks while without much performance drop on contextless benchmarks, validating its robustness in both contextual and contextless application scenarios.
Introduction: The Attention Drift Problem
Modern scene text recognition (STR) systems typically employ an attention-based encoder-decoder framework. While highly effective for regular words by leveraging linguistic context, these models often fail on contextless text like serial numbers, license plates, or random strings. This failure is primarily due to "attention drift," where the model's reliance on learned character sequences (context) overrides the actual visual position of characters in the image.
As shown in Figure 1, standard decoders can lose track of the spatial sequence, leading to "hallucinations" or repetitions (highlighted in red). The authors' analysis reveals that while decoders attempt to track position, this signal is frequently overwhelmed by contextual information as the sequence length increases, causing the model to lose its place.
Methodology: RobustScanner Architecture
To mitigate attention drift, the authors propose RobustScanner, which introduces a dedicated position enhancement branch to complement the standard contextual decoding process.
1. Hybrid Branch
The Hybrid Branch follows the standard character-level LSTM decoder structure. It generates a query vector based on both the previous character (context) and the current time step (positional clue).
2. Position Enhancement Branch
This branch is designed to be context-blind, focusing entirely on spatial location. It consists of two key components:
- Position Aware Module (PAM): Standard CNNs have limited receptive fields. The PAM uses LSTMs to scan feature map rows, capturing global spatial context and ensuring the model understands the overall layout of the text.
- Position-Specific Query: It utilizes a dedicated embedding for each decoding time step, ensuring the positional signal remains distinct and strong throughout the process.
3. Dynamic Fusion Module
Rather than a simple summation, RobustScanner employs an element-wise gate mechanism to fuse the outputs of both branches. This allows the model to adaptively balance its reliance on the "language model" (context) and the "spatial map" (position) at each individual decoding step.
Experimental Results
RobustScanner was evaluated against several state-of-the-art models across various benchmarks:
- Contextless Performance: On the newly introduced RandText benchmark (random character sequences), RobustScanner achieved 81.2% accuracy, significantly outperforming the previous state-of-the-art (SAR) at 59.6%.
- Regular and Irregular Text: The model achieved SOTA results on standard benchmarks, including 95.4% on IIIT5K and 92.4% on the challenging CUTE 80 dataset.
- Real-world Application: In license plate recognition tests, RobustScanner reached 55.7% accuracy, nearly doubling the performance of SAR (29.9%), demonstrating its practical utility for non-dictionary text.
Conclusion
RobustScanner addresses a critical weakness in attention-based STR models: the over-reliance on context that leads to attention drift. By dynamically enhancing positional clues, it provides a robust solution that excels in both natural language and contextless scenarios, making it highly suitable for diverse industrial applications.
Summary updated