# zinedinekamel/gps_spoofing architecture

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

- Interactive diagram: https://gitdiagram.com/zinedinekamel/gps_spoofing
- Repository: https://github.com/zinedinekamel/gps_spoofing

## Overview

This repository is a Streamlit application for detecting GPS spoofing in UAV flight logs. The main workflow is to upload a CSV, normalize and validate its telemetry features, scale them, and run a selected Random Forest or MLP model; users can inspect single or batch results and compare the models. The repository also includes benign, jamming, and spoofing flight-log datasets. The sampled app excerpt shows these runtime stages, but not the complete model-loading or feature-normalization implementations; the README documents the models and pipeline at a high level.

Main entry points: [`app.py`](https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py) (Streamlit App), [`outputs`](https://github.com/zinedinekamel/gps_spoofing/tree/main/outputs) (Random Forest), [`UAVGPSAttacks`](https://github.com/zinedinekamel/gps_spoofing/tree/main/UAVGPSAttacks) (Flight Log Dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Flight Data"]
  node_upload["Uploaded CSV"]
  node_flightdata[("Flight Log Dataset")]
end

subgraph group_runtime["Detection Runtime"]
  node_app["Streamlit App<br/>[app.py]"]
  node_normalize["Column Normalization<br/>[app.py]"]
  node_validate["Feature Validation<br/>[app.py]"]
  node_prepare["Feature Preparation<br/>[app.py]"]
  node_scale["Feature Scaling<br/>[app.py]"]
  node_predict["Prediction Dispatch<br/>[app.py]"]
end

subgraph group_results["Results and Analysis"]
  node_single["Single Prediction<br/>[app.py]"]
  node_batch["Batch Results<br/>[app.py]"]
  node_compare["Model Comparison<br/>[app.py]"]
  node_explain["Feature Explanations<br/>[app.py]"]
  node_metrics["Evaluation Metrics<br/>[app.py]"]
end

subgraph group_artifacts["Model Artifacts"]
  node_rf["Random Forest"]
  node_mlp["MLP Model"]
end

node_user(("Operator"))

node_user -->|"opens"| node_app
node_user -->|"uploads"| node_upload
node_flightdata -.->|"provides logs"| node_upload
node_upload -->|"loads CSV"| node_app
node_app -->|"normalizes"| node_normalize
node_normalize -->|"checks features"| node_validate
node_validate -->|"selects features"| node_prepare
node_prepare -->|"fills and scales"| node_scale
node_scale -->|"sends features"| node_predict
node_app -.->|"loads model"| node_rf
node_app -.->|"loads model"| node_mlp
node_predict -->|"dispatches"| node_rf
node_predict -->|"dispatches"| node_mlp
node_predict -->|"returns predictions"| node_single
node_predict -->|"returns predictions"| node_batch
node_app -->|"compares models"| node_compare
node_app -->|"shows contributions"| node_explain
node_app -->|"shows metrics"| node_metrics

click node_flightdata "https://github.com/zinedinekamel/gps_spoofing/tree/main/UAVGPSAttacks"
click node_app "https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py"
click node_normalize "https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py"
click node_validate "https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py"
click node_prepare "https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py"
click node_scale "https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py"
click node_rf "https://github.com/zinedinekamel/gps_spoofing/tree/main/outputs"
click node_mlp "https://github.com/zinedinekamel/gps_spoofing/tree/main/outputs"
click node_predict "https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py"
click node_single "https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py"
click node_batch "https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py"
click node_compare "https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py"
click node_explain "https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py"
click node_metrics "https://github.com/zinedinekamel/gps_spoofing/blob/main/app.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_upload,node_flightdata toneBlue
class node_app,node_normalize,node_validate,node_prepare,node_scale,node_predict toneAmber
class node_single,node_batch,node_compare,node_explain,node_metrics toneMint
class node_rf,node_mlp toneRose
class node_user toneIndigo
```

## Components

### Flight Data

- **Uploaded CSV**
- [Flight Log Dataset](https://github.com/zinedinekamel/gps_spoofing/tree/main/UAVGPSAttacks): `UAVGPSAttacks`

### Detection Runtime

- [Streamlit App](https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py): `app.py`
- [Column Normalization](https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py): `app.py`
- [Feature Validation](https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py): `app.py`
- [Feature Preparation](https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py): `app.py`
- [Feature Scaling](https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py): `app.py`
- [Prediction Dispatch](https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py): `app.py`

### Results and Analysis

- [Single Prediction](https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py): `app.py`
- [Batch Results](https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py): `app.py`
- [Model Comparison](https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py): `app.py`
- [Feature Explanations](https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py): `app.py`
- [Evaluation Metrics](https://github.com/zinedinekamel/gps_spoofing/blob/main/app.py): `app.py`

### Model Artifacts

- [Random Forest](https://github.com/zinedinekamel/gps_spoofing/tree/main/outputs): `outputs`
- [MLP Model](https://github.com/zinedinekamel/gps_spoofing/tree/main/outputs): `outputs`

### Other components

- **Operator**

## Connections

- Operator → Streamlit App: opens (evidence: `README.md`)
- Operator → Uploaded CSV: uploads
- Flight Log Dataset → Uploaded CSV: provides logs
- Uploaded CSV → Streamlit App: loads CSV (evidence: `app.py`)
- Streamlit App → Column Normalization: normalizes (evidence: `app.py`)
- Column Normalization → Feature Validation: checks features (evidence: `app.py`)
- Feature Validation → Feature Preparation: selects features (evidence: `app.py`)
- Feature Preparation → Feature Scaling: fills and scales (evidence: `app.py`)
- Feature Scaling → Prediction Dispatch: sends features (evidence: `app.py`)
- Streamlit App → Random Forest: loads model
- Streamlit App → MLP Model: loads model
- Prediction Dispatch → Random Forest: dispatches (evidence: `app.py`)
- Prediction Dispatch → MLP Model: dispatches (evidence: `app.py`)
- Prediction Dispatch → Single Prediction: returns predictions (evidence: `app.py`)
- Prediction Dispatch → Batch Results: returns predictions (evidence: `app.py`)
- Streamlit App → Model Comparison: compares models (evidence: `app.py`)
- Streamlit App → Feature Explanations: shows contributions (evidence: `app.py`)
- Streamlit App → Evaluation Metrics: shows metrics (evidence: `app.py`)
