Home

Awesome

AHL

Official implementation of "Anomaly Heterogeneity Learning for Open-set Supervised Anomaly Detection".(accepted by CVPR 2024)

Setup

Run

Step 1. Setup the Anomaly Detection dataset

Download the Anomaly Detection Dataset and convert it to MVTec AD format. (For datasets we used in the paper, we provided the convert script.) The dataset folder structure should look like:

DATA_PATH/
    subset_1/
        train/
            good/
        test/
            good/
            defect_class_1/
            defect_class_2/
            defect_class_3/
            ...
    ...

Step 2. Running the base model (DRA, DevNet) and save model weights.

Step 3. Save augmentation features and multi-scale features extracted from base model's feature extractor. The dataset folder structure of saved features should look like:

DATA_PATH/
    subset_1/
        feature/
            train/
            test/
        feature_scale/
            train/
            test/
        aug_dream/
            train/
        aug_dream_scale/
            train/
        aug_mix/
            train/
        aug_mix_scale/
            train/
        aug_paste/
            train/
        aug_paste_scale/
            train/
    ...

Step 4. Running AHL

python main.py --dataset_root $path-to-dataset --classname $subset-name --feat_classname $subset-name-for-saved-features --experiment_dir $path-to-save-model-weights

Citation

@inproceedings{zhu2024anomaly,
  title={Anomaly Heterogeneity Learning for Open-set Supervised Anomaly Detection},
  author={Zhu, Jiawen and Ding, Choubo and Tian, Yu and Pang, Guansong},
  booktitle={Proceedings of the IEEE/CVF conference on computer vision and pattern recognition},
  year={2024}
}