This project includes classifiers for music genres. The dataset is organized into the dataset
directory, which contains ten subdirectories with different music genre, each with 50 WAV files. The project utilizes three different classification models and employs five feature extraction methods.
- Mel-Spectrogram
- Mel-Frequency Cepstral Coefficients (MFCC)
- Spectral Contrast
- Zero Crossing Rate
- Chroma STFT
- K-Nearest Neighbors (KNN)
- Support Vector Machine (SVM)
- Random Forest
- Clone or download this project.
- Install the required dependencies:
pip install -r requirements.txt
- Run the main script:
python main.py
- Customize the classifier and feature extraction method to use in the 'Start Training' section.
KNN | SVM | Random Forest | |
---|---|---|---|
Mel-Spectrogram | 0.296 | 0.337 | 0.366 |
MFCC | 0.396 | 0.562 | 0.534 |
Spectral Contrast | 0.352 | 0.43 | 0.434 |
Zero Crossing Rate | 0.216 | 0.238 | 0.216 |
Chroma STFT | 0.238 | 0.272 | 0.234 |
The results show that the MFCC feature achieves the highest accuracy across all classification models.