GithubHelp home page GithubHelp logo

renesemela / masters-thesis-music-autotagging Goto Github PK

View Code? Open in Web Editor NEW
11.0 1.0 3.0 557.63 MB

Master's Thesis: Automatic Tagging of Musical Compositions Using Machine Learning Methods

License: MIT License

Python 99.04% Batchfile 0.96%
auto-tagging automatic-tagging autotagging classification content-analysis convolutional-neural-network lastfm-dataset-2020 machine-learning magnatagatune-dataset mel-spectrogram

masters-thesis-music-autotagging's Introduction

Master's Thesis: Automatic Tagging of Musical Compositions Using Machine Learning Methods

CZECH NOTE: Podrobný návod v českém jazyce lze nalézt v práci thesis.pdf v příloze B.

Using artificial neural networks for music auto-tagging purposes. This whole work is written in Python (Keras, TensorFlow). There are 2 datasets used as a source for neural networks (MagnaTagATune Dataset, Last.fm Dataset 2020)

This repository is one of the results of my master's thesis.

  • University: Brno University of Technology, Czech Republic
  • Faculty: Faculty of Electrical Engineering and Communication, Department of Telecomunications
  • Field of Study: Audio Engineering
  • Supervisor: Ing. Tomáš Kiska
  • Author: Bc. René Semela

Getting Started

These instructions will help you to get familiar with overall concept of source codes in this work.

There are two folders:

  • installation_files - Contains prerequisites (Python 3.7.7 and Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019).
  • source_files - Contains all source codes. This folder is considered as main working folder for running scripts.

Prerequisites

  • Microsoft Windows 10 (64-bit)
  • Python 3.7.x (64-bit)
  • Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 (64-bit)
  • It is recommended to use a virtual environment in source_files folder. This can be done with virtualenv Python library (with Windows command line):
cd source_files
pip install virtualenv
virtualenv .venv
".venv\Scripts\activate.bat"
  • Python libraries from requirements.txt can be installed via pip:
pip install -r requirements.txt

Running the scripts

dataset_magnatagatune.py

This script uses MagnaTagATune Dataset. You will need to download MP3 files from the official site (part1, part2, part3) and unzip this archive into the folder datasets\magnatagatune_dataset\tracks_mp3. After this, you can run this script without any switch:

python dataset_magnatagatune.py

or you can obtain more info about switches:

python dataset_magnatagatune.py --help

dataset_lastfm.py

This script builds a completely new Last.fm Dataset 2020 inspired by original Last.fm Dataset which is now (2020) very old and unsupported.

The script is set to build dataset from scratch using Last.fm and Spotify API for data acquisition. This step is not necessary because there is dataset database already present in datasets\lastfm_dataset_2020 and all you need to do is run this script with some switches to get tracks from Spotify servers (This dataset contains 100 tags and 122 877 tracks.):

python dataset_lastfm.py --download_spotify_preview
python dataset_lastfm.py --convert_to_wav
python dataset_lastfm.py --compute_melgram

More info about this script can be obtained with --help switch:

python dataset_lastfm.py --help

If you would like to build dataset from scratch, you will need to insert Last.fm and Spotify API keys into variables api_key_spotify and api_key_lastfm in the source code of this script.

neural_networks.py

This script uses Keras and TensorFlow for training, testing and evaluating neural networks architectures. There are 8 neural networks architectures (crnn3, crnn4, crnn5, crnn6, fcnn3, fcnn4, fcnn5, fcnn6) and you can run this script as follows (parameters can be changed):

python neural_networks.py --architecture crnn4 --dataset magnatagatune

More info can be obtained via this command:

python neural_networks.py --help

appliacation.py

You can find this script in the application folder. It is completely standalone application with GUI for testing purposes. You can use trained architectures (by me) for predicting tags on your own audio file (MP3 or WAV). You can run this app with simple command:

cd application
python application.py

application.png

Results of this work

Here are some figures of the results on both datasets. roc_auc_all_magnatagatune.png

roc_auc_all_lastfm.png

Built With

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments

masters-thesis-music-autotagging's People

Contributors

renesemela avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.