GithubHelp home page GithubHelp logo

absounds / musicgenreclassification Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 832 KB

Feature-based music genre classification using SVM with Scikit-Learn.

License: GNU Affero General Public License v3.0

Jupyter Notebook 100.00%
machine-learning music-genre-classification music-information-retrieval music-technology scikit-learn svm-classifier

musicgenreclassification's Introduction

Music genre classification using Machine Learning

Feature-based music genre classification using SVM with Scikit-Learn.

Summary

This project aims to develop a music genre classifier using Machine Learning algorithms with Scikit-Learn. The classifier is trained on a dataset of precomputed audio features labeled with their genre, and uses a Support Vector Machine (SVM) with a linear kernel to predict the genre of new audio files based on their features.

Dataset

The dataset used for this project consists of the audio features of songs corresponding to 10 different genres: Blues, Classical, Country, Disco, Hip-hop, Jazz, Metal, Pop, Reggae, and Rock. For each audio file a set of 240 audio features labeled with its corresponding genre is provided in an ARFF file.

Installation

To run this project, Python 3 and several Python libraries need to be installed, including Scikit-Learn, Pandas, Numpy, Matplotlib, Seaborn, and Scipy. You can install these libraries using:

pip install scikit-learn pandas numpy matplotlib seaborn scipy

Usage

To use this classifier, you need to follow these steps:

  1. Download or clone the GitHub repository here.

  2. Open the Jupyter notebook GenreClassificationML.ipynb and run all the cells.

  3. The notebook will load the dataset, preprocess it, train the SVM classifier, and evaluate its performance using cross-validation and a confusion matrix. It will also show the five features with the largest weight on the classification.

  4. You can modify the parameters of the SVM classifier, such as the kernel or the regularization parameter, to see if you can improve its performance.

Results

The confusion matrix for the classification is the following:

The classification is not perfect, but it achieves an average accuracy of about 82.5% using 10-fold cross-validation. There are some missclassifications due to the similarity between genres (country/blues, classical/jazz, rock/country...)

And the 5 most important features for the classification are:

Credits

This project was developed as part of the Advanced Topics in SMC course at UPF.

musicgenreclassification's People

Contributors

absounds avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.