Tablature
(or tab) is a form of musical
notation, which tells players where to place their fingers on a particular
instrument rather than which pitches to play.It is frequently used for
guitar,bass, banjo and mandolin but in principle it can be used for any fretted
instrument.
Guitar Tab consists 6 horizontal
lines forming a staff, each line represents one of the instrument’s strings.
Example
Of Guitar Tab Notation
(Excerpt
from HAPPY BIRTHDAY)
Advantages : Since Guitar tab is a direct visual representation of the instrument
fretboard,it can be often easier and quicker for the player to interpret.It’s
also easier for beginner to understand, with the fact that numbers take the
place of the notes on staff notation.
ANN is a simplified weighted graph model of the brain. The nodes represent neurons arranged in layers, and the edges represent synapses. The strength of the synapse is the weight of the edge. Each neuron has many inputs from the previous layer and one output connected to the following layer. In the execution of the ANN, each perceptron computes the sum of its weighted inputs and passes the result to a hard-limit threshold function (in more complex perceptrons, as in my case, other functions like sigmoid are used).
The weights on the "synapses" change
according to the learning procedure where the outputs (neurons of the output
layer) are mapped to learned targets.
The Main Stages Of The
Algorithm Are:
1. Guitar Tab
Extractation.
2. Image
Manipulation.
3. Using ANN .
4. Playing the Guitar Tab.
In order to extract the Guitar Tab from a given
image,I used the fact that the tablature pattern is 6 horizontal lines that
form a rectangle shape,so the only thing I had to find is two XY Coordinates
:The Up_Left and the Down_Right Rectangle coordinates.
I defined 2 compatability
functions in which indicate the compatability of each pixel to be the Up_Left
Rectangle and Down_Right Rectangle respectively.
Image Manipulation
Converting the input image into 6 Vectors(one for
each Guitar string) of binary matrices that is given to the ANN as a input.
The extracted Guitar Tab image is divided to atomic
images,each containing pattern of single number on horizontal line or just
pattern of horizontal line.
Each atomic image is
divided to one of the six sets(depends on the line it was located) and
converted to binary matrix.
Using ANN
Network Architecture:
·
Input Layer – 65 input neurons representing 5X13 pixels image.
·
Hidden Layers – 2 Hidden layers with 8 neurons for
each layer.
·
Output Layer – 11 outputs neurons,
10 for numbers 0..9 and one for horizontal line (“-
-“) without number on it.
·
Type of Neurons – Sigmoid Function.
Training The Network (Supervised Learning):
Backpropagation is
supervised learning technique for training artificial neural networks.
The term is abbriviation for “backwards propagation
of errors”.
Backpropagation requires the the transfer
function(sigmoid in our case) used by the artificial neurons be differentiable.
The Summary of the technique is as
follows:
1.
Present a training sample to the neural network.
2.
Compare the network’s output to the desired output
from that sample.Calculate the error in each output neuron.
3.
For each neuron, calculate what the output should
have been,and a scaling factor,how much lower or higher the output must be
adjusted to match the desired output.This is the local error.
4.
Adjust the weights of each neuron to lower the
local error.
5.
Assign “blame” for the local error to neurons at
the previous level, giving greater responsibility to neurons connected by the
the stronger weights.
6.
Repeat the steps above on the neurons at the
previous level, using each one’s “blame” as its error.
The input for the learning procedure is a set of
number images that serve as a training set,accompained by the correct
classification given by the user.
The
classification information is converted to a target vectors set (the size of
the target vectors is the size of the output neurons layer). Each of the target
vector represents pattern (number or horizontal line) consists of a one and
zeroes. For example, for the number 3, the target vector is [0, 0, 0, 1, 0, 0,
0, 0, 0, 0, 0].
Each examplar is transformed into binary matrix and
given as a input to the network.
The
purpose of the learning procedure is to learn to generalize the problem and to
recognize features, which are common to good and bad exemplars.
Each
exemplar is added to the previously learned exemplars, in order to improve the
knowledge of the ANN and not to specialize in the recently added exemplars (in
order to avoid over fitting).
Testing the Network (Guitar Tab Recognition):
Before
using the neural network for Guitar Tab Recognition, the network must be
trained.
The
input for the recognition procedure is Guitar Tab Image, which divided into 6
sets (set for each guitar string) of Binary matrices.
Each
binary matrix given as an input to the trained neural network which produce
output vector that is converted to a number or H (see above) and added to one
of the six vector according to the line it was located on.
Playing The Guitar Tabs:
In
the final stage there is mapping from the set of vectors to music notes in 6
channels (one channel for each string).
The
procedure gets as an input a number and the line in which the pattern was
located and returns the corresponding note. Finally the procedure is playing
all the notes in 6 channels.
Results
Best
results I have got with neural network with two hidden layers (8 neurons in
each layer).
After
training on the training set which was composed of number images in various
fonts (including mine) the trained network was able to recognize patterns from
the training set and from scanned images containing fonts which were not part
of the training set.
Even
when I added little noise to the image (4 bit flips in the matrix), the network
was able to recognize the pattern.
The
recognition was not completely accurate only when I wrote something that was
not quite clear.
Conclusions
GTR
gives us another proof for the power of neural network in pattern recognition.
The
Guitar Tab recognition problem was easily solved using artificial neural
network.
The
network topology has a great influence on the results, so I made extensive
experiments in choosing the right topology, which will give the best result
(every problem required different topology).
While
choosing the network topology, several consideration have been taken into
account:
1.Learning
the training set in a short time.
2.The
ability of the network to classify pattern which never seen before
(generalization problem).
One
might think that bigger network will give better results but there is tradeoff
between the size of the network and the learning time.
In
addition too much neurons as well as to much epochs could bring us to the over
fitting problem (Training the network too much could cause the network to
classify perfectly the training set while giving poor results on the testing
set).
Future Work
Use
music theory ideas to help us classify the pattern accurately when the ANN
gives us ambiguous output.
Adding
some constraints or just using database of common guitar tab patterns can do
the trick.
.
Introduction to
neural networks, Willamette University
An Introduction to
Neural Networks by Leslie S.Smith
Neural
Networks by Christos Stergiou and
Dimitrios Siganos