Classifying music into 10 genres using Deep Learning and Machine Learning
An end-to-end music genre classification system that automatically categorizes audio tracks into 10 genres using multiple ML/DL approaches. The project compares CNN-based deep learning models (trained on raw and feature-engineered spectrograms) with a traditional Random Forest classifier, and includes a Gradio web interface for real-time predictions.
Blues · Classical · Country · Disco · Hip-Hop · Jazz · Metal · Pop · Reggae · Rock
Audio Input (.wav)
│
├──► Mel Spectrogram ──► CNN (Raw) ──────────────► Genre Prediction
│
├──► Feature-Engineered Spectrogram ──► CNN ─────► Genre Prediction
│
└──► Extracted Features (MFCCs, Spectral, etc.)
│
└──► Random Forest Classifier ──────► Genre Prediction
| # | Notebook | Description | Colab |
|---|---|---|---|
| 1 | Data_Pre-Processing.ipynb | Data loading, cleaning, and preparation | |
| 2 | Feature_Engineering.ipynb | Audio feature extraction (MFCCs, spectral features) | |
| 3 | ML-Model.ipynb | Random Forest classifier training & evaluation | |
| 4 | CNN_raw.ipynb | CNN trained on raw mel spectrograms | |
| 5 | CNN_featured.ipynb | CNN trained on feature-engineered spectrograms | |
| 6 | Deployment.ipynb | Gradio web app for real-time inference |
Run the Gradio demo locally or in Google Colab:
Option 1 — Google Colab (no setup needed): Click the Colab badge next to Deployment.ipynb above to launch the interactive demo instantly.
Option 2 — Local:
# Clone the repo
git clone https://github.com/Purnachander-Konda/MusicGenresClassification.git
cd MusicGenresClassification
# Install dependencies
pip install -r requirements.txt
# Run the deployment notebook
jupyter notebook Deployment.ipynb- Python 3.8+
- pip
git clone https://github.com/Purnachander-Konda/MusicGenresClassification.git
cd MusicGenresClassification
pip install -r requirements.txt- Audio Processing: Librosa
- Deep Learning: TensorFlow / Keras
- Machine Learning: scikit-learn (Random Forest)
- Computer Vision: OpenCV (spectrogram processing)
- Data Handling: NumPy, Pandas
- Deployment: Gradio
- Visualization: Matplotlib, Seaborn
MusicGenresClassification/
├── Data_Pre-Processing.ipynb # Data preparation pipeline
├── Feature_Engineering.ipynb # Audio feature extraction
├── ML-Model.ipynb # Random Forest model
├── CNN_raw.ipynb # CNN on raw spectrograms
├── CNN_featured.ipynb # CNN on engineered spectrograms
├── Deployment.ipynb # Gradio web app
├── MusicGenreClassification_Proposal.pdf
├── MusicGenreClassification_Report.pdf
├── requirements.txt
├── LICENSE
└── README.md
- Project Proposal — Problem statement, objectives, and methodology
- Project Report — Detailed analysis, results, and conclusions
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License — see the LICENSE file for details.
⭐ Star this repo if you found it useful!