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

Learning Shape-Aware Embedding for Scene Text Detection.

Zhuotao Tian, Michelle Shu, Pengyuan Lyu, Ruiyu Li, Chao Zhou, Xiaoyong Shen, Jiaya JiaCVPR 2019 · DOI

TL;DR

This paper introduces a novel segmentation-based framework for detecting scene text of arbitrary shapes. It achieves this by learning a "shape-aware embedding" for text pixels, encouraging pixels from the same text instance to be close in the embedding space while pushing apart pixels from different instances. A new "Shape-Aware Loss" and a refined cluster processing pipeline further improve accuracy, especially for challenging cases like curved text and small gaps between instances.

What Problem Does This Paper Address?

Detecting text in natural images is notoriously difficult due to variations in lighting, blur, and especially the diverse and often arbitrary shapes of text instances. While traditional methods often rely on rectangular or quadrilateral bounding boxes, they struggle with curved or irregularly shaped text. Existing segmentation-based methods can detect arbitrary shapes but often fail to accurately separate closely spaced text instances. This paper aims to bridge this gap by developing a robust method that can precisely segment and localize text of any shape, even when instances are very close together or have unusual aspect ratios.

Methods

The core of the proposed method is a segmentation-based framework that treats text detection as an instance segmentation problem. It comprises two main branches:

  1. Embedding Branch: This branch learns an 8-channel embedding feature for each pixel. The key idea is to map pixels belonging to the same text instance close together in this embedding space and pixels from different instances far apart. This is achieved through a novel Shape-Aware Loss (SA Loss).
  2. Shape-Aware Loss (SA Loss): This loss function has two components:
  3. Variance Loss ($L_{var}$): Encourages pixels within the same text instance to have similar embeddings.
  4. Distance Loss ($L_{dist}$): Pushes embeddings of pixels from different text instances further apart.
  5. Adaptive Weights: Crucially, the SA Loss incorporates adaptive weights ($W_{Scale}$ and $W_{Dist}$) that adjust the pulling and pushing forces based on the scale of text instances and the distance between them. This allows the model to better handle varying aspect ratios and small gaps.
  6. Segmentation Branch: This branch generates two types of segmentation masks:
  7. Full Map: Identifies the general location and distribution of text.
  8. Center Map: Captures only the central areas of text instances. This helps in separating spatially close instances and provides more precise starting points for clustering.
  9. Both maps are trained using a Dice Loss.

Post-processing (Cluster Processing): The framework then employs a refined cluster processing pipeline that leverages both the embedding and segmentation maps. It uses DBSCAN on the Full Map to get initial clusters, then refines these using the Center Map and the learned embedding features. This two-stage clustering, guided by both spatial and semantic information, is key to accurately separating instances.

Datasets

The paper trains and evaluates its model on three challenging scene text datasets:

  • SynthText: Used for pre-training the model (over 800,000 synthetic images).
  • ICDAR15: An oriented scene text dataset with quadrangle annotations.
  • MSRA-TD500: A dataset containing both Chinese and English text, with a focus on long and oriented instances.
  • CTW1500: A dataset specifically designed for curved text, with 14-vertex polygon annotations.

Key Insights and Ideas

  • Embedding Space for Instance Separation: The core insight is that learning a rich embedding space where pixels of the same instance are clustered is a powerful way to distinguish between them, especially when they are spatially close or have complex shapes. This moves beyond simple boundary detection or pixel-wise classification.
  • Shape-Awareness is Crucial: Text instances have highly variable aspect ratios and can be very long or short. The proposed Shape-Aware Loss, with its adaptive weights, directly addresses this by dynamically adjusting the loss based on instance scale and proximity, making it more robust than fixed losses.
  • Synergy of Segmentation and Embedding: The dual-branch architecture, combining segmentation masks (Full and Center Maps) with embedding features, is a key innovation. The segmentation maps provide coarse localization and reduce search space, while the embedding features provide fine-grained discrimination, leading to better overall performance.
  • Two-Stage Clustering for Precision: The refined cluster processing, which first uses DBSCAN on segmentation maps and then refines with embedding distances, is more effective than directly applying clustering algorithms to either segmentation or embedding alone. This highlights the importance of integrating different types of information.

Key Results

The proposed method achieves state-of-the-art results on the CTW1500 dataset for curved text detection.

  • On ICDAR15, the method achieves a new state-of-the-art when evaluated at a larger input scale, with an H-mean of 86.6%.
  • On MSRA-TD500, it achieves an H-mean of 82.9%, comparable to the previous best performance.
  • On CTW1500, it achieves an H-mean of 80.1%, outperforming previous methods, particularly in precision.
  • Qualitative results demonstrate improved detection of curved text and better separation of closely spaced instances compared to baseline methods.

Limitations and Future Work

  • Inference Speed: The paper acknowledges that the two-stage clustering process leads to an average inference speed of 3 FPS on 720P images, which could be a limitation for real-time applications.
  • Failure Cases: The authors show examples of failure cases, including erroneously suppressed small words, text-like structures, and hard instances.
  • Future Work: The authors suggest extending their findings to text spotting (localization and recognition) and further optimizing the model to shorten the running time.

Summary updated

BibTeX
@inproceedings{tian2019learning,
  author = {Zhuotao Tian and Michelle Shu and Pengyuan Lyu and Ruiyu Li and Chao Zhou and Xiaoyong Shen and Jiaya Jia},
  title = {{Learning Shape-Aware Embedding for Scene Text Detection.}},
  booktitle = {CVPR},
  year = {2019},
  doi = {10.1109/cvpr.2019.00436},
}
Figure