Giter Site home page Giter Site logo

goad's Introduction

GOAD

This repository contains a PyTorch implementation of the method presented in "Classification-Based Anomaly Detection for General Data" by Liron Bergman and Yedid Hoshen, ICLR 2020.

Requirements

  • Python 3 +
  • Pytorch 1.0 +
  • Tensorflow 1.8.0 +
  • Keras 2.2.0 +
  • sklearn 0.19.1 +

Training

To replicate the results of the paper on the tabular-data:

python train_ad_tabular.py --n_rots=64 --n_epoch=25 --d_out=64 --ndf=32 --dataset=kdd 
python train_ad_tabular.py --n_rots=256 --n_epoch=25 --d_out=128 --ndf=128 --dataset=kddrev
python train_ad_tabular.py --n_rots=256 --n_epoch=1 --d_out=32 --ndf=8 --dataset=thyroid
python train_ad_tabular.py --n_rots=256 --n_epoch=1 --d_out=32 --ndf=8 --dataset=arrhythmia 

To replicate the results of the paper on CIFAR10:

python train_ad.py --m=0.1

Citation

If you find this useful, please cite our paper:

@inproceedings{bergman2020goad,
  author    = {Liron Bergman and Yedid Hoshen},
  title     = {Classification-Based Anomaly Detection for General Data},
  booktitle = {International Conference on Learning Representations (ICLR)},
  year      = {2020}
}

goad's People

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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

goad's Issues

A possible problem with computing the means for evalutaion

During the training you perform the transformation, and then sum the means per transformation within the batch:

for i in range(0, len(train_xs), self.batch_size):
    ...
    tc_zs, ce_zs = self.netC(xs)
    sum_zs = sum_zs + tc_zs.mean(0)
    ...
means = sum_zs.t() / n_batch

However, the self.netC changes between batches, so as far as I can tell, means consists of sums over the outputs of different networks.

Am I wrong?
Thanks!

Inconsistency on contamination ratio between paper and code.

Hello,

First of all, thanks for releasing the codebase for your paper. I would like to clarify the definition of contamination ratio as I found they are inconsistent between the paper description and the code.

In the paper page 8, it is told that "To evaluate the robustness of our method to this unsupervised scenario, we analysed the KDDCUP99 dataset, when X% of the training data is anomalous."

In your implementation, however, c_percent of samples from anomaly set is sampled and included to the training data.

n_contaminated = int((c_percent/100)*len(anom_samples))

This seems inconsistent with the description in the paper as normal and anomaly dataset sizes are not equal (e.g., for KDD, there are 4x more normal data than anomaly, so the contamination ratio should be 4x smaller than c_percent if following the description in the paper).

It would be great if this can be clarified. Also, due to this inconsistency, it is difficult to reproduce the contaminated data results on KDDRev or Arrhythmia. It would be great if authors can provide the code that generates the train/val splits for other datasets as well.

Occupy too much memory

I use half the number of transforms(72->36) and I find different classes are affected differently

args for fashion-mnist

Hi, lironber, I reproduce the experiment on Fashion-mnist, but it fails to close to your results in paper, can you share me the setting about Fashion-mnist ? Thank you!

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.