# adityak-101/outlier_detection architecture

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

- Interactive diagram: https://gitdiagram.com/adityak-101/outlier_detection
- Repository: https://github.com/adityak-101/outlier_detection

## Overview

This repository offers two GPS-track cleaning workflows: a Dash/Leaflet web app and a Tkinter/Folium GUI with batch and command-line processing. Both ingest MF4 data, clean tracks through land filtering and layered outlier detection, then present results as maps; the README also describes resampling, feature engineering, clustering, and smoothing. The shared processing code is embedded in each script rather than factored into a common package. Edges reflect calls visible in excerpts or explicit README descriptions; unsampled GUI internals are not inferred.

Main entry points: [`gps_outlier_detection_leaflet_v2.py`](https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py) (Dash upload app), [`gps_outlier_gui_folium.py`](https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_gui_folium.py) (Batch processing entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflow"]
  node_dash_app["Dash upload app"]
end

subgraph group_batch["GUI and batch"]
  node_file_gui["File selection GUI"]
  node_batch_entry["Batch processing entry"]
end

subgraph group_processing["Track processing"]
  node_mf4_loading["MF4 loading and resampling"]
  node_feature_detection["Feature and outlier detection"]
  node_ensemble["Stacking ensemble"]
  node_cluster_filter["Cluster and land filtering"]
  node_smoothing["Path smoothing"]
  node_gui_processing["Batch track processing"]
  node_boundary_data[("Land boundaries")]
end

subgraph group_results["Map results"]
  node_leaflet_map["Interactive Leaflet map"]
  node_folium_report["Folium map report"]
end

node_web_user(("Web user"))
node_batch_user(("GUI or CLI user"))
node_mf4["MF4 track file"]
node_osm_tiles["OpenStreetMap tiles"]

node_web_user -->|"uploads file"| node_dash_app
node_mf4 -->|"provides track"| node_dash_app
node_dash_app -->|"decodes and resamples"| node_mf4_loading
node_mf4_loading -->|"computes features"| node_feature_detection
node_feature_detection -->|"supplies detector results"| node_ensemble
node_ensemble -->|"flags track points"| node_cluster_filter
node_cluster_filter -->|"checks land"| node_boundary_data
node_cluster_filter -.->|"passes cleaned path"| node_smoothing
node_dash_app -->|"renders track layers"| node_leaflet_map
node_dash_app -->|"loads map tiles"| node_osm_tiles
node_batch_user -->|"selects files"| node_file_gui
node_batch_user -->|"runs batch"| node_batch_entry
node_mf4 -->|"provides track"| node_batch_entry
node_file_gui -->|"starts processing"| node_batch_entry
node_batch_entry -->|"processes tracks"| node_gui_processing
node_gui_processing -->|"generates map"| node_folium_report

click node_dash_app "https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py"
click node_file_gui "https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_gui_folium.py"
click node_batch_entry "https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_gui_folium.py"
click node_mf4_loading "https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py"
click node_feature_detection "https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py"
click node_ensemble "https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py"
click node_cluster_filter "https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py"
click node_smoothing "https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py"
click node_gui_processing "https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_gui_folium.py"
click node_boundary_data "https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py"
click node_leaflet_map "https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py"
click node_folium_report "https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_gui_folium.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_dash_app,node_web_user,node_batch_user toneBlue
class node_file_gui,node_batch_entry toneAmber
class node_mf4_loading,node_feature_detection,node_ensemble,node_cluster_filter,node_smoothing,node_gui_processing,node_boundary_data toneMint
class node_leaflet_map,node_folium_report toneRose
class node_mf4,node_osm_tiles toneIndigo
```

## Components

### Web workflow

- [Dash upload app](https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py): `gps_outlier_detection_leaflet_v2.py`

### GUI and batch

- [File selection GUI](https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_gui_folium.py): `gps_outlier_gui_folium.py`
- [Batch processing entry](https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_gui_folium.py): `gps_outlier_gui_folium.py`

### Track processing

- [MF4 loading and resampling](https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py): `gps_outlier_detection_leaflet_v2.py`
- [Feature and outlier detection](https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py): `gps_outlier_detection_leaflet_v2.py`
- [Stacking ensemble](https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py): `gps_outlier_detection_leaflet_v2.py`
- [Cluster and land filtering](https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py): `gps_outlier_detection_leaflet_v2.py`
- [Path smoothing](https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py): `gps_outlier_detection_leaflet_v2.py`
- [Batch track processing](https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_gui_folium.py): `gps_outlier_gui_folium.py`
- [Land boundaries](https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py): `gps_outlier_detection_leaflet_v2.py`

### Map results

- [Interactive Leaflet map](https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_detection_leaflet_v2.py): `gps_outlier_detection_leaflet_v2.py`
- [Folium map report](https://github.com/adityak-101/outlier_detection/blob/main/gps_outlier_gui_folium.py): `gps_outlier_gui_folium.py`

### Other components

- **Web user**
- **GUI or CLI user**
- **MF4 track file**
- **OpenStreetMap tiles**

## Connections

- Web user → Dash upload app: uploads file (evidence: `gps_outlier_detection_leaflet_v2.py`)
- MF4 track file → Dash upload app: provides track (evidence: `README.md`)
- Dash upload app → MF4 loading and resampling: decodes and resamples (evidence: `gps_outlier_detection_leaflet_v2.py`)
- MF4 loading and resampling → Feature and outlier detection: computes features (evidence: `README.md`)
- Feature and outlier detection → Stacking ensemble: supplies detector results (evidence: `gps_outlier_detection_leaflet_v2.py`)
- Stacking ensemble → Cluster and land filtering: flags track points (evidence: `gps_outlier_detection_leaflet_v2.py`)
- Cluster and land filtering → Land boundaries: checks land (evidence: `gps_outlier_detection_leaflet_v2.py`)
- Cluster and land filtering → Path smoothing: passes cleaned path (evidence: `gps_outlier_detection_leaflet_v2.py`)
- Dash upload app → Interactive Leaflet map: renders track layers (evidence: `gps_outlier_detection_leaflet_v2.py`)
- Dash upload app → OpenStreetMap tiles: loads map tiles (evidence: `gps_outlier_detection_leaflet_v2.py`)
- GUI or CLI user → File selection GUI: selects files (evidence: `gps_outlier_gui_folium.py`)
- GUI or CLI user → Batch processing entry: runs batch (evidence: `README.md`)
- MF4 track file → Batch processing entry: provides track (evidence: `README.md`)
- File selection GUI → Batch processing entry: starts processing (evidence: `gps_outlier_gui_folium.py`)
- Batch processing entry → Batch track processing: processes tracks (evidence: `gps_outlier_gui_folium.py`)
- Batch track processing → Folium map report: generates map (evidence: `gps_outlier_gui_folium.py`)
