TuneType is an advanced music genre classification system that leverages machine learning and audio signal processing to accurately identify the genre of any music track. The system analyzes audio features such as spectral characteristics, rhythm patterns, harmonic content, and tonal features to classify songs into major music genres.
- High-Accuracy Classification: Ensemble ML model combining multiple classifiers for robust genre detection
- Support for Major Genres: Classifies music into 12 major genres including rock, pop, jazz, classical, hip-hop, and more
- Comprehensive Audio Analysis: Extracts 135+ audio features for nuanced genre identification
- Interactive Web Interface: User-friendly web app for uploading and analyzing music files
- Detailed Visualizations: Genre probability distribution and audio feature visualizations
- Cross-Platform Compatibility: Processes common audio formats (.mp3, .wav, .ogg)
- Python 3.9 or higher
- pip (Python package manager)
- Virtual environment (recommended)
- Clone the repository:
git clone https://github.com/yourusername/TuneType.git
cd TuneType
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Download genre samples for model training:
python download_samples.py
- Train the classification model:
python train_with_samples.py
- Start the web application:
python app.py
- Access the application in your browser at:
http://localhost:5001
- Upload a Music File: Click the upload button and select an audio file (.mp3, .wav, .ogg)
- Analyze: Click the "Analyze" button to process the audio and detect the genre
- View Results: The system will display:
- Top predicted genre
- Confidence scores for all genres
- Detailed audio feature visualizations
- Explore Features: Navigate to the visualization page for deeper analysis of audio characteristics
TuneType operates through a multi-stage pipeline:
-
Feature Extraction: Converts raw audio into 135+ numerical features including:
- Mel-frequency cepstral coefficients (MFCCs)
- Spectral characteristics (centroid, rolloff, contrast)
- Rhythm features (beat statistics, tempo)
- Harmonic/percussive component analysis
- Tonal features (chroma, key detection)
-
Classification: Uses an ensemble model combining:
- Random Forest Classifier
- Gradient Boosting Classifier
- Extra Trees Classifier
- Support Vector Machines
- Neural Networks
- K-Nearest Neighbors
-
Result Presentation: Displays genre predictions with confidence scores and interactive visualizations
- Backend: Flask (Python web framework)
- Machine Learning: scikit-learn, librosa, numpy
- Frontend: HTML5, CSS3, JavaScript, Chart.js
- Audio Processing: librosa, soundfile
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some 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.
- librosa - Audio and music processing in Python
- scikit-learn - Machine learning in Python
- Flask - Web framework
- Internet Archive - Source for public domain music samples