# western-oc2-lab/intrusion-detection-system-using-machine-learning architecture

> Architecture diagram of the GitHub repository western-oc2-lab/intrusion-detection-system-using-machine-learning, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/western-oc2-lab/intrusion-detection-system-using-machine-learning
- Repository: https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning

## Overview

This repository provides notebook implementations of three machine-learning intrusion-detection systems: a tree-based detector, the multi-tiered MTH-IDS, and the LCCDE ensemble. Their documented workflows cover traffic data, preprocessing or feature engineering where specified, model training and optimization, and attack detection. The README describes the systems but no notebook source was excerpted, so the graph shows only documented relationships; it does not infer notebook-internal calls or connect individual sample files to specific models.

Main entry points: [`MTH_IDS_IoTJ.ipynb`](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/MTH_IDS_IoTJ.ipynb) (MTH-IDS), [`Tree-based_IDS_GlobeCom19.ipynb`](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/Tree-based_IDS_GlobeCom19.ipynb) (Tree-based IDS), [`LCCDE_IDS_GlobeCom22.ipynb`](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/LCCDE_IDS_GlobeCom22.ipynb) (LCCDE), [`data/CICIDS2017_sample.csv`](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/data/CICIDS2017_sample.csv) (CICIDS2017 sample)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Traffic data"]
  node_cic_sample["CICIDS2017 sample"]
  node_cic_km["K-means sample"]
  node_iot_sample["IoT 2020 sample"]
end

subgraph group_tree["Tree-based IDS"]
  node_tree_notebook["Tree-based IDS"]
  node_tree_learners["Tree learners"]
  node_tree_ensemble["Ensemble and selection"]
end

subgraph group_mth["MTH-IDS"]
  node_mth_notebook["MTH-IDS<br/>[MTH_IDS_IoTJ.ipynb]"]
  node_mth_preprocess["Preprocessing and features<br/>[MTH_IDS_IoTJ.ipynb]"]
  node_mth_supervised["Known-attack learners<br/>[MTH_IDS_IoTJ.ipynb]"]
  node_mth_stacking["Stacking and BO-TPE<br/>[MTH_IDS_IoTJ.ipynb]"]
  node_mth_kmeans["Cluster labeling<br/>[MTH_IDS_IoTJ.ipynb]"]
  node_mth_biased["Biased classifiers and BO-GP<br/>[MTH_IDS_IoTJ.ipynb]"]
end

subgraph group_lccde["LCCDE"]
  node_lccde_notebook["LCCDE"]
  node_lccde_models["Class leader models"]
  node_lccde_decision["Confidence decisions"]
end

node_researcher(("IDS researcher"))

node_researcher -->|"runs"| node_tree_notebook
node_researcher -->|"runs"| node_mth_notebook
node_researcher -->|"runs"| node_lccde_notebook
node_cic_sample -->|"sample data"| node_tree_notebook
node_cic_sample -->|"sample data"| node_mth_notebook
node_tree_notebook -->|"uses"| node_tree_learners
node_tree_notebook -->|"uses"| node_tree_ensemble
node_mth_notebook -->|"includes"| node_mth_preprocess
node_mth_notebook -->|"includes"| node_mth_supervised
node_mth_notebook -->|"optimizes"| node_mth_stacking
node_mth_notebook -->|"includes"| node_mth_kmeans
node_mth_notebook -->|"optimizes"| node_mth_biased
node_lccde_notebook -->|"selects leaders"| node_lccde_models
node_lccde_notebook -->|"combines confidence"| node_lccde_decision

click node_cic_sample "https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/data/CICIDS2017_sample.csv"
click node_cic_km "https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/data/CICIDS2017_sample_km.csv"
click node_iot_sample "https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/data/IoT_2020_multi_0.05.csv"
click node_tree_notebook "https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/Tree-based_IDS_GlobeCom19.ipynb"
click node_tree_learners "https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/Tree-based_IDS_GlobeCom19.ipynb"
click node_tree_ensemble "https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/Tree-based_IDS_GlobeCom19.ipynb"
click node_mth_notebook "https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/MTH_IDS_IoTJ.ipynb"
click node_mth_preprocess "https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/MTH_IDS_IoTJ.ipynb"
click node_mth_supervised "https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/MTH_IDS_IoTJ.ipynb"
click node_mth_stacking "https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/MTH_IDS_IoTJ.ipynb"
click node_mth_kmeans "https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/MTH_IDS_IoTJ.ipynb"
click node_mth_biased "https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/MTH_IDS_IoTJ.ipynb"
click node_lccde_notebook "https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/LCCDE_IDS_GlobeCom22.ipynb"
click node_lccde_models "https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/LCCDE_IDS_GlobeCom22.ipynb"
click node_lccde_decision "https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/LCCDE_IDS_GlobeCom22.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_cic_sample,node_cic_km,node_iot_sample toneBlue
class node_tree_notebook,node_tree_learners,node_tree_ensemble toneAmber
class node_mth_notebook,node_mth_preprocess,node_mth_supervised,node_mth_stacking,node_mth_kmeans,node_mth_biased toneMint
class node_lccde_notebook,node_lccde_models,node_lccde_decision toneRose
class node_researcher toneIndigo
```

## Components

### Traffic data

- [CICIDS2017 sample](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/data/CICIDS2017_sample.csv): `data/CICIDS2017_sample.csv`
- [K-means sample](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/data/CICIDS2017_sample_km.csv): `data/CICIDS2017_sample_km.csv`
- [IoT 2020 sample](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/data/IoT_2020_multi_0.05.csv): `data/IoT_2020_multi_0.05.csv`

### Tree-based IDS

- [Tree-based IDS](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/Tree-based_IDS_GlobeCom19.ipynb): `Tree-based_IDS_GlobeCom19.ipynb`
- [Tree learners](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/Tree-based_IDS_GlobeCom19.ipynb): `Tree-based_IDS_GlobeCom19.ipynb`
- [Ensemble and selection](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/Tree-based_IDS_GlobeCom19.ipynb): `Tree-based_IDS_GlobeCom19.ipynb`

### MTH-IDS

- [MTH-IDS](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/MTH_IDS_IoTJ.ipynb): `MTH_IDS_IoTJ.ipynb`
- [Preprocessing and features](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/MTH_IDS_IoTJ.ipynb): `MTH_IDS_IoTJ.ipynb`
- [Known-attack learners](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/MTH_IDS_IoTJ.ipynb): `MTH_IDS_IoTJ.ipynb`
- [Stacking and BO-TPE](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/MTH_IDS_IoTJ.ipynb): `MTH_IDS_IoTJ.ipynb`
- [Cluster labeling](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/MTH_IDS_IoTJ.ipynb): `MTH_IDS_IoTJ.ipynb`
- [Biased classifiers and BO-GP](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/MTH_IDS_IoTJ.ipynb): `MTH_IDS_IoTJ.ipynb`

### LCCDE

- [LCCDE](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/LCCDE_IDS_GlobeCom22.ipynb): `LCCDE_IDS_GlobeCom22.ipynb`
- [Class leader models](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/LCCDE_IDS_GlobeCom22.ipynb): `LCCDE_IDS_GlobeCom22.ipynb`
- [Confidence decisions](https://github.com/western-oc2-lab/intrusion-detection-system-using-machine-learning/blob/main/LCCDE_IDS_GlobeCom22.ipynb): `LCCDE_IDS_GlobeCom22.ipynb`

### Other components

- **IDS researcher**

## Connections

- IDS researcher → Tree-based IDS: runs (evidence: `README.md`)
- IDS researcher → MTH-IDS: runs (evidence: `README.md`)
- IDS researcher → LCCDE: runs (evidence: `README.md`)
- CICIDS2017 sample → Tree-based IDS: sample data (evidence: `README.md`)
- CICIDS2017 sample → MTH-IDS: sample data (evidence: `README.md`)
- Tree-based IDS → Tree learners: uses (evidence: `README.md`)
- Tree-based IDS → Ensemble and selection: uses (evidence: `README.md`)
- MTH-IDS → Preprocessing and features: includes (evidence: `README.md`)
- MTH-IDS → Known-attack learners: includes (evidence: `README.md`)
- MTH-IDS → Stacking and BO-TPE: optimizes (evidence: `README.md`)
- MTH-IDS → Cluster labeling: includes (evidence: `README.md`)
- MTH-IDS → Biased classifiers and BO-GP: optimizes (evidence: `README.md`)
- LCCDE → Class leader models: selects leaders (evidence: `README.md`)
- LCCDE → Confidence decisions: combines confidence (evidence: `README.md`)
