Source-linked AI summary
Data-Driven Glyph Positioning for Handwritten Music Synthesis
Elona Shatri, Jiří Mayer, Jan Hajič jr
TL;DR
Handwritten OMR has few annotated training scores, and synthetic handwritten scores still have a layout gap because positioning rules use unvalidated constants. This paper measures glyph relationships across two corpora and learns context-dependent offsets; GNN-positioned synthesis improves positioning RMSE and downstream detection results.
Problem
Handwritten-score annotation is labour-intensive and available datasets are small, while hard-coded synthesis layout rules have not been validated against handwriting.
Source: §1 · p. 1Method
Results
GNN-positioned synthesis yields +30% mAP50 over the baseline and +11% over empirical means after fine-tuning on 200 real handwritten staves; positioning RMSE falls 50–85% on context-dependent relationships.
Source: §8 · p. 10Takeaways & Limitations
The reported downstream results show that positioning accuracy in synthesis matters for OMR performance.
Source: §8 · p. 10The current GNN integration uses learned distributions at synthesis time rather than iterative position refinement, which would require the graph to exist before positioning.
Source: §7.2 · p. 9
Abstract
from arXiv · showhide
Synthesised data is a common strategy to address the lack of annotated handwritten music scores in Optical Music Recognition (OMR). Smashcima is a recent synthesis framework that assembles pages of handwritten scores by sampling glyph images from MUSCIMA++ and positioning them with hard-coded rules. In this work we ask whether these rules are grounded empirically and whether a learned model for context-dependent positioning can further improve synthesis quality. We extract inter-glyph distributions from around 285 thousand annotated relationships across MUSCIMA++ and OmniOMR, finding that several key parameters deviate systematically from real handwriting. Replacing these constants with empirical means reduces positioning RMSE by up to 60%. We then train a Graph Neural Network (GNN) on the Music Notation Graph structure to predict context-dependent offsets, achieving an additional 50 to 85% RMSE reduction on stems and beams by modelling how neighbouring glyphs constrain placement. Cross-dataset analysis shows that spacing differences between the two corpora are explained by note density (3.3), not style, and that duration-proportional spacing does not hold in handwriting (R2 = 0.001). In downstream evaluation, a YOLOv8 detector pretrained on GNN-positioned synthetic data achieves +30% mAP50 over the baseline and +11% over empirical means when fine-tuned on 200 real handwritten staves, showing that positioning accuracy matters for downstream OMR.
1 Introduction
The paper targets the layout component of the synthetic-to-real gap in handwritten music recognition, where hard-coded placement rules have not been validated against handwriting. It tests those rules empirically and evaluates whether context-dependent learned positioning improves synthesis.
- Smashcima’s placement parameters are hard-coded constants chosen by visual inspection, and its independent relationship rules cannot model neighboring-glyph constraints.Source: §1 · p. 2
- The contributions include downstream detection gains from GNN-positioned synthesis and large positioning-error reductions on context-dependent glyph relationships.+30% mAP50 over the baseline and +11% over empirical means are reported with 200-shot fine-tuning; GNN positioning reduces RMSE by 50–85% on stems and beams.Source: §1 · p. 2
- The study characterizes 199 inter-glyph relationship types using approximately 285,000 annotated relationships from two complementary corpora.Source: §1 · p. 2
2 Related Work
Prior synthesis approaches either produce typeset scores or address handwritten glyph appearance, while Smashcima supplies handwritten layouts with pixel-level annotations. This work focuses on improving the relative positioning of those glyphs.
- Engraving engines generate typeset scores at scale, while GAN-based methods address handwritten symbol appearance; Gasbert et al. combine generated glyphs with Smashcima’s layout engine.Source: §2 · p. 2
- Smashcima assembles sampled MUSCIMA++ glyphs into handwritten pages with pixel-level annotations, but its positioning constants have not been validated against data.Source: §2 · p. 2
- Prior graph neural networks address semantic engraving decisions, whereas this work addresses realistic glyph placement in millimetre space.Source: §2 · p. 3
3 Data and Method
The method extracts directed glyph relationships from two MuNG-annotated corpora, measures relative positions, and evaluates fixed, empirical, and context-conditioned predictors.
3 Data and Method
- MUSCIMA++ contributes 143,539 directed edges across 199 relationship types, and OmniOMR contributes 141,716 directed edges from real-world handwritten scores.MUSCIMA++ edges connect glyphs through attachment relationships; OmniOMR documents represent different pieces and writers under natural writing conditions.Source: §3 · p. 3
3.1 Feature Extraction
- For each directed MuNG edge, the method computes the source-to-target bounding-box-centre offset in millimetres.Source: §3.1 · p. 3
3.2 Evaluation Protocol
- Evaluation uses leave-one-writer-out validation on MUSCIMA++ and leave-one-document-out validation on OmniOMR, comparing hard-coded, empirical-mean, and GNN predictors by RMSE.Source: §3.2 · p. 3
4 How Far Off Are the Constants?
Empirical measurements show that several Smashcima positioning constants differ from handwriting, while the appropriate spacing depends on note density rather than dataset origin.
4 How Far Off Are the Constants?
- Replacing Smashcima’s 5.0 mm stem length with direction-conditional empirical means reduces RMSE by 57–60%.The empirical means are 3.8 mm for stem-up and 4.2 mm for stem-down; per-writer models perform identically to the global model under leave-one-writer-out validation.Source: §4 · p. 4
- Empirical accidental offsets yield 9–24% RMSE improvement over Smashcima’s zero-offset rule, with flats at −0.78 mm, naturals at 0.45 mm, and sharps near zero.The offsets are measured between bounding-box centres, so the flat and natural values reflect glyph-shape asymmetry.Source: §4 · p. 4
- Beam angle varies with pitch contour and writer style; a linear pitch-proxy model reaches R2 = 0.59 on MUSCIMA++ and R2 = 0.66 on OmniOMR.Writer conditioning provides a 9% RMSE reduction for this relationship.Source: §4 · p. 4
- The empirical mean note-column gap is 5.07 mm in MUSCIMA++ and 10.88 mm in OmniOMR, while duration predicts spacing poorly (R2 = 0.001).Smashcima uses a fixed 1.2 mm gap between note columns.Source: §4 · p. 4
4.1 Cross-Dataset Comparison
- The 2× spacing difference between MUSCIMA++ and OmniOMR is attributed to note density, not dataset of origin.MUSCIMA++ has 62.9 noteheads per page (0.28/mm), compared with 12.0 per staff (0.085/mm) in OmniOMR.Source: §4.1 · p. 4
5 GNN for Context-Dependent Positioning
A GNN predicts glyph offsets from MuNG neighborhoods, targeting relationships where local graph context constrains placement.
5 GNN for Context-Dependent Positioning
- Glyph positions depend on context: stem length varies with beam-group size, beam angle constrains attached stems, and crowded measures compress offsets.The GNN predicts context-dependent (dx, dy) offsets from the MuNG graph structure.Source: §5 · p. 4
5.1 Architecture
- MuNG pages become glyph graphs whose class, box, position, and edge-type features feed a GraphSAGE encoder and edge decoder predicting millimetre offsets.The model uses four message-passing layers and has 236,610 trainable parameters.Source: §5.1 · pp. 4–5
5.2 Results
- 50–85% RMSE improvement over empirical means on stems, beams, and flags, where neighbouring glyphs constrain placement.Across all edge types, the GNN achieves an overall RMSE of 2.06 ± 0.30 mm.Source: Table 2 · p. 6, §5.2 · p. 6
6 Downstream Evaluation
The evaluation compares detectors trained on baseline, empirical-mean, and GNN-positioned synthetic data, then tests transfer after fine-tuning on real OmniOMR staves.
6.1 Experimental Setup
- The study trains YOLOv8-nano detectors on three synthetic datasets generated with identical seeds and glyph sampling, varying only symbol positioning.Each dataset contains 1,000 pages from 100 MusicXML sources; bounding boxes cover 20 symbol categories.Source: §6 · p. 6, §6.1 · p. 7
6.2 Synthetic Validation
- On synthetic validation, mAP50 is 0.297 for baseline, 0.444 for empirical (+50%), and 0.520 for GNN (+75% over baseline, +17% over empirical).GNN gains are consistent across symbol classes and largest on stems and beams.Source: §6.2 · p. 7
6.3 Transfer to Real Handwritten Scores
- Transfer is tested by fine-tuning each pretrained model on 5–924 real OmniOMR staves and evaluating on 231 held-out staves, with three random subsets per condition.Source: §6.3 · p. 7
- At 200 real training images, GNN achieves mAP50 0.218 versus 0.196 for empirical (+11.3%) and 0.168 for baseline (+30.0%).The advantage persists at 924 images (+6.7%).Source: §6.3 · p. 8
7 Discussion
The discussion links improved glyph positioning to detector gains and shows that spacing depends on note density. It also identifies boundaries in the current integration and evaluation.
7 Discussion
- Four message-passing layers let the GNN distinguish stems by beam-group size, while empirical means assign one mean per edge type.Beamed stems are shorter than single-note stems, and conditioning on beam-group membership reduces stem-length variance.Source: §7 · p. 8
7.1 The Layout Ceiling
- +50% mAP50 on synthetic data comes from empirical means over hard-coded constants; the GNN adds +17% on synthetic and +11% on real data.The GNN-pretrained model also outperforms both baselines across all few-shot data regimes.Source: §7.1 · p. 8, Table 3 · p. 9
- The recommendation to prioritize layout fidelity alongside architecture or symbol appearance still needs measurement in an end-to-end context.The discussion frames this as a direction for further measurement, not an established comparison.Source: §7.1 · p. 9
- Per-writer models match the global model for accidentals and stem length under LOWO, so one global model suffices for most positioning parameters on unseen writers.Beam angle is the only studied relationship that benefits from writer-specific models.Source: §7.1 · p. 9
- The 2× spacing difference between MUSCIMA++ and OmniOMR reflects note density rather than style, and duration-proportional spacing does not hold in handwriting (R2 = 0.001).MUSCIMA++ writers copied dense music onto fixed-width paper, and synthesis spacing should depend on target note density.Source: §7.1 · p. 9
7.2 Limitations
- The current GNN integration uses learned distributions at synthesis time rather than full graph inference; iterative refinement on the constructed scene graph remains future work.Full graph inference would require the graph to exist before positioning.Source: §7.2 · p. 9
- At 640px resolution, small symbols such as augmentation dots and ledger lines are difficult to detect regardless of positioning quality.Source: §7.2 · p. 9
- The effect of layout corrections versus more realistic symbol appearances remains a proposed comparison for decomposing the synthetic-to-real domain gap.The suggested comparison includes OmniOMR glyphs or GAN-generated symbols.Source: §7.2 · p. 9
8 Conclusion
Data-driven glyph positioning improves both layout accuracy and downstream handwritten-score detection. A GNN adds context-dependent offsets, and its synthetic-data pretraining advantage persists across few-shot data regimes.
8 Conclusion
- The GNN reduces positioning RMSE by an additional 50–85% on context-dependent relationships by modelling how neighbouring glyphs constrain placement.The relationships include stems, beams, and flags.Source: §8 · p. 10
- Replacing Smashcima’s hard-coded constants with empirical means reduces positioning RMSE by 4–60% without model training.Source: §8 · p. 10
- +30% mAP50 over the baseline and +11% over empirical means were achieved by a YOLOv8 detector pretrained on GNN-positioned synthetic data and fine-tuned on 200 real handwritten staves.The GNN-pretrained model outperforms both alternatives across all few-shot regimes, with the largest advantage in the low-data regime.Source: §8 · p. 10, Figure 4 · p. 10
- Layout fidelity is an important component of the synthetic-to-real domain gap, and each positioning level adds information and measurable downstream improvement.Source: §8 · p. 10