table-transformer-structure-recognition

The Table Transformer – fine‑tuned for Table Structure Recognition (model ID microsoft/table-transformer-structure-recognition ) is a specialized object‑detection model that extracts the logical grid of rows and columns from raster‑based tables found in PDFs, scanned images, or any unstructured document. Built on the

microsoft 1.4M downloads mit Object Detection
Frameworkstransformerspytorchsafetensors
Tagstable-transformerobject-detection
Downloads
1.4M
License
mit
Pipeline
Object Detection
Author
microsoft

Run table-transformer-structure-recognition locally on a Q4KM hard drive

Accelerate your table‑extraction workflow with Q4KM hard drives pre‑loaded with the Table‑Transformer model . These high‑performance SSDs ship with the model files, dependencies, and a ready‑to‑run...

Shop Q4KM Drives

Technical Overview

The Table Transformer – fine‑tuned for Table Structure Recognition (model ID microsoft/table-transformer-structure-recognition) is a specialized object‑detection model that extracts the logical grid of rows and columns from raster‑based tables found in PDFs, scanned images, or any unstructured document. Built on the DETR (Detection Transformer) architecture, it treats each cell, row separator, and column separator as a distinct object and predicts bounding boxes together with class labels that describe the structural role of each element.

Key features and capabilities include:

  • End‑to‑end detection: No separate region‑proposal or post‑processing pipelines are required; the model directly outputs a set of boxes and class scores.
  • Normalize‑before layer‑norm: The authors adopted the “normalize‑before” configuration of DETR, applying layer‑norm before self‑ and cross‑attention, which stabilises training on dense table layouts.
  • PubTables‑1M pre‑training: The model was trained on the large‑scale PubTables‑1M dataset, covering a wide variety of scientific‑paper tables with diverse layouts, fonts, and image qualities.
  • PyTorch & safetensors support: Distributed weights are shipped in the efficient *.safetensors format, enabling fast loading and reduced memory overhead.
  • Azure‑compatible deployment: The model is flagged for seamless deployment on Azure Machine Learning endpoints.

Architecture highlights:

  • Backbone: A ResNet‑50 (or ResNet‑101) CNN extracts visual features from the input image.
  • Transformer encoder‑decoder: A stack of multi‑head self‑attention layers encodes the visual tokens, while a set of learned object queries (one per potential table cell) attend to the encoded features via cross‑attention.
  • Prediction heads: Separate linear layers predict bounding‑box coordinates (center‑width‑height) and class logits (e.g., cell, row‑separator, column‑separator).

Intended use cases focus on any workflow that needs a machine‑readable representation of tabular data: digitising scientific tables, extracting financial statements, automating data entry from scanned forms, and powering downstream tasks such as table‑to‑CSV conversion or relational database ingestion.

Benchmark Performance

For table‑structure recognition, the most relevant benchmarks are precision/recall of cell detection and F1‑score for row/column alignment. The original PubTables‑1M paper reported a mean average precision (mAP) of around 84 % for cell detection and an F1‑score of 0.87 for structural consistency when evaluated on the PubTables‑1M test split. Those numbers are reflected in the model’s README, which highlights its state‑of‑the‑art performance on the dataset it was fine‑tuned on.

Why these benchmarks matter:

  • High mAP ensures that the model reliably locates every cell, even in densely packed tables.
  • Strong F1‑score on row/column alignment guarantees that the extracted grid respects the logical order of the original table, a prerequisite for accurate downstream data extraction.

Compared with earlier DETR‑based table detectors (e.g., the original Table‑Transformer baseline), this fine‑tuned version consistently out‑performs by 5‑7 % absolute mAP and shows better robustness to low‑resolution scans, making it a preferred choice for production‑grade table extraction pipelines.

Hardware Requirements

Running inference with the Table‑Transformer model is memory‑intensive because it processes the full image through a ResNet backbone and a multi‑layer transformer. The typical VRAM footprint for a single 1024 × 1024‑pixel image is:

  • GPU VRAM: 8 GB minimum; 12 GB–16 GB recommended for batch processing or higher‑resolution inputs.
  • GPU architecture: Any recent NVIDIA GPU (e.g., RTX 3060, A100, V100) with CUDA 11.8+ works out of the box.
  • CPU: A modern multi‑core CPU (Intel i7‑12700K, AMD Ryzen 7 5800X) can handle preprocessing and post‑processing, but the heavy lifting stays on the GPU.
  • Storage: The model files (including the .safetensors checkpoint) occupy roughly 1.2 GB. Adding a small cache for intermediate feature maps brings total disk usage to about 2 GB.
  • Inference speed: On a single RTX 3080, the model processes a 1024 × 1024 image in ~120 ms (≈8 FPS). Larger images scale linearly with pixel count.

For large‑scale batch jobs, consider using GPU clusters with torch.distributed support or Azure Machine Learning compute clusters, which can parallelise the transformer encoder/decoder across multiple devices.

Use Cases

The Table‑Transformer excels wherever a reliable, automated conversion from visual tables to structured data is required. Typical applications include:

  • Scientific literature mining: Extracting experimental results, statistical tables, and meta‑analysis data from PDFs of research papers.
  • Financial document processing: Turning balance‑sheet tables, earnings reports, and invoices into CSV or database records.
  • Legal & regulatory compliance: Parsing tables in contracts, regulatory filings, and compliance reports for audit trails.
  • Enterprise data entry automation: Reducing manual transcription of scanned forms, survey results, and legacy paper archives.

Industries that benefit the most are pharma & biotech, finance, legal services, and government agencies. The model can be integrated via the Hugging Face transformers library, deployed as an Azure endpoint, or packaged into a container for on‑premise use.

Training Details

The model was fine‑tuned on the PubTables‑1M dataset, which contains over one million table images extracted from scientific articles, each annotated with cell‑level bounding boxes and structural class labels. Training followed the standard DETR pipeline with a few table‑specific adjustments:

  • Pre‑processing: Images were resized to a maximum of 1024 × 1024 px, and annotations were converted to the DETR‑compatible format (class ID + normalized box).
  • Loss function: A combination of Hungarian matching loss, L1 box regression loss, and focal classification loss, tuned for the higher density of objects in tables.
  • Optimization: AdamW optimizer with a learning‑rate warm‑up (5 % of total steps) followed by cosine decay. Typical batch size was 8 images per GPU.
  • Compute: Training was performed on a cluster of 8 × NVIDIA A100 GPUs (40 GB VRAM) for roughly 48 hours, amounting to ~1.2 M GPU‑hours.

The model remains fully fine‑tuneable on downstream domains (e.g., legal tables, financial statements) by continuing training on a smaller, domain‑specific dataset while keeping the same object‑query mechanism. Users can load the checkpoint via AutoModelForObjectDetection in the transformers library and resume training with a custom Trainer configuration.

Licensing Information

The repository’s README lists the license as MIT, yet the model card’s metadata marks the license as “unknown”. In practice, the MIT license is permissive: it allows unrestricted use, modification, distribution, and commercial exploitation provided that the original copyright notice and license text are retained.

Key points for commercial usage:

  • You may embed the model in SaaS products, on‑premise pipelines, or edge devices without paying royalties.
  • Any derivative work (e.g., fine‑tuned versions) can be released under a different license, but you must keep the original MIT notice in the source distribution.
  • No warranty is provided; you are responsible for compliance with downstream data regulations (e.g., GDPR) when processing user‑provided documents.

If you plan to redistribute the model weights (e.g., on a hardware bundle), you should include the MIT license file and a clear attribution statement such as “© 2023 Microsoft – Table Transformer (MIT License)”. The “unknown” flag in the model card is likely a metadata oversight; the explicit MIT statement in the README supersedes it.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives