Skip to content
Using deep learning to predict the genre of a song.
Python
Branch: master
Clone or download

Latest commit

Latest commit d3b6e4f Dec 23, 2018

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
figs Figs Apr 20, 2017
lists Lists May 9, 2017
models_trained/example_model/weights Script for quick prediction Jan 15, 2017
music Refine + Examples + Web Apr 20, 2017
LICENSE Create LICENSE Dec 22, 2018
Music_genre_recognition.pdf Add files via upload Jan 19, 2017
README.md Update README.md Dec 23, 2018
Slides.pdf Add files via upload Jan 19, 2017
_config.yml Set theme jekyll-theme-slate Apr 21, 2017
audio_processor.py First Commit Jan 3, 2017
list_example.txt Figs Apr 20, 2017
music_tagger_cnn.py First Commit Jan 3, 2017
quick_test.py Figs Apr 20, 2017
requirements.txt Refine + Examples + Web Apr 20, 2017
tagger_net.py First Commit Jan 3, 2017
train_tagger_net.py Script for quick prediction Jan 15, 2017
utils.py Script for quick prediction Jan 15, 2017

README.md

Music Genre Classification with Deep Learning

DOI

Abstract

In this project we adapt the model from Choi et al. to train a custom music genre classification system with our own genres and data. The model takes as an input the spectogram of music frames and analyzes the image using a Convolutional Neural Network (CNN) plus a Recurrent Neural Network (RNN). The output of the system is a vector of predicted genres for the song.

We fine-tuned their model with a small dataset (30 songs per genre) and test it on the GTZAN dataset providing a final accuracy of 80%.

Slides and Report

Code

In this repository we provide the scripts to fine-tune the pre-trained model and a quick music genre prediction algorithm using our own weights.

Currently the genres supported are the GTZAN dataset tags:

  • Blues
  • Classical
  • Country
  • Disco
  • HipHop
  • Jazz
  • Metal
  • Pop
  • Reggae
  • Rock

Prerequisites

We have used Keras running over Theano to perform the experiments. Was done previous to Keras 2.0, not sure if it will work with the new version. It should work on CPU and GPU.

Python packages necessary specified in requirements.txt run:

 # Create environment
 virtualenv env_song
 # Activate environment
 source env_song/bin/activate
 # Install dependencies
 pip install -r requirements.txt
 

Example Code

Fill the folder music with songs. Fill the example list with the song names.

 python quick_test.py
 

Results

Sea of Dreams - Oberhofer

Sea of Dreams - Oberhofer fig_sea Results

Sky Full of Stars - Coldplay

Sky Full of Stars- Coldplay fig_sky

You can’t perform that action at this time.