Using LIBSVM for classification in a pretrained network

1 view (last 30 days)
Hello,
im an absolute beginner in deep learning and associated topics and need some help in the following problem.
I want to classify objects in RGB data (images) with these steps:
  • load a dataset of images into Matlab
  • use a pretrained network (vgg16) for and only for feature extraction
  • classify (thats the last 3 layers in the network- correct me if im false) with a SVM from LIBSVM (library for support vector machine) and not with the predefined classifier of the pretrained network.
and there is my problem. My idea was to cut off the last 3 layers and implement LIBSVM into the network. I thought I could just replace these last 3 layers with an appropriate SVM from libsvm. But i have no idea how I should do this. Another idea was to get an array of features from the last layer (e.g. in vgg16 its fc7) and try to work with this array of features as input for the SVM from LIBSVM for classifying.
Thank you in advance

Answers (1)

Viren Gupta
Viren Gupta on 28 Sep 2018
I think the second approach is better where you extract features from 'fc7' layer and then feed these features into your svm model. You can extract the 4096 dimensional features by referring here. Read the section - 'Extract Image Features'.
Then you can feed in these features into 'svmtrain' function of libsvm library.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!