我使用前馈神经网络训练了古代硬币图像。现在,我想使用经过训练的网络来测试图像。我做了如下;
load net.mat;
load Features.mat; %this is the test image's features file
testInputs = features_set';
out = sim(net,testInputs);
[dummy, I]=max(out);
if (I == 1)
h = msgbox('type 1','Description','none');
elseif (I == 2)
h = msgbox('type 2','Description','none');
else
h = msgbox('unclassified','Description','none');
end;
问题是,即使我输入另一张图像,比如一个人的脸,它会显示类型 1 或类型 2。它不会显示未分类。始终为任何图像提供类型 1 或类型 2,而不仅仅是硬币图像。
有人可以帮帮我吗?