Source-linked AI summary
Classification-Based Anomaly Detection for General Data
Liron Bergman, Yedid Hoshen
TL;DR
Anomaly detection requires identifying deviations from previously observed patterns, despite limited access to examples of unknown anomalies. GOAD unifies one-class and transformation-based classification through open-set distance modeling and random affine transformations. The method achieves reported improvements across multiple datasets and remains robust under a small percentage of anomalous training samples.
Problem
Unknown anomaly examples are often unavailable, limiting supervised anomaly detection and creating generalization problems for transformation-based methods outside the training distribution.
Method
GOAD combines open-set classification with transformation-based feature learning, using random affine transformations and distance-based centers for transformed subspaces.
Results
GOAD significantly improves over the state-of-the-art and improves over closed-set softmax on Cifar10 and FashionMNIST, with additional gains reported on KDDRev.
Takeaways & Limitations
Random affine transformations extend the method to broad data types, while randomization can reduce adversarial-example effectiveness against known transformation classes.
Takeaways & Limitations
The method is primarily evaluated in a semi-supervised setting, although results indicate graceful degradation and greater robustness than strong baselines with small training contamination.
Abstract
from arXiv · showhide
Anomaly detection, finding patterns that substantially deviate from those seen previously, is one of the fundamental problems of artificial intelligence. Recently, classification-based methods were shown to achieve superior results on this task. In this work, we present a unifying view and propose an open-set method, GOAD, to relax current generalization assumptions. Furthermore, we extend the applicability of transformation-based methods to non-image data using random affine transformations. Our method is shown to obtain state-of-the-art accuracy and is applicable to broad data types. The strong performance of our method is extensively validated on multiple datasets from different domains.
1 INTRODUCTION
Anomaly detection identifies patterns that differ from previously observed data, but supervision for unknown anomalies is often unavailable. Classification-based approaches offer a distinct paradigm alongside reconstruction and distribution-based methods, and this paper introduces GOAD to unify such methods using transformations.
- Motivation: Anomaly detection classifies data as normal or anomalous to trigger further inspection of patterns differing from the past.Applications include fraud detection, cyber intrusion detection, predictive maintenance, and stock-market opportunity discovery.
- Motivation: Supervised anomaly detection uses labeled normal and anomalous examples, whereas unsupervised methods process streams containing both types without such labels.Supervision may be unavailable for unknown threats such as new computer viruses.
- Related approaches: Recent deep classification-based methods have achieved superior anomaly-detection results, including one-class and self-supervised approaches trained with normal data.Deep-SVDD is an example of one-class classification using a learned deep feature space.
- Contribution: GOAD unifies classification-based methods using only normal training data and extends transformation-based anomaly detection beyond image data.The method transforms data into M subspaces, learns separated features, and uses distance from a cluster center as an anomaly criterion; affine transformations support non-image data.
- Related approaches: Existing anomaly detection methods broadly comprise reconstruction-based, distribution-based, and classification-based approaches.Reconstruction methods use reconstruction costs, while distributional methods model normal-data likelihoods.
2 CLASSIFICATION-BASED ANOMALY DETECTION
Classification-based anomaly detection separates normal data from other regions, but transformation-based scores can generalize poorly to unseen anomalies. The section motivates open-set and anomaly-supervision alternatives while describing their practical constraints.
- Classification-based methods: The semi-supervised setting assumes normal data lie in a subspace X and anomalies lie outside X.The desired classifier outputs 1 for x ∈ X and 0 for x ∈ R^L\X.
- One-class classification: One-class methods learn normality directly, while Deep-SVDD maps data to features and fits a minimal hypersphere around normal examples.Its anomaly score is ∥f(x) − c0∥2 − R2, with positive values indicating anomalies.
- Transformation-based classification: GEOM transforms normal data into M subspaces and scores anomalies using the probability assigned to the applied transformation.Low probabilities P(m|T(x,m)) produce high anomaly scores.
- Generalization issue: GEOM's classifier is valid for training-distribution samples, causing very high variance in anomaly scores outside the normal subspace.For anomalies, transformed samples may have zero probability in every modeled subset.
- Supervision constraint: Using labeled anomalies can address this issue, but obtaining representative anomaly supervision is difficult for varied tabular datasets.This supervised alternative corresponds to Outlier Exposure and is more feasible for some image tasks with external datasets.
3 DISTANCE-BASED MULTIPLE TRANSFORMATION CLASSIFICATION
GOAD combines transformation-based classification with distance-based open-set modeling: it learns separated feature-space centers for transformed subspaces and converts transformation probabilities into anomaly scores. Training uses normal samples transformed across M tasks, while evaluation aggregates the probabilities of the correct transformations.
- GOAD model: GOAD maps each transformed subspace to a feature representation modeled by a sphere with center cm.The approach combines open-set classification with one-class and transformation-based classification ideas.
- Training: Each center cm is computed as the average feature over training samples transformed by transformation m.The feature extractor and centers are learned from transformed normal training data.
- Training: The feature extractor is trained with center triplet loss to reduce within-class variation and increase between-class variation.The loss includes a margin s that regularizes distances between transformation clusters.
- Open-set regularization: GOAD adds a small constant ϵ to transformation probabilities so distant, uncertain samples receive equal probabilities rather than overconfident assignments.This regularization supplies a general uncertainty prior away from the training distributions.
- Evaluation: At test time, GOAD transforms each sample M times and aggregates the probabilities of predicting each applied transformation into an anomaly score.The normal probability is modeled as a product under an independence assumption, and higher scores indicate more anomalous samples.
- Algorithms: The training algorithm transforms every normal sample with all transformations, then optimizes the feature extractor and transformation centers.The evaluation algorithm applies the transformations, computes correct-transformation likelihoods, and aggregates them into Score(x).
4 PARAMETERIZING THE SET OF TRANSFORMATIONS
The paper generalizes transformation-based anomaly detection beyond image-specific operations by using affine transformations, including randomly sampled transformations. This broader class supports non-image data and can reduce variance while making adversarial attacks less effective.
- Generalizing beyond images: Affine transformations extend transformation-based anomaly detection to tabular and other non-image data without relying on pixel neighborhoods.Tabular data combines discrete and continuous attributes without a natural neighborhood or ordering, making image-specific rotations unsuitable.
- Affine transformation class: Affine transformations include prior rotations, flips, and translations while also permitting dimensionality reduction, non-distance preservation, and random sampling.The transformation is parameterized as T(x, m) = W_m x + b_m.
- Randomization: Random transformations reduce variance across dataset types when no prior knowledge identifies the correct transformation classes.They also allow an unlimited number of transformations.
- Randomization: Unknown transformations reduce adversarial effectiveness because attacks must generalize across different transformations rather than target a deterministic transformation.Deterministic transformations can expose a known target even when the exact network parameters are unknown.
5 EXPERIMENTS
Experiments evaluate GOAD across image and tabular anomaly-detection datasets, varying transformations, contamination, and adversarial settings. GOAD generally outperforms the compared baselines and remains effective across these conditions.
- 5.1 IMAGE EXPERIMENTS: GOAD outperforms the state-of-the-art approach on Cifar10 with and without Dirichlet weighting.The comparison uses ROC-AUC and evaluates GOAD against Deep SVDD and GEOM.
- 5.1 IMAGE EXPERIMENTS: GOAD outperforms all baseline methods on FashionMNIST, while GEOM depends substantially on Dirichlet weighting.
- 5.2 TABULAR DATA EXPERIMENTS: GOAD significantly outperforms all baselines on both KDDCUP99 and KDD-Rev.The strongest baselines on these large datasets are FB-AE and DAGMM; training results are reported after 25 epochs without early stopping.
- 5.2 TABULAR DATA EXPERIMENTS: Random transformations improve adversarial robustness on KDD: anomaly transformation-classification accuracy increased 3.7% in-network, 1.3% across shared transformations, and 0.2% across random transformations.PGD generally failed to obtain adversarial examples on the evaluated tabular datasets.
- 5.2 TABULAR DATA EXPERIMENTS: With anomalous training-data contamination, GOAD significantly outperforms DAGMM for all impurity values and degrades more gracefully.Similar robustness to contamination is reported for the other datasets.
- 5.2 TABULAR DATA EXPERIMENTS: From 16 tasks, KDD-Rev accuracy remains stable, while fewer than 16 tasks produces poor results.On the smaller Thyroid and Arrhythmia datasets, more transformations reduced F1-score variance across differently initialized runs.
6 DISCUSSION
GOAD improves over closed-set softmax in several settings, remains relatively insensitive to its margin, and supports alternative transformations and classifier depths. Its robustness extends to limited training contamination, while deep networks help mainly on large datasets.
- GOAD outperformed closed-set softmax on Cifar10, FashionMNIST, and KDDRev, while results were comparable on Arrhythmia and Thyroid.Softmax performed better on KDD, with F1 = 0.99.
- GOAD is not particularly sensitive to margin s, although margins that are too small might cause instability.The authors used s = 1 and recommend it as a starting value.
- Affine transformations performed slightly better than comparable rotations or permutations for tabular data.The authors observed comparable but slightly worse performance for the alternative transformation types.
- GOAD degrades gracefully with a small amount of training contamination and is more robust than strong baselines to a small percentage of anomalies.Most reported results assume anomaly-free training data, so the contamination evidence extends beyond the main semi-supervised setting.
- Deep networks benefit large datasets, particularly full KDDCUP99, but are unnecessary for smaller datasets.The authors note that a linear setting may be used for performance-critical operations.
7 CONCLUSION
The paper presents a general-data anomaly detector trained with random auxiliary classification tasks. It requires no domain knowledge, supports arbitrarily many random tasks, and significantly improves over the state of the art.
- The method detects anomalies in general data by training a classifier on random auxiliary tasks.
- The method requires no knowledge of the data domain and can generate an arbitrary number of random tasks.
- The method significantly improves over the state of the art.
A.1 IMAGE EXPERIMENTS
The image experiments examine GOAD's sensitivity to the margin parameter on Cifar10. Results with s = 0.1 and s = 1 were not greatly affected by the margin.
- Cifar10 results were not affected much by using margin s = 0.1 versus s = 1.The comparison is reported in Fig. 4, and the broader empirical observation is that GOAD is not very sensitive to s.
- Table 4 reports anomaly detection accuracy on Cifar10 as percentages.
A.2 TABULAR DATASETS
The tabular evaluation uses four datasets spanning medical and cyber-intrusion domains, with predefined anomaly labels and a shared train-test protocol. KDD is evaluated in both standard and reversed configurations.
- Arrhythmia labels selected small classes as anomalous and the remaining classes as normal.Classes 3, 4, 5, 7, 8, 9, 14, and 15 are designated anomalous.
- Thyroid designates hyperfunction as anomalous and the other classes as normal, using six continuous attributes.
- KDD contains normal traffic and four simulated attack types, using the subsampled UCI KDD 10% dataset.The attack types are denial of service, unauthorized remote access, unauthorized local-superuser access, and probing.
- KDDCUP99 treats the non-attack class as anomalous, whereas KDDCUP99-Rev subsamples attacks and designates them as anomalous.The reverse configuration is intended to better match the actual use case.
- Methods train on 50% of normal data and are evaluated on the remaining 50% of normal data together with all anomalies.
A.3 NUMBER OF TASKS
Across datasets, anomaly-detection F1 generally improves as the number of auxiliary tasks increases, with gains diminishing after roughly 16 tasks. Additional tasks can reduce variation between runs.
- A.3 NUMBER OF TASKS: Performance increases rapidly up to around 16 auxiliary tasks, after which additional tasks reduce the variance of F1 scores between runs.The plots measure anomaly-detection accuracy using F1 across Arrhythmia, Thyroid, KDDRev, and KDDCup99.