Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aryanxxvii/lstm-ddos-prediction
LSTM neural network in PyTorch to predict DDoS attacks from network packet data, with 95% accuracy
https://github.com/aryanxxvii/lstm-ddos-prediction
ddos kafka network-analysis pyspark pytorch
Last synced: 7 days ago
JSON representation
LSTM neural network in PyTorch to predict DDoS attacks from network packet data, with 95% accuracy
- Host: GitHub
- URL: https://github.com/aryanxxvii/lstm-ddos-prediction
- Owner: aryanxxvii
- Created: 2024-08-18T17:21:51.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-11-11T10:40:12.000Z (3 months ago)
- Last Synced: 2024-11-11T11:36:02.298Z (3 months ago)
- Topics: ddos, kafka, network-analysis, pyspark, pytorch
- Language: Python
- Homepage:
- Size: 2.18 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## DDoS Attack Detection with Stacked-LSTM and Real-Time Inference
Developed a 4-layer stacked-LSTM model to detect DDoS attacks, achieving **95.94% accuracy** on the CIC-DDoS2019 dataset using PyTorch and Numpy. The project involved:
![Connections per Second](_resources/connections_per_time.png)
- **Data Processing:**
- Utilized **PySpark** to process and combine data from 11 different network packet sources into a single NumPy object for training and testing.
- **Model Development:**
- Implemented a 4-layer stacked-LSTM model in **PyTorch** for time-series classification to differentiate between benign and DDoS attack traffic.- **Real-Time Inference with Apache Kafka:**
- Created a **Kafka Producer** to simulate real-time network packet flow using test data.
- Developed a **Kafka Consumer** that takes in packets in real-time, performs inference with the trained LSTM model, and classifies them as DDoS or benign traffic.- **Evaluation**:
The performance of the model was evaluated using various metrics and visualizations to assess its ability to detect DDoS attacks accurately:- **Accuracy:** 95.94%
- **Precision:** 98.21%
- **Recall:** 97.24%
- **F1 Score:** 97.73%
### Technologies Used:
- **PyTorch**: For building and training the stacked-LSTM model.
- **Kafka**: For simulating real-time packet flow (Producer and Consumer).
- **PySpark**: For data preprocessing and combining multiple data sources.
- **Seaborn/Matplotlib**: For data visualization.
- **NumPy**: For handling and manipulating data.