AI-powered network intrusion detection system β classifies DoS, DDoS, PortScan, and Brute Force attacks using Machine Learning and Deep Learning, with a Flask web interface for real-time prediction.
This project is developed for educational and research purposes only. It demonstrates intrusion detection concepts using the CIC-IDS2017 benchmark dataset and is not intended for production deployment without further hardening.
ShieldNet is an end-to-end network intrusion detection system (NIDS) that combines classical machine learning and deep learning to classify malicious network traffic. It processes both benchmark dataset traffic and custom Wireshark-captured PCAPs β from raw packets all the way to a web-based prediction interface.
The system detects:
- DoS (Denial of Service)
- DDoS (Distributed Denial of Service)
- PortScan (Network Reconnaissance)
- Brute Force (Credential Attacks)
- Benign (Normal Traffic)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SHIELDNET PIPELINE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β DATA SOURCES β β
β β CIC-IDS2017 Dataset | Custom PCAP (Wireshark/tshark) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β PREPROCESSING (notebook(prep)/) β β
β β Feature extraction β Cleaning β Normalization β β
β β Feature selection β SMOTE (class imbalance) β β
β β Feature alignment (dataset β custom traffic) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β MODEL TRAINING (notebooks/) β β
β β β β
β β Machine Learning: Deep Learning: β β
β β - Logistic Regression - ANN (Artificial Neural Net) β β
β β - Random Forest - CNN (Convolutional NN) β β
β β - SVM - LSTM (Long Short-Term Mem) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β MODEL SERIALIZATION (models/) β β
β β Trained models + Scaler + Label Encoder β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β FLASK WEB APP (app.py) β β
β β Upload traffic β Select model β Get prediction β β
β β Supports dataset input + custom PCAP input β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Model | Type | Purpose |
|---|---|---|
| Logistic Regression | Machine Learning | Baseline classifier |
| Random Forest | Machine Learning | Ensemble, high accuracy |
| SVM | Machine Learning | Margin-based classification |
| ANN | Deep Learning | Feedforward neural network |
| CNN | Deep Learning | Pattern recognition in traffic features |
| LSTM | Deep Learning | Sequential/temporal traffic analysis |
- CIC-IDS2017 β Canadian Institute for Cybersecurity benchmark dataset containing labeled network flows for DoS, DDoS, PortScan, Brute Force, and Benign traffic
- Custom traffic β Captured using Wireshark, processed with
tsharkfor feature extraction - Class imbalance β Handled using SMOTE (Synthetic Minority Oversampling Technique)
- Feature alignment β Ensures consistency between CIC-IDS2017 features and custom-captured traffic features
ShieldNet/
β
βββ app.py # Flask web application β prediction + interface
β
βββ models/
β βββ final_dl_models/ # Trained models, scaler, label encoder
β
βββ notebooks/ # Model training, EDA, experimentation
β
βββ notebook(prep)/ # Data preprocessing and feature alignment
β
βββ templates/ # HTML frontend templates
β
βββ static/ # CSS and UI assets
β
βββ assets/ # Images and visualizations
β
βββ requirements.txt
βββ .gitignore
| Component | Technology |
|---|---|
| Backend | Python, Flask |
| Machine Learning | Scikit-learn |
| Deep Learning | TensorFlow / Keras |
| Data Processing | Pandas, NumPy |
| Class Balancing | imbalanced-learn (SMOTE) |
| Traffic Capture | Wireshark, tshark |
| Frontend | HTML, CSS |
Clone the repository:
git clone https://github.com/Ki1shan/ShieldNet.git
cd ShieldNetInstall dependencies:
pip install -r requirements.txtRun the application:
python app.pyOpen in browser:
http://127.0.0.1:5000/
- Network Intrusion Detection (NIDS) β passive monitoring and classification of network flows
- CIC-IDS2017 β industry-standard benchmark dataset for IDS research
- SMOTE β synthetic data generation to handle severe class imbalance in attack datasets
- Feature Engineering β extraction of flow-level statistics from raw packet captures
- Multi-class Classification β simultaneous detection of multiple attack types in a single model
- PCAP Processing β raw packet capture β tshark β feature vector β model prediction
- Live network traffic capture integration
- Real-time streaming analysis
- Model optimization for higher accuracy
- Cloud deployment (AWS/GCP)
- SIEM integration (Splunk, ELK)
- API endpoint for programmatic prediction
Kishan N Offensive Security Engineer | AI/ML Security Researcher
Built ShieldNet to bridge the gap between machine learning research and practical network security β applying deep learning techniques to real-world intrusion detection challenges.
MIT License β see LICENSE file for details.
Traffic doesn't lie. The model just needs to learn how to listen.