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

Abstract

Mask TextSpotter is an end-to-end trainable neural network that treats scene text spotting as a semantic segmentation task. By leveraging a Mask R-CNN-inspired architecture, it simultaneously detects and recognizes text of arbitrary shapes—including curved and highly oriented text—outperforming previous methods that relied on complex multi-stage training or 1D sequence modeling.

Introduction

In computer vision, "text spotting" involves two distinct tasks: detection (finding where the text is) and recognition (reading what it says). Historically, these were handled by separate modules, which often led to sub-optimal results because the two tasks could not share information.

While some end-to-end models existed prior to this work, they faced two major hurdles. First, training complexity: they often required curriculum learning or complex pre-training stages because their internal components (like LSTMs or CTC loss) are difficult to optimize from scratch. Second, geometric rigidity: most models were designed for horizontal or slightly tilted text. In the real world, text appears on curved surfaces, round logos, or at extreme angles. Standard bounding boxes or 1D sequence recognizers simply cannot handle these arbitrary shapes effectively.

Comparison of text spotting methods: axis-aligned (left) and rotated (middle) bounding boxes lead to incorrect recognition on curved text, whereas the proposed mask-based approach (right) correctly identifies the word 'petrosains'.

Methodology

The authors propose a unified framework inspired by Mask R-CNN. The architecture consists of four main components: a ResNet-50 backbone with a Feature Pyramid Network (FPN) for multi-scale feature extraction, a Region Proposal Network (RPN), and a Fast R-CNN branch for localization refinement.

The core innovation is the Mask Branch. Instead of predicting a single binary mask for an object, this branch predicts 38 different maps:

  • 1 Global Word Map: Identifies the overall shape of the text instance.
  • 36 Character Maps: One for each alphanumeric character (26 letters + 10 digits).
  • 1 Background Map: To filter out non-character pixels.

To convert these maps into words, the authors use a Pixel Voting strategy. They identify connected regions in the predicted maps and "vote" on which character is most likely present based on the average probability across the pixels. Finally, a Weighted Edit Distance algorithm matches the predicted sequence against a dictionary (lexicon), giving more weight to characters the model was more confident about.

Experimental Results

The model was evaluated on three major benchmarks: ICDAR 2013 (horizontal text), ICDAR 2015 (incidental scene text), and Total-Text (curved text). Initial pre-training was performed on the SynthText dataset, which contains 800,000 synthetic images.

Mask TextSpotter achieved state-of-the-art results across the board:

  • ICDAR 2015: On the end-to-end recognition task, it outperformed previous top performers by a significant margin of 13.2% to 25.3%.
  • Total-Text: It beat the previous best method by 8.8 points in detection and at least 16.6% in end-to-end recognition, proving its superiority for irregular shapes.
  • Efficiency: The model runs at approximately 4.8 to 6.9 FPS, which is significantly faster than many previous multi-stage pipelines.
A real-world example of curved text on a sports jersey, demonstrating the model's ability to handle non-rigid surfaces.

Discussion and Conclusion

A key insight of this research is that segmentation is superior to regression for handling curved text. By using semantic segmentation at the character level, the model identifies "character pixels" regardless of whether the text is straight, wavy, or circular. This approach treats recognition as a spatial layout problem, making it more robust for irregular shapes and eliminating the need for Recurrent Neural Networks (RNNs).

While the paper demonstrates a massive leap forward, some limitations remain. The training process benefits significantly from character-level bounding box annotations. Furthermore, the current implementation focuses on 36 English alphanumeric characters; expanding this to languages with thousands of characters (like Chinese) would require a more memory-efficient mask branch. Finally, very long text lines might still pose a challenge for the RPN and RoI Align stages inherited from the standard Mask R-CNN architecture.

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