Document splitting is the step in a document processing pipeline that divides a continuous stream of pages, such as a scanned batch or a merged PDF, into separate logical documents by detecting where one document ends and the next begins. In Document AI, it is also called page separation, and it usually runs right after capture and before classification and data extraction.
Splitting matters because downstream models assume they receive one coherent document. A batch that mixes an invoice, a delivery note and a contract will produce wrong field values and wrong classifications if it is processed as a single file, so accurate boundaries are a precondition for reliable intelligent document processing.
How document splitting finds page boundaries
At its core, document splitting is a sequence labeling problem. For every page, the system decides whether the page starts a new document or continues the previous one. Some systems frame it as a binary decision for each pair of adjacent pages, while others assign each page a tag such as first, middle or last.
Modern splitters combine several kinds of evidence. Visual features capture layouts, logos and letterheads; textual features come from OCR, such as a page number reading 1 of 3 or a new invoice number; and sequence context compares each page with its neighbors so that a sudden change in layout or sender becomes a strong boundary signal.
The table below summarizes the signals that splitting models typically use and how reliable each one is.
| Signal | What it captures | Reliability |
|---|---|---|
| Page numbering | Patterns such as 1 of 4 or page 1 | High when present, often missing |
| Header and letterhead | Logos, sender blocks, title zones | High for business correspondence |
| Document identifiers | Invoice, order or case numbers | High, depends on OCR quality |
| Layout change | Shift in structure or template | Medium, can mislead within one file |
| Blank or separator pages | Empty sheets or barcode sheets | Very high when used consistently |
| Semantic continuity | Sentences that run across pages | Medium, needs language models |
Approaches to page separation
Page separation has evolved from physical separator sheets toward fully automatic, model-based methods. Many organizations still run hybrid setups in which rules handle predictable batches and machine learning handles the rest.
| Approach | How it works | Best suited for | Limitation |
|---|---|---|---|
| Separator sheets | Barcode or patch code pages between documents | Controlled mailroom scanning | Manual preparation, labor cost |
| Fixed page count | Split every n pages | Uniform forms of known length | Breaks on any variation |
| Rule-based detection | Keywords, regular expressions, zones | Few known document types | Brittle with new layouts |
| Classification-based | Classify each page, split on class change | Mixed batches of distinct types | Misses two same-type documents in a row |
| Pairwise boundary model | Compare adjacent pages with neural networks | Heterogeneous incoming mail | Needs labeled boundary data |
| LLM-based splitting | Multimodal model reasons over page sequence | Complex, low-volume cases | Higher cost and latency |
Classification and splitting are closely linked. Many pipelines perform joint classification and splitting, because knowing that a page is the first page of an invoice already implies a boundary. However, two consecutive invoices share the same class, so a robust splitter must also detect boundaries within one document type.
Where document splitting fits in a Document AI pipeline
Document splitting sits between document capture and the extraction stage. A typical pipeline receives scans or files, cleans the images with deskewing and binarization, runs OCR and layout analysis, then splits and classifies pages before extraction models read key fields, tables and line items.
- Capture pages from scanners, email attachments or uploads.
- Preprocess images and run OCR and layout analysis.
- Split the page stream into logical documents.
- Classify each document and route it to the right extraction model.
- Extract fields, validate them and send low-confidence cases to human review.
Because errors propagate, a single wrong boundary affects two documents: one becomes incomplete and the other receives foreign pages. For this reason, production systems often attach an extraction confidence score to each split and route uncertain boundaries to a reviewer instead of passing them silently downstream.
Measuring splitting quality
Splitting quality is measured at two levels. Boundary-level metrics check whether each predicted break matches a true break, while document-level metrics check whether entire documents were reconstructed with exactly the right pages.
| Metric | What it measures | Why it matters |
|---|---|---|
| Boundary precision | Share of predicted breaks that are correct | Avoids fragmenting documents |
| Boundary recall | Share of true breaks that are found | Avoids merging documents |
| Boundary F1 score | Balance of precision and recall | Single summary for comparison |
| Exact document match | Documents with exactly the right pages | Reflects real downstream impact |
| Straight-through rate | Batches needing no human correction | Drives operational cost |
Exact document match is stricter than boundary F1, because one missed break ruins two documents. Teams should therefore report both metrics on realistic batches, including long documents and runs of similar forms.
Limitations and common mistakes
Document splitting fails most often on ambiguous transitions, such as attachments that follow a cover letter, multi-page tables without headers, or two letters from the same sender printed on identical letterhead.
- Relying only on page classification, which merges consecutive documents of the same type.
- Ignoring poor scan quality, because OCR errors hide page numbers and identifiers.
- Training on clean benchmark data, which rarely reflects real mailroom batches.
- Dropping blank pages blindly, although they may mark intentional boundaries.
- Skipping human review for low-confidence splits, which lets errors reach business systems.
In plain words
Imagine someone drops a thick stack of paper on your desk. It holds letters, bills and forms, all mixed together. Before you can file anything, you must find where each document starts and ends.
Document splitting does this job automatically. It looks at each page and asks one question. Is this the start of something new? Once the stack is divided correctly, every document can be read and filed properly.
A real-world example
A logistics company receives about 8,000 scanned pages per day from drivers and partners. Each scan batch can mix delivery notes, customs declarations, invoices and damage reports, and drivers rarely insert separator sheets.
The company introduces a model-based splitter that compares each page with its neighbors using layout, OCR text and identifiers such as shipment numbers. Boundaries with a confidence below a set threshold go to a review screen where an operator confirms or corrects the split with a single click.
After three months, boundary F1 reaches about 0.97 on live batches, and the share of batches processed without any human correction rises from roughly 40 percent to over 80 percent. Downstream extraction errors fall as well, because the invoice model no longer receives customs pages mixed into its input.