Arbitrary Shape Text Detection via Boundary Transformer

Shi-Xue Zhang, Chun Yang, Xiaobin Zhu, Xu-Cheng Yin · DOI

Abstract

Detecting scene text in the wild remains a significant challenge due to the diverse and arbitrary shapes text can take, from curved signage to wrapped labels. This paper presents TextBPN++, a unified coarse-to-fine framework that leverages a novel Boundary Transformer to model text boundaries directly as sequences of control points. By iteratively refining these points, the method achieves state-of-the-art accuracy while maintaining real-time efficiency, effectively removing the need for complex post-processing steps like Non-Maximum Suppression (NMS).

Introduction: The Challenge of Scene Text

"Scene text"—text found on real-world objects like billboards, packaging, or street signs—rarely conforms to simple horizontal boxes. It often curves, tilts, and follows the geometry of the underlying surface. Traditional detection methods typically fall into two categories:

  1. Segmentation-based methods: These predict text pixels and group them into shapes. However, they are often sensitive to noise and require heuristic post-processing to define clean boundaries.
  2. Component-based methods: These detect small text fragments and link them together, which can fail to capture the global geometric structure of long or highly curved text.

The goal of this research is to develop a method that models the global boundary of text directly and accurately, streamlining the detection pipeline.

The TextBPN++ Framework

The proposed framework, TextBPN++, consists of three primary stages designed to move from a raw image to a precise text boundary.

1. Feature Extraction

The system begins with a standard ResNet backbone (e.g., ResNet-18 or ResNet-50) to extract multi-scale spatial features from the input image.

2. Boundary Proposal Module

This module generates an initial "rough draft" of the text. Using dilated convolutions, it predicts three key priors:

  • Classification Map: Identifies regions likely to contain text.
  • Distance Field: Estimates the distance of each pixel from the nearest text boundary.
  • Direction Field: Predicts the vector pointing toward the closest boundary. These priors are combined to generate a coarse set of initial control points.
The overall architecture of TextBPN++, showing the feature extraction and boundary proposal stages.

3. Boundary Transformer Module

The core innovation is the Boundary Transformer, which treats the control points as a sequence.

  • Encoder: Employs multi-layer Transformer blocks to model long-range relationships between all control points simultaneously. This global perspective allows the model to understand the overall shape of the text, regardless of the number of points.
  • Decoder: A simple Multi-Layer Perceptron (MLP) predicts coordinate offsets, instructing each control point on how to move to align perfectly with the actual text edge.

Key Innovations

Iterative Refinement and Energy Loss

TextBPN++ does not attempt to predict the final shape in a single step. Instead, it employs an iterative refinement process (typically 3 passes), where the model "re-examines" the boundary and adjusts the control points progressively.

Visual demonstration of the iterative refinement process, showing control points progressively snapping to the text boundary.

To ensure stability during training, the authors introduced Boundary Energy Loss (BEL). Inspired by active contour models in physics, BEL treats the distance field as an energy map. The loss function encourages the boundary to settle into a "low energy" state—the true edge of the text—ensuring that each iteration moves closer to the ground truth.

Experimental Results

The model was evaluated on several industry-standard benchmarks, including Total-Text, CTW-1500, and MSRA-TD500.

  • State-of-the-Art Accuracy: On the Total-Text dataset, TextBPN++ achieved an 87.52% F-measure without pre-training, and reached 90.13% with a DCN-enhanced ResNet-50 backbone.
  • Real-Time Performance: Utilizing a lightweight ResNet-18 backbone, the framework operates at 32.5 FPS, making it suitable for real-time deployment.
  • Robustness: The use of Transformers allows the model to capture global geometry better than local-focused CNNs, leading to superior performance on long and highly curved text lines.

Conclusion and Future Work

TextBPN++ demonstrates that treating text boundaries as sequences and applying Transformer-based refinement is a powerful approach for arbitrary shape text detection. While the model excels in most scenarios, it can still struggle with extreme occlusion or very large character spacing. Future work aims to integrate this detection framework with text recognition modules to create a complete, end-to-end "Text Spotting" system.

Summary updated

BibTeX
@article{zhang2024arbitrary,
  author = {Shi-Xue Zhang and Chun Yang and Xiaobin Zhu and Xu-Cheng Yin},
  title = {{Arbitrary Shape Text Detection via Boundary Transformer}},
  journal = {IEEE Trans. Multimedia},
  year = {2024},
  doi = {10.1109/tmm.2023.3286657},
}
Figure