A learning-based method of automatic music transcription
Organizations: Department of Information Technology, FPT University, Ho Chi Minh City, Vietnam · Faculty of Information Technology, Ho Chi Minh City Open University, Ho Chi Minh City, Vietnam
Abstract
Automatic Music Transcription (AMT) seeks to convert acoustic music recordings into symbolic musical notation, a process that remains remarkably difficult for polyphonic piano due to concurrent polyphony, harmonic partial interference, expressive timing, and severe pitch activation sparsity. In this paper, we formulate polyphonic piano transcription as a frame-level multi-label classification problem across the standard 88 piano pitches (MIDI notes 21 to 108). Raw audio waveforms are processed using the Constant-Q Transform (CQT) to construct a geometrically spaced log-frequency time-frequency representation that aligns with the chromatic musical scale across seven octaves (252 frequency bins per frame). We systematically investigate recurrent sequence models, contrasting unidirectional Long Short-Term Memory (LSTM) with Bidirectional LSTM (BiLSTM) backbones, and propose two architectural adaptations tailored to recurrent temporal representations: a modified additive attention module and a modified multihead attention mechanism equipped with hyperbolic tangent activation and head-wise summation. Furthermore, to mitigate the severe class imbalance between inactive and active notes (approximately 41:1), we evaluate Weighted Binary Cross-Entropy (WBCE) alongside standard Binary Cross-Entropy (BCE). Rigorous empirical evaluations on the MAPS and MAESTRO datasets demonstrate steady, compounding gains from bidirectionality and attention mechanisms. Our proposed Multihead Attention-BiLSTM architecture attains an F1-score of 88.20%, an accuracy of 78.90%, a precision of 0.89, and a recall of 0.86, substantially outperforming the baseline unidirectional LSTM (F1-score of 71.20%) while maintaining a compact parameter budget of 4.43M. Qualitative piano-roll visualizations confirm that our model generates faithful transcriptions even in complex harmonic passages.
Figures & tables
| Dataset | Train | Validation | Test |
|---|---|---|---|
| MAESTRO [ 10 ] | 962 | 174 | – |
| MAPS [ 9 ] | 23,928 | 2,991 | 2,991 |
| Onset Time (s) | Offset Time (s) | MIDI Pitch |
|---|---|---|
| 0.988281 | 1.111979 | 34 (A#1) |
| 1.109375 | 1.135417 | 53 (F3) |
| 1.109375 | 1.161458 | 62 (D4) |
| 1.153646 | 1.196615 | 58 (A#3) |
| 1.518229 | 1.549479 | 74 (D5) |
| 1.527344 | 1.563802 | 62 (D4) |
| Model Architecture | Parameters | Precision | Recall | Accuracy (%) | F1-score (%) |
| LSTM (Base Model) [ 22 ] | 1.59M | 0.76 | 0.66 | 55.20 | 71.20 |
| Bidirectional LSTM | 4.24M | 0.77 | 0.74 | 61.20 | 75.98 |
| LSTM–Attention | 1.66M | 0.74 | 0.75 | 59.80 | 74.80 |
| Bidirectional LSTM–Attention | 4.35M | 0.80 | 0.83 | 69.50 | 82.00 |
| Attention–LSTM | 1.66M | 0.80 | 0.84 | 69.80 | 82.20 |
| Attention–Bidirectional LSTM | 4.35M | 0.84 | 0.88 | 75.50 | 86.10 |
Automatic Music Transcription
Automatic music transcription converts recorded music into symbolic notes, rhythms, instruments, and sometimes readable scores or tablature.
See all 35 papers