NeurIPS 2026Coming to NeurIPS in Sydney?Explore papers, orals & directions

Transforming Musical Signals through a Genre Classifying Convolutional Neural Network

Shijia Geng, Gang Ren, Mitsunori OgiharaarXiv 2017

TL;DR

This paper explores using a Convolutional Neural Network (CNN) trained for music genre classification to transform existing music. By manipulating the network's internal representations, they can generate modified audio clips that highlight the network's understanding of genre-specific features, offering a novel way to both create interesting audio and gain insights into how these models "hear."

What Problem Does This Paper Address?

While CNNs have proven effective for tasks like music genre classification, their internal workings remain somewhat opaque. This paper tackles the question of how to leverage the knowledge encoded within a trained CNN, not just for its original classification purpose, but for generative tasks. Specifically, they aim to understand what a genre-classifying CNN "learns" about music and how this learned knowledge can be used to alter existing audio signals, creating new sonic textures that reflect the network's genre understanding. This is analogous to the "DeepDream" project in computer vision, which visualized what CNNs learned about image features.

Methods

The core of the method involves training a CNN for music genre classification. The network architecture consists of three convolutional layers, followed by an output layer. After training, the researchers employ a "DeepDream"-like approach: they take an existing audio clip and iteratively modify it using gradient ascent to maximize the sum of outputs from specific layers of the trained CNN. This process essentially "pushes" the audio signal towards features that the network strongly associates with certain genres or its internal representations. The modified clips are then normalized and saved.

Datasets

The study utilized a private dataset comprising 23,639 song files. These files were processed into five-second audio clips, resulting in a total of 139,500 clips for training and testing. The clips were downsampled to 8,000Hz. The genres used for classification were alternative, electronica, pop, rap, and rock.

Key Insights and Ideas

  • CNNs as "Music Interpreters": The paper demonstrates that a CNN trained for genre classification doesn't just output a label; it develops internal representations that capture genre-specific sonic characteristics.
  • Generative Potential of Discriminative Models: By using gradient ascent on the network's outputs, a discriminative model (genre classifier) can be repurposed for generative tasks, creating novel audio transformations.
  • Visualizing Musical Features: The modified audio clips offer a form of "audio DeepDream," allowing researchers to visualize and understand what aspects of the music the CNN prioritizes for genre identification.
  • Layer-Specific Transformations: The paper suggests that modifying based on different layers of the CNN can yield distinct sonic results, with lower layers potentially producing more "attack-like" features and higher layers generating clearer harmonic patterns.

Key Results

The CNN achieved varying classification accuracies across the five genres:

  • Alternative: 27.6%
  • Electronica: 45.3%
  • Pop: 34.2%
  • Rap: 84.3%
  • Rock: 51.2%

The results indicate that the CNN performed better on genres with more distinct characteristics (rap and rock) but struggled with genres that have more ambiguous features (alternative and pop). Qualitatively, the generated audio files, available online, show interesting transformations. Modifications based on lower layers tend to produce "attack-like" features, while those based on higher layers exhibit clearer harmonic patterns.

Limitations and Future Work

The authors acknowledge that the CNN's ability to distinguish between genres with less distinct features is weak, suggesting that a more complex network architecture might be needed. They also note that the generated audio can contain noise, implying that additional constraints might be necessary to refine the modification process. Future work could explore more sophisticated network architectures, investigate different optimization objectives for modification, and further analyze the relationship between specific network layers and the resulting audio transformations.

Summary updated

Abstract

Convolutional neural networks (CNNs) have been successfully applied on both discriminative and generative modeling for music-related tasks. For a particular task, the trained CNN contains information representing the decision making or the abstracting process. One can hope to manipulate existing music based on this 'informed' network and create music with new features corresponding to the knowledge obtained by the network. In this paper, we propose a method to utilize the stored information from a CNN trained on musical genre classification task. The network was composed of three convolutional layers, and was trained to classify five-second song clips into five different genres. After training, randomly selected clips were modified by maximizing the sum of outputs from the network layers. In addition to the potential of such CNNs to produce interesting audio transformation, more information about the network and the original music could be obtained from the analysis of the generated features since these features indicate how the network 'understands' the music.
BibTeX
@misc{geng2017transforming,
  author = {Shijia Geng and Gang Ren and Mitsunori Ogihara},
  title = {{Transforming Musical Signals through a Genre Classifying Convolutional Neural Network}},
  year = {2017},
  eprint = {1706.09553},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1706.09553},
}
Figure