Git Product home page Git Product logo

shahariar-shibli / feature-selection-using-metaheuristic-approaches-for-intrusion-detection-system Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 11.63 MB

Meta-heuristic approaches to select important features only for performance enhancement in effective Intrusion Detection System.

Python 51.70% Jupyter Notebook 48.30%
feature-selection intrusion-detection machine-learning meta-heuristics differential-evolution flower-pollination-algorithm optimization particle-swarm-optimization sine-cosine-algorithm knn-classification naive-bayes-classifier

feature-selection-using-metaheuristic-approaches-for-intrusion-detection-system's Introduction

Feature-Selection-using-Metaheuristic-Approaches-for-Intrusion-Detection-System

There are two folders in the repository:

  1. MH_Algorithms
  2. datasets

There is one python notebook in the repository: Feature_Selection_Notebook.ipynb , this is the main file which performs data processing, feature selection and classification for this study.

MH_Algorithms

In this folder, there are five python (.py) files.

  1. de.py [contains the implementation of the differential evolution]
  2. fpa.py [contains the implementation of the flower pollination algorithm]
  3. pso.py [contains the implementation of the particle swarm optimization]
  4. sca.py [contains the implementation of the sine cosine algorithm]
  5. functionHO.py [contains the implementation of fitness function for this study]

Each algorithm is implementation based on the algorithm provided in the original research paper.

Each of the four algorithms has four functions in their implementation:

  1. init_position() -> generates initial population with floating point values for the problem
  2. binary_conversion() -> converts the initial population vector into a binary (0/1) vector
  3. jfs() -> contains the main algorithm implementation
  4. boundary() -> helps in normalization

functionHo.py has two functions:

  1. fun() -> calculates the fitness score
  2. error_rate() -> contains the machine learning model for fitness evaluation

datasets

In this folder, there are two .csv files.

  1. UNSW-NB15_training-set.csv [contains 175341 records]
  2. UNSW-NB15_testing-set.csv [contains 82332 records]

The UNSW-NB15 dataset (Moustafa and Slay, 2016) was generated using an IXIA PerfectStorm program. The tcpdump program was used to record 100 GB of raw network data (pcap files). Each pcap file is 1000 MB in size to facilitate packet analysis. To create 49 features with the class label, Argus and Bro-IDS approaches were utilized, and 12 processes were carried out. This dataset is separated into two parts: training and testing. The training set has 175,341 records, whereas the testing set contains 82,332 records that can be attack or normalnon-attack. Analysis, backdoor, DoS, Exploits, Fuzzers, Generic, Reconnaissance, Shellcode, and Worms are the nine types of attacks undertaken against the UNSW-NB15 dataset. The dataset has "label" values of 0 and 1, with 0 representing no attack and 1 representing an attack. So, using the information at our disposal, this study attempts to predict whether a particular datapoint belongs to the attack or non-attack group.

How to reproduce the results

  1. Copy all the folders and files in google drive
  2. Open Feature_Selection_Notebook.ipynb with google collaboratory
  3. Run the cells one by one
  4. During run you need to -
    1. Hybridization:
      1. Select first model
      2. Update parameter values
      3. select second model
      4. Update parameter values
    2. Single Run:
      1. Select first model
      2. Update parameter values
      3. No need to run second model and its subsequent cells
    3. Fitness evaluation model:
      1. Select KNN / GaussianNB in functionHo.py (by default KNN)
      2. Change parameter 'alpha' value

feature-selection-using-metaheuristic-approaches-for-intrusion-detection-system's People

Contributors

shahariar-shibli avatar

Stargazers

 avatar

Watchers

 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.