# clemsjr/network-intrusion-detection-system- architecture

> Architecture diagram of the GitHub repository clemsjr/network-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/clemsjr/network-intrusion-detection-system-
- Repository: https://github.com/clemsjr/network-intrusion-detection-system-

## Overview

This repository is a notebook-based network intrusion detection project. Its documented workflow explores and cleans CICIDS2017 traffic, classifies it into benign and attack categories with a Random Forest, evaluates results, analyzes feature importance, and saves a trained model. The notebook is the only listed workflow source; its contents were not provided, so the stages and their links below rely on the README rather than inspected implementation. The README documents saved model and label-encoder artifacts, but does not specify how the encoder is used.

Main entry points: [`notebooks/01_data_loading.ipynb`](https://github.com/clemsjr/network-intrusion-detection-system-/blob/main/notebooks/01_data_loading.ipynb) (Random Forest classifier), [`models/ids.pkl`](https://github.com/clemsjr/network-intrusion-detection-system-/blob/main/models/ids.pkl) (Saved IDS model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Traffic preparation"]
  node_exploration["Explore and clean"]
end

subgraph group_modeling["Intrusion modeling"]
  node_classifier["Random Forest classifier"]
  node_evaluation["Model evaluation"]
  node_importance["Feature importance"]
end

subgraph group_artifacts["Saved artifacts"]
  node_trained_model["Saved IDS model<br/>[ids.pkl]"]
  node_models_encoder["Saved label encoder<br/>[label_encoder.pkl]"]
  node_root_encoder["Root label encoder<br/>[label_encoder.pkl]"]
end

node_dataset[("CICIDS2017 dataset")]

node_dataset -->|"provides traffic"| node_exploration
node_exploration -->|"prepares features"| node_classifier
node_classifier -->|"evaluated by"| node_evaluation
node_classifier -->|"analyzed for"| node_importance
node_classifier -->|"saved as"| node_trained_model

click node_exploration "https://github.com/clemsjr/network-intrusion-detection-system-/blob/main/notebooks/01_data_loading.ipynb"
click node_classifier "https://github.com/clemsjr/network-intrusion-detection-system-/blob/main/notebooks/01_data_loading.ipynb"
click node_evaluation "https://github.com/clemsjr/network-intrusion-detection-system-/blob/main/notebooks/01_data_loading.ipynb"
click node_importance "https://github.com/clemsjr/network-intrusion-detection-system-/blob/main/notebooks/01_data_loading.ipynb"
click node_trained_model "https://github.com/clemsjr/network-intrusion-detection-system-/blob/main/models/ids.pkl"
click node_models_encoder "https://github.com/clemsjr/network-intrusion-detection-system-/blob/main/models/label_encoder.pkl"
click node_root_encoder "https://github.com/clemsjr/network-intrusion-detection-system-/blob/main/label_encoder.pkl"

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_exploration toneBlue
class node_classifier,node_evaluation,node_importance,node_dataset toneAmber
class node_trained_model,node_models_encoder,node_root_encoder toneMint
```

## Components

### Traffic preparation

- [Explore and clean](https://github.com/clemsjr/network-intrusion-detection-system-/blob/main/notebooks/01_data_loading.ipynb): `notebooks/01_data_loading.ipynb`

### Intrusion modeling

- [Random Forest classifier](https://github.com/clemsjr/network-intrusion-detection-system-/blob/main/notebooks/01_data_loading.ipynb): `notebooks/01_data_loading.ipynb`
- [Model evaluation](https://github.com/clemsjr/network-intrusion-detection-system-/blob/main/notebooks/01_data_loading.ipynb): `notebooks/01_data_loading.ipynb`
- [Feature importance](https://github.com/clemsjr/network-intrusion-detection-system-/blob/main/notebooks/01_data_loading.ipynb): `notebooks/01_data_loading.ipynb`

### Saved artifacts

- [Saved IDS model](https://github.com/clemsjr/network-intrusion-detection-system-/blob/main/models/ids.pkl): `models/ids.pkl`
- [Saved label encoder](https://github.com/clemsjr/network-intrusion-detection-system-/blob/main/models/label_encoder.pkl): `models/label_encoder.pkl`
- [Root label encoder](https://github.com/clemsjr/network-intrusion-detection-system-/blob/main/label_encoder.pkl): `label_encoder.pkl`

### Other components

- **CICIDS2017 dataset**

## Connections

- CICIDS2017 dataset → Explore and clean: provides traffic (evidence: `README.md`)
- Explore and clean → Random Forest classifier: prepares features (evidence: `README.md`)
- Random Forest classifier → Model evaluation: evaluated by (evidence: `README.md`)
- Random Forest classifier → Feature importance: analyzed for (evidence: `README.md`)
- Random Forest classifier → Saved IDS model: saved as (evidence: `README.md`)
