# osama336/network-anomaly-detection-system architecture

> Architecture diagram of the GitHub repository osama336/network-anomaly-detection-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/osama336/network-anomaly-detection-system
- Repository: https://github.com/osama336/network-anomaly-detection-system

## Overview

NADS is a Streamlit network-monitoring application. Administrators select an interface and packet count, start live capture, and view packet classifications and visual summaries. The documented backend uses TShark and a Keras model, with Pandas preprocessing and Plotly visualizations; the README also describes anomaly alerts and report generation. The available source excerpt shows capture, queueing, model loading, and dashboard classification, but omits parts of the implementation, so some documented capability links remain unverified.

Main entry points: [`NADS.py`](https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py) (Streamlit controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Monitoring interface"]
  node_streamlit["Streamlit controls<br/>[NADS.py]"]
end

subgraph group_capture["Traffic capture"]
  node_capture_runner["Capture runner<br/>[NADS.py]"]
  node_tshark_capture["Live packet capture<br/>[NADS.py]"]
  node_packet_queue["Packet queue<br/>[NADS.py]"]
end

subgraph group_detection["Anomaly detection"]
  node_packet_features["Feature preprocessing<br/>[NADS.py]"]
  node_keras_model["Keras model"]
  node_classification["Packet classification<br/>[NADS.py]"]
end

subgraph group_insights["Analysis and insights"]
  node_packet_table["Packet results<br/>[NADS.py]"]
  node_anomaly_alerts["Anomaly alerts<br/>[NADS.py]"]
  node_reporting["Report generation<br/>[NADS.py]"]
  node_visualizations["Traffic visualizations<br/>[NADS.py]"]
end

node_admin(("Administrator"))

node_admin -->|"uses controls"| node_streamlit
node_streamlit -->|"starts capture"| node_capture_runner
node_capture_runner -->|"runs capture"| node_tshark_capture
node_tshark_capture -->|"enqueues packets"| node_packet_queue
node_streamlit -->|"drains packets"| node_packet_queue
node_streamlit -->|"classifies packets"| node_classification
node_classification -.->|"preprocesses features"| node_packet_features
node_classification -->|"uses model"| node_keras_model
node_streamlit -->|"displays packets"| node_packet_table
node_streamlit -.->|"shows alerts"| node_anomaly_alerts
node_streamlit -.->|"generates reports"| node_reporting
node_streamlit -->|"renders charts"| node_visualizations

click node_streamlit "https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py"
click node_capture_runner "https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py"
click node_tshark_capture "https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py"
click node_packet_queue "https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py"
click node_packet_features "https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py"
click node_classification "https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py"
click node_packet_table "https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py"
click node_anomaly_alerts "https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py"
click node_reporting "https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py"
click node_visualizations "https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.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_streamlit toneBlue
class node_capture_runner,node_tshark_capture,node_packet_queue toneAmber
class node_packet_features,node_keras_model,node_classification toneMint
class node_packet_table,node_anomaly_alerts,node_reporting,node_visualizations toneRose
class node_admin toneIndigo
```

## Components

### Monitoring interface

- [Streamlit controls](https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py): `NADS.py`

### Traffic capture

- [Capture runner](https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py): `NADS.py`
- [Live packet capture](https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py): `NADS.py`
- [Packet queue](https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py): `NADS.py`

### Anomaly detection

- [Feature preprocessing](https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py): `NADS.py`
- **Keras model**
- [Packet classification](https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py): `NADS.py`

### Analysis and insights

- [Packet results](https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py): `NADS.py`
- [Anomaly alerts](https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py): `NADS.py`
- [Report generation](https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py): `NADS.py`
- [Traffic visualizations](https://github.com/osama336/network-anomaly-detection-system/blob/main/NADS.py): `NADS.py`

### Other components

- **Administrator**

## Connections

- Administrator → Streamlit controls: uses controls (evidence: `README.md`)
- Streamlit controls → Capture runner: starts capture (evidence: `NADS.py`)
- Capture runner → Live packet capture: runs capture (evidence: `NADS.py`)
- Live packet capture → Packet queue: enqueues packets (evidence: `NADS.py`)
- Streamlit controls → Packet queue: drains packets (evidence: `NADS.py`)
- Streamlit controls → Packet classification: classifies packets (evidence: `NADS.py`)
- Packet classification → Feature preprocessing: preprocesses features (evidence: `NADS.py`)
- Packet classification → Keras model: uses model (evidence: `NADS.py`)
- Streamlit controls → Packet results: displays packets (evidence: `NADS.py`)
- Streamlit controls → Anomaly alerts: shows alerts (evidence: `README.md`)
- Streamlit controls → Report generation: generates reports (evidence: `README.md`)
- Streamlit controls → Traffic visualizations: renders charts (evidence: `NADS.py`)
