TextSnake: A Flexible Representation for Detecting Text of Arbitrary Shapes

Shangbang Long, Jiaqiang Ruan, Wenjie Zhang, Xin He, Wenhao Wu, Cong Yao · DOI

Abstract

Driven by deep neural networks and large scale datasets, scene text detection methods have progressed substantially over the past years, continuously refreshing the performance records on various standard benchmarks. However, limited by the representations (axis-aligned rectangles, rotated rectangles or quadrangles) adopted to describe text, existing methods may fall short when dealing with much more free-form text instances, such as curved text, which are actually very common in real-world scenarios. To tackle this problem, we propose a more flexible representation for scene text, termed as TextSnake, which is able to effectively represent text instances in horizontal, oriented and curved forms. In TextSnake, a text instance is described as a sequence of ordered, overlapping disks centered at symmetric axes, each of which is associated with potentially variable radius and orientation. Such geometry attributes are estimated via a Fully Convolutional Network (FCN) model. In experiments, the text detector based on TextSnake achieves state-of-the-art or comparable performance on Total-Text and SCUT-CTW1500, the two newly published benchmarks with special emphasis on curved text in natural images, as well as the widely-used datasets ICDAR 2015 and MSRA-TD500. Specifically, TextSnake outperforms the baseline on Total-Text by more than 40% in F-measure.

Introduction

Scene text detection—the task of locating text in natural images like street signs, billboards, or product packaging—is a fundamental component of many computer vision systems. Traditionally, state-of-the-art models have relied on simple geometric containers to bound text, such as axis-aligned rectangles, rotated rectangles, or four-sided quadrangles.

While these rigid representations are effective for standard horizontal or slightly tilted text, they struggle significantly with curved or highly distorted text instances, such as those found on round logos or wavy banners. A rigid box around curved text inevitably includes excessive background noise or truncates characters, making subsequent Optical Character Recognition (OCR) nearly impossible. TextSnake introduces a flexible representation designed to adapt to the natural flow of text, regardless of its shape.

Comparison of text representations: (a) Axis-aligned rectangle, (b) Rotated rectangle, (c) Quadrangle, and (d) TextSnake.

The TextSnake Representation

The core innovation of this work is the TextSnake representation. Instead of a single global box, a text instance is modeled as a sequence of ordered, overlapping disks $S(t) = \{D_0, D_1, \dots, D_n\}$ aligned along the text's symmetric axis, or "center line."

As shown in the diagram below, each disk is defined by three primary geometry attributes:

  1. $c$: The center point coordinates.
  2. $r$: The radius, representing half the local text width.
  3. $\theta$: The orientation, defined as the tangential direction of the center line at that point.
The TextSnake representation, modeling text as a sequence of ordered, overlapping disks with radius r and orientation θ.

Detection Pipeline

The TextSnake framework utilizes a Fully Convolutional Network (FCN) with a Feature Pyramid Network (FPN) to produce several "score maps." The network predicts whether a pixel belongs to a Text Region (TR) or a Text Center Line (TCL), alongside the specific geometry values ($r, \cos\theta, \sin\theta$).

To convert these maps into final detections, a striding algorithm is employed. It begins at a random TCL pixel, "centralizes" it using the predicted geometry, and then "strides" in both directions along the center line until the boundaries of the text instance are reached. Finally, the full curved shape is reconstructed by sliding a circle along this extracted center line using the predicted radii.

Experimental Results

The model was pre-trained on the SynthText dataset (800,000 synthetic images) and evaluated across several benchmarks, including those specifically focused on curved text:

  • Total-Text: TextSnake achieved an F-measure of 78.4%, representing a massive 42.4% improvement over the baseline (36.0%).
  • SCUT-CTW1500: The model reached an F-measure of 75.6%, outperforming other specialized curved-text models.
  • ICDAR 2015 & MSRA-TD500: TextSnake maintained competitive performance on these standard benchmarks for incidental and multi-lingual straight text, demonstrating its versatility.

Discussion and Key Insights

By predicting local geometric properties rather than a global bounding box, TextSnake becomes inherently shape-agnostic. This approach offers several advantages:

  • Robustness to Density: Because the Text Center Line (TCL) is a thin "skeleton," it rarely overlaps with neighboring text instances, simplifying the task of instance segmentation in crowded scenes.
  • Built-in Rectification: Since TextSnake captures the precise flow and width of text at every point, it can naturally "unroll" or rectify curved text into a straight horizontal strip. This significantly aids OCR engines, which are typically optimized for linear text.

Limitations

While highly flexible, the current implementation assumes text follows a single, non-branching path (a "snake" shape). This may pose challenges for complex artistic typography that forks or branches. Additionally, the post-processing striding algorithm adds computational overhead compared to models that directly regress coordinates.

Conclusion

TextSnake represents a significant shift from rigid bounding boxes toward a more organic, flexible representation for scene text. By modeling text as a sequence of disks, the framework achieves state-of-the-art results on curved text benchmarks while remaining robust enough for traditional rectangular text detection.

Summary updated

BibTeX
@inproceedings{long2018textsnake,
  author = {Shangbang Long and Jiaqiang Ruan and Wenjie Zhang and Xin He and Wenhao Wu and Cong Yao},
  title = {{TextSnake: A Flexible Representation for Detecting Text of Arbitrary Shapes}},
  booktitle = {European Conference on Computer Vision},
  year = {2018},
  doi = {10.1007/978-3-030-01216-8\_2},
}
Figure