out-of-distribution detection
/ owt-uv-dis-truh-BYOO-shun dee-TEK-shun /
Out-of-distribution detection is teaching a model to recognize when an input is unlike anything it was trained on — and to say so, rather than guessing. Imagine a doctor trained only on adult patients suddenly handed an X-ray of a dog. The wise response is "this isn't my specialty," not a confident diagnosis. Most machine learning models lack that wisdom by default: hand them a nonsense input and they will still pick their most likely label and report it as if certain.
The goal is a gatekeeper that flags inputs falling outside the training distribution — a new disease the model never saw, a corrupted sensor reading, an image from a category that doesn't exist in its vocabulary — so the system can abstain, defer to a human, or ask for help. Methods range from watching how confident the model is, to measuring how far an input sits from the cloud of training examples in the model's internal representation, to training a separate detector on what "normal" looks like.
It matters most where a confident wrong answer is dangerous: a medical AI seeing a condition outside its training, a self-driving car facing a scene unlike its data. But be candid — OOD detection is genuinely hard and far from solved. Deep models are notoriously overconfident on weird inputs, sometimes assigning higher confidence to pure noise than to real data. A perfect detector would essentially require the model to know the full shape of everything it doesn't know, which no method achieves.
A classifier trained only on the ten handwritten digits 0–9 is shown a hand-drawn letter 'A'. With no "none of the above" option, it must answer with a digit — and a plain model often replies, say, "7" with 99% confidence. A good OOD detector instead raises a flag: this input doesn't belong to any digit it knows.
Without an "I don't know" option, a classifier forces every input into a known box.
A famous counterintuitive result: deep generative models trained on one image dataset can assign higher likelihood to images from a completely different dataset than to their own training data. The lesson is that raw model confidence is a poor and sometimes inverted signal for "is this familiar?" — OOD detection needs dedicated, carefully validated methods.