I have 1000 images of dogs and 1000 images of cats.
I've trained a small CNN to do classification on this dataset and the accuracy on both the validation/test set is 99% +.
But, I've noticed that when I give an input that isn't a cat or a dog, for example a car, the classifier (sometimes) gives a high confidence of cat or dog.
Why is this? I understand that the CNN has only been trained on two classes, but if it sees something completely random shouldn't it output a low confidence for both classes?
I assume that this problem is solved by negative examples (of other random object and animals), but then the question becomes: how many negative examples are needed to truly cover the distribution of all the possible random images (that aren't of cats or dog)?