Source-linked AI summary
Skip-GANomaly: Skip Connected and Adversarially Trained Encoder-Decoder Anomaly Detection
Samet Akçay, Amir Atapour-Abarghouei, Toby P. Breckon
TL;DR
Anomaly detection is difficult when datasets contain many normal samples but limited, evolving coverage of anomalies. The paper proposes an unsupervised skip-connected adversarial encoder-decoder that learns normality in image and latent spaces, and reports superior results across benchmarks and X-ray screening data.
Problem
Highly imbalanced datasets contain plentiful normal samples but limited and incomplete coverage of anomalous samples, restricting traditional supervised anomaly detection.
Method
The method adversarially trains a skip-connected encoder-decoder convolutional network to reconstruct normal data in image and latent spaces.
Results
The proposed method significantly outperforms prior work on each anomaly case across the UBA and FFOB datasets, including AUC 0.904 for the knife case versus 0.599 for prior work.
Takeaways & Limitations
The approach shows promise for unsupervised anomaly detection across established benchmarks and challenging real-world X-ray security-screening data.
Abstract
from arXiv · showhide
Despite inherent ill-definition, anomaly detection is a research endeavor of great interest within machine learning and visual scene understanding alike. Most commonly, anomaly detection is considered as the detection of outliers within a given data distribution based on some measure of normality. The most significant challenge in real-world anomaly detection problems is that available data is highly imbalanced towards normality (i.e. non-anomalous) and contains a most a subset of all possible anomalous samples - hence limiting the use of well-established supervised learning methods. By contrast, we introduce an unsupervised anomaly detection model, trained only on the normal (non-anomalous, plentiful) samples in order to learn the normality distribution of the domain and hence detect abnormality based on deviation from this model. Our proposed approach employs an encoder-decoder convolutional neural network with skip connections to thoroughly capture the multi-scale distribution of the normal data distribution in high-dimensional image space. Furthermore, utilizing an adversarial training scheme for this chosen architecture provides superior reconstruction both within high-dimensional image space and a lower-dimensional latent vector space encoding. Minimizing the reconstruction error metric within both the image and hidden vector spaces during training aids the model to learn the distribution of normality as required. Higher reconstruction metrics during subsequent test and deployment are thus indicative of a deviation from this normal distribution, hence indicative of an anomaly. Experimentation over established anomaly detection benchmarks and challenging real-world datasets, within the context of X-ray security screening, shows the unique promise of such a proposed approach.
I. INTRODUCTION
The paper addresses anomaly detection when data are dominated by normal samples and anomalous cases are limited. It proposes an unsupervised skip-connected adversarial encoder-decoder that learns normality in image and latent spaces and reports superior performance.
- Motivation: Real-world anomaly datasets are highly imbalanced toward normality and provide incomplete coverage of possible anomalies, limiting traditional supervised detection.X-ray screening is presented as an application where anomalous cases may be limited and evolve over time.
- Proposed approach: Training uses only normal samples, while evaluation includes both unseen normal and abnormal examples to detect deviations from learned normality.This unsupervised setup is described as instrumental for modeling data distributions under limited anomaly availability.
- Proposed approach: The proposed method adversarially trains a skip-connected encoder-decoder convolutional network to learn normality in image and latent spaces.The approach uses skip connections to capture multi-scale image detail and a discriminator for latent-space feature extraction.
- Contributions: The algorithm is reported to achieve quantitatively and qualitatively superior anomaly-detection performance against prior state-of-the-art approaches.The paper also characterizes the approach as simple and readily reproducible.
II. RELATED WORK
Prior work increasingly uses reconstruction and adversarial learning to model normality in image and latent spaces. The paper builds on these approaches by jointly learning both representations with adversarial autoencoders and skip connections.
- Reconstruction-based detection: The review focuses on reconstruction-based anomaly detection because prior studies indicate promise across multiple application domains.The cited applications span areas including biomedical analysis and video surveillance.
- Adversarial approaches: Schlegl et al. learn a latent representation from normal images, then optimize latent vectors against frozen generator and discriminator networks during inference.The method reports improvement over previous work but requires a separate latent-vector remapping stage.
- Proposed direction: The proposed approach uses adversarial autoencoders with skip connections to learn image- and latent-space representations jointly.This design is motivated by earlier methods that optimize latent vectors.
1) Generative Adversarial Networks (GAN):
The paper introduces GAN and AAE concepts before defining an unsupervised anomaly-detection problem. The model is trained on normal data to capture its distribution in image and latent spaces, then evaluated on mixed test data.
- 1) Generative Adversarial Networks (GAN):: GANs learn input data distributions through competition between a generator and discriminator optimized in a zero-sum game.The discriminator predicts class labels for high-dimensional features, while both networks strengthen their predictions toward equilibrium.
- 1) Generative Adversarial Networks (GAN):: GAN training can be unstable, motivating empirical stabilization methods including fully convolutional layers, batch normalization, and Wasserstein loss.The passage describes these techniques as responses to instability in jointly training the two networks.
- 2) Adversarial Auto-Encoders (AAE):: AAEs reconstruct inputs by encoding them into latent representations and decoding those representations back into images, while a discriminator distinguishes encoded vectors from a prior distribution.Training is reported to provide superior reconstruction and latent-space control.
- 1) Problem Definition:: The paper formulates unsupervised detection by training on normal samples only and testing on both normal and abnormal samples.The training set contains m normal samples, the test set contains n normal and abnormal samples, and m ≫ n in the practical setting.
- 1) Problem Definition:: The training objective captures the normal training distribution in both image and hidden latent spaces by minimizing reconstruction-related objectives.The stated goal is to learn higher- and lower-level features unique to normal images and define an anomaly score from the training objective.
2) Pipeline:
The pipeline uses a generator with an encoder-decoder structure and a discriminator. The encoder maps images to latent representations, while skip connections support multi-scale reconstruction and the discriminator also extracts inference features.
- The generator G comprises an encoder GE and decoder GD, while discriminator D classifies real images against reconstructed images.
- Encoder GE maps a high-dimensional image x to a lower-dimensional latent representation z through five convolutional blocks.
- Decoder GD upsamples z back to the input dimension and reconstructs the output image ˆx.
- Skip connections concatenate corresponding encoder down-sampling and decoder up-sampling layers, preserving local and global multi-scale information.
- Discriminator D additionally serves as a feature extractor for latent representations of the input and reconstructed images.
C. Training Objective
Training uses only normal samples and combines adversarial, contextual, and latent reconstruction losses. The adversarial component encourages realistic reconstructions while the discriminator distinguishes real from generated images.
- The model is trained only on normal samples and is expected to reconstruct normal data better than abnormal data.
- The training objective combines adversarial, contextual, and latent losses.
- Adversarial loss trains G to reconstruct normal images realistically while D classifies real and generated samples.
2) Contextual Loss:
Contextual and latent losses complement adversarial training by matching reconstructed images and their discriminator-derived representations to normal inputs. The total objective weights the individual losses.
- 2) Contextual Loss:: Contextual loss applies L1 normalization between input x and reconstructed output ˆx to learn contextually similar normal images.
- 3) Latent Loss:: Together, adversarial and contextual losses produce realistic, contextually similar images before latent reconstruction is added.
- 3) Latent Loss:: Latent loss compares discriminator features of x and ˆx, encouraging similar latent representations for normal examples.
- The total training objective is a weighted sum whose parameters control the dominance of the individual losses.
D. Inference
Inference assigns each test image an anomaly score that combines reconstruction and latent representation differences. Scores are then computed across the test set and scaled to [0, 1].
- D. Inference: The anomaly score combines a reconstruction score measuring contextual similarity with a latent representation score measuring input-output differences.
- D. Inference: The weighting parameter λ controls the relative importance of the reconstruction and latent score functions.
- D. Inference: Anomaly scores are computed for each test sample and assembled into an anomaly score vector A.
- D. Inference: Feature scaling converts the final anomaly scores into the probabilistic range [0, 1].
IV. EXPERIMENTAL SETUP
The experiments validate the proposed approach across benchmark and X-ray security-screening datasets, using anomaly-detection settings with normal training data and abnormal test cases.
- The evaluation covers four datasets, including CIFAR-10, UBA, and FFOB, to demonstrate the approach’s proof of concept.
- UBA and FFOB formulate anomaly detection for X-ray baggage screening, treating weapon threat items as anomalies.
- CIFAR-10 uses ten leave-one-class-out anomaly cases, each with 45,000 normal training samples and 9,000:6,000 normal-abnormal test samples.
- The in-house X-ray dataset contains 230,275 64 × 64 patches, including knife, gun, gun-component, and benign classes.
3) Full Firearm vs Operational Benign —FFOB:
The FFOB evaluation uses operational benign imagery and firearm full-weapons, while training and scoring follow the paper’s reconstruction-based anomaly-detection protocol.
- FFOB contains 4,680 firearm full-weapons as abnormal images and 67,672 operational benign images as normal data.
- Training uses Adam with initial learning rate lr = 2e−3, β1 = 0.5, β2 = 0.999, and loss weights λadv = 1, λrec = 40, λlat = 1.
- Parameters are saved when performance begins to decrease because this indicates over-fitting.
- The model is evaluated using ROC AUC, computed from true-positive and false-positive rates across varying threshold values.
V. RESULTS
The proposed method generally outperforms prior work across CIFAR-10, UBA, and FFOB, while separating normal and abnormal samples in score and discriminator-feature spaces.
- Except for bird and dog, the proposed model yields superior CIFAR-10 results relative to prior work.
- 0.904 AUC for knife exceeds the prior work’s best AUC of 0.599 on this challenging abnormality case.
- The proposed method significantly outperforms prior work in every UBA and FFOB anomaly case.
- Normal and abnormal test samples can both produce reconstructed outputs, yet abnormality is detected in latent object space.
- The model shows promising separation in both output anomaly scores and discriminator convolutional-feature spaces.
- Overall, the approach achieves superior anomaly-detection performance to previous state-of-the-art approaches.
VI. CONCLUSION
The paper presents an adversarially trained skip-connected encoder-decoder architecture and evaluates its training behavior and anomaly-detection performance across diverse datasets.
- The proposed architecture combines adversarial training with a skip-connected encoder-decoder network for anomaly detection.
- The model achieves its most optimum performance when λadv = 1, λrec=40 = 1 and λenc = 1.
- Skip connections and discriminator feature extraction are examined for their effects on hidden-feature manipulation and inference.
- Across datasets from different domains and complexity, skip connections provide more stable training and discriminator-based inference achieves numerically superior results than prior state-of-the-art methods.