extract features and pass to svm for classification
Show older comments
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
Giridharan Kumaravelu
on 18 Jul 2018
Could you please post the exact error you get or attach the pretrainedmnist.mat file, so we could know what error you get?
Alpha Bravo
on 19 Jul 2018
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.
amina naseer
on 21 Jul 2018
Thet Hnin Zaw
on 25 Feb 2020
hey..i want to also use Alexnet + SVM .So, can i get your coding.
Answers (1)
amina naseer
on 18 Jul 2018
Edited: amina naseer
on 18 Jul 2018
0 votes
3 Comments
Giridharan Kumaravelu
on 18 Jul 2018
Edited: Giridharan Kumaravelu
on 18 Jul 2018
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 ?
amina naseer
on 19 Jul 2018
Giridharan Kumaravelu
on 24 Jul 2018
Edited: Giridharan Kumaravelu
on 24 Jul 2018
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.
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!