Layout analysis
Also: Layout assessment
The step before OCR that identifies and labels regions on a page image — text blocks, headers, footnotes, figures, tables, marginalia.
Last updated
Layout analysis is the step before OCR. Given a page image, identify and label its regions — text blocks, headers, footnotes, figures, tables, marginalia. Without it, OCR pours every character into one flat stream and loses all structure.
Why it matters for your research. Primary-source pages are rarely one rectangle of text. A 17th-century broadsheet is three columns with wood-cut borders; an academic monograph has footnotes anchored to specific lines. Preserving the region kinds in your bundle is what lets you filter, facet, and cite correctly later.
In Archēglyph. Done by a VLM. Each region is tagged with its kind and the model id that made the call. See the pipeline guide.
Not to be confused with. OCR reads text inside regions. Layout analysis decides where the regions are and what they are.
A worked example. A page from a 19th-century newspaper might contain a masthead, three columns of body text, a boxed advertisement mid-column, and a footnote rule separating an editor’s note from the main article. Read left-to-right, top-to-bottom without layout analysis, the OCR output would interleave the advertisement’s text into the middle of a news column sentence. With regions correctly labelled and ordered, the same page yields a masthead block, three separate ordered text streams for the columns, an isolated advertisement block, and a footnote block — each queryable and citable on its own rather than as one undifferentiated wall of text.
Why a vision-language model instead of a rules engine. Classical layout analysis used hand-tuned rules — assume text is in rectangular columns, assume a header is the topmost text block — which works on clean modern scans and breaks on the irregular layouts common in archival material: wood-cut borders, marginalia at an angle, columns that don’t align across a fold. A VLM reads the page more like a person does, using visual cues (font size, whitespace, rules, position) together rather than a fixed rule order, which is why it degrades more gracefully on a page that doesn’t match any template.
What “region kind” enables later. Tagging a region as a footnote rather than body text is what lets citation extraction even attempt to find footnote markers, and tagging a region as a figure caption rather than body prose keeps caption text from being concatenated mid-sentence into the paragraph above it. Losing region kinds at this stage doesn’t just make the page harder to read later — it removes information that several downstream analyses need and cannot recover, since neither OCR nor chunking looks at the page image again once text has been extracted.
Ordering matters as much as labelling. A three-column page read in raster order (left to right, top to bottom across the whole page) interleaves the end of column one with the start of column two mid-sentence. Layout analysis has to determine reading order per region, not just region boundaries, which is the harder half of the problem on multi-column archival material — a wood-cut border or marginal note can visually sit between two columns without belonging in the reading order at all.
The provenance angle. Each region carries the model id that made the call on its kind and boundaries, following the same provenance rule as every other derived output. If a researcher later disagrees with a region’s label — a caption tagged as body text, say — the model id tells them which engine to distrust for that page rather than treating the whole extraction as suspect.