# everna44/operational-zero-day-ids-reimplementation architecture

> Architecture diagram of the GitHub repository everna44/operational-zero-day-ids-reimplementation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/everna44/operational-zero-day-ids-reimplementation
- Repository: https://github.com/everna44/operational-zero-day-ids-reimplementation

## Overview

This repository is a clean reimplementation of a research pipeline for zero-day intrusion detection under target false-positive-rate constraints. Its main workflow turns CICIDS2017 flows into labeled host-session nodes, prepares leakage-aware splits and graph variants, trains tabular or GNN models, calibrates thresholds on benign validation scores, and evaluates detection and operational risk on held-out data. The README also describes feature pre-smoothing, multiple graph backbones, and family-level result summaries. Some links for unsampled preprocessing and reporting stages are supported by README statements rather than inspected implementation details.

Main entry points: [`src/run_tabular_experiment.py`](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/run_tabular_experiment.py) (Tabular experiment), [`src/run_gnn_experiment.py`](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/run_gnn_experiment.py) (GNN experiment), [`src/normalize.py`](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/normalize.py) (Feature standardization), [`src/graph_split.py`](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/graph_split.py) (Split-isolated graphs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_sessions["Host sessions<br/>[preprocess.py]"]
  node_splits["Data splits<br/>[split.py]"]
  node_standardization["Feature standardization<br/>[normalize.py]"]
end

subgraph group_graphs["Graph learning"]
  node_communication["Communication edges<br/>[preprocess.py]"]
  node_splitgraphs["Split-isolated graphs<br/>[graph_split.py]"]
  node_knn["KNN similarity graph<br/>[knn_graph.py]"]
  node_smoothing["Feature pre-smoothing<br/>[smoothing.py]"]
end

subgraph group_experiments["Model experiments"]
  node_tabularmodels["Tabular baselines<br/>[tabular.py]"]
  node_mlp["Tabular MLP<br/>[mlp.py]"]
  node_gnnmodels["GNN backbones<br/>[gnn.py]"]
  node_tabexperiment["Tabular experiment"]
  node_gnnexperiment["GNN experiment"]
  node_tabbatch["Tabular batch runner"]
  node_gnnbatch["GNN batch runner<br/>[run_gnn_batch.py]"]
end

subgraph group_evaluation["Operational evaluation"]
  node_calibration["Target-FPR calibration<br/>[calibration.py]"]
  node_metrics["Detection metrics<br/>[evaluation.py]"]
  node_summaries["Family summaries"]
  node_tabsummary["Tabular summaries"]
end

node_researcher(("Researcher"))
node_flows[("CICIDS2017 flows")]

node_researcher -->|"launches runs"| node_tabbatch
node_researcher -->|"launches runs"| node_gnnbatch
node_flows -->|"aggregated into"| node_sessions
node_sessions -->|"derive edges"| node_communication
node_sessions -->|"partition nodes"| node_splits
node_splits -->|"fit on train"| node_standardization
node_standardization -->|"build per-split graphs"| node_splitgraphs
node_communication -->|"filter by split"| node_splitgraphs
node_splitgraphs -->|"rebuild KNN"| node_knn
node_knn -.->|"provides neighbors"| node_smoothing
node_standardization -->|"supplies features"| node_tabexperiment
node_tabexperiment -->|"trains baseline"| node_tabularmodels
node_tabexperiment -->|"trains MLP"| node_mlp
node_tabbatch -->|"runs settings"| node_tabexperiment
node_standardization -->|"supplies nodes"| node_gnnexperiment
node_splitgraphs -.->|"supplies split edges"| node_gnnexperiment
node_gnnexperiment -->|"trains backbone"| node_gnnmodels
node_gnnbatch -->|"runs settings"| node_gnnexperiment
node_tabexperiment -->|"calibrates threshold"| node_calibration
node_tabexperiment -->|"evaluates attacks"| node_metrics
node_gnnexperiment -->|"calibrates threshold"| node_calibration
node_gnnexperiment -->|"evaluates attacks"| node_metrics
node_metrics -.->|"aggregated by family"| node_summaries
node_metrics -.->|"aggregated by family"| node_tabsummary

click node_sessions "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/preprocess.py"
click node_splits "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/split.py"
click node_standardization "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/normalize.py"
click node_communication "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/preprocess.py"
click node_splitgraphs "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/graph_split.py"
click node_knn "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/knn_graph.py"
click node_smoothing "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/smoothing.py"
click node_tabularmodels "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/tabular.py"
click node_mlp "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/mlp.py"
click node_gnnmodels "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/gnn.py"
click node_tabexperiment "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/run_tabular_experiment.py"
click node_gnnexperiment "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/run_gnn_experiment.py"
click node_tabbatch "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/run_tabular_batch.py"
click node_gnnbatch "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/run_gnn_batch.py"
click node_calibration "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/calibration.py"
click node_metrics "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/evaluation.py"
click node_summaries "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/summarize_gnn_results.py"
click node_tabsummary "https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/summarize_tabular_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_sessions,node_splits,node_standardization toneBlue
class node_communication,node_splitgraphs,node_knn,node_smoothing,node_flows toneAmber
class node_tabularmodels,node_mlp,node_gnnmodels,node_tabexperiment,node_gnnexperiment,node_tabbatch,node_gnnbatch toneMint
class node_calibration,node_metrics,node_summaries,node_tabsummary toneRose
class node_researcher toneIndigo
```

## Components

### Data preparation

- [Host sessions](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/preprocess.py): `src/preprocess.py`
- [Data splits](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/split.py): `src/split.py`
- [Feature standardization](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/normalize.py): `src/normalize.py`

### Graph learning

- [Communication edges](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/preprocess.py): `src/preprocess.py`
- [Split-isolated graphs](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/graph_split.py): `src/graph_split.py`
- [KNN similarity graph](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/knn_graph.py): `src/knn_graph.py`
- [Feature pre-smoothing](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/smoothing.py): `src/smoothing.py`

### Model experiments

- [Tabular baselines](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/tabular.py): `src/tabular.py`
- [Tabular MLP](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/mlp.py): `src/mlp.py`
- [GNN backbones](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/gnn.py): `src/gnn.py`
- [Tabular experiment](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/run_tabular_experiment.py): `src/run_tabular_experiment.py`
- [GNN experiment](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/run_gnn_experiment.py): `src/run_gnn_experiment.py`
- [Tabular batch runner](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/run_tabular_batch.py): `src/run_tabular_batch.py`
- [GNN batch runner](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/run_gnn_batch.py): `src/run_gnn_batch.py`

### Operational evaluation

- [Target-FPR calibration](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/calibration.py): `src/calibration.py`
- [Detection metrics](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/evaluation.py): `src/evaluation.py`
- [Family summaries](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/summarize_gnn_results.py): `src/summarize_gnn_results.py`
- [Tabular summaries](https://github.com/everna44/operational-zero-day-ids-reimplementation/blob/main/src/summarize_tabular_results.py): `src/summarize_tabular_results.py`

### Other components

- **Researcher**
- **CICIDS2017 flows**

## Connections

- Researcher → Tabular batch runner: launches runs (evidence: `src/run_tabular_batch.py`)
- Researcher → GNN batch runner: launches runs (evidence: `src/run_gnn_batch.py`)
- CICIDS2017 flows → Host sessions: aggregated into (evidence: `README.md`)
- Host sessions → Communication edges: derive edges (evidence: `src/preprocess.py`)
- Host sessions → Data splits: partition nodes (evidence: `README.md`)
- Data splits → Feature standardization: fit on train (evidence: `README.md`)
- Feature standardization → Split-isolated graphs: build per-split graphs (evidence: `README.md`)
- Communication edges → Split-isolated graphs: filter by split (evidence: `src/graph_split.py`)
- Split-isolated graphs → KNN similarity graph: rebuild KNN (evidence: `src/graph_split.py`)
- KNN similarity graph → Feature pre-smoothing: provides neighbors (evidence: `README.md`)
- Feature standardization → Tabular experiment: supplies features (evidence: `src/run_tabular_experiment.py`)
- Tabular experiment → Tabular baselines: trains baseline (evidence: `src/run_tabular_experiment.py`)
- Tabular experiment → Tabular MLP: trains MLP (evidence: `src/run_tabular_experiment.py`)
- Tabular batch runner → Tabular experiment: runs settings (evidence: `src/run_tabular_batch.py`)
- Feature standardization → GNN experiment: supplies nodes (evidence: `src/run_gnn_experiment.py`)
- Split-isolated graphs → GNN experiment: supplies split edges (evidence: `README.md`)
- GNN experiment → GNN backbones: trains backbone (evidence: `src/run_gnn_experiment.py`)
- GNN batch runner → GNN experiment: runs settings (evidence: `src/run_gnn_batch.py`)
- Tabular experiment → Target-FPR calibration: calibrates threshold (evidence: `src/run_tabular_experiment.py`)
- Tabular experiment → Detection metrics: evaluates attacks (evidence: `src/run_tabular_experiment.py`)
- GNN experiment → Target-FPR calibration: calibrates threshold (evidence: `src/run_gnn_experiment.py`)
- GNN experiment → Detection metrics: evaluates attacks (evidence: `src/run_gnn_experiment.py`)
- Detection metrics → Family summaries: aggregated by family (evidence: `README.md`)
- Detection metrics → Tabular summaries: aggregated by family (evidence: `README.md`)
