University of Bahrain Senior Project

PyroSense

An AI-based smart fire detection and management system that predicts fire risk from sensor data, reduces false alarms, and guides emergency response across multiple building zones.

Accuracy 99.27%
Model Random Forest
Inputs 6 sensors
Response 4 levels

Project introduction

Smarter decisions than a simple alarm

Traditional fire alarms depend on fixed thresholds, so harmless changes like steam, dust, or humidity can trigger unnecessary evacuations. PyroSense uses machine learning to analyze multiple environmental readings together and return a probability-based fire risk result. The system turns that result into clear operational actions for building managers.

Features

Built for multi-zone fire monitoring

01

AI fire-risk prediction

Classifies incoming readings as safe or fire risk using a trained Random Forest model.

02

Probabilistic confidence

Shows class probabilities and confidence instead of only producing a binary alarm.

03

Multi-zone dashboard

Lets building managers monitor floors, rooms, sensor IDs, exits, and affected zones from one interface.

04

Automated reports

Captures incident details, sensor readings, timestamps, predictions, and triggered actions for audit use.

How it works

From sensor readings to emergency response

1

Collect data

PyroSense receives temperature, humidity, pressure, eCO2, raw ethanol, and raw H2 readings.

2

Run prediction

The FastAPI backend sends the six features to the trained machine learning model.

3

Score risk

The model returns safe/fire probabilities, confidence, and a classification label.

4

Trigger action

The dashboard maps the result to Monitor, Warn, Act, or Contain decisions for each zone.

Decision hierarchy

Four response levels

Level 1

Monitor

Track early abnormal readings while the model still classifies the zone as safe.

Level 2

Warn

Notify supervisors, inspect the zone, and prepare evacuation if warning probability rises.

Level 3

Act

Evacuate affected zones, activate suppression support, and notify emergency teams.

Level 4

Contain

Escalate to a multi-zone incident when fire risk spreads across adjacent zones.

Dashboard

Designed for fast situational awareness

The interface highlights active floors, risk level, sensor readings, affected rooms, confidence scores, evacuation routes, and incident actions in a format that non-technical building managers can understand quickly during an emergency.

PyroSense Control F2 / Research Lab
Lab
Corridor
Office
Server
Act Fire confirmed

Evacuate Zone A and isolate HVAC on the affected floor.

Technology

System architecture

Frontend

TypeScript and Vite render the interactive monitoring dashboard, floor map, analytics, and reports.

Backend

Python FastAPI exposes simulation and prediction endpoints for the web dashboard.

Machine learning

Scikit-learn trains Random Forest, Decision Tree, and KNN models, then saves the best model with joblib.

Dataset

The model is trained on a Kaggle fire detection sensor dataset with labeled safe and fire readings.

Evaluation

High accuracy with practical response intelligence

PyroSense achieved 99.27% accuracy on the held-out test set, with near-perfect precision and recall for safe and fire classes. The project also benchmarks PyroSense against traditional threshold-based systems, SVM approaches, CNN fire detection, and commercial alarm platforms.

Model Accuracy Fire F1
Random Forest 99.27% 0.99
Decision Tree 99.10% 0.99
KNN 97.14% 0.97

Future work

Next steps toward deployment

Live IoT sensor integration SMS, email, and mobile push alerts Mobile monitoring application Advanced temporal ML models