TAP: Text-Aware Pre-Training for Text-VQA and Text-Caption

Zhengyuan Yang, Yijuan Lu, Jianfeng Wang, Xi Yin, Dinei Florêncio, Lijuan Wang, Cha Zhang, Lei Zhang, Jiebo Luo

Abstract

Standard Vision-Language Pre-training (VLP) models often fail to comprehend scene text—the words written on signs, products, or clothing within an image. This paper introduces TAP (Text-Aware Pre-training), the first framework to explicitly incorporate scene text as a primary modality alongside visual objects and linguistic tokens. By leveraging novel pre-training tasks and a large-scale text-rich dataset, TAP achieves state-of-the-art results across multiple benchmarks, including a significant +8.3% accuracy boost on TextVQA.

Introduction

While modern VLP models excel at identifying general objects like "a dog on a sofa," they remain largely "illiterate" regarding the text embedded in visual scenes. Tasks such as Text-VQA (e.g., "What is the price on the menu?") and Text-Captioning (e.g., "A person wearing a shirt that says 'Save the Planet'") require a deep alignment between visual text regions and semantic meaning. Existing models struggle because they lack exposure to these relationships during initial training. TAP addresses this by making scene text a "first-class citizen" in the pre-training phase.

The TAP Framework

The TAP architecture builds upon a multi-modal Transformer (specifically M4C) and processes three distinct inputs: text words from the query/caption, visual objects detected via Faster R-CNN, and scene text regions detected by an OCR engine.

The TAP architecture illustrates the integration of text words, visual objects, and scene text through a multi-modal fusion module during pre-training and fine-tuning.

Pre-training Tasks

To align these modalities, the authors introduce three specific tasks:

  1. Masked Language Modeling (MLM): The model predicts masked words using both surrounding text and visual scene text features.
  2. Image-Text Matching (ITM): The model determines if a text sequence matches an image. The authors intentionally "pollute" text with random OCR tokens to force the model to verify scene text for discrepancies.
  3. Relative Position Prediction (RPP): A novel task where the model predicts spatial relationships (e.g., "left," "on") between detected objects and scene text, enhancing spatial reasoning.

Datasets and Evaluation

The model was pre-trained on OCR-CC, a new dataset of 1.4 million image-caption pairs filtered from Conceptual Captions for high text density using the Microsoft Azure OCR API. Evaluation was conducted on three major benchmarks: TextVQA, ST-VQA (Scene Text VQA), and TextCaps.

Key Results

TAP established new performance records across all evaluated benchmarks. A critical insight was the "Anchor Effect": including recognized OCR words in the input sequence significantly eases the alignment between visual pixels and semantic meaning. Furthermore, the RPP task proved vital for questions requiring spatial context.

TAP demonstrates substantial performance gains over non-TAP baselines and previous state-of-the-art models across TextVQA, ST-VQA, and TextCaps benchmarks.
  • TextVQA: Achieved 54.71% accuracy (+8.3% absolute improvement).
  • ST-VQA: Achieved an ANLS score of 0.597 (+8.6% improvement).
  • TextCaps: Reached a CIDEr score of 103.22 (+10.2 point jump).

Conclusion

TAP demonstrates that explicitly modeling scene text during pre-training is essential for complex vision-language tasks. While currently dependent on the quality of offline OCR engines, TAP provides a robust foundation for future end-to-end multi-modal systems that can truly "read" the world around them.

Summary updated

BibTeX
@inproceedings{yang2021tap,
  author = {Zhengyuan Yang and Yijuan Lu and Jianfeng Wang and Xi Yin and Dinei Florêncio and Lijuan Wang and Cha Zhang and Lei Zhang and Jiebo Luo},
  title = {{TAP: Text-Aware Pre-Training for Text-VQA and Text-Caption}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.00864},
}
Figure