I have trained ancient coin images using feed forward neural network. Now, I want to use that trained network to use for testing images. I did as follows;
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;
Problem is, even when I input another image, say a face of a person, it says either type 1 or type 2. It doesn’t display unclassified. Always, gives either type 1 or type 2 for any image, not only for coin images.
Can someone please help me?
You trained your neural network on only coins, I assume.
That is the problem. If you want your neural network to classify things that are not coins. You have to train it with images that are not coins. This is a big problem, because there are infinitely many images that are not coins. Neural networks, despite its misleading name, is only as smart as your training data.
The easier way to do this would be to come up with some algorithms to classify things that are not coins before you use your neural network. (For example, you could detect to see if there are any circles in the image)