Reputation: 11
I fine tuned an image classifier from GoogleNet which outputs classes of animals (dogs, cats, birds) and it's working perfectly. Accuracy is very high when i pass an image related to the topic and very happy about it!
Now the question is: if i pass to the classifier an image of something un-related to the training dataset (for example an image of a house), I would love to receive as an output lower score that helps me recognize that the analyzed image is not one of the dataset categories.
My current output is
dogs = 97%
cats = 2%
birds = 1%
Instead my need is to see something like
dogs = (anything low %)
cats = (anything low %)
birds = (anything low %)
How can i accomplish this result? Thanks for any help
Upvotes: 1
Views: 90
Reputation: 153
The last layer of your network is a softmax so the results will sum up to 100% even if your input is a white image. If you look at the layer just before, you have a score for each class. The score is probably much lower than if there was a dog on the picture.
Anyway, if your goal is to be able to know if there is a dog, a cat, a bird or none of them in the picture, you should probably add a class 'other' and add images on which there is none of the 3 other classes.
Upvotes: 1
Reputation: 6404
You need to read the docs. But often recognisers take advantage of the fact that the inputs must be one of a restricted set to help tune their algorithms. For example postcodes must be English letters and numerals. If someone handwrites a postcode which is not, it doesn't matter if the recogniser produces garbage, because the input is also garbage.
It's quite likely that it can't recognise input outside of the training set, not trained for. But it all depends exactly how it works underneath.
Upvotes: 0