Introduction
Document Layout Analysis (DLA) is the foundational task of identifying and classifying structural regions within a document, such as titles, tables, and paragraphs. While critical for downstream tasks like Information Extraction, DLA remains challenging due to the complex, overlapping, and often low-quality layouts found in real-world documents like invoices and forms.
Existing DLA models typically fall into two categories: vision-heavy models that treat documents as natural images, often neglecting textual semantics, and multi-modal models that struggle to effectively pre-train on the spatial relationships of text. Furthermore, the field has been constrained by datasets like PubLayNet, which focus primarily on scientific papers and do not represent the diversity of administrative or commercial documents. This paper introduces the Vision Grid Transformer (VGT) and a new benchmark, $D^4LA$, to address these limitations.
Methodology: The Vision Grid Transformer
The Vision Grid Transformer (VGT) utilizes a decoupled two-stream architecture to capture both visual and textual features effectively:
- Vision Stream: Employs a standard Vision Transformer (ViT) to process document images, capturing visual cues like lines, textures, and colors.
- Grid Stream: Introduces a novel Grid Transformer (GiT). Unlike traditional models that process text as a 1D string, the GiT takes a 2D grid of tokens as input. This approach preserves the spatial context of text directly, allowing for natural alignment with image pixels without the need for complex 2D position embeddings.
Pre-training Objectives
The GiT branch is pre-trained using two specialized objectives:
- Masked Grid Language Modeling (MGLM): Similar to BERT, this masks tokens in the 2D grid, forcing the model to recover them using surrounding spatial and linguistic context.
- Segment Language Modeling (SLM): This aligns segment-level features (e.g., a line of text) with pseudo-features from a teacher model (like LayoutLM) via contrastive learning.
Features from both streams are fused at multiple scales using a Feature Pyramid Network (FPN) to handle diverse region sizes, from footnotes to full-page tables.
The $D^4LA$ Benchmark
To move beyond the "scientific paper" focus of previous benchmarks, the authors released $D^4LA$, a diverse dataset featuring 12 document types (including Budget, Email, Form, Invoice, and Memo) and 27 detailed layout categories. This dataset is significantly more challenging and representative of real-world document variety than predecessors like PubLayNet.
Results and Discussion
VGT achieves state-of-the-art (SOTA) results across major benchmarks:
- PubLayNet: Reached 96.2% mAP, surpassing previous leaders like VSR and LayoutLMv3.
- DocBank: Achieved 84.1% mAP, a significant improvement over the 79.6% baseline.
- $D^4LA$: Established an initial benchmark of 68.8% mAP.
Qualitatively, VGT excels at distinguishing visually similar but semantically distinct regions. For instance, it showed a 6.6% improvement in the "Abstract" category on DocBank, demonstrating its superior ability to model linguistic features compared to vision-only approaches.
Conclusion
The Vision Grid Transformer represents a significant step forward in DLA by explicitly pre-training a 2D grid-based textual stream alongside a vision stream. While the model is larger (243M parameters) and slower (460ms/page) than some vision-only counterparts, its superior accuracy and ability to handle diverse document types—as evidenced by the new $D^4LA$ benchmark—make it a powerful tool for complex document understanding. Future work may extend this image-centric detection model to text-centric tasks like Key Information Extraction (KIE).
Summary updated