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

READ: Recursive Autoencoders for Document Layout Generation

Akshay Gadi Patil, Omri Ben-Eliezer, Or Perel, Hadar Averbuch-Elor

Abstract

Layout is a fundamental component of any graphic design. Creating large varieties of plausible document layouts can be a tedious task, requiring numerous constraints to be satisfied, including local ones relating different semantic elements and global constraints on the general appearance and spacing. In this paper, we present a novel framework, coined READ, for REcursive Autoencoders for Document layout generation, to generate plausible 2D layouts of documents in large quantities and varieties. First, we devise an exploratory recursive method to extract a structural decomposition of a single document. Leveraging a dataset of documents annotated with labeled bounding boxes, our recursive neural network learns to map the structural representation, given in the form of a simple hierarchy, to a compact code, the space of which is approximated by a Gaussian distribution. Novel hierarchies can be sampled from this space, obtaining new document layouts. Moreover, we introduce a combinatorial metric to measure structural similarity among document layouts. We deploy it to show that our method is able to generate highly variable and realistic layouts. We further demonstrate the utility of our generated layouts in the context of standard detection tasks on documents, showing that detection performance improves when the training data is augmented with generated documents whose layouts are produced by READ.

Introduction

Document layout generation is a critical task for automating graphic design and creating synthetic data for training Document AI systems. While generative models like GANs have made strides in this area, they often struggle with "dense" documents—those containing dozens or hundreds of elements, such as tax forms or technical manuscripts. Previous state-of-the-art methods, like LayoutGAN, were typically limited to around nine elements per page.

The READ (REcursive Autoencoders for Document layout generation) framework addresses these limitations by treating a document layout as a recursive tree of spatial relationships rather than a flat list of bounding boxes. This hierarchical approach allows the model to capture complex, multi-scale structures and generate realistic layouts with high element counts, even when trained on relatively small datasets.

Methodology

Hierarchical Decomposition

The core innovation of READ is representing a document as a binary tree. The process begins by scanning the document (typically left-to-right, top-to-bottom) and recursively grouping "atomic units" (individual bounding boxes) into larger blocks based on their spatial relationships.

Hierarchical decomposition of a document layout into a recursive tree structure.

The model recognizes seven specific spatial relationships: right, left, bottom, bottom-left, bottom-right, enclosed, and wide-bottom. By modeling these relationships, the network learns the underlying "grammar" of a layout.

Recursive Autoencoding (RvNN-VAE)

The framework utilizes a Recursive Neural Network - Variational Autoencoder (RvNN-VAE). The architecture consists of:

  • Encoders (SREs): These take two child nodes and their relative positions to produce a parent "code."
  • Decoders (SRDs): These take a parent code and split it back into two children and their relative positions.
Architecture of the READ framework (RvNN-VAE).

By mapping the hierarchical structure to a compact latent space approximated by a Gaussian distribution, the model can sample novel hierarchies to generate new, plausible document layouts.

DocSim Metric

To evaluate structural similarity, the authors introduced DocSim, a metric inspired by the BLEU score in NLP. It employs a bipartite matching algorithm to compare layouts based on the shape, location, and semantic role (e.g., title, paragraph, figure) of the elements.

Datasets and Evaluation

READ was evaluated on two primary datasets:

  1. ICDAR2015: A public dataset of 478 magazine-style documents.
  2. User-Solicited (US) Dataset: A new dataset of 2,036 complex documents, such as tax forms and banking applications, averaging ~28 boxes per page.

Results and Insights

The experimental results highlight several key advantages of the READ framework:

  • Complexity and Scalability: READ successfully generates layouts with up to 74 boxes, significantly exceeding the capacity of previous flat-representation models.
  • Data Efficiency: Because the recursive structure shares weights across different levels of the tree, the model is remarkably data-efficient, producing high-quality results with only a few hundred training samples.
  • Downstream Utility: Augmenting training data for object detection (using Mask R-CNN) with READ-generated layouts improved Average Precision (AP) on the ICDAR2015 dataset by 3% (from 0.609 to 0.634).

Conclusion and Future Work

READ demonstrates that hierarchical modeling is a powerful paradigm for document layout generation. While the current model excels at structural synthesis, future work could integrate GAN-based refinement to reduce alignment artifacts and explore the generation of actual semantic content (text and images) within the generated boxes.

Summary updated

BibTeX
@inproceedings{patil2020read,
  author = {Akshay Gadi Patil and Omri Ben-Eliezer and Or Perel and Hadar Averbuch-Elor},
  title = {{READ: Recursive Autoencoders for Document Layout Generation}},
  booktitle = {Workshops @ CVPR},
  year = {2020},
  url = {https://openreview.net/forum?id=mjFNKFSu5T},
}
Figure