# PP-DocLayout: Unified Document Layout Detection

> We analyze PP-DocLayout, PaddlePaddle's unified layout detection model that achieves 90.4% mAP with fine-grained classification and sub-15ms latency.

- Authors: Bevaya AI Team
- Published: 2025-03-21
- Updated: 2026-03-12
- Paper: PP-DocLayout Paper <https://arxiv.org/abs/2503.17213>
- Code: PaddlePaddle/PaddleX <https://github.com/PaddlePaddle/PaddleX>
- Model: PP-DocLayout-L <https://huggingface.co/PaddlePaddle/PP-DocLayout-L>
- Model: PP-DocLayout_plus-L <https://huggingface.co/PaddlePaddle/PP-DocLayout_plus-L>
- Model: PP-DocLayout-M <https://huggingface.co/PaddlePaddle/PP-DocLayout-M>
- Model: PP-DocLayout-S <https://huggingface.co/PaddlePaddle/PP-DocLayout-S>
- Source: Bevaya Labs, <https://labs.bevaya.ai/>

---


## TL;DR

PP-DocLayout is a family of document layout detection models (L/M/S) that predict bounding boxes for 23 layout block classes. The largest variant reports 90.4% `mAP@0.5` with 13.39 ms per page on T4 GPU; the smallest variant achieves 70.9% `mAP@0.5` at 8.11 ms per page (T4) or 14.49 ms (CPU). Training combines knowledge distillation from GOT-OCR2.0's visual encoder (for the L backbone) and semi-supervised learning with adaptive per-class thresholds (for M/S variants).

* * *

## What kind of paper is this?

**Dominant:** $\Psi\_{\text{Method}}$

Core contribution is a unified detection approach across diverse document types with multiple model variants and training strategies: knowledge distillation for the L backbone and semi-supervised pseudo-labeling with adaptive thresholds for M/S variants.

**Secondary:** $\Psi\_{\text{Resource}}$

Provides three model variants (L/M/S) with public weights and implementation details.

## What is the motivation?

Layout detection is positioned as a foundational step for downstream document processing tasks (table recognition, formula recognition, OCR, information extraction) and structured training data generation.

The authors identify three gaps in prior layout detectors:

1.  Weak generalization beyond academic papers: insufficient coverage of magazines, newspapers, financial reports, and other document types.
2.  Insufficient granularity for complex layouts: coarse categorization that collapses charts, seals, and formulas into broad buckets.
3.  Insufficient speed for large-scale and real-time processing requirements.

## What is the novelty?

**Fine-grained label space:** 23 layout categories designed to cover diverse document types and distinguish high-value regions (charts, seals, formula numbers, header/footer images) rather than collapsing them into generic classes.

**Knowledge distillation for PP-DocLayout-L backbone:** The PP-HGNetV2-B4 student backbone learns from the frozen Vary-VIT-B visual encoder (from GOT-OCR2.0) via feature-level alignment with a learnable projection layer and L2 distillation loss.

**Adaptive per-class thresholding for semi-supervised learning:** PP-DocLayout-M/S use PP-DocLayout-L as a teacher model to generate pseudo-labels, but instead of a fixed global confidence threshold, they select per-class thresholds by maximizing F1 on labeled validation data for each of the 23 categories.

**Throughput focus:** The authors emphasize deployment scenarios requiring batch processing at scale, reporting approximately 123 pages per second on T4 GPU when using the PaddleX inference engine.

## What experiments were performed?

**Main evaluation:** Reports `mAP@0.5`, inference latency on T4 GPU and CPU (Intel Xeon Gold 6271C, 8 threads, FP16), and parameter counts for all three variants.

**Qualitative comparison:** Visual side-by-side comparisons to DocLayout-YOLO on diverse document types. No direct quantitative comparison due to label set mismatch.

**Ablations:**

-   Knowledge distillation effect on PP-DocLayout-L accuracy.
-   Semi-supervised learning effect on PP-DocLayout-M and PP-DocLayout-S accuracy.

**Dataset description:** Training and evaluation split sizes with per-category instance counts provided in the appendix.

## What are the outcomes/conclusions?

**Outcomes:**

-   **PP-DocLayout-L:** 90.4% `mAP@0.5`, 13.39 ms (T4), 759.76 ms (CPU), 30.94M parameters.
-   **PP-DocLayout-M:** 75.2% `mAP@0.5`, 12.73 ms (T4), 59.82 ms (CPU), 5.65M parameters.
-   **PP-DocLayout-S:** 70.9% `mAP@0.5`, 8.11 ms (T4), 14.49 ms (CPU), 1.21M parameters.

Distillation improves L from 89.3% to 90.4% `mAP@0.5`. Semi-supervised learning improves M from 73.8% to 75.2% and S from 66.2% to 70.9%. Note: the paper's Table 4 labels the S improvement as "+3.7" while the body text states "4.7%"; the arithmetic (70.9 - 66.2 = 4.7) supports the body text figure.

**Limitations:**

**Fragile evaluation:** The "Unified" claim rests on a very small custom evaluation set of 500 images (approx. 22 images per class on average). Despite using DocLayNet and PubLayNet in the training mix, the authors do *not* report results on standard public benchmarks (e.g., DocLayNet Test, PubLayNet Val). This makes the 90.4% mAP figure isolated and difficult to compare against the broader SOTA (LayoutLMv3, VGT, DiT).

**Qualitative-only baselines:** The comparison to DocLayout-YOLO is purely visual. The authors cite "label mismatch" as the reason for avoiding quantitative comparison, but this prevents verifying whether the architecture itself is superior or if gains are solely due to the custom label taxonomy.

**IoU looseness:** Reporting only `mAP@0.5` is permissive for layout analysis, where precise boundary alignment often matters for downstream OCR or reading order recovery. Stricter thresholds (e.g., `mAP@0.75` or `mAP@0.5:0.95`) are not provided.

**Reporting ambiguity:** The paper's body text states PP-DocLayout-S improves by "4.7%" with semi-supervised learning, but Table 4 labels the gain as "+3.7" (66.2% to 70.9%). The arithmetic (70.9 - 66.2 = 4.7) supports the body text. This internal inconsistency suggests a typo in Table 4.

* * *

## Reproducibility

**Reproducibility Score:** Partially Reproducible

**Missing Components:**
- **Training Data:** The 30k-image training set is a mix of public (DocLayNet, PubLayNet) and proprietary data; neither the dataset nor the exact composition ratio is released.
- **Distillation Corpus:** The 500k-document corpus used to distill the backbone is unreleased and origins are unspecified.
- **Evaluation Data:** The 500-image custom evaluation set used for the 90.4% mAP claim is "self-built" and not public.
- **Standard Benchmarks:** The authors do not report results on standard public benchmarks (e.g., DocLayNet Test), preventing independent verification of the performance claims.

**Compute:**
- **Training:** 8 NVIDIA V100 GPUs (approx. 26 hours for L variant).
- **Inference:** Benchmarks provided for NVIDIA T4 and Intel Xeon Gold 6271C.

### Models

#### Detector architecture

**PP-DocLayout-L:**

-   Detector: RT-DETR-L
-   Backbone: PP-HGNetV2-B4 (15.6M parameters after distillation from Vary-VIT-B)
-   Total parameters: 30.94M

**PP-DocLayout\_plus-L** (not described in the paper; details below are from the [HuggingFace model card](https://huggingface.co/PaddlePaddle/PP-DocLayout_plus-L)):

-   Detector: RT-DETR-L
-   Backbone: PP-HGNetV2-B4
-   Total parameters: 30.94M
-   Classes: 20 (reduced from the standard 23-class set)

**PP-DocLayout-M:**

-   Detector: PicoDet-M
-   Total parameters: 5.65M

**PP-DocLayout-S:**

-   Detector: PicoDet-S
-   Total parameters: 1.21M

#### Label set

The standard PP-DocLayout variants (L/M/S) predict bounding boxes for 23 layout block classes. The **PP-DocLayout\_plus-L** variant uses a modified set of 20 classes.

**Standard 23-class set:**

`paragraph_title`, `image`, `text`, `number`, `abstract`, `content`, `figure_title`, `formula`, `table`, `table_title`, `reference`, `doc_title`, `footnote`, `header`, `algorithm`, `footer`, `seal`, `chart_title`, `chart`, `formula_number`, `header_image`, `footer_image`, `aside_text`

**Plus-L 20-class set** (sourced from the HuggingFace model card, not the paper):

The model card lists 20 categories. The exact mapping of which classes were removed or renamed relative to the standard 23-class set is not fully specified.

#### Category mapping versus DocLayout-YOLO

The authors provide a mapping table contrasting their 23-class label space with DocLayout-YOLO's coarser scheme. Examples:

-   **Page Number** is explicitly modeled in PP-DocLayout but mapped to "Abandon" in DocLayout-YOLO.
-   **Formula** is treated as "Isolate Formula" in PP-DocLayout, while many structural elements (header, footer, footnote) are "Abandon" in DocLayout-YOLO.

* * *

### Data

#### Labeled layout detection dataset (Training)

**Training:** 30,000 images annotated with 23 categories.

**Composition:** A mix of images collected from Baidu image search and public datasets (DocLayNet, PubLayNet). Note: The authors do not specify the ratio of proprietary to public data, nor do they report performance on the standard test splits of the public datasets used in training.

**Evaluation:** 500 images (approx. 22 images per class).

**Document types:** Chinese and English academic papers, magazines, newspapers, research reports, exam papers, handwritten notes, contracts, books.

**Per-category instance counts (train/eval):**

High-volume classes from the appendix include:

-   text: 217,257 / 3,342
-   formula: 113,145 / 1,961
-   paragraph title: 42,158 / 715
-   header: 25,001 / 430
-   number: 25,217 / 430

Full counts for all 23 categories are provided in Table 5 of the paper.

#### Distillation pretraining corpus

Used for distilling the PP-HGNetV2-B4 backbone from the Vary-VIT-B teacher: 500,000 document samples across five domains (mathematical formulas, financial documents, scientific literature from arXiv STEM fields, academic dissertations, tabular data from reports and spreadsheets).

The paper does not specify the source or license for this 500k corpus.

* * *

### Algorithms

#### Knowledge distillation (PP-DocLayout-L backbone)

**Teacher model:** Vary-VIT-B visual encoder ($F\_{\text{Vary-VIT-B}}$) from GOT-OCR2.0, frozen during student training.

**Student model:** PP-HGNetV2-B4 backbone ($F\_{\text{PP-HGNetV2-B4}}$).

**Feature alignment:** Teacher features $F\_{\text{Vary-VIT-B}} \in \mathbb{R}^{B \times D}$ and student features $F\_{\text{PP-HGNetV2-B4}} \in \mathbb{R}^{B \times P}$ are aligned via a learnable linear projection $\varphi: \mathbb{R}^{P} \rightarrow \mathbb{R}^{D}$.

**Distillation loss (feature L2):**

$$
L\_{\text{Distill}} = \frac{1}{B} \sum\_{i=1}^{B} \left\lVert F\_{\text{Vary-VIT-B}}^{(i)} - \varphi\left(F\_{\text{PP-HGNetV2-B4}}^{(i)}\right) \right\rVert\_2^2
$$

**Distillation training settings:**

-   Input resolution: 768 $\times$ 768
-   Epochs: 50
-   Optimizer: AdamW ($\beta\_1 = 0.9, \beta\_2 = 0.999$)
-   Student backbone parameters after distillation: 15.6M

#### Semi-supervised learning (PP-DocLayout-M/S)

**Teacher model:** PP-DocLayout-L generates predictions $P(y | x\_u) = f\_T(x\_u; \theta\_T)$ over $C = 23$ classes.

**Adaptive per-class thresholding:** For each class $c$, the threshold $\tau\_c^{\ast}$ is selected to maximize per-class F1 on labeled validation data $x\_l$:

$$
\tau\_c^{\ast} = \arg \max\_{\tau \in [0, 1]} F\_c(\tau; P(y|x\_l))
$$

**Pseudo-label assignment:** An unlabeled region $i$ in image $x\_u$ is assigned a pseudo-label $\hat{y}\_{u,i}$ if the prediction exceeds the optimal threshold:

$$
\hat{y}\_{u,i} = \begin{cases} 1 & \text{if } P(y\_{i,c} | x\_u) > \tau\_c^{\ast} \text{ for any } c \\\\ 0 & \text{otherwise} \end{cases}
$$

#### Detector training settings

**PP-DocLayout-L:**

-   Epochs: 100
-   Learning rate: 0.0001 (constant)
-   Batch size: 2 per GPU
-   GPUs: 8 NVIDIA V100
-   Training time: approximately 26 hours

**PP-DocLayout-M:**

-   Epochs: 100
-   Learning rate: 0.02
-   Batch size: 2 per GPU
-   GPUs: 8
-   LR scheduler: CosineDecay

**PP-DocLayout-S:**

-   Epochs: 100
-   Learning rate: 0.06
-   Batch size: 2 per GPU
-   GPUs: 8
-   LR scheduler: CosineDecay

* * *

### Evaluation

#### Metrics and hardware

**Primary metric:** `mAP@0.5`

**GPU latency:** NVIDIA Tesla T4

**CPU latency:** Intel Xeon Gold 6271C @ 2.60 GHz, 8 threads, FP16 precision

#### Main results

| Variant | `mAP@0.5` | T4 Latency | CPU Latency | Parameters |
| ------- | ------------------------- | ---------- | ----------- | ---------- |
| L       | 90.4%                     | 13.39 ms   | 759.76 ms   | 30.94M     |
| M       | 75.2%                     | 12.73 ms   | 59.82 ms    | 5.65M      |
| S       | 70.9%                     | 8.11 ms    | 14.49 ms    | 1.21M      |

#### Ablation: Knowledge distillation (PP-DocLayout-L)

Distillation improves the L variant from 89.3% to 90.4% `mAP@0.5` (+1.1 percentage points).

#### Ablation: Semi-supervised learning (PP-DocLayout-M/S)

| Variant | Baseline | With Semi-Supervised | Improvement |
| ------- | -------- | -------------------- | ----------- |
| M       | 73.8%    | 75.2%                | +1.4 pp     |
| S       | 66.2%    | 70.9%                | +4.7 pp (paper Table 4 prints "+3.7", likely a typo) |

#### Qualitative comparisons

The authors provide side-by-side visualizations comparing PP-DocLayout to DocLayout-YOLO on diverse document types. Claimed improvements include:

-   More granular text hierarchy: separate detection of document title, abstract, and paragraph title.
-   Improved detection of headers, footers, and page numbers.
-   Inline and block formula detection.
-   Handwritten content classified as text rather than figure.
-   Separation of charts, seals, and natural images into distinct categories.

* * *

### Hardware

#### Throughput claims

The authors emphasize large-scale batch processing scenarios, claiming approximately **123 pages per second** on T4 GPU when using the PaddleX inference engine.

#### Deployment context

Inference performance is framed around two use cases:

1.  **Large-scale data construction:** Processing document corpora for training data generation.
2.  **Real-time processing:** Low-latency layout detection for interactive applications.

CPU measurements are provided for evaluation scenarios, but primary speed claims focus on T4 GPU performance.

### Mapping to Unified Taxonomy

| Dataset Class | Visual Primitive | Logical Role | Notes |
| :--- | :--- | :--- | :--- |
| **paragraph_title** | `Text` | `SectionHeader` | |
| **image** | `Image` | `Figure` | |
| **text** | `Text` | `Body` | |
| **number** | `Text` | `PageNumber` | |
| **abstract** | `Text` | `Abstract` | |
| **content** | `Table` | `TOC` | "Content" usually refers to Catalogue/TOC in this context. |
| **figure_title** | `Text` | `Caption` | |
| **formula** | `Formula` | `DisplayEquation` | |
| **table** | `Table` | `Table` | |
| **table_title** | `Text` | `Caption` | |
| **reference** | `Text` | `BibEntry` | |
| **doc_title** | `Text` | `Title` | |
| **footnote** | `Text` | `Footnote` | |
| **header** | `Text` | `PageHeader` | |
| **algorithm** | `Text` | `Code` | |
| **footer** | `Text` | `PageFooter` | |
| **seal** | `Image` | `Stamp` | |
| **chart_title** | `Text` | `Caption` | |
| **chart** | `Image` | `Chart` | |
| **formula_number** | `Text` | `FormulaNumber` | Numbering associated with equation. |
| **header_image** | `Image` | `PageHeader` | |
| **footer_image** | `Image` | `PageFooter` | |
| **aside_text** | `Text` | `Sidebar` | |

## BibTeX

```bibtex
@misc{sun2025ppdoclayout,
      title={PP-DocLayout: A Unified Document Layout Detection Model to Accelerate Large-Scale Data Construction},
      author={Ting Sun and Cheng Cui and Yuning Du and Yi Liu},
      year={2025},
      eprint={2503.17213},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}
```


