Box2Poly: Memory-Efficient Polygon Prediction of Arbitrarily Shaped and Rotated Text

Xuyang Chen, Dong Wang, Konrad Schindler, Mingwei Sun, Yongliang Wang, Nicoló Savioli, Liqiu Meng

Abstract

Box2Poly is a memory-efficient text detector that shifts away from the resource-heavy "point-query" approach of modern Transformers. By using a single feature vector per text instance and an iterative "box-to-polygon" refinement process, it achieves state-of-the-art accuracy on curved and rotated text while slashing memory usage by over 50% and increasing inference speed by 40%.

Introduction

Detecting text in the wild is notoriously difficult because text isn't always a neat horizontal rectangle; it can be curved, tilted, or wrapped around objects. Current state-of-the-art (SOTA) methods often use Transformers to predict polygons by assigning a unique "query" feature to every single vertex of the polygon.

While accurate, this approach has two major flaws:

  1. Memory Bloat: Encoding dozens of vertices per text instance requires a massive memory footprint.
  2. Structural Instability: Because each vertex is often treated somewhat independently, the model can struggle to maintain the "global" shape of the text, leading to messy or self-intersecting polygons.

Box2Poly addresses these issues by treating the entire text string as a single instance-aware object, improving both efficiency and structural integrity.

Methodology

Box2Poly is built on the Sparse R-CNN framework and introduces a cascaded decoding pipeline. Instead of jumping straight to a complex polygon, the model follows a "coarse-to-fine" evolution.

Overview of the Box2Poly architecture and the iterative refinement process.

The model starts with Iterative Box Regression, refining a set of learnable bounding boxes over several stages ($K$ layers) to locate the general area and scale of the text.

The Box-to-Poly Bridge

A key innovation is the transformation from boxes to polygons using a cubic Bezier curve as an intermediary. The model predicts control points for the curve based on the bounding box, samples points along that curve, and then expands them into a polygon.

The Box-to-Poly transformation using cubic Bezier curves as a structural prior.

This "Bezier bridge" ensures the initial polygon inherits the correct scale and orientation from the box. It also acts as a structural regularizer, preventing the polygon from becoming jagged because the initial shape is constrained by smooth geometry.

Refinement and Alignment

Following the transformation, the model uses PolyAlign to extract features directly from the predicted polygon shape for precise vertex refinement. To handle rotated text, Orientation-Equivalent Annotation (OEA) is employed during training, allowing the model to match ground truth regardless of vertex labeling order.

Key Results

Box2Poly holds its own against the current leader, DPText-DETR, while being significantly leaner:

  • Memory Efficiency: It uses >50% less VRAM (8072MB vs. 17409MB).
  • Inference Speed: It is >40% faster, reaching 19.6 FPS compared to 13.6 FPS.
  • Accuracy: On the TotalText benchmark, it achieved an F-score of 88.35%. On the rotation-heavy InverseText dataset, it outperformed the SOTA by 1.6% when no pretraining was used.

Conclusion and Future Work

Box2Poly demonstrates that a single, well-refined instance-level feature is sufficient to guide the regression of an entire polygon. While highly efficient, the model can struggle with very small text instances or extremely dense scenes due to its fixed proposal count. Future research will explore advanced proposal generators to improve recall and further optimize inference speed.

Summary updated

BibTeX
@inproceedings{chen2024box,
  author = {Xuyang Chen and Dong Wang and Konrad Schindler and Mingwei Sun and Yongliang Wang and Nicoló Savioli and Liqiu Meng},
  title = {{Box2Poly: Memory-Efficient Polygon Prediction of Arbitrarily Shaped and Rotated Text}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i2.27884},
}
Figure