项目作者: phuccuongngo99

项目描述 :
Fence GAN: Towards Better Anomaly Detection
高级语言: Python
项目地址: git://github.com/phuccuongngo99/Fence_GAN.git
创建时间: 2019-04-21T05:58:37Z
项目社区:https://github.com/phuccuongngo99/Fence_GAN

开源协议:

下载


Fence GAN: Towards Better Anomaly Detection

This is the official implementation of the paper: Fence GAN: Towards Better Anomaly Detection (link).

Prerequisites

  1. Linux OS
  2. Python 3
  3. CUDA
  4. Tensorflow Version 1.12 (Tested on this version)

Installation

  1. Clone repository
    1. git clone https://github.com/phuccuongngo99/Fence_GAN.git
  2. Installing tensorflow or tensorflow-gpu by following instruction here.

  3. Installing necessary libraries

    1. pip3 install -r requirements.txt

Anomaly Detection

Check results and plots under result folder

2D Synthetic Dataset

  1. python3 2D_experiment/2D_fgan.py

MNIST

  1. python3 main.py --dataset mnist --ano_class 0 --epochs 100 --alpha 0.1 --beta 30 --gamma 0.1 --batch_size 200 --pretrain 15 --d_lr 1e-5 --g_lr 2e-5 --v_freq 4 --latent_dim 200 --evaluation 'auprc'

CIFAR10

  1. python3 main.py --dataset cifar10 --ano_class 0 --epochs 150 --alpha 0.5 --beta 10 --gamma 0.5 --batch_size 128 --pretrain 15 --d_lr 1e-4 --g_lr 1e-3 --v_freq 1 --latent_dim 256 --evaluation 'auroc'

KDD99

Unzip the KDD99_Final.zip and then run Fence_GAN.py. Hyperparameters are set as global variables in the Fence_GAN.py file

More training option

Enter python3 main.py -h for more training options

  1. usage: Train your Fence GAN [-h] [--dataset DATASET] [--ano_class ANO_CLASS]
  2. [--epochs EPOCHS] [--beta BETA] [--gamma GAMMA]
  3. [--alpha ALPHA] [--batch_size BATCH_SIZE]
  4. [--pretrain PRETRAIN] [--d_l2 D_L2] [--d_lr D_LR]
  5. [--g_lr G_LR] [--v_freq V_FREQ] [--seed SEED]
  6. [--evaluation EVALUATION]
  7. [--latent_dim LATENT_DIM]
  8. optional arguments:
  9. -h, --help show this help message and exit
  10. --dataset mnist | cifar10
  11. --ano_class 1 anomaly class
  12. --epochs number of epochs to train
  13. --beta beta
  14. --gamma gamma
  15. --alpha alpha
  16. --batch_size
  17. --pretrain number of pretrain epoch
  18. --d_l2 L2 Regularizer for Discriminator
  19. --d_lr learning_rate of discriminator
  20. --g_lr learning rate of generator
  21. --v_freq epoch frequency to evaluate performance
  22. --seed numpy and tensorflow seed
  23. --evaluation 'auprc' or 'auroc'
  24. --latent_dim Latent dimension of Gaussian noise input to Generator

Citation

  1. @article{ngo2019,
  2. author = {Cuong Phuc Ngo and Amadeus Aristo Winarto and Connie Khor Li Kou and
  3. Sojeong Park and Farhan Akram and Hwee Kuan Lee},
  4. title = {Fence GAN: Towards Better Anomaly Detection},
  5. year = {2019},
  6. url = {https://arxiv.org/pdf/1904.01209.pdf},
  7. archivePrefix = {arXiv}
  8. }