annotate 2_generate_smith2013_ismir.m @ 6:e2337cd691b1 tip

Finishing writing the matlab code to replicate all observations made in the article. Added the article to the repository. Renamed the two main scripts ("1-get_mirex_estimates.rb" and "2-generate_smith2013_ismir.m") to not have dashes (since this was annoying within Matlab) Added new Michael Jackson figure.
author Jordan Smith <jordan.smith@eecs.qmul.ac.uk>
date Wed, 05 Mar 2014 01:02:26 +0000
parents
children
rev   line source
jordan@6 1 % This is a script that reproduces the results of the following ISMIR paper:
jordan@6 2 %
jordan@6 3 % Smith, J. B. L., and E. Chew. 2013. A meta-analysis of the MIREX Structural
jordan@6 4 % Segmentation task. Proceedings of the International Society for Music
jordan@6 5 % Information Retrieval Conference. Curitiba, Brazil. 251–6.
jordan@6 6 %
jordan@6 7 % DO read the README.txt before running this file. Among other things, it will
jordan@6 8 % explain that you must download some data and place it in the correct file
jordan@6 9 % tree before this script will work.
jordan@6 10 %
jordan@6 11 % DO read the comments in this script before running it. You may want to run
jordan@6 12 % it piece by piece in order to understand exactly what it is doing.
jordan@6 13
jordan@6 14
jordan@6 15 %%
jordan@6 16 % STEP 0: Set up parameters.
jordan@6 17 % Name the MIREX datasets and algorithms desired.
jordan@6 18 dsets = {'mrx09','mrx10_1','mrx10_2','sal'};
jordan@6 19 algos = {'KSP1','KSP2','KSP3','MHRAF1','OYZS1','SBV1','SMGA1','SMGA2','SP1'};
jordan@6 20
jordan@6 21 % YOU MUST SET THE FOLLOWING PATH YOURSELF!
jordan@6 22 % Set it to be the same as the path given at the top of '1-get_mirex_estimates.rb'.
jordan@6 23 base_directory = '/Users/me/Desktop/MIREX_data';
jordan@6 24 base_directory = '/Users/jordan/Desktop/MIREX_data';
jordan@6 25
jordan@6 26
jordan@6 27 % You should get a copy of the evalution scripts in the Code.SoundSoftware
jordan@6 28 % repository. Wherever you put it, set the following path accordingly:
jordan@6 29 addpath('/Users/me/Desktop/whereiputmymatlabfiles/structural_analysis_evaluation')
jordan@6 30 addpath('/Users/jordan/Documents/structural_analysis_evaluation')
jordan@6 31
jordan@6 32 % You should also, clearly, add the current path (where this file is):
jordan@6 33 addpath('.')
jordan@6 34
jordan@6 35 % Check that we have access to the correct dependencies.
jordan@6 36
jordan@6 37 if exist('compare_structures.m')~=2,
jordan@6 38 fprintf('I could not locate ''compare_structures.m'', part of the Structural Analysis Evaluation project. Please read the help for this file before proceeding.\n')
jordan@6 39 end
jordan@6 40 if exist('load_annotation.m')~=2,
jordan@6 41 fprintf('I could not locate ''load_annotation.m'', part of the Structural Analysis Evaluation project. Please read the help for this file before proceeding.\n')
jordan@6 42 end
jordan@6 43 if exist('collect_all_mirex_annotations')~=2,
jordan@6 44 fprintf('I could not locate ''collect_all_mirex_annotations.m'', which should be in the same folder as this file. Something really screwed up has happened, clearly! Please read the help for this file before proceeding.\n')
jordan@6 45 end
jordan@6 46
jordan@6 47 %%
jordan@6 48 % STEP 1: Download data from MIREX website:
jordan@6 49 %
jordan@6 50 % - Ground truth files
jordan@6 51 % - Algorithm output
jordan@6 52 % - Reported evaluation results
jordan@6 53 % (See README.txt to see where to get this data.)
jordan@6 54
jordan@6 55
jordan@6 56 %%
jordan@6 57 % STEP 2: Import all this data into some Matlab structures.
jordan@6 58 %
jordan@6 59 % 1. Assemble MIREX ground truth file data in Matlab.
jordan@6 60 [mirex_truth mirex_dset_origin] = collect_all_mirex_annotations(base_directory, dsets, algos);
jordan@6 61 % 2. Assemble MIREX algorithm output data in Matlab.
jordan@6 62 mirex_output = collect_all_mirex_algo_output_data(base_directory, dsets, algos);
jordan@6 63 % 3. Assemble MIREX evaluation results in Matlab.
jordan@6 64 mirex_results = collect_all_mirex_results(base_directory, dsets, algos);
jordan@6 65 % 4. Download public repositories of annotations.
jordan@6 66 % NB: You must do this manually, as per the README.
jordan@6 67 % 5. Assemble public ground truth data in Matlab.
jordan@6 68 [public_truth public_dset_origin] = collect_all_public_annotations(base_directory);
jordan@6 69
jordan@6 70
jordan@6 71 %%
jordan@6 72 % STEP 3: Match MIREX and public data.
jordan@6 73 %
jordan@6 74 % With this information, we can now easily search for matches between
jordan@6 75 % MIREX and public ground truth.
jordan@6 76 [pub2mir, mir2pub, P] = match_mirex_to_public_data(mirex_truth, public_truth, mirex_dset_origin, public_dset_origin);
jordan@6 77 % If you have already done this, do not repeat this time-consuming step. Instead:
jordan@6 78 % load match_mirex_to_public_data_results
jordan@6 79
jordan@6 80 %%
jordan@6 81 % STEP 4: Compile datacubes
jordan@6 82 % 1. Compute extra evaluation measures using MIREX algorithm output.
jordan@6 83 % 2. Compute extra features of the annotations (song length, mean segment length, etc.).
jordan@6 84 % 3. Put it all together in a giant MEGADATACUBE.
jordan@6 85 [datacube newcube extracube indexing_info] = compile_datacubes(mirex_truth, ...
jordan@6 86 mirex_dset_origin, public_truth, mirex_output, mirex_results, mir2pub);
jordan@6 87 megadatacube = [datacube newcube extracube];
jordan@6 88 % If you have already done this, do not repeat this time-consuming step. Instead:
jordan@6 89 % load datacubes
jordan@6 90
jordan@6 91
jordan@6 92 %%
jordan@6 93 % Step 5: Do the statistics!
jordan@6 94 % 1. Compute correlations between all these parameters.
jordan@6 95 % 2. Display correlation figures.
jordan@6 96 % 3. Display analysis result figure.
jordan@6 97 do_correlation_analyses % this one is just a script because it does not return any values.
jordan@6 98
jordan@6 99 % You are now finished!