What is document layout analysis?
Document layout analysis identifies the boundaries and types of sections on a document page, such as headings, paragraphs, lists, tables, figures, footnotes, page headers and columns, then sets their correct reading order.
It is the step within document parsing that maps the page, while parsing extracts all text, tables and structure. Optical Character Recognition recognises characters; layout analysis decides which section they belong to and in what order to read them.
- Topic
- Embeddings, document processing and RAG
- Also known as
- Page layout analysis, DLA
How document layout analysis works
- A page image or the document's internal structure is taken as input.
- Deep learning models process image or text together with position and mark regions such as headings, paragraphs, tables and figures with bounding boxes.
- Relations between regions are built; reading order is set on multi-column pages and page headers and footers are separated from body text.
- The result becomes a document structure used by the parsing and chunking steps.
In more detail
Born-digital PDFs versus scanned images
Layout analysis differs markedly between born-digital PDFs and scanned images. Born-digital PDFs already embed vector character coordinates and font metadata, though often in arbitrary stream order, so hybrid pipelines fuse fast PDF coordinate extraction with visual layout detectors; scanned pages rely entirely on rasterised image analysis and suffer when skew, stamps or low DPI blur region boundaries.
Reading order and table structure recognition (TSR)
Detecting bounding boxes is only half the task: multi-column layouts, sidebars and cross-page tables require dedicated reading-order reconstruction (via geometric XY-Cut algorithms or transformer sequence models) and Table Structure Recognition (TSR) to recover row/column spans and multi-line cells before serialising into Markdown or HTML for RAG.
Choosing between object detection models and end-to-end document VLMs
End-to-end document Vision-Language Models (VLMs) and specialised page-parsing pipelines increasingly unify layout detection, reading order, LaTeX equation parsing and table extraction into a single model pass. However, because VLM decoding is GPU-intensive and can hallucinate numeric values on noisy scans, on-premise deployments weigh lightweight object-detection DLA (tens of milliseconds per page) against VLM parsers based on latency and accuracy budgets.
Evaluation metrics for layout analysis
Document layout models are benchmarked using region-level mean Average Precision (mAP) and Intersection over Union (IoU) for bounding boxes, edit distance or Kendall's tau for reading-order accuracy and Tree-Edit-Distance-based Similarity (TEDS) for reconstructed HTML/Markdown table structure.
Commonly confused terms
| Term | How it differs |
|---|---|
| OCR | OCR recognises individual characters and words in a page image, whereas document layout analysis identifies structural regions (headings, tables, footnotes, columns) and determines their semantic roles and reading order. |
Why document layout analysis matters for on-premises AI
Company documents often have multi-column pages, tables, margin notes and repeated page headers; if layout is extracted wrongly, lines from two columns mix or each page footer lands mid-text. That leads to irrelevant chunks in retrieval and wrong answers. Models in this field are largely trained on labelled datasets; one open dataset, for example, has 80,863 manually annotated pages of varied types. On company hardware, document images do not leave.
An energy company uses layout analysis when moving scanned older technical specifications from its archive into its assistant; reading order on two-column pages is fixed, tables are extracted separately and page footers removed.
Common questions
How does document layout analysis differ from OCR?
OCR recognises characters. Layout analysis decides which section that text belongs to and in what order it is read.
Why is document layout analysis needed?
On multi-column or table-heavy pages plain text extraction breaks reading order. Layout analysis ensures content is processed in the right order and section.
Related terms
- Document parsing
- Optical Character Recognition
- Table extraction
- Chunking
- Computer vision
- Vision-language model
Sources
- Pfitzmann et al., DocLayNet: A Large Human-Annotated Dataset for Document-Layout Analysis, 2022
- Xu et al., LayoutLM: Pre-training of Text and Layout for Document Image Understanding, 2019
In the glossary: Glossary, D to L