Skip to content

About

PyTorch Automatic Chord Recognition pipeline with parameter-shared Conformer, structured chord decomposition, Focal Loss, GradNorm, and uncertainty-based Active Learning.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Chord Recognition Pipeline

CI Python 3.11 PyTorch License: MIT

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.


Architecture

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)

Key Components

  • 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-class FocalLoss for rare chord qualities with GradNormWeighter (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.

Quick Start

uv sync --extra dev
uv run pytest -v

Run a synthetic training smoke benchmark:

uv run python -m chord_pipeline.train --steps 10

Run with Docker:

docker build -t chord-recognition-pipeline .
docker run --rm chord-recognition-pipeline --steps 10

References

  • 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)

About

PyTorch Automatic Chord Recognition pipeline with parameter-shared Conformer, structured chord decomposition, Focal Loss, GradNorm, and uncertainty-based Active Learning.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages