Inferensys

Glossary

Out-of-Distribution Detection

Out-of-distribution detection is the task of identifying input signals that are fundamentally different from the training data distribution, enabling a deployed AMC model to flag novel or adversarial waveforms instead of making a forced, incorrect classification.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
NOVELTY RECOGNITION

What is Out-of-Distribution Detection?

Out-of-distribution detection is the task of identifying input signals that are fundamentally different from the training data distribution, enabling a deployed model to flag unknown waveforms instead of making a forced misclassification.

Out-of-Distribution (OOD) Detection is a critical safety mechanism for Automatic Modulation Classification (AMC) models deployed in open-world electromagnetic environments. Unlike standard closed-set classification, which forces an input into a known category, OOD detection quantifies whether a received I/Q sample originates from the model's learned data manifold. This allows the system to reject novel, adversarial, or malformed waveforms that would otherwise trigger a high-confidence but incorrect modulation label, a catastrophic failure in electronic warfare or spectrum enforcement scenarios.

Common techniques include using the maximum softmax probability as a confidence score, with low probabilities indicating OOD inputs, or employing energy-based models that learn a scalar energy function assigning lower values to in-distribution data. More advanced methods leverage the feature space of a deep learning AMC model, fitting a class-conditional Gaussian distribution to the learned embeddings and flagging inputs that fall far from any known cluster as open-set anomalies.

OPEN-SET RECOGNITION

Core Characteristics of OOD Detection

Out-of-Distribution (OOD) detection is a critical safety mechanism for deployed Automatic Modulation Classification (AMC) models. It enables a system to recognize when an intercepted signal falls outside its training distribution—such as a novel waveform, an adversarial attack, or noise—and flag it as unknown rather than forcing a high-confidence misclassification.

01

Distributional Uncertainty Quantification

OOD detection relies on quantifying the epistemic uncertainty of a model's prediction. Unlike softmax probabilities, which can be high for OOD inputs, true uncertainty metrics identify when a model is operating outside its knowledge. Bayesian neural networks and deep ensembles model weight distributions to produce predictive variance. High variance across ensemble members signals an unfamiliar input. Monte Carlo Dropout approximates Bayesian inference during inference by sampling multiple forward passes, measuring disagreement as a proxy for distributional shift.

02

Distance-Based Detection Methods

These techniques operate on the principle that in-distribution (ID) samples cluster tightly in the model's feature embedding space, while OOD samples map to distant, low-density regions. Key approaches include:

  • Mahalanobis Distance: Computes the distance of a test sample's feature vector to the nearest class-conditional Gaussian distribution, using a tied covariance matrix estimated from training data.
  • Deep Nearest Neighbors: Compares the test embedding against a stored gallery of ID embeddings using k-NN; a low conformity score triggers rejection.
  • Gaussian Mixture Models (GMMs): Fit a probabilistic density model to the ID embeddings and flag samples with low log-likelihood.
03

Energy-Based and Logit Scoring

These methods derive OOD scores directly from a model's logit outputs without modifying the architecture. The Energy Score computes the negative LogSumExp of the logits, providing a scalar that is theoretically aligned with the input's probability density. ID samples yield lower (more negative) energy. Maximum Softmax Probability (MSP) uses the highest softmax value as a confidence proxy, though it is known to be poorly calibrated for OOD detection. ODIN (Out-of-DIstribution detector for Neural networks) enhances MSP by applying temperature scaling and small input perturbations to widen the gap between ID and OOD scores.

04

Training-Time Regularization

Proactive techniques modify the training objective to enforce a compact decision boundary for ID classes and a repulsive margin for everything else. Outlier Exposure (OE) introduces a diverse auxiliary dataset of OOD examples during training, penalizing the model for making confident predictions on them. Contrastive Learning pulls augmented views of the same I/Q sample together while pushing all other samples apart, creating a highly structured embedding space. CAC (Classifier-Agnostic Contrastive) loss explicitly optimizes for a uniform distribution of OOD samples on the embedding hypersphere.

05

OpenMax and Recalibrated Softmax

OpenMax replaces the standard softmax layer with a mechanism that estimates the probability of an input belonging to an unknown class. It fits a Weibull distribution to the distances between correctly classified training samples and their class mean activation vectors. At inference, the model recalibrates the logits by weighting them against the probability of extreme distance values, redistributing mass to a new 'unknown' pseudo-class. This explicitly models the boundary between known modulation schemes and the open world of novel waveforms.

06

Evaluation Metrics for OOD Detection

Standard classification accuracy is insufficient for evaluating OOD detectors. Key metrics include:

  • AUROC (Area Under the Receiver Operating Characteristic curve): Measures the trade-off between true positive rate (correctly identifying OOD) and false positive rate (flagging ID as OOD).
  • FPR at 95% TPR (FPR95): The false positive rate when the true positive rate is fixed at 95%. Lower is better.
  • AUPR (Area Under the Precision-Recall curve): More informative than AUROC when there is a class imbalance between ID and OOD samples.
  • Detection Error: The minimum misclassification probability achievable by tuning the threshold.
OUT-OF-DISTRIBUTION DETECTION

Frequently Asked Questions

Core concepts and common questions about identifying signals that fall outside a model's training distribution, a critical safety mechanism for deployed automatic modulation recognition systems.

Out-of-distribution (OOD) detection is the task of identifying input I/Q signals that are fundamentally different from the modulation schemes and channel conditions present in the training data distribution. In a deployed AMC system, a standard closed-set classifier will forcibly map any input—including novel, adversarial, or noise-only waveforms—to one of its known modulation classes with high confidence. An OOD detector acts as a gating mechanism that flags these anomalous inputs, enabling the system to respond with "unknown modulation" rather than making a silent, incorrect classification. This capability is essential for electronic warfare applications where threat emitters may use previously unseen waveforms and for commercial cognitive radios encountering interference from new wireless standards.

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.