Upload
ankit-tandon
View
218
Download
0
Embed Size (px)
Citation preview
8/10/2019 A Classifier for Guitar Tabs
1/8
!"#$% '(")*"
(%+,,-.
A Classifier For Guitar Tabs
INTRODUCTION/MOTIVATION:
I built a prediction system for the difficulty of a guitar tabs or sheet music. A
guitar tab is a collection of notes written specifically for the guitar in the tablature
format. The following image is an example of what a tab looks like:
THE DATA SET:
The first big problem of this project is curating the data set. Ultimate-guitar.com is
the go-to site for any guitarist looking for sheet music. The problem with
Ultimate-guitars difficulty measurement system is that it doesnt use a classifier,
instead when a user submits a sheet they select the difficulty of the piece
themselves. This adds large amounts of bias to the sites difficulty system becausedifficulty is a relative term and the site is relying exclusively on a single users
determination of whether a song is tough or not. To combat this, the method I
went with is hand curating a dataset from scratch. I downloaded and hand-labeled
67 randomly selected sheets of music from Ultimate-Guitar.com. Each rating is on
a scale of 1 5, 1 meaning the song is very easy and 5 meaning the song is
extremely difficult. To improve the robustness of the database I asked another
8/10/2019 A Classifier for Guitar Tabs
2/8
!"#$% '(")*"
(%+,,-.
friend to hand-label each of the data points I labeled already. The result was a 67
row and 2 column data matrix. This was definitely a challenging data set to get
performance on. Ive had some success with the data, but nothing super
spectacular. Im convinced though there probably is more structure to the data that
Im just not seeing.
My classifier pipeline has several stages.
First, I build a feature table from the data. This is an N x M matrix where N is the
number of tabs (67) and M is the number of features. Ive been playing around
with a set of M=15 features which Ill describe later.
Second, I run feature selection on the features to select the features that are most
useful. Obviously, you dont want to use all 15 features because some are much
more noisy than others. Feature selection is a process to select the features that
appear most useful in classification.
Third, I run different classifier algorithms, hoping to find the right one to model
the data. I have played with decision trees, multinomial logistic regression and
KNN on my feature set.
1. Feature Table Creation
I have been playing with the following 15 features, some obviously more useful
than others. I have sorted the features into categories.
Track Length Features
-Mean length of track in tab
-Max length of a track in tab
-Min length of a track in tab
-Number of tracks in tab
Note/chord Features
-Mean number of unique notes/chords in track
-Max number of unique notes/chords in track
Chord Features a chord is defined as playing more than one string
-Median Number of chords in tracks
-Maximum Number of chords in tracks
-Median number of unique chords in tracks.
-Max number of unique chords in tracks
-Median frequency of chords playing (median # of times a chord was played, out
of playing of all chords)
8/10/2019 A Classifier for Guitar Tabs
3/8
!"#$% '(")*"
(%+,,-.
-Maximum frequency of chords playing
-Minimum frequency of chords playing
Auxiliary Features
-Band name (as a unique id) intuition that maybe certain bands produce harder
music than others and reputation factors into our labeling.
From this giant feature table, I find the most useful features using the following
feature selection strategy.
2. Feature Selection
For this section I used a lot of help from Dr. Ravikumar and a paper I found on
piano sheet music classification (I will cite this paper later in the article). A lot of
the math goes over my head but I feel like I understand how to use these methods
as a tool to achieve my goal.
First, in building a classifier, often what people care about is having class-
conditional density distributions be as divergent (i.e. different) as possible.
What I have plotted is the histogram of training data that falls under that feature
for each of our 5 labels. Notice that the distributions are quite distinct and dont
overlap much. This means that this feature separates the labels well.
This feature turned out to be maximum number of unique chords in piece. This is
the best histogram I could produce and this one isnt very good. An ideal
distribution would be 5 curve that are distinct and dont overlap.
8/10/2019 A Classifier for Guitar Tabs
4/8
!"#$% '(")*"
(%+,,-.
Conversely, here is an example of a not-so-great feature:
Notice the distributions overlap completely for all labels. Thus, this feature isnt
useful in telling the different labels apart.
At first I just eyeballed the plots to see which distribution was the most distinct but
then I found KL-Divergence. KL(P||Q) is a way to say non-parametrically how
different two distributions P and Q are. Its a distance metric between distributions
that is based on information entropy. It is quite useful in state of the art Machine
Learning.
One difficulty with the vanilla KL-Divergence formula is that it is not symmetric.Thus, if you swap P and Q then you will get a different answer.
KL(P||Q)!=KL(Q||P). To solve for this, people often use the Symmetrized KL-
Divergence (SKL) = KL(P||Q) + KL(Q||P). Basically, this metric is just adding
both ways.
8/10/2019 A Classifier for Guitar Tabs
5/8
!"#$% '(")*"
(%+,,-.
These are the features with the maximum SKL for my friend and me.
Friends top features Ankits top features
Median Number of Unique Chords Band Name
Maximum Length of Track Median Number of Unique Chords
Maximum Skewness of Rest Distribution Mean Weighted Average Duration
Maximum number of unique chords Number of Tracks
Band Name Max weighted average duration
It is interesting the differences in features that give rise to the cleanest separation
of difficulty rankings for our individual labeling. My friend seems to really like
looking for unique chords, and find fast or long pieces difficult. I think my friend
also consider pieces with lots of sixteenth and eight notes hard. I think I have a
bias towards band name.
8/10/2019 A Classifier for Guitar Tabs
6/8
!"#$% '(")*"
(%+,,-.
Classification
These are the classification accuracies Im getting, on average, via 10-fold cross-
validation in using the entire set of 15 features:
Classifier Accuracy on
friends Data
Accuracy on
Ankits Data
Decision Trees [matlab: classregtree] 37.86% 27.86%
Multinomial Logistic Regression
[matlab: mlrfit]
15.48% 9.52%
K Nearest Neighbor [matlab:
knnclassify]
20.21% 25.00%
8/10/2019 A Classifier for Guitar Tabs
7/8
!"#$% '(")*"
(%+,,-.
These are the classification accuracies Im getting, on average, via cross-validation
on the data using ONLY the top 5 feature selections:
Classifier Accuracy on
friends Data
Accuracy on
Ankits Data
Decision Trees [matlab: classregtree] 44.29% 31.19%
Multinomial Logistic Regression[matlab: mlrfit]
42.42% 29.29%
K Nearest Neighbor [matlab:
knnclassify]
26.43% 34.52%
Multi-class SVM [libsvm] ~36% ~18%
8/10/2019 A Classifier for Guitar Tabs
8/8
!"#$% '(")*"
(%+,,-.
Here are accuracies if I clump labels 2,3,4 into 1 label. Thus, we reduce the 5
labels to 3 and also use feature selection.
Classifier Accuracy on friends
Data Accuracy on Ankit
Data
Decision Trees [matlab: classregtree] 14.29%
6.80%
Multinomial Logistic Regression[matlab: mlrfit]
76.90%62.38%
K Nearest Neighbor [matlab:
knnclassify]
66.90% 59.67%
Overall I found this to be a very tough data set. The only way Ive been able to getabove chance performance is with lumping the middle labels into 1 giant label.
This parallels the intuition that there is relatively clean separation between labels 1
and 5 with several features but it is hard to tell the middle labels apart.
CITATIONS:
Chiu, Shih-Chuan, and Min-Syan Chen. "A Study on Difficulty Level Recognition of
Piano Sheet Music."IEEE(2012): n. pag.IEEE Xplore. Web.