A challenge for detecting beats and downbeats in music audio, with a focus on handling dynamic tempo changes common in rhythm game charts.
Goal
The goal is to detect and identify beats and downbeats in audio to assist composers by providing a flexible timing grid when working with samples that have dynamic BPM changes.
Beat: A regular pulse in music (e.g., quarter notes in 4/4 time)
Downbeat: The first beat of each measure (the "1" in counting "1-2-3-4")
This is particularly useful for:
Music production with samples of varying tempos
Rhythm game chart creation and verification
Audio analysis and music information retrieval (MIR)
Dataset
The dataset is derived from Taiko no Tatsujin rhythm game charts, providing high-quality human-annotated beat and downbeat ground truth.
Dynamic BPM: Many tracks feature tempo changes mid-song
Variable Time Signatures: Common patterns include 4/4, 3/4, 6/8, and more exotic meters
Diverse Genres: Japanese pop, anime themes, classical arrangements, electronic music
High-Quality Annotations: Derived from professional rhythm game charts
Evaluation Metrics
The evaluation considers both timing accuracy and metrical correctness. Models are evaluated on both beat and downbeat detection tasks.
Primary Metrics
1. Weighted F1-Score (Main Ranking Metric)
F1-scores are calculated at multiple timing thresholds (3ms to 30ms), then combined with inverse-threshold weighting:
Threshold
Weight
Rationale
3ms
1.000
Full weight for highest precision
6ms
0.500
Half weight
9ms
0.333
One-third weight
12ms
0.250
...
15ms
0.200
18ms
0.167
21ms
0.143
24ms
0.125
27ms
0.111
30ms
0.100
Minimum weight for coarsest threshold
Formula:
Weighted F1 = Σ(w_t × F1_t) / Σ(w_t)
where w_t = 3ms / t (inverse threshold weighting)
This weighting scheme rewards models that achieve high precision at tight tolerances while still considering coarser thresholds.
2. Continuity Metrics (CMLt, AMLt)
Based on the MIREX beat tracking evaluation protocol using mir_eval:
Metric
Full Name
Description
CMLt
Correct Metrical Level Total
Percentage of beats correctly tracked at the exact metrical level (±17.5% of beat interval)
AMLt
Any Metrical Level Total
Same as CMLt, but allows for acceptable metrical variations (double/half tempo, off-beat)
CMLc
Correct Metrical Level Continuous
Longest continuous correctly-tracked segment at exact metrical level
AMLc
Any Metrical Level Continuous
Longest continuous segment at any acceptable metrical level
Note: Continuity metrics use a default min_beat_time=5.0s (skipping the first 5 seconds) to avoid evaluating potentially unstable tempo at the beginning of tracks.
Results evaluated on 100 tracks from the test set:
Model
Combined F1
Beat F1
Downbeat F1
CMLt (Beat)
CMLt (Downbeat)
Baseline 1 (ODCNN)
0.0765
0.0861
0.0669
0.0731
0.0321
Baseline 2 (ResNet-SE)
0.2775
0.3292
0.2258
0.3287
0.1146
Note: Baseline 2 (ResNet-SE) demonstrates significantly better performance due to larger context window and deeper architecture.
Quick Start
Setup
uv sync
Train Models
bash
1# Train Baseline 1 (ODCNN)2uv run -m exp.baseline1.train
34# Train Baseline 2 (ResNet-SE)5uv run -m exp.baseline2.train
67# Train specific target only (e.g. for Baseline 2)8uv run -m exp.baseline2.train --target beats
9uv run -m exp.baseline2.train --target downbeats
Run Evaluation
bash
1# Evaluation (replace baseline1 with baseline2 to evaluate the new model)2uv run -m exp.baseline1.eval
34# Full evaluation with visualization and audio5uv run -m exp.baseline1.eval --visualize --synthesize --summary-plot
67# Evaluate on more samples with custom output directory8uv run -m exp.baseline1.eval --num-samples 50 --output-dir outputs/eval_baseline1
Evaluation Options
Option
Description
Option
Description
--------
-------------
--model-dir DIR
Model directory (default: outputs/baseline1)
--num-samples N
Number of samples to evaluate (default: 20)
--output-dir DIR
Output directory (default: outputs/eval)
--visualize
Generate visualization plots for each track
--synthesize
Generate audio files with click tracks
--viz-tracks N
Number of tracks to visualize/synthesize (default: 5)
--time-range START END
Limit visualization time range (seconds)
--click-volume FLOAT
Click sound volume (0.0 to 1.0, default: 0.5)
--summary-plot
Generate summary evaluation bar charts
Visualization & Audio Tools
Beat Visualization
Generate plots comparing predicted vs ground truth beats:
uv run -m exp.baseline1.eval --visualize --viz-tracks 10
Output: outputs/eval/plots/track_XXX.png
Click Track Audio
Generate audio files with click sounds overlaid on the original music: