Organizations: School of Statistics and Mathematics, Yunnan University of Finance and Economics, Kunming, 650221, China · Beijing National Center for Applied Mathematics, Capital Normal University, Beijing, 100048, China
Multi-class open-set anomaly detection requires a model to characterize the normal acceptance domain formed by multiple heterogeneous subdistributions using only class-labeled samples from known normal classes, and to identify previously unseen anomalies at test time. Existing single-hypersphere methods cannot explicitly represent class-specific locations and acceptance ranges, while current multi-hypersphere or multi-class approaches do not fully integrate inter-class boundary constraints, learnable acceptance ranges, and interpretable decisions. To address these limitations, we propose Interpretable Multi-Hypersphere Deep Anomaly Detection (IMHD-AD). IMHD-AD constructs an independent hypersphere for each known normal class in a shared feature space. With target-inside and non-target-outside constraints, IMHD-AD embeds the class-specific hypersphere centers and radii directly into the final network layer and jointly optimizes them with the shared representation. The minimum signed boundary score across hyperspheres simultaneously determines open-set acceptance or rejection and provides a faithful geometric explanation of each decision. On MNIST, Fashion-MNIST, and CIFAR-10, IMHD-AD achieves the highest AUC in 28 of 30 open-set comparisons. A two-dimensional synthetic study further shows that model architecture must balance the compactness of known normal classes against the separability of unknown anomalies.
Figures & tables
图 1: Architecture of the proposed interpretable multi-hypersphere deep anomaly-detection model.
Input
Training set D ; number of classes K ; hyperparameters ν , μ , and λ ; learning rates ηp and ηd ; and number of epochs T .
Output
Network parameters θ and {wk,bk}k=1K ; hypersphere parameters {Ck,Rk}k=1K .
1
Initialize the network parameters and Lagrange multipliers αk and βk .
2
for epoch =1 to T do
3
Sample a mini-batch and compute zi=ϕ(xi;θ) .
4
Compute gk(xi)=wk⊤zi+bk .
5
Compute sik=gk(xi)+∥zi∥22 .
表 1: Training procedure for IMHD-AD.
Dataset
Classes
Number of samples
Image size
MNIST
10
60,000 (train) + 10,000 (test)
28×28 (grayscale)
Fashion-MNIST
10
60,000 (train) + 10,000 (test)
28×28 (grayscale)
CIFAR-10
10
50,000 (train) + 10,000 (test)
32×32 (RGB)
表 2: Summary of the public benchmark datasets.
Dataset
Conv. layers
Conv. channels
Embedding dim.
Dropout
MNIST
2
6, 16
64
0.2
Fashion-MNIST
2
8, 24
96
0.3
CIFAR-10
3
32, 64, 128
256
0.5
表 3: Network configurations for the public image datasets.
Category
Parameter
Setting
Training
Random seed
42
Optimizer
Adam
Initial learning rate
3.0×10−4
Weight decay
0.5×10−6
Maximum epochs
200
Batch size
200
表 4: Experimental hyperparameters for IMHD-AD.
Dataset
Known-class combination
MC-SVDD
DeepSVDD
DMSVDD
DeepMAD
IMHD-AD
MNIST
(0, 2)
91.23
86.14
97.64
94.07
96.77
(0, 6)
94.96
96.52
88.75
96.56
96.99
(0, 7)
93.71
87.68
97.15
96.85
95.40
(0, 9)
91.83
91.85
87.96
91.61
97.25
(4, 9)
92.85
95.23
83.89
83.70
97.50
CIFAR-10
(0, 2)
50.19
47.32
71.63
57.12
90.28
表 5: AUC comparison on MNIST, CIFAR-10, and Fashion-MNIST with two known normal classes and eight unseen anomaly classes.
Dataset
Known-class combination
MC-SVDD
DeepSVDD
DMSVDD
DeepMAD
IMHD-AD
MNIST
(2, 6, 9)
78.38
78.66
81.32
96.13
97.45
(3, 6, 7)
73.60
76.76
78.03
96.60
96.68
(0, 8, 9)
89.04
87.55
92.09
92.14
96.51
(0, 6, 8)
89.43
88.09
86.44
87.29
93.92
(0, 5, 8)
85.23
84.46
89.22
94.82
97.61
CIFAR-10
(2, 6, 9)
51.02
46.68
69.48
78.92
88.02
表 6: AUC comparison on MNIST, CIFAR-10, and Fashion-MNIST with three known normal classes and seven unseen anomaly classes.
图 2: Feature-space visualizations of the synthetic data under different network complexities.
Anomaly detection is a crucial machine-learning task with wide-ranging applications. Deep Support Vector Data Description (Deep SVDD) is a prominent deep one-class method, but it is vulnerable to hypersphere collapse, often relies on heuristic choices for hypersphere parameters, and provides limited interpretability. To address these issues, we propose Interpretable Maximum Margin Deep Anomaly Detection (IMD-AD), which leverages a small set of labeled anomalies and a maximum margin objective to stabilize training and improve discrimination. It is inherently resilient to hypersphere collapse. Furthermore, we prove an equivalence between hypersphere parameters and the network's final-layer weights, which allows the center and radius to be learned end-to-end as part of the model and yields intrinsic interpretability and visualizable outputs. We further develop an efficient training algorithm that jointly optimizes representation, margin, and final-layer parameters. Extensive experiments and ablation studies on image and tabular benchmarks demonstrate that IMD-AD empirically improves detection performance over several state-of-the-art baselines while providing interpretable decision diagnostics.
Zhiji Yang, Mei Huang, Xinyu Li +3
the School of Statistics and Mathematics, Yunnan University of Finance and Economics, Kunming 650221, China · the Academy for Multidisciplinary Studies, Capital Normal University, Beijing 100048, China
Open-set supervised anomaly detection (OSAD) aims to identify unseen anomalies using limited anomalous supervision. However, existing prototype-based methods typically model normal data via a unimodal Gaussian prior, failing to capture inherent multi-modality and resulting in blurred decision boundaries. To address this, we propose Mixture Prototype Flow Matching (MPFM), a framework that learns a continuous transformation from normal feature distributions to a structured Gaussian mixture prototype space. Departing from traditional flow-based approaches that rely on a single velocity vector, MPFM explicitly models the velocity field as a Gaussian mixture prior where each component corresponds to a distinct normal class. This design facilitates mode-aware and semantically coherent distribution transport. Furthermore, we introduce a Mutual Information Maximization Regularizer (MIMR) to prevent prototype collapse and maximize normal-anomaly separability. Extensive experiments demonstrate that MPFM achieves state-of-the-art performance across diverse benchmarks under both single- and multi-anomaly settings.
Fuyun Wang, Yuanzhi Wang, Xu Guo +6
Nanjing University of Science and Technology, Nanjing, China · Beijing Normal University, Beijing, China · China Academy of Space Technology, Beijing, China +1
In practice, machine learning methods commonly require anomaly detection (AD) to filter inputs or detect distributional shifts. Typically, this is implemented by running a separate AD model alongside the primary model. However, this separation ignores the fact that the primary model already encodes substantial information about the target distribution. In this paper, we introduce On-Model AD, a setting for anomaly detection that explicitly leverages access to a related machine learning model. Within this setting, we propose RangeAD, an algorithm that utilizes neuron-wise output ranges derived from the primary model. RangeAD achieves superior performance even on high-dimensional tasks while incurring substantially lower inference costs. Our results demonstrate the potential of the On-Model AD setting as a practical framework for efficient anomaly detection.
Luca Hinkamp, Simon Klüttermann, Emmanuel Müller
TU Dortmund University, Dortmund, Germany · Research Center Trustworthy Data Science and Security, UA Ruhr, Germany