0
$\begingroup$

I have built a neural network that detects dog breeds.

My issue is that I don't know how to handle images that don't contain dogs. Indeed, whenever I input a flower image, it will be classified as a dog breed.

Is there a way I could train my neural network to the output "I don't know"?

Attempt:

I have tried adding pictures from other objects than dogs. Unfortunately, I don't know what proportion of external images with the not_a_dog label I should add to correctly detect non-dog images. I don't want to create a bias in my data.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rule of thumb is to create a balanced dataset with both positive & negative samples. There's no harm in using the same number of dog images(positive samples) & images without a dog (negative samples).

Unless you add negative sample to your training data, there's a very high chance that your model will predict "dog" for unseen data without a dog.

You can use probability as a measure to avoid negative samples. Usually if you have a good training data, the predicted probability of "dog" should be very less for negative samples.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.