# libamariyamk/explainable-ai-for-ids architecture

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

- Interactive diagram: https://gitdiagram.com/libamariyamk/explainable-ai-for-ids
- Repository: https://github.com/libamariyamk/explainable-ai-for-ids

## Overview

This notebook-based IDS project turns CICIDS-2017 network-flow data into intrusion predictions, evaluates model performance, and uses LIME to explain individual predictions. The README documents preprocessing, Decision Tree, Random Forest, SVM and Voting Classifier models, plus confusion matrices and standard metrics. The repository provides no source excerpts, so the graph reflects README-documented capabilities and relationships only; the notebook is the sole implementation path visible in the file tree.

Main entry points: [`Code_XAI IDS.ipynb`](https://github.com/libamariyamk/explainable-ai-for-ids/blob/main/Code_XAI%20IDS.ipynb) (Intrusion predictions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_prep["Preprocessing<br/>[Code_XAI IDS.ipynb]"]
end

subgraph group_detection["Intrusion detection"]
  node_base_models["DT, RF, SVM<br/>[Code_XAI IDS.ipynb]"]
  node_voting["Voting classifier<br/>[Code_XAI IDS.ipynb]"]
  node_predictions["Intrusion predictions<br/>[Code_XAI IDS.ipynb]"]
end

subgraph group_interpretation["Evaluation and explanations"]
  node_evaluation["Performance evaluation<br/>[Code_XAI IDS.ipynb]"]
  node_lime["LIME explanations<br/>[Code_XAI IDS.ipynb]"]
end

node_dataset["CICIDS-2017 data"]
node_analyst(("IDS analyst"))

node_dataset -->|"provides flows"| node_prep
node_prep -->|"trains on"| node_base_models
node_base_models -->|"ensemble models"| node_voting
node_voting -->|"classifies flows"| node_predictions
node_predictions -->|"evaluated by"| node_evaluation
node_predictions -->|"explained by"| node_lime
node_lime -->|"provides explanations"| node_analyst
node_evaluation -->|"reports metrics"| node_analyst

click node_prep "https://github.com/libamariyamk/explainable-ai-for-ids/blob/main/Code_XAI%20IDS.ipynb"
click node_base_models "https://github.com/libamariyamk/explainable-ai-for-ids/blob/main/Code_XAI%20IDS.ipynb"
click node_voting "https://github.com/libamariyamk/explainable-ai-for-ids/blob/main/Code_XAI%20IDS.ipynb"
click node_predictions "https://github.com/libamariyamk/explainable-ai-for-ids/blob/main/Code_XAI%20IDS.ipynb"
click node_evaluation "https://github.com/libamariyamk/explainable-ai-for-ids/blob/main/Code_XAI%20IDS.ipynb"
click node_lime "https://github.com/libamariyamk/explainable-ai-for-ids/blob/main/Code_XAI%20IDS.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_prep toneBlue
class node_base_models,node_voting,node_predictions toneAmber
class node_evaluation,node_lime toneMint
class node_dataset,node_analyst toneIndigo
```

## Components

### Data preparation

- [Preprocessing](https://github.com/libamariyamk/explainable-ai-for-ids/blob/main/Code_XAI%20IDS.ipynb): `Code_XAI IDS.ipynb`

### Intrusion detection

- [DT, RF, SVM](https://github.com/libamariyamk/explainable-ai-for-ids/blob/main/Code_XAI%20IDS.ipynb): `Code_XAI IDS.ipynb`
- [Voting classifier](https://github.com/libamariyamk/explainable-ai-for-ids/blob/main/Code_XAI%20IDS.ipynb): `Code_XAI IDS.ipynb`
- [Intrusion predictions](https://github.com/libamariyamk/explainable-ai-for-ids/blob/main/Code_XAI%20IDS.ipynb): `Code_XAI IDS.ipynb`

### Evaluation and explanations

- [Performance evaluation](https://github.com/libamariyamk/explainable-ai-for-ids/blob/main/Code_XAI%20IDS.ipynb): `Code_XAI IDS.ipynb`
- [LIME explanations](https://github.com/libamariyamk/explainable-ai-for-ids/blob/main/Code_XAI%20IDS.ipynb): `Code_XAI IDS.ipynb`

### Other components

- **CICIDS-2017 data**
- **IDS analyst**

## Connections

- CICIDS-2017 data → Preprocessing: provides flows (evidence: `README.md`)
- Preprocessing → DT, RF, SVM: trains on (evidence: `README.md`)
- DT, RF, SVM → Voting classifier: ensemble models (evidence: `README.md`)
- Voting classifier → Intrusion predictions: classifies flows (evidence: `README.md`)
- Intrusion predictions → Performance evaluation: evaluated by (evidence: `README.md`)
- Intrusion predictions → LIME explanations: explained by (evidence: `README.md`)
- LIME explanations → IDS analyst: provides explanations (evidence: `README.md`)
- Performance evaluation → IDS analyst: reports metrics (evidence: `README.md`)
