# amankumar-git9868/intrusion-detection-system architecture

> Architecture diagram of the GitHub repository amankumar-git9868/intrusion-detection-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amankumar-git9868/intrusion-detection-system
- Repository: https://github.com/amankumar-git9868/intrusion-detection-system

## Overview

This repository is a notebook-based intrusion-detection research project. Users provide ToN_IoT or NSL-KDD data and run the corresponding notebook through preprocessing, temporal-window formulation, dual-stream classification, cross-validation, and evaluation. The README documents the phase order and model architecture, but no notebook source excerpts were provided; relationships below therefore reflect documented workflow rather than inspected calls.

Main entry points: [`IDSMinorProject.ipynb`](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb) (Form time windows), [`IDS_NSLKDD_Validation.ipynb`](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDS_NSLKDD_Validation.ipynb) (Ingest and scale)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ton["ToN_IoT workflow"]
  node_ton_data[("ToN_IoT data")]
  node_ton_ingest["Ingest and scale"]
  node_ton_balance["SMOTE balancing"]
  node_ton_features["Select features"]
  node_ton_windows["Form time windows"]
end

subgraph group_nsl["NSL-KDD validation"]
  node_nsl_data[("NSL-KDD data")]
  node_nsl_ingest["Ingest and scale"]
  node_nsl_balance["SMOTE balancing"]
  node_nsl_features["Select features"]
  node_nsl_windows["Form time windows"]
end

subgraph group_model["Dual-stream model"]
  node_bilstm["BiLSTM stream"]
  node_transformer["Transformer stream"]
  node_fusion["Feature fusion"]
  node_classifier["Classification head"]
end

subgraph group_evaluation["Validation and evaluation"]
  node_ton_cv["Five-fold CV"]
  node_ton_results["Metrics and plots"]
  node_nsl_cv["Five-fold CV"]
  node_nsl_results["Metrics and plots"]
end

node_user(("Researcher"))

node_user -->|"provides"| node_ton_data
node_ton_data -->|"loads and scales"| node_ton_ingest
node_ton_ingest -->|"balances classes"| node_ton_balance
node_ton_balance -->|"selects features"| node_ton_features
node_ton_features -->|"forms windows"| node_ton_windows
node_user -->|"provides"| node_nsl_data
node_nsl_data -->|"loads and scales"| node_nsl_ingest
node_nsl_ingest -->|"balances classes"| node_nsl_balance
node_nsl_balance -->|"selects features"| node_nsl_features
node_nsl_features -->|"forms windows"| node_nsl_windows
node_ton_windows -->|"analyzes sequence"| node_bilstm
node_ton_windows -->|"analyzes raw window"| node_transformer
node_bilstm -->|"contributes context"| node_fusion
node_transformer -->|"contributes context"| node_fusion
node_fusion -->|"feeds classifier"| node_classifier
node_classifier -->|"evaluated by"| node_ton_cv
node_ton_cv -->|"generates metrics"| node_ton_results
node_nsl_windows -->|"evaluated by"| node_nsl_cv
node_nsl_cv -->|"generates metrics"| node_nsl_results

click node_ton_ingest "https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb"
click node_ton_balance "https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb"
click node_ton_features "https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb"
click node_ton_windows "https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb"
click node_nsl_ingest "https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDS_NSLKDD_Validation.ipynb"
click node_nsl_balance "https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDS_NSLKDD_Validation.ipynb"
click node_nsl_features "https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDS_NSLKDD_Validation.ipynb"
click node_nsl_windows "https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDS_NSLKDD_Validation.ipynb"
click node_bilstm "https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb"
click node_transformer "https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb"
click node_fusion "https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb"
click node_classifier "https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb"
click node_ton_cv "https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb"
click node_ton_results "https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb"
click node_nsl_cv "https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDS_NSLKDD_Validation.ipynb"
click node_nsl_results "https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDS_NSLKDD_Validation.ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ton_data,node_ton_ingest,node_ton_balance,node_ton_features,node_ton_windows toneBlue
class node_nsl_data,node_nsl_ingest,node_nsl_balance,node_nsl_features,node_nsl_windows toneAmber
class node_bilstm,node_transformer,node_fusion,node_classifier toneMint
class node_ton_cv,node_ton_results,node_nsl_cv,node_nsl_results toneRose
class node_user toneIndigo
```

## Components

### ToN_IoT workflow

- **ToN_IoT data**
- [Ingest and scale](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb): `IDSMinorProject.ipynb`
- [SMOTE balancing](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb): `IDSMinorProject.ipynb`
- [Select features](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb): `IDSMinorProject.ipynb`
- [Form time windows](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb): `IDSMinorProject.ipynb`

### NSL-KDD validation

- **NSL-KDD data**
- [Ingest and scale](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDS_NSLKDD_Validation.ipynb): `IDS_NSLKDD_Validation.ipynb`
- [SMOTE balancing](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDS_NSLKDD_Validation.ipynb): `IDS_NSLKDD_Validation.ipynb`
- [Select features](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDS_NSLKDD_Validation.ipynb): `IDS_NSLKDD_Validation.ipynb`
- [Form time windows](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDS_NSLKDD_Validation.ipynb): `IDS_NSLKDD_Validation.ipynb`

### Dual-stream model

- [BiLSTM stream](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb): `IDSMinorProject.ipynb`
- [Transformer stream](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb): `IDSMinorProject.ipynb`
- [Feature fusion](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb): `IDSMinorProject.ipynb`
- [Classification head](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb): `IDSMinorProject.ipynb`

### Validation and evaluation

- [Five-fold CV](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb): `IDSMinorProject.ipynb`
- [Metrics and plots](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDSMinorProject.ipynb): `IDSMinorProject.ipynb`
- [Five-fold CV](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDS_NSLKDD_Validation.ipynb): `IDS_NSLKDD_Validation.ipynb`
- [Metrics and plots](https://github.com/amankumar-git9868/intrusion-detection-system/blob/main/IDS_NSLKDD_Validation.ipynb): `IDS_NSLKDD_Validation.ipynb`

### Other components

- **Researcher**

## Connections

- Researcher → ToN_IoT data: provides (evidence: `README.md`)
- ToN_IoT data → Ingest and scale: loads and scales (evidence: `README.md`)
- Ingest and scale → SMOTE balancing: balances classes (evidence: `README.md`)
- SMOTE balancing → Select features: selects features (evidence: `README.md`)
- Select features → Form time windows: forms windows (evidence: `README.md`)
- Researcher → NSL-KDD data: provides (evidence: `README.md`)
- NSL-KDD data → Ingest and scale: loads and scales (evidence: `README.md`)
- Ingest and scale → SMOTE balancing: balances classes (evidence: `README.md`)
- SMOTE balancing → Select features: selects features (evidence: `README.md`)
- Select features → Form time windows: forms windows (evidence: `README.md`)
- Form time windows → BiLSTM stream: analyzes sequence (evidence: `README.md`)
- Form time windows → Transformer stream: analyzes raw window (evidence: `README.md`)
- BiLSTM stream → Feature fusion: contributes context (evidence: `README.md`)
- Transformer stream → Feature fusion: contributes context (evidence: `README.md`)
- Feature fusion → Classification head: feeds classifier (evidence: `README.md`)
- Classification head → Five-fold CV: evaluated by (evidence: `README.md`)
- Five-fold CV → Metrics and plots: generates metrics (evidence: `README.md`)
- Form time windows → Five-fold CV: evaluated by (evidence: `README.md`)
- Five-fold CV → Metrics and plots: generates metrics (evidence: `README.md`)
