<p>It is fairly well-known in the literature that most CNNs do not output <em>well-calibrated probabilities</em>: in other words the 'probability' output of the softmax often does not correlate well to the true likelihood of being correct. See, for example, <a href="https://arxiv.org/pdf/1706.04599.pdf" rel="nofollow noreferrer"><em>On Calibration of Modern Neural Networks</em></a> by Guo et al for some context on the issue.</p>
<p>Recently interest has grown in <em>Bayesian deep learning</em> techniques which can model the <em>epistemic uncertainty</em>, i.e. the uncertainty in the model itself, and there are lots of interesting papers you can read, for example Kendall and Gal's <a href="https://arxiv.org/pdf/1703.04977.pdf" rel="nofollow noreferrer"><em>What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision?</em></a> (there are also some slides from Kendall which are a bit lighter to read <a href="https://alexgkendall.com/media/presentations/oxford_seminar.pdf" rel="nofollow noreferrer">here</a>).</p>
<p>You could try the temperature scaling technique in Guo et al, which seems to improve the predictions somewhat.</p>
How to get models confidence in tensorflow?
<p>I took pretrained model and trained it on custom dataset with 3 classes and softmax activation as an output layer. I got 91% accuracy on test set, but here's the problem. I want to my CNN to be able to say &quot;I don't know what's on image&quot;. That will help with 2 issues:</p>
<ul>
<li>Missclassification</li>
<li>Images without any class. I search for snakes on image and want to be able to say that there are no snakes on the image</li>
</ul>
<p>I got strange results with softmax:</p>
<pre><code>[[0.05 0.89 0.05]]
[[0.05 0.89 0.05]]
</code></pre>
<p>First image was second class, so model got it right, but second image has NO known class, but model is pretty certain there is. How can I get something closer to real probabilities?
And model isn't bad at classifying, it just always get something like 0.85-0.89</p>
<p>My first thought was to add another class with no snakes on image. But that's pretty dirty solution.
Can Detection/segmentation help here?</p>