Abstract
Music annotation has always been one of the critical topics in the field of Music Information Retrieval (MIR). Traditional models use supervised learning for music annotation tasks. However, as supervised machine learning approaches increase in complexity, the increasing need for more annotated training data can often not be matched with available data. In this paper, a new self-supervised music acoustic representation learning approach named MusiCoder is proposed. Inspired by the success of BERT, MusiCoder builds upon the architecture of self-attention bidirectional transformers. Two pre-training objectives, including Contiguous Frames Masking (CFM) and Contiguous Channels Masking (CCM), are designed to adapt BERT-like masked reconstruction pre-training to continuous acoustic frame domain. The performance of MusiCoder is evaluated in two downstream music annotation tasks. The results show that MusiCoder outperforms the state-of-the-art models in both music genre classification and auto-tagging tasks. The effectiveness of MusiCoder indicates a great potential of a new self-supervised learning approach to understand music: first apply masked reconstruction tasks to pre-train a transformer-based model with massive unlabeled music acoustic data, and then finetune the model on specific downstream tasks with labeled data.
Introduction
In the field of Music Information Retrieval (MIR), most high-performing models rely on supervised learning. However, as these models grow more complex, they require increasingly large amounts of labeled data—which is expensive, time-consuming, and difficult to scale.
While the Natural Language Processing (NLP) community has solved similar data bottlenecks using self-supervised models like BERT, applying these techniques to music isn't straightforward. Unlike text, which consists of discrete words, music audio is a continuous signal. If you simply mask a single "frame" of audio, a model can easily "cheat" by interpolating from its immediate neighbors. MusiCoder addresses this gap by designing specific pre-training objectives that force the model to understand the broader context of a musical piece rather than just local patterns.
Methodology
MusiCoder utilizes a multi-layer bidirectional self-attention transformer architecture. The core innovation lies in how it adapts BERT’s "Masked Language Modeling" for the continuous acoustic domain. The model processes 324-dimensional feature vectors, which are a concatenation of Mel-spectrograms, Constant-Q Transform (CQT), Mel-frequency cepstral coefficients (MFCCs), and Chromagrams.
Unlike BERT, which predicts a category for a masked word, MusiCoder performs a regression task, directly reconstructing the continuous acoustic frames using Huber Loss. To prevent the model from relying on local smoothness, the researchers introduced two novel masking objectives:
- Contiguous Frames Masking (CFM): The model masks spans of consecutive frames (averaging about 180ms), forcing it to learn long-range dependencies.
- Contiguous Channels Masking (CCM): This masks specific frequency channels across all time steps, requiring the model to learn the relationships between different musical characteristics like harmony and timbre.
Experimental Setup
The authors used a massive aggregate of unlabeled data for pre-training, totaling over 3,100 hours of music audio from the Music4all, FMA-large, and MTG-Jamendo datasets. Evaluation was conducted on two standard benchmarks:
- GTZAN: A classic dataset of 1,000 clips across 10 genres used for genre classification.
- MTG-Jamendo (Subset): 18.4K clips with 56 mood/theme tags used for auto-tagging.
Results and Discussion
MusiCoder established new benchmarks across its evaluation tasks. In the Music Genre Classification (GTZAN) task, MusiCoderLarge achieved 94.3% accuracy, nearing the theoretical maximum score of 94.5% and outperforming previous CNN-based ensembles.
For Music Auto-Tagging (MTG-Jamendo), the model saw a significant jump in performance, reaching an ROC-AUC of 83.82%, compared to the previous state-of-the-art of 77.17% (Shake-FA-ResNet). Ablation studies highlighted that pre-training was the essential component; adding both CFM and CCM objectives improved the ROC-AUC from 77.03% (no pre-training) to 82.57% for the MusiCoderBase model.
Key insights from these results include:
- Contextual Learning: Global context is more critical for audio than local interpolation. Masking larger chunks of time and frequency forces the model to learn the underlying structure of the music.
- Direct Regression: Reconstructing continuous features directly is highly effective, bypassing the need to discretize audio into "pseudo-words."
- Transformer Power: The self-attention mechanism is exceptionally well-suited for capturing long-range dependencies in musical signals.
Conclusion
MusiCoder demonstrates that self-supervised masked reconstruction is a powerful approach for learning universal music-acoustic representations. While the current study focused on genre and tagging, future work could extend this to more granular tasks like chord estimation, beat tracking, or music segmentation. Additionally, the consistent performance gains from MusiCoderBase to MusiCoderLarge suggest that further scaling of parameters and pre-training data could yield even more robust representations.
Summary updated