chinmayee-04/NeuroGuard-Adaptive-Cognitive-Threat-Mitigation-System
GitHub: chinmayee-04/NeuroGuard-Adaptive-Cognitive-Threat-Mitigation-System
Stars: 0 | Forks: 0
# NeuroGuard: Adaptive Cognitive Threat Mitigation System




## Overview
NeuroGuard is a real-time network intrusion detection system trained on
the KDD Cup dataset. It applies multiple machine learning and deep learning
models to classify network traffic as normal or attack, with real-time
traffic simulation and automated threat response.
## Dataset
- **KDDTrain+.txt** - NSL-KDD dataset with 43 network traffic features
- Labels classified as: `normal` or `attack`
- Features include: duration, protocol_type, service, flag, src_bytes,
dst_bytes, and 38 additional network-level attributes
## Models Implemented
| Model | Type |
|-------|------|
| Logistic Regression | Classification |
| K-Nearest Neighbors (k=20) | Classification |
| Gaussian Naive Bayes | Classification |
| Linear SVC | Classification |
| Decision Tree | Classification |
| Random Forest | Classification (Best Model) |
| XGBoost | Regression |
| Deep Neural Network (TensorFlow) | Binary Classification |
| PCA + Random Forest | Dimensionality Reduction + Classification |
## Workflow
1. Data Loading - Load KDDTrain+.txt from Google Drive
2. Preprocessing - Assign column names, encode labels, scale features
using RobustScaler
3. EDA - Visualize protocol types and attack distribution using pie charts
4. Feature Engineering - Apply PCA (20 components) for dimensionality
reduction
5. Model Training - Train and evaluate all models, compare accuracy,
precision, recall and F1 score
6. Deep Learning - Build and train a Dense Neural Network using
TensorFlow/Keras
7. Best Model Saved - Random Forest saved as `best_random_forest_model.pkl`
8. Real-Time Simulation - Simulate live traffic using PCA-transformed
test data and predict threats row by row
## Tech Stack
| Category | Tools |
|----------|-------|
| Language | Python 3.9+ |
| Deep Learning | TensorFlow, Keras |
| Machine Learning | Scikit-learn, XGBoost |
| Data Processing | Pandas, NumPy |
| Visualization | Matplotlib, Seaborn |
| Dimensionality Reduction | PCA (20 components) |
| Model Saving | Joblib |
| Platform | Google Colab |
| Dataset | NSL-KDD (KDDTrain+.txt) |
## Repository Structure
NeuroGuard/
├── notebooks/
│ └── MCSA__ipynb.ipynb
├── dataset/
│ └── KDDTrain+.txt
├── models/
│ └── best_random_forest_model.pkl
├── report/
│ └── final_report_42614152.pdf
├── research/
│ └── Neuroguard_research_paper.pdf
├── README.md
└── requirements.txt