Myna: Masking-Based Contrastive Learning of Musical Representations

Ori Yonay, Tracy Hammond, Tianbao Yang · DOI

Introduction

In the field of Music Information Retrieval (MIR), the challenge lies in developing computational models capable of understanding complex musical attributes such as genre, key, and emotional content. While self-supervised learning (SSL) has mitigated the need for extensive labeled datasets, current contrastive learning paradigms often rely on heavy data augmentations (e.g., pitch shifting, time stretching). These methods suffer from two primary drawbacks: musical distortion, where augmentations destroy critical information for tasks like key detection, and computational inefficiency, as memory-intensive CNN-based models limit batch sizes and necessitate massive GPU clusters.

Myna addresses these challenges by introducing a highly efficient self-supervised framework that replaces complex audio augmentations with an aggressive 90% token masking strategy on spectrograms.

Methodology

Myna treats music representation as a visual task, utilizing a Vision Transformer (ViT) backbone—specifically a simplified SimpleViT—operating on mel-spectrograms.

The Myna Framework: A streamlined pipeline using 90% masking and contrastive learning.

Masking-Only Augmentation

Instead of traditional signal-processing augmentations, Myna generates two "views" of an audio clip by randomly masking 90% of the spectrogram tokens. This forces the model to reconstruct global musical structures from a mere 10% of visible data, serving as a powerful, domain-agnostic signal for learning meaningful representations.

Patch Geometry and Hybrid Training

Standard ViTs typically employ square patches (e.g., 16x16). Myna introduces "vertical patches" (128x2) that span the entire frequency range at a specific time step. This geometry is optimized for capturing harmonic relationships essential for tasks like key detection. The "Myna-Hybrid" variant alternates between square and vertical patches during training to balance general tagging capabilities with specialized harmonic understanding.

Experimental Setup

The model was pre-trained on the music subset of AudioSet, comprising approximately 822,000 10-second clips. Evaluation was conducted across several downstream MIR tasks:

  • MagnaTagATune (MTT): Music auto-tagging.
  • GTZAN: Genre classification.
  • GiantSteps: Musical key detection.
  • EmoMusic: Valence and arousal (emotion) prediction.

Results and Discussion

Myna demonstrates significant improvements in both performance and efficiency. By attending only to unmasked tokens, the computational load is drastically reduced, enabling a batch size of 4096 on a single NVIDIA A100 GPU—an 85x efficiency gain over previous methods like CLMR.

Performance vs. Computational Cost: Myna achieves high performance with significantly fewer GPU hours compared to larger models.

Key Findings

  • State-of-the-Art Performance: Myna-Vertical achieved a score of 68.6 on the GiantSteps dataset, setting a new benchmark for self-supervised key detection.
  • Efficiency and Scaling: Despite having only 22M parameters and training on a single GPU, Myna-Hybrid outperformed MULE (62M parameters) and rivaled MERT-95M, which requires up to 64 GPUs.
  • Public Data Benchmark: Myna is currently the top-performing model trained exclusively on publicly available data.

Conclusion

Myna proves that aggressive masking is a viable alternative to complex, domain-specific augmentations in music SSL. The success of vertical patching highlights the importance of frequency-axis integrity for harmonic tasks. Future research will explore scaling Myna to larger datasets and investigating more sophisticated masking policies to further enhance representation quality.

Summary updated

BibTeX
@misc{yonay2025myna,
  author = {Ori Yonay and Tracy Hammond and Tianbao Yang},
  title = {{Myna: Masking-Based Contrastive Learning of Musical Representations}},
  year = {2025},
  eprint = {2502.12511},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.12511},
}
Figure