Skip to content
Music auto-tagging experiments for the paper entitled "Timbre Analysis of Music Audio Signals with Convolutional Neural Networks".
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Music auto-tagging experiments for the paper entitled "Timbre Analysis of Music Audio Signals with Convolutional Neural Networks" by Jordi Pons, Olga Slizovskaia, Rong Gong, Emilia Gómez and Xavier Serra.

We provide the code for data preprocessing, training and evaluation of our approach.


Python scripts based on Lasagne-Theano for deep learning and Librosa for feature extraction.

Requires installing Lasagne-Theano ( and Librosa (

Lasagne is already in a /src folder, to install Theano do:

sudo pip install --upgrade

Dependencies: pandas, numpy and scipy.

Steps for reproducing our results

  1. Download the MagnaTagATune (MTT) dataset. See: and
  2. Copy the MTT datset to ./data/audio/MagnaTagATune/ in its original format: 16 folders, '0' to '9' and then 'a' to 'f'. It will look like: ./data/audio/MagnaTagATune/a/, ./data/audio/MagnaTagATune/2/, etc. Note that you will have to create the folder: ./data/audio/MagnaTagATune/.
  3. Go to src folder: cd EUSIPCO2017/src/
  4. Run python
  5. Run python
  6. Run python
  7. Configure
    1. Set config['patches'] to be the folder generated by, ie: patches/patches_dieleman_setup_eusipco2017_187_logC_elementWise_memory_1489752607/.
    2. Choose the architecture by setting config['type'] to: smallSquared or proposed or proposed2.
  8. Run python If you want to use your GPU, you probably want to run the following: THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python
  9. Configure set test_params['model_name'] to be the model created by, ie: dieleman_setup_eusipco2017_proposed2_v0_210270563616880246637098465086143809559 - without the extension.
  10. Run python

Additional information

You might want to use this code for your own porpuses. If this is the case, the following additional information might be useful for you.

Scipts pipeline > > > >

  • computes spectrograms.
  • splits data in train, val, test. Requires: previous run of ''.
  • computes patches and normalizes the data. Requires: previous run of ''.
  • trains a deep learning model defined in ''. Requires: previous run of ''.
  • evaluates how the trained model performs. Requires: previous run of ''.

Folders structure

Root folders:

  • ./data: with audio, groundtruth and all intermediate files (spectrograms, patches and train/test results).
  • ./src: with core and static scripts.

Default data folders:

  • ./data/audio/: with the raw audio files.
  • ./data/index/: with pre-processed (i) 'index_file' and (ii) 'gt_file'.

When running the scripts throughout the pipeline, the following folders will be created:

  • ./data/spectrograms/
  • ./data/exp_setup/
  • ./data/patches/
  • ./data/train/
  • ./data/test/
You can’t perform that action at this time.