why can't I get the correct results when performing classification on googlenet model
Show older comments
i have trained my model using googlenet and it depicted 93% accuracy for disease detection, but after that when i perform classification then the classifier predicted the wrong labels along with very less accuracy which is 37.3%. i have used https://www.mathworks.com/help/deeplearning/ug/classify-image-using-googlenet.html and https://www.mathworks.com/help/vision/ug/image-category-classification-using-deep-learning.html for classifying my image dataset but both have not worked for me. Can u help me where I am going wrong
%net = googlenet;
inputSize = net.Layers(1).InputSize
classNames = net.Layers(end).ClassNames;
numClasses = numel(classNames);
disp(classNames(randperm(numClasses,10)))
im = imread("D:\dataset\processed\Alternaria fliph\ (9).jpeg");
figure
imshow(im)
size(im)
im = imresize(im,inputSize(1:2));
figure
imshow(im)
[label,scores] = classify(net,im);
label
figure
imshow(im)
title(string(label) + ", " + num2str(100*scores(classNames == label),3) + "%");
[~,idx] = sort(scores,'descend');
idx = idx(5:-1:1);
classNamesTop = net.Layers(end).ClassNames(idx);
scoresTop = scores(idx);
figure
barh(scoresTop)
xlim([0 1])
title('Top 5 Predictions')
xlabel('')
yticklabels(classNamesTop)

Accepted Answer
More Answers (0)
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!