# buseyaren/classification-and-detection-ddosattacks architecture

> Architecture diagram of the GitHub repository buseyaren/classification-and-detection-ddosattacks, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/buseyaren/classification-and-detection-ddosattacks
- Repository: https://github.com/buseyaren/classification-and-detection-ddosattacks

## Overview

##### Project type and purpose
- This is a data-science/machine-learning project for detecting DDoS attacks. It uses classical ML (Decision Trees, SVM), reinforcement learning, and deep learning (RNN, LSTM, BiLSTM) methods, all orchestrated via Jupyter notebooks and a Python script.

##### File structure
- Notebooks:
- Desicion Trees.ipynb (Decision Tree experiment)
- Detection of DDOS Attack.ipynb (overall workflow/demo)
- Training_RNN_DDOS_Attack.ipynb (RNN/LSTM training)
- Script: training_rnn_ddos_attack.py (standalone version of the RNN training code)
- Assets: images/ (plots, model result visuals)
- README.md (project overview, results table)

##### README for additional insights
- Confirms three comparative approaches: classical ML, reinforcement learning, deep learning
- Shows performance metrics and sample outputs

##### Main components & interactions (to represent
a. Data Ingestion & Storage
- Raw network packet data (could be CSV/PCAP)
- Stored in a local folder or data lake
b. Preprocessing Module
- Feature extraction (packet length, timestamps, protocol flags)
- Implemented in notebooks (pandas, NumPy)
c. Model Training Engines (three parallel flows)
1. Classical ML Engine
– Uses scikit-learn to train DecisionTreeClassifier and SVM
2. Reinforcement Learning Engine
– Custom RL environment, agent, reward function implemented in Python
3. Deep Learning Engine
– TensorFlow/Keras or PyTorch code in notebooks/training_rnn_ddos_attack.py for RNN, LSTM, BiLSTM
d. Evaluation & Comparison
- Compute accuracy, precision, recall
- Generate plots (matplotlib/seaborn) saved to images/
e. Visualization & Reporting
- Inline charts in notebooks
- Exported images (predicted_attacks.jpg, bwd_packet_length.jpg)
- README.md consolidates key results

##### Architectural patterns & design principles
- Data‐centric pipeline with clear separation of preprocessing, training, and evaluation
- Modular notebooks/scripts each dedicated to one approach
- Reusable preprocessing code across all engines
- Batch processing (no real‐time streaming)

## Diagram (Mermaid)

```mermaid
graph TD
  RawData[(Raw Network Data)]:::data
  Preprocessing["Preprocessing\n(pandas, NumPy)"]:::data
  ClassicalML["Classical ML\n(scikit-learn)"]:::compute
  RL["Reinforcement Learning\n(custom RL)"]:::compute
  DeepLearning["Deep Learning\n(TF/Keras, PyTorch)"]:::compute
  Evaluation["Evaluation & Comparison\n(metrics computation)"]:::output
  Reporting["Visualization & Reporting\n(images, README)"]:::output

  RawData --> Preprocessing
  Preprocessing --> ClassicalML
  Preprocessing --> RL
  Preprocessing --> DeepLearning
  ClassicalML --> Evaluation
  RL --> Evaluation
  DeepLearning --> Evaluation
  Evaluation --> Reporting

  subgraph Legend
    D1["Data Elements"]:::data
    C1["Compute Modules"]:::compute
    O1["Outputs"]:::output
  end

  click Preprocessing "https://github.com/buseyaren/classification-and-detection-ddosattacks/blob/main/Detection of DDOS Attack.ipynb"
  click ClassicalML "https://github.com/buseyaren/classification-and-detection-ddosattacks/blob/main/Desicion Trees.ipynb"
  click RL "https://github.com/buseyaren/classification-and-detection-ddosattacks/blob/main/Detection of DDOS Attack.ipynb"
  click DeepLearning "https://github.com/buseyaren/classification-and-detection-ddosattacks/blob/main/Training_RNN_DDOS_Attack.ipynb"
  click DeepLearning "https://github.com/buseyaren/classification-and-detection-ddosattacks/blob/main/training_rnn_ddos_attack.py"
  click Evaluation "https://github.com/buseyaren/classification-and-detection-ddosattacks/blob/main/Detection of DDOS Attack.ipynb"
  click Evaluation "https://github.com/buseyaren/classification-and-detection-ddosattacks/tree/main/images/"
  click Reporting "https://github.com/buseyaren/classification-and-detection-ddosattacks/tree/main/images/"
  click Reporting "https://github.com/buseyaren/classification-and-detection-ddosattacks/blob/main/README.md"

  classDef data fill:#E0F7FA,stroke:#00BCD4,color:#006064;
  classDef compute fill:#E8F5E9,stroke:#4CAF50,color:#1B5E20;
  classDef output fill:#FFF3E0,stroke:#FF9800,color:#E65100;
```
