Skip to content

Repository files navigation

Wildfire Intelligence Azerbaijan

Python PyTorch Streamlit NASA FIRMS Open-Meteo Folium Scikit-learn

Wildfire Intelligence Azerbaijan is an end-to-end AI and geospatial decision-support prototype for wildfire research in Azerbaijan. It combines satellite active-fire segmentation experiments with U-Net, FirePred-style feature engineering, Random Forest wildfire activity modeling, fusion and explainability analysis, final full-dataset training, and an interactive Streamlit dashboard that blends NASA FIRMS thermal anomaly detections, Open-Meteo weather, Azerbaijan region centroids, and a transparent 0-100 regional risk score.

This is a research and portfolio decision-support prototype. It is not an official emergency alert system.

Key Features

  • Active fire segmentation with U-Net on TS-SatFire / FirePred-style satellite data.
  • Satellite and weather feature engineering for wildfire activity modeling.
  • Tabular wildfire activity prediction with Random Forest classifiers.
  • Fusion analysis between segmentation outputs and tabular risk signals.
  • Explainability with feature importance and case-study summaries.
  • Full-dataset final training and threshold analysis.
  • Azerbaijan live wildfire risk dashboard.
  • Region-level 0-100 rule-based wildfire risk scoring.
  • Interactive Folium map embedded in Streamlit.
  • Demo data fallback so the dashboard can open without live API calls.

Architecture

flowchart LR
    A["TS-SatFire / FirePred-style satellite data"] --> B["EDA and preprocessing"]
    B --> C["U-Net active-fire segmentation"]
    B --> D["FirePred feature engineering"]
    D --> E["Random Forest tabular risk models"]
    C --> F["Fusion and case studies"]
    E --> F
    F --> G["Explainability and final training outputs"]
    H["NASA FIRMS active fire detections"] --> I["Azerbaijan dashboard data cache"]
    J["Open-Meteo weather at region centroids"] --> I
    K["Azerbaijan region centroids"] --> I
    I --> L["Rule-based 0-100 regional risk score"]
    L --> M["Streamlit + Folium dashboard"]
    G --> N["Portfolio results and documentation"]
Loading

Repository Structure

wildfire-intelligence-ai/
├── app/
│   ├── streamlit_app.py
│   ├── components/
│   │   └── map_utils.py
│   └── services/
│       ├── firms_client.py
│       ├── region_loader.py
│       ├── risk_engine.py
│       └── weather_client.py
├── assets/
│   └── readme/
├── data/
│   ├── azerbaijan_regions.csv
│   └── demo/
├── docs/
│   ├── dashboard.md
│   ├── methodology.md
│   └── model_card.md
├── models/
│   └── README.md
├── notebooks/
│   ├── 01_ts_satfire_eda.ipynb
│   ├── 02_unet_active_fire_segmentation.ipynb
│   ├── 03_firepred_weather_feature_engineering.ipynb
│   ├── 04_tabular_risk_model.ipynb
│   ├── 05_fusion_model.ipynb
│   ├── 06_explainability_and_maps.ipynb
│   ├── 07_full_dataset_final_training.ipynb
│   └── 08_azerbaijan_live_fire_risk_dashboard_prototype.ipynb
├── outputs/
├── requirements.txt
├── requirements-dashboard.txt
├── .env.example
└── test_env.py

Notebook Pipeline

  1. notebooks/01_ts_satfire_eda.ipynb - TS-SatFire / FirePred exploratory analysis and satellite band inspection.
  2. notebooks/02_unet_active_fire_segmentation.ipynb - U-Net active-fire segmentation baseline and expanded experiments.
  3. notebooks/03_firepred_weather_feature_engineering.ipynb - day-level satellite and weather feature engineering.
  4. notebooks/04_tabular_risk_model.ipynb - Random Forest modeling for fire presence and high-fire activity.
  5. notebooks/05_fusion_model.ipynb - fusion analysis between tabular and segmentation signals.
  6. notebooks/06_explainability_and_maps.ipynb - feature importance, case-study summaries, and visual explanations.
  7. notebooks/07_full_dataset_final_training.ipynb - final full-dataset U-Net training and threshold selection.
  8. notebooks/08_azerbaijan_live_fire_risk_dashboard_prototype.ipynb - live dashboard data generation and repository QA workflow.

Notebook execution outputs are stripped for GitHub hygiene. The curated result images used below are stored in assets/readme/, and reproducible CSV/JSON summaries remain in outputs/.

Dashboard

The dashboard reads local live cache files first. If they are missing, it falls back to committed demo files under data/demo/, so it can run without NASA FIRMS or Open-Meteo calls.

Windows local path:

cd C:\wildfire-intelligence-ai
streamlit run app/streamlit_app.py

Cross-platform:

streamlit run app/streamlit_app.py

Environment Setup

python -m venv .venv
.venv\Scripts\activate
python -m pip install -r requirements.txt
python -m pip install -r requirements-dashboard.txt

For a lighter dashboard-only install:

python -m venv .venv
.venv\Scripts\activate
python -m pip install -r requirements-dashboard.txt

Environment Variables

Copy .env.example to .env and add your local values:

FIRMS_MAP_KEY=your_firms_map_key_here
PROJECT_ROOT=C:\wildfire-intelligence-ai
AZERBAIJAN_BBOX=44.7,38.3,50.6,41.9

.env is intentionally ignored by Git. Keep real NASA FIRMS keys, Kaggle tokens, and other local credentials out of notebooks and source files.

Data Sources

  • NASA FIRMS active fire / thermal anomaly detections.
  • Open-Meteo current weather data.
  • TS-SatFire / FirePred-style satellite data used for segmentation and tabular model experimentation.
  • Azerbaijan region centroid table in data/azerbaijan_regions.csv.

Results

Final full-dataset U-Net training used 3,556 valid samples across 178 unique events, with event-level train/validation/test splitting. The selected threshold was 0.60, with test Dice 0.549, IoU 0.453, precision 0.691, and recall 0.614 across all test samples.

Final training metric curves

Final threshold sweep

Fire size group metrics

The explainability workflow shows the Random Forest model relies heavily on previous-day active fire intensity and seasonal/date-related variables, while the U-Net provides spatial evidence for active-fire regions.

Tabular feature importance

Representative segmentation case studies:

High-risk large fire case study

Large fire strong segmentation case study

Low-risk no-fire case study

The dashboard demo snapshot contains 33 Azerbaijan regions, 112 FIRMS detections over a 5-day window, 5 high-risk regions, and an average regional risk score of about 39.4.

Model and File Policy

  • Small tabular Random Forest .joblib files may be kept in models/.
  • Large U-Net .pth checkpoints are ignored by default to keep the Git repository lightweight.
  • Reproduce ignored checkpoints with notebooks/07_full_dataset_final_training.ipynb.
  • Large raw satellite datasets are not committed. Store them locally under ignored raw-data folders and document their source.
  • data/demo/ is committed so the dashboard remains runnable for reviewers.
  • data/live_cache/ is ignored because it is generated runtime data.

Limitations

  • FIRMS detections are thermal anomalies, not necessarily confirmed wildfires.
  • The regional risk score is a transparent rule-based MVP, not a government-grade fire spread model.
  • The U-Net segmentation model is research-oriented and is not directly used as the live dashboard risk predictor.
  • Weather is based on region centroid coordinates, not full regional boundary surfaces.
  • Dashboard region markers use centroids; they are not true administrative-area choropleths.

Future Work

  • Deploy the Streamlit dashboard.
  • Add geospatial boundaries for true choropleth maps.
  • Validate against historical confirmed fire events.
  • Add temporal forecasting.
  • Improve calibration of the 0-100 regional risk score.
  • Integrate model-based risk prediction into the dashboard.
  • Add automated data refresh jobs and monitoring.

Author

Author: Celal Ibrahimli

GitHub: celalthedon

License

This project is released under the MIT License. See LICENSE.

About

AI-powered wildfire intelligence and decision-support prototype for Azerbaijan using satellite fire segmentation, NASA FIRMS active fire detections, Open-Meteo weather data, tabular risk modeling, explainability, and an interactive Streamlit dashboard.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages