Coder Social home page Coder Social logo

gelliravi / transformerad Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jogecodes/transformerad

0.0 0.0 0.0 347 KB

Code for the paper "Anomaly-Based Intrusion Detection in IIoT Networks Using Transformer Models"

License: GNU General Public License v3.0

Python 11.70% Jupyter Notebook 88.30%

transformerad's Introduction

transformerAD

Code for the paper "Anomaly-Based Intrusion Detection in IIoT Networks Using Transformer Models".

The utils folder contains the implementation for the transformer class and all of its dependencies, along with some extra functions providing data loading and model saving support. The train-main.py and test-main.py files contain examples of model training and saving and AD execution, with saving of the results. The data-visualization.ipynb Jupyter Notebook includes the code for result evaluation and visualization.

Models will be saved in a /models/ directory, while its outputs will be kept in an /output/ directory. A /data/ directory must contain the processed datasets in its respective subfolders.

This repository has been tested on the WUSTL-IIoT-2021 datasets. The code for the processing of both datasets in order for them to be in a format compatible with the transformer model can be found in the /dataset-processing directory. In order to reproduce the experiments presented on the paper:

  1. Follow the instructions in the README file in /raw-data/ to download the WUSTL-IIoT dataset. Extract the CSV file in this same directory and keep the original name.
  2. Execute the processing.ipynb Jupyter Notebook from the root directory. Note: All the cells must be executed.
  3. Run the train-main.py script from the root directory. Hyperparameters can be tweaked.
  4. Run the test-main.py script from the root directory. Testing batch size can be adjusted to memory requirements.
  5. Use the data-visualization.ipynb Jupyter Notebook from the root directory to analyze the produced results.

Note that the train-main.py script will always generate a new numerated model subfolder. The 'model_name' variable in the test-main.py script must aim to the desired model. Similarly, running test-main.py will generate a new output subfolder relative to the used model. The 'output' variable in the data-visualization.ipynb Notebook must refer to the desired output as well.

Different datasets can be used with minimal adjustment.

transformerad's People

Contributors

jogecodes 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.