AUST-Hansen / MMR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Industrial Anomaly Detection with Domain Shift: A Real-world Dataset and Masked Multi-scale Reconstruction

This is an official PyTorch implementation of the paper Industrial Anomaly Detection with Domain Shift: A Real-world Dataset and Masked Multi-scale Reconstruction.

Datasets

We release a real-world Aero-engine Blade Anomaly Detection (AeBAD) dataset, consisting of two sub-datasets: the single-blade dataset (AeBAD-S) and the video anomaly detection dataset of blades (AeBAD-V). Compared to existing datasets, AeBAD has the following two characteristics: 1.) The target samples are not aligned and at different sacles. 2.) There is a domain shift between the distribution of normal samples in the test set and the training set, where the domain shifts are mainly caused by the changes in illumination and view.

Dataset will be available soon.

  • AeBAD-S

  • AeBAD-V

Visualization for Videos

①: Original Video ②: PatchCore ③: ReverseDistillation ④: DRAEM ⑤: NSA ⑥: MMR

  • video 1






  • Video 2






  • Video 3






Get Started

Pre-trained models

Download the pre-trained model of MAE (ViT-base) at here.

Dataset

MVTec:

Create the MVTec dataset directory. Download the MVTec-AD dataset from here. The MVTec dataset directory should be as follows.

|-- data
    |-- MVTec-AD
        |-- mvtec_anomaly_detection
            |-- object (bottle, etc.)
                |-- train
                |-- test
                |-- ground_truth

AeBAD:

We will release soon.

Virtual Environment

Use the following commands:

pip install -r requirements.txt

Train and Test

Train the model and evaluate it for each category. This will output the results (sample-level AUROC, pixel-level AUROC and PRO) for each category. It will generate the visualization in the directory.

run the following code:

sh mvtec_run.sh

TRAIN.MMR.model_chkpt in MMR.yaml is the path of above download model. TRAIN.dataset_path (TEST.dataset_path) is the path of data.

About


Languages

Language:Python 99.8%Language:Shell 0.2%