Identifying the Genre of a Song with Neural Networks

Navdeep Singh
10 min readOct 22, 2018

--

This article will show you how to build a neural network that can identify the genre of a song.

DataSet: You can find the GTZAN Genre Collection at the following link: GTZAN

It has 1,000 different songs from over 10 different genres, with 100 songs per genre and each song is about 30 seconds long.

Library Used: Python library, librosa to extract features from the songs and use Mel-frequency cepstral coefficients (MFCC).

MFCC values mimic human hearing, and they are commonly used in speech recognition applications as well as music genre detection. These MFCC values will be fed directly into the neural network.

Let’s understand MFCC in detail

To help you understand the MFCC, let’s use two examples. Download Kick Loop 5 by Stereo Surgeon. You can do this by visiting Kick Loop 5, and download Whistling by cmagar by visiting Whistling by cmagar. One of them is a low-bass beat and the other is a higher pitched whistling. They are clearly different and you can see how they look different with MFCC values.

Let’s go to the code (Note that all the necessary code files for this article can be found at Github link).

--

--

Navdeep Singh
Navdeep Singh

Written by Navdeep Singh

Author of Reactive programming with Swift, Engineering Manager — Exploring possibilities with new Tech.

Responses (8)