TL;DR
This paper introduces the first rigorous mathematical formulation for semi-supervised anomaly detection (AD) by training classifiers on both limited known anomalies and uniformly generated synthetic anomalies. The authors prove that synthetic anomalies smooth the underlying regression function, yielding the first minimax-optimal learning guarantees for neural networks in this setting while substantially boosting detection of unseen anomalies in practice.
What Problem Does This Paper Address?
In real-world anomaly detection, practitioners often have abundant normal data and a small handful of labeled "known" anomalies. Standard unsupervised AD methods typically ignore or discard these labeled anomalies, while standard supervised classifiers overfit to the known anomaly types and fail to flag novel, "unknown" anomalies during testing.
Training purely on normal data and known anomalies leads to two fundamental failure modes:
- False Negative Modeling: In regions where the normal data density is low but the known anomaly density is even lower, the density ratio explodes, incorrectly classifying unseen low-density regions as normal.
- Insufficient Regularity in Learning: Even when data distributions are continuous, the true regression function $f_P(X) = \mathbb{E}[Y|X]$ can suffer from severe jump discontinuities across decision boundaries, making it impossible for neural networks to approximate effectively and resulting in vacuous theoretical error bounds.
Methods
The authors propose Semi-Supervised AD with Synthetic Anomalies (SA):
- Mixture Anomaly Distribution: Alongside normal data $T$ and known anomalies $T^-$, the model incorporates synthetic anomalies $T'$ drawn uniformly across the input space: $X' \sim \text{Uniform}(\mathcal{X})$. This models the anomaly distribution as a mixture: $$h_2(X) = \tilde{s} h_-(X) + (1 - \tilde{s})$$
- Restoring Smoothness: Because the synthetic distribution adds a positive baseline across the entire domain, the denominator of the regression function cannot vanish, ensuring $f_P$ remains continuous ($C^r$ smooth) and well-behaved.
-
Theoretical Guarantees: Using a smoothed activation function ($\sigma_\tau^k$) and empirical risk minimization over a hypothesis class of ReLU networks, the authors prove that the excess risk converges at the minimax optimal rate (up to logarithmic factors): $$\mathcal{O}\left( (n_{\min})^{-\frac{\alpha(q+1)}{d + \alpha(q+2)}} \right)$$ where $n_{\min} = \min\{n, n^-, n'\}$.
-
Practical Implementation: To avoid vanishing gradients, practical implementations use shallow networks (e.g., depth 3), Leaky ReLU activations, and logistic loss, adding $n' \approx n + n^-$ synthetic samples.
Datasets
The authors evaluated their approach across five diverse benchmarks spanning tabular, image, and language modalities:
- Tabular (Cybersecurity & Medical): NSL-KDD (network intrusion detection), Thyroid (vitals dataset), and Arrhythmia (cardiac vitals).
- Vision (Manufacturing): MVTec AD, converted into 1024-dimensional tabular features using frozen DINOv2 embeddings.
- Language (Safety): AdvBench (a combination of 10 text harm benchmarks), converted into 384-dimensional tabular representations using frozen Sentence-BERT embeddings.
Key Insights and Ideas
- Synthetic anomalies as regularizers: Rather than attempting to mimic realistic anomalies, uniformly distributed synthetic anomalies act as a geometric prior over the "open space," ensuring low-density regions default to anomalous.
- Overcoming Bayes discontinuity: Separable data with zero margin naturally causes $f_P$ to jump between $+1$ and $-1$. Adding uniform synthetic anomalies prevents this jump and guarantees continuity.
- Generalizing unsupervised AD: Setting the known anomaly mixture weight $\tilde{s} = 0$ reduces the framework exactly to classical density level-set estimation (unsupervised AD).
- No signal dilution: Empirically and theoretically, adding a balanced number of synthetic samples ($n' = n + n^-$) does not dilute the supervision signal of known anomalies; in fact, it often improves known anomaly detection.
Key Results
Evaluating Area Under the Precision-Recall Curve (AUPR) and AUROC demonstrated consistent improvements:
- Vanilla Classifier (VC vs. VC-SA): VC-SA outperformed baseline classification on 19 out of 24 unknown anomaly categories and 5 out of 7 known anomaly categories.
- On NSL-KDD, VC-SA improved AUPR on unknown DoS attacks from $0.345 \to 0.793$ and Probe attacks from $0.180 \to 0.649$.
- On Thyroid, unknown anomaly AUPR increased from $0.565 \to 0.817$.
- Generalizability to SOTA: Integrating synthetic anomalies boosted other classification-oriented AD frameworks:
- ES-SA beat standard ES on 16/24 unknown and 7/7 known categories.
- DROCC-SA beat standard DROCC on 19/24 unknown and 5/7 known categories.
- Autoencoders: Methods incorporating autoencoder bottlenecks (ABC, DeepSAD) yielded mixed results, indicating that synthetic anomalies are most beneficial for direct classification architectures.
Limitations and Future Work
- High Dimensions and "Open Space": Uniform sampling scales poorly to extremely high-dimensional spaces without feature reduction, requiring exponential volume coverage.
- Architecture Dependency: Autoencoder-based methods (such as DeepSAD) experienced dilution of known anomaly signals, showing the principle does not transfer universally across all AD loss designs.
- Alternative Formulations: The authors note that semi-supervised AD could alternatively be framed as a constrained optimization problem (e.g., density level-set estimation constrained by known anomaly error), which remains an open comparison for future research.
Summary updated