extract features and pass to svm for classification

i want to extract features of my dataset and pass it to svm for classification. when i use pretrain alexnet and do feature extraction then code work well and give me result. but i want to replace pretrained alexnet with mnist dataset (mnist model that i have save already by transfer learning of mnist data from scratch). when i load mnist data and then do feature extraction process then code gives me error ( activations(net,trainingImages,layer); activations(net,testImages,layer); give error in these lines that is in activations). here i attach the code please guide me how to remove the error and what is issue

4 Comments

Could you please post the exact error you get or attach the pretrainedmnist.mat file, so we could know what error you get?
To my knowledge, the MNIST data set contains images of the 28 x 28 resolution, while AlexNet was trained on 224 x 224 images. You won't be able to do transfer learning effectively without re-scaling the images.
when we rescale images then again it give error
hey..i want to also use Alexnet + SVM .So, can i get your coding.

Sign in to comment.

Answers (1)

amina naseer
amina naseer on 18 Jul 2018
Edited: amina naseer on 18 Jul 2018
Giridharan Kumaravelu sir this is error image

3 Comments

It looks like the loaded pretrained model may not be in the correct format for the written code. Could you please attach the mat files containing the alexnet and pretrainedmnistnet ?
Giridharan Kumaravelu sir could you please share your email address so that i will mail files on it. the file is of larger size so that not attached here. please share email
I am not in a position to receive any files. But you could look into this example https://mathworks.com/help/nnet/examples/transfer-learning-using-alexnet.html where it is explained what you are trying to do. As Alpha Bravo mentioned, this could be a dimension mismatch problem. Please check the third dimension of your image too.

Sign in to comment.

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Tags

Asked:

on 18 Jul 2018

Commented:

on 25 Feb 2020

Community Treasure Hunt

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

Start Hunting!