Music Style Transfer With Diffusion Model

Hong Huang, Yuyi Wang, Luyao Li, Jun LinarXiv 2024 · DOI

Abstract

This paper introduces a many-to-many music style transfer framework powered by Latent Diffusion Models (LDMs). By combining perceptual compression with a novel diffusion-based vocoder called GuideDiff, the authors achieve high-fidelity, real-time style conversion across timbre, genre, and composition styles while significantly reducing the computational overhead typical of previous generative models.

1. Introduction

Music style transfer—the act of changing the "style" of a piece (like its instrument or genre) while keeping the "content" (the melody and rhythm) intact—is a complex task in audio processing. Existing methods often struggle with three major hurdles: the limitation to one-to-one style pairs, poor audio quality due to phase reconstruction issues in spectrogram-based methods, and slow inference speeds that prevent real-time application.

To address these challenges, this work proposes a system that leverages the generative power of diffusion models within a compressed latent space. This approach allows for flexible, many-to-many transfers while maintaining high audio fidelity and operational efficiency.

Overview of the music style transfer pipeline from raw waveform to generated output via latent diffusion and GuideDiff.

2. Methodology

The proposed architecture utilizes a three-stage pipeline designed to move the primary computational load into a compressed "latent" representation.

2.1 Perceptual Compression

Rather than operating on raw audio or high-resolution spectrograms, the framework uses an Autoencoder (AE) to compress the spectrogram into a lower-dimensional latent space. This compression (by a factor of 4) makes the subsequent diffusion process significantly faster and less memory-intensive, enabling execution on consumer-grade hardware.

2.2 Latent Diffusion with Cross-Attention

The core style transfer occurs within the latent space using a U-Net-based diffusion model. To facilitate many-to-many transfer, the model employs a cross-attention mechanism. A domain-specific encoder takes a "seed" spectrogram of the target style and "guides" the diffusion process, transforming the source content into the target domain without requiring pair-specific training.

Detailed architecture of the Latent Diffusion Model, featuring the denoising U-Net and cross-attention conditioning mechanism.

2.3 GuideDiff Vocoder

To convert the generated latent representations back into audible waveforms, the authors developed GuideDiff. This specialized diffusion-based vocoder is designed to restore the phase information typically discarded during initial processing (STFT). By "learning" the correct phase relationships, GuideDiff produces high-fidelity audio that surpasses traditional phase-estimation algorithms.

3. Experimental Setup and Results

The model was trained on a diverse dataset of over 100,000 audio files, encompassing various instruments (piano, violin, guitar), genres (jazz, classical, pop), and specific compositional styles (e.g., Beethoven, Chopin).

3.1 Performance Evaluation

The system was evaluated against baselines such as CycleGAN, UNIT, and musicVAE using both subjective and objective metrics:

  • Subjective Quality: In Mean Opinion Scores (MOS), the proposed model achieved 4.23/5 for piano-to-violin transfer, outperforming CycleGAN (3.98) and musicVAE (3.86).
  • Vocoder Fidelity: The GuideDiff vocoder achieved an Inception Score (IS) of 5.40, significantly surpassing the original WaveNet (2.84) and slightly beating WaveRNN (5.38).
  • Style Accuracy: The model achieved over 95% accuracy in timbre and composition classification tasks. While genre transfer (e.g., jazz to pop) proved more challenging with accuracies around 86-87%, it still represents a significant step forward in multi-domain audio generation.

3.2 Efficiency

By performing diffusion in the latent space, the system can generate high-quality audio in under 5 seconds on an RTX 3090Ti, making it suitable for real-time or near-real-time applications.

4. Conclusion and Future Work

This framework demonstrates that combining Latent Diffusion Models with specialized vocoders like GuideDiff can effectively solve the long-standing issues of quality and scalability in music style transfer. While genre transfer remains a complex structural challenge, the current system provides a robust foundation for many-to-many audio synthesis. Future research will focus on integrating text-to-music capabilities, allowing for style guidance via natural language descriptions.

Summary updated

BibTeX
@misc{huang2024music,
  author = {Hong Huang and Yuyi Wang and Luyao Li and Jun Lin},
  title = {{Music Style Transfer With Diffusion Model}},
  year = {2024},
  eprint = {2404.14771},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.14771},
}
Figure