If your cell phone is suggesting whether a mushroom you just picked up from your backyard for your dinner is poisonous, it better be sure about it! Computer vision applications are now dominated by the applications of neural networks. They have affected each and every one of our lives, thus, also increasing the suspicion. There have been many debates on the trustworthiness of this black box machine. One way by which a model can make itself more trustworthy is by telling us how sure or unsure is it of its decision rather than just saying ‘this is my decision’.

But then the question comes down to how good the current state of the art neural networks are at determining how sure they are of their decision.

Through this post, we will understand —

  • What predicting certainty means for a model [Confidence Calibration]
  • How can we measure it? [Reliability diagram and ECE]
  • Why should we expect a model to be calibrated in the very first place? [MAP, KL divergence and cross entropy]

Let’s start our journey - Confidence Calibration

The problem of predicting probability estimates representative of the true likelihood is called confidence calibration. For example, given 100 predictions, each with the confidence of 0.8, we expect that 80 should be correctly classified. The easiest way to measure this is a plot of confidence vs accuracy. This is known as the Reliability Diagram.

Image for post

The x-axis here is the Bin Accuracy or number of correct samples/ total number of samples in that bin-

Image for post

Bin accuracy

and the y-axis is the confidence or the average of the probabilities in that bin -

Image for post

Confidence Calibration

If the confidence always equals the accuracy i.e the x=y line the model is perfectly calibrated. If a model’s calibration plot lies above the x=y (Perfect Calibration)line this means it gives higher probability estimates for correct classes which makes it overconfident. Lower probability estimates for correct classes means the model is underconfident.

#uncertainty #artificial-intelligence #deep-learning #neural-networks #data-science

Am I sure or unsure?- Uncertainty talks with a neural network
1.20 GEEK