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 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