TL;DR
This paper introduces GLAM (Graph-based Layout Analysis Model), a lightweight approach to Document Layout Analysis that treats PDF pages as structured graphs rather than raw images. By leveraging PDF metadata and a Graph Neural Network (GNN), GLAM achieves state-of-the-art results on the DocLayNet dataset while being an order of magnitude smaller and over five times faster than leading computer vision-based models.
What Problem Does This Paper Address?
Document Layout Analysis (DLA) is the process of identifying and classifying semantic regions in a document—distinguishing a title from a paragraph, or a table from a figure.
Most current state-of-the-art (SOTA) models treat this as a pure Computer Vision (CV) problem, processing document pages as images. While effective, this "pixels-only" approach has two major drawbacks:
- Efficiency: These models (like LayoutLMv3 or YOLOv5) are computationally heavy, often exceeding 130 million parameters, making them slow and expensive to run at scale.
- Information Loss: Digital PDFs contain rich metadata (font types, exact text locations, character densities) that CV models typically discard.
The authors argue that for "born-digital" documents, we should use this metadata directly to understand the relationships between document objects.
Methods
The authors propose a hybrid approach that frames DLA as a joint graph segmentation and node classification problem.
- Graph Generation: Using a PDF parser (
pdfminer.six), the model extracts text boxes as "nodes." Each node has 79 features (e.g., location, font size, text length). Edges are created between a node and its nearest neighbors in four directions, plus edges that follow the natural reading order. - The GLAM Architecture:
- Graph Network: Uses Topology Adaptive Graph (TAG) convolutional layers to process the spatial relationships.
- CV Feature Extractor: To account for visual elements like lines or background colors not present in text metadata, they use a small ResNet-18 to extract visual features from the area around each text box.
- Joint Learning: The model is trained with a multi-task loss function that simultaneously predicts the category of each node (e.g., "header") and whether an edge represents a "link" (same semantic group) or a "break" (different groups).
- Inference: At runtime, the model removes "negative" edges and uses the remaining connected components to cluster text boxes into final layout segments.
Datasets
The study evaluates GLAM on two major benchmarks:
- DocLayNet: A diverse, human-annotated dataset featuring 80,863 pages across six genres (financial reports, laws, manuals, etc.). It is considered more challenging due to its complex, varied layouts.
- PubLayNet: A massive dataset of ~358,000 biomedical research articles. The authors note that PubLayNet's ground-truth boxes are often misaligned with actual PDF text boxes, which creates a performance ceiling for graph-based models.
Key Insights and Ideas
- Structure over Pixels: For text-heavy documents, the spatial arrangement and metadata of text blocks are often more predictive of layout than raw visual features.
- The Power of Sparsity: Because GLAM operates on a graph of objects rather than a dense grid of pixels, it is incredibly efficient. The core GLAM model has only 4 million parameters, compared to the 140M+ parameters in SOTA vision models.
- Complementary Strengths: Graph models excel at structured text (headers, captions, footers), while CV models excel at "vision-rich" areas (figures and tables). The authors found that a simple ensemble of GLAM and YOLOv5x6 produced a new SOTA on DocLayNet, suggesting these two approaches "see" documents in fundamentally different, yet complementary, ways.
Key Results
- New SOTA: An ensemble of GLAM and YOLOv5x6 achieved a 80.8 mAP on DocLayNet, surpassing the previous best of 76.8.
- Efficiency: GLAM is 5x faster than YOLOv5x6 and over 60x faster than LayoutLMv3 on a single GPU. It can process nearly 100 pages per second on a standard T4 GPU.
- Class-Specific Wins: Despite its small size, GLAM outperformed the 140M-parameter YOLO model on 5 out of 11 classes in DocLayNet, particularly on small, text-based elements like page footers and headers.
Limitations and Future Work
- Parsing Dependency: GLAM relies entirely on the quality of the underlying PDF parser. If a document is a low-quality scan (OCR-dependent) or has a corrupted internal structure, the graph representation suffers.
- Vision-Rich Content: The model still struggles with figures and complex tables where text is sparse. The authors suggest that integrating more sophisticated visual features or better text embeddings (rather than just heuristics) could bridge this gap.
- Misalignment Issues: The model is "handicapped" on datasets like PubLayNet where human-drawn ground-truth boxes don't perfectly snap to the underlying PDF text boxes. Future work may involve "snapping" algorithms to better align these data sources.
Summary updated