Field notes · Trustworthy AI made clear
Aleatoric vs epistemic uncertainty: what a model does not know, and why
"The model is uncertain" can mean two very different things. Either the input itself is ambiguous, or the model has simply not seen enough cases like it. The two have different causes, different remedies, and different meanings for the people using the system.
Two kinds of uncertainty
Uncertainty from noise in the observation itself. It is inherent to the data, so collecting more of the same data does not make it go away.
Uncertainty from the model's lack of knowledge. It can be reduced with more data, or a better model, because it reflects what the model has not learned.
These are the definitions used in the deep learning literature, for example by Kendall and Gal in their paper on uncertainty in computer vision: aleatoric uncertainty captures noise inherent in the observations, and epistemic uncertainty is uncertainty in the model that can be explained away with enough data.
Examples from mammography
Take a model that reads screening mammograms.
- Aleatoric. Dense breast tissue can hide a lesion, or make normal tissue look suspicious. Image noise and an unclear lesion boundary add to it. No amount of extra training data changes the fact that this particular image is ambiguous.
- Epistemic. Images from a scanner the model never saw during training, a patient group that is rare in the training set, or an unusual appearance of a lesion. The model is uncertain because it lacks experience, and examples like these in the training data would help.
Why the distinction is useful
It changes what you do next.
- High epistemic uncertainty says the case may be outside what the model knows. Send it to a human, flag it as unfamiliar, and consider adding such cases to the training data.
- High aleatoric uncertainty says the image is hard even for an expert. More training data will not fix it. Better imaging, additional views, or a second reader are more likely to help.
How each one is estimated
There is no single method, but a few approaches are common.
- Aleatoric. Train the network to output a measure of noise alongside its prediction, so it learns where the data are noisy. Kendall and Gal describe this approach for computer vision.
- Epistemic, with MC dropout. Keep dropout switched on at test time and run the same image through the network several times. If the predictions vary a lot, the model is uncertain. Gal and Ghahramani argued that dropout training can be interpreted as approximate Bayesian inference.
- Epistemic, with deep ensembles. Train several networks from different random starts and look at how much they disagree. Lakshminarayanan and colleagues presented this as a simple and scalable alternative to Bayesian neural networks, with high quality uncertainty estimates.
The costs differ. MC dropout needs many forward passes at test time. Ensembles need several trained models. For a broad survey of the methods, see the review by Abdar and colleagues. For a plain comparison of the main methods and their cost, see uncertainty quantification explained for researchers.
The line between the two is not sharp
In practice, the split depends on the model and the data you have. Something one model treats as noise, another model with better features may be able to explain. Hüllermeier and Waegeman discuss this in their introduction to the topic. So treat the two labels as a useful way of thinking, not as two quantities nature hands you separately.
How to check that your uncertainty is meaningful
An uncertainty estimate is a claim, and it should be tested like one.
- Does it track errors? Group the test cases by their uncertainty and compare the error rate across groups. Errors should concentrate in the uncertain groups.
- Does it respond to unfamiliar data? Test on data from another source, and check that the epistemic estimate rises.
- Is the confidence calibrated? See model calibration and ECE explained.
- Is it useful? The test of an uncertainty estimate is a decision it improves, such as which cases to defer. See selective prediction in medical AI.
This is the thread running through my own research on breast cancer detection in mammography: it is not enough for a model to be accurate. It has to know when its answer should not be trusted. You can see the publications on the research page.
References
A. Kendall and Y. Gal, “What uncertainties do we need in Bayesian deep learning for computer vision?,” arXiv:1703.04977, 2017. doi.org/10.48550/arXiv.1703.04977
E. Hüllermeier and W. Waegeman, “Aleatoric and epistemic uncertainty in machine learning: an introduction to concepts and methods,” Machine Learning, vol. 110, no. 3, pp. 457 to 506, 2021. doi.org/10.1007/s10994-021-05946-3
Y. Gal and Z. Ghahramani, “Dropout as a Bayesian approximation: representing model uncertainty in deep learning,” Proceedings of the 33rd International Conference on Machine Learning, PMLR 48, pp. 1050 to 1059, 2016. proceedings.mlr.press/v48/gal16.html
B. Lakshminarayanan, A. Pritzel, C. Blundell, “Simple and scalable predictive uncertainty estimation using deep ensembles,” arXiv:1612.01474, 2016. doi.org/10.48550/arXiv.1612.01474
M. Abdar et al., “A review of uncertainty quantification in deep learning: techniques, applications and challenges,” Information Fusion, vol. 76, pp. 243 to 297, 2021. doi.org/10.1016/j.inffus.2021.05.008
Free kit
Uncertainty quantification, explained for researchers.
Four printable pages: the words, a method chooser, a test checklist, and what to write in your paper. Free, no email, no sign-up.
Writing a paper right now? Take the two minute readiness check.
Keep reading
Uncertainty quantification explained for researchers
A plain map of uncertainty quantification: what it is, the main methods and their cost, how to test them, and what to report. Free PDF kit included.
9 min readTrustworthy AI made clearSelective prediction: when a medical AI should say "I am not sure"
Letting a model abstain on uncertain cases. How risk and coverage trade off, and six checks before you claim it works.
8 min read