# kee-rti/safetyappmlmodelprototype architecture

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

- Interactive diagram: https://gitdiagram.com/kee-rti/safetyappmlmodelprototype
- Repository: https://github.com/kee-rti/safetyappmlmodelprototype

## Overview

This repository is a Streamlit ML prototyping platform for safety-risk classification from synthetic multi-sensor data. Its main workflow runs from scenario generation and preprocessing through configurable fusion/model training, evaluation, and result interpretation or ONNX export. Experiment history and model versioning are also surfaced in the application. The README documents the product stages; sampled source confirms key imports, training/evaluation calls, and ONNX validation/benchmarking. Some module internals were not sampled, so their interactions are shown only where documented.

Main entry points: [`app.py`](https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/app.py) (Streamlit workspace), [`src/data_loader.py`](https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/src/data_loader.py) (Dataset loader), [`attached_assets/safetyAppDataset_1755171350672.py`](https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/attached_assets/safetyAppDataset_1755171350672.py) (Scenario generator), [`src/models.py`](https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/src/models.py) (Neural architectures)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Data workflow"]
  node_synthetic["Scenario generator"]
  node_loader["Dataset loader<br/>[data_loader.py]"]
  node_preprocess["Feature preprocessing<br/>[preprocessing.py]"]
end

subgraph group_modeling["Modeling"]
  node_fusion["Fusion strategies"]
  node_models["Neural architectures<br/>[models.py]"]
end

subgraph group_analysis["Analysis and deployment"]
  node_evaluation["Training and evaluation<br/>[evaluation.py]"]
  node_interpretability["Model interpretation"]
  node_onnx["ONNX export<br/>[onnx_export.py]"]
end

subgraph group_support["Application and sensor support"]
  node_app["Streamlit workspace<br/>[app.py]"]
  node_experiments["Experiment tracking<br/>[app.py]"]
  node_sensor_specs["Sensor specifications<br/>[sensor_specs.py]"]
end

node_user(("Platform user"))

node_user -->|"uses"| node_app
node_app -->|"generates scenarios"| node_synthetic
node_synthetic -.->|"provides samples"| node_loader
node_loader -->|"imports generator"| node_synthetic
node_app -->|"loads data"| node_loader
node_app -->|"preprocesses data"| node_preprocess
node_app -->|"selects fusion"| node_fusion
node_app -->|"selects architecture"| node_models
node_app -->|"trains and evaluates"| node_evaluation
node_app -->|"analyzes results"| node_interpretability
node_app -->|"exports and benchmarks"| node_onnx
node_app -->|"records runs"| node_experiments
node_app -->|"uses sensor definitions"| node_sensor_specs
node_loader -.->|"uses specifications"| node_sensor_specs
node_models -.->|"applies fusion module"| node_fusion

click node_app "https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/app.py"
click node_experiments "https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/app.py"
click node_synthetic "https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/attached_assets/safetyAppDataset_1755171350672.py"
click node_loader "https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/src/data_loader.py"
click node_preprocess "https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/src/preprocessing.py"
click node_sensor_specs "https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/utils/sensor_specs.py"
click node_fusion "https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/src/fusion_techniques.py"
click node_models "https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/src/models.py"
click node_evaluation "https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/src/evaluation.py"
click node_interpretability "https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/src/interpretability.py"
click node_onnx "https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/src/onnx_export.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_synthetic,node_loader,node_preprocess,node_user toneBlue
class node_fusion,node_models toneAmber
class node_evaluation,node_interpretability,node_onnx toneMint
class node_app,node_experiments,node_sensor_specs toneRose
```

## Components

### Data workflow

- [Scenario generator](https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/attached_assets/safetyAppDataset_1755171350672.py): `attached_assets/safetyAppDataset_1755171350672.py`
- [Dataset loader](https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/src/data_loader.py): `src/data_loader.py`
- [Feature preprocessing](https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/src/preprocessing.py): `src/preprocessing.py`

### Modeling

- [Fusion strategies](https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/src/fusion_techniques.py): `src/fusion_techniques.py`
- [Neural architectures](https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/src/models.py): `src/models.py`

### Analysis and deployment

- [Training and evaluation](https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/src/evaluation.py): `src/evaluation.py`
- [Model interpretation](https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/src/interpretability.py): `src/interpretability.py`
- [ONNX export](https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/src/onnx_export.py): `src/onnx_export.py`

### Application and sensor support

- [Streamlit workspace](https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/app.py): `app.py`
- [Experiment tracking](https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/app.py): `app.py`
- [Sensor specifications](https://github.com/kee-rti/safetyappmlmodelprototype/blob/main/utils/sensor_specs.py): `utils/sensor_specs.py`

### Other components

- **Platform user**

## Connections

- Platform user → Streamlit workspace: uses (evidence: `README.md`)
- Streamlit workspace → Scenario generator: generates scenarios (evidence: `README.md`)
- Scenario generator → Dataset loader: provides samples (evidence: `src/data_loader.py`)
- Dataset loader → Scenario generator: imports generator (evidence: `src/data_loader.py`)
- Streamlit workspace → Dataset loader: loads data (evidence: `README.md`)
- Streamlit workspace → Feature preprocessing: preprocesses data (evidence: `README.md`)
- Streamlit workspace → Fusion strategies: selects fusion (evidence: `README.md`)
- Streamlit workspace → Neural architectures: selects architecture (evidence: `README.md`)
- Streamlit workspace → Training and evaluation: trains and evaluates (evidence: `app.py`)
- Streamlit workspace → Model interpretation: analyzes results (evidence: `README.md`)
- Streamlit workspace → ONNX export: exports and benchmarks (evidence: `app.py`)
- Streamlit workspace → Experiment tracking: records runs (evidence: `app.py`)
- Streamlit workspace → Sensor specifications: uses sensor definitions (evidence: `app.py`)
- Dataset loader → Sensor specifications: uses specifications
- Neural architectures → Fusion strategies: applies fusion module
