Inferensys

Glossary

ODIN

ODIN (Out-of-DIstribution detector for Neural networks) is a method that applies temperature scaling and small adversarial perturbations to inputs, amplifying the difference in SoftMax scores between in-distribution and out-of-distribution samples.
Finance professional using AI FP&A copilot on laptop, board presentation visible on screen, home office work session.
OUT-OF-DISTRIBUTION DETECTOR

What is ODIN?

ODIN is an out-of-distribution detector that applies temperature scaling and small adversarial perturbations to inputs, amplifying the difference in SoftMax scores between in-distribution and out-of-distribution samples.

ODIN (Out-of-DIstribution detector for Neural networks) is a post-hoc method that enhances a pre-trained neural network's ability to separate known in-distribution samples from unknown out-of-distribution inputs without retraining. It operates by first applying temperature scaling to soften the SoftMax probability distribution, then adding a small, calibrated adversarial perturbation to each input. This perturbation is calculated by taking the sign of the gradient of the temperature-scaled SoftMax score with respect to the input, effectively pushing in-distribution samples toward higher confidence and out-of-distribution samples toward lower confidence, widening the separability gap.

The core mechanism relies on the observation that in-distribution inputs respond differently to input pre-processing than out-of-distribution samples. By subtracting a weighted step in the direction that increases the maximum class score, ODIN causes the predicted probabilities for known classes to become more pronounced while forcing unknown inputs into a uniform, low-confidence state. A threshold on the maximum calibrated and perturbed SoftMax score then serves as the decision boundary for rejection. This lightweight, inference-time technique requires no auxiliary outlier dataset for tuning, making it a practical first-line defense against distributional shift in deployed classification systems.

OUT-OF-DISTRIBUTION DETECTOR

Key Features of ODIN

ODIN (Out-of-DIstribution detector for Neural networks) is a lightweight, post-hoc method that enhances any pre-trained neural network's ability to separate known from unknown inputs without retraining.

01

Temperature Scaling

Applies a temperature parameter T to the SoftMax function during inference, dividing logits to soften probability distributions. Higher temperatures amplify the difference between in-distribution and out-of-distribution SoftMax scores.

  • No model retraining required
  • Single scalar parameter tuned on validation data
  • Preserves original classification accuracy on known classes
T > 1
Typical Temperature Range
02

Input Preprocessing with Adversarial Perturbations

Adds a small, calibrated perturbation to each input sample before scoring. The perturbation is computed as the sign of the gradient of the SoftMax score with respect to the input, pushing in-distribution samples toward higher confidence while leaving out-of-distribution samples relatively unaffected.

  • Perturbation magnitude controlled by epsilon (ε)
  • Requires only a single backward pass
  • Amplifies the separability gap between known and unknown
03

Threshold-Based Detection

After temperature scaling and perturbation, ODIN computes the maximum SoftMax score for each input. Samples with scores below a calibrated threshold are flagged as out-of-distribution.

  • Simple binary decision rule
  • Threshold selected using a held-out validation set of OOD examples
  • Compatible with any pre-trained classifier without architectural changes
04

Hyperparameter Tuning Protocol

ODIN requires tuning two hyperparameters: temperature (T) and perturbation magnitude (ε). These are selected jointly on a validation set containing both in-distribution and out-of-distribution samples to maximize detection performance.

  • Grid search over T and ε values
  • Optimizes AUROC or TNR at 95% TPR
  • No access to test-time OOD data required
05

Compatibility with Pre-Trained Models

ODIN operates as a post-hoc wrapper around any neural network with a SoftMax output layer. It requires no modification to the model architecture, no access to training data, and no retraining of weights.

  • Works with CNNs, ResNets, DenseNets, and transformers
  • Applicable to image, signal, and text classification
  • Demonstrated on CIFAR-10, CIFAR-100, and ImageNet benchmarks
06

Performance Benchmarks

ODIN significantly outperforms the baseline maximum SoftMax probability detector. On standard benchmarks, it reduces the false positive rate at 95% true positive rate (FPR95) by up to 34% compared to uncalibrated SoftMax.

  • Evaluated against datasets like TinyImageNet, LSUN, and iSUN as OOD
  • Maintains near-identical in-distribution accuracy
  • Competitive with more complex methods requiring retraining
34%
FPR95 Reduction vs. Baseline
ODIN DETECTOR EXPLAINED

Frequently Asked Questions

Clear, technical answers to the most common questions about the ODIN out-of-distribution detector, its mechanisms, and its application in open-set signal recognition.

ODIN (Out-of-DIstribution detector for Neural networks) is a post-hoc, inference-time method that detects out-of-distribution (OOD) samples by applying temperature scaling and small adversarial perturbations to inputs, amplifying the difference in SoftMax scores between in-distribution and out-of-distribution data. Unlike methods requiring model retraining, ODIN operates on a pre-trained neural network without modifying its weights. The technique is hyperparameter-free in its core logic, requiring only a calibration set to tune the temperature and perturbation magnitude. For a modulation classifier, ODIN takes an IQ sample, adds a tiny perturbation calculated from the gradient of the SoftMax output, and then re-evaluates the prediction with a high temperature. If the recalibrated maximum class probability falls below a threshold, the signal is flagged as an unknown modulation scheme, making it a critical tool for open set signal recognition in dynamic spectrum environments.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.