🤖

Anomalib with custom data setup(日本語つき)

2023/05/02に公開

Anomalib

https://github.com/openvinotoolkit/anomalib

https://openvinotoolkit.github.io/anomalib/

Anomalib is a deep learning library that aims to collect state-of-the-art anomaly detection algorithms for benchmarking on both public and private datasets.

Scope

  • This page is described troubleshooting of anomalib setup
  • introduce my config file
    • reference for my colleague.
    • But definitely overlook this page, haha.
    • That's why I decided share this information with you.

Summary of Anomalib

My environment is Anaconda

  • If you will setup other, please refer to official web tutorial.

yes | conda create -n anomalib_env python=3.8
conda activate anomalib_env
git clone https://github.com/openvinotoolkit/anomalib.git
cd anomalib
pip install -e .

Custom dataset using

Try MVTEC dataset

  • For my convenience and learning anomalib training, implemented this sample.

  • dataset is saved "datasets"folder

    • It is very huge data. If you don't need to use for your target, remove is better.

    Anomaly Detection on MVTec AD

    https://www.kaggle.com/datasets/ipythonx/mvtec-ad

  • I can see the anomalib detection accuracy!

Troubleshooting for custom data

  1. saved original data in the "datasets" folder
  2. almost similar folder construct with MVTEC data.
  3. modifying config.yaml, which I want to utilize

trouble examples

omegaconf.errors.ConfigAttributeError: ?????dict

  • In this case we should check modified or created config.yaml parameter is correct.
  • For my experirence, almost wrong data such a path, folder name and insufficient parameter.

https://github.com/facebookresearch/fairseq/issues/4057

insufficient parameter in dataset group.


normalization: imagenet # data distribution to which the images will be normalized: [none, imagenet]

  • using wrong model name? backbone is correct for your target?
  • Duplicated parameter also cause of failure.
model:
  name: padim
  backbone: wide_resnet50_2 #resnet18

wrong parameter example

  • In this case normalization: value is wrong for me.
  • Heat map become noise map....

correct parameter example

config.yaml for the custom dataset example

https://github.com/mi-kaneyon/anomalib_configs

Added Patchcore config sample 23th Jul

Discussion