Hi Sherzod!



 Sherzod_Bek:

I think it should show around 0.5.   because image doesn’t look like any class.


Here’s my speculative way of looking at this:
You train your classifier to predict one of two classes.  When it gets it
right, it gets rewarded for predicting that class with high certainty, so
there is some bias towards making high-certainty predictions.  Because
you don’t train with not-cat, not-dog images, there is no penalty for
predicting a not-cat, not-dog image – say an image of a person with a
vaguely dog-like face – with high certainty as a dog.
If your actual use case is that at inference time your model will be presented
with cat, dog, and neither images and it’s important that you not predict
the neither images as cat or dog, then you need train you model to get
the neither images right.
So, in this case, you would want to train a three-class classifier (rather
than a binary classifier), where your three classes would be “cat,” “dog,”
and “everything else.”  And your training would include not only “cat”
and “dog” samples, but “everything else” (human, nature, etc.) samples,
as well.
If such a model trains well – and there’s no reason it shouldn’t – when
presented with an “everything else” image, it should predict “everything
else” with a probability close to one, and correspondingly, with probabilities
for “cat” and “dog” close to zero.
Best.
K. Frank