why my classification results are not correct

3 Ansichten (letzte 30 Tage)
Aiman Zara
Aiman Zara am 2 Jan. 2023
Beantwortet: Image Analyst am 2 Jan. 2023
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)

Antworten (1)

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

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by