# Advanced Layout Analysis Models for Docling

> IBM's Docling team trains RT-DETR and D-FINE detectors on 150K documents with 17 layout classes, releasing five models that improve mAP by 20-24 absolute points over their previous baseline.

- Authors: Bevaya AI Team
- Published: 2026-03-15
- Paper: Preprint (arXiv) <https://arxiv.org/abs/2509.11720>
- Model: heron (RT-DETRv2 R50, default) <https://huggingface.co/docling-project/docling-layout-heron>
- Model: heron-101 (RT-DETRv2 R101) <https://huggingface.co/docling-project/docling-layout-heron-101>
- Model: egret-m (D-FINE M) <https://huggingface.co/docling-project/docling-layout-egret-medium>
- Model: egret-l (D-FINE L) <https://huggingface.co/docling-project/docling-layout-egret-large>
- Model: egret-x (D-FINE XL) <https://huggingface.co/docling-project/docling-layout-egret-xlarge>
- Source: Bevaya Labs, <https://labs.bevaya.ai/>

---


## TL;DR

IBM trains five real-time document layout detectors (RT-DETRv2 and D-FINE variants) on a mixed corpus of 150K documents spanning 17 layout classes. The best model, heron-101, achieves 0.780 mAP on a filtered DocLayNet test set with 28 ms/image inference on an A100, a 23.9 absolute mAP-point improvement over Docling's previous baseline. All model weights are released under Apache-2.0.

## What kind of paper is this?

**Dominant:** $\Psi\_{\text{Method}}$. The headline contribution is training and evaluating a family of object detection architectures (RT-DETRv1, RT-DETRv2, D-FINE) for document layout analysis. The paper devotes most of its pages to architecture selection, training recipes, post-processing pipelines, and multi-benchmark evaluation.

**Secondary:** $\Psi\_{\text{Resource}}$. Five publicly released model checkpoints under Apache-2.0, plus the introduction of DocLayNet-v2 (a proprietary 17-class extension of DocLayNet) and canonical-DocLayNet (a filtered subset of DocLayNet that removes annotation noise from the 6 "delta" classes).

**Secondary:** $\Psi\_{\text{Evaluation}}$. The paper devotes significant analysis to comparing two evaluation methodologies (COCO-tools vs. docling-eval), documents a "post-processing paradox" where qualitatively better outputs score lower on mAP, and concludes that mAP may not be suitable for document layout evaluation.

## What is the motivation?

Docling is IBM's open-source document conversion pipeline. Its previous layout model (RT-DETRv1 with ResNet-50, referred to as "old-docling") only supported DocLayNet's 11 original classes and missed important structural elements: checkboxes, code blocks, forms, key-value regions, and document indices. The authors needed to:

1. Expand the label taxonomy from 11 to 17 classes to support richer document types (forms, code, etc.).
2. Improve detection accuracy while maintaining real-time inference speed.
3. Use only permissively licensed architectures (no YOLO due to AGPL licensing concerns).

## What is the novelty?

### Expanded taxonomy and data curation

The 17-class taxonomy adds six "delta" classes to DocLayNet's original 11: Checkbox-Selected, Checkbox-Unselected, Code, Document Index, Form, and Key-Value Region. The training mix unifies three sources:

- **DocLayNet** (public, filtered): A "canonical-DocLayNet" variant created by training a filtering detector at confidence threshold 0.3 to flag and exclude pages likely containing mislabeled delta-class elements. This removed ~32% of DocLayNet, yielding 22,101 training pages.
- **DocLayNet-v2** (proprietary): IBM's extended dataset covering all 17 classes with a 7,613-page test split.
- **WordScape** (public, filtered): Documents from the 2013 Common Crawl snapshot, with all table-containing pages removed due to systematic "Table"/"Form" label confusion.

The combined training set contains ~150K pages and 2.3M bounding-box annotations.

### Architecture selection

The authors chose transformer-based detectors with permissive licenses:

| Model name | Architecture | Backbone | Params |
| :--- | :--- | :--- | :--- |
| egret-m | D-FINE | HGNet-V2 M | 19.5M |
| egret-l | D-FINE | HGNet-V2 L | 31.2M |
| egret-x | D-FINE | HGNet-V2 XL | 62.7M |
| heron | RT-DETRv2 | ResNet-50vd | 42.9M |
| heron-101 | RT-DETRv2 | ResNet-101vd | 76.7M |

### Post-processing pipeline

Raw detections undergo PDF-aware refinement:
1. Each predicted bounding box is matched to overlapping native PDF cells and snapped to their boundaries.
2. Pictures covering >90% of a page are discarded.
3. Regular elements overlapping "wrapper" elements (Form, Key-Value Region, Table, Document Index) become children; wrapper boxes expand to enclose children.
4. Overlapping groups are resolved by a rule-based selector that considers label priority, element size, and confidence.

## What experiments were performed?

### Evaluation datasets

- **DocLayNet** (original 11-class test split)
- **DocLayNet-v2** (17-class, 7,613-page proprietary test split)
- **canonical-DocLayNet** (filtered 11-class, 1,574-page test split)

### Evaluation methodologies

Both methods report mean Average Precision averaged over IoU thresholds from 0.50 to 0.95 in steps of 0.05:

$$\text{mAP} = \frac{1}{|\mathcal{T}|} \sum\_{t \in \mathcal{T}} \text{AP}\_t, \quad \mathcal{T} = \\{0.50, 0.55, \ldots, 0.95\\}$$

1. **COCO-tools**: Standard $\text{mAP}@[0.50{:}0.95]$ with per-size AP (small/medium/large). Evaluated under three conditions: all predictions (no threshold), confidence $\geq 0.50$, and Docling post-processing (confidence $\geq 0.50$ + PDF-cell snapping + overlap resolution).
2. **docling-eval**: Docling's own evaluation package. Applies a 0.50 confidence threshold, sets all surviving scores to 1.0, restricts to the label intersection of predictions and ground truth, skips samples with mismatched box counts, then computes $\text{mAP}@[0.50{:}0.95]$.

### Runtime benchmarks

Inference time measured across three hardware configurations:
- CPU: AMD EPYC 7763 (4 threads)
- GPU: NVIDIA A100-80GB (batch sizes 100, 200, 500)
- MPS: Apple M3 Max (batch sizes 50, 100)

## What are the outcomes/conclusions?

### Accuracy

On canonical-DocLayNet (COCO-tools, no post-processing, no threshold):
- **heron-101**: 0.780 mAP (best overall)
- **heron**: 0.776 mAP
- **egret-m**: 0.765 mAP

On DocLayNet-v2 (COCO-tools, no post-processing, no threshold):
- **heron-101**: 0.758 mAP
- **heron**: 0.751 mAP

All new models improve over old-docling by 20.6 to 23.9 absolute mAP points (the paper reports these as percentage-point gains, not relative improvements). On the original DocLayNet test set, heron leads with 0.699 mAP, a 38.4% relative improvement over old-docling's 0.505.

### Post-processing paradox

The Docling post-processing pipeline (PDF-cell snapping, overlap resolution) visually improves layout quality, producing cleaner, less fragmented bounding boxes. However, it consistently lowers mAP scores by 10+ points. The authors attribute this to mAP penalizing geometric adjustments that do not exactly match ground-truth boxes, even when the post-processed output is qualitatively better. They conclude that mAP may not be the most suitable metric for document layout evaluation.

### Runtime

On A100 with batch size 200:
- **egret-m**: 24 ms/image (fastest)
- **heron-101**: 28 ms/image
- **heron**: 31 ms/image

On CPU (4 threads, batch 32):
- **egret-m**: 334 ms/image
- **heron**: 643 ms/image
- **heron-101**: 988 ms/image

egret-m is roughly $3\times$ faster than heron-101 on CPU, making it a better choice for CPU-only deployments.

### Limitations

- **DocLayNet-v2 is proprietary.** The 17-class test set that most directly measures full-taxonomy performance is not publicly available, limiting independent reproducibility.
- **No comparison to non-DETR baselines.** YOLO-family models (DocLayout-YOLO, PP-DocLayout) are excluded due to licensing. This makes it difficult to position these results against the broader DLA landscape.
- **mAP critique is observational, not formal.** The authors note mAP's shortcomings for document layout but do not propose an alternative metric.
- **Single training run per model.** No error bars, variance estimates, or seed sensitivity analysis.
- **Annotation ambiguity acknowledged but unaddressed.** The qualitative analysis (Figures 2-4) reveals that ground truth and model predictions can both be "valid" layouts, but the paper does not explore multi-annotation or soft-label approaches.

## Reproducibility

### Models

- Five new models released on HuggingFace in safetensors format under Apache-2.0, plus the pre-existing old-docling baseline.
- Parameter counts: 19.5M (egret-m) to 76.7M (heron-101).
- Backbones initialized from pre-trained weights (ResNet, HGNet-V2). Pre-training source not specified beyond "pre-trained" (likely ImageNet, but not stated).
- Models were trained with native PyTorch code from the original RT-DETR and D-FINE repositories, then converted to HuggingFace Transformers safetensors for inference. Training scripts, configs, and reproduction recipes are not released; only inference-ready checkpoints are available.

### Algorithms

- **RT-DETRv2 models (heron, heron-101):** 72 epochs, lr $10^{-4}$, AdamW ($\beta\_1$=0.9, $\beta\_2$=0.999), weight decay $10^{-4}$.
- **D-FINE models (egret-m/l/x):** 132/80/80 epochs, lr $2 \times 10^{-4}$ / $2.5 \times 10^{-4}$ / $2.5 \times 10^{-4}$, AdamW ($\beta\_1$=0.9, $\beta\_2$=0.999), weight decay $10^{-4}$ / $1.25 \times 10^{-4}$ / $1.25 \times 10^{-4}$.
- Augmentation: randomized distortions, zoom out, horizontal flips, resize to $640 \times 640$.
- No mention of learning rate warmup, gradient clipping, mixed precision, or EMA.

### Data

- **Training set:** ~150K pages, 2.3M annotations across 17 classes.
  - DocLayNet (public, filtered to ~22K pages via canonical filtering at threshold 0.3)
  - DocLayNet-v2 (proprietary, not publicly available)
  - WordScape (public, table-containing pages excluded)
- **Test splits:** DocLayNet original (public), DocLayNet-v2 (proprietary, 7,613 pages), canonical-DocLayNet (public, 1,574 pages).
- The proprietary DocLayNet-v2 component means the full training set cannot be reconstructed. DocLayNet-v2 is not available on the [docling-project HuggingFace org](https://huggingface.co/docling-project) or the deprecated [ds4sd org](https://huggingface.co/ds4sd).

### Evaluation

- COCO-tools mAP@[0.50:0.95] with size-stratified AP.
- [docling-eval](https://github.com/docling-project/docling-eval) (MIT license): custom evaluation that filters predictions at 0.50 confidence, normalizes scores, and restricts to shared labels.
- No cross-dataset evaluation (e.g., M6Doc, D4LA) beyond the DocLayNet family.
- Single run per model; no error bars or significance tests.

### Hardware

- Training hardware not specified (GPU type, count, total hours not reported).
- Inference benchmarked on three platforms: A100-80GB, AMD EPYC 7763 CPU (4 threads), Apple M3 Max (MPS). Batch sizes varied (32 for CPU, 50-500 for GPU/MPS).
- Models are small enough to run on consumer hardware; egret-m at 19.5M params runs at 334 ms/page on CPU.

## BibTeX

```bibtex
@article{livathinos2025advanced,
  title={Advanced Layout Analysis Models for Docling},
  author={Livathinos, Nikolaos and Auer, Christoph and Nassar, Ahmed and Teixeira de Lima, Rafael and Lysak, Maksym and Ebouky, Brown and Berrospi, Cesar and Dolfi, Michele and Vagenas, Panagiotis and Omenetti, Matteo and Dinkla, Kasper and Kim, Yusik and Weber, Valery and Morin, Lucas and Meijer, Ingmar and Kuropiatnyk, Viktor and Strohmeyer, Tim and Gurbuz, A. Said and Staar, Peter W. J.},
  journal={arXiv preprint arXiv:2509.11720},
  year={2025}
}
```


