Source-linked AI summary

Explainable Deep One-Class Classification

Philipp Liznerski, Lukas Ruff, Robert A. Vandermeulen, Billy Joe Franks, Marius Kloft, Klaus-Robert Müller

arXiv:2007.01760v3cs.CVcs.LGstat.ML

TL;DR

Deep one-class classifiers are difficult to interpret because their nonlinear feature mappings separate nominal and anomalous samples without directly revealing anomalous regions. FCDD addresses this by using fully convolutional outputs as spatial anomaly heatmaps, achieving competitive benchmark detection and state-of-the-art MVTec-AD explanation performance, including stronger results with a few labeled anomaly maps.

  • Problem

    Deep one-class anomaly detectors have limited explainability because their nonlinear mappings concentrate nominal samples in feature space while mapping anomalies away.

  • Method

    FCDD combines a fully convolutional network with one-class classification so output features preserve spatial information and serve as downsampled anomaly heatmaps, with fixed-Gaussian upsampling available.

  • Results

    FCDD performs close to state-of-the-art on CIFAR-10 and ImageNet, reaches 0.92 pixel-wise mean AUC unsupervised on MVTec-AD, and 0.96 with one anomalous sample and map per defect class.

  • Takeaways & Limitations

    FCDD provides transparent, structured anomaly explanations while adapting to both semantic detection and subtle manufacturing-defect detection tasks.

Abstract

from arXiv · show

Deep one-class classification variants for anomaly detection learn a mapping that concentrates nominal samples in feature space causing anomalies to be mapped away. Because this transformation is highly non-linear, finding interpretations poses a significant challenge. In this paper we present an explainable deep one-class classification method, Fully Convolutional Data Description (FCDD), where the mapped samples are themselves also an explanation heatmap. FCDD yields competitive detection performance and provides reasonable explanations on common anomaly detection benchmarks with CIFAR-10 and ImageNet. On MVTec-AD, a recent manufacturing dataset offering ground-truth anomaly maps, FCDD sets a new state of the art in the unsupervised setting. Our method can incorporate ground-truth anomaly maps during training and using even a few of these (~5) improves performance significantly. Finally, using FCDD's explanations we demonstrate the vulnerability of deep one-class classification models to spurious image features such as image watermarks.

1 INTRODUCTION

Deep anomaly detectors are effective on complex data but difficult to explain, motivating FCDD, which makes spatially localized anomaly outputs serve simultaneously as detection features and heatmaps. FCDD performs competitively across benchmarks and supports evaluation against ground-truth anomaly maps on MVTec-AD.

  • Motivation: Deep anomaly detection has limited explainability despite its effectiveness on large, complex datasets such as high-resolution images.Explanations support industrial safety and security, bias avoidance, and human decision making.
  • Motivation: DSVDD concentrates nominal data near a predetermined feature-space center while mapping anomalous data elsewhere.FCDD modifies this one-class classification approach to preserve spatial information.
  • Method: FCDD makes transformed samples into downsampled anomaly heatmaps whose distant pixels correspond to anomalous input regions.Using only convolutional and pooling layers limits each output pixel’s receptive field.
  • Results: FCDD achieves performance close to state-of-the-art methods on CIFAR-10 and ImageNet while providing transparent explanations.The method also sets a new state of the art on MVTec-AD, whose ground-truth anomaly maps enable explanation evaluation.
  • Results: FCDD heatmaps provide a basis for examining whether deep one-class classifiers rely on spurious features such as image watermarks.The paper reports this vulnerability as a “Clever Hans” effect.

2 RELATED WORK

Deep anomaly-detection research has explored reconstruction, one-class feature mappings, self-supervision, and general explanation techniques, but explanation support remains uneven across methods.

  • Reconstruction-based methods: Autoencoders use reconstruction error as an anomaly score and pixel-wise differences as naturally produced explanation heatmaps.They are trained on nominal data and assumed to reconstruct anomalous samples poorly.
  • One-class classification: Deep one-class classification concentrates nominal samples in feature space while mapping anomalies to distant locations.DSVDD has also been applied to text, where attention mechanisms provide a form of interpretation.
  • Self-supervised methods: Self-supervised anomaly-detection methods score anomalies using prediction confidence after training networks to identify input transformations.Known anomalies can additionally be incorporated, but explanation approaches had not been considered for these methods.
  • Explanation methods: General explanation techniques include model-agnostic methods such as LIME and gradient-based techniques such as saliency methods and integrated gradients.Fully convolutional architectures have also been used for supervised segmentation when target maps are available during training.

3 EXPLAINING DEEP ONE-CLASS CLASSIFICATION

FCDD adapts deep one-class classification with a fully convolutional network whose spatial output is an anomaly heatmap, then upsamples it to full resolution without pixel-level training annotations.

  • Deep One-Class Classification: Deep one-class classification maps nominal samples near a center while sending anomalies away in output space.The HSC objective uses this mapping principle for anomaly detection.
  • Fully Convolutional Architecture: FCDD replaces the vector-valued network output with a spatial feature matrix produced by convolutional and pooling layers only.The fully convolutional architecture preserves spatial information and excludes fully connected layers.
  • Fully Convolutional Data Description: FCDD trains with nominal and anomalous labels, where anomalous samples may be random images outside the nominal collection.The method therefore supports one-class-style detection with synthetic or externally sourced anomalies.
  • Fully Convolutional Data Description: The positive entries of A(X) form a downsampled anomaly heatmap, and their sum serves as the anomaly score.Regions contributing to ∥A(X)∥1 correspond to input-image regions contributing to the anomaly score.
  • Heatmap Upsampling: FCDD upsamples the low-resolution heatmap with a strided transposed convolution using a fixed Gaussian kernel derived from receptive-field properties.The kernel size matches the receptive-field range, while the stride matches FCDD’s cumulative stride.
  • Heatmap Upsampling: Because ground-truth pixel annotations are generally unavailable, FCDD uses principled receptive-field upsampling instead of learning a supervised deconvolutional upsampler.The resulting A′ is a full-resolution anomaly heatmap.

4 EXPERIMENTS

Experiments evaluate FCDD’s detection and explanation quality on standard image benchmarks and MVTec-AD, including semi-supervised training with a few labeled anomalies. The results show competitive detection, strong pixel-level explanations, and vulnerability of one-class models to spurious features.

  • Standard Anomaly Detection Benchmarks: FCDD is evaluated quantitatively with mean AUC and qualitatively through heatmaps against gradient-based HSC explanations and autoencoder reconstruction-error maps.The benchmarks use one-vs-rest classification with nominal classes and auxiliary Outlier Exposure datasets where applicable.
  • Standard Anomaly Detection Benchmarks: FCDD achieves detection performance close to state-of-the-art methods on Fashion-MNIST, CIFAR-10, and ImageNet while outperforming autoencoders on complex datasets.Autoencoders yield detection performance close to random on more complex datasets.
  • Standard Anomaly Detection Benchmarks: FCDD heatmaps highlight meaningful anomalous regions, including horizontal elements for trousers and color or semantic features for ImageNet acorns.For acorns, green and brown regions tend to appear nominal, while red barns and white snow are treated as anomalous; a green caterpillar is recognized as anomalous.
  • Standard Anomaly Detection Benchmarks: Increasing OE samples tends to concentrate FCDD explanations on primary objects, while gradient-based maps produce centered blobs lacking spatial context.Autoencoder heatmaps look reasonable but cannot straightforwardly incorporate auxiliary OE samples or labeled anomalies.
  • Explaining Defects in Manufacturing: On MVTec-AD, FCDD reaches 0.92 pixel-wise mean AUC unsupervised and 0.96 pixel-wise mean AUC semi-supervised using one anomalous sample per defect class.The semi-supervised training uses only 3–8 anomalous training samples overall and yields the most consistent performance across classes.
  • The Clever Hans Effect: FCDD explanations reveal one-class models assigning high anomaly scores to spurious watermarks, bars, grids, and fences rather than horse features.Transparent detectors enable practitioners to recognize and remedy such behavior by cleaning or extending training data.

5 CONCLUSION

FCDD performs well across semantic and subtle defect detection tasks and is adaptable compared with previous methods. Its explanations are directly tied to anomaly scores, though robustness against attacks remains for future analysis.

  • FCDD performs well compared with previous methods across semantic detection and subtle defect detection tasks.
  • Directly tying explanations to anomaly scores may make FCDD less vulnerable to attacks than a posteriori explanation methods.The paper leaves analysis of this phenomenon for future work.

A RECEPTIVE FIELD SENSITIVITY ANALYSIS

Receptive-field size minimally changes detection performance but substantially affects explanation quality. Larger receptive fields produce less concentrated, blurrier heatmaps and can reduce pixel-wise AUC on MVTec-AD.

  • Larger receptive fields make explanation heatmaps less concentrated and more “blobby.”
  • Detection performance is only minimally affected by receptive-field size.
  • On MVTec-AD, larger receptive fields can negatively affect pixel-wise AUC scores.
  • CIFAR-10: CIFAR-10 experiments use eight architectures with four convolutional layers and two max-pool layers, varying the first kernel size from 3 to 17.Kernel size 3 gives a receptive field of approximately one quarter of the image, while 17 covers the entire image.
  • MVTec-AD: MVTec-AD experiments use six architectures with six convolutional layers and three max-pool layers, varying all kernel sizes from 3 to 13.These settings correspond to receptive fields from 1/16 of the image to the full image.

B IMPACT OF THE GAUSSIAN VARIANCE

FCDD upsamples low-resolution anomaly heatmaps with a Gaussian kernel, making σ a key explanation hyperparameter. Heatmap visualization additionally uses percentile-based contrast normalization and dataset-specific settings.

  • FCDD’s full-resolution heatmaps require choosing σ for the Gaussian-kernel upsampling.The effect of σ on MVTec-AD explanation performance is evaluated using pixel-wise mean AUC.
  • Heatmap scores are normalized with anomaly-score quantiles rather than standard min-max scaling.The normalization subtracts the global minimum, divides by the η-th percentile, and clamps values at 1.
  • Lower η leaves more values above 1 before clamping, producing more red anomalous regions in the heatmaps.
  • For MVTec-AD, Figures 1, 10, and 11 use η = 0.97 and normalize each heatmap relative to its own image.
  • Gaussian-kernel upsampling uses σ values of 1.2 for CIFAR-10 and Fashion-MNIST, 8 for ImageNet and Pascal VOC, and 12 for MVTec-AD.

D DETAILS ON THE NETWORK ARCHITECTURES

The appendix provides the complete FCDD network architectures used across datasets. The architecture descriptions organize layers by type, output shape, and parameter count.

  • The paper provides complete FCDD network architectures for the different datasets.
  • The architecture listings use columns for layer type, output shape, and parameter count.
  • ImageNet, MVTec-AD, and Pascal VOC are identified as a shared architecture group.

E TRAINING AND OPTIMIZATION

Training uses dataset-specific optimization schedules and preprocessing pipelines, with auxiliary anomalies sampled online to balance training batches. The ImageNet and Pascal VOC pipelines adapt the CIFAR-10 setup, while MVTec-AD uses a distinct epoch definition and schedule.

  • General training pipeline: Each nominal batch sample has a 50% chance of replacement by a randomly selected auxiliary anomaly, producing balanced batches for sufficiently large batch sizes.An epoch still corresponds to the original nominal dataset size, so approximately half of nominal samples are seen per epoch.
  • Dataset-specific optimization: CIFAR-10 training runs for 600 epochs with batch size 200 and Adam using β = (0.9, 0.999), weight decay 10^-6, and an initial learning rate of 0.001.The learning rate decreases by a factor of 10 at epochs 400 and 500.
  • Dataset-specific preprocessing: ImageNet resizes images to 256×256, uses 224-sized crops without padding, and center-crops test samples before normalization.The remaining setup is the same as CIFAR-10.
  • Dataset-specific preprocessing: Pascal VOC follows the CIFAR-10 setup after resizing images to 224×224 and removing random cropping.
  • Dataset-specific optimization: MVTec-AD defines an epoch as ten full-dataset iterations and trains for 200 epochs with SGD, Nesterov momentum, weight decay 10^-4, and an initial learning rate of 0.001.The learning rate decreases by a factor of 0.985 per epoch.

F QUANTITATIVE DETECTION RESULTS FOR INDIVIDUAL CLASSES

The appendix reports class-wise AUC results for Fashion-MNIST, CIFAR-10, and 30 ImageNet classes across autoencoder, one-class, geometric, supervised, and semi-supervised baselines. These tables provide per-class quantitative comparisons rather than a single aggregate result.

  • Fashion-MNIST: Fashion-MNIST class-wise AUC scores are reported for AE, DSVDD, and GEO.
  • CIFAR-10: CIFAR-10 class-wise AUC scores compare methods without OE, including AE, DSVDD, GEO, and GEO+, with methods using OE, including focal loss, GEO+, Deep SAD, and HSC.
  • ImageNet: ImageNet results report AUC scores for 30 classes, comparing AE, focal loss, GEO+, Deep SAD, and HSC; literature results are marked with an asterisk.

G FURTHER QUALITATIVE ANOMALY HEATMAP RESULTS

The appendix expands qualitative evaluation with unblurred and class-wise anomaly heatmaps across Fashion-MNIST, CIFAR-10, MVTec-AD, and ImageNet. Heatmaps are organized by anomaly score and compare FCDD, gradient-based HSC, autoencoder reconstructions, and, for MVTec-AD, ground-truth maps.

  • Unblurred anomaly heatmaps: Figures 12–14 provide unblurred heatmaps for Fashion-MNIST, ImageNet, and CIFAR-10, including comparisons across auxiliary-anomaly sample counts where applicable.CIFAR-10 compares FCDD and HSC as OE grows from 2, 8, 128, and 2048 samples to the full OE set; autoencoders cannot incorporate OE.
  • Class-wise anomaly heatmaps: Class-wise heatmaps are presented for all classes across the evaluated datasets, extending beyond the subset shown in the main paper.
  • Visualization caveat: Unified normalization improves cross-class comparability but can produce misleadingly large blobs for some classes, such as MVTec-AD toothbrushes.Class-specific normalization can reveal that the maps mark the correct anomalous regions.
  • Heatmap organization: Heatmap rows contain inputs, FCDD maps, HSC gradient maps, and autoencoder reconstruction maps, with MVTec-AD adding ground-truth anomaly maps.
  • Heatmap organization: Heatmap columns are ordered by increasing anomaly score for Fashion-MNIST, CIFAR-10, MVTec-AD, and ImageNet.Nominal-class subcaptions identify the class used to train each model, with nominal examples shown separately in several figures.
Loading 2007.01760v3…