Giter VIP home page Giter VIP logo

gan-ensemble-for-anomaly-detection's Introduction

GAN-Ensemble-for-Anomaly-Detection

This repository contains PyTorch implementation of the following paper: "GAN-Ensemble-for-Anomaly-Detection"

0. Environment Setup

pip install -r requirements.txt

1. Table of Contents

2. Experiment

To replicate the results in the paper for MNIST and CIFAR10 dataset, run the following commands:

#MNIST
sh experiments/run_mnist_en_fanogan.sh
sh experiments/run_mnist_en_egbad.sh
# CIFAR
sh experiments/run_cifar_en_fanogan.sh
sh experiments/run_cifar_en_egbad.sh
#OCT
sh experiments/run_oct_en_fanogan.sh
#KDD99
sh experiments/run_oct_en_egbad.sh

3. Training

To list the arguments, run the following command:

python train.py -h

To train the model on MNIST dataset for a given anomaly class, run the following:

python train.py \
    --dataset mnist                                                                \
    --niter <number-of-epochs>                                                     \
    --abnormal_class  <0,1,2,3,4,5,6,7,8,9>                                        \
    --setting <model-name: f-anogan, egbad, ganomaly, skipgan>                     \
    --n_G <number of ensemble generators>                                          \
    --n_D <number of ensemble discriminators>                                      \

To train the model on CIFAR10 dataset for a given anomaly class, run the following:

python train.py \
    --dataset cifar10                                                             \
    --niter <number-of-epochs>                                                    \
    --abnormal_class                                                              \
        <0-9 for :airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck>    \
    --setting <model-name: f-anogan, egbad, ganomaly, skipgan>                     \
    --n_G <number of ensemble generators>                                          \
    --n_D <number of ensemble discriminators>                                      \
         

To train the model on OCT dataset for a given anomaly class, run the following:

python train.py \
    --dataset OCT                                                                  \
    --niter <number-of-epochs>                                                     \
    --setting <model-name: f-anogan, egbad, ganomaly, skipgan>                     \
    --n_G <number of ensemble generators>                                          \
    --n_D <number of ensemble discriminators>                                      \
         

To train the model on KDD99 dataset for a given anomaly class, run the following:

python train.py \
    --dataset KDD99                                                                \
    --niter <number-of-epochs>                                                     \
    --setting <model-name: f-anogan, egbad>                                        \
    --n_G <number of ensemble generators>                                          \
    --n_D <number of ensemble discriminators>                                      \
         

gan-ensemble-for-anomaly-detection's People

Contributors

xiaohui9607 avatar xuhan314 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gan-ensemble-for-anomaly-detection's Issues

dataloader missing

Hello, congratulations on your paper!
Please dataloader is missing in your argument, as shown below:-

!python train.py
--dataset cifar10
--niter 2
--abnormal_class 9
--setting ganomaly
--n_G 3
--n_D 3

Traceback (most recent call last):
File "train.py", line 30, in
main()
File "train.py", line 23, in main
model = Ganomaly(opt)
TypeError: init() missing 1 required positional argument: 'dataloader'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.