Skip to content

Repository files navigation

OpenFireAlert

OpenFireAlert logo

Python 3.8 or later OpenCV Ultralytics YOLO11 Edge inference: NVIDIA Jetson and TensorRT Sensor node: ESP32-S3
Java 19 Spring Boot 3.2.0 MySQL 8.x License: AGPL-3.0

English | 简体中文 | License | Citation | Contributing | Security | Third-Party Notices

Important

OpenFireAlert is an experimental open-source monitoring project for research, learning, and engineering exploration. It is provided as-is and is not a certified fire-safety system or a replacement for professional emergency response, inspections, or applicable safety requirements.

OpenFireAlert is an open-source intelligent wildfire monitoring platform that combines AI vision, Jetson edge inference, ESP32 sensor nodes, and a Spring Boot control plane.

The repository is organized as a deployable engineering project rather than a research-only prototype. Each module can be used independently, but the full system is designed around this data flow:

sensor-node and vision-edge collect field signals -> control-plane stores device state and alarms -> the web console displays live status and stream links -> model-workbench maintains the detector model lifecycle.

Choose Your Starting Point

Goal Start here What you will configure
Run the backend and web console control-plane/ MySQL, SMTP, alarm email, stream endpoints, admin account
Run Jetson fire/smoke inference vision-edge/ backend URL, RTSP URL, device ID, model path
Flash ESP32 sensor firmware sensor-node/ WiFi, backend host/port, device ID, sensor pins
Train or export YOLO models model-workbench/ dataset YAML, model YAML, output directory, weight files
Read deployment notes documentation/ architecture, module order, production checklist
Add public demo assets reference-assets/ sample ownership and redistribution rights

Repository Map

OpenFireAlert/
|-- control-plane/        Spring Boot API service and web console
|-- vision-edge/          Jetson runtime, camera tools, runtime models, output layout
|   |-- models/           curated runnable model artifacts
|   |-- camera-tools/     CSI camera capture and RTSP smoke tests
|   |-- diagnostics/      GPU and TensorRT environment checks
|   `-- outputs/          ignored local outputs, plus reviewed public training archive
|-- sensor-node/          ESP32 firmware for DHT11, MQ2, and buzzer linkage
|-- model-workbench/      YOLO training, export scripts, and model/dataset configs
|   `-- configs/          readable dataset and model YAML files
|-- documentation/        architecture and deployment notes
|-- ReadmePhoto/          curated README figures grouped by system, model, and UI
|-- reference-assets/     placeholder for redistributable demo assets
|-- LICENSE               AGPL-3.0
`-- THIRD_PARTY_NOTICES.md

The ultralytics/ directories are vendored upstream source used by the training and edge runtime modules. Avoid editing them unless you are intentionally patching the YOLO runtime.

Run Before You Configure

No real credentials are stored in this repository. Copy example files and fill your own values before running:

  • control-plane/src/main/resources/application.example.yaml
  • control-plane/src/main/resources/static/config.example.js
  • sensor-node/include/config.example.h
  • vision-edge/.env.example
  • model-workbench/.env.example

Do not commit database passwords, SMTP authorization codes, WiFi passwords, tunnel domains, private dataset paths, unreviewed training outputs, or private video samples. Only the curated runtime model under vision-edge/models/ and the reviewed public training archive under vision-edge/outputs/training-runs/included-fire-smoke-detector-20260419/ are intentionally included.

Quick Start

  1. Start MySQL and create a database such as wildfire_aegis.

  2. Configure and start the control plane:

    cd control-plane
    mvn spring-boot:run
  3. Run edge inference with the included portable model:

    cd vision-edge
    python edge_fire_detector.py --source 0
  4. Flash the ESP32 after creating sensor-node/include/config.h:

    cd sensor-node
    pio run --target upload
  5. Train or export a replacement detector from model-workbench/ only after the dataset YAML points to your local dataset.

Included Edge Model

vision-edge/models/ contains a curated fire/smoke detector so the edge module can run without an extra training step:

  • wildfire-aegis-fire-smoke.pt: portable default runtime model.
  • wildfire-aegis-fire-smoke.engine: TensorRT export for the original Jetson deployment environment.
  • manifest.json: size, hash, class list, and provenance notes.

TensorRT engine files are environment-sensitive. If TensorRT, CUDA, GPU architecture, or driver versions differ, regenerate the .engine file from the .pt model.

System And Model Figures

ReadmePhoto/ contains curated high-resolution figures grouped by purpose: system for architecture and hardware diagrams, model for detector outputs and training charts, and user for redacted web-console screenshots. These files are documentation assets for README pages, technical reports, and public demos; none of the runtime modules depend on them.

Fire-Smoke Detector Architecture

The detector figure shows the overall YOLO11-based network used by OpenFireAlert. The backbone extracts multi-scale visual features, the feature-fusion path aggregates shallow and deep representations, and the detection heads produce fire/smoke predictions at multiple scales. The custom FeatureComplexHead, FeatureComplexNeck, and PoolingLayer blocks are expanded in the lower part of the figure so their internal data flow is visible without opening the model YAML.

OpenFireAlert fire-smoke detector architecture with FeatureComplex modules

This figure is useful when reviewing model changes, explaining the detector design, or comparing architecture variants in model-workbench/configs/models/.

Alert Orchestration State Machine

The alarm figure summarizes the backend decision path after a Jetson device uploads a frame. Normal frames only refresh device status, while fire/smoke frames enter a per-device anti-jitter state machine. Only first threats and threats that reappear after the cooldown window trigger LinkageAlarmService, which then coordinates ESP32 buzzer state, email delivery, alarm records, and dashboard visibility.

OpenFireAlert alert orchestration state machine

This figure matches the current control-plane flow around Jetson frame ingestion, ESP32 sensor linkage, duplicate-alarm suppression, and frontend observability.

ESP32-S3 Sensor Node Wiring

The wiring diagram maps the firmware pin definitions to a reproducible hardware setup. It shows the DHT11 temperature/humidity sensor, MQ2 smoke sensor, and active-low buzzer module connected to the ESP32-S3 DevKitC-1, including shared ground and voltage-level notes for MQ2 modules.

OpenFireAlert ESP32-S3 sensor node wiring diagram

The pin assignments come from sensor-node/src/main.cpp: DHT11 data on GPIO4, MQ2 analog output on GPIO2, MQ2 digital output on GPIO8, and buzzer control on GPIO7.

Web Console Preview

The following screenshots are redacted README copies from the web console. Local URLs, organization-specific text, personal contact information, and private IP values are hidden before publication.

System Overview

The overview page summarizes online devices, recent alarm activity, runtime status, processing ratio, and the latest alarm records.

OpenFireAlert web console system overview

Device Monitoring

The monitoring page shows ESP32 sensor cards with temperature, humidity, smoke value, buzzer status, and Jetson camera device status.

OpenFireAlert web console device monitoring

Alert Records

The alert records page shows handled and unhandled alarms, device linkage context, smoke values, and operator actions.

OpenFireAlert web console alert records

Detection Result Examples

The following images are frames generated for presentation. They simulate realistic forest fire and smoke scenes and add YOLO-style bounding boxes for fire and smoke. They are useful for explaining the expected visual output format, but they should not be treated as benchmark evidence or real model inference results.

Simulated forest fire and smoke detection result 1

Simulated forest fire and smoke detection result 2

Model Training Snapshot

The included detector is accompanied by a reviewed public training archive at vision-edge/outputs/training-runs/included-fire-smoke-detector-20260419/. The archive documents the released model with parameters, metrics, small visual summaries, exported weights, and TensorBoard metadata. It does not include raw D-Fire dataset images, labels, or private videos.

Training Curves

The training curves summarize loss and validation metrics across epochs. They are useful for quickly checking convergence behavior and spotting obvious training instability.

OpenFireAlert detector training curves

Normalized Confusion Matrix

The normalized confusion matrix gives a compact view of class-level behavior for the included fire/smoke detector.

OpenFireAlert normalized confusion matrix

Additional precision/recall/F1 charts and run metadata are available in the archived run directory.

Open Source, Attribution, And Privacy Notes

This project is released under AGPL-3.0 because it includes and modifies Ultralytics YOLO source code. See LICENSE and THIRD_PARTY_NOTICES.md.

If you deploy a modified OpenFireAlert service over a network, provide users a visible source-code link for the running version. Raw datasets and private videos are not included in this repository. Check licenses before publishing any additional model, dataset, media, or calibration assets.

Project-specific source code, documentation, and project assets are attributed in NOTICE. Forks and derivative works must preserve applicable copyright and license notices, and must not imply that they are the official OpenFireAlert project or are endorsed by its copyright holders. See TRADEMARKS.md for the project-identity notice.

If you use OpenFireAlert in research, reports, or derivative work, use the repository citation metadata in CITATION.cff.

See CONTRIBUTING.md before opening a pull request. Use the repository's issue forms for public bugs and feature proposals; report suspected vulnerabilities only through the private process described in SECURITY.md.

Validation Checklist

Recommended checks before publishing a release:

python -m py_compile vision-edge/edge_fire_detector.py model-workbench/train_fire_detector.py
cd control-plane && mvn test
cd sensor-node && pio run
rg -n "password|secret|token|ngrok|localhost.run|/Users/|C:\\\\Users|workspace.xml|application.yaml|config.js|config.h|target|.idea"

Platform-specific tools such as TensorRT, PlatformIO, CUDA, and PyTorch must be installed in the target environment.

About

Open-source wildfire monitoring and early-warning platform powered by AI vision, Jetson edge inference, and ESP32 sensors.

Topics

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages