# Dealing with Uncertainty in Contextual Anomaly Detection

arXiv: https://arxiv.org/abs/2507.04490 · HTML: https://mlsanity.com/paper/2507.04490/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 8 of its 52 references that are in the map.
- First posted on arXiv 6 Jul 2025.

## Builds on (most cited first, 8 of 8)

- [Aleatoric and Epistemic Uncertainty in Machine Learning: An Introduction to Concepts and Methods](https://mlsanity.com/paper/1910.09457/) (2019)
- [PyOD: A Python Toolbox for Scalable Outlier Detection](https://mlsanity.com/paper/1901.01588/) (2019)
- [GPflow: A Gaussian process library using TensorFlow](https://mlsanity.com/paper/1610.08733/) (2016)
- [Robust Contextual Outlier Detection: Where Context Meets Sparsity](https://mlsanity.com/paper/1607.08329/) (2016)
- [Explainable Contextual Anomaly Detection using Quantile Regression Forests](https://mlsanity.com/paper/2302.11239/) (2023)
- [Detecting Outliers in Data with Correlated Measures](https://mlsanity.com/paper/1808.08640/) (2018)
- [Scalable Bayesian dynamic covariance modeling with variational Wishart and inverse Wishart processes](https://mlsanity.com/paper/1906.09360/) (2019)
- [Uncertainty Disentanglement with Non-stationary Heteroscedastic Gaussian Processes for Active Learning](https://mlsanity.com/paper/2210.10964/) (2022)

## Abstract (arXiv)

Contextual anomaly detection (CAD) aims to identify anomalies in a target (behavioral) variable conditioned on a set of contextual variables that influence the normalcy of the target variable but are not themselves indicators of anomaly. In many anomaly detection tasks, there exist contextual variables that influence the normalcy of the target variable but are not themselves indicators of anomaly. In this work, we propose a novel framework for CAD, normalcy score (NS), that explicitly models both the aleatoric and epistemic uncertainties. Built on heteroscedastic Gaussian process regression, our method regards the Z-score as a random variable, providing confidence intervals that reflect the reliability of the anomaly assessment. Through experiments on benchmark datasets and a real-world application in cardiology, we demonstrate that NS outperforms state-of-the-art CAD methods in both detection accuracy and interpretability. Moreover, confidence intervals enable an adaptive, uncertainty-driven decision-making process, which may be very important in domains such as healthcare.
