Language Matters: A Weakly Supervised Vision-Language Pre-training Approach for Scene Text Detection and Spotting

Chuhui Xue, Wenqing Zhang, Yu Hao, Shijian Lu, Philip H. S. Torr, Song Bai

Abstract

Vision-Language Pre-training (VLP) has revolutionized various tasks by jointly learning visual and textual representations. However, standard VLP methods struggle with Optical Character Recognition (OCR) due to the difficulty in instance-level text encoding and the high cost of acquiring fully annotated image-text pairs. This paper introduces oCLIP, a weakly supervised pre-training method that aligns visual and textual information through a character-aware text encoder and a visual-textual decoder. By modeling interactions between textual and visual features, oCLIP learns effective scene text representations from weakly annotated data (transcriptions without bounding boxes). Experiments on ICDAR2019-LSVT show that oCLIP improves F-scores by +2.5% for text detection and +4.8% for text spotting. Consistently outperforming existing techniques across multiple benchmarks, oCLIP demonstrates that linguistic knowledge is a powerful teacher for visual text recognition.

Introduction

While general VLP models like CLIP have transformed computer vision, they are often ill-suited for OCR tasks. The authors identify two primary gaps: granularity and annotation cost. Standard VLP models typically pair one image with one descriptive sentence, whereas scene text images contain multiple independent text instances (e.g., different signs) that are linguistically unrelated. Furthermore, high-quality OCR training usually requires expensive "full" annotations—bounding boxes for every word.

Comparison of standard OCR, VLP, and the proposed oCLIP pipeline.

oCLIP bridges these gaps by treating text at the instance and character levels. This approach allows the model to utilize "weak" supervision, where only the text transcriptions are known, mitigating the data annotation constraint significantly.

The oCLIP Framework

The oCLIP architecture is designed to extract and align fine-grained features through three core components:

  1. Image Encoder: A ResNet-50 backbone paired with a multi-head attention layer to capture spatial visual embeddings.
  2. Character-Aware Text Encoder (CAE): Unlike word-level models, CAE operates on individual characters. It uses positional encodings to maintain character order within a word but intentionally ignores relationships between different text instances in the same image, reflecting the independence of disparate signs.
  3. Visual-Textual Decoder (VTD): This module uses text embeddings as queries to attend to visual features. By omitting self-attention between different text instances, the model remains robust to partial annotations, allowing it to learn from images where only some words are transcribed.
Detailed architecture of oCLIP, highlighting the character-aware encoder and masked character prediction task.

Training Objectives

The model is optimized using two primary losses. Masked Character Prediction forces the model to use visual and surrounding linguistic context to predict hidden characters, encouraging the visual encoder to focus precisely on text regions. Simultaneously, a Batch-level Contrastive Loss encourages the alignment of correct image-text pairs within a training batch.

Experimental Results

The pre-trained oCLIP weights were transferred to various state-of-the-art detectors (e.g., DB, PSENet) and spotters (e.g., Mask TextSpotter-v3), yielding significant improvements:

  • ICDAR2019-LSVT: oCLIP improved the F-score of the DB detector by +2.4% and Mask TextSpotter-v3 by +4.8%.
  • Total-Text & CTW1500: The method outperformed existing pre-training techniques by +3.2% and +1.3%, respectively.
  • Scalability: Pre-training on 40 million automatically filtered web images further pushed the state-of-the-art, demonstrating that the weak-supervision approach scales effectively with massive datasets.

Conclusion

oCLIP demonstrates that character-level linguistic guidance significantly enhances visual text representations. By leveraging weak supervision and focusing on instance-level independence, oCLIP provides a scalable and efficient path for pre-training OCR models. Future work may extend this character-aware approach to logographic languages like Chinese and further optimize the computational efficiency of the visual-textual interaction.

Summary updated

BibTeX
@inproceedings{xue2022language,
  author = {Chuhui Xue and Wenqing Zhang and Yu Hao and Shijian Lu and Philip H. S. Torr and Song Bai},
  title = {{Language Matters: A Weakly Supervised Vision-Language Pre-training Approach for Scene Text Detection and Spotting}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  url = {https://openreview.net/forum?id=_6ytp00GlEo},
}
Figure