Dataset Viewer
The dataset viewer is not available for this dataset.
The JWT signature verification failed. Check the signing key and the algorithm.
Error code:   JWTInvalidSignature
Exception:    InvalidSignatureError
Message:      Signature verification failed
Traceback:    Traceback (most recent call last):
                File "/src/libs/libapi/src/libapi/jwt_token.py", line 286, in validate_jwt
                  decoded = jwt.decode(
                      jwt=token,
                  ...<2 lines>...
                      options=options,
                  )
                File "/usr/local/lib/python3.14/site-packages/jwt/api_jwt.py", line 368, in decode
                  decoded = self.decode_complete(
                      jwt,
                  ...<8 lines>...
                      leeway=leeway,
                  )
                File "/usr/local/lib/python3.14/site-packages/jwt/api_jwt.py", line 265, in decode_complete
                  decoded = self._jws.decode_complete(
                      jwt,
                  ...<3 lines>...
                      detached_payload=detached_payload,
                  )
                File "/usr/local/lib/python3.14/site-packages/jwt/api_jws.py", line 270, in decode_complete
                  self._verify_signature(
                  ~~~~~~~~~~~~~~~~~~~~~~^
                      signing_input,
                      ^^^^^^^^^^^^^^
                  ...<4 lines>...
                      options=merged_options,
                      ^^^^^^^^^^^^^^^^^^^^^^^
                  )
                  ^
                File "/usr/local/lib/python3.14/site-packages/jwt/api_jws.py", line 417, in _verify_signature
                  raise InvalidSignatureError("Signature verification failed")
              jwt.exceptions.InvalidSignatureError: Signature verification failed

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

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.

Sample lines

  • 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:

field type description
image image RGB PNG, 64 px tall, variable width — one line of Hebrew handwriting
text string ground-truth transcription (the label)
style int32 writer-style id [0, 490]; images with the same id share handwriting
cer float32 character error rate of an independent TrOCR re-read of the line (lower = cleaner)

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

  1. Text source. Sentences from Hebrew literary corpora are split into ~721 chunks of 1,000 lines each.
  2. 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.
  3. Independent audit. The finished line images were re-read end-to-end by the same TrOCR model to obtain the honest line-level cer stored with each row.
  4. Targeted improvement. Lines that scored cer > 0.8 were 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.
  5. Filtering. Lines still unreadable (cer > 0.8) after re-rendering were dropped (48 lines, almost all single-character labels a line reader cannot score).
  6. 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 text if 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.0 license 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}
}
Downloads last month
145