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.
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.
- 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
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
- Logistic Regression
- Random Forest
- XGBoost
- LightGBM
- CatBoost
Each model is trained for:
- Stage 1: Binary detection
- Stage 2: Attack type classification
- SHAP Summary & Bar Plots
- Permutation Feature Importance
- Partial Dependence Plots (PDP)
- Accumulated Local Effects (ALE)
- SHAP Force & Waterfall Plots
- LIME Instance Explanations
- ICE Plots
- PDP Plots
- Permutation Feature Importance
- Surrogate Decision Trees
- Ceteris Paribus Plots
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