Skip to content

Maazkorejo/NIDS-Machine-Learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ Network Intrusion Detection System (NIDS) using Machine Learning

![Python](https://img.shields.io/badge/Python-3.10+-blue.svg)

![Machine Learning](https://img.shields.io/badge/Machine%20Learning-XGBoost%20%7C%20RandomForest-orange)

![Status](https://img.shields.io/badge/Status-Completed-brightgreen)

![Dataset](https://img.shields.io/badge/Dataset-CICIDS2017-red)

---

πŸ“Έ Project Preview

Machine Learning-based Intrusion Detection System that detects malicious network traffic using real-world cybersecurity data.

---

πŸ“Œ Overview

This project is a **Machine Learning-based Network Intrusion Detection System (NIDS)** that detects malicious and normal network traffic using classification algorithms.

It compares multiple models and selects the best-performing one based on evaluation metrics.

---

🎯 Objective

- Detect malicious network activity

- Classify traffic as normal or attack

- Compare ML models for best performance

- Reduce false positives in intrusion detection

---

πŸ“Š Dataset

- **CICIDS-2017 Dataset**

- Real-world network traffic dataset

- Contains multiple attack types and normal traffic

- Preprocessed for machine learning training

---

βš™οΈ Technologies Used

- Python 🐍

- scikit-learn

- XGBoost

- pandas

- NumPy

- matplotlib

- seaborn

- joblib

---

🧠 Machine Learning Models

🌲 Random Forest

- Ensemble-based classifier

- Strong baseline performance

- Handles large datasets well

⚑ XGBoost

- Gradient boosting algorithm

- High accuracy and efficiency

- Best-performing model in this project

---

πŸ”„ Project Workflow

1. Data Loading

2. Data Cleaning & Preprocessing

3. Train-Test Split

4. Model Training

- Random Forest

- XGBoost

5. Model Evaluation

6. Performance Comparison

7. Final Model Selection

---

πŸ“ˆ Evaluation Metrics

- Accuracy

- Precision

- Recall

- F1-Score

- Confusion Matrix

---

πŸ† Results

| Model | Performance |

|----------------|------------|

| Random Forest | ~99% Accuracy |

| XGBoost | ⭐ Best Performance (~99%+) |

βœ” **Final Selected Model:** XGBoost

---

πŸ“ Project Structure

---

πŸ”₯ Why This Project Matters

Cyber attacks are increasing rapidly, and manual detection is not scalable.

This system uses Machine Learning to automatically detect and classify malicious network traffic with high accuracy.

---

⭐ Key Features

- End-to-end ML pipeline

- Real-world cybersecurity dataset (CICIDS-2017)

- Multi-model comparison

- High accuracy intrusion detection

- Modular and clean code structure

---

πŸš€ Future Improvements

- Real-time intrusion detection system

- Web dashboard (Flask / Streamlit)

- Deep learning-based detection

- API deployment for production use

---

πŸ‘¨β€πŸ’» Author

**Maaz Korejo**

---

πŸ“Œ Conclusion

This project demonstrates how Machine Learning can be applied to cybersecurity for detecting network intrusions effectively.

The XGBoost model achieved the best performance and was selected as the final model.

---

About

Network Intrusion Detection System using Machine Learning (Random Forest + XGBoost)

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages