# shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks architecture

> Architecture diagram of the GitHub repository shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks
- Repository: https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks

## Overview

Threat Sentinel is an IoT malware-detection product with a Flask inference backend and a SOC dashboard. The principal workflow is dashboard polling of the prediction API, followed by displaying current detections, alerts, charts, and history. The backend also includes ensemble inference and digital-twin functionality; the repository has separate model-training and evaluation code. Some backend routes, training orchestration, and digital-twin UI wiring were not sampled, so those relationships are not inferred.

Main entry points: [`src/routes/index.tsx`](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/routes/index.tsx) (SOC Dashboard), [`src/components/digital-twin/DigitalTwin.tsx`](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/digital-twin/DigitalTwin.tsx) (Twin Dashboard), [`ml_server/app.py`](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/ml_server/app.py) (Flask Prediction API), [`src/lib/predictions.ts`](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/lib/predictions.ts) (Prediction Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["SOC Dashboard"]
  node_dashboard["SOC Dashboard<br/>[index.tsx]"]
  node_prediction_client["Prediction Client<br/>[predictions.ts]"]
  node_soc_header["SOC Header<br/>[Header.tsx]"]
  node_telemetry["Device Telemetry"]
  node_threat_status["Threat Status<br/>[ThreatStatus.tsx]"]
  node_live_prediction["Live Prediction<br/>[LivePrediction.tsx]"]
  node_alerts["Threat Alerts<br/>[AlertBanner.tsx]"]
  node_charts["Threat Charts<br/>[Charts.tsx]"]
  node_history["Prediction History<br/>[HistoryTable.tsx]"]
  node_model_analysis["Model Analysis<br/>[ModelAnalysis.tsx]"]
  node_model_comparison["Model Comparison"]
end

subgraph group_backend["Detection Backend"]
  node_flask_api["Flask Prediction API<br/>[app.py]"]
  node_ensemble["Ensemble Inference"]
  node_inference["Inference Engine<br/>[inference.py]"]
  node_sequence_validation["Sequence Validation"]
end

subgraph group_twin["Digital Twin"]
  node_digital_twin["Twin Runtime<br/>[digital_twin.py]"]
  node_twin_detection["Twin Detection Runner"]
  node_twin_dashboard["Twin Dashboard<br/>[DigitalTwin.tsx]"]
  node_network_topology["Network Topology"]
  node_device_twin["Device Twin View<br/>[DeviceTwin.tsx]"]
  node_gateway_twin["Gateway Twin View<br/>[GatewayTwin.tsx]"]
end

subgraph group_ml["Model Development"]
  node_model_registry["Model Registry<br/>[models.ts]"]
  node_training_prep["Training Data Prep<br/>[data_prep.py]"]
  node_training_models["Model Training<br/>[train_models.py]"]
  node_training_evaluation["Training Evaluation<br/>[evaluate.py]"]
end

node_analyst(("Security Analyst"))

node_analyst -->|"views monitoring"| node_dashboard
node_dashboard -->|"polls predictions"| node_prediction_client
node_dashboard -->|"renders"| node_soc_header
node_dashboard -->|"renders"| node_telemetry
node_dashboard -->|"renders"| node_threat_status
node_dashboard -->|"renders"| node_alerts
node_dashboard -->|"renders"| node_charts
node_dashboard -->|"renders"| node_history
node_dashboard -->|"renders"| node_model_analysis
node_dashboard -->|"looks up model"| node_model_registry
node_prediction_client -->|"fetches records"| node_flask_api
node_flask_api -->|"uses twin runtime"| node_digital_twin
node_flask_api -->|"uses inference"| node_ensemble
node_model_comparison -->|"loads metrics"| node_model_registry
node_training_evaluation -->|"imports preparation"| node_training_prep
node_twin_dashboard -.-> node_network_topology
node_twin_dashboard -.-> node_device_twin
node_twin_dashboard -.-> node_gateway_twin

click node_dashboard "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/routes/index.tsx"
click node_prediction_client "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/lib/predictions.ts"
click node_soc_header "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/Header.tsx"
click node_telemetry "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/DeviceTelemetry.tsx"
click node_threat_status "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/ThreatStatus.tsx"
click node_live_prediction "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/LivePrediction.tsx"
click node_alerts "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/AlertBanner.tsx"
click node_charts "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/Charts.tsx"
click node_history "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/HistoryTable.tsx"
click node_model_analysis "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/ModelAnalysis.tsx"
click node_model_comparison "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/ModelComparison.tsx"
click node_model_registry "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/lib/models.ts"
click node_flask_api "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/ml_server/app.py"
click node_ensemble "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/ml_server/ensemble_inference.py"
click node_inference "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/ml_server/inference.py"
click node_digital_twin "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/ml_server/digital_twin.py"
click node_twin_detection "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/ml_server/run_twin_detection.py"
click node_sequence_validation "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/ml_server/sequence_validator.py"
click node_training_prep "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/training/data_prep.py"
click node_training_models "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/training/train_models.py"
click node_training_evaluation "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/training/evaluate.py"
click node_twin_dashboard "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/digital-twin/DigitalTwin.tsx"
click node_network_topology "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/digital-twin/NetworkTopology.tsx"
click node_device_twin "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/digital-twin/DeviceTwin.tsx"
click node_gateway_twin "https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/digital-twin/GatewayTwin.tsx"

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_prediction_client,node_soc_header,node_telemetry,node_threat_status,node_live_prediction,node_alerts,node_charts,node_history,node_model_analysis,node_model_comparison toneBlue
class node_flask_api,node_ensemble,node_inference,node_sequence_validation toneAmber
class node_digital_twin,node_twin_detection,node_twin_dashboard,node_network_topology,node_device_twin,node_gateway_twin toneMint
class node_model_registry,node_training_prep,node_training_models,node_training_evaluation toneRose
class node_analyst toneIndigo
```

## Components

### SOC Dashboard

- [SOC Dashboard](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Prediction Client](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/lib/predictions.ts): `src/lib/predictions.ts`
- [SOC Header](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/Header.tsx): `src/components/soc/Header.tsx`
- [Device Telemetry](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/DeviceTelemetry.tsx): `src/components/soc/DeviceTelemetry.tsx`
- [Threat Status](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/ThreatStatus.tsx): `src/components/soc/ThreatStatus.tsx`
- [Live Prediction](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/LivePrediction.tsx): `src/components/soc/LivePrediction.tsx`
- [Threat Alerts](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/AlertBanner.tsx): `src/components/soc/AlertBanner.tsx`
- [Threat Charts](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/Charts.tsx): `src/components/soc/Charts.tsx`
- [Prediction History](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/HistoryTable.tsx): `src/components/soc/HistoryTable.tsx`
- [Model Analysis](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/ModelAnalysis.tsx): `src/components/soc/ModelAnalysis.tsx`
- [Model Comparison](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/soc/ModelComparison.tsx): `src/components/soc/ModelComparison.tsx`

### Detection Backend

- [Flask Prediction API](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/ml_server/app.py): `ml_server/app.py`
- [Ensemble Inference](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/ml_server/ensemble_inference.py): `ml_server/ensemble_inference.py`
- [Inference Engine](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/ml_server/inference.py): `ml_server/inference.py`
- [Sequence Validation](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/ml_server/sequence_validator.py): `ml_server/sequence_validator.py`

### Digital Twin

- [Twin Runtime](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/ml_server/digital_twin.py): `ml_server/digital_twin.py`
- [Twin Detection Runner](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/ml_server/run_twin_detection.py): `ml_server/run_twin_detection.py`
- [Twin Dashboard](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/digital-twin/DigitalTwin.tsx): `src/components/digital-twin/DigitalTwin.tsx`
- [Network Topology](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/digital-twin/NetworkTopology.tsx): `src/components/digital-twin/NetworkTopology.tsx`
- [Device Twin View](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/digital-twin/DeviceTwin.tsx): `src/components/digital-twin/DeviceTwin.tsx`
- [Gateway Twin View](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/components/digital-twin/GatewayTwin.tsx): `src/components/digital-twin/GatewayTwin.tsx`

### Model Development

- [Model Registry](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/src/lib/models.ts): `src/lib/models.ts`
- [Training Data Prep](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/training/data_prep.py): `training/data_prep.py`
- [Model Training](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/training/train_models.py): `training/train_models.py`
- [Training Evaluation](https://github.com/shashankreddyo8/deep-learning-based-anomoly-and-malware-detection-in-iot-networks/blob/main/training/evaluate.py): `training/evaluate.py`

### Other components

- **Security Analyst**

## Connections

- Security Analyst → SOC Dashboard: views monitoring (evidence: `README.md`)
- SOC Dashboard → Prediction Client: polls predictions (evidence: `src/routes/index.tsx`)
- SOC Dashboard → SOC Header: renders (evidence: `src/routes/index.tsx`)
- SOC Dashboard → Device Telemetry: renders (evidence: `src/routes/index.tsx`)
- SOC Dashboard → Threat Status: renders (evidence: `src/routes/index.tsx`)
- SOC Dashboard → Threat Alerts: renders (evidence: `src/routes/index.tsx`)
- SOC Dashboard → Threat Charts: renders (evidence: `src/routes/index.tsx`)
- SOC Dashboard → Prediction History: renders (evidence: `src/routes/index.tsx`)
- SOC Dashboard → Model Analysis: renders (evidence: `src/routes/index.tsx`)
- SOC Dashboard → Model Registry: looks up model (evidence: `src/routes/index.tsx`)
- Prediction Client → Flask Prediction API: fetches records (evidence: `README.md`)
- Flask Prediction API → Twin Runtime: uses twin runtime (evidence: `ml_server/app.py`)
- Flask Prediction API → Ensemble Inference: uses inference (evidence: `ml_server/app.py`)
- Model Comparison → Model Registry: loads metrics (evidence: `src/components/soc/ModelComparison.tsx`)
- Training Evaluation → Training Data Prep: imports preparation (evidence: `training/evaluate.py`)
- Twin Dashboard → Network Topology
- Twin Dashboard → Device Twin View
- Twin Dashboard → Gateway Twin View
