AutoUAD: Hyper-parameter Optimization for Unsupervised Anomaly Detection
Authors: Wei Dai
Jicong Fan
Venue: ICLR 2025 Poster (2025)
Keywords: anomaly detection
hyper-parameter optimization
Primary area: unsupervised, self-supervised, semi-supervised, and supervised representation learning

Abstract: Unsupervised anomaly detection (UAD) has important applications in diverse fields such as manufacturing industry and medical diagnosis. In the past decades, although numerous insightful and effective UAD methods have been proposed, it remains a huge challenge to tune the hyper-parameters of each method and select the most appropriate method among many candidates for a specific dataset, due to the absence of labeled anomalies in the training phase of UAD methods and the high diversity of real datasets. In this work, we aim to address this challenge, so as to make UAD more practical and reliable. We propose two internal evaluation metrics, relative-top-median and expected-anomaly-gap, and one semi-internal evaluation metric, normalized pseudo discrepancy (NPD), as surrogate functions of the expected model performance on unseen test data. For instance, NPD measures the discrepancy between the anomaly scores of a validation set drawn from the training data and a validation set drawn from an isotropic Gaussian. NPD is simple and hyper-parameter-free and is able to compare different UAD methods, and its effectiveness is theoretically analyzed. We integrate the three metrics with Bayesian optimization to effectively optimize the hyper-parameters of UAD models. Extensive experiments on 38 datasets show the effectiveness of our methods.

Published as a conference paper at ICLR 2025
AUTOUAD: HYPER-PARAMETER OPTIMIZATION FOR UNSUPERVISED ANOMALY DETECTION
Wei Dai Jicong Fan" School of Data Science, The Chinese University of Hong Kong, Shenzhen weida i @ link. cuw..ccckkeeee cn canjicon@@cuhi edu.
ABSTRACT
Unsupervised anomaly detection (UAD) has important applications in diverse fields such as manufacturing industry and medical diagnosis. In the past decades, although numerous insightful and effective UAD methods have been proposed, it remains huge challenge to tune the syper-parameters of each method and select the most appropriate method among many candidates for specific dataset, due to the absence of labeled anomalies the training phase of UAD methods and the high diversity of real datasets. In this work, we aim to address this challenge, so as to make UAD more practical and reliable. We propose two internal evaluation metrics, relative-top- nop-median and porectedanomally gap, and one semi-intern oete-nnternal evaluation metric, normalized pseudo discrepancy (NPD), as surrogate functions of the expected model performance unseen test data. For instance, NPD) mea- sures the discrepancy between the anomaly scores of a validation set drawn from the training data and validation set drawn from isotropic Gaussian. NPD is simple and myyer-parametee free and is able to compare different UAD methods, and its effectiveness is theoretically analyzed. We integrate the three metrics with Bayesian optimization to effectively optimize the els. Extensive experiments on 38 datasets show the effectiveness of methods.
of UAD mod-
INTRODUCTION
Unsupervised anomaly detection (UAD), often referred to as the one-class classification problem, is critical machine learning task with applications across diverse fields such cybersecurity, fraud detection, industrial quality control, and medical diagnostics (Aggarwal) 2016 Pang et al. 2021). These domains typically encounter rare or unknown anomalous events, making the lack of labeled anomaly data a key challenge. UAD addresses this by training models exclusively on "normal" data with the primary objective of learning the boundary that defines normality. This allows the model to identify unseen data points deviating from the normality as potential anomalies.
Recent advances in deep learning have led to highly effective deep UAD methods (Aggarwal 2016
Ruff et al., 2018 Zong et al. 2018 Pidhorskyi et al. 2018 Pang et al. 2019 Goyal et al. [020 Yan
al. 2021 QQu al. [202] Shenkar Wolf [202]] Han al. [2022]
& Fan 2022] Tur al.
2023
Zhang et al. 2023 2024; Fu et | often outperforming traditional shallow models
like --nearest-neighhorr (KNN) (Zimek al." 2012; Sun et al., 2022), local outlier factor (LOF)
(Breunig et al., 2000). isolation forest (IForest) (Lu et al. 2008). and one-class support vector ma- chine (OCSVM) (Schölkopf et al.) (001I). While deep UAD methods offer greater performance and efficiency, they exhibit longer list of dyper-parameters such network depth, hidden dimension, weight decay, training epochs, learning rate, and algorithm-specified they sensitive to the configuration of their hyper- parameters.
Meanwhile,
Compared to supervised learning, paper-parrmeter tuning for unsupervised learning tasks like UAD particularly challenging. In supervised tasks, labeled validation sets provide direct feedback dur- ing the hyper-parameter search, allowing practitioners to iteratively adjust parameters based on mea- surable improvements (Hutter et al. 2019). In contrast, the absence of labeled data poses a unique
"Corresponding author
UAD assumes all most of the training data from normal conditions of system. See Definition

---

Published as a conference paper at ICLR 2025
challenge in unsupervised tasks, making it highly difficult to compare across different models and tune their Syper-parametert (Halkidi & Vazirgiannis 2001; Poulakis 2020 Fan et al. 2022). In Figure []] more intuitively, present the sensitivity of four UAD methods when tuning two of their hyper-parameters. It can be seen that the performance of each method terms of AUC over its two hyper-parameters has many local maximums and minimums. Moreover, the distributions of each method's performance on different datasets are significantly different.
0.50
6.7
1 1
0.825
0.55
0.775
weght decay
0.59
54
0.75
0.2
04
06
0.5
02
24
06
0.5
100
155
200
200
20
200
250
200
250
(a) OCSVM on wine
(b) OCSVM on ALOI
(c) AE on magic.gamme
(d) AE on annthyroid
0.0
A Allessaee
0.55
(bpssaak
9.
(top-traak))
0.00
3.4
b. bubbue 1
0.7
0.79
0.55
hidden dim
Pidden dim
Oogescale)
(ogescals)
(c) DSVDD on annthyroid
(f) DSVDD on glass
(g) DPAD on letter
(h) DPAD on annthyroid
Figure 1: Heatmap visualization of AUC (area under the ROC curve) over two hyper-paramess (described in Appendix (H) four UAD methods including OCSVM (Schölkopf et al. (00T), AE
(autoencoder), Deep SVDD (Ruff et al. 2018) 8), and DAPD (Fu et al. 2024) on different datasets.
Although there have been some insightful attempts at syper-paramete tuning and model selection for anomaly detection, they face significant challenges in unsupervised settings. Recent methods at- tempt to address this by using historical datasets to train meta-models or assuming a prior knowledge of the anomaly ratio. However, both strategies introduce elements of supervision, contradicting the fundamental principles of unsupervised learning. This reliance on prior information compromises the unsupervised nature of the task. Specifically, meta-learming-bet 2022 Zhao & Akoglu 2024 Ding et al. 2024) require access to a collection of historical datasets, which may not always available or relevant. Similarly, methods (Nguyen et al., 2016) that as- sume a known anomaly ratio are impractical in the real world, where anomalies are rare and their proportion is typically unknown. These limitations highlight the urgent need for more effective and fully unsupervised model selection techniques that can operate without these assumptions.
methods (Zhao et al. 2021]
To address these challenges, we first propose two new internal evaluation metries, relative-topk- median and expected-anomall- anomaly-gap. under two proper assumptions in UAD. In the empirical studies, we found that these two metrics do not always work well and are not effective in comparing different UAD methods because they could overfit the training data when implemented model, and they both have an additional defined. We then propose semi-internal evaluation metric, normalized pseudo discrepancy (NPD), which measures the discrepancy between the anomaly scores of a validation set drawn from the training data and a validation robust and reliable results under simpler assumptions without additional hyper- parameters. Our metrics provide a more nuanced understanding model performance based on a reliable theoretical guarantee, enabling a better selection of hyper-parameters and models in UAD tasks.
complex UAD to determine in advance, as the assumption
drawn from an isotropic Gaussian distribution. It offers more
Aiming at model and hyper- parammeeee selection for UAD algorithms and improving the convenience, accuracy, and efficiency of UAD, our contributions are highlighted as follows.
We propose two internal evaluation metrics, relative-top-medinn and expected-anomaly- and one semi-internal evaluation metric, normalized pseudo discrepancy, for automated UAD.
We implement automated UAD using Bayesian optimization. It automatically and efficiently selects the possibly best hyper-paun parameters guided by our proposed metrics.
We provide theoretical guarantees for our NPD metric ensure feasibility and reliability.
2

---

Published as a conference paper at ICLR 2025
We conduct extensive empirical experiments on 38 benchmark datasets with four popular UAD algorithms. The results show that NPD consistently outperforms existing model selection heuristics and significantly works well on the complex state-of-art UAD algorithms.
2 RELATED WORK
Prior studies have shown that UAD methods are sensitive to eyper--arameter choices (Goldstein & Uchidal 2016 Ding et al., 2022). Recently, hyper-parameter tuning and model selection for unsupervised outlier detection have gained attention. Marques et al. (2015) proposed IREOS to evaluate KNN and LOF, but requires additional per-sample training. reducing efficiency. Nguyen al.] (2016) compared clustering quality measures for outlier detection, but these metrics need prior knowledge of the outlier ratio, introducing extra hyper-parameters.
contradicts the goal of
hyper-parameter optimization. Consensus-based methods (Duan et al., 2020; Lin et al. 2020 Ma
et al. 2023) use voting mechanisms to select reliable models, but model pools construction are still sensitive to hyper-parameters. Goix 2016 proposed statistical metrics Mass Volume (MV) and Excess-Mass (EM), assuming outliers appear in the tail of the score distribution. Nevertheless. these studies focus only shallow outlier detection methods.
Mass-Volume
Deep outlier detection methods have three main categories for model selection. The first, early stop- ping, proposed by (Huang et al., 2024), uses an inlier priority assumption and loss entropy to select models during deep learning training iterations. The second category. hyper-ensemble meth- ods, combines multiple models with varying
to enhance detection capability (Ding iet al. [2022] Nawaz et al. 2024). However, these methods introduce additional papre-parameters, such as ensemble weights, and do not guarantee effective outlier detection from the hyper-parametts parameter pool. 'he third category is based on meta-learning, which leverages historical tasks to inform new outlier detection tasks. For example, (Zhao et al.] [021] 2022 Zhho & Akoglu 2024 Ding al., 2024) train meta-model on historical datasets with ground-truth labels predict hyper- parameters for new unlabeled datasets. However, this approach requires supervision, conflicting with unsupervised learning principles. Moreover, if there's s significant domain gap between histor- ical and current (etasetseexampled by the significantly different performance distributions in Figure 1p. meta-learning may underperform. Lastly, meta-learning typically focuses on single detection model, making it challenging to compare various candidate models.
It is worth mentioning that previous hyper-paramett optimization methods focus the unsuper- vised outlier detection problem where transductive learning is performed to recognize the outliers in the training set. In contrast, the UAD problem considered in this study is to train a model on "normal" dataset to detect the newly incoming anomalies in an inductive learning manner. Exist- ing model selection methods for unsupervised outlier detection may fail when encountering UAD because the training set contains no outliers or very few outliers. For example. the inlier priority assumption does not hold for the early stopping method proposed by (Huang et al.] [2024). this paper, we focus on the hyper-parameter tuning and model selection for UAD methods and take advantage of Bayesian optimization (Snock et al. 2012).
Note that hyperparameter tuning is challenge in other unsupervised learning tasks well. (Halkidi & Vazirgiannis 2001 Poulakis| 2020) Fan et al. 2022) presented some clustering validity metrics to guide the typer-parameter search using grid search or Bayesian optimization. Particularly, Fan ct al. (2022) proposed AutoSC to select models and hyperparameters for spectral clustering. Lin & Fukuyama (2024): Liao et al. (2023) also used Bayesian optimization to tune the hyperparameter in dimensionality reduction methods such as t-SNE.
3 AUTOMATED UNSUPERVISED ANOMALY DETECTION (AUTOUAD)
For completeness and clarity, we present the following definitions of UAD and AutoUAD.
Definition (UAD) Consider a dataset X = =xx== E Rd : i-= = 1.2....,NJ NN satisfies all of the following assumptions:
No samples are randomly drawn from unknown distribution Du deemed distribution of normal data and N₁ := N No samples are randomly drawn from another unknown distribu- tion DD deemed anomalous distribution;
3

---

Published as a conference paper at ICLR 2025
For every 2; in X, whether it is drawn from Du D2 remains unknown:
No and N1 are unknown but No > N1 (e.g.. No = 10NN);
The overlap IInman & Bradley Jr 1989 between Do and Di. defined as my Di)
Jaa min (PawDo ( Pa (x) da, is sufficiently small.
Rd > R that assigns an anomaly score for an arbitrary unseen data (test data) where the higher f(x) is, the more likely æ is anomalous data belonging an unknown anomaly distribution D', where 1)(Di, Do) is sufficiently small.
Based on such an X, UAD learns a function
some scenarios, we may have N1 = O. meaning that all samples in the training dataset are normal. The sufficiently small overlaps nf(1, Do) and , mentioned in the definition are to ensure that the problem is meaningful, ie.. it is possible to distinguish between normal samples and anomalous samples. In addition, when the difference between Di and 'D1 is larger, the task is more difficult. Note that each of Do. D1, and Di may be a mixture of multiple distributions popppaouuations). which will further increase the difficulty of the task.
Remark 3.1
Definition (AutoUAD) Given a dataset X defined in Definition 7 suppose we have a set of C candidate UAD methods M == {M1, Mcc and each method M, has a set of H; hyper- parameters O; (0 " ,B0)), where 8/²) 5. and 5. denotes a constraint set of the j-th hyper-parumeter of the i-th method. Denote SM. (ar(O.) the scoring faninng function of the method M; with parameters O; Let D the joint distribution of feature and label of unseen test data and let (X,J) be a test set with Ñ samples drawn from D. Denote E(,3)) an evaluation metric of anomaly detection (e.g., AUC or Fl-score) for X, where & denotes the anomaly scores provided by a UAD method. We aim to achieve the following two goals:
.........
Goal 1: For each M; E M, solve
+
arg max (EDDYDN Hi T y=ر s/
[50) (x, : x XD)
where II the Cartesian product and I is the expectation over the randomness of X. Goal 2: Let ((M) == -x ((x [E(), (f,,(x()) x E x811 and M(O*) =
(Mi(()), ................................ Mc(Oe)), solve
M²"0"" = arg max Q(M(0))
(2)
M(@ JEM(er)
where (*00") is the best among all candidate methods with their best hyper-parameters.
Remark 3.2 An example for M is {KNN, OCSVM, DeepSVDD Particularly, for M2, namely OCSVM, the set of hyper-parameetess is θ₂ {u, 'keree'', r, on where, for example, the search space for y is s/ (0, oc), though we may reduce the search space according to experience.
AutoUAD defined by Definition 2 challenging problem due to the fact that the training data X unlabeled and there no available prior knowledge about the test data X. What we can do is designing metric V based on M, and X' as a surrogate for (( (x(O.)
X))) i...,
V(M, x ( ( [ (f,. : x
(3)
where g: : R > R. is ideally monotonically increasing function.
3.1 RELATIVE TOP-MEDIAN METRIC
In any real-world dataset, there are typically some data points that are far from the majority of the data distribution, especially when the number of data points becomes large. These data points, though not necessarily true anomalies, often exhibit characteristics that make them appear closer to
According to scikit-lcam (Pedregosa al. 2011 is the training error bound, 7, oo are kernel coefficient, and 'ernel" is the choice of kernel function.
4

---

Published as a conference paper at ICLR 2025
F7
Test AUC: 0.78
200
A1 Test AUC 0.99
Test 0.61
Aust 1.00
Count
Coupt
110
Count
100-
10-
0.00
153
5.04
255
10:00
65
128
185
6.52
1645
2,05
2226
1132
2403
3255
4004
630
Training Aromaly
Traiiin Anomaly
Trainin Aramaly
Traning Anomaly
(a) Low-AUC OCSVM (b) High-AUC OCSVM (c) Low-AUC DSVDD (d) High-AUC DSVDD
model on breastw
model on breastw
model on lymph.
model on lymph.
Figure 2: Histograms of training anomaly scores of models with low and high testing AUCs. This conforms to Assumption T
A larger RTM (Definition 3) corresponds a higher AUC.
anomalies than the majority of the data. For example, in a dataset following Gaussian distribution II or R3, most data points cluster near the mean, but a few data points naturally occur in the tail regions of the distribution. While these tail points are part of the normal data, their distance from the majority can make them resemble potential anomalies. They should be assigned relatively high anomaly scores by good UAD model. Based this observation, we make the following assumption.
Assumption A good UAD model will assign low anomaly scores to the majority of data points and will assign relatively high anomaly scores to the minority of data points.
Actually, Assumption [ aligns with the way many UAD models designed. For example, in OCSVM, the decision boundary is shaped to enclose the majority of normal data points tightly, leaving the points near or beyond the boundary with higher anomaly scores. To further show the feasibility of the assumption, we present an empirical comparison between models with high AUC and low AUC in Figure 2
where "DSVDD" stands for Deep SVDD (Ruff al., 2018).
Assumption 1 and Figure 2 provide the following insights:
The majority of data points, close to the median of the distribution, are presumed to represent normal behavior and should be assigned low anomaly scores.
A small percentage of data points (e.g., the top T%) farthest from the majority are more likely to deviate from normality and should receive relatively higher anomaly scores.
Thus we propose the following metric approximate g (E( (ff(((()) x X))))
Definition 3 (RTM) Given UAD method M with set of hyper-parameter θ trained on dataset
X, the output anomaly scores are = {81, 82, SN3 where 8; = JM ( and a; E X. Denote
8(0) for sorted values with 8(1) I 8(2) S ... 8(1/100N)
8(N)- The relative top-median
(RTM) is defined as
(/an(( 2 ((//100N) median(s)
VRTM(M,
(4)
median 8)) +
where E (throughout this paper) is a small constant (e.g. 10 10-6 6) to avoid zero denominator,
We heuristically set = in our experiments. During hyper pprammerrrette searching, if RTM5% is larger, we say the corresponding model is better.
3.2 EXPECTED ANOMALY GAP METRIC
RTM may overlook case in which all scores uniformly distributed from small to large value. To solve this, we propose the following anomaly gap metric.
Definition 4 (AG) Let p(s) be the unknown and theoretical distribution of the anomaly score
defined in Definition 3 given by a UAD model and let & be value in the domain of s. Define Elisss <), Var(s|s < E), and of(E)= Var(s]s > E). Based on Assumption
wo(E) P(s < E). (E) =P(s 2 E). (o{)
Els|s > ()() ! there exists & such that P(s 2 f
small, and the variance of both 2 2 and
should also be small. The anomaly gap (AG) at
& is calculated by
AG(E:p(s)) = wo(E) u (E)()) (M)))) wo(E)of(() (io +
(5)
5

---

Published as a conference paper at ICLR 2025
Ideally, the choice of depends on how many training samples around the optimal decision boundary or similar to the true anomaly, i.c. drawn from D1 defined in Definition [ It relies on threshold number, e.g. top-5%. Due the non-linearity of real-world data and the lack of supervision, it is hard to select the threshold for each dataset. The metric may also be sensitive to an arbitrarily selected threshold. To reduce the sensitivity, design use relaxed threshold Sthr indicating a range where data may draw from D and propose the following soneeteeddaomaly---ee
Definition 5 (EAG) Given the output anomaly scores 8, let Smax max(s) and let 8thr be thresh- old value such that 8 < Smax- Suppose E, follows a uniform distribution with p({) = 1/($max 8shr). The expected anomaly gap (EAG) is defined as
VEAG = -E[AGGEE)(()) 2 sphrl - [- AG(E)p(E)dE-
AG(E)dg. (6)
8max
8thr
To determine Str for EAG, we make the following assumption.
Assumption 2 (Low Quality Data Upper Bound) At most 20% data points in the training set are similar the true anomalies, which the UAD model gives them higher anomaly scores.
This is very mild assumption for UAD. If there is too much low-quality data, the UAD model may overfit them, leading to bad performance. Limiting the proportion prevents the model from being overly influenced by low-quality data, ensuring that the learned normality patterns remain accurate. In many practical scenarios, such as medical diagnosis and mechanical fault detection, noisy or wrongly collected data constitute a small portion. So, it realistic and applicable make the 20% upper bound assumption. Following Assumption 2 we set Sthr as (0.8,, where G(s) is the cumulative distribution function (CDF) of and G G-1(0.8) is the inverse CDF evaluated 0.8, representing the 80th percentile. Since we do not know p(s) but we have s sampled from p(s), we finally calculate EAG by the discrete form (M, X) = 0.2N Σg (G 8). Sequential and vectorized implementations for calculating EAG are shown in Algorithms and of Appendix
3.3 NORMALIZED PSEUDO DISCREPANCY GUIDED SEARCH
Previous methods for evaluating UAD models have primarily relied on utilizing the training data's anomaly scores 8 solely. While these approaches are sometimes useful, they suffer from the follow- ing limitations. First, internal evaluation metrics such as RTM and EAG may overfit the training set, as they only observe the data available during training: Second, both RTM and EAG introduce an ad- ditional
(a relaxed threshold). While the sypee-parrmmters can be set to reasonable value under proper assumptions, they tend to be sensitive when applied to complex datasets.
We propose a new method called normalized pseudo discrepancy to address these limitations. Recall that our goal is construct surrogate metric V to approximate the expected test performance B[E(), [fm, (a:(O,)
&])] This can be done if we could generate reasonable proxy for X. NPD generates this proxy via taking advantage of a randomly generated dataset in addition to a subset of the original training data, aiding in the evaluation by incorporating more diverse perspectives and reducing the risk of overfitting, without using any real anomalies.
Definition 6 (NPD) Suppose M is the black box UAD model and @ is the corresponding hyper- parameters. We randomly split the training data into two subsets Xrmn and X with sizes N M and M respectively. The UAD model trained on Xayn Let pern R2d and of B2 be the mean vector and the variance vector of Xevn. We generate dataset Nzen consisting of M samples drawn from an isotropic Gaussian N (ptray diag(o (rrn))) Then, we compute the anomaly score vectors for Xvat and Xgen iee. 8yal [M ()) and 8gen [M((aa)))) respectively. Finally, we calculate the normalized pseudo discrepancy (NPD) as
VVPD (Mean(s Mean( 8 )²
2(Var(8 (gen)) + Var( (Sva)) +
We argue that X U Agen is a good proxy for x and NPD is an effective proxy of the expected test performance (E(()), (fM, (a)(::) i E 2})) by answering the following questions.

---

Published as a conference paper at ICLR 2025
Why use Gaussian rather than other distributions for Xgen? Real-world data often non- Gaussian but are often close to Gaussian to some extent (Zulawiński et al. 2023 Khokhlov & Hulot 2017 Weinberg & Cole 1992 Marko & Weil 2012). We hope that dgen are comparable to Au while having high diversity. It known that within all distributions with the same vari- ance, the Gaussian distribution has the largest entropy, meaning the highest diversity. Theorem
T shows that the uncertainty of Xgen is always higher than that of Xm In Figure we illustrate The correlation coefficient matrices of Xm and Xgen. and compare the distribution of normalized Xun with standard Gaussian distribution. Although they have the same mean and variance, Xmm is from skewed distributions, and the features in Xun are correlated.
Can Xzen contain samples very close to real anomalies? ? In Figure the distributions of Xum and Xgen are a little similar but substantially different, which indicates that X contains anomalies close to normal data, raising the difficulty of detection. We visualized Xgen in Figure 7 where Xgon can contain samples close to the real anomalies. Although there is the case of not, The Xgen helps the UAD model build a tight decision boundary around normal data. What if some samples in Xge are very close to normal data? In Theorem 2
we show that NPD is upper bounded by the score gap between normal data and anomalies. When maximizing NPD, the gap also becomes larger even if X Agen contains some normal data.
Will NPD overfil the training data? No. NPD is calculated from Xval and Xgen that are indepen- dent from the model training data Xmm-
Denote Dmm the variables of Xm and Tgen the variables of Xyem the entropy of Ugen is, almost surely, higher than the entropy of Dow i.e., H (Izen) > H (Imm).
Theorem
X U X gon where X and X are normal, X vat and X are anomalous. The anomaly scores denoted by Saat statt SQ 8gmn 8en accordingly. NPD has the following properties:
Theorem 2
Let Xnal = Xaa U Ny and Xgon
(a) Letting A = ( ( Mean(
[2 M
Mean (oo))) and A = =01 (1 Mean (8) (oo))
X
Mean (sau)) it holds that
VNPD(M, S
(8)
(Var( syat) + Var (gen)) + c/2
(b) NPD is translation-invarian and scale-invariant w.r.. the scoring function fM when = 0.
Theorem 2 shows that NPD is upper bounded by the score gap between normal data and anomalies. Specifically, A and A' represent the squared gap between the mean anomaly scores of normal and anomalous data across Xval and Xgen- As NPD is maximized, the gap between normal and anomalous data also be- comes larger, meaning clearer separation is achieved. Note that in the worst case, NPD is always zero for all UAD models, which how- ever indicates that Xmm Kaal and Xgen are from the same distribution, i.c. [N diag om)).. As the distribution of Xmm is already identi- fied as (Hu,, diag(o (o )., it is easy to detect anomalies without hyper-parametert
Cormbriin contfriect Herris
D Oxttiuu Comperison for Peatures ESTTE
Thaming
3.4
Figure 3: The left is the correlation coefficient ma- trix of Xm in the dataset 'letter'. shows that the distribution of Xm is far away from an isotropic Gaussian. The right the distribution comparison between the normalized features and standard Gaussian. The majority of features are skewed, indicating the Xgea is not similar to the Xmm.
Geometry Interpretation for NPD From geometry perspective, the outline of Xgen is hyper- sphere, denoted as 5d-1, in Rd, centered at the mean of Xmm- Sd-1 is the tightest hyper-sphere enclosing almost all of the points of Xm. In practice, features in normal data are usually correlated such that the volume occupied is small in the hyper-sphere. The rest of the space could be covered by potential anomalies from Dí. We visualized 4 real-world datasets in Figure Based on the fact that Gaussian mixture model is universal approximator of densities, present a theorem (Theoremm3) in Appendix[Btoo show that the overlap between the distribution of normal training data and the distribution of Xgen could be effectively bounded.
7

---

Published as a conference paper at ICLR 2025
Features Visual.
Veual.
Visull satmage
Reatures Visual.
Normal Generated
hormal Generated
Nurmal al Generated
Normal Generated
Visualization of 3 randomly selected features of Xum Xgen and the hyper-sphere S sup- ported by Xgen Notice Xm only occupies part of the hyper-sphere. Potential anomalies could appear in the rest of the hyper-sphere space.
Figure 4:
Theoretical Error Rate Bound of NPD TheoremFinn Appendix[ppreet presents an error bound of FPR and FNR for AutoUAD with NPD, which further supports the effectiveness of our method.
3.4 AUTOUAD VIA BAYESIAN OPTIMIZATION
Bayesian optimization (BO) (Jones et al. 1998) is an effective tool for hyperparameter optimization in supervised learning (Snock al.) 2012: Klein et al. 2017). It optimizes hyperparameters sequen- tially, using past results to guide future iterations. Compared to grid search, BO is more efficient, grid search faces exponentially growing
particularly for models with many hyperparameters, search spaces and high computational costs. For example, using grid search to solve State I of the
AutoUAD problem (Definition 2) the number of training models M, is I |s Additionally, grid search requires predefined hyperparameter grids, which often involve guesswork. We use BO with the Tree-structured Parzen Estimator (TPE) (Bergstra et al. (01T) for optimization. Details of BO based X') are in Appendix F as illustrated in Figure
EXPERIMENTS AND RESULTS
Benchmark Datasets and UAD Methods We here show the effectiveness of AutoUAD with four UAD methods including shallow method OCSVM (Schölkopf et al. 2001) and three deep methods AutoEncoder (AE) (Aggarwal 2016). DeepSVDD (Ruff et al.J 2018), and DPAD (Fu ct al. 2024), though there are more UAD methods in the literature. The experiments are conducted on 38 widely-used real-world benchmark datasets collected by ADBench (Han et al. 2022) and DAMI (Campos al., 2016), excluding those with 50,000 more samples due to time constraints, though our method is scalable to larger datasets. The dataset information is summarized in Table of Appendix B Similar to (Shenkar & Wolf (022). we randomly split 50% of normal samples for training and used the rest with anomalous data for testing. All data are standardized using the training set's mean and standard deviation. The split of each dataset the same across different UAD methods. We repeat all experiments with 5 different data splits and report the results with mean and standard deviation. Note that the hyperparameter tuning and model selection are done with the training data only (and the validation data used in our NPD is part of the training data), while the test data is only used to evaluate the final model. Please also see the flowchart in Figure
Baselines and Evaluation Metric We compare the proposed three metrics, RTM, EAG, and NPD,
with three existing internal evaluation metrics, including ModelCentrality (MC) (Lin et al. 2020). MrTS(Ma al.) 2023). and Mass- Volume (MV) Excess-Mass (EM) GGoix 2016). which uses a Mass-Volume
similar assumption to RTM and EAG. Besides, we also compare three model selection baselines, Default uses the default pyper-pasameters adopted by the corresponding UAD algorithm, Random picks a set of tlyper-parameet and is an upper bound of the performance. For the performance metric, we report the area under the ROC curve (AUC) and Fl score of the selected model. The calculation of the Fl score is consistent with (Seenkar & Wolf 2022 Qiu et al. 2021). The implementation details are in Appendix G
randomly from grid search pool, and Max operates as an oracle
'Due space limitation, the results on more UAD methods are in Appendix
8

---

Published as a conference paper at ICLR 2025
0.71
DCSVV antihyyud
10275
0.75
AE hma
1.01
3.02
Dees5VDO on glas
7881
1.00
DIKO lenouphere
14:1
0.72
20.5
0L72
1186
45.12
A6C
MBC
AJC
A-C
0.43
F2
37.33
0.44
3.23
3.36-
71
2532
0.60
38335
Perition
Perstion
Ferstio
(a)
(b)
(c)
(d)
0.92
0CSUM satellte
0.53
AB
2.70
SvepS/00 veritrra
1.00
DRAD cardio
2.5
0.31
0.51
3.30
228
0.74
0,.44
2.40
AVC
ANC
0.27
0.44
1.24
0.14
-111
024
-100
BAG
DAG
liration
Raraton
(c)
(f)
(h)
0.28
CC5VM
0.62
41.65
Doco SVED gamma.
DAAD
0.27
0.39
17.03
0.94
02
16.31
418
AUC
AUC
0.31
0.48
-0m1
1P0
6P0
liration
Meration
tonttin
Mtettion
(i)
(k)
(l)
Figure 5: AUC, F1, and the proposed evaluation metrics of OCSVM, AE, DeepSVDD, and DPAD on different datasets in each iteration of BO. The first row (a, b. c, d) are the results of RTM; The second row (e, f, g. h) are the results of EAG; The last row (i. k, 1) are the results of NPD.
Table I: Mean AUC and Fl scores through 38 datasets. Default uses the default hyper-paramens Random is the expected value of the grid search. The p-value of the paired t-test shows the statistical significance compared with Random. The best performance is bold and the second best is underline. p-value* the comparison between NPD and the second best.
Method
OCSVM
AE
DeeDSVDD
DPAD
Metric
AUC
F1
AUC
F1
AUC
F1
AUC
FI
Max
mean:istd
85.75 63.33422.11
84,86 16.0 64.11
80.18118.11 57.63-28.7
83.38.1149 24.
Default
meandstd
16.4
56.68
73.90=21.7 14.45+19.9 48.73-26.6
48.93=28.4
73.65::18.5 48.66225.1
Random
mcan:tstd
14.71=16.4 48.90-2228
81.8
57 25.666
14.24 46.57421.1
RM/MV
meandistd
45.1:22..55.711122
16.08
59.67
74.431121.7
47.63-29.5
72.59.18.55 46.28125.9
p-value
0.0065
0.0437
0.0156
0.04304
0,3301
0,3694
0.1385
0,6731
Eean
76.52.120.8 53.15:128.9
16.
37.72.17..7
73.44
44,87
21.77
74.00
44.24127.4
RTM(Ours)
p-value
0.1768 0.0415
0.7653
0.7414
0,4833
0.0325
0.0935
0.1684
meandssd
77.17=19.5 51.95:127.5
12.35=16.9
57.16:126.2
18.56
46.53=27.3
71.14119.3
46.16:22699
BAG(Ourr)
p-value
0.1333
0.1354
0.5727
0,3866
0,1674
0.0446
0,9189
0,7773
std
84.03+15.5
60.26:+26.2
13.58=11..0
59.73-225.4
74.38+20.1
48.31=27.8
16.3
55.67+23.7
NPD(Ours)
p-value
0.0000
0.0000
0.0212
0.0701
0.8838
0.6024
0.0000
0.0000
p-value+ 0.0011
0.0014
0.181130
0.6954
0.5909
0.1657
0.0001
0.0406
Intuitive Validation of AutoUAD via BO In Figure 5 we present the performance in each itera- tion of our proposed metrics RTM, FAG, and NPD with four UAD methods. The setting is detailed in Tf Appendix [ We see that in most cases, higher metrics correspond to higher AUC and F1, meaning that they are effective surrogates for the expected model performance on unseen data.
Comparative Study We compare the performance using BO to search for the best model of RTM, FAG, and NPD with Max, Default, Random, and EM/MV in Table The consensus-basee metrics not adaptable for BO because they are designed to select the most reliable model from set of models, while the performance of each model is not a consideration. The average performance of AUC and Fl through 38 benchmark datasets indicates that methods have the highest AUC and F1. NPD significantly outperforms other methods when applied to OCSVM, AE, and DPAD. The results for each dataset are in Appendix Thus, we achieve Goal 1 of AutoUAD.
To see the effectiveness of our methods for Goal 2 of AutoUAD, taking Figure a an example, we NPD consistently has strict positive correlation with AUC and F1, where the Spearman rank

---

Published as a conference paper at ICLR 2025
Normaked Ware
INW
O05IN 3MD JerpoiD
OC9VM SPA DeepRyon
OC94M BPA3 DrepGe03
BAAD DIADRODD
Figure 6: Comparison EM/MV, RTM, EAG, and NPD on test AUC of selected model BO hyper-parameter search in 4 datasets. V is caleulated the training set, and AUC is calculated on the testing set. Both AUC and V have been normalized. The NPD is positively proportional to the AUC. We can select the best model through different UAD algorithms.
TSNE Visual. antyythmia
TSNE Visual.
TSNE Visual.
TSNE Visual. breastw
Generated
Generated
Val Normal Generated Anomaly
Val Normal
Generated
Anomaly
(a) arrhythmia
(b) glass
(c) letter
(d) breastw
Figure 7: T-SNE visualization of X Xgens and true anomalies. The generated Gaussian samples guide the model in learning a decision boundary around normal data. coefficient is always 1. In contrast, RTM and EAG do always monotonically increase the AUC and Fl due to overfitting of the training data and the additional
Unsupervised Outlier Model Selection (UOMS) Study Instead of using BO to optimize the select the best pair of {M, 0} among a pool of op-
hyper-parameters, the goal UOMS tions (usually a grid search pool). We use the same grid search pool in Table 4 and compare the performance with the consensus-be bassed metries, MC and HITS, and IForest with the default hyper- parameter. The size of our grid search is much larger, up to 2667 models, compared with previous seen that
works Huang et al. (2024); Ma et al. (2023). The results are reported Table 2 our metrics RTM and NPD consistently outperform the baselines indicating our method can achieve goal 2 in AutoUAD among a grid search model pool. MC and HITS obtain a worse performance because the consensus- based methods are not designed to be surrogate in equation They will be affected by the majority of models. If the majority model has a lower score, the selected model will thereby perform worse.
Data Visualization See the t-SNE (Van der
Table 2: UOMS comparison through 38 datasets. The notation meanings are the same as Table I
Maaten & Hinton 2008) results Figure
5 CONCLUSION
Metries
AUC
F1
Max
mean:istd
89,28=11.
73.33=22.0
Default (IPorest)
78.088 T8.6
27.2
This paper studied the problem of hyper- parameter optimization and model comparison for unsupervised anomaly detection. We pro- posed three surrogate metrics for the expected model performance on unseen data without us- ing any information of anomaly. Particularly, the last metric NPD showed significant im- provement over the baselines in the experi- ments of 38 benchmark datasets. The success of NPD stems from its simplicity and theoreti- cal ground. Nevertheless, the highest NPD did not always correspond to the best model performance. Future work may continuously try provide more effective surrogate metrics.
Random
meandistd
75.15 16.2
49.71+23..2
EM/MV
mtan:istd
75.79=19.2
31,09:127.70
meunistt
70.74118.4
44.17+25.7
HITS
mein-istd
73.44=188. 18.8
48.13-427.1
mean:istd
79.39=195 19.6
56.84=28.1
RTM (Ours)
p-value
0.1308
0.1227
meansistd
76.5::17.4
46.25:125.0
BAG (Ours)
p-value
0.5670
0,3453
sed
83.49-16.4
59.30-126.2
NPD (Ours)
p-value
0.0000
0.00M0
p-value"
0.0014
0.0003
10

---

Published as a conference paper at ICLR 2025
ACKNOWLEDGMENTS
This work was supported by the General Program of Guangdong Basic and Applied Basic Re- search under Grant No. No.202441515011777 the National Natural Science Foundation of China under Grant No.62376236, the Guangdong Provincial Key Laboratory of Mathematical Founda- tions for Artificial Intelligence (2023B12120) 12000001),,, Shenzhen Science and Technology Program ZDSYS200306260911002222 and Shenzhen Stability Science Program 2023.
REFERENCES
Charu C Aggarwal. Outlier analysis second edition, 2016.
Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta, and Masanori Koyama. Optuna: A next-generation hyperparameter optimization framework. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2019.
Peter L Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk bounds and structural results. Journal of Machine Learning Research, 3(Nov):463-482, 2002.
Peter L Bartlett, Dylan J Foster, and Matus Telgarsky. Spectrally neural networks. Advances in neural information processing systems, 30, 2017.
margin bounds for
James Bergstra, Rémi Bardenet, Yoshua Bengio, and Balázs Kégl. Algorithms for paramterr optimization. Advances in neural information processing systems, 24, 2011.
Markus M Breunig, Hans-Peter Kriegel, Raymond T Ng. and Jörg Sander. Lof: identifying density- based local outliers. In Proceedings of the 2000 ACM SIGMOD international conference on Management of data, pp. 93-104, 2000.
Jinyu Cai and Jicong Fan. Perturbation learning based anomaly detection. Advances in Neural Information Processing Systems, 35, 2022.
Guilherme Campos, Arthur Zimek, Jörg Sander, Ricardo JGB Campello, Barbora Micenková, Erich Schubert, Ira Assent, and Michael E Houle. On the evaluation of unsupervised outlier detection: measures, datasets, and an empirical study. Data mining and knowledge discovery, 30: 891-927, 2016.
Xueying Ding, Lingxiao Zhao, and Leman Akoglu. Hyperparameter sensitivity in deep outlier detection: Analysis and scalable hyper-ensemble solution. Advances in Neural Information Processing Systems, 35:9603-9616, 2022.
Xueying Ding, Yue Zhao, and Leman Akoglu. Fast unsupervised deep outlier model selection with hypemetworks.. In Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pp. 585 0355-96,770 2024.
Sunny Duan, Loic Matthey, Andre Saraiva, Nick Watters, Chris Burgess, Alexander Lerchner, and Irina Higgins. Unsupervised model selection for variational disentangled representation learning. In International Conference on Learning Representations, 2020.
Jicong Fan, Yiheng Tu, Zhao Zhang, Mingbo Zhao, and Haijun Zhang A simple approach to automated spectral clustering. Advances in Neural Information Processing Systems, 35:9907- 2022.
Dazhi Fu, Zhao Zhang, and Jicong Fan. Dense projection for anomaly detection. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pp. 8398-8408, 2024.
Nicolas Goix. How to evaluate the quality of unsupervised anomaly detection algorithms? arXiv preprint arXiv:1607.011522 2016.
Markus Goldstein and Seichh Uchida. A comparative evaluation of unsupervised anomaly detection algorithms for multivariate data. PloS one, 11(4):=0522133 2016.

---

Published as a conference paper at ICLR 2025
Sachin Goyal, Aditi Raghunathan, Moksh Jain, Harsha Vardhan Simhadri, and Prateek Jain. Droce: Deep robust one-class classification. In International conference on machine learning. pp. 3711- 3721. PMLR. 2020.
Maria Halkidi and Michalis Vazirgiannis. Clustering validity assessment: Finding the optimal par- titioning of a data set. In Proceedings 2001 IEEE international conference dala mining, pp- 187-194. IEEE, 2001.
Songqiao Han, Xiyang Hu, Hailiang Huang, Minqi Jiang, and Yue Zhao. Adbench: Anomaly detection benchmark. Advances in Neural Information Processing Systems, 35:32142-32159, 2022.
Wenpeng Hu, Mengyu Wang, Qi Qin, Jinwen Ma, and Bing Liu. Hrn: A holistic approach one class learning. Advances in neural information processing systems, 33:19111-19124, 2020.
Yihong Huang, Yuang Zhang, Liping Wang, Fan Zhang, and Xuemin Lin. Entropystop: Unsu- pervised deep outlier detection with loss entropy. In Proceedings of the 30th ACM SIGKDD Conference Knowledge Discovery and Data Mining, pp. 1143-1155 2024.
Frank Hutter, Lars Kotthoff, and Joaquin Vanschoren. Automated machine learning: methods, sys- lems, challenges. Springer Nature, 2019.
Henry Inman and Edwin L Bradley The overlapping coefficient measure of agreement between probability distributions and point estimation of the overlap of two normal densities. Communicattion Statistics-theon theory and Methods, 18(10):385133877 1989.
Donald R Jones, Matthias Schonlau, and William J Welch. Efficient global optimization of expensive black-box functions. Journal of Global optimization, 13:455-499 1998.
Andrey Khokhlov and Gauthier Hulot. On the cause of the non gan-siassi distribution of residuals in geomagnetism. Geophysical Journal International, 209(2): 2017.
Aaron Klein, Stefan Falkner, Simon Bartels, Philipp Hennig, and Frank Hutter. Fast bayesian op- timization of machine learning hyperparameters on large datasets. In Artificial intelligence and statistics, pp. 528-558885 536. PMLR, 2017.
Yin-Ting Liao, Hengrui Luo, and Anna Ma. Efficient and robust bayesian selection of hyperparam- eters in dimension reduction for visualization. arXiv preprint arXiv:2306.0m 00357, 2023.
Justin Lin and Julia Fukuyama. Calibrating dimension reduction hyperparameters in the presence of noise. PLOS Computational Biology, 20(9)x<101242) 2024.
Zinan Lin, Kiran Thekumparampil, Giulia Fanti, and Sewoong Oh. Infogan-cr and modelcentrality: Self-supervised model training and selection for disentangling gans. In international conference on machine learning, pp. 6127-6139. PMLR, 2020.
Fei Tony Liu, Kai Ming Ting, and Zhi-Hua Zhou. Isolation forest. 2008 eighth ieee international conference on data mining, pp. 413-422. IEEE, 2008
Martin Q Ma, Yue Zhao, Xiaorong Zhang, and Leman Akoglu. The need for unsupervised out- lier model selection: A review and evaluation of internal evaluation strategies. ACM SIGKDD Explorations Newsletter, 25(1):19-355 2023.
Nicholas F Marko and Robert Weil. Non Non-gaussian distributions affect identification of expression patterns, functional annotation, and prospective classification in human cancer genomes. PLoS One, 7(10)e469335 2012.
Henrique O Marques, Ricardo JGB Campello, Arthur Zimek, and Jörg Sander. On the internal evaluation of unsupervised outlier detection. In Proceedings of the 27th international conference on scientific and statistical database management, pp. 1-12, 2015.
Ali Nawaz, Shehroz S Khan, and Amir Ahmad. Ensemble of autoencoders for anomaly detection in biomedical data: A narrative review. IEEE Access, 2024.
12

---

Published as a conference paper at ICLR 2025
Thanh Trung Nguyen, Uy Quang Nguyen, et al. An evaluation method for unsupervised anomaly detection algorithms. Journal of Computer Science and Cybernetics, 32(3):255-22 272, 2016.
Guansong Pang, Chunhua Shen, and Anton Van Den Hengel. Deep anomaly detection with deviation networks. In Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining, pp. 353-362, 2019.
Guansong Pang, Chunhua Shen, Longbing Cao, and Anton Van Den Hengel. Deep learning for anomaly detection: A review. ACM computing surveys (CSUR), 54(2):1-38, 2021.
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. 2017.
Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, Thirion, O. Grisel, M. Blondel, P. Pretten- hofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825-28333 2011.
Stanislav Pidhorskyi, Ranya Almohsen, and Gianfranco Doretto. Generative probabilistic novelty detection with adversarial autoencoders. Advances in neural information processing systems, 31, 2018.
Giannis Poulakis. Unsupervised automl: study on automated machine learning in the context of clustering. Master's thesis, Паιεεиотiiи Iεspacćς 2020.
Chen Qiu, Timo Pfrommer, Marius Kloft, Stephan Mandt, and Maja Rudolph. Neural transformation learning for deep anomaly detection beyond images. In International conference machine learning, pp. 8703-8714. PMLR, 2021.
Lukas Ruff, Robert Vandermeulen, Nico Goernitz, Lucas Deecke, Shoaib Ahmed Siddiqui, Alexan- der Binder, Emmanuel Müller, and Marius Kloft. Deep one-class classification. In International conference on machine learning, pp. 4393 4402. PMLR, 2018.
Bernhard Schölkopf, John C Platt, John -ayoor, Alex J Smola, and Robert Williamson. Estimating the support of a high-dimensional distribution. Neural computation, 2001.
Tom Shenkar and Lior Wolf. Anomaly detection for tabular data with internal contrastive learning. In International Conference on Learning Representations, 2022.
Jasper Snoek, Hugo Larochelle, and Ryan P Adams. Practical bayesian optimization of machine learning algorithms. Advances in neural information processing systems, 25, 2012.
Yiyou Sun, Yifei Ming, Xiaojin Zhu, and Yixuan Li. Out-of-distribution detection with deep nearest neighbors. In International Conference on Machine Learning, pp. 20827-2084H PMLR, 2022.
Anil Osman Tur, Nicola Dall' Asen, Cigdem Beyan, and Elisa Ricci. Exploring diffusion models for unsupervised video anomaly detection. In 2023 IEEE International Conference on Image Processing (ICIP), pp. 2540-2544. IEEE, 2023.
Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008.
David H Weinberg and Shaun Cole. Non Non-gaussian fluctuations and the statistics of galaxy clustering. Monthly Notices of the Royal Astronomical Society, 259(4))652-694, 1992.
Christopher KI Williams and Carl Edward Rasmussen. Gaussian processes for machine learning. volume 2. MIT press Cambridge, MA, 2006.
Xudong Yan, Huaidong Zhang, Xuemiao Xu, Xiaowei Hu, and Pheng-Ann Heng. Learning semantic context from normal samples for unsupervised anomaly detection. In Proceedings of the AAAI conference on artificial intelligence, volume 35, pp. 31 10-3118, 2021.
13

---

Published as a conference paper at ICLR 2025
Xinyi Zhang, Naiqi Li, Jiawei Li, Tao Dai, Yong Jiang, and Shu-Tao Xia. Unsupervised surface anomaly detection with diffusion probabilistic model. In Proceedings of the IEEE/CVF Interna- tional Conference on Computer Vision, pp.
2023.
Yunhe Zhang, Yan Sun, Jinyu Cai, and Jicong Fan. Deep orthogonal hypersphere compression for anomaly detection. In The Twelfth International Conference on Learning Representations, 2024.
URL httpp:: http://eee/ooounndcccccooooo//oo
Yue Zhao and Leman Akoglu. Hpod: Hyperparameter optimization for unsupervised outlier detec- tion. AutoML, 2024.
Yue Zhao, Zain Nasrullah, and Zheng Li. Pyod: A python toolbox for scalable outlier detec- tion. Journal of Machine Learning Research, 20(96):1-7, 2019. [RLhtttp:// oorg
papers/v20/19-011.ngg 1tml
Yue Zhao, Ryan Rossi, and Leman Akoglu. Automatic unsupervised outlier model selection. Ad- vances Neural Information Processing Systems, 34:4489 4502, 2021.
Yue Zhao, Sean Zhang, and Leman Akoglu. Toward unsupervised outlier model selection. In 2022 IEEE International Conference Data Mining (ICDM), pp. 773-782. IEEE, 2022.
Arthur Zimek, Erich Schubert, and Hans-Peter Kriegel. A survey on unsupervised outlier detection in high-dimensional numerical data. Statistical Analysis and Data Mining: The ASA Data Science Journal, 5(5):363-387, 2012.
Bo Zong, Qi Song, Martin Renqiang Min, Wei Cheng, Cristian Lumezanu, Dacki Cho, and Haifeng Chen. Deep autoencoding gaussian mixture model for unsupervised anomaly detection. In Inter- national conference learning representations, 2018
Wojeiech Zulawinski, Katarzyna Maraj Maraj-ZZygmat, Hamid Shiri, Agnieszka Wylomańska, and Ra- dostaw Zimroz. Framework for stochastic modelling of long-term non-homogeneous data with non-gaussian characteristics for machine condition prognosis. Mechanical Systems and Signal Processing, 184:109677, 2023.
A EAG ALGORITHM
The sequential and vectorized algorithms for calculating EAG shown in Algorithm [ and Al- gorithm 2 where p in the algorithm is set to 0.2. The time complexity O(N) with prefix sum computation of mean and variance. So, EAG is scalable large dataset.
Algorithm Expected Anomaly Gap
Input: maximum percentile p. anomaly score vector s;
1: + s.size; A +- 0;
2: Top PN sort descending order:
3: for & {1...,, p.N. do
4:
Ho m kt); μI <-means((kk)) r-variianneee k)): 01 -
5:
6:
A A
A + k(N k) - 1n 11) + (N -k)o? +c;
> equation
7:
end for
8:
A A/pN:
Output: EAG value A through different k;
14

---

Published as a conference paper at ICLR 2025
Algorithm 2 Expected Anomaly Gap Vectorized
Input: Percentile anomaly score vector
1: +- 8.size; < 0;
2: Top pN sort in descending order;
3: Σ f Prefix (reffxsSu(s)) sum f -[-
4: n
wo n/N; W1 < 1 W1i
5: Mg + Σ/n; μ4 + (sum ) re.eevrse;
6: E -PrefixSume
3))
7: o - - 0 Σ E/n)/(n (n 1 c);
> Sample variance
8: of [- Σー ssm Σ) O (sum ne/.n.everse))/ (n.reerrseeeeeeeeeee..eee... 1 E);
9: σ quer
+ Wow; (10- (1) O 11);
mim + woo + w1
1I: A of /mter/ 0 intraa
Output: mean (A pNN]::
B BOUND OF OVERLAP BETWEEN DISTRIBUTIONS OF XTRN AND XOEN
Here we provide the bound of the overlap between the distribution of normal training data and the distribution of Xgen The theorem is proved in Appendix D
Theorem Let Pum be the density function of the training data and Pmix Ei= WWN(H, E,) be a Gaussian mixture model to approximate Prm such that log[Prrm (x)) log(p (x:)) S holds for any E Rdd Denote Pzen the density function Xgo Suppose Amiin (anin(,))))))) S Amax (E;) X,
|A:ll ã. B |Ell for all i [T). Then the distance between Pim and Pgen measured by the KL-divergence, satisfies The following inequalities:
(a) (Pgel (PgenllPum) (Pm))
$ 27' (d λ 2
dA t)
+ E;
(b) DKL (oom((Pmllleee) Pee exp(-E)(-d log d- 2(T 2(T-1)A
C BOUND OF ERROR RATE OF NPD
In this section, analyze the generalization error of our AutoUAD with the evaluation metric NPD using tool of the Rademacher complexity, which is defined as follows.
Definition (Rademacher Complexity) Let H be set of real-valued functions defined over a set X. Given sample S _ and (o1....,On)) on), where a,s independent uniform random variables taking values (-1,+h +1}. The empirical Rademacher complexity of H is defined as follows:
2
E
osh (x:) IS (II,..., {m)
he
To calculate the false positive rate (FPR) and false negative rate (FNR), we need to determine threshold for the anomaly scores given by a model M. For convenience, we give the following definitions.
Definition 8 Let (M(2)) 1(= c) be threshold functionn where c. >> O is the threshold. Let
FM = TM JM- R2d - {0, 1} and FM be the class of FM defined by M with hyperparameters O. The FPR and FNR the unseen testing data then defined as FPR Ex (Fx(x) and FNR Ex>D;; [1 (x)) respectively.
Without loss of generality and for convenience, we assume that in the problem defined by Definition N2 0, and in NPD, M = N/2. The following theorem (proved in Section D.4 provides bound for the FPR and FNR on the unseen testing data.
Theorem Based on Definition
g letting
A minxex fM(x)),
min fM(()
min X.. JM (x), maxxe [M(x)
maxxex [M((X) and
15

---

Published as a conference paper at ICLR 2025
1.2 + 2(c 5c) Exex fM(x)/N, then over the randomness of Xyat and Xgen the following inequality holds with probability least 1 20:
2
V2 2 V
FPR + FNR H K
N VNPD (M, +
DKL DxL(Dgen) (D()
(9)
|l0g xr
R R + Rx (FM) +61
NV
In the theorem, the empirical Rademacher complexities Rx., (FM) and Rx (FM) can be explic- itly bounded for any M (e.g., OC-SVM and AE) with any hyperparameters θ and the corresponding technique is fairly standard in the literature (Bartlett & Mendelson 2002, Bartlett et al., 2017). Due to this, together with the fact that our work AutoUAD is a framework not specialized to sin- gle M, we will not show the M-specific computation of Rx.,, (FM) and Rxyo (FM). Note that (Denlgell can be further bounded by the similar approach used in Theorem 3 Our AutoUAD finds the model with the largest VNeD and hence has the potential reduce the talse positive rate and false negative rate. In addition, a smaller DKL. (D (Di) or complexity of M (measured as Rx. (FM) and H. Xxp (FM)) may also lead to a lower error rate.
D PROOF FOR THEOREMS
D.1 PROOF FOR THEOREM II
Proof: Let (()) be the density function of Gaussian distribution with mean μ and variance o² and let p(z) be the density function of an arbitrary distribution with the same variance o². Without loss of generality, we assume that f (ar) has the same mean of μ as g(z), because differential entropy translation invariant. Denote the entropy of g and f as If (g) and (f) respectively. The Kullback- Leibler divergence between and satisfies
0 $ (KI())lg))) = 1- f(x) log
f(x)
da = --=--(())
(()))og((()))))
(10)
g(x)
We have
H(g) / g(x) log g(x)dr
E NlogNN (n, (u,
E log (2TO²)
11/2
(x pu)2
exp
20
(II)
log (2TTO²)
+
E
[(I - [4)²]
2
20
1
log (2TO²)
+
2
Note that according to the basic definitions, 1 f(x)dr = and 1 [(x) 1d o².
Then, for the second term of RHS of (TO), we have
/ f(x) log(g()))dr= =
& (x-w)²
[(x)
da
V2TO22
100
[(x) (-(x-- uu)² dx
f(x) log
dx +
(-=220
22m0²
20
σ²
(12)
log (2iTO?) 2
(log (2TTO?) + 1)
-- (g)
16

---

Published as a conference paper at ICLR 2025
Combining the results of (00 and 12
obtain
H - H()) 2 0.
(13)
This inequality indicates that with given variance, the entropy of the Gaussian distribution the largest amongst all distributions.
For Nua. denote the density function of each variable as f., i l...., For Xgen we denote the density function of each variable as 9s. i = 1,..., d. Since 91, ........ 9a or the corresponding variables more formally are independent, we have
H [1 92. ................................ ...
Σ H(g)).
(14)
Since 91 91.92.... ..... . 9d or the corresponding variables more formally not independent almost surely, we have
..........
H(S1, fa,
H(f:).
(15)
Appying
13 to each i and combing them with (14) and 15 we arrive at
H (ig ................................ ) > Hf,, fa).
(16)
We finish the proof by changing the format of entropy using variables rather than density functions. Q.E.D.
D.2
PROOF FOR THEOREM
Proof:
For (a), have the following derivation:
(Mean val)) Mean (Mean($gen)) ggen))
(N, 2( 2(Var(8 (8val) + Var Var(8gee)) +
Mean( (aa)) M
[x M
Mean
1.20 A
Mean son)
1.2 M Mean
s
gen
Varl S + Var Var(s (Sgen) +
2( [ M
Mean (s
1. M
Mean (s8 (sfon) ) + 2( 1.2
Mean ($)m))
12 M
Mean (s ())))
2 [Var( + Var( Var((8en)) +
x2 M
Mean
(m))
1x M
Mean
s
+
[x2
M
Mean (s)m))
1 M
Mean (a))
(Sai))
Var (Sgea)) + c/2
(17)
For (b), co and ej two arbitrary real numbers and let the transformed scoring function be I' = ff + Cp- Then denote the anomaly score given by s' as s'. We have the following derivation:
(Mean( (s - Mean (sean(ss..n) ssnm
VNPD(J")) 2( 2(Var(s'(.) + Var(s'
((c1 Mean + cu) (c1 X Mean 8gen) + cu))
(18)
2(c Var( + of x Var((gen) +
ct x (Mean Mean (syen))
20 x (Var( Var( +E
When O, we have VNPD(f) VfrD(f). This finished the proof.
Q.E.D.
D.3
PROOF FOR THEOREM
Proof: (a) The KL-divergence between Peen and Prm
DKL (PeoullPun) / Peea (x) log Peen (x)
(19)
Pum
17

---

Published as a conference paper at ICLR 2025
where (gen(x))
(2x)4/2| Syz 175 exp (- Mggn) TE - (Mgen)). In addi- log (Pmix (z))
tion, [log(rm (2))
I holds for any a. where Pmic (2)
E We (2x)44/12))"" exp (- 2 (x M4) Ej (x= m.))..
We have
D (Peal Pun)
-Bpon log(P - log(Pum))
pp log - log(pmix) + E)]
(20)
=c + D DEL (Pgonlllee lmmxx))
Using Jensen's inequality, we obtain
T Wi Wis: Σ;]]
DEL (Pgen [Pmix) - Eyp [oog - log
1=1
< E Epp [log Σ
log (Niss, E.))
(21)
pma [log(pem Log(NV ).)
For each i, is not hard to show that [log(Pgen)
Bpn
log(N (og(N( [1)
log
Σ
(x -
(x0)
En (x - mo) +
Wi 2
(x - mi)
2x (x - mi)
2
Eal"
1/T
27
1
log
Σ
1
E pgn
[x- mo)
Enj (x - [m)] +
Wi R pyy (x - mR) Σn¹ I (x [1:)
2
Eo!
1/T
2T
2
1
EN W4
1
[xx po) (x - mo) Σの +
wi (wo - -mi)² Ta)TT Ei¹ (mD mi)
log
tr( tr(pppn
2
E
1/T
2T
2
+
W/
tr
E
Σo
2
1
Σj m1
d
log
wy (p0 p1) E (po ui) + m to) En)
2
Σul
1/T
T
(22)
Since 140 0, En
La it follows from 22 that
Epp [log (Pgen)))) ) Mog(N((ss) m]
(23)
log Σ,1 T
+ wi Σj ps + w,,t((E;1)
Combining (21 and (23). and using Amin (Ei) > A and Amin (Ei) S X, we have
d 1
D (Peen Plmix)
[ws log [Er| wife T Σj ps + wxtr(E,1]]
2T
1
Σ
wi (dlog - + dl d
2T
1
[dlog A + -1 max ||ا 1| + dd d
(24)
<
+
wi
2
2T
i=1
1
d Ā + + max || + d dd-1
=
+
2
27
d
1
< 2T
2 +
(dlog
+ x 1 + dx
18

---

Published as a conference paper at ICLR 2025
Combining 22 and (20). we complete the proof.
(b) First, log(pan(z)) (pmix (z)) S E implies that
Pim (x)
Pmixx Pmix(a:) (x)
I exp(s) and
S exp(s).
(25)
Pmix (nixx(r)))
Pim (im(
Now we obtain
DKL (PomllPgen)
pmm log((pm)) log(Pgen)]
2 exp( -E pmm. (Pai)) - log( - E]
(26)
exp(-=) D (pmix Pgen) exp(-e)
For convenience, let q: == N (u,, Ei), then pmix Σ Diml wiq.. Using Jensen's 's inequality, we have
DKL (Pmix (Pmix))Psen) - E Pua. [log(
wiq:) log(Pgen)]
T
EE
wi log((;)
log (P
(27)
Pinx
E Prn [log(g.")) - log (og(pgd) pp((T) )
1=1
For each i, we derive that
[oog(0.") )
(pg
gon
P
log
Σg
1/2
wi
(x - m4i) Σ (x - m2) +
1
(x - no) T EnO² (x -mo)
2
Σ
w
2
2T
1
log
Σol
1/T
Wi
Bpns
(x - ui) T Mx² (x - un) + 2T
Epmi
[(x- -o)² Eo (x - Hom
2
W1
2
1
log
Σol
1/T
wi
w,tr(BEng
[(x (x-) mi:)" (x - mi) )
2
W//
(x- - me) T Ex¹² (xx mm)
j7
T
1
Wi (11 Mo)T T Eσ¹¹ (me m4) +
1
Σ
tr 2 ززح
2T
2T
j=1
j=1
1
log
Σn
1/T
w w/ E(e;
(1r m.) -. (11 - p4) - - E
2
ΣS 14
1+1
1
(1 ma)
Eg (11 11)
1
Σ tr( in(_)'2) Σソ
T
T
j=1
j=l
1
1
2
wi log| E wfd wia1
T
02
+
T + c
(28)
where 1 Ejes (1:-1:)² Σ (1: m.) S (T - 1)A max,j || pull. 02
Ejt: (1(2,110 "2,) < (T - 13 c3 - (w; mo0 En' (m, mo) > T min, || ||. and
Σ/= tr(E)) Σ,) 2 Tg. By the way, log Σd| - dloo X. It follows that
T
(P (Pmixllleg)))
2 Σ
(-w, ī wid d - 2w - - 1- B
i=1
2 dlog ā d 2(T 1)x 3- +
(29)
19

---

Published as a conference paper at ICLR 2025
Finally, we have
DEL (Paml Pgen) 2cxp(-e)(-dlog) x 2(T 1)1-13 -T - 1)A + - +T) eexp(
(30)
Q.E.D.
D.4 PROOF FOR THEOREM 4
The following a standard Rademacher complexity bounds (Bartlett Mendelson 2002).
Theorem (Rademacher Bound) Let H be class offunctions mapping = Y to [0, and S = (Zı,..., Zm finite sample drawn i..dd according to a distribution Q. Then, for any > 0. with probability at least over samples of size m, the following inequality holds for all H
log
R(h) < R(h) Rss +31
2m
Proof: Since Xva are sampled from Do. using the standard Rademacher complexity bound given by Theorem 5) we can obtain
2 N
log 3 N
Ex [F(())] S Σ FM(x) (FM) 31/
(31)
XEXxal
where |.Kaall
N/2 and the inequality holds with probability at least 1 5.
For convenience, we let g(x) = 1-Fx(xx) and let p1 (x), be the density functions of D4, Dgen respectively. We have
E Ex-Dy [x(x] = -ExxD [xxx]] + Bx-DD [9(x)] EX (x(x))
<X [x(]]] / 9(x)pI / 9(x)p2(x)dx
<Ex~D [g(x)] + / ((x)lpi - (2(x)xxx
(32)
Ex [g(x)] / [x( - (xx(x)
V2 V (Di.(Deen) (Di),
R [x)]
2
where the last inequality used the fact that the total variation distance can be upper-bouned by using the KL-divergence.
Using Theorem 5 for Ex~D, [x())], we have
2 (1-)((x)) + Rx (FM) + +3/ N
log 2
ExwDD [1 FM(())
(33)
N
X
where |Agen| N/2 and the inequality holds with probability at least - 8.
Combining
31 and 33
we have
FPR + FNR
Σ FM(x)
2 N XEX
(a-FM((x) + 2 V DKI, (
V2
DD
(34)
log 2
Rx,, (F + (FM) + 61
N
which holds with probability least 1 25.
20

---

Published as a conference paper at ICLR 2025
As TM is threshold function, have
FM(x)= sgn(f(x) c)
(35)
2
where è is a threshold defined by the model M with hyperparameters O It follows that
FM(x) S c- fm((x)
(36)
and
1 FM(x) S 1 [m(x)
(37)
where & could be any value and ç maxxeXpn fM(x).
Now we can derive that
2
Σ
2 FM(x)
Σ (1- Fx((x)
N
N
XEXxi
XEdx
c fm(x)
Σ (1+ (1+0--fMis) -m((x))
N
N
x
X
(38)
Se-1
2
Σ [M(x)
2
Σ [m(x)
N
XEd
X
Σ - (
Recall that 2 ExEx, fM(x) mcan sa)) and
2 ExExpo fm(x)
mean(Sgen) and
mean().at) S mean Sgen), follows from 339h that
Σ
(M
Σ
(1 (1- (M))))
N
N
X
X
c-
(mean (Spen) -eeanane -mean(Sva)))
(39)
Σ 1+0+ (c 1f
+
N
XEX
--c (M)
Var( and 2 Exexm (1 (c -)fm(x)) = 1+ @ + (c-1 mean (gge)).
where g @Var((e (gen) (agn))
Based on the von- SzokefalviiNaagy'' inequality, have
2( 2(mmax(8 8gon) min (8pen)) + (max(8val) - min(8va)))
e
N
(40)
4A2
442
N
where A = min (ggen) min( 8gen). max - minn(saa)):
Combining the above result with (39 and (34 and letting 0.2 we obtain
2A
v2 V
FPR + FNR SK-
VNDD +
DxL (Dgenl | DD))
CVN
(41)
log
+ Rx. (FM) Rx (FM) + +61
This completed the proof.
Q.E.D.
21

---

Published as a conference paper at ICLR 2025
Table 3: 38 real-world tabular datasets tested. 2016
represent the dataset is from DAMICampor et al.
Dataset
# Sample
Dim.
% Anomaly
ALOI
49534
27
3.04
anthyroid
7200
6
7.42
arrhythmia"
452
274
14.60
breastw
683
9
34.99
cardio
1831
21
9.61
Cardiotocography
2114
21
22.04
fault
1941
27
34.67
glass
214
9
42.21
Hepatitis
80
17
16.25
InternetAds
1966
1555
18.72
Ionosphere
351
32
35.90
landsat
6435
36
20.71
letter
1600
32
15.10
Lymphography
148
18
4.05
magic
19020
10
35.16
mammography
11183
6
2.32
mnist
7603
100
9.21
musk
3062
166
3.17
optdigits
5216
64
2.88
PageBlocks
5393
10
9.46
pendigits
6870
16
2.27
Pima
768
8
34.90
satellite
6435
36
31.64
satimage-2
5803
36
1.22
shuttle
1013
9
1,28
SpamBase
4207
57
39.91
speech
3686
400
1.65
Stamps
340
9
9.12
thyroid
3772
6
2,47
vertebral
240
6
12.50
vowels
1456
12
3,43
Waveform
3443
21
2.90
WBC
223
9
4.48
WDBC
367
30
2.72
Wilt
4819
5.33
wine
129
13
7.75
WPBC
198
33
23.74
yeast
1484
8
34.16
E DATASETS SUMMARY
We conducted our experiment under the UAD dataset setting with benchmark datasets commonly used in UAD research. The dataset information is shown in Table 3 Similar to (Shenkar & Wolf, 2022). we randomly split 50% of normal samples for training and used the rest with anomalous data for testing. All data are standardized using the training set's mean and standard deviation. The split of each dataset the same across different UAD methods. We repeat all experiments with different data splits and report the results with mean and standard deviation.
F AUTOUAD VIA BAYESIAN OPTIZATION
Bayesian optimization (BO) (Jones al. 1998 has emerged powerful tool for hyper-parameter optimization in supervised learning (Snock et al., 2012) Klein et al. 2017). BO optimizes hyper- parameters sequentially by leveraging historical search results guide the next iteration. Com-
22

---

Published as a conference paper at ICLR 2025
pared with grid search, BO offers significant advantages, especially for models with many hyper- parameters.
Given black-box function h Z - IR BO aims to find optimal point 2" Z that minimizes globally, and typically proceeds through three steps. First, BO identifies the most promising point 2++1 E arg max; (=) using numerical optimization, where ap(h) is acquisition function (e.g., Expected Improvement) that depends on prior p(h) (e.g.. Gaussian processes (Williams & Rasmussen, 2006)). Next, BO evaluates the potentially expensive and noisy function Ut+1 ~ h(2++1) + (0, o²) and updates the observation
D, {[21, 21)..... (zt, yt)} with the new sample (2++1, 1). Finally, it updates both the prior p(h) and the acquisition function (p((h) using the updated dataset Dr+1, allowing the process to iterate toward the optimal solution.
We sequentially maximize the proposed evaluation metrics via BO instead of defining a hyper- parameter grid grid search. Suppose we have set of different models for UAD method M, iee, FM =
fm: where O is the hyper-parametert in fM. Let
(,,))) == A(ffx(2(9)), i= 1.2,..., H,
where A can RTM, FAG, or NPD, and X' denotes the dataset (either training set or validation set). Then we use BO to find
+ = arg min (O;))), O,E3,
where S; denotes the set of constraints. We can find the best model for each UAD method. Finally, we get the best model with its best Parzen Estimator (TPE) (Bergstra et al. 2011). Then, the Expected Improvement (EI) acquisition function is
using equation 2 we use Tree-structured
Ely f (y" Oyy(y (V--))) 1" (y" y) 1)) p(ellip(u)) dy, p(0)
where h0), and y² = hmin is the best function value known. Let p(u < v²) and p()) = 5 (yy))d = -(( + (1- ()) We have
Ely. TV (0) (0) >
p p(u)dy
0 (1 (1+
(( (1)))
((6)
where (()) is the density formed by using the observations (e(1) such that the corresponding loss
(() was less than y², and (e) is the density formed by using the remaining observations.
G IMPLEMENTATION DETAILS
Implementation All experiments are implemented by Pytorch (Paskee et al., 2017) on NVIDIA RTX 3090 and AMD Ryzen l'hreadripper 3990X platform. For OCSVM, AE, and DVeDSVDD, we utilize popular PyOD implementation (Zhao et al. 2019). For DPAD, we use the code provided by the authors. We utilize optuna (Akiba et al. 2019) to implement the Bayesian optimization with Tree-structured Parzen Estimator (TPE) sampler (Bergstra et al. 201T). For each run, we perform 500 searches. We consider the core 5 For MV/EM, MC, and HITS baseline, we utilize implementation in Ma et al. 2023) For Max baseline, the highest performance among all observations reported. For Random baseline, the grid search pool is listed in Table 4 For NPD, we set the size of validation data as M 0.3N. For all e, we set
of each UAD algorithm. they listed in
10 10-9
H HYPER-PARAMENT
OF UAD ALGORITHMS
We first describe each hyper-parameter of 4 UAD algorithms studied in this paper. For deep learning- based algorithms, we only consider the core hyper-parameter such as hidden dimension, regulariza- tion, etc, because deep UAD algorithms are usually not sensitive to optimization's 's perrmeearaeeters (learning rate, batch size, etc.).
https://github..e http
23

---

Published as a conference paper at ICLR 2025
Table 4: UAD Algorithms studied for hyper-parameter sensitivity and grid search pool construc-
tion. We search for two core syper-parameten for each algorithm while keeping the other hyper- parameters as default. 2667 UAD models are constructed in the pool.
UAD Algorithms
Searched [Grid Values]
# models
OCSVM
[0.01, 0.02, .... 11, 7: 100, 50, 10, 5, 1.0.5,0.. 0.1. 0.01, ,.... 10
1500
AutoEncoder
weight decay: 0.5, 0.01, .... 10 100-: S1. hidden dim.: [16, 24,
256]]
403
DeepSVDD
A: [0.9, 0.5, 0.1, 0.01, ..., 10 J. hidden dim.: [16, 24, 32.32. .... 256]
403
DPAD
A: [1000, 100, 50.... 10 1. 7 [1000, 500, 100, 50. 10
361
Table 5: Elyper-paramette Searched in Bayesian Optimization.
UAD Algorfthms
Hyper-parameters Searched (Value Range)
OCSVM
kernel, v(00, 1), 7(1e- - 6, 100), (0 1000) weight decay(le - 6, 0. hidden dim. 1(16, 256). hidden dim 2(16, 256)
AutoFincoder
DeepSVDD
A(le - 6, 1), hidden dim. 1(16, 256), hidden dim. 2(16, 256)
DPAD
A(le 6, 1000), k(3, 1000), 7(1e - 6, 100) hidden dim. 1(16, 256), hidden dim 2(16, 256)
We repeat the description in Scikit- Baakiii-Leamm(eereggsaa et al. 2011). v: An upper bound on the fraction of training errors and a lower bound on the fraction of support vectors. y; Kernel coefficient for rbf, poly, and sigmoid. on: Independent term in kernel function. is only significant in poly and sigmoid. Kernel: kernel type to be used in the algorithm.
OCSVM:
AE: Hidden dim. 1: the width of the first and the last hidden layer of the neural network. Hidden dim. 2: the width of the second and the penultimate hidden layer of the neural network, which is known the size of the hidden representation. Weight decay: the regu- larization term to control model complexity.
DeepSVDD: We do not use an AE for pre-training to save time. is computed based on the network initialization first forward pass. Hidden dim. 1: the width of the first and the last hidden layer of the neural network. Hidden dim. 2: the width of the second and the penultimate hidden layer of the neural network, which is known as the size of the hidden representation. A: weight decay regularizer on the network parameters.
DPAD: Hidden dim. I: the width of the first and the last hidden layer of the neural network. Hidden dim. 2: the width of the second and the penultimate hidden layer of the neural net- work, which is known as the size of the hidden representation. A: weight decay regularizer the network parameters. y: hyper-parameter in dense projection distance calculation. k: k nearest neighbors used in finding anomaly score.
Unless specified we train deep UAD methods with 256 batch size, Adam optimizer, 0.001 learning rate, and 200 epochs. For AE we train 100 epochs. For DPAD we use larger batch size of 4096.
We list the Syper-ppaametter searched for grid search and UOMS model pool construction in Table We list the hyper-parameters considered in BO in Table 5
I DETAILED RESULTS FOR EACH DATASET
Table I Ii Section reports the average AUC and Fl results through 38 datasets. We list the results of each dataset in Table o and Table 7 for AUC and F1, respectively.
J BO RESULTS ON MORE UAD ALGORITHM
We perform AutoUAD via BO on five additional conventional deep UAD algorithms, including PLAD(Cai & Fan 2022). NeuTraLAD Qiu et al. 2021). HRN et al. 2020). DROCC(Goyal et al. 2020), and <Senkare & Wolf 2022). Due to time constraints, we test them on 14 datasets with smaller sizes (number of samples less than 1000), including arrhythmia, breastw, glass, Hepatitis, lonosphere, Lymphography Pima, shuttle, Stamps, vertebral, WBC, WDBC, wine, and WPBC. The results compared with Max, EM/MV, RTM, EAG, and NPD are reported in Table g seen our metrics work well with complex deep UAD methods.
24

---

Published as a conference paper at ICLR 2025
Table 6: AUC (%) score of EM/MV, FAG, NPD, and RTM on 38 benchmark datasets with 4 UAD methods. Average results are reported through 5 different random data splits.
DPAD
Bep8V100
ENDYY
RIM
EMSNV
KIM
EHIMV
201
EAQ
AIDE
56 5518100
5138111
01/13112
18 14644833
76,9944
7500833
1852:14
18 1m
68
10-6-11
17:0-14
66
06 66.7969
N1:0010
6670441
06-01-1
7688822
Stange
53.13:1.
5448:14
9335243
0234.13
60--11
WERC
WFBCC
1123234
0341224
1156:54
1030650
45.7355
Wil
09:05
2601-11
18576361
13
1584-16
13:33:13
1496-11
09044110
18 18200
99 13360t1
04.55200
1400:17
05.0122
16:6--11
12/0-4
13
52
1716
13.834.
6401:1.1
18.2222
4441532
4120559
4130:35
34.44110
15:3-45
1831-11
2310213
11:4:22
12:1125
1740230
10/09400
0003340
19
00001000
6665-1
08
96
13:12225
19.7700
S1.51333
12:0101
1138-114
61.9122
05 51:52113
18:5-111
16-0-11
17:4:31
07:4417
13
13
98
1430-0
06.00
10001111
55
96 W35-85
4401211
0100114
54312-5
13
63461113
0509115
9165.11
0737386
0736117
MJ
5113:65
W5/9114
4:38114
Table 7: F1 (%) score of EM/MV, EAG, NPD, and RTM on 38 benchmark datasets with 4 UAD methods. Average results are reported through 5 different random data splits.
EMIMY
SBO
RTM 233100
RTM
EMIMV 1:212244
RTM
DMMY
NHO
KTM
ALIX
3334E1.
11333313
806158
1339224
55.5257
26674145
1010-119
90912511
Piss
24 787
04:0122
(346-14
61
63
67.88177
66.7
6386163
0734185
11.001
1411-11
Sange
55 2020055
6321543
1832-11
31.115-00
51
1510-15
WEBC
WHBC
15 33302-1
3151214
1142233
3338261
11.5266
Wil:
2137-50
S18151
07165
411414
166-3
santorai
11:3-33
40200:3
6630111
1182213
3182214
12/2:14
454051
413321311
45
64
55:0-1
9::0-11
W.0--1
1152-61
130921
6336021
10:5-1.1
60.77775
154113
45 (6627
10:3-11
4451:11
01:01111
56
11 111644
2400431
1630641
12:11:2
11:5.15
71.0.11
1111111
10/6
4180252
31302:13
4140:33
11558155
45
4430211
H000/10
00000000011
15
12.
161419 71 1135
100
1235252
01 01.55345
54.3-233
40
11882143
145211
3454216.
3.312333
15055511
3622211
54
11155555
1340-01
01
01:3436
5161-1
13:4-14
110074
1310-15
16
22:1147
4176-211
16
15 161401
90
09
22
4-522213
2612-4
11
111121200
1110:100
3
24
1300-60
1130-14
17
6146-51
11 11-373
035-11
666-71
71 11-511
01312110
8530
25
01.0119
4131110
1400162
1125679
45111A
11 01105253
44 6080532 7601159 25.11133
9
06.0122
555645
415e11
25

---

Published as a conference paper at ICLR 2025
Table 8: Comparative study of Bayesian optimization through 14 datasets on additional UAD algorithms. Mean AUC and F1 scores are reported. The best performance is bold.
Method
PLAD
AAD
HRN
DROCC
SCAD
Metric
AUC
AUC
AUC
FI
AUC
FI
AUC
FI
Max
7.084 19.3 57,89+
24.5
74.24
16.0 52044
17. 68
49.26+
26.5 36. + 24.8 86
15.9 63,15+ 18.8
EM/M
41200+25.7
23.574
26.86+
33.7
22.9
78.17
20.5
53.87+
27.60+24.7
24.7
16.86+
16.4 77.55+ 19,4
27.1
OTM(Ous
52 12.48-19.8 17.33+ 16.5
60.3+
17.0
33.454
80.43:
39,48+
26.4
5::1+2222
21.52
74.92+
EAG(Ours)
59.22+-21.4 38.64-244.0
68.4066.444423.
45.494-28.6
19.224-188.22
35.914332.9
30.39+32.33
25.50+-25.1
18.8
49.74+-26.7
NPD(Ous))
47.234-24.3
30.31+223.2
70.64+1184
39.484-28.2
64.81+-27.5
46.07+-33.3
26.97+223.1
14.464-16.0
The core hyper-parameters considered for AutoUAD via BO are listed below.
coefficient to control the perturbation. Hidden dim. I: the width of the first and the last hidden layer of the neural network. Hidden dim. 2: the width the second and the penultimate hidden layer of the neural network, which is known as the size of the hidden representation. Weight decay: the regularization term to control model complexity.
PLAD:
NeuTraLAD:: number transformations. т: temperature for contrastive loss. Hidden dim. the size of the hidden representation. Encoder dim.: Hidden dimension of encoder module. Transform dim.: Hidden dimension of transformation module.
HRN: n: order of the H-regularization. coefficient of the H-regularization. Hidden dim. the size of the hidden representation. Weight decay: the regularization term to control model complexity.
DROCC: ": parameter vary projection. r: radius of hypersphere sample points from. lamda: weight is given to the adversarial loss. Hidden dim. the size of the hidden representation.
SCAD: k: kernel size for sliding window. temperature for contrastive loss. Hidden dim. the size of the hidden representation. Weight decay: the regularization term to control model complexity.
K EFFICIENCY OF PROPOSED METRICS
We test the running time efficiency of datasets of different sizes. Notice that MC and HITS have theoretical computation time complex with O(LN²) and O(LLN), respectieely, where t is the iteration in HITS, and L is the size of UAD model pool, i.c. L [[M, I M, O2 $00H The running time results for selection through 200 candidate UAD models are shown in Figure seen that NPD is the most efficient method.
26

---

Published as a conference paper at ICLR 2025
Efficiency of Different Metrics
104
EM/MV
NPD
RTM
MC
10a
EAG
X
HITS
102
Time (seconds)
10
100
10-1
10
10-3
10-4
102
10
104
10s
10c
Number of Samples in the Dataset
Figure 8: Rumning time efficiency comparison.
L FLOWCHART OF AUTOUAD
27

---

Published as a conference paper at ICLR 2025
training phase no ground tuuth label
UAD
hyper-parameters
testing phuse
NPD details
M,
10 0. 2.0
(2,5) lesting dataset inference
split
11
10
model training
X' training dataset
Bayesian Optimization
M' (
for each MM
@.
aanoally
X ~ -N diagio ))
M, !2)
M,
V(M, jente-iineemal evaluation (RTM, EAG, NPD)
$ evaluation (AUC/FI metric) using testing
Manl-M NPD evaluation by Fq.
X training dataset
model training
using training
Figure 9: Working flowehart of AutoUAD. Training Phase: Candidate UAD models M con- tain multiple UAD algorithm {M, M2, Mc.) ). and each algorithm M, has multiple candidate
hyper-parameters {0(1), 6 ..... 0 :...), 0 e I s(i), For each Mi, the Bayesian opti- train the UAD model. After training converges, the model evaluated by (semi-)internal metric (RTM, EAG, or NPD) using the training set where ground- truth label is required. The evaluation output ((M,, X') provides feedback to the Bayesian optimizer to select new Sryper-parametern for the next round. Testing Phase: After training, obtain the best model M,(e;) for each UAD algorithm. By selecting the algorithm with highest V, we obtain M*(*). During testing, the selected model is evaluated by (AUC/F1) using the testing set with the ground-truth label to show the effectiveness of our methods. NPD Details: The training dataset randomly split into Xr, and Xv before training phase. An extra dataset Xgen is generated from an isotropic Gaussian N ((trr, diag (rr )), where Mern and ofrn the mean and variance vectors of Xern- Xern is used to train the UAD model. After the model training, anomaly scores Seal and 8gen computed from Xeo! and Xyen, respectively. Then, NPD is calculated taking 8 and 8gen as input using equation 7 We argue that Xyen can contain samples close to real anomalies so that NPD can show the significance of evaluating good UAD model. It is justified in Theorem 3
mizer will select ayper-parametery
M SENSITIVITY OF IN RTM
Due to time constraints, we perform sensitivity analysis varying 7 [50, 30, 20, 10, 5, 3, 1] tested on 37 datasets (ALOI is dropped due to its size) using DPAD and OCSVM. An average result is summarized in Figure 10 is seen that the performance varies much as the change of r, especially in DPAD results, and imperial. It also reveals the internal evaluation metric is still sensitive to the additional hyper- parameter.
and т show very different results, making the choice 7 difficult
28

---

Published as a conference paper at ICLR 2025
RTM on varying t
0.79
0.77
Avg. Testing AUC
0.75
0.73
0.71
0.69
0.67
0.65
10
RTM on OCSVM varying T
0.79
0.77
Avg. Testing AUC
0.75
0.69
0.67
0.65
135
10
20
30
50
Figure 10: Average testing AUC across 37 datasets varying 7 in RTM.
29


Reviews:
[{"review_id": "hHgUEuzuXv", "reviewer": "Reviewer_7zTy", "summary": "Unsupervised anomaly detection (UAD) faces challenges in model selection and hyper-parameter tuning due to the lack of labeled anomalies and dataset variability. This work introduces three evaluation metrics—relative-top-median, expected-anomaly-gap, and normalized pseudo discrepancy (NPD)—to estimate model performance without labels. Using Bayesian optimization, these metrics streamline UAD tuning, showing effectiveness across 38 datasets.", "questions": "Please see Weaknesses", "limitations": "", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "- The paper is well-written.\n- The focus on hyper-parameter optimization in UAD is important and well-motivated.\n- The proposed method is novel.\n- Extensive experiments effectively demonstrate the method’s effectiveness.", "weaknesses": "- The details of AutoUAD are complex and difficult to understand.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "dl6GdkniJj", "reviewer": "Reviewer_DpZ3", "summary": "This paper aims at improving hyperparameter optimization of unsupervised anomaly detection methods. To that end, it first proposes three different metrics that can be used to estimate the performance of UAD methods at testing. The metrics are used within a Bayesian optimization framework to estimate the hyperparameters of different UAD methods.", "questions": "**Questions:**:\n1. In Eq 4, if the median (median(s))  is close to zero, the selected value of $\\epsilon$ may induce some instability of V_rtm. How do you deal with those cases?\n2. In definition 1, what is $\\mathcal{D}'_1$? \n3. Assumption 2 lacks justification. What leads to conclude that 20% of the points on any given dataset are similar to true anomalies?\n4. What is $\\xi$ in Eq 5? \n5. \"In many practical scenarios, such as medical diagnosis and mechanical fault detection, noisy or wrongly collected data constitute a small portion\" -> Do you have evidence that backs this claim?\n6. If Bayesian optimization, according to the claims, works on supervised setting, how can it be used in this setup that is AutoUAD?\n\n**Comments:**\n- The formulation of definition 1 has some flaws. If one says that N points were drawn from a distribution it means that they were effectively drawn. One cannot then say that N is unknown. Perhaps what is really meant is that points in $\\mathcal{X}$ come from two different distributions, but it is not possible to determine which points come from which (D_0 or D_1). Please reformulate to the latter clearly stating where points come without the need of mentioning the quantities (N). Also, explain what is the difference between $\\mathcal{D}_1$ and $\\mathcal{D}'_1$.\n- Assumption 1 seems to be missing something : \"... will assign the majority of data points with low anomaly scores\"  to what? same for the minority. Please complete/\n- What is the point of Figure 2? it does not seem to match what is written in the text. What makes the difference between, for instance, fig 2 a and b?\n- The observations from assumption 1 and Figure 2 are somehow trivial. This is the typical assumption in most anomaly detection setups.\n- There is some text missing in definition 4 (\"there exists and the variance..\" -> there exists what?) that makes text incomprehensible. Please revise the sentence. \n\n**Minor comments:**\n- \"Histograms of training anomaly scores of models with low high testing AUCs\" -> with low and high?", "limitations": "", "rating": 6, "confidence": 4, "soundness": 2, "presentation": 2, "contribution": 2, "strengths": "- The work addresses a relevant problem that requires further attention from the literature\n- A large set of datasets are used for evaluationLarge set of datasets considered for evaluation.", "weaknesses": "- The paper lacks clarity. As pointed in the questions section, there are multiple sentences that seem incomplete, which makes difficult to understand the concept being explained. \n- There are some of the statements and claims that are contradictory across the paper. For example, the paper claims to be unsupervised and criticizes previous works that claim to be unsupervised but still require some form of supervision: this work aims at fixing this. Nonetheless, Definition 2 and remark 3.2 introduce labels for normal and abnormal points ($\\mathcal{Y}$) and in the explanation of Definition 4 there seems to be the notion of supervision as there is the idea of true anomalies. \n- Other claims lack a justification (see question 3 regarding assumption 2).\n- The assumption of an isotropic Gaussian distribution for the generated dataset may be over-simple. Real-world datasets may have more complex dynamics.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "zs4dx4p2a4", "reviewer": "Reviewer_FcaY", "summary": "This paper introduces different metrics for the optimization of hyperparameters in unsupervised anomaly detection. The authors formulate the problems of hyperparameter tuning and model selection as a maximization of the expected evaluation metric for a random dataset containing anomalies. They then propose three metrics that approximate this unknown expected value (up to some monotonically increasing function).\nThe key contributions of the paper are (i) the introduction of three evaluation metrics for hyperparameter optimization, (ii) theoretical analysis of the third metric and (iii) empirical experiments comparing the optimization based on the proposed evaluation metrics with other model selection methods.", "questions": "Comments/Questions:\n- Hyperparameter tuning is a challenge in other unsupervised learning tasks as well. Which relevant approaches are there, that are worth being added to the \"Related Work\" section?\n- The internal evaluation metrics depend on hyperparameters themselves, which does not seem to be an advantage. How robust are they w.r.t. different choices of the hyperparameters?\n- Definition 2: Are the true labels supposed to be in $\\{0, 1\\}$? Generally, the anomaly scores are not restricted to the interval $[0, 1]$. What should be passed to the evaluation metric $\\mathcal{E}?$ The anomaly scores, or binary predictions based on them?\n- L205: \"While these tail points are part of the normal data, their distance from the majority\ncan make them resemble potential anomalies. They should be recognized by a good UAD model.\" -> Should a good UAD model recognize these points as anomalies or normal data? From my understanding, a *good* UAD model should not only perform well for data close to the majority, but also for data points at the boundary of \"normal\" behavior\n- What is the intuition of using the mean and median to define RTM? It seems more natural to use the $mean(\\{s_i|s_i < s_{top\\tau\\%}\\})$ instead of the median (or the median in both cases).\n- Can the RTM be interpreted so that an error of $\\tau\\%$ is accepted? Similar to the significance level of a statistical test?\n- L249: What is the intuition behind the statement: \"RTM may overlook a case in which all scores are uniformly distributed...\"?\n- L255: \"Based on Assumption 1, there exists (?) and ...\" -> What does exist?\n- L257: What is $\\xi$ in equation (4)? There seems to be something missing.\n- What is the intuition of the definition of $AG(\\xi, p(s))$? Why are the probabilities $w_0(k)$ and $w_1(k)$ used as weights? This seems to prefer values of $k$ such that $s_k$ is close to the median of the sample $s$.\n- Definition 5: $AG(\\xi)$ is not defined, only $AG(\\xi; p(s))$ - and the latter not correctly\n- Definition 5: Why is the conditional expectation needed? $\\xi \\ge s_{thr}$ by definition, so the conditional expectation reduces the the expectation, right?\n- L288: If overfitting w.r.t. the training data is an issue, couldn't this simply be fixed by using a train-test-split or cross validation?\n- Definition 6: Here the underlying assumption is that the \"normal\" data is approximately normal distributed with distribution $\\mathcal{N}(\\mu, diag(\\sigma))$. This seems to be a very strong assumption, especially in applications with real data.\n- Definition 6: Why are the coordinates assumed to be uncorrelated (as modeled with the diagonal matrix)? Why are covariances between the coordinates not considered? This assumption is **very** restrictive and even in the examples not met (see, e.g., Fig. 3)\n- L372: Geometric interpretation: Why is the outline generally a hypersphere? That is, why is this the case if the variance across different coordinates varies?\n- Figure 6: What does the y-axis represent? The correlation of $\\nu$ with AUC? In this case, high values would be good, so the results for NPD/NDP seem ambiguous.\n- Are the final results, e.g. in Table 1, calculated based on the validation data, i.e., the same data that was used for model selection and hyperparameter tuning? If so, the results are probably overly optimistic for the model selection methods.\n- Some considered datasets contain unrealistic many anomalies. Can \"anomalies\" that occur more than 10-20\\% of the time be considered as real anomalies?\n\nAdditional Feedback\n- Definition 1: \"normal distribution\" (and the term \"normal\" in general) is ambiguous: clearly the distribution of normal data points is meant and not the normal distribution $\\mathcal{N}(\\mu, \\sigma)$, but the terms \"normal\" (as typical) and \"normal\" (as Gaussian) should be distinguished better\n- Definition 1: $p_0$ and $p_1$ are not defined - probably the density functions of $D_0$ and $D_1$?\n- Definition 2 (L. 170-171): The joint distribution of $(\\tilde{X}, \\tilde{Y})$ could be specified instead of the vague \"Let $\\tilde{X}$ be a random unseen dataset containing both normal samples and anomalous samples\"\n- Definition 2: $\\mathbb{E}$ should denote the expectation over the joint distribution of $(\\tilde{X}, \\tilde{Y})$\n- Definition 3: The notation could be simplified by using the usual notation $s_{(i)}$ for sorted values (with $s_{(1)} \\le \\dots \\le s_{(n)}$ and $s_{(\\frac{\\tau}{100} N)}$ instead of $s_{top\\tau\\%}$\n- Definition 3: $\\varepsilon$ could be avoided by the case distinction $med(s)=0$ and $med(s)\\neq 0$\n- Definition 4: \"Let $p(s)$ be the distribution of the anomaly score $s$\" -> Emphasize that $p(s)$ is the unknown, theoretical distribution, not the empirical distribution based on the observations in $s$\n- Definition 5: From Def. 4 it is not clear what the role of $\\xi$ is. If $\\xi=k$, only integer-valued are allowed. In this case, the distribution is simply the discrete uniform distribution on indices $k$ with $s_k > s_{thr}$, right?\n- Typo in Definition 6: \"varaince vector\" -> \"variance vector\"\n- The abbreviation NPD/NDP is not used consistently (mostly NPD, in experiments NDP)", "limitations": "", "rating": 6, "confidence": 4, "soundness": 2, "presentation": 2, "contribution": 2, "strengths": "The paper has a red line and the structure from internal to external evaluation metrics is comprehensible. The problem of hyperparameter optimization is well motivated, and extensive empirical experiments are provided.\n\nThe proposed metrics are, generally, clearly defined, and the approach is innovative. \n\nThis paper could be a helpful contribution to unsupervised hyperparameter tuning.", "weaknesses": "The proposed metrics seem to work only under strong assumptions, no theoretical guarantees in terms of the expected false positive/negative rate are provided and the results of experiments seem to be overly optimistic with results being reported on the same data that was used for model selection and hyperparameter tuning. \n\nGiven the current shortcomings (see below), I recommend to reject the paper. I would be willing to increase the score, given that the below concerns are addressed.\n\n---\nUPDATE: Based on the additional results and explanations provided by the authors, I suggest to accept the paper.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Decision: Accept (Poster)