Machine learning hybrid dynamic best model selection algorithm for real-time fire prediction using IoT-enabled multi-sensor data in buildings

Published 20 September, 2026

A new study published in the Journal of Safety Science and Resilience (ISSN: 2096-7527) found that fire detection can become more reliable when a system does not depend on only one fixed machine-learning model. Instead, the proposed system learns which model performs best under the current sensor conditions and uses that model for real-time fire prediction.

The study introduces a hybrid dynamic best model selection algorithm for building fire detection using IoT-enabled sensors. The system collected smoke, temperature, and humidity data through MQ-2 and DHT11 sensors connected to a NodeMCU ESP8266 microcontroller. The data were transmitted to the ThingSpeak cloud platform, where machine-learning models analyzed the incoming sensor readings and predicted whether a fire was present.

"Unlike conventional fire alarm systems that often rely on fixed thresholds, this method compares multiple classifiers, including random forest, logistic regression, support vector classifier, decision tree, and Gaussian Naïve Bayes," explains lead author Mujeeb Ali Khan. "It then dynamically selects the best-performing model using accuracy, precision, recall, F1-score, ROC-AUC, MAE, and RMSE. This makes the system more adaptive to changing fire and environmental conditions."

"Our aim was to move beyond static fire detection and develop a system that can respond intelligently to real-time sensor data," said lead author Mujeeb Ali Khan. "By allowing the algorithm to select the best model dynamically, we improved both prediction accuracy and system reliability."

The proposed algorithm achieved 99.57% testing accuracy, 99.37% precision, 99.79% recall, 99.58% F1-score, 100% ROC-AUC, and very low prediction error. It also outperformed the individual machine-learning models tested in the study.

Notably, the team used a custom-built laboratory sensor node and an original fire dataset.

"The system was tested under controlled smoke and petroleum fire scenarios, giving us real-time data rather than relying only on public or simulated datasets," adds Khan. "We found that low-cost IoT sensors, cloud analytics, and adaptive machine learning can work together to support faster and more accurate fire warning systems."

ML AND IOT-BASED REAL-TIME FIRE DETECTION SYSTEM ARCHITECTURE WITH MULTI-SENSOR INTEGRATION AND CLOUD CONNECTIVITY

The image shows the proposed IoT-enabled real-time building fire detection system, integrating MQ-2 smoke sensing, DHT11 temperature and humidity sensing, NodeMCU ESP8266 control, relay-based alarm activation, cloud connectivity, and control-room monitoring. Image created by Mujeeb Ali Khan et al., State Key Laboratory of Fire Sciences, University of Science and Technology of China.

Contact author details:

Mujeeb Ali Khan, State Key Laboratory of Fire Sciences, University of Science and Technology of China, Hefei, China; Hefei Keda Li’an Safety Technology Co. Ltd., Hefei, China, mujeebkhan@mail.ustc.edu.cn

Funder:

This work was supported by the National Natural Science Foundation of China (52321003) and the China Scholarship Council (CSC). Hefei Keda Li’an Safety Technology Co., Ltd. provided the experimental devices and facilities.

Conflict of interest: 

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

See the article: 

Khan, M.A., Song, W., Khan, A., Ali, M., Karim, R., and Zhang, J., Machine learning hybrid dynamic best model selection algorithm for real-time fire prediction using IoT-enabled multi-sensor data in buildings, Journal of Safety Science and Resilience, Volume 7, issue 2, 2026, Article 100236, https://doi.org/10.1016/j.jnlssr.2025.100236.

 

Back to News

Stay Informed

Register your interest and receive email alerts tailored to your needs. Sign up below.