Introduction
Scene Text Recognition (STR) has seen significant progress, yet models often falter when encountering "domain shifts"—unseen variations such as artistic fonts, industrial textures, or messy handwriting. Traditionally, adapting to these new environments requires fine-tuning, a process that is computationally expensive and necessitates maintaining multiple model versions. While Large Language Models (LLMs) utilize In-Context Learning (ICL) to adapt via a few examples, applying massive LLMs to STR is resource-heavy. Moreover, standard STR models do not inherently possess ICL capabilities because they are typically trained to recognize images in isolation.
To bridge this gap, the researchers introduced $E^2STR$ (Ego-evolving Scene Text Recognizer), a model designed to adapt to new domains on the fly without parameter updates. By leveraging a novel training strategy, $E^2STR$ brings the power of in-context learning to a standard-sized architecture, allowing it to "rectify" its own errors by observing similar examples.
Methodology: The $E^2STR$ Framework
The $E^2STR$ model consists of a Vision Transformer (ViT) encoder and a small language decoder (OPT-125M), totaling approximately 210M parameters. The core innovation lies in the transition from single-image training to sequence-based context training.
In-Context Training (ICT)
Standard STR models fail at ICL because they lack the ability to find relationships between different images in a sequence. $E^2STR$ employs In-Context Training (ICT), where the model learns from "context-rich" sequences generated via a Split and Transform (ST) strategy:
- Split Strategy: A single word image is divided into overlapping sub-samples. This forces the model to understand how local visual features relate to the global word structure.
- Transform Strategy: Various augmentations, such as color shifts and warping, are applied to the same word. This teaches the model to recognize the same linguistic "concept" across diverse visual styles.
This structured approach ensures that the model doesn't just see a sequence of random images but learns to extract shared information across the context.
In-Context Inference and kNN Selection
During inference, $E^2STR$ does not rely solely on the test image. It utilizes a k-Nearest Neighbor (kNN) selection mechanism to search a small "in-context pool" of 1,000 images for the most visually similar examples. These examples are then used as "prompts" for the language decoder. If a character in the test image is ambiguous (e.g., a blurry 'a' that looks like a 'q'), the model uses the clear examples in the prompt to "rectify" its prediction.
Experimental Results
The model was trained on the Union14M-L dataset and evaluated across 12 standard benchmarks and several cross-domain sets, including the newly introduced EIST (Enhanced Industrial Scene Text) benchmark.
- State-of-the-Art Accuracy: $E^2STR$ achieved an average word accuracy of 91.33% across 12 common benchmarks, outperforming even fine-tuned SOTA models.
- Superior Domain Adaptation: In unseen domains, the ICL approach provided significant performance gains without any parameter updates: +4.59% on handwriting (IAM) and +7.11% on industrial text (EIST).
- Error Mitigation: On samples where both $E^2STR$ and other SOTA models initially failed, the inclusion of a few annotated examples reduced the error rate by up to 32%.
- Efficiency: The computational cost of processing extra context is minimal. Inference time increased from 0.071s to 0.094s per image, a negligible trade-off for the substantial accuracy gains.
Discussion and Conclusion
The development of $E^2STR$ demonstrates that massive parameter counts are not a prerequisite for effective In-Context Learning. The key discovery was that ICL capabilities can be "baked in" through structured training data that emphasizes visual and linguistic connections. By using the "Split and Transform" logic, $E^2STR$ effectively uses visual prompts to resolve ambiguities in degraded or stylized text.
While the model shows remarkable adaptation, it remains limited by its predefined character lexicon and the potential for misleading prompts if the kNN search selects visually similar but linguistically unrelated images. Future research will explore more robust prompt selection methods to further enhance the model's "ego-evolving" capabilities.
Summary updated