# hrishir746/wildfire-prediction architecture

> Architecture diagram of the GitHub repository hrishir746/wildfire-prediction, 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/hrishir746/wildfire-prediction
- Repository: https://github.com/hrishir746/wildfire-prediction

## Overview

This is a research-oriented wildfire-spread prediction system: environmental inputs feed a learned pixel-level predictor, with a Rothermel-inspired simulator as a deterministic baseline; predictions can be evaluated against historical fires and explained through a read-only agent. The README also documents training dashboards and historical-data workflows. The tree does not include the README-referenced `src/data/real_data.py`, so data preparation is represented by the available fetch script. Several script-level links reflect README statements or SOURCE INDEX references rather than inspected implementations.

Main entry points: [`src/model/unet.py`](https://github.com/hrishir746/wildfire-prediction/blob/master/src/model/unet.py) (U-Net Predictor), [`scripts/evaluate_real_fires.py`](https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/evaluate_real_fires.py) (Historical Fire Evaluation), [`scripts/train_extended_gpu.py`](https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/train_extended_gpu.py) (Model Training), [`src/simulation/rothermel_simulator.py`](https://github.com/hrishir746/wildfire-prediction/blob/master/src/simulation/rothermel_simulator.py) (Rothermel Simulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Environmental and Fire Data"]
  node_fetch["Fetch Real Inputs<br/>[fetch_real_data.py]"]
  node_realdata["Environmental Inputs"]
  node_historical["Historical Fire Data<br/>[fetch_mtbs_data.py]"]
end

subgraph group_prediction["Simulation and Prediction"]
  node_simulator["Rothermel Simulator"]
  node_gpu_simulator["GPU Simulator"]
  node_unet["U-Net Predictor<br/>[unet.py]"]
  node_funet["FU-Net Predictor<br/>[fu_unet.py]"]
end

subgraph group_learning["Training and Monitoring"]
  node_train["Model Training"]
  node_train_fu["FU-Net Training<br/>[train_fu_unet.py]"]
  node_dashboard["Training Dashboard"]
end

subgraph group_assessment["Evaluation and Interpretation"]
  node_evaluation["Prediction Metrics<br/>[metrics.py]"]
  node_real_eval["Historical Fire Evaluation"]
  node_validation["Model Validation"]
  node_agent_app["Agent Interface<br/>[agent_app.py]"]
  node_agent["Prediction Explainer<br/>[agent.py]"]
end

subgraph group_research["Research Extensions"]
  node_rl_env["RL Environment<br/>[wildfire_rl_env.py]"]
  node_progressions["Fire Progression Data"]
end

node_researcher(("Researcher"))

node_researcher -->|"requests inputs"| node_fetch
node_fetch -->|"produces inputs"| node_realdata
node_realdata -->|"provides channels"| node_unet
node_researcher -->|"starts training"| node_train
node_train -->|"uses model"| node_unet
node_train -->|"generates targets"| node_simulator
node_researcher -->|"runs simulation"| node_simulator
node_researcher -->|"evaluates event"| node_real_eval
node_real_eval -->|"uses predictor"| node_unet
node_real_eval -->|"compares baseline"| node_simulator
node_real_eval -.->|"computes metrics"| node_evaluation
node_researcher -->|"asks questions"| node_agent_app
node_agent_app -->|"launches agent"| node_agent
node_agent -->|"loads predictor"| node_unet
node_agent -->|"compares metrics"| node_evaluation
node_researcher -->|"monitors training"| node_dashboard
node_dashboard -.->|"loads checkpoints"| node_unet
node_historical -.->|"supports validation"| node_real_eval
node_train_fu -->|"trains model"| node_funet
node_progressions -.->|"may supply examples"| node_train
node_rl_env -->|"calls simulation"| node_simulator
node_researcher -->|"checks predictions"| node_validation
node_validation -->|"uses model"| node_unet
node_researcher -.->|"runs accelerated simulation"| node_gpu_simulator

click node_fetch "https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/fetch_real_data.py"
click node_historical "https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/fetch_mtbs_data.py"
click node_simulator "https://github.com/hrishir746/wildfire-prediction/blob/master/src/simulation/rothermel_simulator.py"
click node_gpu_simulator "https://github.com/hrishir746/wildfire-prediction/blob/master/src/simulation/rothermel_simulator_gpu.py"
click node_unet "https://github.com/hrishir746/wildfire-prediction/blob/master/src/model/unet.py"
click node_funet "https://github.com/hrishir746/wildfire-prediction/blob/master/src/model/fu_unet.py"
click node_train "https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/train_extended_gpu.py"
click node_train_fu "https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/train_fu_unet.py"
click node_dashboard "https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/training_dashboard.py"
click node_evaluation "https://github.com/hrishir746/wildfire-prediction/blob/master/src/evaluation/metrics.py"
click node_real_eval "https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/evaluate_real_fires.py"
click node_validation "https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/wildfire_validation.py"
click node_agent_app "https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/agent_app.py"
click node_agent "https://github.com/hrishir746/wildfire-prediction/blob/master/src/agent/agent.py"
click node_rl_env "https://github.com/hrishir746/wildfire-prediction/blob/master/src/simulation/wildfire_rl_env.py"
click node_progressions "https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/process_firms_progressions_temporal.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_fetch,node_realdata,node_historical toneBlue
class node_simulator,node_gpu_simulator,node_unet,node_funet toneAmber
class node_train,node_train_fu,node_dashboard toneMint
class node_evaluation,node_real_eval,node_validation,node_agent_app,node_agent toneRose
class node_rl_env,node_progressions,node_researcher toneIndigo
```

## Components

### Environmental and Fire Data

- [Fetch Real Inputs](https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/fetch_real_data.py): `scripts/fetch_real_data.py`
- **Environmental Inputs**
- [Historical Fire Data](https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/fetch_mtbs_data.py): `scripts/fetch_mtbs_data.py`

### Simulation and Prediction

- [Rothermel Simulator](https://github.com/hrishir746/wildfire-prediction/blob/master/src/simulation/rothermel_simulator.py): `src/simulation/rothermel_simulator.py`
- [GPU Simulator](https://github.com/hrishir746/wildfire-prediction/blob/master/src/simulation/rothermel_simulator_gpu.py): `src/simulation/rothermel_simulator_gpu.py`
- [U-Net Predictor](https://github.com/hrishir746/wildfire-prediction/blob/master/src/model/unet.py): `src/model/unet.py`
- [FU-Net Predictor](https://github.com/hrishir746/wildfire-prediction/blob/master/src/model/fu_unet.py): `src/model/fu_unet.py`

### Training and Monitoring

- [Model Training](https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/train_extended_gpu.py): `scripts/train_extended_gpu.py`
- [FU-Net Training](https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/train_fu_unet.py): `scripts/train_fu_unet.py`
- [Training Dashboard](https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/training_dashboard.py): `scripts/training_dashboard.py`

### Evaluation and Interpretation

- [Prediction Metrics](https://github.com/hrishir746/wildfire-prediction/blob/master/src/evaluation/metrics.py): `src/evaluation/metrics.py`
- [Historical Fire Evaluation](https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/evaluate_real_fires.py): `scripts/evaluate_real_fires.py`
- [Model Validation](https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/wildfire_validation.py): `scripts/wildfire_validation.py`
- [Agent Interface](https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/agent_app.py): `scripts/agent_app.py`
- [Prediction Explainer](https://github.com/hrishir746/wildfire-prediction/blob/master/src/agent/agent.py): `src/agent/agent.py`

### Research Extensions

- [RL Environment](https://github.com/hrishir746/wildfire-prediction/blob/master/src/simulation/wildfire_rl_env.py): `src/simulation/wildfire_rl_env.py`
- [Fire Progression Data](https://github.com/hrishir746/wildfire-prediction/blob/master/scripts/process_firms_progressions_temporal.py): `scripts/process_firms_progressions_temporal.py`

### Other components

- **Researcher**

## Connections

- Researcher → Fetch Real Inputs: requests inputs (evidence: `README.md`)
- Fetch Real Inputs → Environmental Inputs: produces inputs (evidence: `README.md`)
- Environmental Inputs → U-Net Predictor: provides channels (evidence: `README.md`)
- Researcher → Model Training: starts training (evidence: `README.md`)
- Model Training → U-Net Predictor: uses model (evidence: `scripts/train_extended_gpu.py`)
- Model Training → Rothermel Simulator: generates targets (evidence: `scripts/train_extended_gpu.py`)
- Researcher → Rothermel Simulator: runs simulation (evidence: `README.md`)
- Researcher → Historical Fire Evaluation: evaluates event (evidence: `README.md`)
- Historical Fire Evaluation → U-Net Predictor: uses predictor (evidence: `scripts/evaluate_real_fires.py`)
- Historical Fire Evaluation → Rothermel Simulator: compares baseline (evidence: `scripts/evaluate_real_fires.py`)
- Historical Fire Evaluation → Prediction Metrics: computes metrics
- Researcher → Agent Interface: asks questions (evidence: `README.md`)
- Agent Interface → Prediction Explainer: launches agent (evidence: `scripts/agent_app.py`)
- Prediction Explainer → U-Net Predictor: loads predictor (evidence: `src/agent/agent.py`)
- Prediction Explainer → Prediction Metrics: compares metrics (evidence: `src/agent/agent.py`)
- Researcher → Training Dashboard: monitors training (evidence: `README.md`)
- Training Dashboard → U-Net Predictor: loads checkpoints
- Historical Fire Data → Historical Fire Evaluation: supports validation
- FU-Net Training → FU-Net Predictor: trains model (evidence: `scripts/train_fu_unet.py`)
- Fire Progression Data → Model Training: may supply examples
- RL Environment → Rothermel Simulator: calls simulation (evidence: `src/simulation/wildfire_rl_env.py`)
- Researcher → Model Validation: checks predictions (evidence: `README.md`)
- Model Validation → U-Net Predictor: uses model (evidence: `scripts/wildfire_validation.py`)
- Researcher → GPU Simulator: runs accelerated simulation
