Home

Awesome

UniAD

Official PyTorch Implementation of A Unified Model for Multi-class Anomaly Detection, Accepted by NeurIPS 2022 Spotlight.

Image text Image text

1. Quick Start

1.1 MVTec-AD

|-- data
    |-- MVTec-AD
        |-- mvtec_anomaly_detection
        |-- json_vis_decoder
        |-- train.json
        |-- test.json
PlatformGPUDetection AUROCLocalization AUROCCheckpointsNote
slurm group8 GPUs (NVIDIA Tesla V100 16GB)96.796.8hereA unified model for all categories
torch.distributed.launch1 GPU (NVIDIA GeForce GTX 1080 Ti 11 GB)97.697.0hereA unified model for all categories

1.2 CIFAR-10

|-- data
    |-- CIFAR-10
        |-- cifar-10-batches-py
Normal Samples{01234}{56789}{02468}{13579}Mean
AUROC84.479.693.089.186.5

2. Visualize Reconstructed Features

We highly recommend to visualize reconstructed features, since this could directly prove that our UniAD reconstructs anomalies to their corresponding normal samples.

2.1 Train Decoders for Visualization

2.2 Visualize Reconstructed Features

3. Questions

3.1 Explanation of Evaluation Results

The first line of the evaluation results are shown as follows.

clsnamepixelmeanmaxstd

The pixel means anomaly localization results.

The mean, max, and std mean post-processing methods for anomaly detection. That is to say, the anomaly localization result is an anomaly map with the shape of H x W. We need to convert this map to a scalar as the anomaly score for this whole image. For this convert, you have 3 options:

In our paper, we use max for MVTec-AD and mean for CIFAR-10.

3.2 Visualize Learned Query Embedding

If you have finished the training of the main model and decoders (used for visualization) for MVTec-AD, you could also choose to visualize the learned query embedding in the main model.

Some results are very interesting. The learned query embedding partly contains some features of normal samples. However, we did not fully figure out this and this part was not included in our paper.

Image text Image text

Acknowledgement

We use some codes from repositories including detr and efficientnet.