- Clone the GitHub repository to your local machine.
- Run: python -m venv venv to create a virtual environment.
- Run: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process to allow script execution in PowerShell.
- Activate the virtual environment: .\venv\Scripts\activate
- Once activated, you will see the environment name on your terminal prompt.
- Install dependencies: pip install -r requirements.txt
- Run the web app using: python Web_Demo/app.py
- Open the server address displayed in the terminal (default: http://127.0.0.1:5000).
This project classifies music tracks into genres using machine learning techniques. It uses the GTZAN dataset and extracts meaningful audio features to train classifiers like SVM, Random Forest, KNN, and Neural Networks.
We use the GTZAN dataset, which contains:
- 1000 audio tracks (30 seconds each)
- 10 genres: Blues, Classical, Country, Disco, Hip-hop, Jazz, Metal, Pop, Reggae, Rock
Using the librosa library, we extract:
- MFCC (Mel Frequency Cepstral Coefficients)
- Chroma Frequencies
- Spectral Contrast
- Tonnetz
These features capture timbre, harmony, and rhythmic properties of audio.
We experiment with multiple models:
- Support Vector Machine (SVM)
- Random Forest
- K-Nearest Neighbors (KNN)
- Neural Networks
Model performance is evaluated using accuracy scores and confusion matrices.
pip install numpy pandas matplotlib seaborn librosa scikit-learngit clone https://github.com/Saumi18/Music-Genre-Classification.git
cd Music-Genre-Classificationjupyter notebook Music_Genre_Classification.ipynbRun all cells step-by-step to see feature extraction, model training, and evaluation.
The notebook includes:
Feature visualizations
Confusion matrices
Accuracy scores
Classification reports
Add deep learning models (CNN on spectrograms)
Web interface for genre prediction
Real-time genre classification