cyttic/diffusionpen-hebrew-handwriting
DiffusionPen Hebrew Handwriting A large synthetic dataset of Hebrew handwritten text lines with ground-truth transcriptions, for training and evaluating handwritten text recognition (HTR / OCR) models. Every image is a single line of right-to-left Hebrew handwriting synthesized by DiffusionPen — a style-conditioned latent-diffusion handwriting generator — in one of 491 distinct writer styles, and quality-filtered by an independent OCR pass. 149,952 line images, 491 writer… See the full description on the dataset page: https://huggingface.co/datasets/cyttic/diffusionpen-hebrew-handwriting.
DiffusionPen Hebrew Handwriting
A large synthetic dataset of Hebrew handwritten text lines with ground-truth transcriptions, for training and evaluating handwritten text recognition (HTR / OCR) models. Every image is a single line of right-to-left Hebrew handwriting synthesized by DiffusionPen — a style-conditioned latent-diffusion handwriting generator — in one of 491 distinct writer styles, and quality-filtered by an independent OCR pass.
- 149,952 line images, 491 writer styles
- Splits: train 119,986 / validation 14,855 / test 15,111 (≈ 80 / 10 / 10)
- Writer-independent: each writer style belongs to exactly one split — a style seen in training never appears in validation or test
- Quality-gated: lines the OCR reader could not read back (CER > 0.8) were removed
Fields
Each row is one handwritten line and its transcription:
Usage
from datasets import load_dataset
ds = load_dataset("cyttic/diffusionpen-hebrew-handwriting")
print(ds)
sample = ds["train"][0]
sample["image"].save("line.png")
print(sample["text"], sample["style"], sample["cer"])How it was built
- Text source. Sentences from Hebrew literary corpora are split into ~721 chunks of 1,000 lines each.
- Rendering. Each line is generated with DiffusionPen (a style-conditioned latent-diffusion handwriting synthesizer). Every word is rendered best-of-N: N candidates are sampled and read back with a fine-tuned Hebrew TrOCR reader (
cyttic/exp10-trocr-hebrew-matan-full); the candidate with the lowest character error rate is kept. Words are then stitched right-to-left into a full line image. - Independent audit. The finished line images were re-read end-to-end by the same TrOCR model to obtain the honest line-level
cerstored with each row. - Targeted improvement. Lines that scored
cer > 0.8were re-rendered with a heavier budget (DDIM-50 / best-of-20, then DDIM-100 / best-of-30 for the hardest), scoring each candidate under test-time distortions (blur, ±rotation, noise) so the most robust, legible rendering is chosen. - Filtering. Lines still unreadable (
cer > 0.8) after re-rendering were dropped (48 lines, almost all single-character labels a line reader cannot score). - Writer-independent split. The 491 styles are partitioned into train / validation / test (no style in more than one split) and greedily balanced to ≈ 80 / 10 / 10 by row count. Evaluation therefore measures generalization to unseen handwriting styles.
Intended use
- Training and benchmarking Hebrew HTR / line-recognition models with a proper writer-independent evaluation protocol.
- Pre-training or data augmentation for low-resource Hebrew handwriting tasks.
- Studying style-conditioned handwriting synthesis and OCR robustness.
Limitations and biases
- Synthetic. Images are model-generated, not scans of real handwriting; they may lack some artifacts of genuine documents (paper texture, ink bleed, real degradation).
- `cer` is model-measured, from a specific TrOCR reader — treat it as a relative quality signal, not an absolute ground truth. Some kept lines still have moderate CER.
- Minor text overlap. The split is by writer, not by sentence. About 1.6 % of validation/test rows contain a sentence that also appears (in a different, train-only style) in the training set. Filter on
textif your protocol requires zero text overlap. - Text provenance. Transcriptions derive from Hebrew literary sources; verify you have the rights for your use case. The
cc-by-4.0license covers the image/label collection and generation; it is not a rights grant over the underlying source texts.
Citation
If you use this dataset, please cite it as:
@misc{diffusionpen_hebrew_handwriting,
title = {DiffusionPen Hebrew Handwriting},
author = {cyttic},
year = {2026},
url = {https://huggingface.co/datasets/cyttic/diffusionpen-hebrew-handwriting}
}