MATLAB Answers

unable to display training progress using SVM classifier

조회 수: 16(최근 30일)
Teo
Teo 2021년 9월 11일
댓글: Teo 2021년 9월 20일 5:14
Hi,
i going through a research paper (A Transfer Learning Architecture Based on a Support Vector Machine for Histopathology Image Classification) where CNN fully connected layer are connected to a SVM classifer. However when i try to simulate the model as shown in the paper, i notice that the training progress are not displayed as compared to training CNN classifier. Below is the code that i used to simulate the model.
imds = imageDatastore('MerchData', 'IncludeSubfolders',true, 'LabelSource','foldernames');
[imdsTrain,imdsValidation] = splitEachLabel(imds,0.7);
testnet = alexnet
inputSize = testnet.Layers(1).InputSize
augimdsTrain = augmentedImageDatastore(inputSize(1:2),imdsTrain)
augimdsValidation = augmentedImageDatastore(inputSize(1:2),imdsValidation)
layer = 'fc8';
featuresTrain = activations(testnet,augimdsTrain,layer,'OutputAs','rows')
featuresTest = activations(testnet,augimdsValidation,layer,'OutputAs','rows');
whos featuresTrain
YTrain = imdsTrain.Labels;
YValidation = imdsValidation.Labels;
classifier = fitcecoc(featuresTrain,YTrain);
YPred = predict(classifier,featuresTest);
accuracy = mean(YPred == YValidation)
The training progress that i trying to simulate is as shown in the picture below where it is obtain from the research paper.
Thank you very much.

채택된 답변

Prateek Rai
Prateek Rai 2021년 9월 13일
To my understanding, you are trying to simulate a model where CNN fully connected layers are connected to a SVM classifer at the end and want to display the training progress.
Training progress can be dispalyed in different manner in case of SVM. You can display diagnostic messages instead during training by using the 'Verbose' name-value pair argument. It controls the amount of diagnostic information per binary learner that the software displays in the Command Window.
You can refer to verbose MathWorks documentation page to find more on 'Verbose' name-value pair in 'fitcecoc' function.

추가 답변(0개)

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by