Cecilia: Towards Layout-Inclusive Optical Music Recognition

Congren Dai, Zhancheng Guo, Xiaobing Li, Maosong SunarXiv 2026 · arXiv

Imagine you’re trying to digitize a stack of old sheet music. You don’t just want a MIDI file that beeps out the notes; you want an editable file that looks exactly like the original—complete with the lyrics, the specific way the staves are grouped, and exactly where the line breaks occur.

This is the goal of Optical Music Recognition (OMR), but it’s surprisingly hard. Most AI models today either give you a "lite" version of the music (missing the layout) or get completely overwhelmed by the sheer verbosity of professional music formats. This paper introduces Cecilia, a clever "shorthand" for music notation that allows AI to see the music and the page layout without losing its mind.

TL;DR

Cecilia is a new, compact way to represent musical scores that includes layout and lyrics while being 27 times shorter than standard MusicXML. By using this representation, the authors built an OMR model that outperforms previous state-of-the-art systems, especially on real-world scans of complex scores.

What Problem Does This Paper Address?

The "gold standard" for digital sheet music is MusicXML. It’s powerful, but it’s incredibly "chatty." A single page of music can turn into hundreds of thousands of tokens of XML code. For an AI model, trying to predict that much text is like trying to write a novel while being forced to repeat the table of contents on every single page—it’s inefficient and prone to errors.

Because of this, many researchers use simpler formats like ABC notation. ABC is great for notes, but it usually ignores the "engraving" details: where does the system break? How wide is this measure? Where do the lyrics attach? Without these, you can’t reconstruct a truly faithful, editable score.

The authors tackle this "representation gap" by creating a format that is as compact as ABC but as detailed as MusicXML.

Methods

The team introduced two main innovations:

  1. The Cecilia Representation: Think of this as a "compressed" version of MusicXML. It uses fixed codes for common musical structures and layout instructions (like system breaks and measure widths). It keeps lyrics tied directly to their notes. As shown in Figure 1, Cecilia achieves a sequence length nearly as short as ABC while retaining all the rich metadata of MusicXML.
Comparison of ABC, Cecilia, and MusicXML formats. Cecilia maintains layout info while staying compact.
  1. Cecilia-OMR Architecture: To read the music, they built a model with a Vision Transformer (ViT) encoder and an autoregressive decoder. Crucially, they use a "segment-count head" to predict how many measures are on a page. The model then decodes the music measure-by-measure (segments), reusing the same visual memory for each part. This "divide and conquer" approach prevents the model from getting lost in long sequences.
The Cecilia-OMR architecture, showing the shared visual memory and segmented decoding process.

Datasets

The model was tested on several rigorous benchmarks:

  • OpenScore String Quartets & Lieder: Both "Rendered" (clean digital images) and "Camera" (scans of physical pages).
  • Lieder with Lyrics: A new extension to the OpenScore set to specifically test how well the model handles sung text.
  • CVC-MUSCIMA: A dataset of handwritten music. The authors contributed new, expert-transcribed MusicXML references for this set to help future researchers.

Key Insights and Ideas

  • The 27x Factor: The most striking "aha" moment is the efficiency. Cecilia is 27.73 times shorter than raw MusicXML. This isn't just a storage win; it’s a performance win. Shorter sequences mean the model's "attention" isn't spread too thin.
  • Layout is Content: The authors argue that layout isn't just aesthetic—it's part of the musical document. By including new-system and new-page tags, the model learns to understand the physical organization of the score.
  • Reinforcement Learning for Music: They used Group-Relative Policy Optimization (GRPO) to fine-tune the model. Instead of just guessing the next token, the model is rewarded for producing valid, compilable MusicXML that matches the reference.

Key Results

Cecilia-OMR set a new bar for the field:

  • Better Accuracy: On the "Camera" (scanned) String Quartets, it achieved a Normalized Edit Distance (OMR-NED) of 0.2232, significantly beating the previous best of 0.2998 (Legato 2).
  • Visual Fidelity: As seen in Figure 3, Cecilia-OMR is the only model that correctly captures the system breaks and layout of the original input, whereas other models (like Legato 1 or even GPT-4 based approaches) often fail to group measures correctly.
Visual comparison of rendered outputs. Cecilia-OMR (Ours) matches the original layout much more closely than baselines.

Limitations and Future Work

While Cecilia-OMR is a leap forward, it’s not perfect:

  • Handwriting is still hard: On the handwritten CVC-MUSCIMA dataset, a direct-XML approach using a massive proprietary model (GPT-6 Astra) still held a slight lead.
  • Geometric Precision: While the model gets the "logical" layout right (which measure goes on which line), it doesn't yet perfectly replicate the exact pixel-perfect spacing of every symbol.
  • Future Directions: The authors suggest moving toward even more faithful page geometry and exploring better ways to align lyrics in highly polyphonic music.

Summary updated

Abstract

Reconstructing an editable music score requires musical events, sung text and the instructions that organise them on the page. Existing recognition targets often omit part of this information, while direct MusicXML prediction repeats substantial structural markup. We introduce Cecilia, a compact representation of canonicalised MusicXML that retains musical content, lyric attachments and layout instructions. Cecilia-OMR predicts this representation through metadata and measure-bounded music segments from shared visual memory. A learned count head determines the number of output segments. Across paired complete scores under a common tokeniser, the ratio of mean MusicXML to Cecilia sequence lengths is 27.73. Cecilia-OMR outperforms Legato 2 on Camera String Quartets and both Lieder conditions, with a four-condition OpenScore macro normalised edit distance of 0.2232 against 0.2998. Separate evaluations of lyrics, notation trees and rendered layout reveal complementary aspects of reconstruction and quantify the contribution of layout instructions. Training-stage, reward and candidate-selection studies further examine how recognition changes across model adaptation and decoding.
BibTeX
@misc{dai2026cecilia,
  author = {Congren Dai and Zhancheng Guo and Xiaobing Li and Maosong Sun},
  title = {{Cecilia: Towards Layout-Inclusive Optical Music Recognition}},
  year = {2026},
  eprint = {2611.27465},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.27465},
}
Figure