Dataset Viewer
Auto-converted to Parquet Duplicate
Search is not available for this dataset
image
imagewidth (px)
2.55k
2.55k
End of preview. Expand in Data Studio

Synthetic Medical Document Recognition Benchmark

This dataset contains synthetic, English-language medical records rendered as documents for evaluating automated data extraction and de-identification systems. Each synthetic patient has a longitudinal FHIR R4 record and multiple visual representations derived from that record.

Every rendered document is clearly marked as synthetic. This makes the dataset suitable for manual testing, product demonstrations, and workflows that benefit from realistic-looking medical documents without exposing real patient data.

The dataset is designed as an evaluation benchmark, not as a training corpus. It is too small for representative model training, and its repeated elements, synthetic-data notices, and watermarks could provide shortcuts for a trained model.

All people, clinical histories, organizations, and practitioners in this dataset are synthetic. The dataset is intended for software development and benchmarking, not for clinical use.

Bundle contents

The published bundle contains five synthetic patients:

  • Adam Hirthe (1ce276e5)
  • Andres O'Hara (348deeaf)
  • Carolann Pfeffer (ebd5380d)
  • Marion Cormier (2a636504)
  • Rebecka Aufderhar (8e9abf1d)

For each patient, the bundle provides 33 document layouts across several document categories and three visual template variants. The document categories include clinical timelines, contact information and contact forms, diagnostic documents, printed email threads, notes, observations, referral packets, reports, surveys, and vaccination histories.

The bundle contains:

Path Contents
data/html/ 165 source documents with selectable text: 33 per patient.
data/pdf/ 2,970 PDFs. This includes searchable PDFs rendered directly from HTML and image-only PDFs for pristine and degraded variants.
data/png/ 10,931 page images rendered at 300 DPI, grouped into capture-variant subdirectories. Multi-page documents have one PNG per page.
data/fhir/patients/ Five FHIR R4 transaction bundles containing the underlying longitudinal patient records.
data/fhir/practitioners/ Referenced practitioner resources needed to resolve the selected patient bundles.
data/fhir/organizations/ Referenced organization and location resources needed to resolve the selected patient bundles.
data/manifest.json The selected patient files, supporting FHIR files, and file counts for the bundle.

Supporting FHIR resources are stored once even when they are referenced by multiple patients. The patient bundles contain their clinical resources and resolve all internal urn:uuid: references. Practitioner, organization, and location references that live outside a patient bundle can be resolved using the companion files included under data/fhir/.

Synthea run metadata and the source-generation project are intentionally not included. They are not required to consume the rendered documents or their FHIR companions.

Document categories and typical length

Each patient has one document for every document-category × template-variant combination: eleven document categories and three template variants, for 33 source documents per patient. The average lengths below were measured from the clear 300-DPI renderings in this release. Each average covers 15 documents (five patients × three template variants); the range shows the shortest and longest document in that category.

Document category Contents Average pages Range
clinical_timeline A chronological longitudinal record of encounters, procedures, diagnostic reports, conditions, medication requests, and immunizations. 14.6 9–22
contact_form A patient-completed, handwritten-style contact form containing identity, demographic, address, telephone, email, and verification fields. 1 1
contact_info A typed administrative summary of patient identity, demographics, address, telephone, email, and record-verification information. 1 1
diagnostic Diagnostic and laboratory panels with result names, values, units, reference ranges, interpretations, status, date, and performer when available. 4.53 2–10
email Patient–clinic email threads quoting recorded observations, with separate diagnostic attachment pages; presented as a desktop mail printout, webmail conversation, or plain-text archive. 8.6 6–12
notes Narrative procedure or clinical-activity notes with service dates and associated clinician and facility information. 1 1
observation Charts and summaries of longitudinal numeric observations, such as weight, BMI, blood pressure, pulse, respiration, pain score, and GAD-7 score when present. 1 1
referral Five-sheet referral packets covering request and contact details, clinical background, medications and allergies, diagnostic results, and care history. Referral orders, urgency, recipient details, and signatures remain unfilled. 5 5
report A compact overview of key medical data: allergies, conditions, medications, encounters, procedures, vaccinations, observations, and patient details. 2.47 2–3
survey The latest PRAPARE social-needs survey rendered as a patient-completed paper or checkbox form. 2 2
vaccination_history Immunization history with administration date, vaccine and CVX code, status, facility, manufacturer, lot, site, route, source, and notes when available. 1.67 1–2

The degraded PNG and image-only PDF variants preserve the pagination of their corresponding clear document.

Three vendor and style variants

Every document category has type_1, type_2, and type_3. These are three independent visual presentations of the same category of patient information, intended to simulate documents produced by different vendors and systems. Depending on the document category, the variants differ in branding, typography, spacing, table or card structure, information density, handwriting treatment, and patient-facing versus clinician-facing presentation.

The variants also exercise different date conventions where dates are displayed:

  • type_1 primarily uses US numeric dates such as 08/24/2026;
  • type_2 primarily uses abbreviated month names such as Aug 24, 2026;
  • type_3 primarily uses ISO-style dates such as 2026-08-24.

Rendered document variants

The PNG collection contains a pristine rendering of every page and simulated capture degradations suitable for document-recognition testing. These include:

  • clear 300-DPI renders;
  • photocopies with straight, misoriented, rotated, clipped, and combined variants;
  • photographs with stains, perspective skew, page bend, misorientation, clipping, and combined variants.

Every degraded page is derived from its corresponding clear page. Image-only PDFs combine the pages of each PNG variant in their original page order. Searchable PDFs preserve the text and vector content of the HTML source.

Variant and file counts

Each of the 643 source pages has 17 PNG representations: one clear, seven photocopy, and nine photo variants. Each of the 165 source documents has 17 image-only PDFs plus one searchable PDF.

Representation Variants PNG pages Image-only PDFs
Clear 1 643 165
Photocopy 7 4,501 1,155
Photo 9 5,787 1,485
Total 17 10,931 2,805

With the 165 searchable PDFs, the total PDF count is 2,970. The bundle also contains 165 HTML documents, five patient FHIR bundles, and 16 supporting FHIR files. Each PNG dataset configuration selects exactly 643 page images.

File naming

Files belonging to the same patient share a stable prefix:

synthetic_<Given>_<Family>_<patient-id>

The shared patient prefix is the join key between HTML, PDF, PNG, and patient FHIR files. A patient FHIR bundle represents the complete longitudinal record; it is therefore a companion to all documents for that patient, rather than a ground-truth file for only one rendered document.

FHIR JSON filenames retain their existing names without a version suffix.

For example:

synthetic_Adam_Hirthe_1ce276e5_report_type_2_ver_1.html
synthetic_Adam_Hirthe_1ce276e5_report_type_2_ver_1.pdf
synthetic_Adam_Hirthe_1ce276e5_report_type_2_p_2_of_3_dpi_300_clear_ver_1.png
synthetic_Adam_Hirthe_1ce276e5_report_type_2_p_2_of_3_dpi_300_photo_skeh_ver_1.png
synthetic_Adam_Hirthe_1ce276e5_report_type_2_p_2_of_3_dpi_300_photocopy_str_ver_2.png
synthetic_Adam_Hirthe_1ce276e5_report_type_2_dpi_300_clear_3p_img_ver_1.pdf
synthetic_Adam_Hirthe_1ce276e5_report_type_2_dpi_300_photocopy_str_3p_img_ver_2.pdf
synthetic_Adam_Hirthe_1ce276e5.json

Common filename fields are:

  • type_<n>: visual template variant;
  • p_<n>_of_<n>: PNG page number and total page count, present only for multi-page documents;
  • dpi_300: raster resolution;
  • clear, photo_*, or photocopy_*: capture/degradation variant;
  • <n>p: page count in a multi-page image-only PDF;
  • img: a PDF assembled from raster page images rather than rendered directly from HTML.

The degradation tokens can be read from left to right:

Token Meaning
clear Pristine raster rendering without simulated capture degradation.
photo Simulated photograph of a document.
photocopy Simulated photocopied document.
sta Stained with randomized marks or discoloration.
skel, skem, skeh Unclipped skew at low, medium, or heavy severity: perspective, page bend, and rotation simulate a photograph taken at an angle.
skem Medium skew in combined and clipped variants (4–8°).
mis Misoriented by 90, 180, or 270 degrees.
rotl, rotm, roth Unclipped rotation at low, medium, or heavy severity.
rotm Medium rotation in clipped variants (4–10°).
cli Clipped: part of the page extends beyond the image boundary.
str Straight photocopy without rotation or clipping.

Combined tokens mean that all named effects are present. For example, photo_sta_skem is a stained photograph with medium skew; photo_mis_skem_cli is a misoriented, skewed, clipped photograph; and photocopy_mis_rotm_cli is a misoriented, rotated, clipped photocopy.

Standalone unclipped rotation and skew have three severity levels. Stained-skew combinations use medium skew (sta_skem and sta_mis_skem). Angles are sampled uniformly within the inclusive ranges, with a random direction. For skew, these ranges control the rotation step; perspective and page bend are also applied. The canvas expands to retain the whole page.

Level Rotation segment and angle Skew segment and angle
Low rotl: 1–3° skel: 1–3°
Medium rotm: 4–10° skem: 4–8°
Heavy roth: 11–45° skeh: 9–25°

Clipped rotation uses 4–10° (rotm_cli and mis_rotm_cli); clipped skew uses 4–8° (skem_cli, mis_skem_cli, and sta_mis_skem_cli).

The last filename segment is ver_<n>, immediately before the extension. Every HTML, PNG, and PDF filename contains exactly one such segment, after any page numbering, DPI, degradation tokens, page count, or img marker. The number identifies the version of that complete document representation. Versions can advance independently for different representations as their content or generation changes.

Downloading selected files with Python

The full repository is large, so consumers can use snapshot_download from huggingface_hub with glob-style allow_patterns and ignore_patterns. Install the client first:

python -m pip install -U huggingface_hub

With uv, add it to a project with:

uv add huggingface_hub

Or install it into the current environment without changing project dependencies:

uv pip install -U huggingface_hub

The following downloads every image-only PDF while skipping searchable PDFs, HTML, PNG, and FHIR files:

from huggingface_hub import snapshot_download

repo_id = "morzel85/synthetic-medical-document-recognition-benchmark"

snapshot_download(
    repo_id=repo_id,
    repo_type="dataset",
    allow_patterns="data/pdf/*_img_ver_*.pdf",
    local_dir="benchmark",
)

Download only clear image-only PDFs:

snapshot_download(
    repo_id=repo_id,
    repo_type="dataset",
    allow_patterns="data/pdf/*_clear*_img_ver_*.pdf",
    local_dir="benchmark-clear-pdfs",
)

The wildcard between clear and _img_ver_*.pdf also matches the optional page count in names such as _clear_3p_img_ver_1.pdf.

Download all image-only PDFs that simulate stained photographs, including stained-and-skewed and other combined variants:

snapshot_download(
    repo_id=repo_id,
    repo_type="dataset",
    allow_patterns="data/pdf/*_photo_sta*_img_ver_*.pdf",
    local_dir="benchmark-stained-photo-pdfs",
)

Download only the searchable PDFs rendered directly from HTML:

snapshot_download(
    repo_id=repo_id,
    repo_type="dataset",
    allow_patterns="data/pdf/*.pdf",
    ignore_patterns="data/pdf/*_img_ver_*.pdf",
    local_dir="benchmark-searchable-pdfs",
)

Patterns can also select a patient, document family, or condition. For example, this downloads Adam Hirthe's clear report PDFs:

snapshot_download(
    repo_id=repo_id,
    repo_type="dataset",
    allow_patterns=(
        "data/pdf/synthetic_Adam_Hirthe_1ce276e5_report_*_clear*_img_ver_*.pdf"
    ),
    local_dir="adam-clear-reports",
)

PNG files are grouped by capture variant under data/png/<variant>/, such as data/png/clear/ and data/png/photo_skel/. Each variant directory contains 643 page images. Use data/png/**/*.png to select all PNGs or data/png/clear/*.png to select clear pages.

The same approach works for data/html/ and data/fhir/.

Simulated handwriting

Handwritten-looking fields are rendered using CSS and handwriting fonts licensed under the SIL Open Font License, with per-glyph variation added during rendering. They are not produced using a handwriting model trained on the IAM Handwriting Database. Such a model might produce more realistic results, but it could introduce licensing restrictions because the database's official terms limit its use to non-commercial research. This dataset is intended to support both commercial and non-commercial use under the CC BY 4.0 license.

Author and attribution

Created by Miłosz Orzeł.

The underlying synthetic health records were generated with Synthea.

Changelog

v1.4.1

Removes the _medium suffix from the stained-skew and stained-misoriented-skew dataset configuration names. Severity labels remain only on standalone skew and rotation configurations with three levels.

v1.4.0

Adds a new document category, referral, with three layouts per patient (15 documents in total). Each referral is a five-page packet covering the referral request and contact details, clinical background, medications and allergies, diagnostics, and care history.

Refines the rotation (rot) and skew (ske) variants introduced in v1.3.0:

  • Standalone, unclipped rotation and skew retain all three severity levels: rotl / rotm / roth use 1–3° / 4–10° / 11–45°, and skel / skem / skeh use 1–3° / 4–8° / 9–25°.
  • Stained-skew combinations now use medium skew only (sta_skem and sta_mis_skem). Their low- and high-skew counterparts are removed.
  • Clipped rotation is regenerated with medium angles (4–10°, previously 20–30°). rot_cli and mis_rot_cli become rotm_cli and mis_rotm_cli, making the severity explicit in filenames.
  • Clipped skew is regenerated with medium angles (4–8°, previously 3–12°). ske_cli, mis_ske_cli, and sta_mis_ske_cli become skem_cli, mis_skem_cli, and sta_mis_skem_cli.

v1.3.0

Replaces all unclipped rotation and skew files with three severity levels: rotl, rotm, roth, skel, skem, and skeh. Stained and stained-misoriented skew combinations also receive all three levels. Rotation ranges are 1–3°, 4–10°, and 11–45°; skew rotation ranges are 1–3°, 4–8°, and 9–25°. All ranges are inclusive, in either direction. Clipped variants are unchanged.

Removes 2,272 old PNGs and 600 old image-only PDFs and replaces them with 6,816 PNGs and 1,800 image-only PDFs. All new severity filenames use _ver_1. The PNG dataset configurations, naming examples, and file counts reflect the new variants.

The bundle totals are 150 HTML documents, 3,300 PDFs (3,150 image-only and 150 searchable), and 11,928 PNGs. The five patient FHIR bundles and 16 supporting FHIR files are unchanged.

v1.2.0

Improves the simulated photocopy appearance with grayscale toner grain, rough ink edges, uneven exposure bands, and roller streaks. All 2,840 photocopy PNGs and their 750 image-only PDFs are regenerated from the pristine pages.

Standardizes document filenames so that each HTML, PNG, and PDF has exactly one _ver_<n> suffix immediately before its extension. Photocopy PNGs and their image-only PDFs use _ver_2; other document files use _ver_1. Dataset configuration paths and download examples follow this convention.

The bundle totals remain 150 HTML documents, 2,100 PDFs, and 7,384 PNGs. FHIR files are unchanged.

v1.1.0

Version v1.1.0 adds three printed email styles for each of the five patients: a desktop mail printout (type_1), an indented webmail conversation (type_2), and a plain-text correspondence archive (type_3), with diagnostic attachments.

Compared with the previous bundle, this adds 15 HTML documents, 210 PDFs, and 1,677 PNGs. The totals are now 150 HTML documents, 2,100 PDFs, and 7,384 PNGs; the five patient FHIR bundles and 16 supporting FHIR files are unchanged. The email documents contain 129 source pages across all patients and styles, with 13 image variants per page (one clear, five photocopy, and seven photo). Each document also has one searchable PDF and 13 image-only PDFs.

To download this release reproducibly, pass revision="v1.1.0" to snapshot_download.

Downloads last month
2,175