Skip to content

cs7org/i7-IDS

Repository files navigation

Enhancing Smart Grid Security: A Deep Learning Approach to Adversarial Intrusion Detection

Proposed IDS flow diagram.

Setting Up

  1. Download the dataset DNP3 Intrusion Detection Dataset from Zenodo
  2. Unzip and copy all the CSV files related to CICFlowmeter and paste them into a single folder.
  3. These files will be the main data files.
  4. Read all files and combine them into a single CSV file. Relevant script.
  5. Install this project as pip install -e . and all its requirements too.

PCAP to Image

A packet for the array creation steps.

  • Read the CSV file for 120s Timeout and the corresponding PCAP files.
  • For each CSV:
    • Read each row.
    • Find the matching packets in the PCAP file.
    • Call matched packets session and assign the label to it.
    • Convert session to image.
  • Main script is: feature_importance/dnp3_pcap_to_img.py, and all others are there when some experiments were done, but are not needed to reproduce the results. It needs a mapping file between CSV and PCAP file, and are inside assets.

Model Training

Baseline Model Training

Image-Based Model Training

Adversarial Generation

Evaluation

A proposed evaluation plan.

All files are inside adversarial.

These evaluation files create result CSV files (and sample images).

Generating Plots

Debug on HPC

  • salloc.tinygpu --gres=gpu:1 --time=01:00:00
  • srun --jobid=1134289 --overlap --pty /bin/bash -l
  • tqdm should be disabled in HPC.
  • Quota: shownicerquota.pl

Misc Experiments

These are not being used in the final paper and presentation. Because these are only for tabular and later focus turned into image based IDS.

Feature Importance

First, the goal was to find the best feature importance extractor method. Feature importance could vary for each attack. Methods experimented with are:

The best one was PFI. A visualisation is available in notebook notebooks/feature_importance.ipynb, esp. in section Read Previous Results.

This is also a good read.

Imbalance Handling

  • Synthetic Data generation to oversample data based on CTGAN.
  • Here, we loop through each label and generate the synthetic dataset needed.
  • So for each attack label, there is one CTGAN model.
  • CTGAN can be installed from here.

Classification in Tabular Data

  • tabpfn looks great. pip install "tabpfn-extensions[all] @ git+https://github.com/PriorLabs/tabpfn-extensions.git"

Reproducing Results

An attempt was made to reproduce results from some research work done on tabular data. See notebook notebooks/reproducing_results.ipynb.

Acknowledgment

The authors gratefully acknowledge the scientific support and HPC resources provided by the Erlangen National High Performance Computing Center (NHR@FAU) of the Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU). The hardware is funded by the German Research Foundation (DFG).

Citation

Please cite as:

@mastersthesis{Acharya2025,
    author = {Ramkrishna Acharya},
    title = {Enhancing Smart Grid Security: A Deep Learning Approach to Adversarial Intrusion Detection},
    school = {Friedrich-Alexander-Universität Erlangen-Nürnberg, Department of Computer Science, Computer Networks and Communication Systems},
    year = {2025},
    month = {September},
    address = {Erlangen, Germany}
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors