scoredit scan models (oemer symbol network and a small student)
The models scoredit uses to read scanned or
photographed sheet music in the browser (readScanScore), as used by
Omnitext. They are downloaded on first use,
after the person agrees, and run on their device.
| File | What | Size |
|---|---|---|
oemer-symbols.onnx | oemer's symbol segmentation network (seg_net): stems and rests, noteheads, clefs and keys | 38.4 MB |
oemer-symbols-int8.onnx | the same network quantised to int8 (reads about as well; for phones and plain WebAssembly) | 10.3 MB |
scoredit-symbols-small.onnx | a small network (1.75 M parameters) trained to reproduce seg_net's output; free input size, for tiles: "strips"; about 15 to 25 times faster than seg_net and reads at least as well | 7.0 MB |
scoredit-symbols-small-int8.onnx | the small network quantised to int8 (same accuracy) | 1.8 MB |
scoredit-symbols-small-v2.onnx | the small network with two more outputs: augmentation dots and tuplet numbers (6 classes); same size and speed | 7.0 MB |
scoredit-symbols-small-v2-int8.onnx | v2 quantised to int8 | 1.8 MB |
oemer-classifiers.json | oemer's four SVM classifiers (clefs, rests, rests above an eighth, sharp/flat/natural), exported to JSON | 5.9 MB |
Staff lines are found by scoredit's own image processing, not by a network: oemer's staff network (unet_big) is not included, since it was trained on CVC-MUSCIMA, a dataset licensed for non-commercial research only.
Origin and credits
- oemer, by BreezeWhite, MIT licence: https://github.com/BreezeWhite/oemer. The network and the classifiers here are oemer's released checkpoints, converted for onnxruntime-web (the int8 copy quantised with onnxruntime's tools, the classifiers exported from scikit-learn to JSON). No retraining.
- The small network (
scoredit-symbols-small*.onnx) was distilled from oemer's seg_net: trained on seg_net's own output (the labels are seg_net's, no hand annotation) over pages rendered with MuseScore 4 in five music fonts, with simulated scan damage (rotation, perspective, blur, noise, JPEG, uneven lighting, bleed-through, thresholding). The pages came from 24 scores: 15 from the OpenScore corpus (Lieder and string quartets, CC0), 6 test files from OpenSheetMusicDisplay's test suite (BSD-3), and 3 guitar scores published by their users on musescore.com (an Asturias, a Romance de amor and a set of guitar riffs). The scripts are in scoredit'sscripts/scan-student/. MIT, like oemer. - v2 (
scoredit-symbols-small-v2*.onnx) continues from the small network with two more outputs. The same 24 scores were rendered again with MuseScore drawing augmentation dots in red and tuplet numbers and brackets in blue; those colours are the labels for the two new classes (no hand annotation), the grey page gets seg_net's labels for the other four, and the first small network supervises those four while training so they do not drift (render.pywithCOLOR=1,label_marks.py,train.py --classes 6 --keep). - DeepScoresV2 (Tuggener, Satyawan, Pacha, Schmidhuber, Stadelmann), CC BY 4.0, https://zenodo.org/record/4012193: the dataset the symbol network and the classifiers were trained on.
Use
import { readScanScore } from "scoredit";
const base = "https://huggingface.co/<owner>/<repo>/resolve/main/";
const doc = await readScanScore(imageBlob, {
models: { symbols: base + "oemer-symbols.onnx", classifiers: base + "oemer-classifiers.json" },
});
With the small network (or v2, read the same way), pass tiles: "strips":
await readScanScore(imageBlob, {
models: { symbols: base + "scoredit-symbols-small-int8.onnx", classifiers: base + "oemer-classifiers.json" },
tiles: "strips",
threads: 1,
});
Accuracy and speed are documented in scoredit's README. On a 14-page test bed (24 staffs, half of them simulated scans): seg_net reads about 80% of pitches and 72% of pitch and duration; the small network 83% and 74%, with its symbol step taking about 10 s a page on one WebAssembly thread of a 2019 laptop. With scoredit's current reader the small network reads 82.1% and 70.3% (the scores differ from the earlier ones because the reader changed), and v2 83.3% and 73.0%, at the same speed, finding nearly every augmentation dot and most printed triplets. The result is a draft to correct.