Evaluation, Robustness & Ethics

out-of-distribution detection

Out-of-distribution detection gives a model the ability to say 'I don't know'. A normal classifier is forced to assign every input to one of its known classes, so when it meets something it was never trained on — a new animal, a corrupted image, garbage, or an attack — it still confidently outputs one of its labels, often with high confidence. OOD detection adds a gate before the classifier commits: it flags inputs that are too unlike the training data, so the system can abstain, defer to a human, or ask for help rather than make a confident, dangerous error.

The core difficulty is that deep networks are notoriously overconfident on inputs far from their training distribution — softmax probabilities saturate near 1 even on pure noise or unfamiliar objects, so naively trusting the model's confidence does not work. The task is therefore to design a score that separates in-distribution (ID) from OOD inputs: low score on OOD, high on ID, and a threshold that turns the score into an accept/reject decision. Because OOD data is by definition unknown and unbounded, you cannot enumerate it; you must characterize 'normality' from the ID training data alone and call everything sufficiently far from it OOD.

Methods fall into families. Confidence/logit-based scores post-process a trained classifier: maximum softmax probability (the baseline), ODIN (temperature scaling plus input perturbation to sharpen the ID/OOD gap), the energy score (a logit-derived quantity with a cleaner theoretical link to data density), and Mahalanobis distance in feature space (how far a feature vector is from the nearest class-conditional Gaussian fit on training features). Density and reconstruction methods model P(x) directly or measure how well an autoencoder reconstructs an input. Outlier-exposure methods improve detectors by training against a surrogate set of known outliers. Crucially, OOD performance is measured as a detection problem — AUROC, AUPR, and FPR at 95% true-positive rate (FPR@95) — separately from the classifier's clean accuracy.

OOD detection sits at the heart of safe, open-world deployment and overlaps several neighboring problems: anomaly/novelty detection (industrial defect spotting), open-set recognition (correctly classify known classes while rejecting unknown ones), and selective prediction (abstain when uncertain). It matters most precisely where confident errors are costly — a medical imaging system encountering a disease it never saw, a perception stack meeting an unfamiliar object on the road, a content filter facing novel manipulations. A persistent, humbling research finding is that some powerful density models can assign higher likelihood to OOD inputs than to in-distribution ones, so the field treats OOD detection as an unsolved, actively benchmarked problem rather than a closed one.

Evaluation is fragile: an OOD detector's reported AUROC depends entirely on which OOD dataset it is tested against (near-OOD, e.g. CIFAR-10 vs CIFAR-100, is far harder than far-OOD, e.g. CIFAR vs noise). A detector that aces far-OOD can fail on semantically similar near-OOD, so always report results across multiple, diverse OOD sets.

Also called
OOD detectionnovelty detectionanomaly detectionopen-set recognition