The repository contains code refered to the work:
Giuseppina Andresini, Annalisa Appice, Corrado Loglisci, Vincenzo Belvedere, Domenico Redavid and Donato Malerba
A Network Intrusion Detection System for Concept Drifting Network Traffic Data
Please cite our work if you find it useful for your research and work.
Str-MINDFUL requires Python 3 (preferably >= 3.6) Packages need are:
- Tensorflow 2.3.1
- Keras 2.4.3
- Matplotlib 3.3.2
- Pandas 1.1.3
- Numpy 1.18.5
- Scikit-learn 0.23.2
- Scikit-multiflow 0.5.3
- Hyperas 0.4.1
- Hyperopt 0.2.5
- Pillow 7.2.0
Package dependencies can be installed by using the listing in requirements.txt.
pip install -r requirements.txtGlobal variables are stored in settings section of the file MINDFUL.conf:
[setting]
EXECUTION_TYPE # 0=>ebatch execution 1=>streaming execution
N_CLASSES # number of classes for the prediction
PREPROCESSING1 # 0=>do not preprocessing 1=>do preprocessing
LOAD_AUTOENCODER_ADV # 0=>train autoencoder of attacks 1=> load trained autoencoder of attacks
LOAD_AUTOENCODER_NORMAL # 0=>train autoencoder of normal samples 1=> load trained autoencoder of normal samples
LOAD_CNN # 0=>train the CNN1D 1=> load trained CNN1D
VALIDATION_SPLIT # split train/validation
WINDOW_TYPE # 0=>count window 1=>time window
DECREASE_BATCH_DATASET # 0=>use the complet dataset from batch during the stream 1=>reduce the dimension of the batch dataset
In addition to configuring you must also enter information about the dataset:
[dataset_name]
pathModels # path to hold the models
pathPlot # path of the plot
pathDataset # path where the original datasets are stored
path # name of the batch dataset file
pathTest # file name of the dataset used as test in the basic version
pathStream # file name of the dataset used for streaming
testPath # the same as the dataset name
pathDatasetNumeric # path to contain the preprocessed numeric dataset files
pathUtils # path to the folder where to put the streaming computation support files
countWindowNormal # size of countWindow of normal examples
countWindowAttack # size of the countWindow of the attack examples
smallerSize # size of the batch dataset after sampling
timeDeltaNormal # time allowed in the time window of normal examples
timeDeltaAttack # time allowed in the timeWindow of the attack examples
Two steps are required for the execution of the stream algorithm: a batch training and ta streaming phase
Set the value EXECUTION_TYPE=0, the value path with the name of the dataset you want to use as a batch, and run main.py using the name of the dataset as input.
python3 main.py dataset_name
This will run the basic version of MINDFUL, which will take care of the preliminary training of the models by choosing the best hyperparameters. If you want more information about this step, you can consult this repository
Set EXECUTION_TYPE=1, the value of pathStream with the name of the dataset and run main.py again with the command:
python3 main.py dataset_name
PLEASE NOTE: The current version of STREAM MINDFUL has been implemented based on the use of the CICIDS2017 dataset. If you want to use another dataset, you need to add in the Datasetconfig.preprocessing2() the functions for the preprocessing step.
The dataset used for experiments can downloaded from here: