Music Genre Classifier

Grid Korsutatipkul
2 min readApr 16, 2021

Scope

  • Be able to classify the genre of English or non-lyrics song
  • The classification will only classify the following genres:
  1. Hip-hop/ Rap
  2. Pop
  3. Rock
  4. R&B
  5. EDM
  6. Jazz

* Noted that one song can have a combination of two or more music genre such as Pop-Rock or HipHop-Pop

We will try to extract the percentage of genre in that song.

Train dataset: 10 hours of non-lyrics and lyrics for each genre (collected from YouTube )

Framework and Specification

Preprocessing

  • Cut 10 hours song in to 20 seconds each (1,800 files for each genre)
  • Dimensional reduction with PCA

Classification

  • 26 Features Extraction
  • -i.e. Mel-Frequency Cepstral Coefficients(MFCC)(20 in number), Spectral Centroid, Zero Crossing Rate, Chroma Frequencies, root-mean-square (RMS), Spectral Roll-off.
  • Perform Support Vector Machine (SVM) on the features\

Input to the system

  • Using Pydup to convert the audio file from Mp3 to Wav
  • Load the wav file with librosa

Output example

Implementation

Outcome

The result shows that the classifier is quiet bias on the edm genre
result of Kill this Love song classification

--

--

Grid Korsutatipkul
0 Followers

Hi there, these are the collection of my works done during the study in the university. If you want to explore more on my development please proceed to my repo.