Matlab tool for CNN-SVM implementation

3 ビュー (過去 30 日間)
Saugata Bose
Saugata Bose 2019 年 6 月 19 日
編集済み: Hiro Yoshino 2022 年 11 月 3 日
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 Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by