Decoder Pre-Training with only Text for Scene Text Recognition

Shuai Zhao, Yongkun Du, Zhineng Chen, Yu-Gang Jiang · DOI

Scene Text Recognition (STR)—the task of reading text in natural environments—is a cornerstone of computer vision with applications ranging from autonomous driving to document digitization. However, STR models are traditionally limited by a significant domain gap. While synthetic datasets provide abundant training labels, models trained on them often fail to generalize to the complexities of real-world scenes, such as variable lighting, motion blur, and intricate backgrounds.

To address this, researchers have introduced DPTR (Decoder Pre-training with only Text), a novel strategy that bypasses the need for expensive labeled real-world images by leveraging the semantic power of vision-language models.

The DPTR Framework

DPTR shifts the focus from visual encoder pre-training to the decoder. The framework consists of three primary innovations designed to bridge the gap between text labels and visual features:

  1. Decoder Pre-training with CLIP: The core innovation involves feeding text labels into a frozen CLIP text encoder using the prompt template "a photo of a ‘label’". Because CLIP aligns text and real images in a unified feature space, these text embeddings serve as high-quality "pseudo-visual" representations of real-world text.
  2. Offline Randomized Perturbation (ORP): To prevent the decoder from overfitting to the static, idealized embeddings of the CLIP encoder, the authors introduce noise. They extract features from natural images (e.g., from the COCO dataset) and randomly add these "background" features to the text embeddings during pre-training, simulating the visual noise found in real scenes.
  3. Feature Merge Unit (FMU): During fine-tuning, when a standard STR visual encoder is integrated, the FMU uses a cross-attention mechanism to filter redundant background features. This forces the model to concentrate specifically on character foregrounds, improving recognition accuracy.
The DPTR pipeline showing (a) text-only pre-training with CLIP and ORP, and (b) the fine-tuning stage with the Feature Merge Unit.

Bridging the Gap: Text as a Proxy for Reality

The fundamental insight behind DPTR is the statistical relationship between text and image embeddings within the CLIP space. The authors observed that CLIP text embeddings are significantly more similar to embeddings of real images than they are to synthetic images.

As illustrated in the similarity analysis below, prompt text embeddings consistently align more closely with real-world visual data. This makes pre-training on text labels a more effective preparation for real-world deployment than training on traditional synthetic image datasets. By pre-training the decoder to map these semantic embeddings to character sequences, the model develops a robust understanding of text structure before ever seeing a real image.

Analysis of CLIP similarity showing that prompted text labels are statistically closer to real images than synthetic ones.

Key Results and Performance

DPTR has demonstrated state-of-the-art (SOTA) performance across multiple benchmarks:

  • English Benchmarks: When integrated with the PARSeq architecture, DPTR achieved a SOTA average accuracy of 97.5% on real-trained benchmarks.
  • Cross-Language Versatility: On Chinese benchmarks (BCTR), the method reached 80.7% accuracy, outperforming larger models like MaskOCR-L.
  • Robustness and Efficiency: The pre-trained decoder showed marked improvements on challenging, distorted text (e.g., SVT and CUTE datasets). Furthermore, the FMU condenses visual feature sequences, often leading to faster inference speeds for autoregressive models.

Conclusion

DPTR represents a paradigm shift in STR by demonstrating that the decoder can be effectively pre-trained using only text labels. By treating text as a "pseudo-visual" proxy via CLIP, the method overcomes the scarcity of labeled real-world data. While the system still requires visual fine-tuning, the efficiency and accuracy gains suggest that semantic-first pre-training is a powerful tool for bridging the domain gap in scene text recognition.

Summary updated

BibTeX
@inproceedings{zhao2024decoder,
  author = {Shuai Zhao and Yongkun Du and Zhineng Chen and Yu-Gang Jiang},
  title = {{Decoder Pre-Training with only Text for Scene Text Recognition}},
  booktitle = {ACM Multimedia},
  year = {2024},
  url = {https://openreview.net/forum?id=R1OjhQ0iAt},
}
Figure