Page Segmentation Failures in Mixed Text and Image Documents
Fixing segmentation errors early preserves document structure before extraction fails.

In mixed-content documents, segmentation goes wrong when layout relationships break down ahead of extraction. Bad page cuts mislabel regions, scramble the reading sequence, and damage tables, so downstream processes inherit the error. A reliable extraction workflow therefore pinpoints where the collapse happens and keeps the page structure intact before anything is converted into text.
Why layout analysis runs before OCR, and what it protects against
Financial exhibits spanning three columns in a mortgage package may yield legible characters yet send data to the wrong places. Medical documents combining printed entries and handwritten notes suffer an identical structural collapse. Merely identifying text fails to restore those severed connections. What is absent is a spatial hierarchy, an organizational layer that separates page regions while maintaining their relative positions. Both scenarios break down when processing treats the page layout as static from the start.
Layout analysis first reads the page visually, outlines each detected area, and assigns every region a type before extraction. They sort regions as text blocks, tables, illustrations, running heads, or notes so later steps receive pixel-derived structure. OCR by itself does not understand that two-dimensional page order. Without layout analysis, column text runs together, notes lose their anchors, and a search can surface a caption apart from its figure. Layout analysis protects the way the page looks and the relationships that make the text usable.
How spatial hierarchy collapses: the three-layer detection chain and where each layer breaks
Detection proceeds in sequence through three dependencies: resolving physical signals, classifying region types, and inferring reading order. The initial stage fixes box boundaries, while the next distinguishes headers, body copy, tabular content, and graphical elements before the last places those identified regions in sequence. Thus, a boundary error alters what classification receives before reading order inference starts.
Tightly packed or bent text lines, fused table cells, and poor-quality scans can yield boxes that cross region boundaries at the physical layer. Classification consequently receives fragmented regions. Even an apparently correct label cannot restore the absent boundary. The reading order stage then inherits these flawed or wrongly labeled pieces, which amplifies the original error.
A one-column assumption can cause nearby text to be wrongly combined across scholarly articles, public-sector paperwork, and insurance records. The text can still be legible even when the recovered order is unusable. Methods driven by rules, from projection profiles to whitespace analysis, run quickly and remain transparent, yet their layout models can fail under skew, mixed orientations, or degraded image quality. Their weakness lies less in scan quality than in rigid layout expectations that variation can undo.
Over-segmentation and under-segmentation as the two poles of the same collapse
When over-segmentation happens, one logical region gets carved up into several detected ones. A big table cell holding multiple lines and paragraphs can come apart into separate pieces, and sections of a multi-column article may lose the links between them. DocSAM, introduced in a CVPR 2025 paper, points to inconsistent labels across datasets as a further source of the issue. This breaking apart is more than a surface-level flaw. It strips away the grouping later stages rely on to treat those pieces as belonging to a single region.
By fusing distinct logical regions, under-segmentation commits the opposite boundary mistake. A form's separate columns might merge into a single zone, compelling OCR to weave together text drawn from distinct streams. Scans of facing pages illustrate this flaw vividly: treating both leaves as one area causes their lines to merge into a single output stream. Both extremes likewise impair table structure recognition, since vague estimates near tightly packed or arced cell edges prevent proper separation of cells.
These failures should not lead to opposite diagnoses. In both cases, the error happens at the boundary-drawing stage, before any type is assigned to the region. Garbled text by itself cannot show which boundary error happened. So the practical diagnostic step is to compare the drawn boxes with the text produced by OCR. That check tells whether one region was split apart or several regions were merged.
Why table structure and reading order fail together when spatial hierarchy is gone
Row-column relationships and the content within each cell together determine what a table conveys. The sequence in which text is read relies on both the spatial arrangement of regions and their content. Without those boundaries, extraction strips away the relational framework and multi-column layouts risk merging into jumbled sequences.
DocSAM notes that practitioners typically rely on distinct tools to handle page structure, locate text, and recognize table layouts. Since these components operate independently, the modules handling both tables and reading order remain vulnerable to mistakes made earlier in the layout stage. The cascade that follows does more than change output quality. If OCR results are taken as ground truth, downstream parsing faces an altered formal challenge since incorrect borders reshape what gets read. This goes beyond merely processing a corrupted form of what was meant to be read.
Legal and administrative records expose this dependency because poor segmentation undermines field extraction and the rebuilding of logical structure. Corporate disclosures, bills, and agreements present complex, diverse layouts that make boundary errors especially damaging. Page boundaries interrupt continuity. Handling pages one by one wipes away context and breaks the links between fields on different pages in loan packages and insurance submissions. Accurate page-level regions remain essential, yet they cannot by themselves maintain document-wide relationships.
What model architecture choices actually change about the collapse point
Layout architectures vary in the amount of spatial structure they can capture prior to extraction. DiT alongside Vision Grid Transformer approach layout through object detection across image regions, whereas LayoutLM with its successors primarily rely on sequence labeling that incorporates positional encodings. Such methods capture relational patterns beyond the reach of rule-based systems. This difference matters because the model's representation dictates the range of layout diversity it can tolerate prior to boundaries or relationships turning unreliable.
Vision Grid Transformer captures spatial structure simultaneously across tokens and grids. By maintaining context through layout shifts that stump rule-driven parsers, this grid approach resolves reading order failures in multi-column documents. DiT processes unprocessed page visuals, bypassing any need for OCR. Yet its reliance on scholarly publications hampers performance when applied to complex financial tables or unconventional business documents. Consequently, when source data diverges from what was learned during pretraining, models tend to break down on visually unfamiliar pages.
Model size does not resolve that mismatch. OmniDocBench, presented at CVPR 2025 for diverse PDF parsing, shows DocLayout-YOLO substantially outperforming LayoutLMv3 despite the latter having far more parameters. Model selection should match pretraining material to the target document type before benchmarking, rather than treating a strong academic-document score as evidence of suitability for financial forms.
Unified models tackle failure from another angle. By running layout analysis alongside table structure recognition and text segmentation at multiple granularities, DocSAM cuts the fragmentation between modules where boundary errors propagate. Even so, it still struggles when evaluated against benchmarks for spotting text in natural images. Doing these tasks at once shifts where the collapse happens without ruling it out, while specialized routing offers another path for handling different documents.
Why end-to-end vision approaches bypass segmentation but introduce a different ceiling
ColPali, unveiled during the ICLR 2025 conference, processes each page visually rather than as text, generating multi-vector representations without relying on a parsing pipeline. That means it bypasses region classification altogether. Such a method proves valuable whenever visual elements like graphs or illustrations hold key details that text extraction would discard.
Vision-language models that process documents end-to-end excel with visually grounded content but struggle when faced with dense, complex text. ColPali's architecture exemplifies this bypass, though it fails to prove consistent superiority compared to parsing pipelines. What matters is the location where spatial hierarchy gets rebuilt, be it a layout model or a vision model's attention mechanism. Which method fits the document type determines reliability.
Unstructured's Brian Raymond anticipates that bespoke extraction workflows, rather than single massive architectures, will soon direct document fragments to appropriate model classes. This synthetic parsing approach should cost less and work better. Real-world tests on fiscal documents confirm this: a group discovered that sending tabular data, prose segments, and visual figures to tailored models outperformed any unified setup. The findings support targeted dispatch rather than treating either modular workflows or holistic visual processing as the sole answer.
Why standard evaluation metrics miss the failures that matter most in production
Assessment can inherit extraction’s blind spot. Metrics like IoU score how well pixels line up spatially, but they can miss splits and merges that disrupt logical relationships. A fragmented region can still retain substantial overlap. The pixel map can look mostly right while later steps are left without the complete region they require.
Standardized scholarly evaluations create another gap separating reported accuracy from real-world outcomes. One OCR evaluation covering eleven difficult document categories, featuring unusual page structures, fine-grained scans, intricate or watermarked backdrops, tabular data, and equations, reveals declining accuracy on practical business texts even when traditional metrics look excellent. Consequently, the top-scoring system may prove unsuitable for collections plagued by fragmented tables or collapsed multi-column reading sequences. Mean scores never pinpoint the specific layout breakdown driving a bad extraction.
DLER quantifies layout error rate, and a demanding industrial document profile reveals conditions that clean academic material does not have. Segmentation-stage confidence scoring lets uncertain areas prompt human review ahead of final decisions. Segmentation that stays consistent and flags which files require review serves operations better than marginal improvements to mean benchmark scores.
Practical interventions that address the collapse before it propagates
Start by making segmentation its own pipeline stage rather than leaving it implicit in the extraction tool. Running layout analysis as a separate step first is usually the safest practical fix for documents whose columns are read in the wrong order. If that stage still draws weak boundaries, then assess how well the data used to pretrain the model resembles the documents being processed, including compact financial tables and uneven business forms.
Architecture choice follows the main structural problem. VGT’s grid encoding handles table-dense files by retaining layout relationships through shifts that defeat template-driven and single-stream approaches. Visually grounded content needs another path. For information embedded in figures or graphs, unified visual architectures prevent pixel-level data from passing through text segmentation pipelines. When a single stream demands both, routing at the component level directs figures, tables, and text blocks to purpose-built models.
Before extraction proceeds, these choices require testing and review. Layout metrics tailored to the task, together with the industrial benchmark spanning eleven categories, can expose breakdowns that tidy academic datasets conceal. Confidence scores then flag the areas calling for human review. Segmentation with weak confidence must not flow onward unchecked simply because the following stage tolerates it. Taken together, these steps surface uncertainty while it remains fixable, rather than depending on OCR to reconstruct structure already lost.
The Extend AI platform for document layout analysis and IDP follows this pipeline-first design: deep learning layout detection runs before extraction, with routing and confidence scoring built in. Its relevance lies in where those controls sit rather than in any claim that one model can handle every kind of document. The decisive boundary sits upstream of extraction. Later stages then inherit relationships the document never contained.
Notes
- DocSAM: Unified Document Image Segmentation via Query Decomposition and Heterogeneous Mixed Learning
Provided details on DocSAM's unified architecture, its handling of inconsistent dataset labels, and its approach to running layout analysis alongside table structure recognition and text segmentation.
- Handwritten and Printed Text Segmentation via Region-Aware Human-Writing Descriptor Engineering
Informed the discussion of handwritten and printed text segmentation failures, including challenges with mixed orientations and region boundary detection.
- Document Layout Analysis with Deep Learning and Heuristics
Supported the discussion of deep learning layout analysis methods, heuristic approaches, and the comparison of models like LayoutLMv3 and DocLayout-YOLO on document layout tasks.
- Document Layout Error Rate (DLER) metric to evaluate image segmentation methods - ScienceDirect
Provided the basis for the DLER metric discussion and the industrial document benchmark that reveals failures not captured by standard academic evaluation metrics.
Every new piece from The Parse Layer, as it's published.
Follow