hi my name is Gabriel ha and we're going to showcase how to make a classifier
through a process called feature extraction which uses deep neural
networks in combination with classic machine learning tools first what are
the feature a feature in the context of deep learning isn't really all that
different from how you'd normally think of a feature in everyday life if you're
shopping around for a TV and you want to know what makes this TV any different
from and the other TV you'll generally look at its list of features how big is
it how many pixels per inch who manufactured it how much does it cost
these features like price or dimension or resolution are shared amongst all TVs
for the fact that this TV has one set of values and that TV has another set is
what differentiates them or classifies them if you will so this is the same
sort of thing that deep learning classifiers figure out when they go
through training with the added bonus that not only are they differentiating
features but they're also determining what the actual features are in the
first place for example the very first layer which looks at the raw input image
might be learning basic things like where edges and blobs are in the image
as you deeper and deeper layers of a neural network those layers combine the
information they get from the earlier layers and form higher-level image
features perhaps things like the objects overall shape well feature extraction
does require good knowledge of machine learning techniques unlike other
classifier construction methods done entirely with narrow networks feature
extraction is super quick requires very little data and you don't even need good
hardware to get good results in not that much time our goal is to make a
classifier in images of four animals cats dogs frogs and deer as a point of
reference we've previously created a network from scratch and a network using
transfer learning to accomplish the same classification tasks those networks took
around 45 and 250 seconds to train respectively with overall accuracies of
75 and 85 percent and just to keep us honest we're going to use the same set
of images to train and test our new classifier now the world of machine
learning you have resources like the multi-class SVM classifier at your
disposal and these techniques run and learn really release fast but they
require an initial list of features the you have to supply ah so now you see
where this is going so for our task at hand let's say you have this machine
learning knowledge and you'd like to take advantage of compelling thoughtful
classification work that's already been done like would alex net a convolutional
neural network which has been trained to classify a thousand objects so we're
going to import alex net and with this line of code we pull in all its layers
generally the deepest layer of the network right before the layer that
actually starts classifying things is a good place to start for feature
extraction so this single line of code extracts the features from that layer
and now we can give it to our machine learning classifier as a starting point
here we're going to have MATLAB train our multi-class SVM classifier using
just 50 images of each animal compared to five hundred and five thousand images
per animal used in the other classifier construction techniques we're going to
drop each set of images in zone folder point MATLAB to the data and tell to
start running normally with demos like this we'd be like okay so we tell to run
and through the magic of post-production we cut out the wait time but in this
case let's see some magic without the post-production check it out it
literally took barely two seconds to extract the features a fraction of a
second to create the classifier and when we run this against our test set of one
thousand images each its overall accuracy is already 74% so with good
knowledge of machine learning you can use MATLAB to generate a decent
classifier with way less data much less time and without dependence on good
hardware click on my links below to get your hands on this code and try it out
for yourself it don't hesitate to leave us feedback
you