A Bi-Directional Transformer for Musical Chord Recognition

Jonggwon Park, Kyoyun Choi, Sungwook Jeon, Dokyun Kim, Jonghun Park

Introduction

Automatic Chord Recognition (ACR) is the process of extracting a time-synchronized sequence of chord labels—such as "C Major" or "G7"—from raw audio data. This task is fundamental to music information retrieval but faces significant hurdles. Audio signals are often cluttered with "noise" from non-chord tones (passing tones or decorative flourishes), and the identity of a chord is frequently dependent on its surrounding temporal context.

The task of Automatic Chord Recognition: mapping raw audio to a sequence of chord labels.

Traditional ACR models typically utilize Convolutional Neural Networks (CNNs) for local feature extraction or Recurrent Neural Networks (RNNs) for temporal dependencies. However, these often require complex post-processing steps, such as Hidden Markov Models (HMMs) or Conditional Random Fields (CRFs), to smooth the output sequence. Researchers from Seoul National University have introduced BTC (Bi-directional Transformer for Chord recognition) to address these limitations using a unified self-attention framework.

The BTC Architecture

The BTC model adapts the Transformer architecture, specifically the bi-directional approach popularized by models like BERT, for musical audio. The pipeline consists of several key stages:

  1. Input Processing: The model begins with a Constant-Q Transform (CQT), which provides a frequency analysis aligned with the logarithmic scale of musical pitches.
  2. Bi-directional Self-Attention: Unlike standard Transformers that may only look at past frames, BTC employs bi-directional masking. This allows the model to consider the entire context of a 10-second audio clip when predicting the chord for any given frame.
  3. Position-wise Convolutional Blocks: Replacing the standard fully-connected feed-forward layers found in typical Transformers, BTC uses 1D convolutional blocks. This modification enhances the model's ability to capture local information and smooth transitions between chords.
The BTC architecture, showing the overall pipeline (a) and the internal bi-directional self-attention layer (b).

The model is trained end-to-end in a single phase using a simple negative log-likelihood loss, avoiding the need for complex multi-stage training or separate feature extractors.

Experimental Evaluation

The researchers evaluated BTC across three standard datasets: Isophonics (including the Beatles catalog), Robbie Williams, and UsPop2002. Performance was measured using Weighted Chord Symbol Recall (WCSR) across two label sets: a standard "maj-min" set (25 chords) and a "large vocabulary" set (170 chords).

Key results include:

  • Competitive Performance: On the "maj-min" task, BTC achieved a WCSR of 82.7%, nearly matching the performance of more complex CNN+CRF baselines (83.1%).
  • Large Vocabulary Superiority: BTC outperformed existing baselines in identifying complex chords, such as sevenths, within the 170-chord vocabulary.
  • Internal Smoothing: Analysis of attention maps revealed that the model naturally learns to group adjacent frames sharing the same chord, effectively performing temporal smoothing without an external decoder.

Insights and Future Directions

The primary advantage of BTC lies in its adaptive receptive fields. While CNNs are limited by a fixed window of time, the self-attention mechanism allows BTC to "zoom" in on specific beats or "zoom out" to capture multi-bar harmonic structures.

Despite its success, the model faces challenges with "harmonic overlap." For instance, it may confuse an A Major chord (A, C#, E) with an F# minor chord (F#, A, C#) due to their shared notes. Future research may focus on refining the model's handling of these overlapping pitch sets or extending the audio window to capture even broader musical structures like verses and choruses.

Summary updated

BibTeX
@inproceedings{park2019bi,
  author = {Jonggwon Park and Kyoyun Choi and Sungwook Jeon and Dokyun Kim and Jonghun Park},
  title = {{A Bi-Directional Transformer for Musical Chord Recognition}},
  booktitle = {ISMIR},
  year = {2019},
  url = {https://openreview.net/forum?id=RpboAIuiUy},
}

Loading related content...

Figure