NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

TSRFormer: Table Structure Recognition with Transformers

Weihong Lin, Zheng Sun, Chixiang Ma, Mingze Li, Jiawei Wang, Lei Sun, Qiang HuoACM Multimedia 2022 · DOI · OpenReview

Abstract

Table Structure Recognition (TSR) remains a challenging task in document analysis, particularly when dealing with "in-the-wild" images characterized by geometric distortions, curved pages, and complex layouts. Traditional methods often rely on image segmentation, which struggles with the thin, overlapping, or non-linear boundaries found in real-world captures. This paper discusses TSRFormer, a novel transformer-based approach that reformulates table separation as a line regression problem. By utilizing a two-stage Separator REgression TRansformer (SepRETR), the model achieves state-of-the-art performance across major benchmarks and demonstrates unprecedented robustness against physical distortions.

Introduction

The goal of Table Structure Recognition is to convert table images into machine-readable formats by identifying cell boundaries and spanning information. While digital-native documents with axis-aligned tables are relatively well-handled by current deep learning models, real-world images—such as smartphone captures—introduce significant noise. Perspective distortion, curved paper surfaces, and borderless cell structures often cause traditional segmentation-based models to fail.

Most existing TSR frameworks assume tables are perfectly horizontal and vertical. TSRFormer addresses these limitations by treating row and column separation as a geometric regression task rather than a pixel-level classification task. This allows the model to "draw" flexible, curvilinear separation lines that adapt to the physical contours of the document.

Methodology

TSRFormer utilizes a two-stage framework designed to handle both the localization of separators and the logical reconstruction of the table grid.

1. SepRETR (Separator REgression TRansformer)

The core innovation of TSRFormer is SepRETR, which moves away from heatmap-based segmentation. Instead, it formulates line prediction as a regression problem through two distinct stages:

  • Stage 1: Reference Point Prediction: The model first predicts initial reference points for each potential row and column separator.
  • Stage 2: Coordinate Regression: These reference points serve as "object queries" for a DETR-based transformer decoder. The decoder then regresses the precise coordinates of the separation lines. By representing lines as a series of points, the model can naturally accommodate curvature.

To address the slow convergence typical of DETR architectures, the authors implemented a prior-enhanced matching strategy. This strategy links queries to ground-truth lines based on physical proximity, providing the transformer with a spatial "hint" that stabilizes training. Additionally, a specialized cross-attention module allows the model to sample high-resolution features efficiently, ensuring high localization accuracy without excessive computational costs.

2. Relation Network Cell Merging

Once the separators define a candidate grid of cells, a secondary Relation Network is employed. This network examines adjacent cells to determine if they should be merged, effectively recovering complex row-spans and column-spans that are common in professional and scientific documents.

Experimental Evaluation

The model was rigorously tested against several diverse benchmarks to evaluate its performance on both standard and distorted layouts:

  • SciTSR: 15,000 tables from scientific literature, primarily axis-aligned.
  • PubTabNet: A large-scale dataset containing over 500,000 tables.
  • WTW (Wild Table Warehouse): A dataset focused on bordered tables in complex, distorted real-world environments.
  • In-House Dataset: A challenging collection of over 40,000 images featuring extreme distortions, curved pages, and borderless tables to test the model's limits.

Key Results and Insights

TSRFormer achieved state-of-the-art (SOTA) results across all tested benchmarks, proving the efficacy of the regression-based approach:

  • SciTSR: Achieved a 99.4% F1-score, surpassing previous methods like LGPMA and FLAG-Net.
  • PubTabNet: Reached a TEDS-Struct score of 97.5%, establishing a new performance ceiling for the dataset.
  • WTW: Outperformed Cycle-CenterNet—a model specifically designed for distorted tables—with a 93.4% F1-score.
  • Robustness: On the difficult in-house dataset, TSRFormer outperformed the enhanced SPLERGE baseline by a significant 11.4% in F1-score. This result highlights the model's superior ability to handle curved and borderless tables that typically confuse split-and-merge approaches.

The Advantage of Regression

The primary insight of this research is that thin structural lines are better represented as geometric entities (coordinates) than as clusters of pixels. By treating each separator as an "object" to be detected, the model leverages the global context-awareness of Transformers. This ensures that a separation line remains continuous even when there are visual gaps in the table border or significant image noise.

Conclusion and Future Work

TSRFormer represents a significant step forward in making table recognition robust for real-world applications. By shifting the paradigm from segmentation to regression, it successfully handles the geometric complexities of "in-the-wild" document captures.

While highly effective, the current framework relies on a two-step "split then merge" process. Future research may focus on tighter integration of OCR text-content features directly into the line regression stage. This could help guide separators through extremely sparse or empty spaces where visual cues are minimal, further enhancing the model's performance on highly complex, borderless layouts.

Summary updated

BibTeX
@misc{lin2022tsrformer,
  author = {Weihong Lin and Zheng Sun and Chixiang Ma and Mingze Li and Jiawei Wang and Lei Sun and Qiang Huo},
  title = {{TSRFormer: Table Structure Recognition with Transformers}},
  year = {2022},
  eprint = {2208.04921},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2208.04921},
}
Figure