Abstract
Musical performance combines a wide range of pitches, nuances, and expressive techniques. Audio-based classification of musical instruments thus requires building signal representations that are invariant to such transformations. This article investigates the construction of learned convolutional architectures for instrument recognition, given a limited amount of annotated training data. In this context, we benchmark three different weight sharing strategies for deep convolutional networks in the time-frequency domain: temporal kernels; time-frequency kernels; and a linear combination of time-frequency kernels which are one octave apart, akin to a Shepard pitch spiral. The best classification accuracy is obtained by hybridizing all three convolutional layers into a single deep learning architecture.
The Challenge of Pitch Invariance
In Music Information Retrieval (MIR), recognizing an instrument is a "pitch-invariant" task: a violin should be identified as a violin regardless of the note played. However, instruments are "source-filter" systems. While the "source" (the vibrating string or air column) changes pitch, the "filter" (the instrument's body) has fixed resonances called spectral envelopes.
This creates a challenge for machine learning: moving a note up an octave shifts harmonics while resonance peaks remain stationary. Standard features like MFCCs struggle to disentangle these factors, and standard CNNs often require massive datasets to learn these musical properties. This research explores baking musical logic directly into the network architecture to improve performance on smaller, specialized datasets.
Methods: Hybridizing the Pitch Spiral
The proposed architecture utilizes a Constant-Q Transform (CQT) spectrogram as input, where a pitch shift corresponds to a simple vertical translation on a log-frequency scale. The core innovation involves benchmarking and hybridizing three weight-sharing strategies:
- 2D Time-Frequency Kernels: The standard CNN approach for learning local spectral shapes.
- 1D Temporal Convolutions: Applied at high frequencies where harmonics are densely packed and the spectral envelope dominates.
- The Pitch Spiral: Applied at low frequencies where harmonics are sparse. By "rolling up" the frequency axis into a Shepard pitch spiral, the model aligns notes an octave apart, allowing kernels to learn correlations between harmonics regardless of specific pitch.
The final model is a hybrid architecture that merges these convolutional streams before passing them into a fully connected layer for classification.
Datasets and Evaluation
The study utilized several datasets for training and evaluation:
- MedleyDB: Primary source for training data (122 multitracks).
- RWC Music Database: Used for diagnostic experiments regarding pitch transposition errors.
- Joder et al. (2009) Dataset: Solo music recordings for evaluation, supplemented with MedleyDB stems.
The models were tested on eight classes: piano, violin, distorted electric guitar, female singer, clarinet, flute, trumpet, and tenor sax.
Key Results and Insights
The hybrid model (2D + 1D + Spiral) achieved the highest average accuracy at 74.0%, significantly outperforming standard 2D CNNs (69.1%) and traditional "bag-of-features" approaches (61.4%).
Key insights from the performance data include:
- Frequency-Dependent Processing: High and low frequencies behave differently in log-spectrograms; the hybrid approach accounts for this by using 1D temporal filters for high frequencies and spiral connections for low frequencies.
- Domain Knowledge as Regularization: Forcing the network to recognize octave relationships acts as a form of regularization, preventing the model from overfitting to specific pitches in the training set.
- Parameter Efficiency: The hybrid model (147k parameters) outperformed a larger standard 2D CNN (158k parameters), demonstrating that how weights are arranged is more critical than raw parameter count.
Conclusion
While effective for limited data, scaling to larger instrument taxonomies remains a challenge. Future work may involve deeper temporal windows to model long-term dynamics and combining these specialized layers with data augmentation techniques like pitch shifting to further enhance recognition performance.
Summary updated