why my classification results are not correct

1 次查看(过去 30 天)
net = googlenet;
inputSize = net.Layers(1).InputSize
classNames = net.Layers(end).ClassNames;
numClasses = numel(classNames);
disp(classNames(randperm(numClasses,10)))
im = imread("D:\cotton\dataset\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)

回答(1 个)

Image Analyst
Image Analyst 2023-1-2
It was probably not trained with enough examples of the class it's getting wrong.

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by