Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions submissions/bjork-gudmundsdottir-dual/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Transcribe twice and follow

Team Björk Guðmundsdóttir (Matthias Nagl, Klaus Lex, Kevin Eberl), Music
Informatics WS26, JKU Linz.

An audio score follower in two steps, like our first submission
(`bjork-gudmundsdottir`): piano transcription turns the audio into notes while
it arrives, and a symbolic follower aligns those notes to the score. What is
new is that two transcribers run side by side. The slower one decides where
in the score the performer is, the faster one decides when the next chord
comes.

## Why two transcribers

A transcriber that looks 5 frames ahead finds notes reliably, but it knows a
note only about 166 ms after it is played. Our first submission bridges that
delay by moving on at the followed tempo between notes. A transcriber without
lookahead knows a note after 46 ms, but when we followed its notes alone, the
follower lost some validation pieces in the first seconds: it ran ahead on
the first few chords, and a follower that only moves forward cannot undo
that. Here the fast notes never move the follower itself. They only time the
chords that come after the slow follower's last chord.

## How it works

1. **Transcription** (`DualProcessor` in `solution.py`). One log-filtered
spectrogram (4096-sample window, hop 882, 50 frames per second, the same
features as madmom's note CNN) is computed one frame at a time and fed to
two networks of our own transcriber (`transcriber_b/stream.py`, numpy).
Both have the same architecture: 5 blocks of 3x3 convolutions, a
one-directional GRU with 256 units, and sigmoid heads for onset, sounding
note and offset of the 88 keys (1.5 million parameters).
- `anchor.npz`: each convolution block sees one future frame, so 5
frames of lookahead. A note starts where the onset activation of a key
is at least 0.5, higher than one frame earlier and at least as high as
one frame later, and the key has not started a note in the last 50 ms.
Onsets are final 166 ms after their frame.
- `fast.npz`: no lookahead. The same rule without the condition on the
next frame. Onsets are final 46 ms after their frame (half the window).

Every onset keeps the time of the frame it belongs to.
2. **Following where** (`TranscriptionFollower`, unchanged from
`bjork-gudmundsdottir`). The anchor's onsets within 35 ms of the first
note of a chord form one chord, as in Matchmaker's `ChordOnsetProcessor`.
Each chord goes to Matchmaker's `OnlineTimeWarpingArztEvent` with the
settings of Matchmaker's MIDI `arzt` follower.
3. **Following when** (`DualFollower`). The fast onsets are grouped into
chords at their first note (35 ms). Every fast chord that starts more than
35 ms after the anchor's last chord moves the reported position one score
chord further than the anchor's last chord. When the anchor takes its next
chord, the count starts again from there, so a wrong fast note only
matters until then.
4. **Reported position.** From the last chord (fast or anchor), the position
moves on at the tempo the anchor followed over the last 4 seconds (at most
8 beats per second, for at most 1.5 seconds after the chord), as in
`bjork-gudmundsdottir`.

## Validation fold

One run of the benchmark's own runner on the 20 validation performances,
seed 0 pair (the pair we fixed before running it):

| | Tracked | Mean of per-piece median beat errors | Within 0.1 beat | Within 0.05 beat |
|---|---|---|---|---|
| `bjork-gudmundsdottir` | 20/20 | 0.085 | 0.667 | 0.470 |
| this submission | 20/20 | 0.023 | 0.792 | 0.733 |

Real-time factor about 0.13 (two pieces at a time on a 2-core machine). The rule that combines the two transcribers was designed after we had seen
validation results of the fast transcriber alone, so these numbers are not an
unbiased estimate. No setting was tuned on the validation fold: the onset
thresholds come from the MAESTRO validation split, everything else from
`bjork-gudmundsdottir`. The output jumps from chord to chord more than our
first submission's, so it is less smooth.

## Training data

Both networks were trained by us on the MAESTRO v3.0.0 train split only. The
MAESTRO validation split chose the checkpoint (best onset F1) and the onset
threshold (0.5 for both). ASAP's audio are MAESTRO recordings: all 42 ASAP
recordings of the benchmark folds (10 valid, 32 eval) are in MAESTRO's test
split, listed in `asap_in_maestro.csv` with their MAESTRO file names. That
split was never prepared or read, and our data preparation stops if any of
the 42 appears in the train or validation split. We used MAESTRO with the
agreement of the course instructor. Batik and Vienna 4x22 are not part of
MAESTRO.

## Files

| File | What it is | Licence |
|---|---|---|
| `solution.py` | Processor, both followers and registration | Apache-2.0 |
| `transcriber_b/` | Our transcriber's spectrogram and frame-by-frame numpy network | Apache-2.0 |
| `anchor.npz` | Weights of the network with lookahead, trained by us | CC BY-NC-SA 4.0 |
| `fast.npz` | Weights of the network without lookahead, trained by us | CC BY-NC-SA 4.0 |
| `settings.json` | Both onset thresholds and the weights' sha256 | |
| `asap_in_maestro.csv` | The 42 benchmark recordings in MAESTRO's test split | |
| `requirements.txt` | No dependencies beyond the benchmark environment | |

The weights carry CC BY-NC-SA 4.0 because MAESTRO, their training data, is
licensed under it.

## References

- C. Hawthorne et al. Enabling Factorized Piano Music Modeling and Generation
with the MAESTRO Dataset. ICLR 2019.
- C. Hawthorne et al. Onsets and Frames: Dual-Objective Piano Transcription.
ISMIR 2018. (Our sounding-note head also gets the onset probabilities, as
there.)
- R. Kelz, S. Böck and G. Widmer. Deep Polyphonic ADSR Piano Note
Transcription. ICASSP 2019. (The spectrogram features.)
Binary file added submissions/bjork-gudmundsdottir-dual/anchor.npz
Binary file not shown.
43 changes: 43 additions & 0 deletions submissions/bjork-gudmundsdottir-dual/asap_in_maestro.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
fold,piece_id,maestro_audio_stem,maestro_split
valid,asap/Piano_Sonatas_10-1/Hou02M,MIDI-Unprocessed_09_R1_2011_MID--AUDIO_R1-D3_13_Track13_wav,test
valid,asap/Prelude_bwv_862/Song04M,MIDI-Unprocessed_13_R1_2008_01-04_ORIG_MID--AUDIO_13_R1_2008_wav--1,test
valid,asap/Prelude_bwv_891/Duepree06M,MIDI-Unprocessed_03_R1_2008_01-04_ORIG_MID--AUDIO_03_R1_2008_wav--1,test
valid,asap/Fugue_bwv_858/VuV01M,MIDI-Unprocessed_R1_D1-1-8_mid--AUDIO-from_mp3_02_R1_2015_wav--1,test
valid,asap/Prelude_bwv_863/LeeN01M,MIDI-Unprocessed_R1_D1-1-8_mid--AUDIO-from_mp3_07_R1_2015_wav--1,test
valid,asap/Piano_Sonatas_5-1/Colafelice02M,MIDI-Unprocessed_23_R1_2011_MID--AUDIO_R1-D9_03_Track03_wav,test
valid,asap/Fugue_bwv_863/Shychko01M,MIDI-Unprocessed_11_R1_2011_MID--AUDIO_R1-D4_07_Track07_wav,test
valid,asap/Transcendental_Etudes_10/CaoJ03M,MIDI-Unprocessed_065_PIANO065_MID--AUDIO-split_07-07-17_Piano-e_3-01_wav--3,test
valid,asap/Prelude_bwv_873/Lisiecki13M,MIDI-Unprocessed_11_R3_2008_01-04_ORIG_MID--AUDIO_11_R3_2008_wav--1,test
valid,asap/Transcendental_Etudes_3/Huang14M,MIDI-Unprocessed_04_R3_2008_01-07_ORIG_MID--AUDIO_04_R3_2008_wav--3,test
eval,asap/Fugue_bwv_858/Zhang01M,MIDI-Unprocessed_07_R1_2011_MID--AUDIO_R1-D3_02_Track02_wav,test
eval,asap/Fugue_bwv_862/Song04M,MIDI-Unprocessed_13_R1_2008_01-04_ORIG_MID--AUDIO_13_R1_2008_wav--1,test
eval,asap/Fugue_bwv_863/LeeN01M,MIDI-Unprocessed_R1_D1-1-8_mid--AUDIO-from_mp3_07_R1_2015_wav--1,test
eval,asap/Fugue_bwv_863/TongB01M,MIDI-Unprocessed_056_PIANO056_MID--AUDIO-split_07-07-17_Piano-e_1-05_wav--1,test
eval,asap/Fugue_bwv_873/Lisiecki13M,MIDI-Unprocessed_11_R3_2008_01-04_ORIG_MID--AUDIO_11_R3_2008_wav--1,test
eval,asap/Fugue_bwv_891/Duepree06M,MIDI-Unprocessed_03_R1_2008_01-04_ORIG_MID--AUDIO_03_R1_2008_wav--1,test
eval,asap/Prelude_bwv_858/VuV01M,MIDI-Unprocessed_R1_D1-1-8_mid--AUDIO-from_mp3_02_R1_2015_wav--1,test
eval,asap/Prelude_bwv_858/Zhang01M,MIDI-Unprocessed_07_R1_2011_MID--AUDIO_R1-D3_02_Track02_wav,test
eval,asap/Prelude_bwv_863/Shychko01M,MIDI-Unprocessed_11_R1_2011_MID--AUDIO_R1-D4_07_Track07_wav,test
eval,asap/Prelude_bwv_863/TongB01M,MIDI-Unprocessed_056_PIANO056_MID--AUDIO-split_07-07-17_Piano-e_1-05_wav--1,test
eval,asap/Prelude_bwv_891/BLINOV04M,MIDI-Unprocessed_XP_03_R1_2004_01-02_ORIG_MID--AUDIO_03_R1_2004_01_Track01_wav,test
eval,asap/Piano_Sonatas_12-1/Kleisen05M,MIDI-Unprocessed_06_R1_2008_01-04_ORIG_MID--AUDIO_06_R1_2008_wav--2,test
eval,asap/Piano_Sonatas_16-1/BuiJL02M,MIDI-Unprocessed_046_PIANO046_MID--AUDIO-split_07-06-17_Piano-e_2-02_wav--2,test
eval,asap/Piano_Sonatas_16-1/Khmara05M,MIDI-Unprocessed_05_R1_2008_01-04_ORIG_MID--AUDIO_05_R1_2008_wav--2,test
eval,asap/Piano_Sonatas_16-1/LeeSH02M,MIDI-Unprocessed_049_PIANO049_MID--AUDIO-split_07-06-17_Piano-e_2-06_wav--2,test
eval,asap/Piano_Sonatas_16-1/Woo05M,MIDI-Unprocessed_17_R1_2008_01-04_ORIG_MID--AUDIO_17_R1_2008_wav--2,test
eval,asap/Piano_Sonatas_18-4/ChenGuang06M,MIDI-UNPROCESSED_04-05_R1_2014_MID--AUDIO_04_R1_2014_wav--2,test
eval,asap/Piano_Sonatas_18-4/KOLESO06M,MIDI-Unprocessed_XP_15_R1_2004_03_ORIG_MID--AUDIO_15_R1_2004_03_Track03_wav,test
eval,asap/Piano_Sonatas_3-2/MiyashitaM04M,MIDI-Unprocessed_R1_D1-9-12_mid--AUDIO-from_mp3_09_R1_2015_wav--2,test
eval,asap/Piano_Sonatas_5-1/SunD02M,MIDI-Unprocessed_R1_D2-13-20_mid--AUDIO-from_mp3_16_R1_2015_wav--2,test
eval,asap/Piano_Sonatas_8-3/Na06M,MIDI-Unprocessed_09_R1_2009_01-04_ORIG_MID--AUDIO_09_R1_2009_09_R1_2009_03_WAV,test
eval,asap/Piano_Sonatas_9-3/Tysman05M,MIDI-Unprocessed_17_R1_2009_01-03_ORIG_MID--AUDIO_17_R1_2009_17_R1_2009_01_WAV,test
eval,asap/Etudes_op_10_12/Bult-ItoS04M,MIDI-Unprocessed_R1_D1-1-8_mid--AUDIO-from_mp3_05_R1_2015_wav--4,test
eval,asap/Etudes_op_10_12/HuNY03M,MIDI-Unprocessed_R1_D2-21-22_mid--AUDIO-from_mp3_22_R1_2015_wav--3,test
eval,asap/Etudes_op_10_12/LuoJ08M,MIDI-Unprocessed_R1_D1-1-8_mid--AUDIO-from_mp3_06_R1_2015_wav--6,test
eval,asap/Etudes_op_10_12/WuuE06M,MIDI-Unprocessed_R1_D1-9-12_mid--AUDIO-from_mp3_11_R1_2015_wav--3,test
eval,asap/Etudes_op_10_12/ZhangYunling02M,MIDI-Unprocessed_07_R1_2011_MID--AUDIO_R1-D3_03_Track03_wav,test
eval,asap/Transcendental_Etudes_10/Huang17M,MIDI-Unprocessed_04_R3_2008_01-07_ORIG_MID--AUDIO_04_R3_2008_wav--6,test
eval,asap/Transcendental_Etudes_10/LeungM06M,MIDI-Unprocessed_Recital17-19_MID--AUDIO_19_R1_2018_wav--3,test
eval,asap/Preludes_op_23_6/Nikiforov14M,MIDI-Unprocessed_12_R3_2008_01-04_ORIG_MID--AUDIO_12_R3_2008_wav--3,test
eval,asap/Toccata/DupreeF13M,MIDI-UNPROCESSED_19-20_R1_2014_MID--AUDIO_19_R1_2014_wav--8,test
eval,asap/Toccata_repeat/WangY07M,MIDI-UNPROCESSED_11-13_R1_2014_MID--AUDIO_13_R1_2014_wav--4,test
Binary file added submissions/bjork-gudmundsdottir-dual/fast.npz
Binary file not shown.
47 changes: 47 additions & 0 deletions submissions/bjork-gudmundsdottir-dual/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Transcribe twice and follow (two streaming transcribers + event OLTW)
authors:
- Matthias Nagl
- Klaus Lex
- Kevin Eberl
affiliation: Johannes Kepler University Linz (Music Informatics WS26)
input_type: audio
description: >
Two causal piano transcribers of our own, computed frame by frame in numpy,
turn the audio into notes while it arrives. One looks 5 frames ahead (notes
final after 166 ms), the other does not (notes final after 46 ms).
Matchmaker's event-level online time warping on the slower, more reliable
notes decides where in the score the performer is, as in our first
submission (bjork-gudmundsdottir). The faster notes only decide when the
next chords come: each new fast chord moves the position one score chord
past the slow follower's last chord, until the slow follower takes its next
chord. Between notes the position moves on at the followed tempo.
license: Apache-2.0 for the code. anchor.npz and fast.npz hold weights we trained on MAESTRO v3, under CC BY-NC-SA 4.0 because of the training data, see README.md.

# How this submission was developed.
tuned_on: [valid]
external_data: >
Both transcribers are trained by us on the MAESTRO v3.0.0 train split only
(Hawthorne et al., ICLR 2019), with the MAESTRO validation split for early
stopping and the onset thresholds. ASAP's audio are MAESTRO recordings: all
42 ASAP recordings of the benchmark folds (10 valid, 32 eval) are in
MAESTRO's test split, listed in asap_in_maestro.csv. That split was never
prepared or read, and our data preparation stops if any of the 42 appears in
the train or validation split. We used MAESTRO with the agreement of the
course instructor. No other data.

# Required declaration. See docs/eval-protocol.md.
eval_fold_untouched: true

notes: >
numpy only, weights load from two npz files (5.6 MB each, 1.5 million
parameters per network) at import. Real-time factor about 0.13 on the
validation fold (two pieces at a time on a 2-core machine). Validation fold,
one run: 20 of 20 performances tracked, mean of the per-piece median beat
errors 0.023 beats (bjork-gudmundsdottir: 0.085). The rule that combines the
two transcribers was designed after we had seen validation results of the
fast transcriber alone, which lost pieces at the start, so the validation
numbers are not an unbiased estimate. It adds no new settings: the onset
thresholds come from the MAESTRO validation split and the follower settings
from bjork-gudmundsdottir. We trained three seeds of each network. The
submitted pair (seed 0) was fixed before the combination was run on the
validation fold.
1 change: 1 addition & 0 deletions submissions/bjork-gudmundsdottir-dual/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# No dependencies beyond the benchmark environment (numpy only).
24 changes: 24 additions & 0 deletions submissions/bjork-gudmundsdottir-dual/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"anchor": {
"onset_threshold": 0.5,
"onset_rule": "peak",
"weights": "transcriber_b/weights/maestro-seed0.npz",
"weights_sha256": "9a53dca7cadf81e1b45c298300a415c64e496cda8d6399829ffd0964f23923cc",
"dev_summary": "transcriber_b/runs/dev_eval/maestro-seed0/summary.json",
"run": "maestro-seed0",
"epoch": 79,
"seed": 0,
"lookahead_frames": 5
},
"fast": {
"onset_threshold": 0.5,
"onset_rule": "rising",
"weights": "transcriber_b/weights/maestro_la0-seed0.npz",
"weights_sha256": "60475fc7d10e0bfed8bbe4be7e882cb34d7b875b8ec5b759b37902e5cf81fa25",
"dev_summary": "transcriber_b/runs/dev_eval/maestro_la0-seed0/summary.json",
"run": "maestro_la0-seed0",
"epoch": 76,
"seed": 0,
"lookahead_frames": 0
}
}
Loading
Loading