DocLayout-YOLO: Axis-Attentive Document Layout Detector with Mesh-Guided Synthetic Pretraining
Organizations: Shanghai AI Laboratory
Abstract
Accurate and efficient document layout analysis is critical for modern document parsing systems. However, although the YOLO framework represents a leading paradigm for the real-time detector, its adaptation to heterogeneous documents remains underexplored. To address this gap, we propose DocLayout-YOLO, a document-specialized real-time detector that integrates diverse synthetic document pretraining and page-axis context modeling. From the data perspective, we introduce MeshLayout-1M, a synthetic pretraining corpus generated by the proposed Mesh-candidate BestFit algorithm, which provides large-scale and diverse document layouts for pretraining and improves adaptation to heterogeneous document scenarios. From the model perspective, we propose Page-Axis Layout Attention (PALA), which captures long-range dependencies along the horizontal and vertical page axes while remaining computationally efficient. Extensive experiments demonstrate that DocLayout-YOLO achieves state-of-the-art performance on four heterogeneous document benchmarks, obtaining 72.4%/75.5%/96.0%/73.1% mAP50:95 on D4LA, M6Doc, HJDataset, and PRIMA-LAD, respectively. Compared with existing real-time detectors, DocLayout-YOLO establishes a superior accuracy-efficiency trade-off in document layout analysis. Code, model, and data are available at https://github.com/opendatalab/DocLayout-YOLO/tree/release-v2.
Figures & tables
| Dataset | #Pages | #Elements | Element Types | Layout Diversity | Annotation Type |
| IIT-CDIP ( Lewis et al., 2006 ) | 42M | - (None) | - (None) | 11 (Diverse) | Unannotated |
| PRIMA-LAD ( Antonacopoulos et al., 2009 ) | 478 | 7,453 | 5 | 5 (Diverse) | Automatic |
| PubLayNet ( Zhong et al., 2019 ) | 360K | 3,311,660 | 5 | 1 (Academic) | Automatic |
| HJDataset ( Shen et al., 2020 ) | 2,271 | 250,000+ | 7 | 4 (Historical) | Semi-automatic |
| DocBank ( Li et al., 2020 ) | 500K | 6,715,907 | 13 | 1 (Academic) | Automatic |
| DocLayNet ( Pfitzmann et al., 2022 ) | 80,863 | 1,107,470 | 11 | 6 (Diverse) | Manual |
| Method | FLOPs (G) | #Param. (M) | Latency (ms) | D 4 LA | M 6 Doc | HJDataset | PRIMA-LAD |
| YOLOv8-N ( Jocher et al., 2023 ) | 45.9 | 2.8 | 1.1 | 64.6 | 60.2 | 87.8 | 61.3 |
| YOLOv10-N ( Wang et al., 2024a ) | 38.2 | 2.1 | 1.4 | 66.9 | 61.5 | 92.9 | 58.7 |
| YOLOv11-N ( Khanam and Hussain, 2024 ) | 33.1 | 2.3 | 1.3 | 65.3 | 62.6 | 88.3 | 60.5 |
| YOLOv12-N ( Tian et al., 2025 ) | 30.2 | 2.2 | 1.7 | 66.5 | 64.5 | 89.6 | 60.4 |
| YOLOv26-N ( Jocher et al., 2026 ) | 38.2 | 2.6 | 1.6 | 65.2 | 62.6 | 91.5 | 59.5 |
| DocLayout-YOLO-N | 30.2 | 2.2 | 1.5 | 67.2 | 66.2 | 93.6 | 67.7 |
| Method | Venue | Backbone | Modality | Params | D 4 LA | M 6 Doc | HJDataset | PRIMA-LAD | |
| V | L | ||||||||
| LayoutParser ( Shen and others, 2021 ) | ICDAR 2021 | ResNext ( Xie et al., 2017 ) | ✓ | ✗ | 6.6M | - | - | 81.6 | 64.7 |
| DocSegTr ( Biswas and others, 2022 ) | arXiv 2022 | ResNet ( He et al., 2016 ) | ✓ | ✗ | 84.2M | - | 60.3 | 83.1 | 42.5 |
| DiT-L ( Li et al., 2022 ) | ACM MM 2022 | ViT-L ( Dosovitskiy et al., 2021 ) | ✓ | ✗ | 361.6M | 68.2 | 70.2 | - | - |
| SelfDocSeg ( Maity et al., 2023 ) | ICDAR 2023 | ResNet-50 ( He et al., 2016 ) | ✓ | ✗ | 63.7M | - | - | 78.8 | 52.1 |
| SwinDocSegmenter ( Banerjee and others, 2023 ) | ICDAR 2023 | Swin ( Liu et al., 2021 ) | ✓ | ✗ | 220.9M | - | 47.1 | 84.6 | 54.4 |
| Size | Components | Benchmarks | ||||
| MeshLayout-1M | PALA | D 4 LA | M 6 Doc | HJDataset | PRIMA-LAD | |
| N | 66.5 | 64.5 | 89.6 | 60.4 | ||
| ✓ | 67.0 | 65.3 | 91.0 | 62.6 | ||
| ✓ | 66.9 | 65.4 | 92.1 | 65.8 | ||
| ✓ | ✓ | 67.2 | 66.2 | 93.6 | 67.7 | |
| S | 69.2 | 69.5 | 91.7 | 64.1 | ||
| Pretraining Data | Volume | M 6 Doc | ||||||
| Book | Magazine | Newspaper | Note | Paper | Test Paper | Textbook | ||
| None | – | 53.5 | 74.2 | 74.4 | 64.9 | 71.5 | 71.5 | 65.7 |
| DocBank ( Li et al., 2020 ) | 400K | 53.9 (+0.4) | 74.7 (+0.5) | 74.8 (+0.4) | 65.5 (+0.6) | 72.7 (+1.2) | 71.1 (-0.4) | 66.1 (+0.4) |
| PubLayNet ( Zhong et al., 2019 ) | 340K | 53.7 (+0.2) | 74.0 (-0.2) | 74.5 (+0.1) | 64.0 (-0.9) | 70.5 (-1.0) | 71.6 (+0.1) | 65.9 (+0.2) |
| DocSynth ( Biswas et al., 2021 ) | 300K | 53.2 (-0.3) | 73.7 (-0.5) | 73.5 (-0.9) | 62.7 (-2.2) | 69.9 (-1.6) | 69.4 (-2.1) | 65.0 (-0.7) |
| RanLayNet ( Anand et al., 2023 ) | 7K | 53.9 (+0.4) | 73.2 (-1.0) | 72.8 (-1.6) | 62.3 (-2.6) | 70.7 (-0.8) | 70.3 (-1.3) | 65.2 (-0.5) |
| Method | Meshgrid Construction | Scale-stratified Sampling | BestFit Matching | M6Doc | HJDataset | PRIMA-LAD |
| Baseline (w/o MeshLayout pretraining) | – | – | – | 70.1 | 92.9 | 66.8 |
| w/o Meshgrid Construction | ✗ | ✓ | – | 69.9 | 92.2 | 67.2 |
| w/o Scale-stratified Sampling | ✓ | ✗ | ✓ | 70.8 | 94.4 | 69.2 |
| w/o BestFit Matching | ✓ | ✓ | ✗ | 70.4 | 94.3 | 68.5 |
| Full MeshLayout | ✓ | ✓ | ✓ | 71.1 | 94.8 | 70.3 |
Appendix figures & tables27 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameters | MeshLayout-1M Pretraining | Downstream Fine-tuning |
| Training Configuration | ||
| Model scales | N/S/M/L/X | N/S/M/L/X |
| Input resolution | ||
| Maximum epochs | 50 | 500 |
| Optimizer | SGD | SGD |
| Momentum | 0.9 | 0.9 |
| Benchmark | # Training | # Testing | Document Types | Categories | Example Documents |
| M 6 Doc | 5,448 | 2,724 | Book, Magazine, Newspaper, Note, Paper, Test Paper, Textbook | 74 fine-grained categories | |
| D 4 LA | 8,868 | 2,224 | Budget, Email, Form, Invoice, Letter, Memo, News, Presentation, Resume | DocTitle, ListText, LetterHead, Question, RegionList, TableName, FigureName, Footer, Number, ParaTitle, RegionTitle, LetterDear, OtherText, Abstract, Table, Equation, PageHeader, Catalog, ParaText, Date, LetterSign, RegionKV, Author, Figure, Reference, PageFooter, PageNumber | |
| HJDataset | 1,589 | 341 | Main, Advertisement, Index, Other | Body, Row, Title, Bio, Name, Position, Other | |
| PRIMA-LAD | 382 | 96 | Magazine, Technical Article | Figure, Table, Paragraph, Header, Page-number, Floating, Caption, Credit, Drop-capital, Heading, Footer | |
| PubLayNet | 335,703 | 11,245 | Academic | Text, Title, List, Table, Figure | |
| DocLayNet | 69,103 | 6,480 | Financial, Scientific, Patents, Manuals, Laws, Tenders | Caption, Footnote, Formula, List-item, Page-footer, Page-header, Picture, Section-header, Table, Text, Title |
| Category | Methods |
| Real-time Detectors | YOLOv8 ( Jocher et al., 2023 ) , YOLOv10 ( Wang et al., 2024a ) , |
| YOLOv11 ( Khanam and Hussain, 2024 ) , YOLOv12 ( Tian et al., 2025 ) , | |
| YOLOv26 ( Jocher et al., 2026 ) , RT-DETRv3 ( Wang et al., 2025 ) | |
| Specialized DLA | Unimodal |
| LayoutParser ( Shen and others, 2021 ) , DocSegTr ( Biswas and others, 2022 ) , | |
| DiT-L ( Li et al., 2022 ) , SelfDocSeg ( Maity et al., 2023 ) , SwinDocSegmenter ( Banerjee and others, 2023 ) , |
| Method | PubLayNet | DocLayNet | IndicDLP |
| YOLOv12-X | 96.9 | 81.0 | 56.3 |
| DocLayout-YOLO-X | 97.5 | 82.3 | 56.9 |
| Method | Backbone | Modality | Clean | Spatial | Content | Inconsistency | Blur | Noise | P-Avg | mRD | |||||||||
| V | L | T | P1 | P2 | P3 | P4 | P5 | P6 | P7 | P8 | P9 | P10 | P11 | P12 | |||||
| LayoutParser ( Shen and others, 2021 ) | ResNeXt ( Xie et al., 2017 ) | ✓ | ✗ | ✗ | 89.0 | 35.8 | 78.1 | 68.0 | 84.8 | 45.9 | 79.0 | 85.8 | 82.6 | 51.4 | 31.1 | 53.6 | 0.3 | 58.0 | 212.7 |
| Faster R-CNN ( Ren et al., 2015 ) | ResNet ( He et al., 2016 ) | ✓ | ✗ | ✗ | 90.2 | 44.2 | 75.3 | 74.3 | 78.9 | 53.2 | 81.4 | 82.7 | 80.2 | 80.6 | 63.2 | 55.7 | 24.3 | 66.2 | 175.5 |
| DocSegTr ( Biswas and others, 2022 ) | ResNet ( He et al., 2016 ) | ✓ | ✗ | ✗ | 90.4 | 28.3 | 76.0 | 71.2 | 85.2 | 46.2 | 69.3 | 86.2 | 68.9 | 50.8 | 19.8 | 60.2 | 0.4 | 55.2 | 233.0 |
| Mask R-CNN ( He et al., 2017 ) | ResNet ( He et al., 2016 ) | ✓ | ✗ | ✗ | 91.0 | 40.0 | 74.0 | 71.8 | 76.9 | 48.7 | 79.0 | 80.6 | 77.4 | 78.2 | 54.2 | 55.1 | 31.9 | 64.0 | 192.7 |
| SwinDocSegmenter ( Banerjee and others, 2023 ) | Swin ( Liu et al., 2021 ) | ✓ | ✗ | ✗ | 93.7 | 39.0 | 83.3 | 61.3 | 88.9 | 46.6 | 87.9 | 88.1 | 86.6 | 37.3 | 29.2 | 36.1 | 0.5 | 57.1 | 214.4 |
| Method | Backbone | Modality | Clean | P-Avg | mRD | ||
| V | L | T | |||||
| DocSegTr ( Biswas and others, 2022 ) | ResNet ( He et al., 2016 ) | ✓ | ✗ | ✗ | 60.3 | 43.2 | 212.6 |
| Mask R-CNN ( He et al., 2017 ) | ResNet ( He et al., 2016 ) | ✓ | ✗ | ✗ | 61.9 | 48.9 | 216.7 |
| Faster R-CNN ( Ren et al., 2015 ) | ResNet ( He et al., 2016 ) | ✓ | ✗ | ✗ | 62.0 | 49.6 | 192.2 |
| SwinDocSegmenter ( Banerjee and others, 2023 ) | Swin ( Liu et al., 2021 ) | ✓ | ✗ | ✗ | 47.1 | 39.7 | 239.2 |
| Cascade R-CNN ( Cai and Vasconcelos, 2018 ) | DiT ( Li et al., 2022 ) | ✓ | ✗ | ✗ | 70.2 | 60.6 | 164.8 |
| Layout Generation | Align | Density |
| Random | 0.0171 | 0.259 |
| Diffusion (LACE) | 0.0032 | 0.476 |
| Mesh-candidate BestFit (ours) | 0.0009 | 0.645 |
| Dataset | Size | Horizontal-only | Vertical-only | PALA | |
| M 6 Doc | N | 64.1 | 63.9 | 65.3 | +0.2 |
| M 6 Doc | L | 72.7 | 71.4 | 73.7 | +1.3 |
| PRIMA-LAD | N | 60.6 | 60.1 | 62.6 | +0.5 |
| PRIMA-LAD | L | 67.0 | 64.9 | 69.1 | +2.1 |
| Dataset | # Boxes | Wider than tall | Aspect ratio | Aspect ratio | Mean aspect ratio | Geometric-mean aspect ratio |
| M 6 Doc | 237,116 | 89.0% | 63.9% | 41.5% | 5.22 | 3.19 |
| PRIMA-LAD | 8,942 | 83.8% | 58.2% | 40.1% | 6.05 | 3.02 |
| Dataset | Attention | Precision | Recall | mAP 50:95 |
| M 6 Doc | Global | 83.0 | 76.8 | 64.5 |
| M 6 Doc | Criss-Cross | 86.7 | 75.5 | 64.7 |
| M 6 Doc | PALA | 88.1 | 76.3 | 65.3 |
| Method | Axis Execution | Attention Normalization |
| Criss-Cross Attention | Parallel | Joint |
| Axial Attention | Sequential | Separate |
| PALA | Parallel | Separate |
| Dataset | Size | Parallel + Separate (PALA) | Parallel + Joint | Sequential + Separate |
| M 6 Doc | N | 65.3 | 65.5 | 63.4 |
| L | 73.7 | 73.1 | 72.9 | |
| PRIMA-LAD | N | 62.6 | 59.8 | 59.6 |
| L | 69.1 | 67.6 | 65.9 |
Document Layout Analysis
Document layout analysis identifies and organizes page elements such as text, tables, figures, and forms.
See all 64 papers