Graph-based Document Structure Analysis

Yufan Chen, Ruiping Liu, Junwei Zheng, Di Wen, Kunyu Peng, Jiaming Zhang, Rainer Stiefelhagen

Introduction

When humans interact with complex documents—such as scientific papers, financial reports, or legal briefs—we do not merely perceive isolated blocks of text and images. Instead, we instantly recognize a sophisticated hierarchy: a specific caption belongs to a figure, a paragraph follows a preceding one, and a section header governs the subsequent pages.

Traditional Document Layout Analysis (DLA) has historically struggled to replicate this human-level understanding. Most DLA systems treat document analysis as a standard object detection task, drawing bounding boxes and assigning labels like "Text" or "Table" without capturing the underlying connections between these elements. To address this limitation, researchers from the Karlsruhe Institute of Technology (KIT) have introduced a new framework to be presented at ICLR 2025 that treats document structure as a graph-based problem.

The gDSA Task and GraphDoc Dataset

The researchers propose the task of graph-based Document Structure Analysis (gDSA). Unlike traditional methods that provide a "flat" perspective of a page, gDSA aims to map both the spatial and logical relationships between document elements. This involves identifying two distinct types of relations:

  1. Spatial Relations: Physical proximity and orientation (e.g., Up, Down, Left, Right).
  2. Logical Relations: Semantic hierarchy and flow (e.g., Parent-Child, Sequence, Reference).

To facilitate research in this area, the authors released GraphDoc, currently the largest and most comprehensive dataset for document structure analysis. Derived from DocLayNet, GraphDoc contains 80,000 document images featuring 1.10 million layout instances and over 4.13 million relation annotations. The dataset spans six diverse domains, including financial reports, scientific articles, laws, government tenders, manuals, and patents, providing a robust benchmark for model generalization.

Methodology: The Document Relation Graph Generator (DRGG)

To tackle the gDSA task, the authors developed the Document Relation Graph Generator (DRGG). Moving away from inefficient two-stage processes (detecting then linking), DRGG utilizes an end-to-end architecture built upon modern transformer-based detectors like DINO or DETR.

Key technical innovations in DRGG include:

  • Weighted Token Aggregation: Recognizing that different relations are captured at varying levels of abstraction, the model aggregates features from multiple transformer decoder layers. This allows it to distinguish between simple spatial arrangements and complex semantic references.
  • Auxiliary Relation Head: To stabilize the training process, the authors implemented a "stabilizer" head. This component first predicts the existence of a relation between two elements before the primary head attempts to classify the specific relation type.
  • Hungarian Matching: The model employs a bipartite matching algorithm to ensure precise alignment between predicted document elements and ground-truth annotations during training.

Key Insights and Results

The study reveals that documents are best understood as graphs where nodes represent layout elements and edges represent their relationships. Analysis of the GraphDoc dataset shows that while spatial relations constitute approximately 64% of the data, they are not a perfect proxy for logical structure, necessitating explicit logical labeling.

In performance benchmarks, the DRGG model established a strong baseline:

  • Overall Performance: The model achieved a mean Average Precision for graphs ([email protected]) of 57.6% when utilizing the InternImage backbone.
  • Backbone Impact: High-capacity "foundation" models like InternImage significantly outperformed standard ResNet or Swin Transformers, suggesting that complex document features require substantial visual representation power.
  • Domain Variability: Performance varied by document type. The model excelled in highly structured domains like "Laws and Regulations" (63.2 mAPg) but found "Patents" more challenging due to their extreme density and layout complexity.

Challenges and Future Directions

Despite its success, the authors identify two primary areas for improvement. First, the current model is primarily vision-based. Integrating textual information (multimodal input) is likely essential for improving the detection of "Reference" relations, which often depend on specific keywords (e.g., "See Figure 1"). Second, the current scope is limited to single-page analysis. Future work will need to address multi-page documents where logical sequences often span across page breaks.

By providing the GraphDoc dataset and the DRGG architecture, this research moves the field of document AI beyond simple box-drawing toward a more holistic, structural comprehension of complex information.

Summary updated

BibTeX
@inproceedings{chen2025graph,
  author = {Yufan Chen and Ruiping Liu and Junwei Zheng and Di Wen and Kunyu Peng and Jiaming Zhang and Rainer Stiefelhagen},
  title = {{Graph-based Document Structure Analysis}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=Fu0aggezN9},
}
Figure