Transcoda: End-to-End Zero-Shot Optical Music Recognition via Data-Centric Synthetic Training

Daniel Dratschuk, Paul Swoboda

TL;DR

Reading sheet music is far harder for machines than reading plain text because music is a dense, two-dimensional graph of space and time. By rethinking how synthetic training data is cleaned and rendered, the authors trained a compact 108M-parameter model in under 10 hours on a single GPU that drastically outperforms a rival model nearly nine times its size on messy, real-world historical scans. It turns out that when teaching an AI to read music, cleaning up ambiguous notation labels matters a whole lot more than raw model scale.

What Problem Does This Paper Address?

Optical Music Recognition (OMR) translates images of sheet music into machine-readable text formats—in this case, a grid-like format called Humdrum **kern, where rows are time steps and columns ("spines") are parallel musical voices.

Unlike standard text OCR, OMR suffers from a massive data bottleneck: we simply don't have large-scale, annotated datasets of physical, scanned scores. Researchers are forced to train models on clean, computer-generated synthetic sheets and hope they generalize "zero-shot" (without prior exposure) to real scans.

Traditionally, this jump fails for three reasons:

  1. The visual gap: Synthetic sheets lack ink bleed, page warp, and crowded layouts, as well as "distractor" markings like fingerings or dynamics.
  2. Structural fragility: If an autoregressive model misreads one note's duration, its internal clock breaks, throwing off voice alignment for the rest of the page.
  3. Encoding ambiguity: A single printed chord can be written in multiple valid ways in **kern (e.g., listing pitches bottom-to-top vs. top-to-bottom). Models waste capacity trying to guess arbitrary human formatting choices that aren't visually determined by the image.

Methods

The authors introduce Transcoda, pairing a standard vision-to-sequence architecture with a heavily engineered data and decoding pipeline.

Figure 2: Transcoda architecture. A ConvNeXt-V2 encoder feeds projected visual features with 2D positional encodings into a 10-layer Transformer decoder. The optional constraint engine masks invalid **kern continuations at inference time.

The model itself is modest: a 108M-parameter network combining a pretrained ConvNeXt-V2 visual backbone with a 10-layer Transformer decoder, using a custom 3,000-token Byte Pair Encoding (BPE) vocabulary tailored for compact **kern. What is novel is the three-part data-centric strategy surrounding it:

  • Deterministic Target Normalization: Before training, a pipeline collapses equivalent **kern encodings into one canonical form. For instance, chord pitches are strictly sorted in ascending order, and invisible metadata that prints nothing on the page is stripped out.
Sorting equivalent chord encodings into a single normalized sequence to remove training ambiguity.
  • Realistic Synthetic Pipeline: Short musical excerpts are concatenated into dense, multi-system pages. Crucially, the authors inject non-target "distractors" (pedal marks, dynamics, fingerings) into the rendered images without putting them in the text labels, teaching the model to ignore visual clutter rather than hallucinating tuplets from fingering numbers. Finally, they apply heavy scan degradations (bleed-through, dirty rollers, lighting shifts).
  • Constrained Decoding (CD): At inference time, an optional grammar engine masks out syntactically invalid tokens and enforces global rules (like ensuring parallel voices on a staff agree on key signatures), guaranteeing output files actually parse and render.

Datasets

  • Synthetic Training & Test Data: The authors compiled 343,470 synthetic training pages—the largest open OMR training set to date—sourced from PDMX, GrandStaff, and KernScores. They also hold out a clean 2,500-page synthetic test set.
  • Real-Scan Evaluation & New Benchmark: Checkpoints were selected using 134 real scanned validation pages. For zero-shot testing, the authors introduce IMSLP-Real, a new open benchmark of 202 real scanned pages from 28 pieces where every reference transcription was manually verified against the scan (part of a larger 509-page internal set). They also evaluate on 117 manually corrected historical pages from the Polish Scores dataset.

Key Insights and Ideas

  • Ambiguity causes runaway hallucinations: When removing target normalization in ablations, models didn't just make more note errors—they got confused and looped until hitting the 2048-token cutoff limit more than three times as often. Canonicalizing targets stabilizes autoregressive generation.
  • Deliberately ignoring rhythm rules during decoding is smarter: Transcoda’s constrained decoder enforces valid syntax and column alignment, not strict musical math (checking if beats sum to the time signature). Why? Because real scores sometimes have intentionally incomplete measures, and if a model misreads a time signature at the top of the page, a hard math rule would block every correct note for the rest of the sheet!
  • Syntax constraints don't fix bad vision: Applying Transcoda's constrained decoder to an older baseline (SMT++) boosted its valid render rate from 28.2% to 100%, yet barely budged its actual music error rate (97.41% to 91.45%). Data quality drives recognition; grammar just ensures the file opens.

Key Results

Performance is measured primarily via OMR-NED (a music-aware edit distance where lower is better, and unparseable files score 100%) across core musical symbols.

Figure 1: Transcoda maps score images to normalized **kern sequences. Trained entirely on synthetic data, it achieves the lowest error (OMR-NED) among compared systems on clean synthetic pages and, zero-shot, on two sets of real scans. Our constrained decoder (CD) lowers its error further.
  • Punching way above its weight: Trained in just 9.8 hours on a single RTX 5090 GPU, Transcoda + CD (108M parameters) slashes error rates compared to Legato (943M parameters) and SMT++ (10.9M parameters).
  • Zero-shot real scans: On IMSLP-Real, Transcoda + CD achieves 22.59% OMR-NED, beating Legato (53.20%) and SMT++ (97.41%). On historical Polish scans, it hits 21.95%, down from Legato's 52.00%.
  • Synthetic mastery & renderability: On clean synthetic pages, Transcoda + CD reaches 1.25% OMR-NED (vs. Legato’s 18.61%), while guaranteeing 100% renderability in downstream music software. Furthermore, as pages get denser and harder, Legato’s error rate spikes sharply while Transcoda’s stays remarkably flat.

Limitations and Future Work

  • Core notation only: Transcoda captures notes, rhythms, clefs, keys, and meters—enough for search and basic playback—but intentionally omits slurs, ties, lyrics, dynamics, and articulations. Scholarly editions and expressive playback remain out of scope.
  • Voice-splitting cascades & loops: About 60% of remaining edit costs come from note/rest errors, and when the model miscounts voice splits/merges on complex piano staves, alignment errors still ripple down the page. A tiny fraction of pages also still trigger infinite generation loops, which adaptive repetition penalties might fix.
  • Format rigidity: The model processes fixed-size portrait images up to 2048 tokens on printed Western staff notation. Supporting variable aspect ratios, multi-page context, and handwritten scores are open frontiers.

Summary updated

Abstract

Optical Music Recognition (OMR), the task of transcribing sheet music into a structured textual representation, is currently bottlenecked by a lack of large-scale, annotated datasets of real scans. Synthetic training pages often lack the crowded layouts, performance markings, and scan defects found in real scores. In Humdrum **kern, a text format for music notation, different encodings can produce the same printed score. The model must therefore learn encoding choices as well as musical content. We propose Transcoda, an OMR system built on (i) a synthetic data pipeline that combines dense score layouts, notation distractors, and scan degradation, (ii) a normalization of common equivalent **kern encodings and (iii) constrained decoding to ensure the syntactic correctness of the output. This approach allows us to train a compact 108M-parameter model in 9.8 hours on a single GPU that outperforms Legato, a model with 8.7x more parameters. It also has the lowest error of all compared systems on our synthetic test set. On real scans it reaches 22.59% OMR-NED, a music-aware error rate, on the 202 pages of IMSLP-Real, a new benchmark of manually checked transcriptions (Legato: 53.20%), and reduces the error rate on historical Polish scans to 21.95% OMR-NED (down from 52.00% for Legato). We make our model, data and generation pipeline publicly available at https://github.com/btrkeks/transcoda.
BibTeX
@inproceedings{dratschuk2026transcoda,
  author = {Daniel Dratschuk and Paul Swoboda},
  title = {{Transcoda: End-to-End Zero-Shot Optical Music Recognition via Data-Centric Synthetic Training}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=8pzICTUGAk},
}
Figure