Rethinking Text Segmentation: A Novel Dataset and a Text-Specific Refinement Approach

Xingqian Xu, Zhifei Zhang, Zhaowen Wang, Brian L. Price, Zhonghao Wang, Humphrey Shi

Introduction

Text segmentation—the task of identifying exactly which pixels belong to a character—is a critical yet often overlooked component of the computer vision pipeline. While scene text detection and optical character recognition (OCR) have advanced significantly, precise pixel-level masks are essential for sophisticated downstream applications like automated text removal or style transfer. Generic semantic segmentation models frequently struggle with text due to its non-convex boundaries, diverse textures, and varying scales. To address these challenges, this paper introduces TextSeg, a large-scale dataset, and TexRNet, a specialized refinement network.

The TextSeg Dataset

Existing text segmentation datasets are often limited in scale or focus solely on simple scene text. The authors present TextSeg, a comprehensive benchmark comprising 4,024 images. This dataset is distinguished by its diversity, including both "Scene Text" (e.g., billboards) and "Design Text" (e.g., artistic posters and digital logos).

Figure 3: Example of high-quality polygon annotations in the TextSeg dataset, capturing complex "Design Text" on a physical card.

TextSeg provides six types of labels, including word/character polygons and transcriptions. A key innovation is the inclusion of word-effect masks, which allow models to distinguish between the core glyph and decorative elements like shadows or glows.

TexRNet: A Text-Specific Refinement Approach

The proposed TexRNet (Text Refinement Network) acts as a specialized "polishing" layer integrated with standard backbones like DeepLabV3+ or HRNet. It treats text as a distinct structural entity through three primary mechanisms:

  1. Key Features Pooling & Attention: By identifying high-confidence text regions, the network uses their features to "rescue" low-confidence regions with similar textures, ensuring consistency across words.
  2. Trimap Loss: This loss function prioritizes boundary accuracy, focusing the model's learning on the transition zones between text and background.
  3. Glyph Discriminator: A pre-trained, frozen character classifier acts as a "judge." If a segmented shape does not resemble a recognizable letter (a "glyph"), the discriminator penalizes the model, thereby preserving the structural integrity of the text.

Results and Discussion

TexRNet achieves state-of-the-art performance across multiple benchmarks. On the TextSeg dataset, the combination of TexRNet and HRNetV2-W48 reached a foreground Intersection over Union (fgIoU) of 86.84%, a ~2% improvement over the baseline.

Figure 6: Visualization of the text segmentation pipeline. From left to right: original images, polygon annotations from TextSeg, and the resulting high-precision segmentation masks produced by TexRNet.

The model demonstrates particular robustness in handling thin strokes and complex backgrounds where standard models often fail. Furthermore, the high-quality masks generated by TexRNet significantly enhance the visual realism of downstream tasks like text removal and style transfer.

Conclusion and Future Work

While TexRNet sets a new standard for text segmentation, it relies on character-level bounding boxes for its Glyph Discriminator, which may not be available in all datasets. Future research could explore extending this approach to non-Latin scripts with higher structural complexity and optimizing the computational efficiency of the attention and discriminator components.

Summary updated

BibTeX
@inproceedings{xu2021rethinking,
  author = {Xingqian Xu and Zhifei Zhang and Zhaowen Wang and Brian L. Price and Zhonghao Wang and Humphrey Shi},
  title = {{Rethinking Text Segmentation: A Novel Dataset and a Text-Specific Refinement Approach}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.01187},
}
Figure