NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Mask TextSpotter: An End-to-End Trainable Neural Network for Spotting Text with Arbitrary Shapes

Pengyuan Lyu, Minghui Liao, Cong Yao, Wenhao Wu, Xiang Bai

TL;DR

This paper introduces Mask TextSpotter, an end-to-end trainable neural network for simultaneously detecting and recognizing text in natural images, even when the text has arbitrary shapes like curves. By adapting the Mask R-CNN architecture, it achieves state-of-the-art performance on challenging benchmarks, offering a more unified and robust approach to scene text spotting.

What Problem Does This Paper Address?

Scene text spotting, the task of both locating and identifying text within images, is crucial for many applications like image retrieval, autonomous driving, and accessibility tools. While deep learning has significantly advanced both text detection and recognition individually, combining them into a single, efficient, and accurate system remains a challenge. Previous methods often treated these as separate steps or struggled with text that wasn't strictly horizontal or oriented. A key difficulty lies in handling text instances with irregular shapes, such as curved text, which are common in real-world scenarios. Existing end-to-end methods also faced complex training procedures and limitations in recognizing arbitrary text shapes.

Methods

The core of Mask TextSpotter is inspired by the Mask R-CNN architecture, a powerful framework for instance segmentation. The authors adapt this by treating text spotting as a semantic segmentation problem.

  • Instance Segmentation for Detection: Instead of just predicting bounding boxes, Mask TextSpotter generates pixel-level masks for each text instance. This allows it to precisely delineate text regions, regardless of their shape (horizontal, oriented, or curved).
  • Character Segmentation for Recognition: Within the mask branch, the network not only identifies the text instance but also predicts character probability maps. This enables character-level recognition directly from the segmentation output.
  • End-to-End Trainability: A significant advantage is that the entire model, from proposal generation to text recognition, can be trained jointly and end-to-end. This simplifies the training process and allows for better feature sharing between detection and recognition tasks.
  • Weighted Edit Distance: To improve the accuracy of text recognition, especially when dealing with potential ambiguities or errors from the segmentation, the authors propose a weighted edit distance metric. This metric assigns different costs to deletion, insertion, and replacement operations based on the confidence of the predicted character probabilities, making it more robust than standard edit distance.

Datasets

The proposed method was trained and evaluated on several widely used datasets:

  • SynthText: A large synthetic dataset used for pre-training, containing multi-oriented text with word and character-level annotations.
  • ICDAR2013: A benchmark for horizontal text detection and recognition.
  • ICDAR2015: A benchmark for oriented scene text detection and recognition.
  • Total-Text: A comprehensive dataset that includes horizontal, oriented, and importantly, curved text, making it ideal for evaluating the model's ability to handle arbitrary shapes.

Key Insights and Ideas

  • Segmentation as a Unified Approach: Framing both text detection and recognition as segmentation tasks (instance segmentation for detection, character segmentation for recognition) provides a powerful and unified framework. This allows for precise localization of arbitrary shapes and direct character prediction.
  • Mask R-CNN's Adaptability: The success of adapting Mask R-CNN highlights its flexibility beyond general object detection, demonstrating its potential for more specialized tasks like scene text spotting.
  • End-to-End Training Benefits: A truly end-to-end trainable model simplifies the pipeline and allows for mutual benefits between detection and recognition, leading to improved overall performance.
  • Weighted Edit Distance for Robustness: The proposed weighted edit distance is a clever way to improve recognition accuracy by incorporating confidence scores from the segmentation, making the recognition more resilient to segmentation errors.

Key Results

The Mask TextSpotter achieved state-of-the-art results across multiple benchmarks:

  • ICDAR2013 (Horizontal Text): Achieved state-of-the-art in detection, word spotting, and end-to-end recognition, outperforming previous methods even when they used multi-scale evaluation.
  • ICDAR2015 (Oriented Text): Demonstrated significant improvements, achieving an F-Measure of 84% at the original scale and 86.0% at larger scales, outperforming competitors by up to 5.0% in detection and showing substantial gains (13.2% - 25.3%) in end-to-end recognition.
  • Total-Text (Curved Text): Showed a large superiority in both detection and recognition for curved text, exceeding previous methods by 8.8 points in detection and at least 16.6% in end-to-end recognition.
  • Speed: The model runs at 6.9 FPS on a 720x1280 input, offering a good speed-accuracy trade-off, and is significantly faster than some state-of-the-art methods.

Limitations and Future Work

  • Limitations:
    • The paper mentions that while "Ours(a)" (trained without real-world character annotations) still performs competitively, it does decrease performance slightly compared to the fully trained model. This suggests that real-world character annotations are beneficial.
  • The speed, while good, is noted as being slightly slower than the fastest method reported in the paper, though this comes with a significant accuracy gain.
  • Future Work:
    • The authors suggest further ablation studies, including experiments on "With or without character maps" and "With or without weighted edit distance," which were discussed in the supplementary material.
  • The success on arbitrary shapes naturally points towards further exploration and improvement on even more complex text layouts and challenging real-world scenarios.

Summary updated

BibTeX
@inproceedings{lyu2018mask,
  author = {Pengyuan Lyu and Minghui Liao and Cong Yao and Wenhao Wu and Xiang Bai},
  title = {{Mask TextSpotter: An End-to-End Trainable Neural Network for Spotting Text with Arbitrary Shapes}},
  booktitle = {European Conference on Computer Vision},
  year = {2018},
  doi = {10.1007/978-3-030-01264-9\_5},
}
Figure