Conformer-based Ultrasound-to-Speech Conversion
- The paper introduces a conformer architecture that integrates local convolution and global self-attention to capture detailed spectro-temporal features for conversion.
- It employs a chain-conditional random field decoder and structured target decomposition to enforce temporal smoothness and address class imbalance.
- Empirical evaluations show improved frame-wise and class-wise accuracy compared to CNN+BLSTM baselines, highlighting the model’s robust performance.
ChordFormer is a conformer-based neural architecture for large-vocabulary audio chord recognition, specifically designed to address the challenges arising from the long-tail distribution of chord types, the need to model both local spectral detail and long-range harmonic context, and the requirement for structured, musically meaningful chord representations. ChordFormer combines a constant-Q spectrogram frontend, a stack of conformer blocks (hybridizing multi-head self-attention with convolutional modules), and a chain-conditional random field (CRF) decoder. The system outputs a joint prediction over six structured chord components, facilitating precise recognition of complex chord types even in the presence of significant class imbalance (Akram et al., 17 Feb 2025).
1. Motivation and Design Objectives
Chord recognition in music information retrieval involves mapping audio to symbolic chord labels that reflect musical structure. Existing systems have achieved robust accuracy for simple chord vocabularies (e.g., major/minor triads), but large-vocabulary recognition—covering rare extensions and inversions—remains challenging. The rare occurrence of many chord types in available datasets results in pronounced class imbalance, hindering effective learning. ChordFormer is designed to:
- Transcribe audio to rich, structurally decomposed chord labels (root+triad, bass, extensions up to 13th).
- Mitigate the long-tail distribution by leveraging a reweighted loss for underrepresented classes.
- Model both local audio features (voicing, partials) and global dependencies (harmonic progressions).
- Provide structured outputs amenable to music-theoretic interpretation and joint learning across chord components (Akram et al., 17 Feb 2025).
2. Frontend and Feature Representation
ChordFormer accepts audio signals sampled at 22 050 Hz. Inputs are transformed using the Constant-Q Transform (CQT), spanning musical range C1–C8 with 36 bins per octave, resulting in 252 frequency bins per frame. The time step is set by a hop length of 512 samples (approximately 23.2 ms). Spectrogram values are converted to decibel scale using amplitude-to-db normalization (Librosa), then globally normalized. Data augmentation employs pitch shifting by –5 to +6 semitones, applied consistently to both the input spectrogram and the associated chord labels.
For each frame , the chord is represented by a 6-dimensional vector:
where each encodes a musically meaningful component:
| Component () | Category | Classes |
|---|---|---|
| : root+triad | 13 roots × 7 triads + "N" | 92 (including "no-chord") |
| : bass | 12 chroma + "N" | 13 |
| : 7th extension | N, 7, ♭7, ♭♭7 | 4 |
| : 9th extension | N, 9, ♯9, ♭9 | 4 |
| : 11th extension | N, 11, ♯11 | 3 |
| : 13th extension | N, 13, ♭13 | 3 |
This structured target reduces the large-vocabulary classification problem to six smaller multiclass subproblems, reflecting hierarchical relationships in music theory and facilitating parameter sharing (Akram et al., 17 Feb 2025).
3. Conformer Block Architecture
The core of ChordFormer consists of 0 conformer blocks operating on a feature dimension 1. The conformer block fuses local and global modeling via the following sequence:
- Input Projection: The CQT spectrogram (252 bins) is linearly projected to 256 dimensions.
- Half-Step Feed-Forward Module: A position-wise feed-forward network (FFN) with Swish activation, pre-norm, dropout, and a half-step residual connection:
2
- Multi-Head Self-Attention (MHSA): With relative sinusoidal positional encodings. For 3 heads:
4
The output is added residually:
5
- Convolution Module: Pre-normed, pointwise convolution (with Gated Linear Units), a depthwise 1-D convolution (kernel size 31), batch normalization, Swish activation, dropout, and residual addition:
6
- Second FFN & LayerNorm: Another half-step FFN with Swish, followed by layer normalization:
7
The conformer structure enables robust local feature extraction via convolution and global temporal context through self-attention, surpassing the modeling limits of CNN-, LSTM-, or transformer-only configurations (Akram et al., 17 Feb 2025).
4. Output Decoding and Temporal Smoothing
The output sequence (shape 8) is linearly projected to six logit vectors 9, one per chord component. Component-wise softmax yields probabilities:
0
To enforce temporal smoothness, a chain-CRF decoder replaces naïve argmax decoding. The sequence probability is:
1
where
2
3
This approach encourages label stability across adjacent frames, consistent with the piecewise-constant nature of chord sequences in music (Akram et al., 17 Feb 2025).
5. Reweighted Loss and Class Imbalance Mitigation
Given the substantial imbalance in chord-label frequencies, ChordFormer employs a reweighted cross-entropy loss:
4
Class weights are defined as:
5
where 6 is the count of samples for class 7 in component 8, 9 is a balancing exponent favoring rare classes, and 0 caps the maximum weight. Empirical results indicate optimal class-wise accuracy at 1, 2. These settings amplify gradient contributions from rare chord types and elevate class-wise accuracy while minimally affecting frame-wise accuracy. Ablations confirm that the architecture is robust even under aggressive reweighting, preserving major/minor accuracy while boosting performance on rare extensions (Akram et al., 17 Feb 2025).
6. Training, Evaluation, and Comparative Analysis
Training utilizes the AdamW optimizer (initial learning rate 3, plateau scheduler), with early stopping once the learning rate drops below 4. Batches comprise randomly sampled 1 000-frame segments (≈23.2 s) from songs; mini-batch size is 24. Regularization includes dropout (rate 50.1 in all sublayers), batch normalization in convolution modules, and pre-norm residual connections.
On the Humphrey–Bello corpus (1 217 songs; 5-fold cross-validation), ChordFormer achieves:
- Frame-wise accuracy: 78.77%
- Class-wise accuracy: 38.84%
- MIREX score: 83.62% In contrast, a CNN+BLSTM baseline yields 76.76%/33.15%/81.52%, respectively. Metric breakdowns indicate Root: 84.69%, Maj/Min: 84.09%, Triads: 77.55%, Sevenths: 72.28%. Confusion matrices show reduced misclassifications for extensions and rare chords, corresponding to effective local/global modeling and reweighted learning. Module ablations confirm that the conformer block delivers superior triad/extension recall over CNN-, transformer-, and BLSTM-based variants (Akram et al., 17 Feb 2025).
7. Architectural Significance and Empirical Insights
ChordFormer demonstrates that the fusion of convolution and self-attention within conformer blocks effectively unifies short- and long-range sequence modeling, addressing the core requirements of structural chord recognition. The structured decomposition of chord labels facilitates semantically meaningful parameter sharing and interpretable outputs. The introduction of a reweighted cross-entropy loss successfully mitigates performance degradation on low-frequency chord classes, a persistent issue in large-vocabulary regimes.
A plausible implication is that further advances in large-vocabulary symbolic music tasks may benefit from similar decompositions and hybrid modeling. The empirical gains in both frame- and class-wise accuracy establish ChordFormer as a reference architecture for robust and balanced audio chord recognition (Akram et al., 17 Feb 2025).