General-Purpose OCR Paragraph Identification by Graph Convolution Networks

Renshen Wang, Yasuhisa Fujii, Ashok C. PopatarXiv 2021 · arXiv · OpenReview

Abstract

We propose a new approach for paragraph recognition in document images by spatial graph convolutional networks (GCN) applied on OCR text boxes. Two steps, namely line splitting and line clustering, are performed to extract paragraphs from the lines in OCR results. Each step uses a beta-skeleton graph constructed from bounding boxes, where the graph edges provide efficient support for graph convolution operations. With only pure layout input features, the GCN model size is 3~4 orders of magnitude smaller compared to R-CNN based models, while achieving comparable or better accuracies on PubLayNet and other datasets. Furthermore, the GCN models show good generalization from synthetic training data to real-world images, and good adaptivity for variable document styles.

Introduction

While Optical Character Recognition (OCR) has matured significantly in identifying individual words, organizing those words into coherent physical paragraphs remains a challenge. Traditional methods typically rely on brittle heuristic rules or heavy, image-based deep learning models like Faster R-CNN. These image-based models are computationally expensive and often struggle with "non-axis-aligned" text, such as documents with rotation or perspective skew.

Figure 1: Real-world application of the GCN model on a complex historical marker, showing successful paragraph grouping in the wild.

Researchers at Google have developed a highly efficient alternative: a two-stage approach using Graph Convolutional Networks (GCNs) that treats text boxes as nodes in a geometric graph. By focusing entirely on spatial layout rather than raw pixels, this system achieves state-of-the-art accuracy with a model size roughly 2,000 times smaller than traditional image-based detectors.

Methodology

The $\beta$-skeleton Graph Structure

The core of this approach is the representation of document layout as a graph. To connect text boxes effectively, the authors utilize a $\beta$-skeleton graph. Unlike a "free line-of-sight" graph, which can become overly dense and computationally expensive, or a simple "nearest neighbor" graph, which may leave related text blocks isolated, the $\beta$-skeleton provides an optimal level of connectivity.

Figure 6: Comparison of graph construction methods. The $\beta$-skeleton (c) provides a balanced, sparse connectivity ideal for graph convolution.

Two-Stage Pipeline

The system processes OCR results in two distinct phases:

  1. Line Splitting: A GCN node classifier analyzes word-level boxes to identify "line start" and "line end" points. This step corrects common OCR errors where text from adjacent columns is incorrectly merged into a single long line.
  2. Line Clustering: A GCN edge classifier examines the refined lines to predict whether neighboring lines belong to the same physical paragraph.

The GCN utilizes message passing with an attention mechanism. Over eight rounds of communication, each node (text box) aggregates spatial context—including coordinates, dimensions, and orientation—from its neighbors to make final grouping decisions.

Key Insights and Results

Efficiency and Size

Because the model processes geometric coordinates rather than high-resolution image pixels, it is remarkably lightweight. The GCN model occupies approximately 100KB, a stark contrast to the 200MB+ required for ResNet-based detectors. This efficiency makes it ideal for on-device processing where memory and power are limited.

Performance and Generalization

On the PubLayNet benchmark, the GCN achieved an $F1_{var}$ score of 0.959, outperforming the much larger Faster R-CNN model (0.945). Furthermore, the model demonstrated exceptional generalization. By training on a "Web Synthetic Page Layout" dataset—where Wikipedia pages were rendered with randomized CSS, fonts, and rotations—the model learned to handle real-world photos and complex document styles without requiring massive amounts of manually labeled real-world data.

Robustness to Rotation

Traditional object detectors often rely on Non-Maximum Suppression (NMS), which frequently fails when paragraphs are rotated and their axis-aligned bounding boxes overlap. Because the GCN operates on the intrinsic graph of the text itself, it maintains high accuracy even with 45-degree tilts and perspective distortions.

Conclusion

This research proves that for document layout analysis, "geometry is king." By ignoring text content and image pixels in favor of spatial relationships, GCNs provide a faster, smaller, and more robust solution for paragraph identification. Future work may involve integrating small visual features to handle non-text elements like checkboxes or images, further enhancing the model's versatility.

Summary updated

Abstract

We propose a new approach for paragraph recognition in document images by spatial graph convolutional networks (GCN) applied on OCR text boxes. Two steps, namely line splitting and line clustering, are performed to extract paragraphs from the lines in OCR results. Each step uses a beta-skeleton graph constructed from bounding boxes, where the graph edges provide efficient support for graph convolution operations. With only pure layout input features, the GCN model size is 3~4 orders of magnitude smaller compared to R-CNN based models, while achieving comparable or better accuracies on PubLayNet and other datasets. Furthermore, the GCN models show good generalization from synthetic training data to real-world images, and good adaptivity for variable document styles.
BibTeX
@misc{wang2021general,
  author = {Renshen Wang and Yasuhisa Fujii and Ashok C. Popat},
  title = {{General-Purpose OCR Paragraph Identification by Graph Convolution Networks}},
  year = {2021},
  eprint = {2101.12741},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2101.12741},
}

Loading related content...

Figure