DocParser: Hierarchical Document Structure Parsing from Renderings

Johannes Rausch, Octavio Martinez, Fabian Bissig, Ce Zhang, Stefan Feuerriegel

Abstract

DocParser is an end-to-end system designed to extract complete, hierarchical document structures—including nested tables, figures, and text blocks—from flat document images like PDFs. To overcome the massive data bottleneck in document layout analysis, the authors introduce a novel weak supervision framework that automatically generates training labels by reverse-rendering LaTeX source code. This approach significantly boosts parsing accuracy and establishes a new state-of-the-art for table structure recognition.

Introduction

While formats like XML or JSON naturally encode the hierarchical structure of a document, the most common real-world formats—such as PDFs and scanned images—are entirely "flat." They store characters and bounding boxes but discard structural relationships like reading order, table rows, or figure captions. For Natural Language Processing (NLP) systems to truly understand documents, they require this hierarchical context. However, training deep learning models for this task is difficult because large-scale, fully annotated datasets are prohibitively expensive to produce manually.

Methods

DocParser processes document images through a sophisticated 5-stage pipeline designed to reconstruct logical hierarchies from visual data.

The DocParser pipeline: from image conversion to parsed page structure.
  1. Image Conversion: Renders the PDF into a normalized image.
  2. Entity Detection: Uses a modified Mask R-CNN to identify document elements. The network is optimized for the highly rectangular aspect ratios typical of document entities.
  3. Relation Classification: Applies rule-based heuristics to establish nesting (parent_of) and reading order (followed_by) among detected entities.
  4. Structure-Based Refinement: Cleans the predicted hierarchy using a predefined "document grammar" to fix illegal predictions (e.g., a table nested inside a figure).
  5. Scalable Weak Supervision: The core innovation involves using synctex to compile LaTeX source files from arXiv. This automatically maps source code commands to bounding boxes on the rendered PDF, generating millions of "weak" labels for pre-training.

Datasets

The authors evaluated DocParser using three primary benchmarks:

  • arXivdocs-target: A clean, manually annotated dataset of 362 scientific articles containing 30 entity categories.
  • arXivdocs-weak: A massive dataset of 127,472 documents with noisy labels generated via the LaTeX/synctex method.
  • ICDAR 2013: A standard benchmark used to test robustness in table structure parsing.

Key Results

The integration of weak supervision and fine-tuning (WS+FT) yielded significant performance improvements across all metrics.

mAP performance relative to the number of fine-tuning images, demonstrating the efficiency of the WS+FT approach.
  • Accuracy Gains: The WS+FT model achieved a mean Average Precision (mAP) of 69.4 (at IoU=0.5), representing a 39.1% relative improvement over the baseline trained only on clean data.
  • Hierarchical Integrity: The F1 score for predicting hierarchical relations improved by 35.8% (from 0.453 to 0.615).
  • Data Efficiency: As shown in the performance analysis, the WS+FT model surpassed the baseline's peak performance after fine-tuning on just 20 document images.
  • State-of-the-Art Table Parsing: DocParser achieved a new SOTA on the ICDAR 2013 benchmark with an F1 score of 0.9292, outperforming previous image-based methods.
  • Efficiency: The system is highly performant, requiring approximately 340 ms per document for entity detection on a single GPU.

Conclusion

DocParser demonstrates that LaTeX source code is a "goldmine" for weak supervision, allowing researchers to bypass the manual annotation bottleneck. By combining massive noisy datasets with small-scale clean fine-tuning and a logical document grammar, the system bridges the gap between raw computer vision and structured document understanding. Future work will focus on replacing heuristic relation classification with end-to-end neural learning and incorporating textual features like word embeddings to improve parsing in complex layouts.

Summary updated

BibTeX
@inproceedings{rausch2021docparser,
  author = {Johannes Rausch and Octavio Martinez and Fabian Bissig and Ce Zhang and Stefan Feuerriegel},
  title = {{DocParser: Hierarchical Document Structure Parsing from Renderings}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i5.16558},
}
Figure