Conformal Anomaly Detection in Python: Moving Beyond Heuristic Thresholds with 'nonconform'

📅 2026-05-13
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the limitations of traditional anomaly detection methods, which rely on heuristic thresholds and lack statistical interpretability and calibration. We propose a conformal prediction–based framework that transforms anomaly scores into statistically valid p-values, enabling rigorous control of the false discovery rate. To facilitate adoption, we introduce nonconform, an open-source Python toolkit that provides the first unified and user-friendly implementation compatible with both scikit-learn and PyOD, incorporating split-conformal inference and efficient calibration strategies robust to distribution shift. Experimental results demonstrate that our approach maintains high detection performance while delivering reliable probabilistic interpretations and strong statistical guarantees.
📝 Abstract
Most anomaly detection systems output scores rather than calibrated decisions, leaving practitioners to choose thresholds heuristically and without clear statistical interpretation. Conformal anomaly detection addresses this limitation by converting anomaly scores into calibrated p-values that are valid under the statistical assumption of data exchangeability, with a growing literature extending this idea beyond that setting. We present 'nonconform', a Python package for applying conformal anomaly detection within existing machine-learning workflows, and use it as the basis for an implementation-grounded introduction to the field. The package integrates with 'scikit-learn', 'pyod', and custom anomaly detectors, and provides a unified interface for calibration, p-value generation, and false discovery rate control. It supports several conformalization strategies, ranging from simple split-conformal calibration to more data-efficient and shift-aware extensions. Through a progression from foundational concepts to advanced conformalization strategies, complemented by code examples, the paper connects the statistical ideas behind conformal anomaly detection to their practical use in 'nonconform'. Empirical results demonstrate that the implemented methods enable statistically principled anomaly detection. Together, the package and exposition aim to make core conformal anomaly detection workflows more accessible and reproducible in experimental and production-oriented settings.
Problem

Research questions and friction points this paper is trying to address.

anomaly detection
conformal prediction
threshold selection
statistical calibration
p-values
Innovation

Methods, ideas, or system contributions that make the work stand out.

Conformal Anomaly Detection
p-value calibration
false discovery rate control
nonconform
distribution shift awareness
🔎 Similar Papers
2024-05-29arXiv.orgCitations: 0
O
Oliver Hennhöfer
Intelligent Systems Research Group, Karlsruhe University of Applied Sciences
M
Maximilian Kirsch
Intelligent Systems Research Group, Karlsruhe University of Applied Sciences
C
Christine Preisach
Intelligent Systems Research Group, Karlsruhe University of Applied Sciences