Coder Social home page Coder Social logo

jramcast / music-genre-classification-audioset Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 4.0 52.33 MB

Music genre classification experiments with Audioset

License: MIT License

Python 46.00% Shell 0.95% Jupyter Notebook 53.05%
mir machine-learning artificial-intelligence bayesian-inference deep-learning music-genre-classification music-genre-recognition music-genre-detection music-genre-classifier

music-genre-classification-audioset's Introduction

Machine learning for music genre: multifaceted review and experimentation with Audioset: Experiments

Code repository for experiments conducted in the study Machine learning for music genre: multifaceted review and experimentation with Audioset.

Abstract

Music genre classification is one of the sub-disciplines of music information retrieval (MIR) with growing popularity among researchers, mainly due to the already open challenges. Although research has been prolific in terms of number of published works, the topic still suffers from a problem in its foundations: there is no clear and formal definition of what genre is. Music categorizations are vague and unclear, suffering from human subjectivity and lack of agreement. In its first part, this paper offers a survey trying to cover the many different aspects of the matter. Its main goal is give the reader an overview of the history and the current state-of-the-art, exploring techniques and datasets used to the date, as well as identifying current challenges, such as this ambiguity of genre definitions or the introduction of human-centric approaches. The paper pays special attention to new trends in machine learning applied to the music annotation problem. Finally, we also include a music genre classification experiment that compares different machine learning models using Audioset.

Read the article here: https://rdcu.be/b87uq

Demo

I've setup an online demo webapp to show how models trained with this repository work in practice.

https://jramcast.github.io/mgr-app/

Usage

Requirements

  • Python 3.6
  • Pipenv: The project dependencies are managed using pipenv. To install it, you can follow the pipenv installation guide.
  • Audioset VGGish files: you need to download Audioset files in order to train the models.

1. Install dependencies

pipenv install --dev

2. Download Audioset VGGish model files

First, create a downloads folder in the root of the project, and create an audioset folder inside it:

mkdir downloads && cd downloads
mkdir audioset

Now download class_labels_indices.csv file to downloads/ (this file defines dataset labels):

wget http://storage.googleapis.com/us_audioset/youtube_corpus/v1/csv/class_labels_indices.csv

You can also download it from Audioset downloads page.

Go to downloads/audioset and download dataset in csv file:

cd audioset
wget http://storage.googleapis.com/us_audioset/youtube_corpus/v1/csv/eval_segments.csv
wget http://storage.googleapis.com/us_audioset/youtube_corpus/v1/csv/balanced_train_segments.csv
wget http://storage.googleapis.com/us_audioset/youtube_corpus/v1/csv/unbalanced_train_segments.csv

Finally, download Audioset features and save them in the folder downloads/audioset/audioset_v1_embeddings. Once downloaded and extracted, your file structure should look like this:

- downloads/
  - class_labels_indices.csv
  - audioset/
    - balanced_train_segments.csv
    - unbalanced_train_segments.csv
    - eval_segments.csv
    - audioset_v1_embeddings/
        - bal_train/
          - X.tfrecord
          -...
        - unbal_train/
          - X.tfrecord
          -...
        - eval/
          - X.tfrecord
          -...

3. Run experiments

Run this command:

DATA_DIR="./downloads/audioset/audioset_v1_embeddings" python main.py *EXPERIMENT* *OPTIONS*

Experiment can be any of: {bayes,deep,lstm,svm,tree}

As options, you can add:

  • --balanced: to use the balanced Audioset split.
  • --epochs EPOCHS: only for deep learning experiments.

Example:

# Train the LSTM RNN model, on the balanced split of Audioset, for 20 epochs
DATA_DIR="./downloads/audioset/audioset_v1_embeddings" python main.py lstm --balanced --epochs 20

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.