Modular PyTorch pipeline for Automatic Chord Recognition (ACR) designed around structured chord decomposition, cross-layer parameter sharing, long-tailed loss handling, and uncertainty-based Active Learning.
CQT Frames (B, T, 252)
-> Input Projection + LayerNorm
-> Parameter-Shared Conformer Encoder (N recurrent blocks)
-> 5 Structured Classification Heads (Root, Bass, Triad, 7th, Extension)
-> Symbol Reassembly (e.g. C:maj, A:min7, G:7/B)
- Parameter-Shared Conformer (
chord_pipeline.models.conformer): Reuses a single Conformer block across depth to reduce parameter count while preserving multi-scale spectral-temporal modeling. - Structured Chord Taxonomy (
chord_pipeline.taxonomy): Decomposes Harte-style chord labels into 5 independent heads (root,bass,triad,seventh,extension) with enharmonic normalization. - Long-Tail & Multi-Task Losses (
chord_pipeline.losses): Combines multi-classFocalLossfor rare chord qualities withGradNormWeighter(Chen et al., ICML 2018) for adaptive task balancing. - Active Learning (
chord_pipeline.active_learning): Supports predictive entropy and margin-confidence ranking to select informative unlabeled frames, plus confidence-thresholded pseudo-labeling.
uv sync --extra dev
uv run pytest -vRun a synthetic training smoke benchmark:
uv run python -m chord_pipeline.train --steps 10Run with Docker:
docker build -t chord-recognition-pipeline .
docker run --rm chord-recognition-pipeline --steps 10- Gulati et al., Conformer: Convolution-augmented Transformer for Speech Recognition (Interspeech 2020)
- Park et al., A Bi-Directional Transformer for Musical Chord Recognition (ISMIR 2019)
- Lin et al., Focal Loss for Dense Object Detection (ICCV 2017)
- Chen et al., GradNorm: Gradient Normalization for Adaptive Loss Balancing in Deep Multitask Networks (ICML 2018)