Music Genre Classifier
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:
- Hip-hop/ Rap
- Pop
- Rock
- R&B
- EDM
- 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