how to extract missclassified pictures out of a file with a mixed dataset?

조회 수: 1 (최근 30일)
Eren
Eren 2023년 10월 7일
답변: Image Analyst 2023년 10월 9일
Hi everyone, I am working with matlab and I have an AI model to classify street signs.
for i = 1:size(data, 1)
imageName = data.ImageNames{i};
% Annahme: Die Bildnamen sind in der ersten Spalte
classification = str2double(data.Classification{i});
% Annahme: Die Klassifikation ist in der zweiten Spalte
%Classified pictures are number 14. Everything else should be extracted into an other file
if classification ~= 14 srcPfad = fullfile(srcOrdner, [imageName '.png']);
zielPfad = fullfile(zielOrdner, [imageName '.png']);
copyfile(srcPfad, zielPfad);
end
end
With this code I am able to extract missclassified pictures out of a file. Now I am able to extract pictures, which have the same lable. I need to classify pictures with different labels. The problem is, that I do not know where the information about the correct label for each picture is safed and how it is possible to use the information in the if clause.
for i = 1:length(ds.Files)
img = readimage(ds, i);
% Klassifizieren Sie das Bild
predictedLabels = classify(GTSRBNet, img);
Classification{i} = predictedLabels;
% Labels speichern
fprintf('Bild %d wurde der Klasse %s zugeordnet.\n', i, predictedLabels)
% Speichern des Bildnamens
[~, ImageName, ~] = fileparts(ds.Files{i});
ImageNames{i} = ImageName;
end
This is the part where the classification happens and the output neurons are in the classoutput layer.
for all answers I am very thankful.
  댓글 수: 1
Harald
Harald 2023년 10월 9일
Hi,
please use the code formatting options to make your question more readable.
Since we do not have access to your data (please consider posting it), we can't really tell how you can extract the correct label.
The instructor who gave you this assignment may be able to help you better than us.
Best wishes,
Harald

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

답변 (1개)

Image Analyst
Image Analyst 2023년 10월 9일
If, for your test set, you don't know the correct classification, and all you know is that the images you extracted into a different folder do not have the classification number of 14, then there is no way to know for certain what the correct classification is. It might classify it as class #9 but if you don't know whether that is true or not, you're stuck with it. You might be able to look at some confidence scores in it's classification and if it's not very high, you might assume that the classification could perhaps be wrong, but you won't know for sure.

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by