# RanLayNet: A Synthetic Dataset for Document Layout Detection via Domain Adaptation

> RanLayNet is a synthetic document layout dataset created by randomly compositing cropped elements from PubLayNet onto blank canvases, designed to improve domain adaptation and generalization for layout detection models.

- Authors: Hunter Heidenreich
- Published: 2026-03-12
- Updated: 2026-03-13
- Paper: Preprint (arXiv) <https://arxiv.org/abs/2404.09530>
- Paper: Published (ACM MMAsia 2023) <https://doi.org/10.1145/3595916.3626448>
- Code: RanLayNet Code & Data <https://github.com/midas-research/randomlaynet>
- Source: Bevaya Labs, <https://labs.bevaya.ai/>

---


## TL;DR

RanLayNet is a synthetic document layout dataset generated by randomly cropping layout elements (text, title, list, table, figure) from PubLayNet and compositing them onto blank canvases with automatically generated bounding box annotations. The authors show that fine-tuning YOLOv8 on a source dataset followed by further fine-tuning on RanLayNet improves cross-domain table detection performance on DocLayNet compared to using the source dataset alone.

## What kind of paper is this?

**Dominant:** $\Psi\_{\text{Resource}}$ : the headline contribution is the RanLayNet dataset itself, a synthetically generated document layout dataset with automatic annotations. The paper dedicates substantial space to the dataset construction pipeline, class distribution, and its role as a reusable training resource.

**Secondary:** $\Psi\_{\text{Method}}$ : the paper frames the dataset within a domain adaptation workflow and evaluates a two-stage fine-tuning strategy (source dataset $\rightarrow$ RanLayNet $\rightarrow$ target inference). However, the fine-tuning procedure itself is standard YOLOv8 training with no novel algorithmic contribution.

## What is the motivation?

Document layout analysis models trained on specific datasets often fail to generalize across domains. A model trained on scientific papers (PubLayNet) struggles with financial documents, manuals, or legal texts. This domain gap is a well-known problem, and collecting large-scale annotated data for every new domain is expensive and time-consuming.

The authors identify two practical issues:

1. **Limited layout diversity in existing datasets.** Datasets like PubLayNet contain documents from a single domain (biomedical papers), which share a relatively uniform structure. Models trained on them can overfit to that structure.

2. **Costly annotation for new domains.** Manually annotating document layouts for every target domain is impractical at scale. Synthetic data generation offers a path to broader layout diversity without manual labeling.

The core idea is that exposing models to highly varied (even noisy) layout configurations during training can improve their ability to generalize to unseen document types.

## What is the novelty?

The main contribution is the RanLayNet dataset and its generation pipeline. The approach works as follows:

1. **Crop extraction.** Individual layout elements (text blocks, titles, lists, tables, figures) are cropped from PubLayNet images using existing bounding box annotations.
2. **Random compositing.** Cropped elements are randomly placed onto blank white canvases. A `smart_plot` function determines positions and gaps to avoid overlap while allowing diverse spatial arrangements.
3. **Automatic annotation.** Bounding box coordinates are tracked during compositing, producing labels in a standard format without any manual annotation.

The resulting dataset contains $\sim$209,000 element instances across five classes:

| Class | Count | Percentage |
|-------|-------|-----------|
| Text | 95,227 | 45.52% |
| Title | 45,306 | 21.65% |
| List | 23,090 | 11.03% |
| Table | 22,146 | 10.58% |
| Figure | 23,493 | 11.22% |

The authors frame this as "noise labeling": the synthetic images have layouts that do not correspond to any real document structure, which they argue reduces bias toward any specific domain.

## What experiments were performed?

All experiments use YOLOv8 as the detection model. The experimental design has two parts:

### In-domain training

The authors first train YOLOv8 on three individual datasets to establish baselines:

- **PubLayNet** (5 classes: text, title, list, table, figure)
- **IIIT-AR-13K** (5 classes: table, figure, natural image, signature, logo)
- **RanLayNet** (5 classes, same as PubLayNet)

They also train on RanLayNet using pretrained weights from PubLayNet and IIIT-AR-13K, respectively.

### Cross-domain table detection

The key evaluation tests cross-domain transfer. Models are evaluated on **DocLayNet** documents from four domains: Manuals, Financial Documents, Laws & Regulations, and Scientific Documents. The focus is on detecting the "Table" class specifically.

Four model variants are compared per source dataset:

1. Source dataset only (PubLayNet or IIIT-AR-13K)
2. Source dataset + RanLayNet fine-tuning

Metrics reported are Precision, Recall, mAP@50, and mAP@95 (referred to as "mAP95" in the paper, likely meaning mAP@[0.5:0.95]).

### Training details

- **Epochs:** 40
- **Batch size:** 16
- **Optimizer:** SGD
- **Learning rate:** $1 \times 10^{-3}$
- **Hardware:** NVIDIA RTX A6000 GPU, 512 GB RAM

## What are the outcomes/conclusions?

The main finding is that adding RanLayNet fine-tuning consistently improves cross-domain table detection compared to using the source dataset alone.

**IIIT-AR-13K + RanLayNet vs. IIIT-AR-13K alone (Table class on DocLayNet):**

- Scientific Documents: mAP@95 improves from 0.002 to 0.398
- Financial Documents: mAP@95 improves from 0.001 to 0.187
- Manuals: mAP@95 improves from 0.026 to 0.226
- Laws & Regulations: mAP@95 improves from 0.026 to 0.222

**PubLayNet + RanLayNet vs. PubLayNet alone (Table class on DocLayNet):**

- Manuals: mAP@95 improves from 0.220 to 0.588
- Scientific Documents: mAP@95 improves from 0.376 to 0.588
- Financial Documents: mAP@95 improves from 0.163 to 0.293
- Laws & Regulations: mAP@95 improves from 0.194 to 0.282

The improvements are more dramatic when starting from IIIT-AR-13K, which is expected since IIIT-AR-13K's label set (annual report graphics) is more distant from the DocLayNet target than PubLayNet's.

**Limitations and observations:**

- The evaluation focuses exclusively on the Table class. Performance on other layout elements is not evaluated in the cross-domain setting.
- The paper does not compare against other domain adaptation or synthetic data baselines.
- The paper does not ablate the dataset generation choices (e.g., random placement strategy, dataset size, class balance).
- The "noise labeling" framing is informal; there is no formal analysis of how the noise characteristics affect learning.
- The absolute mAP@95 scores remain modest (below 0.6 in all cases), suggesting substantial room for improvement.
- The paper reports the same mAP@95 values (0.562, 0.807, 0.761, 0.588) for both the Manuals and Scientific Documents rows in Table 3 (PubLayNet + RanLayNet), which appears to be a data entry error.

## Reproducibility

### Models

- **Architecture:** YOLOv8 (Ultralytics). The specific variant (n/s/m/l/x) is never stated; the paper simply says "YOLOv8." This omission makes exact reproduction difficult, as parameter counts range from $\sim$3M (nano) to $\sim$68M (extra-large).
- **Pretrained initialization:** Not explicitly stated. Standard Ultralytics YOLOv8 initializes from COCO-pretrained weights by default, but the paper does not confirm or deny this.
- **Input resolution:** Not specified. YOLOv8 defaults to 640$\times$640, but the paper does not confirm the image size used.
- **No model weights released.** The GitHub repository does not include trained checkpoints.
- **Two-stage training:** Models are first trained on a source dataset (PubLayNet or IIIT-AR-13K), then further fine-tuned on RanLayNet. The appendix training curves (Figures 4, 5, 6) confirm convergence across all training runs.

### Algorithms

- **Optimizer:** SGD with learning rate $1 \times 10^{-3}$. Momentum and weight decay are not reported; YOLOv8 defaults are momentum=0.937 and weight\_decay=0.0005, but there is no confirmation the defaults were used.
- **Batch size:** 16, with `num\_workers` set to 4.
- **Epochs:** 40 for all experiments (both source and RanLayNet fine-tuning stages).
- **Learning rate schedule:** Not described. YOLOv8 uses a cosine annealing schedule by default with a configurable warmup period, but the paper does not confirm this.
- **Loss function:** Not explicitly named. The appendix training curves plot box\_loss, cls\_loss, and dfl\_loss, confirming the standard YOLOv8 detection losses (bounding box regression, classification, and distribution focal loss).
- **Data augmentation:** No augmentation details are provided beyond whatever YOLOv8 applies by default (mosaic, mixup, HSV jitter, etc.). It is unclear whether default augmentations were kept, modified, or disabled.

### Data

- **RanLayNet:** Generated from PubLayNet crops. The total number of composite images is never stated; the paper reports only $\sim$209,000 element instances across five classes (Text, Title, List, Table, Figure). The GitHub repository includes a CSV file (`raylaynet_dataframe.csv`) and generation scripts (`smart_plot` function).
- **Train/val splits:** Not specified for any dataset in the experimental setup. It is unclear what portion of each dataset was used for training vs. validation.
- **Annotation format:** Implied to follow COCO format conventions (consistent with PubLayNet), but not explicitly confirmed.
- **Source datasets:** PubLayNet ($\sim$360K pages, Apache-2.0 license), IIIT-AR-13K (13,000 pages, custom license).
- **Target dataset:** DocLayNet (80,863 pages, CDLA-Permissive-1.0 license), used only for inference evaluation across four domain subsets (Manuals, Financial Documents, Laws & Regulations, Scientific Documents).
- **RanLayNet license:** The GitHub repository does not include a LICENSE file. The license for the RanLayNet dataset and code is unknown.

### Evaluation

- **Metrics:** Precision, Recall, mAP@50, and mAP@95 (the paper's notation for what is likely mAP@[0.5:0.95], the standard COCO-style averaged metric).
- **In-domain results** (Tables 4-7) serve as sanity checks showing the model learns each dataset's classes, but these are not the main evaluation.
- **Cross-domain evaluation** is limited to the Table class on four DocLayNet domain subsets. Performance on the other four classes (Text, Title, List, Figure) is not evaluated in the cross-domain setting, leaving the generality of the approach undemonstrated.
- **No error bars, confidence intervals, or multi-seed experiments** are reported. All results appear to come from single training runs.
- **No comparison** against other domain adaptation methods (e.g., adversarial adaptation, self-training, CycleGAN-based augmentation) or other synthetic data generation approaches.
- **No ablation** of dataset generation choices (random placement strategy, number of elements per image, class balance, dataset size scaling).
- **Possible data error** in Table 3: the Manuals and Scientific Documents rows report identical PubLayNet + RanLayNet results (Precision=0.562, Recall=0.807, mAP50=0.761, mAP95=0.588), which is almost certainly a copy-paste error in the paper.

### Hardware

- **Training:** Single NVIDIA RTX A6000 GPU (48 GB VRAM) with 512 GB system RAM.
- **Training time:** Not reported for any experiment.
- **VRAM usage:** Not reported.
- **Inference latency/throughput:** Not reported.
- **Cost estimates:** Not provided.
- **Deployment considerations:** The A6000 is a workstation-class GPU. Without knowing the YOLOv8 variant used, it is difficult to assess whether inference is feasible on more constrained hardware.

## BibTeX

```bibtex
@inproceedings{anand2023ranlaynet,
  title={RanLayNet: A Dataset for Document Layout Detection used for Domain Adaptation and Generalization},
  author={Avinash Anand and Raj Jaiswal and Mohit Gupta and Siddhesh S Bangar and Pijush Bhuyan and Naman Lal and Rajeev Singh and Ritika Jha and Rajiv Ratn Shah and Shin'ichi Satoh},
  booktitle={ACM Multimedia Asia 2023 (MMAsia '23)},
  year={2023},
  publisher={ACM},
  doi={10.1145/3595916.3626448}
}
```


