Skip to content

benchmarks/idmt-first-run - #335

Open
bellescoincidences wants to merge 68 commits into
mainfrom
benchmarks/idmt-first-run
Open

bellescoincidences wants to merge 68 commits into
mainfrom
benchmarks/idmt-first-run

Conversation

@bellescoincidences

@bellescoincidences bellescoincidences commented Sep 24, 2026 •

Copy link
Copy Markdown

Summary

Continues #321, which established the first reproducible IDMT baseline and
identified kick recall as the standout weakness (R = 0.285, "missing ~95%" on
acoustic RealDrum).

This PR diagnoses that failure and fixes it with a single constant change:
KICK_LFER_MIN lowered from 0.32 to 0.08. Also adds the diagnostic tooling
used to arrive at that value.

Diagnosis

31 of 95 IDMT tracks scored a kick F-measure of exactly 0.000, while precision
was frequently exactly 1.000 wherever the rule fired. That signature indicates a
rule that is correct whenever it fires but almost never fires.

Stage attribution across a controlled three-track comparison:

Stage Count
no_onset 0
gated 0
misclassified 22
ok 14

Onset detection was not at fault. Every reference kick was detected. All 22
losses occurred at classification, all on the same condition: lfer_low. Peak
frequency passed in every case (43–65 Hz). The lost kicks were labelled as open
hi-hat (12) or closed hi-hat (10).

Root cause

LFER is the proportion of spectral energy below 150 Hz - a ratio, so sensitive
to whatever else occupies the analysis window.

KICK_LFER_MIN was calibrated on isolated drum stems, where the denominator
holds little but the kick. In mixed audio a simultaneous hi-hat adds
high-frequency energy to the denominator while contributing nothing to the
numerator.

Across 5,387 annotated IDMT onsets:

Group n Median LFER Max
With kick reference 2,096 0.2131 0.8240
Without kick reference 3,291 0.0205 0.4953

The threshold of 0.32 sat above the median of the class it was meant to
detect
.

Threshold selection

Grid sweep over 420 combinations of KICK_FREQ_MIN, KICK_FREQ_MAX and
KICK_LFER_MIN, scored against all 5,387 onsets. Holding the frequency band at
its live 40–140 Hz:

KICK_LFER_MIN Precision Recall F
0.32 (live) 0.893 0.279 0.425
0.18 0.834 0.586 0.688
0.12 0.813 0.785 0.799
0.08 0.784 0.890 0.834
0.05 0.745 0.923 0.825

(Onset-level micro-averages, not directly comparable to the track-level
macro-averages reported below.)

The best combination overall (0–180 Hz, LFER 0.08) scored F = 0.855. Rejected.
A lower bound of 0 Hz only scores well because it admits onsets with a measured
peak frequency of 0 Hz, a measurement artefact rather than a drum. Raising the
upper bound to 180 Hz extends the kick band into the snare band (starts at
120 Hz) and the tom buckets, which append labels additively rather than
exclusively. A gain of 0.021 did not justify that coupling.

Frequency bounds unchanged. One constant moved.

Results: IDMT-SMT-Drums V2

Same setup as #321 - 95 #MIX files, 50 ms onset window, macro-average across
items.

Instrument P (#321) P (now) R (#321) R (now) F (#321) F (now)
Kick (KD) 0.628 0.823 0.285 0.863 0.342 0.810
Snare (SD) 0.732 0.732 0.775 0.775 0.720 0.720
Hi-hat (HH) 0.834 0.834 0.948 0.948 0.878 0.878

Snare and hi-hat are unchanged to four decimal places.

By subset, against the table in #321:

RealDrum TechnoDrum WaveDrum
KD F (#321) 0.088 0.657 0.344
KD F (now) 0.907 0.789 0.794
SD F 0.779 → 0.779 0.662 → 0.662 0.718 → 0.718
HH F 0.935 → 0.935 0.857 → 0.857 0.870 → 0.870

#321 called out acoustic RealDrum as the worst case at KD F = 0.088. It is now
the best subset at 0.907.

Zero-scoring kick tracks: 31 / 95 → 0 / 95. Kick estimates 2,376 against
2,179 references - slight over-detection replaces severe under-detection.

Results: MDB-Drums (23 tracks)

Re-run specifically to test for collateral damage, since the tom rule suppresses
low_tom whenever kick has already been appended to the same event - a
regression IDMT cannot detect, as it does not annotate toms.

Instrument Before After Change
Kick 0.397 0.721 +0.323
Snare 0.590 0.590 0.000
Closed hat 0.521 0.521 0.000
Open hat 0.074 0.074 0.000
Low / mid / high tom 0.000 0.000 0.000
Crash 0.091 0.091 0.000
Ride 0.000 0.000 0.000

No regression occurred, though not for the reason anticipated: the tom rules
produce zero estimates in both runs, so there was nothing to suppress.

MDB kick precision fell slightly, 0.690 → 0.663, while recall rose 0.341 →
0.852. Three previously near-perfect tracks now over-fire: Beatles
(0.990 → 0.847), Hendrix (1.000 → 0.810), Rockabilly (0.960 → 0.684). Five moved
from non-functional to working: Shadows (0.000 → 0.852), FreeJazz
(0.103 → 0.739), Disco (0.033 → 0.696), LatinJazz (0.000 → 0.659), BebopJazz
(0.000 → 0.657).

Tooling added

  • analyze_idmt_dataset.py: --diagnose-kick (per-reference stage attribution
    plus which rule condition failed), per-onset feature capture, and a threshold
    grid sweep (--sweep-csv, --top) that scores candidate rules without
    re-processing audio.
  • Two guards against sample artefacts: a warning when a sample contains no
    non-kick onsets, and a warning when the best candidate produces zero false
    positives. Both fire on small samples where F = 1.000 is structural rather
    than real.

Not in scope

#321 noted that IDMT lacks crash/ride/tom coverage, which is why MDB-Drums was
added. With MDB now running, the gap is measurable: ride has 835 reference
annotations and has never produced a single estimate; toms have 64 references
and likewise produce none. These are unreachable rules rather than mis-tuned
thresholds, and now represent a larger gap than the one closed here.

Testing

  • IDMT full benchmark re-run (95 tracks), compared against the benchmarks/idmt-first-run #321 baseline.
  • MDB full benchmark re-run (23 tracks), before/after across all nine annotated
    classes.
  • No change to any instrument other than kick on either dataset.
  • in progress full unit tests
  • in progress E2E test

Housekeeping
in progress - Write up of work forthcoming and I will add results to this PR before merging
[DONE]: Updated CHANGELOG.md and added these changes to the Unreleased section

cc @nanaoto - this builds directly on the adapter you contributed.

…puts by drum part, with unsorted assuming the default mode
…metrics functionaly in idmt analysis outputs
…sing 70% KD to lower_bound freq 43.1. Updating constants.py for KICK_RANGE to reflect and test
… lower ranges returned zero improvement in post-evaluation idmt mir_eval re-run
…r rather than previous (named DRUMSCRIPT_TO_CODE)
@victoria-mckinney

Copy link
Copy Markdown
Member

NOTE: Relates to #336 and [#330 ](#330

@victoria-mckinney victoria-mckinney mentioned this pull request Sep 29, 2026
13 tasks
@victoria-mckinney

Copy link
Copy Markdown
Member

I am leaving this open for now as I want to cut a new release for the KICK_LFER_MAIN amendments above, but I want to check the results with ENST too before publishing to pypi. I also dont want code on main to drift from latest pypi release.

…yze_idmt_dataset (changed to DRUMSCRIPT_DICT)
…lyze_idmt_dataset (changed to DRUMSCRIPT_DICT)
…ch the unzipped native folder nameof the source dataset used for benchmarking (as stored in DrumScript/benchmarks/datasets)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

benchmarking Issues related to evaluating Automatic Drum Transcription (ADT) using the mir_eval library build Required in build stage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(benchmarkng): update attributions to MBD, ENST and IDMT

3 participants