Code Monkey home page Code Monkey logo

imbalance-anomaly's Introduction

imbalance-anomaly

Evaluation of anomaly detection in imbalanced authentication logs.

Creating a new virtual environment

  1. Create a conda virtual environment

    conda create --name imbalance-anomaly python=3.6

  2. Activate the environment

    conda activate imbalance-anomaly

Cloning the repository and install the package

  1. Clone this repository

    git clone https://github.com/studiawan/imbalance-anomaly.git

  2. Go to the project directory. The rest of the instructions run in this directory

    cd imbalance-anomaly

  3. In setup.py file, change tensorflow-gpu to tensorflow if you do not run on a GPU

  4. Install this package in the activated virtual environment

    pip install -e .

Preparing datasets and Glove embedding

  1. Copy the datasets from imbalance-anomaly-gt repository to directory imbalance-anomaly/datasets. It is assumed that the directory of both repository are located in ~/Git. Please change according to your own directory structure

    cp ~/Git/imbalance-anomaly-gt/datasets/casper-rw/log.all.pickle ~/Git/imbalance-anomaly/datasets/casper-rw/log.all.pickle

    cp ~/Git/imbalance-anomaly-gt/datasets/dfrws-2009/log.all.pickle ~/Git/imbalance-anomaly/datasets/dfrws-2009/log.all.pickle

    cp ~/Git/imbalance-anomaly-gt/datasets/honeynet-challenge7/log.all.pickle ~/Git/imbalance-anomaly/datasets/honeynet-challenge7/log.all.pickle

  2. Extract the Glove pre-trained embedding

    tar -xzvf glove/glove6B.50d.tar.gz --directory glove/

Running the experiment

  1. Run experiments for all methods from Keras library. Type dataset name and method name after the script. The supported datasets are casper-rw, dfrws-2009, and honeynet-challenge7. The supported methods are lstm and cnn.

    Command:

    python imbalance_anomaly/experiment/experiment_keras.py dataset_name method_name

    Example:

    python imbalance_anomaly/experiment/experiment_keras.py casper-rw lstm

  2. The experimental results are located in imbalance_anomaly/datasets/$DATASET_NAME$/ where $DATASET_NAME$ is one of the datasets: casper-rw, dfrws-2009, and honeynet-challenge7. The file name format for experimental results is $METHOD_NAME$.evaluation.csv.

  3. Pretty print the csv file of experimental results

    column -s, -t datasets/$DATASET_NAME$/$METHOD_NAME$.evaluation.csv

imbalance-anomaly's People

Contributors

studiawan avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.