Abstract
Table structure recognition (TSR) is a critical component of document analysis, yet it remains challenging due to the diversity of table layouts and content. We present TableFormer, a transformer-based model that predicts HTML table structures and cell bounding boxes simultaneously. By separating structure prediction from optical character recognition (OCR), TableFormer achieves superior accuracy and language-agnostic capabilities. Evaluation on standard benchmarks demonstrates significant improvements in Tree-Edit-Distance-Based Similarity (TEDS) scores, particularly for complex tables.
Introduction
While humans can interpret a table's layout intuitively, automated systems often struggle with the "geometry" and "logic" of tabular data. Tables feature a wide array of formats, including multi-row headers, empty cells, and multi-line text that disrupts traditional row-based extraction methods. Existing deep learning models often rely on "Image-to-Text" architectures that attempt to predict HTML structure and text content simultaneously. This approach introduces language dependency and relies on computationally expensive OCR decoders that may struggle with precise cell localization. TableFormer addresses these limitations by focusing on the structural skeleton of the table independently of the text content.
Methods: The Dual-Decoder Architecture
TableFormer utilizes a hybrid architecture combining a convolutional neural network (CNN) with a Transformer to understand table geometry.
Backbone and Dual-Decoders
A ResNet-18 CNN encodes the input image into high-level features. The core innovation lies in the dual-decoder strategy:
- Structure Decoder: A Transformer predicts a sequence of HTML tags (e.g.,
<td>,<tr>,colspan) to define the table's skeleton. - Cell BBox Decoder: Inspired by the Detection Transformer (DETR) architecture, this decoder uses the hidden states from the Structure Decoder as "queries" to locate the exact bounding box of each cell in the original image.
Content Extraction
By providing precise bounding boxes, TableFormer allows the system to extract text directly from programmatic PDFs. This bypasses the need for the model to "read" the text itself, enhancing speed and accuracy while maintaining language agnosticism.
Datasets and SynthTabNet
The researchers evaluated TableFormer on several massive, industry-standard datasets: PubTabNet (509,000 tables), FinTabNet (112,000 tables), and TableBank (145,000 tables). To address the lack of complex examples in real-world data, the authors introduced SynthTabNet, a synthetic dataset of 600,000 tables. Unlike real-world datasets, SynthTabNet was specifically designed to include complex spanning cells and properly annotated empty cells, which are common failure points for AI models.
Key Results
TableFormer achieved state-of-the-art results across multiple benchmarks, measured by the Tree-Edit-Distance-Based Similarity (TEDS) score.
- PubTabNet: Achieved a TEDS score of 96.75%, a significant improvement over the previous state-of-the-art (89.9%).
- Complex Tables: On tables with spanning cells, it reached 95.0%, significantly outperforming prior models.
- Zero-Shot Language Transfer: A model trained only on English data successfully parsed Japanese tables, demonstrating its robust structural understanding.
Conclusion
TableFormer demonstrates that decoupling structure prediction from text recognition is a powerful strategy for table parsing. By treating structure as a query for cell localization, the model ensures synchronization between the logical and physical layout of a table. While the model faces challenges with very large tables due to image resizing—which can obscure fine details—future work on multi-scale architectures promises to address these limitations.
Summary updated