# krish74w/ml-based-cybersecurity-anomaly-detector architecture

> Architecture diagram of the GitHub repository krish74w/ml-based-cybersecurity-anomaly-detector, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/krish74w/ml-based-cybersecurity-anomaly-detector
- Repository: https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector

## Overview

This is a Streamlit cybersecurity investigation platform. Its main workflow generates synthetic event telemetry, runs sequence-aware binary anomaly detection, classifies detected attacks, and produces evidence-driven explanations; analysts review results in the dashboard and reporting pages. The README documents the end-to-end demonstration and reporting capabilities, while sampled pipeline code confirms orchestration and generator invocation. Several model implementations and report-page details were not sampled, so their internal relationships are shown only where documented.

Main entry points: [`app/pipeline.py`](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/pipeline.py) (Pipeline Orchestrator), [`outputs`](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/tree/main/outputs) (Prediction & Explanation Files), [`app/dashboard.py`](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/dashboard.py) (Command Dashboard), [`app/pages/1_Data_Generation.py`](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/pages/1_Data_Generation.py) (Data Generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Analyst Interface"]
  node_dashboard["Command Dashboard<br/>[dashboard.py]"]
  node_generation_page["Data Generation"]
  node_detector_page["Detector Controls<br/>[2_GRU_Detector.py]"]
  node_classifier_page["Classifier Controls"]
  node_explain_page["Explanation Review"]
  node_analytics_page["Telemetry Analytics<br/>[5_Analytics.py]"]
  node_reports_page["Executive Reports<br/>[6_Reports.py]"]
end

subgraph group_workflow["Detection Workflow"]
  node_pipeline["Pipeline Orchestrator<br/>[pipeline.py]"]
  node_generator["Telemetry Generator<br/>[data_generator.py]"]
  node_detector["GRU Anomaly Detector"]
  node_classifier["Attack Classifier"]
  node_datasets[("Event Dataset<br/>[input_events.csv]")]
end

subgraph group_explain["Investigation &amp; Reports"]
  node_explain_engine["Decision Explainability<br/>[explainability.py]"]
  node_outputs[("Prediction &amp; Explanation Files")]
  node_reports["Briefing Reports"]
end

subgraph group_shared["Application Support"]
  node_visuals["Cards &amp; Charts"]
  node_theme["SOC Theme<br/>[theme.py]"]
  node_session["Session State<br/>[session_state.py]"]
  node_tracker["Operation Tracker"]
  node_config["Paths &amp; Model Settings<br/>[config.py]"]
end

node_analyst(("Security Analyst"))

node_analyst -->|"uses"| node_dashboard
node_dashboard -->|"runs"| node_pipeline
node_dashboard -->|"renders with"| node_visuals
node_dashboard -->|"applies"| node_theme
node_dashboard -->|"initializes"| node_session
node_dashboard -->|"tracks operations"| node_tracker
node_analyst -->|"configures"| node_generation_page
node_generation_page -->|"requests generation"| node_pipeline
node_analyst -->|"runs detection"| node_detector_page
node_detector_page -.->|"requests detection"| node_pipeline
node_analyst -->|"runs classification"| node_classifier_page
node_classifier_page -->|"requests classification"| node_pipeline
node_analyst -->|"reviews explanations"| node_explain_page
node_analyst -->|"explores telemetry"| node_analytics_page
node_analyst -->|"exports briefing"| node_reports_page
node_pipeline -->|"calls"| node_generator
node_pipeline -->|"runs stage"| node_detector
node_pipeline -->|"runs stage"| node_classifier
node_pipeline -->|"runs stage"| node_explain_engine
node_generator -->|"writes events"| node_datasets
node_datasets -->|"provides telemetry"| node_detector
node_detector -->|"writes predictions"| node_outputs
node_outputs -->|"provides alert windows"| node_classifier
node_classifier -->|"writes classifications"| node_outputs
node_outputs -->|"provides alerts"| node_explain_engine
node_explain_engine -->|"writes explanations"| node_outputs
node_outputs -.->|"supplies explanations"| node_explain_page
node_reports_page -->|"exports briefing"| node_reports
node_analytics_page -.->|"reads results"| node_outputs
node_pipeline -->|"uses paths"| node_config
node_generation_page -->|"tracks progress"| node_tracker
node_classifier_page -->|"tracks progress"| node_tracker
node_explain_page -->|"renders charts"| node_visuals

click node_dashboard "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/dashboard.py"
click node_generation_page "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/pages/1_Data_Generation.py"
click node_detector_page "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/pages/2_GRU_Detector.py"
click node_classifier_page "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/pages/3_Attack_Classifier.py"
click node_explain_page "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/pages/4_Explainability.py"
click node_analytics_page "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/pages/5_Analytics.py"
click node_reports_page "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/pages/6_Reports.py"
click node_pipeline "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/pipeline.py"
click node_generator "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/data_generator.py"
click node_detector "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/anomaly_detector.py"
click node_classifier "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/attack_classifier.py"
click node_explain_engine "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/explainability.py"
click node_datasets "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/datasets/input_events.csv"
click node_outputs "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/tree/main/outputs"
click node_reports "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/tree/main/reports"
click node_visuals "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/tree/main/app/components"
click node_theme "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/components/theme.py"
click node_session "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/utils/session_state.py"
click node_tracker "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/utils/operation_tracker.py"
click node_config "https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/config.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_dashboard,node_generation_page,node_detector_page,node_classifier_page,node_explain_page,node_analytics_page,node_reports_page toneBlue
class node_pipeline,node_generator,node_detector,node_classifier,node_datasets toneAmber
class node_explain_engine,node_outputs,node_reports toneMint
class node_visuals,node_theme,node_session,node_tracker,node_config toneRose
class node_analyst toneIndigo
```

## Components

### Analyst Interface

- [Command Dashboard](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/dashboard.py): `app/dashboard.py`
- [Data Generation](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/pages/1_Data_Generation.py): `app/pages/1_Data_Generation.py`
- [Detector Controls](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/pages/2_GRU_Detector.py): `app/pages/2_GRU_Detector.py`
- [Classifier Controls](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/pages/3_Attack_Classifier.py): `app/pages/3_Attack_Classifier.py`
- [Explanation Review](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/pages/4_Explainability.py): `app/pages/4_Explainability.py`
- [Telemetry Analytics](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/pages/5_Analytics.py): `app/pages/5_Analytics.py`
- [Executive Reports](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/pages/6_Reports.py): `app/pages/6_Reports.py`

### Detection Workflow

- [Pipeline Orchestrator](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/pipeline.py): `app/pipeline.py`
- [Telemetry Generator](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/data_generator.py): `app/data_generator.py`
- [GRU Anomaly Detector](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/anomaly_detector.py): `app/anomaly_detector.py`
- [Attack Classifier](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/attack_classifier.py): `app/attack_classifier.py`
- [Event Dataset](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/datasets/input_events.csv): `datasets/input_events.csv`

### Investigation & Reports

- [Decision Explainability](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/explainability.py): `app/explainability.py`
- [Prediction & Explanation Files](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/tree/main/outputs): `outputs`
- [Briefing Reports](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/tree/main/reports): `reports`

### Application Support

- [Cards & Charts](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/tree/main/app/components): `app/components`
- [SOC Theme](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/components/theme.py): `app/components/theme.py`
- [Session State](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/utils/session_state.py): `app/utils/session_state.py`
- [Operation Tracker](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/utils/operation_tracker.py): `app/utils/operation_tracker.py`
- [Paths & Model Settings](https://github.com/krish74w/ml-based-cybersecurity-anomaly-detector/blob/main/app/config.py): `app/config.py`

### Other components

- **Security Analyst**

## Connections

- Security Analyst → Command Dashboard: uses (evidence: `README.md`)
- Command Dashboard → Pipeline Orchestrator: runs (evidence: `app/dashboard.py`)
- Command Dashboard → Cards & Charts: renders with (evidence: `app/dashboard.py`)
- Command Dashboard → SOC Theme: applies (evidence: `app/dashboard.py`)
- Command Dashboard → Session State: initializes (evidence: `app/dashboard.py`)
- Command Dashboard → Operation Tracker: tracks operations (evidence: `app/dashboard.py`)
- Security Analyst → Data Generation: configures (evidence: `README.md`)
- Data Generation → Pipeline Orchestrator: requests generation (evidence: `app/pages/1_Data_Generation.py`)
- Security Analyst → Detector Controls: runs detection (evidence: `README.md`)
- Detector Controls → Pipeline Orchestrator: requests detection
- Security Analyst → Classifier Controls: runs classification (evidence: `app/pages/3_Attack_Classifier.py`)
- Classifier Controls → Pipeline Orchestrator: requests classification (evidence: `app/pages/3_Attack_Classifier.py`)
- Security Analyst → Explanation Review: reviews explanations (evidence: `README.md`)
- Security Analyst → Telemetry Analytics: explores telemetry (evidence: `README.md`)
- Security Analyst → Executive Reports: exports briefing (evidence: `README.md`)
- Pipeline Orchestrator → Telemetry Generator: calls (evidence: `app/pipeline.py`)
- Pipeline Orchestrator → GRU Anomaly Detector: runs stage (evidence: `README.md`)
- Pipeline Orchestrator → Attack Classifier: runs stage (evidence: `README.md`)
- Pipeline Orchestrator → Decision Explainability: runs stage (evidence: `README.md`)
- Telemetry Generator → Event Dataset: writes events
- Event Dataset → GRU Anomaly Detector: provides telemetry (evidence: `README.md`)
- GRU Anomaly Detector → Prediction & Explanation Files: writes predictions (evidence: `README.md`)
- Prediction & Explanation Files → Attack Classifier: provides alert windows (evidence: `README.md`)
- Attack Classifier → Prediction & Explanation Files: writes classifications (evidence: `README.md`)
- Prediction & Explanation Files → Decision Explainability: provides alerts (evidence: `README.md`)
- Decision Explainability → Prediction & Explanation Files: writes explanations (evidence: `README.md`)
- Prediction & Explanation Files → Explanation Review: supplies explanations
- Executive Reports → Briefing Reports: exports briefing (evidence: `README.md`)
- Telemetry Analytics → Prediction & Explanation Files: reads results
- Pipeline Orchestrator → Paths & Model Settings: uses paths (evidence: `app/pipeline.py`)
- Data Generation → Operation Tracker: tracks progress (evidence: `app/pages/1_Data_Generation.py`)
- Classifier Controls → Operation Tracker: tracks progress (evidence: `app/pages/3_Attack_Classifier.py`)
- Explanation Review → Cards & Charts: renders charts (evidence: `app/pages/4_Explainability.py`)
