Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Explainable_AI_Based_Network_Intrusion_Detection

A two-stage Intrusion Detection System powered by Explainable AI (LIME, SHAP, DiCE, PDP, ICE, ALE) that detects cyberattacks and explains which features triggered each alert. Trained on the CICIDS2017 dataset using Logistic Regression, Random Forest, XGBoost, LightGBM, and CatBoost, it supports both binary and multi-class detection with detailed feature insights.


Overview

This project addresses the limitations of black-box IDS models by providing:

  • Stage 1: Binary classification (Benign vs Malicious)
  • Stage 2: Multi-class attack classification
  • Full XAI module for global and local interpretability

The system offers reliable, interpretable insights for SOC teams and real-world deployment.


Features

  • Two-stage IDS (Binary + Multi-Class)
  • High-accuracy ML models: XGBoost, LightGBM, CatBoost, Random Forest, Logistic Regression
  • Complete XAI suite (SHAP, LIME, DiCE, PDP, ICE, ALE)
  • Handles class imbalance with class weights
  • Feature-level and instance-level explanations
  • Suitable for SOC triage, auditing, and debugging

Dataset

CICIDS2017 dataset containing benign flows and multiple attack families.

Preprocessing steps include:

  • Cleaning missing/invalid values
  • Dropping irrelevant fields
  • Encoding categoricals
  • Scaling numerical features
  • Outlier handling
  • Computing class weights

Models Implemented

  • Logistic Regression
  • Random Forest
  • XGBoost
  • LightGBM
  • CatBoost

Each model is trained for:

  • Stage 1: Binary detection
  • Stage 2: Attack type classification

Explainability Methods

Global Explanations

  • SHAP Summary & Bar Plots
  • Permutation Feature Importance
  • Partial Dependence Plots (PDP)
  • Accumulated Local Effects (ALE)

Local Explanations

  • SHAP Force & Waterfall Plots
  • LIME Instance Explanations
  • ICE Plots
  • PDP Plots
  • Permutation Feature Importance
  • Surrogate Decision Trees
  • Ceteris Paribus Plots

Evaluation

Metrics used for both stages:

  • Accuracy
  • Precision, Recall, F1-score
  • ROC-AUC (Binary & Macro)
  • PR-AUC for imbalance
  • Confusion matrices
  • XAI techniques evaluation using Model-centric, Explanation-centric and Human-centric metrics

Contributors - Kopika Muralidharan | Mukti Patangia | Shakthireka Karthikeyan

About

A two-stage Intrusion Detection System powered by Explainable AI (LIME, SHAP, DiCE, PDP, ICE, ALE) that detects cyberattacks and explains which features triggered each alert. Trained on the CICIDS2017 dataset using XGBoost, LightGBM, CatBoost, etc., it supports both binary and multi-class detection with detailed feature insights.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages