TextFormer: A Query-based End-to-End Text Spotter with Mixed Supervision

Yukun Zhai, Xiaoqiang Zhang, Xiameng Qin, Sanyuan Zhao, Xingping Dong, Jianbing Shen · DOI

Introduction

Scene text spotting—the integrated task of detecting and transcribing text in natural images—is a cornerstone of computer vision with applications ranging from autonomous driving to document analysis. Historically, this field has been divided into two primary paradigms: top-down and bottom-up methods. Top-down methods typically detect a text region and then apply Region-of-Interest (RoI) operations to crop and recognize the text. Conversely, bottom-up methods detect individual characters and group them into words.

Comparison of TextFormer with traditional top-down and bottom-up text spotting paradigms.

Both approaches suffer from inherent limitations. Top-down methods are overly dependent on detection precision; a slight misalignment in the initial bounding box can lead to catastrophic recognition failure. Bottom-up methods, while flexible, require expensive character-level annotations and complex post-processing. TextFormer addresses these issues by treating text spotting as a unified, query-based multi-task problem, deeply integrating detection and recognition.

Architecture and Methodology

TextFormer departs from the traditional "detect-then-crop" workflow in favor of a Transformer-based architecture inspired by DETR. The model utilizes a set of learnable text queries that interact with image features through a Transformer decoder to produce shared semantic features.

The TextFormer architecture, featuring a query-based decoder and multi-task heads for segmentation, classification, and recognition.

Adaptive Global aGgregation (AGG) Module

A key innovation in TextFormer is the Adaptive Global aGgregation (AGG) module. Traditional models rely on local RoI operations (like RoI-Align or TPS) which can struggle with arbitrarily shaped or heavily curved text. The AGG module instead uses an attention mask to weight global feature maps, aggregating them along horizontal and vertical axes. This global context allows the model to remain robust even when parts of the text are occluded or the segmentation mask is imperfect.

Multi-task Learning and Mixed Supervision

The shared semantic features generated by the decoder feed into three parallel heads:

  1. Classification: Determines if a query corresponds to a text instance.
  2. Segmentation: Generates a precise mask for the text region.
  3. Recognition: Transcribes the text content.

To overcome the scarcity of fully annotated data (masks + transcripts), TextFormer employs a mixed supervision strategy. By using bipartite (Hungarian) matching, the model can be trained on "weakly" labeled data—images where only the transcript is known, without spatial coordinates. This allows the model to leverage massive datasets like LSVT, significantly improving recognition performance, particularly for complex scripts like Chinese.

Experimental Results

TextFormer was evaluated across several rigorous benchmarks, demonstrating state-of-the-art performance and remarkable robustness.

  • TDA-ReCTS: On this challenging dataset designed for ambiguous layouts, TextFormer achieved a staggering 13.2% improvement in 1-NED (Normalized Edit Distance) over previous leaders like AE TextSpotter. This result highlights the benefit of deep feature sharing, where recognition loss helps refine the segmentation focus.
  • ICDAR 2015: The model reached an 84.5% F-measure for end-to-end spotting with a strong lexicon, surpassing established frameworks such as ABCNet v2.
  • Total-Text: TextFormer proved its efficacy on curved text, securing a 77.9% lexicon-free F-measure.

Ablation studies confirmed the impact of the AGG module, which alone provided a 6% accuracy boost in recognition compared to standard masked RoI extractors.

Conclusion

TextFormer represents a significant shift in scene text spotting by replacing rigid local operations with a flexible, query-based global aggregation mechanism. By unifying detection and recognition through shared features and leveraging mixed supervision, it achieves unprecedented accuracy on complex, real-world datasets. Future work may explore self-supervised learning to further reduce the dependency on labeled data and optimize the architecture for real-time applications.

Summary updated

BibTeX
@article{zhai2024textformer,
  author = {Yukun Zhai and Xiaoqiang Zhang and Xiameng Qin and Sanyuan Zhao and Xingping Dong and Jianbing Shen},
  title = {{TextFormer: A Query-based End-to-End Text Spotter with Mixed Supervision}},
  journal = {Mach. Intell. Res.},
  year = {2024},
  doi = {10.1007/s11633-023-1460-6},
}
Figure