ganomaly
1.0.0
このレポは維持されなくなりました。ガノマリーの実装は、すぐに使用できる深い学習異常検出アルゴリズムとベンチマークデータセットの最大の公開コレクションであるAnomalibに追加されました。
このリポジトリには、次の論文のPytorchの実装が含まれています。ガノマリー:敵対的訓練による半監視異常検出[1]
git clone https://github.com/samet-akcay/ganomaly.git
conda create -n ganomaly python=3.7
conda activate ganomaly
conda install -c intel mkl_fft
pip install --user --requirement requirements.txt
MNISTおよびCIFAR10データセットの論文で結果を再現するには、次のコマンドを実行します。
# MNIST
sh experiments/run_mnist.sh
# CIFAR
sh experiments/run_cifar.sh # CIFAR10 引数をリストするには、次のコマンドを実行します。
python train.py -h
特定の異常クラスのMNISTデータセットでモデルをトレーニングするには、以下を実行します。
python train.py
--dataset mnist
--niter <number-of-epochs>
--abnormal_class <0,1,2,3,4,5,6,7,8,9>
--display # optional if you want to visualize
特定の異常クラスのCIFAR10データセットでモデルをトレーニングするには、以下を実行します。
python train.py
--dataset cifar10
--niter <number-of-epochs>
--abnormal_class
<plane, car, bird, cat, deer, dog, frog, horse, ship, truck>
--display # optional if you want to visualize
カスタムデータセットでモデルをトレーニングするには、データセットを./dataディレクトリにコピーする必要があり、次のディレクトリとファイル構造が必要です。
Custom Dataset
├── test
│ ├── 0.normal
│ │ └── normal_tst_img_0.png
│ │ └── normal_tst_img_1.png
│ │ ...
│ │ └── normal_tst_img_n.png
│ ├── 1.abnormal
│ │ └── abnormal_tst_img_0.png
│ │ └── abnormal_tst_img_1.png
│ │ ...
│ │ └── abnormal_tst_img_m.png
├── train
│ ├── 0.normal
│ │ └── normal_tst_img_0.png
│ │ └── normal_tst_img_1.png
│ │ ...
│ │ └── normal_tst_img_t.png
次に、モデルトレーニングは、上記のトレーニングMNISTまたはCIFAR10データセットと同じです。
python train.py
--dataset <name-of-the-data>
--isize <image-size>
--niter <number-of-epochs>
--display # optional if you want to visualize
その他のトレーニングオプションについては、 python train.py -hを実行します。
このリポジトリを使用する場合、または論文を参照したい場合は、次のBibtexエントリを使用してください
@inproceedings{akcay2018ganomaly,
title={Ganomaly: Semi-supervised anomaly detection via adversarial training},
author={Akcay, Samet and Atapour-Abarghouei, Amir and Breckon, Toby P},
booktitle={Asian Conference on Computer Vision},
pages={622--637},
year={2018},
organization={Springer}
}
[1] Akcay S.、Atapour-Abarghouei A.、Breckon TP(2019)Ganomaly:敵対的訓練による半監視異常検出。 In:Jawahar C.、Li H.、Mori G.、Schindler K.(eds)Computer Vision - ACCV2018。ACCV2018。ComputerScience、Vol11363。Springer、Cham