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

Latent Diffusion for Guided Document Table Generation

Syed Jawwad Haider Hamdani, Saifullah Saifullah, Stefan Agne, Andreas Dengel, Sheraz Ahmed

TL;DR

This paper introduces a guided image synthesis framework that uses Latent Diffusion Models (LDMs) to generate realistic, fully annotated document table images. By conditioning the generation process on binary row and column masks, the approach provides precise control over table layouts, creating high-quality synthetic data that effectively trains object detection models for table structure recognition.

What Problem Does This Paper Address?

Table Structure Recognition (TSR)—the task of identifying rows, columns, and cells within a document table—is vital for automated document analysis. However, training deep learning models for TSR is notoriously difficult due to data scarcity.

Currently, researchers face a frustrating trade-off:

  1. Manual Annotation: High quality, but extremely labor-intensive and expensive, leading to small datasets.
  2. Automated Parsing (HTML/PDF metadata): Large-scale, but plagued by annotation noise and low visual variance. These datasets rarely capture the real-world complexities, corruptions, and stylistic diversity of printed documents.

The authors tackle this bottleneck by generating synthetic table images that are both visually diverse and automatically paired with perfect, pixel-level structural annotations.

Methods

The authors propose a structure-conditioned Latent Diffusion Model (LDM) utilizing a Diffusion Transformer (DiT) backbone rather than a traditional U-Net.

The workflow consists of three main phases:

  1. Latent Compression: To reduce computational overhead, a variational autoencoder (VAE) pretrained on the LAION-5B natural image dataset is used to compress RGB table images into a lower-dimensional latent space (compression factor $f=8$). Crucially, the VAE weights remain frozen during training.
  2. Mask Conditioning: Ground-truth table annotations are transformed into binary mask images ($m$), where rows and columns are represented as 1s and the background as 0s. These masks are fed into the encoder and concatenated with the noisy image latents along the channel dimension.
  3. Forward and Reverse Diffusion: The Diffusion Transformer (12 layers, embedding dimension of 768) is trained to predict the injected noise using a standard mean squared error ($\mathcal{L}_{mse}$) loss, guided directly by the structural layout of the mask.
Fig. 1: The entire model depicting our methodology. z0 is the latent represen- tation of input document table image x, zt is the is the noisy latent after for- ward diffusion, Mask Condition is the conditioning mask image that depicts the row/column structure of the training table image, Sampling region depicts the newly generated synthetic image.

During inference, a standard DDIM sampler generates new table images from pure noise over 750 intermediate steps, strictly adhering to whatever conditioning mask is provided.

Datasets

The approach was trained and evaluated using two key benchmarks:

  • PubTables-1M: A massive dataset containing nearly 950,000 fully annotated tables. The authors utilized 450,000 samples for training their diffusion models and evaluated downstream object detection on its 93,834-image test set.
  • ICDAR2013: A classic, small-scale competition dataset used purely for downstream evaluation (100 validation images, 158 test images) to test how well the synthetic data generalizes.
Fig. 2: A few sample images from the PubTables-1M [32] dataset (top), along with their corresponding mask images depicting row and column structures (bot- tom), are shown.

Key Insights and Ideas

  • Structure Guidance Improves Fidelity: Introducing structural masks didn't just help control the layout; it actually improved overall image quality. Conditional models achieved lower Fréchet Inception Distance (FID) scores than unconditional ones, proving that structural constraints help the diffusion model generate more coherent document features.
  • Zero-Shot Layout Generalization: The model successfully generalized to completely random, out-of-distribution masks that it never encountered during training. This means users can procedurally design entirely new table structures, and the model will realistically "fill in the blanks" with text and lines.
  • Cross-Domain VAE Transferability: A VAE trained entirely on natural images (LAION-5B) proved highly effective at reconstructing document layouts without any fine-tuning, saving significant training time.

Key Results

The authors validated their synthetic data by using it to train a YOLOv5 object detection model for the task of identifying rows and columns.

  • High Visual Quality: The mask-conditioned model at $512 \times 512$ resolution achieved the best FID score of 7.81, outperforming the unconditional baseline (8.38).
  • Competitive Downstream Performance: A YOLOv5 model trained entirely on 250k synthetic images achieved a mean Average Precision ($\text{mAP}_{50}$) of 0.947 on the real PubTables-1M test set. This is remarkably close to the performance of the same model trained on actual real-world data (0.970).
  • Real Data Augmentation Boost: On the ICDAR2013 benchmark, augmenting the tiny native validation set with just 1,000 synthetic images boosted the YOLOv5 model's F1-score from 0.9350 to 0.9536, comfortably outperforming historical state-of-the-art commercial engines like FineReader and OmniPage.

Limitations and Future Work

While the structural layouts are highly accurate, the textual content within the generated tables remains a weak point. At close inspection, the text often appears smudged or illegible. The authors note that the model cannot currently generate coherent semantic text inside the cells.

To address this, future work will focus on extending training times (up to 800k iterations) to sharpen textual details. Additionally, the authors plan to modify the conditioning mechanism to accept textual prompts (e.g., specifying the exact number of rows, columns, or cell content) for even finer control over the generation process.

Summary updated

BibTeX
@inproceedings{hamdani2024latent,
  author = {Syed Jawwad Haider Hamdani and Saifullah Saifullah and Stefan Agne and Andreas Dengel and Sheraz Ahmed},
  title = {{Latent Diffusion for Guided Document Table Generation}},
  booktitle = {ICDAR},
  year = {2024},
  doi = {10.1007/978-3-031-70549-6\_22},
}
Figure