Matlab tool for CNN-SVM implementation

10 次查看(过去 30 天)
Dear
I am using Matlab in a deep learning project. It has extensive support for implementing CNN and LSTM. My query is does Matlab support combination of CNN and a linear classifier in a model?
I want to mean that, using a trainNetwork function either supports lstm implementtion or CNN implementation based on the defintioin we created in layers and options field. But if I want to apply a linear classifier after the fully conneted layer, will Matlab support such type of modification through its deep learning toolbox?
Any kind of advice in this regard on how to infuse svm with cnn will be highly regarded.
thanks,
  2 个评论
H W
H W 2022-11-3
编辑:KSSV 2022-11-3
you can divide the system into two process
the first is cnn to obtain the features
the second is SVN to linear classifier
the connect features is
% Extract features from 'fc' layer form cnn.
layer = 'fc';
featuresTrain = activations(net,Traindata,layer,'OutputAs','rows');
% Train SVM classififer with those features.
YTrain = Train.Labels;
classifier = fitcecoc(featuresTrain,YTrain);
best wishes!
Hiro Yoshino
Hiro Yoshino 2022-11-3
编辑:Hiro Yoshino 2022-11-3
There is a good example that shows the whole workflow using a CNN based feature extractor combined with a SVM based classifier.
https://www.mathworks.com/help/deeplearning/ref/seriesnetwork.activations.html (see the section: Feature Extraction Using SqueezeNet)
As @H W mentioned, you should use activations functions for this purpose.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Deep Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by