# msy2k4/gnn-iot-intrusion-benchmark architecture

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

- Interactive diagram: https://gitdiagram.com/msy2k4/gnn-iot-intrusion-benchmark
- Repository: https://github.com/msy2k4/gnn-iot-intrusion-benchmark

## Overview

This repository is a reproducible benchmark for edge-level, multiclass IoT intrusion classification. Users build or supply a dataset graph, run dataset-specific notebooks to train GNN architectures under imbalance strategies and evaluate across seeds, then analyze the resulting metrics. The README documents the experiment and analysis workflow; sampled graph-builder code confirms graph preparation and serialized outputs. Notebook internals were not sampled, so their detailed control flow is represented only at the documented subsystem level.

Main entry points: [`BoT-IoT`](https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/BoT-IoT) (BoT-IoT runs), [`ToN-IoT`](https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/ToN-IoT) (ToN-IoT runs), [`graph-builders/build_bot_iot_graph.py`](https://github.com/msy2k4/gnn-iot-intrusion-benchmark/blob/main/graph-builders/build_bot_iot_graph.py) (BoT graph builder), [`graph-builders/build_ton_iot_graph.py`](https://github.com/msy2k4/gnn-iot-intrusion-benchmark/blob/main/graph-builders/build_ton_iot_graph.py) (ToN graph builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Graph preparation"]
  node_botbuilder["BoT graph builder"]
  node_tonbuilder["ToN graph builder"]
  node_botgraph["BoT graph artifact"]
  node_tongraph["ToN graph artifact"]
end

subgraph group_experiments["GNN experiments"]
  node_botruns["BoT-IoT runs"]
  node_tonruns["ToN-IoT runs"]
  node_architectures["GNN architectures"]
  node_strategies["Training strategies"]
  node_botresults["BoT run results"]
  node_tonresults["ToN run results"]
end

subgraph group_analysis["Results analysis"]
  node_botanalysis["BoT results analysis<br/>[analyze_results.py]"]
  node_tonanalysis["ToN results analysis<br/>[analyze_results.py]"]
  node_tables["Analysis tables"]
end

subgraph group_ablations["Design ablations"]
  node_ablationruns["Ablation runs"]
  node_ablationresults["Ablation results"]
end

node_user(("Benchmark user"))
node_botdata["BoT-IoT flows"]
node_tondata["ToN-IoT flows"]

node_user -->|"builds graph"| node_botbuilder
node_user -->|"builds graph"| node_tonbuilder
node_botdata -->|"provides flows"| node_botbuilder
node_tondata -->|"provides flows"| node_tonbuilder
node_botbuilder -->|"saves graph"| node_botgraph
node_tonbuilder -->|"saves graph"| node_tongraph
node_user -->|"runs notebooks"| node_botruns
node_user -->|"runs notebooks"| node_tonruns
node_botruns -->|"loads graph"| node_botgraph
node_tonruns -->|"loads graph"| node_tongraph
node_botruns -->|"evaluates"| node_architectures
node_tonruns -->|"evaluates"| node_architectures
node_botruns -->|"trains with"| node_strategies
node_tonruns -->|"trains with"| node_strategies
node_botruns -->|"writes metrics"| node_botresults
node_tonruns -->|"writes metrics"| node_tonresults
node_user -->|"runs ablations"| node_ablationruns
node_ablationruns -->|"writes metrics"| node_ablationresults
node_user -->|"analyzes results"| node_botanalysis
node_user -->|"analyzes results"| node_tonanalysis
node_botresults -->|"provides JSON"| node_botanalysis
node_tonresults -->|"provides JSON"| node_tonanalysis
node_botanalysis -->|"writes tables"| node_tables
node_tonanalysis -->|"writes tables"| node_tables

click node_botbuilder "https://github.com/msy2k4/gnn-iot-intrusion-benchmark/blob/main/graph-builders/build_bot_iot_graph.py"
click node_tonbuilder "https://github.com/msy2k4/gnn-iot-intrusion-benchmark/blob/main/graph-builders/build_ton_iot_graph.py"
click node_botruns "https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/BoT-IoT"
click node_tonruns "https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/ToN-IoT"
click node_architectures "https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/BoT-IoT"
click node_strategies "https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/BoT-IoT"
click node_botresults "https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/results/bot-iot"
click node_tonresults "https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/results/ton-iot"
click node_ablationruns "https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/ablation"
click node_ablationresults "https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/results/ablation"
click node_botanalysis "https://github.com/msy2k4/gnn-iot-intrusion-benchmark/blob/main/results/bot-iot/analyze_results.py"
click node_tonanalysis "https://github.com/msy2k4/gnn-iot-intrusion-benchmark/blob/main/results/ton-iot/analyze_results.py"

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_botbuilder,node_tonbuilder,node_botgraph,node_tongraph,node_user toneBlue
class node_botruns,node_tonruns,node_architectures,node_strategies,node_botresults,node_tonresults toneAmber
class node_botanalysis,node_tonanalysis,node_tables toneMint
class node_ablationruns,node_ablationresults toneRose
class node_botdata,node_tondata toneIndigo
```

## Components

### Graph preparation

- [BoT graph builder](https://github.com/msy2k4/gnn-iot-intrusion-benchmark/blob/main/graph-builders/build_bot_iot_graph.py): `graph-builders/build_bot_iot_graph.py`
- [ToN graph builder](https://github.com/msy2k4/gnn-iot-intrusion-benchmark/blob/main/graph-builders/build_ton_iot_graph.py): `graph-builders/build_ton_iot_graph.py`
- **BoT graph artifact**
- **ToN graph artifact**

### GNN experiments

- [BoT-IoT runs](https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/BoT-IoT): `BoT-IoT`
- [ToN-IoT runs](https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/ToN-IoT): `ToN-IoT`
- [GNN architectures](https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/BoT-IoT): `BoT-IoT`
- [Training strategies](https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/BoT-IoT): `BoT-IoT`
- [BoT run results](https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/results/bot-iot): `results/bot-iot`
- [ToN run results](https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/results/ton-iot): `results/ton-iot`

### Results analysis

- [BoT results analysis](https://github.com/msy2k4/gnn-iot-intrusion-benchmark/blob/main/results/bot-iot/analyze_results.py): `results/bot-iot/analyze_results.py`
- [ToN results analysis](https://github.com/msy2k4/gnn-iot-intrusion-benchmark/blob/main/results/ton-iot/analyze_results.py): `results/ton-iot/analyze_results.py`
- **Analysis tables**

### Design ablations

- [Ablation runs](https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/ablation): `ablation`
- [Ablation results](https://github.com/msy2k4/gnn-iot-intrusion-benchmark/tree/main/results/ablation): `results/ablation`

### Other components

- **Benchmark user**
- **BoT-IoT flows**
- **ToN-IoT flows**

## Connections

- Benchmark user → BoT graph builder: builds graph (evidence: `README.md`)
- Benchmark user → ToN graph builder: builds graph (evidence: `README.md`)
- BoT-IoT flows → BoT graph builder: provides flows (evidence: `graph-builders/build_bot_iot_graph.py`)
- ToN-IoT flows → ToN graph builder: provides flows (evidence: `graph-builders/build_ton_iot_graph.py`)
- BoT graph builder → BoT graph artifact: saves graph (evidence: `graph-builders/build_bot_iot_graph.py`)
- ToN graph builder → ToN graph artifact: saves graph (evidence: `graph-builders/build_ton_iot_graph.py`)
- Benchmark user → BoT-IoT runs: runs notebooks (evidence: `README.md`)
- Benchmark user → ToN-IoT runs: runs notebooks (evidence: `README.md`)
- BoT-IoT runs → BoT graph artifact: loads graph (evidence: `README.md`)
- ToN-IoT runs → ToN graph artifact: loads graph (evidence: `README.md`)
- BoT-IoT runs → GNN architectures: evaluates (evidence: `README.md`)
- ToN-IoT runs → GNN architectures: evaluates (evidence: `README.md`)
- BoT-IoT runs → Training strategies: trains with (evidence: `README.md`)
- ToN-IoT runs → Training strategies: trains with (evidence: `README.md`)
- BoT-IoT runs → BoT run results: writes metrics (evidence: `README.md`)
- ToN-IoT runs → ToN run results: writes metrics (evidence: `README.md`)
- Benchmark user → Ablation runs: runs ablations (evidence: `README.md`)
- Ablation runs → Ablation results: writes metrics (evidence: `README.md`)
- Benchmark user → BoT results analysis: analyzes results (evidence: `README.md`)
- Benchmark user → ToN results analysis: analyzes results (evidence: `README.md`)
- BoT run results → BoT results analysis: provides JSON (evidence: `results/bot-iot/analyze_results.py`)
- ToN run results → ToN results analysis: provides JSON (evidence: `results/ton-iot/analyze_results.py`)
- BoT results analysis → Analysis tables: writes tables (evidence: `results/bot-iot/analyze_results.py`)
- ToN results analysis → Analysis tables: writes tables (evidence: `results/ton-iot/analyze_results.py`)
