Intelligent fire detection in agriculture using machine learning and embedded systems for risk prevention and improved sustainability

This research proposes the design of an autonomous fire detection system based on a Raspberry Pi 3 B+, combined with smoke and flame sensors, enabling real-time monitoring and increased reactivity to fire hazards. To improve detection accuracy and risk prediction, Machine Learning (ML) algorithms, including Random Forest and Linear Regression, were applied to classify hazard levels and anticipate critical situations. The implementation of these models has enabled accurate classification of risk levels, guaranteeing real-time alerts and rapid decision-making. In addition, anomaly detection techniques based on the Random Forest model have been integrated to identify unusual sensor behavior, ensuring the reliability of the data collected and the correction of any measurement errors. A major contribution of this research lies in the fact that the systems were developed to be adaptable in order to serve areas (i.e., rural and agricultural areas without sufficient Internet access and/or cloud infrastructure) that had little or no access to the Internet. By integrating an embedded, independent, and efficient solution, this system offers a viable alternative to conventional monitoring methods. As part of this research, model performance was evaluated using a confusion matrix for classification accuracy, with the identification of abnormal sensor behavior (anomalies). The performance of each model was evaluated by implementing five-fold stratified cross-validation to confirm their accuracy. The logistic regression model yielded an overall average accuracy of 0.9446 ± 0.0600, with an overall F1 score of 0.9173 ± 0.0744 and a total recall of 0.9250 ± 0.0608. On the other hand, the random forest model produced an overall average accuracy of 0.9860 ± 0.0172, with an overall F1 score of 0.9740 ± 0.0319 and a total recall of 0.9733 ± 0.0327. The random forest demonstrated reliable and balanced classification of fire risk levels compared to the other models in this study. The safety and sustainability of agricultural crops are directly supported by the results of this research, with a reduction in agricultural fire risk through the protection of natural resources and increased resilience of farms through better preparedness for natural disasters. The transition of agriculture to smart systems involves integrated smart approaches to agricultural risk management in order to achieve safer, more sustainable, and more resilient agriculture.

Authors

Institutions

Publication Details

Journal
Scientific Reports
Published
2026-02-18
DOI
https://doi.org/10.1038/s41598-026-40378-w
Primary Topic
Fire Detection and Safety Systems
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Intelligent fire detection in agriculture using machine learning and embedded systems for risk prevention and improved sustainability

Abdennabi Morchid, Rachid El Alami, Abdennacer Elbasri, Paweł Skruch et al.
Scientific Reports
Fire Detection and Safety Systems
article

Intelligent fire detection in agriculture using machine learning and embedded systems for risk prevention and improved sustainability

Abdennabi Morchid, Rachid El Alami, Abdennacer Elbasri, Paweł Skruch, Hassan Qjidaa, Salah Mobayen, Badre Bossoufi
article en

Abstract

This research proposes the design of an autonomous fire detection system based on a Raspberry Pi 3 B+, combined with smoke and flame sensors, enabling real-time monitoring and increased reactivity to fire hazards. To improve detection accuracy and risk prediction, Machine Learning (ML) algorithms, including Random Forest and Linear Regression, were applied to classify hazard levels and anticipate critical situations. The implementation of these models has enabled accurate classification of risk levels, guaranteeing real-time alerts and rapid decision-making. In addition, anomaly detection techniques based on the Random Forest model have been integrated to identify unusual sensor behavior, ensuring the reliability of the data collected and the correction of any measurement errors. A major contribution of this research lies in the fact that the systems were developed to be adaptable in order to serve areas (i.e., rural and agricultural areas without sufficient Internet access and/or cloud infrastructure) that had little or no access to the Internet. By integrating an embedded, independent, and efficient solution, this system offers a viable alternative to conventional monitoring methods. As part of this research, model performance was evaluated using a confusion matrix for classification accuracy, with the identification of abnormal sensor behavior (anomalies). The performance of each model was evaluated by implementing five-fold stratified cross-validation to confirm their accuracy. The logistic regression model yielded an overall average accuracy of 0.9446 ± 0.0600, with an overall F1 score of 0.9173 ± 0.0744 and a total recall of 0.9250 ± 0.0608. On the other hand, the random forest model produced an overall average accuracy of 0.9860 ± 0.0172, with an overall F1 score of 0.9740 ± 0.0319 and a total recall of 0.9733 ± 0.0327. The random forest demonstrated reliable and balanced classification of fire risk levels compared to the other models in this study. The safety and sustainability of agricultural crops are directly supported by the results of this research, with a reduction in agricultural fire risk through the protection of natural resources and increased resilience of farms through better preparedness for natural disasters. The transition of agriculture to smart systems involves integrated smart approaches to agricultural risk management in order to achieve safer, more sustainable, and more resilient agriculture.

Scientific ReportsVol. 16(1)
Cadi Ayyad University (MA), Agence pour le Développement et la Réhabilitation de la Ville de Fès (MA), AGH University of Krakow (PL), National Yunlin University of Science and Technology (TW), Sidi Mohamed Ben Abdellah University (MA)
Zero hunger
Openalex Percentile: Top 61%
Fire Detection and Safety Systems
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.