Abstract
Key information extraction from document images is of paramount importance in office automation. Conventional template matching based approaches fail to generalize well to document images of unseen templates, and are not robust against text recognition errors. In this paper, we propose an end-to-end Spatial Dual-Modality Graph Reasoning method (SDMG-R) to extract key information from unstructured document images. We model document images as dual-modality graphs, nodes of which encode both the visual and textual features of detected text regions, and edges of which represent the spatial relations between neighboring text regions. The key information extraction is solved by iteratively propagating messages along graph edges and reasoning the categories of graph nodes. In order to roundly evaluate our proposed method as well as boost the future research, we release a new dataset named WildReceipt, which is collected and annotated tailored for the evaluation of key information extraction from document images of unseen templates in the wild. It contains 25 key information categories, a total of about 69000 text boxes, and is about 2 times larger than the existing public datasets. Extensive experiments validate that all information including visual features, textual features and spatial relations can benefit key information extraction. It has been shown that SDMG-R can effectively extract key information from document images of unseen templates, and obtain new state-of-the-art results on the recent popular benchmark SROIE and our WildReceipt.
Introduction
Extracting specific data, such as total amounts, dates, or addresses, from documents like receipts and invoices is a cornerstone of office automation. However, traditional methods face two major hurdles: template dependency and the loss of spatial context. Many modern approaches treat a document as a 1D string of text, similar to standard Named Entity Recognition (NER). This ignores the rich 2D spatial context—for example, a "Total" value is often located to the right of or below a "Total" label. This relationship is lost when text is flattened into a single line.
The Spatial Dual-Modality Graph Reasoning (SDMG-R) network aims to create a robust, template-free system that understands both textual content and its 2D spatial arrangement.
Methodology
The SDMG-R architecture follows a three-step process to fuse multi-modal information and perform reasoning over the document structure.
1. Dual-Modality Feature Extraction
The model extracts features from two primary sources:
- Textual Features: A character-level Bi-LSTM encodes the recognized text within each bounding box, capturing semantic meaning.
- Visual Features: A U-Net architecture extracts visual cues (e.g., font style, bolding, or lines) from the image. These features are then cropped via Region of Interest (RoI) Pooling to align with specific text boxes.
2. Efficient Fusion
To combine these modalities, the authors use a Kronecker product. To manage the computational expense of a raw Kronecker product, they implement a block-diagonal tensor decomposition. This drastically reduces learnable parameters while maintaining the ability to model complex interactions between text and vision.
3. Graph Reasoning Module
The document is modeled as a graph where nodes represent text boxes and edges represent spatial distances and angles. The model uses an iterative message-passing scheme with a dynamic attention mechanism. This allows each text box to "consult" its neighbors to determine its own category (e.g., a number might be classified as a "Tax Value" because it is adjacent to a box labeled "Tax").
Datasets and Experimental Results
The model was evaluated on two key datasets:
- SROIE: A popular benchmark of 600 scanned receipts with four categories.
- WildReceipt: A new, more challenging dataset introduced by the authors. It contains 1,740 images and 25 fine-grained categories. These images are captured "in the wild," including folds, shadows, and non-front-facing angles.
SDMG-R achieved state-of-the-art performance, with an F1-score of 87.1% on SROIE and 88.7% on WildReceipt, outperforming previous leaders like Chargrid and VRD. Ablation studies revealed that removing the graph reasoning component caused the largest performance drop (~11.5%), proving that spatial context is the most critical factor. While text is the primary signal, visual features provide a significant boost, especially when OCR errors occur.
Conclusion
SDMG-R demonstrates that 2D spatial relationships are more reliable than 1D text sequences for key information extraction. By treating document images as graphs and fusing visual and textual modalities, the system achieves high robustness across varying templates and noisy real-world conditions. Future work will focus on creating a truly end-to-end system where text detection, recognition, and information extraction are handled in a single unified pass.
Summary updated