Connect SVM to CNN using matlab deep network designer

Hi,
i going through a research paper where CNN fully connected layer are connected to a SVM classifer. However i unable to find a SVM classifier inside the deep network designer when i try to simulate such architecture. If there are other method to connect CNN to SVM classifier, hope someone could share some opinion on using mathlab software to design such architecture.
The issue is face in deep network designer (SVM classifer not available):
The diagram for the architecture that i try to stimulate is as followed:
The research paper are as followed:
Thank you in advance for any suggestion or help.

 채택된 답변

Philip Brown
Philip Brown 2021년 9월 9일
There's no built-in SVM classifier layer available in Deep Network Designer, but you should still be able to use the approach outlined in the referenced paper in MATLAB.
Remove the softmax and classifier layers, so a fully-connected layer is the final layer of the network. Then, use the activations from that layer to train an SVM classifier. Take a look at this example, which covers using a pretrained network as a feature extractor.
Extract the features at the layer of interest (e.g. 'fc8') using the activations function, then use those to train a separate SVM classifier, e.g. with fitcecoc.
% Extract features from 'fc8' layer.
layer = 'fc8';
featuresTrain = activations(net,augimdsTrain,layer,'OutputAs','rows');
% Train SVM classififer with those features.
YTrain = imdsTrain.Labels;
classifier = fitcecoc(featuresTrain,YTrain);

댓글 수: 4

Thanks for your suggestion, i had tested and it's worked. Unlike deep learning there are "trainingOptions" to train the deep learning classifier,may i know how to set the traing options using "fitcecoc" such as defining the number of "epoch" during the training of SVM classifier?
Instead of setting training options up-front, you can pass name-value arguments to fitcecoc - take a look at this doc page.
Thanks @Philip Brown. thanks you very much.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품

릴리스

R2021a

질문:

Teo
2021년 9월 7일

댓글:

H W
2022년 11월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by