Benchmarking Graph Neural Networks for Document Layout Analysis in Public Affairs

Miguel Lopez-Duran, Julian Fierrez, Aythami Morales, Ruben Tolosana, Oscar Delgado-Mohatar, Alvaro OrtigosaarXiv 2025

TL;DR

This paper benchmarks Graph Neural Network (GNN) architectures to improve Document Layout Analysis (DLA) for digital-born public affairs documents. By modeling pages as graphs and combining text (RoBERTa) and visual (ResNet) features in a dual-branch GraphSAGE model, the authors successfully classify text blocks into fine-grained semantic categories without manual feature engineering.

What Problem Does This Paper Address?

Document Layout Analysis (DLA) is the essential first step in turning unstructured PDFs into structured data for downstream Natural Language Processing (NLP) tasks. While a lot of research focuses on scanned document images (which require error-prone Optical Character Recognition), "digital-born" or native PDFs present a unique challenge. They contain exact layout coordinates but completely lack semantic metadata. This makes it difficult to automatically distinguish between a title, a summary, an identifier, or the main body text.

Most traditional tools rely on handcrafted features or focus only on document-level classification. This paper addresses the gap in fine-grained, text-block-level classification by leveraging GNNs to exploit the structural and spatial relationships between different elements on a page.

Methods

The authors propose a multimodal, graph-based framework that avoids manual feature engineering by using pre-trained models for feature extraction:

  • Graph Construction: Each document page is converted into a graph where nodes represent layout objects (text blocks, images, tables, links). The authors test two edge-construction strategies:
  • $k$-Closest Neighbor Graph ($k=4$): Connects each node to its four nearest neighbors based on centroid Euclidean distance, focusing on local context.
  • Complete Graph: A fully connected graph where every node connects to every other node, minimizing human design bias.
Fig. 1. Illustration of the graph construction process applied to a document from the Diario Oficial de la Generalitat Valenciana. Original document page (a), k-closest graph (b), and complete graph (c) representation of the page.
  • Node Embeddings: Text features ($\mathbf{x}_T$) are extracted using a Spanish pre-trained RoBERTa-base model. Visual features ($\mathbf{x}_V$) are captured by running a ResNet-18 model over cropped images of the layout objects.
  • Architectural Frameworks: They evaluate three setups:
  • Single Feature Type: Using only text or only visual features.
  • Concatenated Single Branch: Combining text and visual features into one vector before passing them to a single GNN.
  • Dual Branch: Processing text and visual features through separate, specialized GNN branches before fusing their outputs for final classification.
  • GNN Backbones: They benchmark four foundational GNN models: GCN, GAT, GraphSAGE, and TAGCN.

Datasets

The models are evaluated on the Public Affairs Layout (PAL) dataset, which contains over 37.9K PDF document layouts from 24 official Spanish gazettes (such as the Boletín Oficial del Estado), totaling around 441K pages. The authors specifically utilize the human-verified validation subset to ensure clean evaluation data. The task is to classify text blocks into four semantic categories: Identifier, Title, Summary, and Body.

Key Insights and Ideas

  • Local Context is King: The $k$-closest neighbor graph structure consistently outperformed the complete graph configuration. This proves that a text block's semantic role is highly dependent on its immediate neighbors rather than the global page structure.
  • GraphSAGE is the Most Robust Backbone: GraphSAGE emerged as the top-performing architecture across all configurations. Its inductive neighborhood aggregation method is particularly well-suited for handling the heterogeneous layouts found in public administration documents.
  • Late Fusion Beats Early Fusion: The dual-branch framework (processing text and vision separately through GNNs before combining them) outperformed early concatenation. Specialized branches allow the network to learn better modality-specific structural representations.

Key Results

  • Overall Performance: Across all 24 document sources, the dual-branch GraphSAGE model achieved excellent per-class accuracy, hitting ~99% for Identifiers, ~92-93% for Titles, and ~96% for Body text.
  • Beating the Baseline: When tested on the five largest document sources, the dual-branch GNN approach outperformed a strong Random Forest baseline in specific classes across four of the sources. For the primary Spanish national gazette (BOE), the GNN achieved a superior overall accuracy of 97.93%.

Limitations and Future Work

While promising, the current approach has a few limitations:

  • Lack of Explicit Relative Positioning: The graphs use distance to draw edges but do not explicitly encode directional spatial relationships (e.g., "above", "to the left of"), which are highly informative in document layouts.
  • Future Directions: The authors plan to explore alternative graph structures like visibility graphs and sequential GNNs to capture multi-page document context. They also aim to integrate Named Entity Recognition (NER) and Entity Linking (EL) to deeply combine layout analysis with semantic text understanding.

Summary updated

BibTeX
@misc{lopezduran2025benchmarking,
  author = {Miguel Lopez-Duran and Julian Fierrez and Aythami Morales and Ruben Tolosana and Oscar Delgado-Mohatar and Alvaro Ortigosa},
  title = {{Benchmarking Graph Neural Networks for Document Layout Analysis in Public Affairs}},
  year = {2025},
  eprint = {2505.14699},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.14699},
}
Figure