Manuscript Offprint

arXiv:2610.28171

DocLayout-YOLO: Axis-Attentive Document Layout Detector with Mesh-Guided Synthetic Pretraining

Zhiyuan Zhao, Hengrui Kang, Guang Liang, Bin Wang, Conghui He

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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% mAP 50:95_{50:95} on D 4^{4}LA, M 6^{6}Doc, HJ-Dataset, 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.

1 INTRODUCTION

Document Layout Analysis (DLA) (Zhong et al., 2019; Pfitzmann et al., 2022; Cheng et al., 2023) aims to locate and classify semantic regions such as text, tables, and figures, providing essential structural information for document parsing and understanding (Wang et al., 2026; Cui et al., 2026; Li et al., 2026; Yu et al., 2026). With the rapid development of large language models (LLMs) (OpenAI, 2023; Yang et al., 2025) and retrieval-augmented generation (RAG) (Yu et al., 2025; Cho et al., 2024; Chen et al., 2025), the demand for high-quality structured document data has increased substantially, requiring real-time document detectors to achieve both higher accuracy and efficiency.

Among existing real-time object detectors, the YOLO series (Jocher et al., 2026; Tian et al., 2025; Jocher et al., 2023) achieves a strong accuracy-efficiency trade-off, yet its potential for document layout analysis remains largely unexplored. However, adapting YOLO detectors to document scenarios is non-trivial due to two critical challenges. At the data level, adapting detectors to document scenarios requires effective document-domain pretraining, which relies on large-scale and structurally diverse corpora covering rich layout variations. However, existing datasets face a trade-off among dataset scale, layout diversity, annotation quality, and so on (as shown in Tab. 1), while constructing large-scale annotated document corpora with fine-grained layouts remains costly (Zhong et al., 2019; Li et al., 2020). At the model level, accurately localizing document elements requires effective structural context modeling, as document layouts contain complex long-range dependencies among text lines, paragraph columns, table grids, and figure-caption pairs (Wang et al., 2024b; Da et al., 2023). However, conventional convolutional YOLO architectures lack explicit mechanisms to capture such dependencies, while the Area Attention recently introduced in YOLOv12 (Tian et al., 2025) is primarily designed for efficient generic visual modeling and does not explicitly exploit the horizontal and vertical organization of document pages.

To overcome these challenges, we propose DocLayout-YOLO, a document-specialized real-time detector that improves detection performance through diverse synthetic document pretraining and page-axis context modeling. At the data level, we introduce MeshLayout-1M, a large-scale synthetic pretraining dataset generated by our proposed Mesh-candidate BestFit algorithm based on the principles of 2D Bin-packing (Lodi et al., 2002). By synthesizing diverse document layouts with varying elements, scales, and layout structure, MeshLayout-1M provides a more diverse pretraining corpus, allowing better adaptation to heterogeneous document scenarios.

At the model level, we propose Page-Axis Layout Attention (PALA), which explicitly captures long-range dependencies along the horizontal and vertical axes of document pages. By leveraging inherent page structures, PALA enables efficient context aggregation among layout elements while avoiding the computational overhead of global attention. By combining structure-diverse synthetic pretraining with page-axis context modeling, DocLayout-YOLO achieves a favorable accuracy-efficiency trade-off, as shown in Fig. 1. The contributions of this paper are summarized as follows:

• We introduce MeshLayout-1M, a structure-diverse synthetic pretraining dataset generated by the proposed Mesh-candidate BestFit algorithm, which enables large-scale document-domain pretraining with diverse element and layout organizations.

• We propose Page-Axis Layout Attention (PALA), an efficient context modeling mechanism that captures long-range dependencies along horizontal and vertical page axes, explicitly exploiting the inherent structural organization of document layouts while maintaining efficient computation.

• We present DocLayout-YOLO, a document-specialized real-time detector integrating synthetic layout pretraining and page-axis context modeling. It achieves state-of-the-art performance on four heterogeneous benchmarks while delivering superior accuracy-efficiency trade-offs over existing real-time detectors.

References (96)

  • Ranlaynet: A dataset for document layout detection used for domain adaptation and generalization
  • A realistic dataset for performance evaluation of document layout analysis
  • Graphkd: Exploring knowledge distillation towards document object detection with structured graph creation
  • Semidocseg: Harnessing semi-supervised learning for document layout analysis
  • An end-to-end unified domain adaptive transformer for document instance segmentation
  • Docsynth: A layout guided approach for controllable document image synthesis
  • An instance-level end-to-end document image segmentation transformer (opens arXiv in a new tab)
  • Cascade R-CNN: Delving into high quality object detection
  • Towards aligned layout generation via diffusion model with aesthetic constraints
  • Document haystacks: Vision-language reasoning over piles of 1000+ documents
  • Hybridla: Hybrid generation for document layout analysis
  • Benchmarking the robustness of document layout analysis models
  • M $^{6}$doc: A large-scale multi-format, multi-type, multi-layout, multi-language, multi-annotation category dataset for modern document layout analysis
  • M3docrag: Multimodal retrieval is what you need for multi-page multi-document understanding (opens arXiv in a new tab)
  • Boosting document parsing efficiency and performance with coarse-to-fine visual processing
  • Vision grid transformer for document layout analysis
  • FlashAttention: Fast and memory-efficient exact attention with IO-awareness
  • CSWin transformer: A general vision transformer backbone with cross-shaped windows
  • An image is worth $16 \times 16$ words: Transformers for image recognition at scale
  • Layouttransformer: Layout generation and completion with self-attention
  • Deep residual learning for image recognition
  • Mask R-CNN
  • Layoutlmv3: Pre-training for document AI with unified text and image masking
  • CC-Net: Criss-cross attention for semantic segmentation
  • Unifying layout generation with a decoupled diffusion model
  • Layoutdm: Discrete diffusion model for controllable layout generation
  • Layoutformer++: Conditional graphic layout generation via constraint serialization and decoding space restriction
  • Ultralytics YOLO, 2023
  • Ultralytics YOLO26: Unified real-time end-to-end vision models (opens arXiv in a new tab)
  • YOLOv11: An Overview of the Key Architectural Enhancements
  • Constrained graphic layout generation via latent optimization
  • BLT: bidirectional layout transformer for controllable layout generation
  • Building a test collection for complex document information processing
  • Towards real-world document parsing via realistic scene synthesis and document-aware training
  • Attribute-conditioned layout GAN for automatic graphic design
  • Dit: Self-supervised pre-training for document image transformer
  • Docbank: A benchmark dataset for document layout analysis
  • DocSAM: Unified document image segmentation via query decomposition and heterogeneous mixed learning
  • Position-aware relation learning network for document layout analysis (opens arXiv in a new tab)
  • RoBERTa: A Robustly Optimized BERT Pretraining Approach
  • Swin transformer: Hierarchical vision transformer using shifted windows
  • Recent advances on two-dimensional bin packing problems
  • Selfdocseg: A self-supervised vision-based approach towards document segmentation
  • IndicDLP: A foundational dataset for multi-lingual and multi-domain document layout parsing
  • GPT-4 Technical Report
  • Doclaynet: A large human-annotated dataset for document-layout segmentation
  • Dopta: Improving document layout analysis using patch-text alignment (opens arXiv in a new tab)
  • Faster R-CNN: Towards real-time object detection with region proposal networks
  • A large dataset of historical Japanese documents with complex layouts
  • A unified toolkit for deep learning based document image analysis
  • High-resolution representations for labeling pixels and regions (opens arXiv in a new tab)
  • YOLOv12: Attention-centric real-time object detectors
  • Yolov10: Real-time end-to-end object detection
  • Mineru2.5-pro: Pushing the limits of data-centric document parsing at scale (opens arXiv in a new tab)
  • Axial-deeplab: Stand-alone axial-attention for panoptic segmentation
  • DLAFormer: An end-to-end transformer for document layout analysis
  • RT-DETRv3: Real-time end-to-end object detection with hierarchical dense positive supervision
  • Exploring large-scale vision foundation models with deformable convolutions
  • Non-local neural networks
  • Aggregated residual transformations for deep neural networks
  • Qwen3 Technical Report
  • Visrag: Vision-based retrieval-augmented generation on multi-modality documents
  • Visual document understanding and reasoning: A multi-agent collaboration framework with agent-wise adaptive test-time scaling
  • DINO: DETR with improved denoising anchor boxes for end-to-end object detection
  • Layoutdiffusion: Improving graphic layout generation by discrete diffusion probabilistic models
  • M2doc: A multi-modal fusion approach for document layout analysis
  • Promptdla: A domain-aware prompt document layout analysis framework with descriptive knowledge as a cue
  • Publaynet: Largest dataset ever for document layout analysis
  • DETRs with collaborative hybrid assignments training
  • These benchmarks cover a wide range of document types, including modern and historical documents, multilingual content, and diverse layout structures
  • Detailed statistics of all benchmarks, including data volume, document types, categories, and example images, are summarized in Tab
  • The complete list of comparison methods is summarized in Tab
  • et al., 2024), PromptDLA (Zhang et al., 2026)</td></tr></table>
  • As shown in Fig
  • DocLayout-YOLO exhibits clearer object perception than YOLOv12
  • The evaluation employs the Align and Density metrics, which respectively measure the aesthetic quality of layouts in terms of document alignment and density
  • For Density, we calculate the ratio of filled area in the layout:
  • The gains are particularly pronounced for several low-frequency categories, suggesting that diverse synthetic pretraining can alleviate long-tail effects to some extent
  • 7, we conduct a diagnostic analysis of Global Attention as shown in Tab
  • Although all three attentions model long-range context along the horizontal and vertical axes, they differ in axis execution (parallel vs. sequential) and attention normalization (joint vs. separate), as summarized in Tab
  • Such separation is well suited to document layouts, where the two axes often represent distinct relationships, e.g., text lines and table rows horizontally, versus paragraph columns and vertically stacked regions vertically
  • \tag {11} $$
  • >$M^6Doc$</td><td>N</td><td>65.3</td><td>65.5</td><td>63.4</td></tr><tr><td>L</td><td>73.7</td><td>73.1</td><td>72.9</td></tr><tr><td rowspan=
  • We investigate this question from both theoretical complexity and practical inference performance
  • Therefore, PALA is not theoretically more efficient for arbitrary area configurations
  • For a fair comparison, we train the YOLOv12-N model with different numbers of areas under the same $1600 \times 1600$ input resolution, training recipe, and TensorRT inference protocol
  • We exclude the Date category because it is rare and visually homogeneous, being largely derived from LaTeX \date
  • We therefore partition the filtered elements into large- and small-scale group according to their normalized scales
  • Algorithm 1 summarizes the whole process of Mesh-candidate BestFit
  • The score favors candidates that occupy the available region compactly while satisfying the size constraint
  • Each placed candidate box is mapped from normalized coordinates to the canvas and independently contracted about its center along the width and height using factors sampled from $\mathcal{U}(0.8, 0.95)$
  • S, M, L respectively denote small, medium, and large elements, indicating the components that are relatively abundant on the page
  • Based on the visualization results, the document layouts in PubLayNet and DocBank clearly exhibit the two-column format and Manhattan layout typical of academic papers, lacking diversity
  • N indicates number of documents used in visualization
  • S9), M $^{6}$Doc (Fig
  • While this design covers common document structures well, highly irregular layouts with strong rotation, perspective distortion, or non-axis-aligned arrangements may benefit from more flexible interaction patterns