A Single-Shot Arbitrarily-Shaped Text Detector based on Context Attended Multi-Task Learning

Pengfei Wang, Chengquan Zhang, Fei Qi, Zuming Huang, Mengyi En, Junyu Han, Jingtuo Liu, Errui Ding, Guangming Shi

TL;DR

SAST (Single-Shot Arbitrarily-Shaped Text Detector) is a novel segmentation-based framework that handles the complexities of curved and long scene text through multi-task learning. By combining a Context Attention Block to capture long-range pixel dependencies with a robust "point-to-quad" assignment method, it achieves state-of-the-art accuracy while maintaining real-time speeds (27.63 FPS).

What Problem Does This Paper Address?

Detecting text in the wild is notoriously difficult because text doesn't always appear in neat, horizontal boxes. It can be curved, extremely long, multi-oriented, or written in various languages against complex backgrounds.

Existing segmentation-based methods, which classify text at the pixel level, face two major hurdles:

  1. Instance Separation: When text lines are very close to each other, the model often fails to distinguish them as separate entities.
  2. Fragmentation: Long text instances often break into fragments because standard convolutional neural networks (CNNs) have a limited receptive field and lack the global context needed to "see" the entire string of characters as one unit.
Two common challenges: (a) adjacent text separation and (b) long text fragmentation.

Methods

The authors propose SAST, which utilizes a ResNet-50 backbone with a Feature Pyramid Network (FPN) to perform multi-task learning. The model predicts four distinct geometric maps in parallel:

  • TCL (Text Center Line): A 1-channel map identifying the core region of text.
  • TBO (Text Border Offset): A 4-channel map indicating the distance from a TCL pixel to the upper and lower boundaries.
  • TCO (Text Center Offset): A 2-channel map pointing from a pixel to the center of its parent text instance.
  • TVO (Text Vertex Offset): An 8-channel map regressing the four vertices of the instance's bounding quadrangle.

Key Innovations:

  • Context Attention Block (CAB): To solve the fragmentation problem, the authors insert CABs into the network. These blocks use a self-attention mechanism to aggregate pixel information horizontally and vertically across the entire image, allowing the model to capture long-range dependencies without massive computational overhead.
  • Point-to-Quad Assignment: Instead of relying on simple connected component analysis (which often fails for close-proximity text), SAST uses high-level object knowledge. It groups TCL pixels into instances by checking if their predicted centers (from TCO) fall within the high-level bounding quads predicted by TVO.
  • Adaptive Polygonal Reconstruction: The final shape is generated by sampling an adaptive number of points along the TCL and using the TBO map to "inflate" these points to the actual text borders.
The arbitrary shape representation process: sampling points on the center line and calculating border offsets.

Datasets

The model was pre-trained on the SynthText dataset (800k synthetic images) and evaluated on four major benchmarks:

  • SCUT-CTW1500: A challenging dataset specifically for curved text, featuring 1,500 images with 14-vertex polygon annotations.
  • Total-Text: Another curved text benchmark with horizontal, multi-oriented, and curved instances.
  • ICDAR 2015: A standard dataset for multi-oriented English scene text.
  • ICDAR 2017-MLT: A large-scale multilingual dataset to test generalization across different scripts.

Key Insights and Ideas

  • Hybrid Post-processing: The "Point-to-Quad" method is a clever bridge between detection-based (box-level) and segmentation-based (pixel-level) approaches. It uses the robustness of object-level detection to guide the precision of pixel-level segmentation.
  • Context is Essential for Text: Text is inherently sequential. By capturing long-range dependencies through the CAB, the model effectively "glues" fragmented character segments back into a single coherent line.
  • Efficiency via Resolution: By predicting geometric maps at 1/4 the input resolution and using a single-shot architecture, SAST avoids the heavy computational cost of two-stage detectors like Mask R-CNN while outperforming them in speed.

Key Results

SAST demonstrates a strong balance between speed and accuracy:

  • Speed: It runs at 27.63 FPS on a single NVIDIA Titan Xp, making it suitable for real-time applications like augmented reality translation.
  • Accuracy: On the curved-text benchmark SCUT-CTW1500, it achieved an Hmean (F-measure) of 81.0%, surpassing most existing segmentation-based methods.
  • Robustness: It achieved competitive results on Total-Text (80.17% Hmean) and showed strong generalization on the multilingual ICDAR 2017-MLT (72.37% Hmean with multi-scale testing).

Limitations and Future Work

The authors acknowledge that SAST still struggles with extremely small text regions, which are difficult to resolve at the 1/4 prediction scale. Future research directions include:

  • Improving the detection of small-scale text.
  • Developing an end-to-end system that integrates both detection and recognition (OCR) for arbitrarily-shaped text.

Summary updated

BibTeX
@inproceedings{wang2019single,
  author = {Pengfei Wang and Chengquan Zhang and Fei Qi and Zuming Huang and Mengyi En and Junyu Han and Jingtuo Liu and Errui Ding and Guangming Shi},
  title = {{A Single-Shot Arbitrarily-Shaped Text Detector based on Context Attended Multi-Task Learning}},
  booktitle = {ACM Multimedia},
  year = {2019},
  doi = {10.1145/3343031.3350988},
}
Figure