Giter Site home page Giter Site logo

cgongye / music_genre_classification Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 2.58 MB

Automatic music genre classification using Multi-layer Perceptron (MLP)

License: MIT License

Python 99.37% Shell 0.63%
genre-classification machine-learning music-information-retrieval

music_genre_classification's Introduction

Automatic Music Genre Classification

This project is based on scikit-learn. The accuracy of 5-Fold cross-validation is 74.2%. The classifier used is MLP with (110,110) neurons. The confusion matrix is shown as below:

The best performing class is classical:

The worst performing class is rock:

Prerequisite

  • python 2.7
  • matplotlib
  • scikit-learn
  • FFmpeg (demo.py only)

Dataset

GTZAN
Although we are grateful that the author provides this dataset for free. There are some flaws in this dataset, see An analysis of the GTZAN music genre dataset and The GTZAN dataset: Its contents, its faults, their effects on evaluation, and its future use Do not use it if you can.

  • 10 genres
  • each genre has 100 soundtracks

Usage

feature_extraction.py

Please use -h to see descriptions and options. X.npy and y.npy are the results of feature_extraction.py. X is the extracted features, y is the corresponding labels.

fmodel_feature_selection.py

Please use -h to see descriptions and options. Below is the table of accuracy of different combinations of features of different classifiers.

validation.py

Please use -h to see descriptions and options. model.out is the trained model.

demo.py

Please use -h to see descriptions and options. It uses X.npy and model.out to predict the genre of any given music.

music_genre_classification's People

Contributors

cgongye 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.