Dataset Viewer
Auto-converted to Parquet Duplicate
image
stringlengths
20
20
width
int64
1.8k
1.8k
height
int64
360
360
lines
listlengths
4
13
images/page_0000.png
1,800
360
[ { "id": 0, "row": 0, "text": "617832818361146137899087372661", "word_breaks": [ 3, 7, 10, 14, 21, 27 ], "x0": 45, "x1": 923, "topline": [ [ 45, 42.3 ], [ 49, 42.3 ], [ 53, ...
images/page_0001.png
1,800
360
[{"id":0,"row":0,"text":"0556319045218463425788425677090232","word_breaks":[3,7,10,16,20,24,28,33],"(...TRUNCATED)
images/page_0002.png
1,800
360
[{"id":0,"row":0,"text":"8234690711675762555800189706560704144105115200798760972485462","word_breaks(...TRUNCATED)
images/page_0004.png
1,800
360
[{"id":0,"row":0,"text":"01859855695212446407661462016557918796141089578762940","word_breaks":[7,14,(...TRUNCATED)
images/page_0005.png
1,800
360
[{"id":0,"row":0,"text":"466985664878586159983559764704929685991001871921899512165411","word_breaks"(...TRUNCATED)
images/page_0006.png
1,800
360
[{"id":0,"row":0,"text":"8480622459971452300601897780","word_breaks":[4,11,18,23],"x0":45,"x1":887,"(...TRUNCATED)
images/page_0007.png
1,800
360
[{"id":0,"row":0,"text":"56067584057313","word_breaks":[7,12],"x0":48,"x1":402,"topline":[[48.0,45.1(...TRUNCATED)
images/page_0008.png
1,800
360
[{"id":0,"row":0,"text":"640204212704817225091181185890194046750208131370442196000","word_breaks":[6(...TRUNCATED)
images/page_0009.png
1,800
360
[{"id":0,"row":0,"text":"544920376397868146176720884872900867178297","word_breaks":[5,12,19,24,27,33(...TRUNCATED)
images/page_0010.png
1,800
360
[{"id":0,"row":0,"text":"898165","word_breaks":[],"x0":38,"x1":198,"topline":[[38.0,56.4],[42.0,56.4(...TRUNCATED)
End of preview. Expand in Data Studio

MNIST Manuscripts

A synthetic dataset of manuscript-style page images for building and evaluating OCR engines: text-line detection, line-level text recognition, and full-page transcription.

Each page looks like a long, narrow palm-leaf or pothi-style folio. It holds several lines of handwritten digits, each hanging from a continuous headline bar, like the shirorekha of Devanagari and Sharada. The "text" is digits, so the task has the layout problems of a historical manuscript without the complexity of a real script.

At a glance

Pages 500 in total: 400 train, 50 validation, 50 test
Images <split>/images/page_XXXX.png, 1800 × 360 px, RGB, PNG
Annotations <split>/annotations/page_XXXX.json, one file per page, same number as the image
Content 4–6 rows of digits per page, about 200–340 digits per page
Alphabet 10 classes: 0–9
Annotation levels text line (transcription + geometry), word breaks, individual digit boxes
Language none (random digit strings)

preview.png shows the first four pages stacked, so you can see the data at a glance.

Layout and splits

mnist-manuscripts/
  train/  images/  annotations/    400 pages, with ground truth
  val/    images/  annotations/     50 pages, with ground truth (use for tuning)
  test/   images/  annotations/     50 pages, with ground truth (use only for the final evaluation)
  preview.png
  README.md

The split is by page, so no page appears in more than one set. Page numbers are not reused across sets, and image paths inside each JSON are relative to its split folder.

Please keep the test set for the end. The test annotations are included so you can score yourself, but it only means something if you never train on them or tune against them. Develop on train and val, then run on test once, when you are done, and report that number.

What the images look like

  • Ink: dark brown-black handwritten digits. Digit size varies from line to line (about 22–28 px tall). Individual digits are slightly rotated.
  • Headline bar: every line has a thin dark bar along its top edge with the digits hanging just below it. The bar follows the line, so it is not always straight.
  • Lines are not straight:
    • They are tilted, curved and wavy, and the tilt and curvature change along a page.
    • Spacing between lines is not perfectly even, and neighbouring lines can come close to each other.
  • Line shapes:
    • Most rows are one long line across the page.
    • Some rows are split into 2–3 separate pieces with blank space between them.
    • Some rows are short, like the last line of a paragraph.
    • Words are separated by gaps, so a line contains several "words" of digits.
  • Paper and degradation:
    • Paper colour ranges from cream to tan, with uneven mottling.
    • Foxing spots, water stains with tide-lines, fibres and grain.
    • Darkened, worn edges and occasional fold lines.
    • Occasionally a small trail of insect holes.
    • Ink from the reverse side of the leaf shows through faintly. It is not annotated.
    • Ink strength varies, with some faded patches.
  • Mounted leaves: about a quarter of the pages show a leaf with torn, ragged edges on a dark backing, so there is a dark border and possibly missing content near the edges.

Annotation format

Each annotations/page_XXXX.json looks like this:

{
  "image": "images/page_0000.png",
  "width": 1800,
  "height": 360,
  "lines": [
    {
      "id": 0,
      "row": 0,
      "text": "617832818361146137899087372661",
      "word_breaks": [3, 7],
      "x0": 45,
      "x1": 923,
      "topline":  [[45, 42.3], [49, 42.3], "..."],
      "baseline": [[45, 72.3], [49, 72.3], "..."],
      "polygon":  [[45, 38.3], [49, 38.3], "..."],
      "digits": [
        {"label": 6, "box": [56, 50, 69, 69]},
        {"label": 1, "box": [80, 53, 89, 71]}
      ]
    }
  ]
}

Coordinates

All coordinates are in pixels of the page image. The origin is the top-left corner, x increases to the right and y increases downward.

Page fields

Field Meaning
image Path of the matching image, relative to the dataset folder
width, height Image size in pixels
lines List of text lines on the page (see below)

Line fields

Field Meaning
id Line index within the page. Lines are listed in reading order: top to bottom, and left to right within a row.
row Index of the row the line sits in. Lines with the same row are pieces of one broken row.
text Ground-truth transcription as a digit string, without spaces
word_breaks Indices into text where a word gap occurs. A value of 3 means there is a gap between text[2] and text[3].
x0, x1 Horizontal extent of the line, in pixels
topline Polyline along the top of the headline bar, as [x, y] points sampled every 4 px
baseline Polyline along the bottom of the digit zone, as [x, y] points, sampled the same way
polygon Closed polygon around the line, for cropping. It is the topline and baseline pushed outward by 4 px. Points go left-to-right along the top, then right-to-left along the bottom.
digits One entry per digit, in the same order as text

Each digits entry is {"label": int, "box": [x0, y0, x1, y1]}. The box is a tight bounding box around the digit's ink, with x1 and y1 exclusive.

Reconstructing text with spaces

def with_spaces(line):
    chars = list(line["text"])
    for i in reversed(line["word_breaks"]):
        chars.insert(i, " ")
    return "".join(chars)

Suggested tasks

  1. Line detection: find every text line on the page, as baselines or polygons. Evaluate with precision and recall, matching predicted lines to ground-truth lines.
  2. Line recognition: given a cropped line image, predict its digit string. Use CTC or an attention-based decoder. Evaluate with character error rate (CER).
  3. End-to-end page OCR: go from page image to transcription in reading order. Evaluate with page-level CER, which counts missed and extra lines and misordered lines as well as misread digits.
  4. Digit detection: detect and classify individual digits, using the boxes in digits.

Report line detection, recognition on ground-truth crops, and recognition on your own detected lines separately. Otherwise a good recogniser can hide a weak detector, or the reverse.

Things to watch out for

  • Don't resize naively. Pages are 5:1, and digits are only about 22–28 px tall. Heavy downscaling can destroy the digits.
  • The headline bar touches the ink zone. A crop that is too tight at the top will cut the bar, and one that is too loose will pull in the line above.
  • Lines are curved. Straight rectangular crops will include parts of neighbouring lines. The polygon field is there for this reason, so consider straightening each line before recognition.
  • Spaces are not characters in text. Decide whether your model should predict word breaks, and take them from word_breaks.
  • The digit strings are random. There is no language structure to exploit, so a language model will not help. This isolates the visual side of recognition.
  • Images are RGB with strong colour variation. Grayscale conversion or per-image normalisation may help.

Provenance

The digits are drawn from the handwritten digit images of MNIST. The pages, layout, paper textures and annotations are synthetic and were generated programmatically. No real manuscripts are included.

License and attribution

This dataset is released under the Creative Commons Attribution-ShareAlike 4.0 International license (CC BY-SA 4.0). You may share and adapt it for any purpose, including commercial use, if you give credit and distribute anything you build from it under the same license.

It is derived from MNIST, which is licensed under CC BY-SA 3.0. The digit images come from MNIST (LeCun, Cortes and Burges), who derived them from NIST Special Databases 1 and 3. Credit them if you reuse this dataset.

If you use this dataset, you can cite it as:

Kulkarni, S. MNIST Manuscripts: synthetic manuscript pages built from MNIST digits. Cummins College of Engineering for Women, Pune.

Author

Sourav Kulkarni, Assistant Professor, Computer Engineering Department, Cummins College of Engineering for Women, Pune.

Questions, corrections and feedback are welcome: sourav.kulkarni@cumminscollege.in or srvklkrn@gmail.com.

Downloads last month
242