# PRImA Layout Analysis Dataset

> The PRImA dataset (ICDAR 2009) provides 1,240 human-annotated pages of magazines and technical articles with pixel-accurate isothetic polygon ground truth, establishing the PAGE-XML standard for layout analysis.

- Authors: Bevaya AI Team
- Published: 2009-07-26
- Updated: 2026-03-12
- Paper: Paper (IEEE) <https://doi.org/10.1109/ICDAR.2009.271>
- Dataset: PRImA Layout Analysis Dataset <https://www.primaresearch.org/datasets/Layout_Analysis>
- Code: PAGE-XML Libraries <https://www.primaresearch.org/tools/PAGELibraries>
- Source: Bevaya Labs, <https://labs.bevaya.ai/>

---


## TL;DR

The PRImA Layout Analysis Dataset (ICDAR 2009) contains **1,240 ground-truthed page images** at a 7:1 ratio of magazine to technical article pages. It uses pixel-accurate **isothetic polygon** ground truth (rectilinear shapes that wrap tightly around non-rectangular regions) and stores annotations in the **PAGE-XML** format (formally described in a companion publication at ICPR 2010). A semi-automated ground-truthing tool fits polygon boundaries to region content using a shrink-wrap approach. A subset of 55 pages was used for the ICDAR 2009 Page Segmentation Competition; a downloadable subset of approximately 305 pages is currently available via the dataset website.

---

## What kind of paper is this?

**Dominant:** $\Psi\_{\text{Resource}}$

The primary contribution is the dataset itself along with the PAGE-XML format and semi-automated ground-truthing tooling. The paper argues that no existing dataset adequately captures the complexity of real-world digitisation targets (colour magazines, non-Manhattan layouts), and addresses that gap with a new benchmark.

**Secondary:** $\Psi\_{\text{Evaluation}}$

The paper describes the in-depth evaluation framework tied to the dataset and its use as the basis for the ICDAR 2009 Page Segmentation Competition. Competition results are reported in a separate companion paper (Antonacopoulos et al., ICDAR 2009 competition paper).

## What is the motivation?

Prior datasets used for layout analysis evaluation had two systemic problems:

1. **Simple layouts only.** The University of Washington (UWASH) dataset, ISRI, and MARG datasets contain almost exclusively bilevel (black and white) journal articles with rectangular, Manhattan-style layouts. These do not represent the complexity of documents most likely to be digitised in practice.
2. **Limited region representation.** Bounding rectangles cannot represent text wrapping around images or other non-rectangular content. The MediaTeam Document Database offered colour but still constrained regions to bounding rectangles; the UvA dataset had more complex regions but concentrated on advertisement-type pages unrepresentative of general digitisation work.

The PRImA group built this dataset to evaluate layout analysis methods on realistic, complex, colour documents with accurate and detailed ground truth.

## What is the novelty?

**1. Complex layout support via isothetic polygons:**
Rather than bounding rectangles, PRImA uses **isothetic polygons** (polygons with only horizontal and vertical edges) to describe region boundaries. This enables tight, accurate representation of non-rectangular regions such as text wrapping around a circular image, without the complexity of arbitrary polygons.

**2. The PAGE-XML format:**
The paper uses and describes the **PAGE (Page Analysis and Ground truth Elements)** XML format (formally introduced in Pletschacher and Antonacopoulos, ICPR 2010), which explicitly separates:
- **Physical structure:** Region types (text, image, table, etc.)
- **Logical structure:** Semantic roles within text regions (heading, paragraph, caption, footer, etc.)
- **Reading order:** Ordered and unordered groups, nestable for complex logical structures like newspapers.

The format also supports sub-region annotation at the text line, word, and glyph level, enabling evaluation of segmentation methods beyond the region level.

**3. Semi-automated ground-truthing tool:**
Annotators draw a rough outline around any region; the tool then automatically fits the boundary precisely to the region content using a shrink-wrap approach. (This tool was later developed into the Aletheia system, formally described in Clausner et al., ICDAR 2011.) This proved more efficient than running an automatic segmentation and manually correcting it. The tool enforces the isothetic polygon constraint and captures per-region metadata (language, font, reading direction, text colour, background colour, logical label).

**4. Dataset composition:**
The 1,240 images include:
- Magazines covering news, business, and technology (mainstream publications with complex layouts, text-wrap, and varied font sizes)
- Technical articles from journals and conference proceedings (typically simpler, but with some complex pages)
- Supplementary material including forms, bank statements, and advertisements for broader coverage

**5. Web-accessible, searchable dataset:**
Unlike prior datasets distributed as flat file collections, PRImA provides a web-based database interface at `dataset.primaresearch.org` supporting browsing and search by colour depth, column count, and layout features (presence of images, tables, varying fonts). Suitable subsets can be selected and downloaded as zip files.

## What experiments were performed?

The dataset was used as the basis for the **ICDAR 2009 Page Segmentation Competition**. A subset of 55 pages was reserved for competition evaluation. The competition methodology and results are described in a separate companion paper (Antonacopoulos et al., ICDAR 2009 Page Segmentation Competition); this paper covers only the dataset design and creation workflow.

The evaluation framework, described in an earlier paper by the same authors (Antonacopoulos and Bridson, ICDAR 2007), weights segmentation errors by semantic severity rather than treating all pixel or region errors equally. Merging two unrelated columns is penalised more heavily than splitting a single paragraph, reflecting the impact on downstream readability and extraction.

## What are the outcomes/conclusions?

The paper establishes three artefacts that persisted in the field:

1. **PAGE-XML** became the standard ground-truth format for historical and complex document analysis. It is still used in the Transkribus platform and subsequent PRImA competitions (RDCL 2017, RDCL 2019).
2. **The semi-automated ground-truthing tool** (later named Aletheia; Clausner et al., ICDAR 2011) demonstrated that semi-automated isothetic polygon fitting is more practical than manual correction of automatic segmentation for ground-truthing complex layouts.
3. **PRImA dataset** became a standard benchmark for non-Manhattan layout analysis, filling a gap left by UWASH and other simple-layout datasets.

### Limitations

- **Scale:** 1,240 pages is small by deep learning standards; modern methods typically require tens of thousands of training examples and use PRImA primarily as a test set.
- **Domain:** Heavy bias toward magazines and technical articles. Forms, bank statements, and advertisements are included but not the focus.
- **Access model:** The dataset is accessed via registration on the PRImA website. No open-access download or permissive license is specified in the paper; the effective use appears to be research-only.
- **Evaluation complexity:** The scenario-based weighted evaluation metric, while semantically meaningful, is complex to implement compared to COCO-style mAP, which is why later researchers often apply simpler metrics when using this dataset.

---

## The PAGE-XML Format

> **From the official documentation:** There is a plethora of established and proposed document representation formats but none that can adequately support individual stages within an entire sequence of document image analysis methods. This paper describes PAGE, a new XML-based page image representation framework.

The PAGE-XML format is the standard for ground truth storage in PRImA. Below is an overview of the 2019 version of the structure.

### Region Types

The 2009 paper defines 10 region types: **text, image, line drawing, graphic, table, chart, separator, maths, noise,** and **frame**. The 2019 PAGE-XML schema extended this list; the expanded set is shown below.

Supported types in the 2019 schema:
*   **TextRegion**
*   **ImageRegion**
*   **GraphicRegion**
*   **ChartRegion**
*   **LineDrawingRegion**
*   **SeparatorRegion**
*   **TableRegion**
*   **MathsRegion**
*   **ChemRegion**
*   **MusicRegion**
*   **AdvertRegion**
*   **NoiseRegion**
*   **UnknownRegion**

### Main Structure

The XML schema can be found here: [http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15/pagecontent.xsd](http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15/pagecontent.xsd)

```xml
<?xml version="1.0" encoding="UTF-8"?>
<PcGts xmlns="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15 http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15/pagecontent.xsd">
    <Metadata>...</Metadata>
    <Page imageFilename="SimplePage.png" imageWidth="800" imageHeight="600">
        <ReadingOrder>...</ReadingOrder>
        <TextRegion>...</TextRegion>
    </Page>
</PcGts>
```

### Region Examples

**Text Region (Heading)**
```xml
<TextRegion id="r0" type="heading">
    <Coords points="25,30 25,55 235,55 235,30"/>
    <TextEquiv>
        <Unicode>The PAGE Format</Unicode>
    </TextEquiv>
</TextRegion>
```

**Table Region**
Regions can have sub-regions (nested regions), such as table cells.
```xml
<TableRegion id="r3" lineSeparators="true">
    <Coords points="25,475 25,560 400,560 400,475"/>

    <!-- Column 1 Header -->
    <TextRegion id="r5" type="paragraph">
        <Coords points="40,485 40,500 120,500 120,485"/>
        <TextEquiv>
            <Unicode>Column 1</Unicode>
        </TextEquiv>
    </TextRegion>
    ...
</TableRegion>
```

### Reading Order

Reading order describes the logical sequence of text regions. It supports `OrderedGroup` and `UnorderedGroup`.

```xml
<ReadingOrder>
    <OrderedGroup id="ro357564684568544579089">
        <RegionRefIndexed regionRef="r0" index="0"/> <!-- Heading -->
        <RegionRefIndexed regionRef="r1" index="1"/> <!-- Paragraph 1 -->
    </OrderedGroup>
</ReadingOrder>
```

### Text Line Objects

Text line objects are sub-elements of `TextRegion`. The text content can be stored simultaneously in the text region and in the text line objects.

```xml
<TextRegion id="r0" type="heading">
    ...
    <TextLine id="l0">
        <Coords points="25,30 25,55 235,55 235,30"/>
        <TextEquiv><Unicode>...</Unicode></TextEquiv>
    </TextLine>
    ...
</TextRegion>
```

## Mapping to Unified Taxonomy

PRImA's PAGE-XML schema distinguishes between **Region Type** (Physical) and **TextRegion attributes** (Logical), which aligns well with our [Matter vs. Meaning](../matter-vs-meaning/) standard. This separation between physical and logical structure was a notable design choice for the time.

### High-Level Regions (The Primitives)

| PAGE-XML Region | Visual Primitive | Logical Role | Notes |
| :--- | :--- | :--- | :--- |
| **TextRegion** | `Text` | *Varies* | Role depends on the `type` attribute (see below). |
| **ImageRegion** | `Image` | `Figure` | Photographic content. |
| **GraphicRegion** | `Image` | `Figure` | Logos, decorations, simple graphics. |
| **LineDrawingRegion** | `Image` | `Diagram` | Sketches, technical drawings. |
| **ChartRegion** | `Image` | `Chart` | Business graphics (Bar/Pie). |
| **TableRegion** | `Table` | `Table` | Grid structures. |
| **MathsRegion** | `Formula` | `DisplayEquation` | Math equations. |
| **ChemRegion** | `Formula` | `ChemScheme` | Chemical structures. |
| **MusicRegion** | `Music` | `SheetMusic` | Music scores. |
| **AdvertRegion** | `Image` | `Advertisement` | Adverts (visual or text-heavy blocks). |
| **SeparatorRegion** | `Structure` | - | Lines, rulers. |
| **NoiseRegion** | `Structure` | - | Scanner artifacts. |

### Text Roles (The Meaning)

Within `TextRegion`, the `type` attribute defines the semantic role.

| PAGE-XML Type | Unified Role | Notes |
| :--- | :--- | :--- |
| **paragraph** | `Body` | Standard prose. |
| **heading** | `SectionHeader` | Titles and headings. |
| **caption** | `Caption` | Labels for images/tables. |
| **header** | `PageHeader` | Running headers. |
| **footer** | `PageFooter` | Running footers. |
| **page-number** | `PageNumber` | Folio numbers. |
| **drop-cap** | `Body` | **Violation:** Separates the first letter. |
| **credit** | `Credit` | Image/Photo attribution. |
| **floating** | `Sidebar` | Text outside the main flow. |
| **signature-mark** | `Signature` | Quire marks (books) or actual signatures. |
| **catch-word** | `JumpLine` | Navigation aid at bottom of page. |
| **marginalia** | `Annotation` | Handwritten or printed margin notes. |
| **footnote** | `Footnote` | Notes at bottom of page. |
| **toc-entry** | `TOC` | Table of contents entries. |

## Reproducibility

### Data

- **Total images:** 1,240 ground-truthed page images (stated at time of 2009 publication). A downloadable subset of approximately 305 images (265 magazine + 40 technical article pages) is available via the dataset website as of 2022. The ICDAR 2009 competition used a dedicated subset of 55 pages.
- **Composition:** ~7:1 ratio of magazine pages to technical article pages. Also includes forms, bank statements, and advertisements.
- **Scanning:** 300 DPI, 24-bit colour. Bilevel (binarised) versions are also provided, produced using ABBYY FineReader's binarisation. Deskewing applied automatically (ABBYY FineReader), then manually verified.
- **Access:** Registration required via `dataset.primaresearch.org`. No explicit open license is stated in the paper; effective use appears to be research-only.
- **License:** Unknown. The dataset metadata records copyright holder per document. Individual source documents are magazines and technical publications whose underlying copyrights are not cleared; use for commercial training is not safe to assume.

### Annotation Geometry

- **Format:** PAGE-XML (isothetic polygons, not bounding boxes). Each region boundary is an isothetic polygon with only horizontal and vertical edges, enabling tight representation of non-rectangular regions.
- **Levels:** Page, region, text line, word, glyph. Competition evaluations typically use the region level.
- **Per-region metadata (text regions):** language, font, reading direction, text colour, background colour, logical label (heading, paragraph, caption, footer, etc.).
- **Overlaps:** Not explicitly prohibited by the format, unlike DocLayNet's hard constraint. Complex nested structures (e.g., table cells) are supported as sub-regions.

### Annotation Tool

- **Semi-automated ground-truthing tool** (later named Aletheia; Clausner et al., ICDAR 2011): Annotators draw an approximate boundary; the tool automatically fits it to region contents. Supports rectangle, polygon, and free-draw input modes. A separate quality-control operator reviews each ground-truthed document before it is committed to the dataset.

### Evaluation

- **Metric:** Weighted scenario-based scoring (Antonacopoulos and Bridson, ICDAR 2007) that penalises errors by semantic severity. Not equivalent to COCO-style mAP; later researchers often substitute simpler IoU-based metrics.
- **Competition:** ICDAR 2009 Page Segmentation Competition results are in a separate companion paper, not this dataset description paper.

### Hardware

- Scanning hardware not specified beyond "300 DPI, 24-bit colour scanner." No GPU or compute requirements reported (dataset creation, not model training).

## BibTeX

```bibtex
@inproceedings{antonacopoulos2009realistic,
  title={A realistic dataset for performance evaluation of document layout analysis},
  author={Antonacopoulos, Apostolos and Bridson, David and Papadopoulos, Christos and Pletschacher, Stefan},
  booktitle={2009 10th International Conference on Document Analysis and Recognition},
  pages={296--300},
  year={2009},
  organization={IEEE},
  doi={10.1109/ICDAR.2009.271}
}
```


