# vduong421/ids-system architecture

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

- Interactive diagram: https://gitdiagram.com/vduong421/ids-system
- Repository: https://github.com/vduong421/ids-system

## Overview

##### Project Type and Purpose
- This is a data‐science/ML pipeline encapsulated in a single Jupyter Notebook (`main.ipynb`) for network intrusion detection.
- The notebook orchestrates data loading, preprocessing (including SMOTE resampling), model training (Random Forest, SVM, MLP), evaluation, and visualization.

##### High-Level Components
A. Data Ingestion
B. Data Cleaning & Preprocessing
C. Train-Test Splitting
D. Class Balancing (SMOTE)
E. Model Training (stock & tuned)
F. Evaluation & Metrics Calculation
G. Visualization & Reporting

##### Relationships & Data Flow
- Data flows sequentially from A → B → C → D → E → F → G.
- Within Model Training (E), three parallel tracks run (Random Forest, SVM, MLP), each with two configurations (stock vs tuned). Their outputs all feed into the Evaluation (F) block.

##### Architectural Patterns & Design Principles
- Pipeline Pattern: linear, stage-based processing of data.
- Parallel Model Training: fork/join pattern for training multiple models concurrently.
- Single workbook “host” that orchestrates all steps—there is no separate service or API layer.

##### Technology & Framework Call-Outs
- “Jupyter Notebook / Python” as the orchestration environment at the top.
- Under Data Ingestion (A), list “pandas” and “glob/os” for CSV merging.
- For SMOTE (D), list “imblearn.over_sampling.SMOTE.”
- In Model Training (E), list “scikit-learn” under each model.
- For Visualization (G), annotate “matplotlib” or “seaborn.”

## Diagram (Mermaid)

```mermaid
flowchart TB
    Env["Jupyter Notebook / Python"]:::env
    Doc["README.md"]:::doc

    Env --> A
    A --> B
    B --> C
    C --> D
    D --> RF_stock
    D --> RF_tuned
    D --> SVM_stock
    D --> SVM_tuned
    D --> MLP_stock
    D --> MLP_tuned
    RF_stock --> F
    RF_tuned --> F
    SVM_stock --> F
    SVM_tuned --> F
    MLP_stock --> F
    MLP_tuned --> F
    F --> G

    subgraph "Model Training" 
        direction TB
        RF_stock["Random Forest\nStock"]:::green
        RF_tuned["Random Forest\nTuned"]:::green
        SVM_stock["SVM\nStock"]:::green
        SVM_tuned["SVM\nTuned"]:::green
        MLP_stock["MLP\nStock"]:::green
        MLP_tuned["MLP\nTuned"]:::green
    end

    A["Data Ingestion\n(pandas, glob/os)"]:::blue
    B["Data Cleaning & Preprocessing"]:::blue
    C["Train-Test Splitting"]:::blue
    D["Class Balancing\n(imblearn.over_sampling.SMOTE)"]:::orange
    F["Evaluation & Metrics Calculation"]:::purple
    G["Visualization & Reporting\n(matplotlib, seaborn)"]:::gray

    click Doc "https://github.com/vduong421/ids-system/blob/main/README.md"
    click Env "https://github.com/vduong421/ids-system/blob/main/main.ipynb"
    click A "https://github.com/vduong421/ids-system/blob/main/main.ipynb"
    click B "https://github.com/vduong421/ids-system/blob/main/main.ipynb"
    click C "https://github.com/vduong421/ids-system/blob/main/main.ipynb"
    click D "https://github.com/vduong421/ids-system/blob/main/main.ipynb"
    click RF_stock "https://github.com/vduong421/ids-system/blob/main/main.ipynb"
    click RF_tuned "https://github.com/vduong421/ids-system/blob/main/main.ipynb"
    click SVM_stock "https://github.com/vduong421/ids-system/blob/main/main.ipynb"
    click SVM_tuned "https://github.com/vduong421/ids-system/blob/main/main.ipynb"
    click MLP_stock "https://github.com/vduong421/ids-system/blob/main/main.ipynb"
    click MLP_tuned "https://github.com/vduong421/ids-system/blob/main/main.ipynb"
    click F "https://github.com/vduong421/ids-system/blob/main/main.ipynb"
    click G "https://github.com/vduong421/ids-system/blob/main/main.ipynb"

    classDef blue fill:#ADD8E6,stroke:#000;
    classDef orange fill:#FFA500,stroke:#000;
    classDef green fill:#90EE90,stroke:#000;
    classDef purple fill:#DDA0DD,stroke:#000;
    classDef gray fill:#D3D3D3,stroke:#000;
    classDef env fill:#FFFFE0,stroke:#000,stroke-dasharray: 5 5;
    classDef doc fill:#F0F8FF,stroke:#000,stroke-dasharray: 5 5;
```
