Organizations: 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
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.
Figures & tables
Fig. 1: Training framework of Deep SVDD and IMD-AD, respectively. Green points represent normal samples, and red points represent abnormal samples. R and c represent the radius and center of the hypersphere, respectively. ρ represents the margin between abnormal samples and the surface of the hypersphere.
Datasets
#Classes
Sample size
Dimensions
Hidden layers
MNINST
10
60000 (train) + 10000 (test)
28*28
CNN × 2+FC × 3
Fashion MNIST
10
60000 (train) + 10000 (test)
28*28
CNN × 2+FC × 3
CIFAR-10
10
50000 (train) + 10000 (test)
32*32
CNN × 3+FC × 3
ON
4
1060
21
FC × 3
Card
10
2126
21
FC × 3
BC
2
569
30
FC × 3
TABLE I: Overview of Datasets and Corresponding Network Architecture.
Methods
MNIST
IF
KDE
OCSVM
SVDD
SSLM
AE
Deep SVDD
DROCC
IMD-AD
0
90.33
96.28
99.01
90.39
93.88
97.47
98.00
100.00
99.86
1
97.46
92.54
99.56
98.34
98.61
96.93
99.70
99.96
99.93
2
78.96
85.56
95.78
53.33
85.49
80.06
91.70
100.00
99.66
3
82.12
87.17
93.96
72.44
83.67
86.94
91.90
100.00
99.66
4
80.35
82.34
95.79
84.50
89.04
83.73
94.90
100.00
99.90
TABLE II: AUC (%) OF NINE METHOD ON THREE IMAGE DATASETS.
Datasets
Class
IF
KDE
OCSVM
SVDD
SSLM
AE
Deep SVDD
DROCC
IMD-AD
NB-No Block
79.89 ± 3.21
79.09 ± 3.36
71.82 ± 2.36
57.39 ± 3.00
81.81 ± 2.24
79.40 ± 1.94
51.26 ± 7.49
74.83 ± 0.75
88.86 ± 5.35
Block
88.90 ± 4.55
95.79 ± 0.89
93.49 ± 1.46
92.11 ± 1.23
99.43 ± 0.33
80.46 ± 1.71
76.12 ± 14.06
86.76 ± 0.69
99.45 ± 0.53
ON
No Block
92.90 ± 4.42
97.86 ± 0.59
96.73 ± 3.59
95.65 ± 1.83
99.96 ± 0.05
86.74 ± 4.46
84.14 ± 7.96
97.97 ± 1.64
99.92 ± 0.15
NB-Wait
80.62 ± 3.48
84.90 ± 3.64
83.23 ± 3.99
55.40 ± 3.59
76.77 ± 5.73
83.75 ± 2.13
56.56 ± 10.99
82.36 ± 0.47
89.00 ± 2.93
avg.
85.58 ± 6.37
89.41 ± 8.92
86.32 ± 11.25
75.14 ± 21.71
89.49 ± 11.96
82.59 ± 3.33
67.02 ± 15.64
85.48 ± 0.89
94.31 ± 6.21
Rank
5
3
4
8
2
7
9
6
1
TABLE III: Average AUC (%) with StdDevs (5 Seeds) per Method on Three Tabular Datasets.
Dataset Type
IF
KDE
OCSVM
SVDD
SSLM
AE
Deep SVDD
DROCC
Image Datasets
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0010
Tabular Datasets
0.0001
0.0001
0.0001
0.0001
0.0237
0.0001
0.0001
0.0003
All Datasets
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
TABLE IV: p -values of the Friedman test with post-hoc Wilcoxon signed-rank test for comparisons versus IMD-AD across different dataset types.
Fig. 2: Critical Difference diagrams from Friedman test with Nemenyi posthoc test ( α=0.05 ).
Fig. 3: The visualization of IMD-AD on Spiral and Moon Datasets. (a) (c) (e) (g) display the scatter plots on original data. (b) (d) (f) (h) show the extracted samples and the corresponding detection boundaries of IMD-AD.
Fig. 4: Performance curves of IMD-AD with epochs on Spiral and Moon datasets.
Fig. 5: Model classification results on MNIST with normal class 0 over training epochs.
Fig. 6: MNIST heatmap visualization comparing normal and abnormal samples for class 0.
Fig. 7: Ratio of outliers with the change of the hyperparameters on the MNIST dataset. The horizontal axis represents the theoretical upper bound determined by the model hyperparameters— (ν+1)ν1 for normal data and νν2 for abnormal data, while the vertical axis reports the empirical outlier ratio under the same settings. In each subfigure, the solid red line depicts the continuous theoretical limit. Red “ × ” markers denote discrete values of that limit. Blue “ ⋅ ” represent experimental observations.
Fig. 8: The density of squared distance between training samples and the hypersphere center c in representation space of MNINST dataset. Subfigure (a) shows the distributions at 1st epoch, while subfigure (b) corresponds to the converged distributions at 100th epoch.
Fig. 9: AUC of ablation experiments on the CIFAR-10 dataset.
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