• Home
  • Sitemap
  • Contact us
Int J Fire Sci Eng Search

CLOSE


Int J Fire Sci Eng > Volume 39(4); 2025 > Article
Park, Lee, and Jung: Machine Learning-Based On-Device Smoke and Flame Detection System Using Light Intensity of RGB Color Sensor

Abstract

This study proposes an edge-based real-time fire-detection system utilizing low-cost RGB sensors and TinyML technology. To overcome the high cost and maintenance limitations of existing detection methods in large indoor spaces, we propose an efficient approach that analyzes light-intensity patterns using affordable RGB sensors. Unlike simple threshold-based methods, our system applies machine learning to precisely distinguish between the complex optical patterns of smoke and flames, thus significantly enhancing detection accuracy. Designed with an on-device AI architecture, the system performs independent and rapid fire assessment on an edge device without requiring external network connectivity. Experiments conducted in a simulated fire environment confirmed the system’s feasibility and high accuracy. Spectral analysis and multisensor fusion shall be considered in future investigations to further minimize false alarms.

1. Introduction

In recent years, an increase in the frequency of fires in large indoor spaces, such as large-scale logistics warehouses, has increased the loss of life and property. However, when conventional vision-based fire-detection systems are used in such environments, numerous high-resolution cameras and high-performance servers are required to eliminate blind spots, which substantially increases both installation and maintenance costs [1]. Additionally, conventional ionization-type or photoelectric contact detectors exhibit inherent limitations, including slow responses before smoke reaches the sensor in large spaces and frequent false alarms caused by environmental factors such as dust and humidity [2].
Hence, various approaches have been investigated. In vision-based detection, deep-learning models, such as convolutional neural networks, have been introduced to enhance detection performance [3]. Nevertheless, these approaches require high-performance GPU servers or cloud resources to process large volumes of image data and thus do not fundamentally resolve the issue of high deployment costs.
As an alternative, non-vision-based methods using low-cost optical sensors have been actively investigated. Researchers have proposed approaches that measure light emitted in specific wavelength bands during fire events or variations in light intensity caused by smoke using photodiodes or RGB color sensors [4]. To improve detection reliability, some studies combined UV and IR sensors or analyzed flame flicker frequencies through spectral analysis [5]. However, such multisensor fusion strategies and complex signal-processing schemes increase both system cost and computational complexity, thus limiting their applicability to compact edge devices.
By contrast, conventional approaches based on simple light-intensity measurements using a single RGB sensor offer lightweight system configurations but are extremely sensitive to changes in the surrounding environment, such as variations in sunlight, flickering of indoor lighting, or movement of people and objects [6]. Simple threshold-based decision algorithms cannot clearly distinguish actual fire signals from daily environmental noise, thus resulting in reduced reliability and hindering practical deployment [7].
In this study, we propose an edge-based real-time fire-detection system that integrates the optical characteristics of low-cost RGB sensors with machine-learning techniques. Instead of relying on expensive imaging equipment, the proposed system employs an affordable RGB color sensor to capture subtle light-intensity variation patterns associated with smoke and flames during the early stages of a fire. The acquired data are preprocessed based on temporal variations instead of absolute intensity values, and the resulting patterns are used to train a lightweight machine-learning model. Through this design, the system effectively suppresses environmental interference and enables rapid and accurate fire detection on a resource-constrained edge device.

2. Machine Learning-Based On-Device Smoke and Flame-Detection System

2.1 Experimental environment

To conduct the experiments, a simplified experimental apparatus was constructed, as shown in Figure 1. The apparatus was fabricated using polycarbonate and measured 120 cm × 50 cm × 30 cm; additionally, a ventilation opening measuring 30 cm × 45 cm was installed at a height of 60 cm from the floor. A heating device was placed at the bottom of the apparatus. The measurement sensor was mounted on the inner wall at a height of 80 cm, and an LED was installed at the top of the apparatus to reproduce lighting conditions similar to those in warehouse environments. Experiments were performed by combusting 4.7 g of paper, 7 g of rubber, and 5 g of fabric.

2.2 System configuration

The proposed system consists of an edge device that integrates an RGB color sensor and a microcontroller, enabling the precise acquisition of optical data from smoke and flames generated during fire events. Additionally, a monitoring system was designed to enable real-time remote analysis and visualization of the acquired data for efficient data management. The overall system architecture is illustrated in Figure 2.
For data acquisition aimed at indoor fire detection, the ISL29125 RGB light sensor manufactured by SparkFun was employed. This sensor measures the intensities of red, green, and blue wavelength light with a 16-bit resolution and communicates with the controller via the I2C interface. The measurement range was configured to 375 Lux to capture subtle variations in light intensity during the early stages of smoke generation. The XIAO ESP32S3 was selected as the microcontroller. The ESP32S3 features a 32-bit dual-core architecture and operates at a maximum clock speed of 240 MHz, thus rendering it suitable for neural-network inference. Additionally, it includes built-in Wi-Fi and Bluetooth modules, thereby providing excellent extensibility for Internet of Things applications.
For machine-learning implementation, we designed and executed sensor-data acquisition, variation-based preprocessing, and TinyML model inference in an integrated manner using Edge Impulse. To enable real-time monitoring and logging of fire-related events in the field, the MQTT protocol was adopted. Data published through the HiveMQ cloud broker were subscribed to using a Node-RED server and then stored in the MongoDB Atlas. Additionally, the Edge Impulse platform was utilized for machine-learning model training and optimization.

2.3 Data-acquisition method

Data measurement and acquisition were conducted remotely using wireless communication, and the acquired data were visualized using a Node-RED dashboard, as shown in Figure 3. This interface enabled remote monitoring of real-time variations in RGB sensor data as well as the fire-inference results generated by the edge device. The actual combustion of the test materials is presented in Figure 4.

2.4 Machine-learning model design

Data acquisition for machine-learning model generation was conducted in an open warehouse-type space that closely resembled an actual fire-detection environment. Under controlled conditions, various combustible materials such as wood, paper, and fabric were burned to acquire 7 h 36 min worth of RGB time-series data. The complete dataset was classified into training and test sets at a ratio of 74:26 for model training and performance evaluation. The acquired data were categorized into three classes: a normal condition without fire (Normal), a condition in which smoke was generated by combustion (Smoke), and a condition in which flames began to appear (Fire). Figure 5 presents the distribution of the entire training dataset visualized using Data Explorer.
Based on an analysis of the acquired dataset characteristics, we determined the optimal model parameters as follows: A time-series windowing approach was applied to construct the input data. The window size for data segmentation was set to 10,000 ms to capture sustained smoke patterns during fire events, while the window stride was set to 500 ms to achieve a data-augmentation effect. The input layer could accept 30 preprocessed features. The first hidden layer comprised 20 neurons and employed the ReLU activation function to learn nonlinear feature representations. The second hidden layer comprised 10 neurons with the ReLU activation function, followed by a dropout layer with a rate of 25% to prevent overfitting. The final output layer comprised three neurons, and the Softmax function was used for multiclass classification to output the probability of each class (Normal, Smoke, and Fire). To ensure reliable detection, predictions in which the maximum Softmax probability was below 0.6 were regarded as unreliable and not assigned to a specific class; instead, they were classified as uncertain. During training, the categorical cross-entropy loss function was adopted owing to its suitability for multiclass classification, and the Adam optimizer was used. The hyperparameters for model training were set to a learning rate of 0.0005, a batch size of 32, and 50 epochs. The overall neural-network architecture is shown in Figure 6.

3. Experimental Results and Discussion

3.1 Analysis of experimental results

In this study, a machine learning-based analysis algorithm was designed to precisely extract distinctive fire-related patterns from light-intensity data obtained in complex environments. The time-series light-intensity data acquired using the RGB sensor exhibited diverse characteristics depending on the surrounding environmental conditions. Figure 7 shows the light-intensity patterns observed during daily environmental changes such as flickering indoor lighting and pedestrian movement. These routine events are generally characterized by abrupt and discontinuous variations, whereas the light intensity tends to change gradually during most periods.
Figure 8 presents the data patterns observed under actual smoke-generation conditions. The experimental results indicated that, unlike the case in typical environmental situations, smoke-related signals exhibited relatively small amplitude variations but showed a continuous oscillatory behavior that persisted without interruption for approximately 10 s or longer.
Figure 9 shows the light-intensity variation patterns associated with flame occurrence. Owing to the high luminance of flames, the variation in the sensor data increased significantly, and highly irregular time-series patterns were observed in accordance with the dynamic movement of the flames. The data analysis indicates that simple threshold-based fire-detection methods are inadequate for clearly distinguishing these subtle yet sustained patterns from daily environmental noise. Accordingly, this study extracts fine-grained temporal variations in light intensity based on raw RGB sensor data and trains an artificial-intelligence model using these features. Using this approach, a machine-learning model that can effectively detect nonlinear patterns characteristic of smoke generation was developed.

3.2 Analysis of model training results

To objectively evaluate the performance of the trained model, model assessment was conducted using a separate test dataset that was not included in the training process. The test dataset comprised 1,709 Smoke samples and 3,667 Normal samples. The experimental results showed that the model achieved classification accuracies of 98.3% and 92.2% for the Normal and Smoke classes, respectively. In particular, the confusion-matrix analysis presented in Table 1 indicates that the missed detection rate, in which smoke was misclassified as a normal condition, was 4.9%. Additionally, the F1 score exceeded 0.9 for both classes, thereby confirming that stable learning was achieved without significant performance degradation caused by data imbalance. By contrast, the Fire class exhibited a relatively low classification accuracy of 42.1%, which is attributable to the limited amount of training data available for this class. However, a detailed analysis of the misclassified samples revealed that the proportion of actual flame events misclassified as Normal was 15.8%, whereas 36.8% were misclassified as Smoke. This result suggests that even when the model does not perfectly distinguish flame-specific characteristics, it tends to recognize such events as hazardous smoke-related conditions instead of as normal states.
To deploy the trained model on the edge device, it was converted into the TensorFlow Lite format optimized for edge environments and deployed on the ESP32S3 microcontroller. The model performance and resource usage are summarized in Table 2. The model inference time was measured at 1 ms, and the required RAM usage was 3.2 kB, thus indicating that the model can be executed stably on the ESP32S3 microcontroller.

3.3 Application results of proposed on-device-based system

To verify the detection performance of the proposed system, experiments were conducted under four different scenarios by combining daytime and nighttime conditions with lighting on and off, namely daytime-light-off, daytime-light-on, nighttime-light-on, and nighttime-light-off. For a quantitative comparison across scenarios, data were collected under conditions in which 4.7 g of paper was completely combusted in each case. Figure 10(a) presents the experimental results under the daytime-light-off condition. Smoke was visually observed at approximately 80 s after ignition, and flames appeared at 93 s. Based on the real-time inference results, the system began classifying the state as Smoke at 80.28 s, i.e., immediately after smoke generation, but failed to classify the state as Fire. Figure 10(b) shows the results under the daytime-light-on condition. In this experiment, smoke was observed at 35 s after ignition, followed by flame generation at 67 s. The edge device continuously detected the Smoke state beginning at 40.2 s, i.e., approximately 5 s after smoke occurrence. However, for the Fire class, inference was performed at approximately 100 s, i.e., approximately 33 s after flame generation. Figure 10(c) shows the results under the nighttime-light-on condition. In this scenario, smoke was generated at 18 s after ignition, and flames were observed at 100 s. The system temporarily misclassified the state as Fire at 9.9 s. Nevertheless, it subsequently detected the Smoke state stably from 20.1 s onward and correctly inferred the Fire class at 100.5 s, i.e., immediately after flame occurrence. Figure 10(d) presents the experimental results under the nighttime-light-off condition. Smoke was observed at 46 s after ignition, and flames appeared at 95 s. Based on the inference results, Smoke and Fire were classified beginning from 50.2 and 100 s, respectively. Based on the experimental results of the four scenarios described above, Table 3 quantitatively summarizes the time difference between the actual event occurrence and the system detection time.
Based on these experiments, the system showed high detection performance for smoke generation under various lighting conditions. By contrast, flame detection exhibited delays or instability in some scenarios. This limitation is attributed to the constrained fire experiments conducted for safety reasons and the resulting insufficient amount of training data for the Fire class. By acquiring additional data from a wider range of environments—including actual fire scenes—and incorporating these data into the training process, the proposed system is expected to achieve rapid and accurate real-time monitoring of both smoke and flames during fire events.

4. Conclusions

In this study, a real-time fire-detection system that operates independently of the cloud infrastructure was implemented by integrating light-intensity variation analysis using an RGB color sensor with machine-learning techniques in an edge-based architecture. Experimental results showed that the proposed system achieved classification accuracies of 98.3% and 92.2% for the Normal and Smoke classes, respectively. In particular, the system recorded a missed detection rate of 4.9% and a minimum response time of 0.28 s for smoke detection, thereby experimentally validating its practical effectiveness. By contrast, flame detection exhibited relatively limited performance, with a classification accuracy of 42.1% under complex lighting conditions and detection delays of up to 33 s in certain scenarios. Based on these findings, the developed system is considered sufficiently effective for the early detection of smoke during the initial stages of a fire, particularly in environments where conventional fire detectors cannot be installed easily or where communication infrastructure is limited, while maintaining low deployment costs. Future investigations may address the identified limitations in flame detection by introducing spectral-analysis techniques to characterize the wavelength properties of smoke and flame phenomena more precisely. Additionally, multisensor fusion approaches can be investigated to minimize false alarms and further enhance detection reliability.

Notes

Acknowledgments

This research was supported by the Regional Innovation System & Education (RISE) program through the Chungbuk Regional Innovation System & Education Center, funded by the Ministry of Education (MOE) and the Chungcheongbuk-do, Republic of Korea (2025-RISE-11-008-01).

Figure 1.
Experimental apparatus.
KIFSE-fe5501d6f1.jpg
Figure 2.
System architecture.
KIFSE-fe5501d6f2.jpg
Figure 3.
Real-time monitoring dashboard.
KIFSE-fe5501d6f3.jpg
Figure 4.
Combustion test sequence.
KIFSE-fe5501d6f4.jpg
Figure 5.
Dataset visualization using edge impulse.
KIFSE-fe5501d6f5.jpg
Figure 6.
Architecture of the machine learning model used in the current study.
KIFSE-fe5501d6f6.jpg
Figure 7.
Sensor response in various situations.
KIFSE-fe5501d6f7.jpg
Figure 8.
RGB sensor response to smoke generated by various combustible materials.
KIFSE-fe5501d6f8.jpg
Figure 9.
RGB sensor detection results for flames.
KIFSE-fe5501d6f9.jpg
Figure 10.
Sensor response to paper combustion under various lighting conditions.
KIFSE-fe5501d6f10.jpg
Table 1.
Confusion Matrix
Fire Normal Smoke Uncertain
Fire 42.1% 15.8% 36.8% 5.3%
Normal 0% 98.3% 1.3% 0.4%
Smoke 0% 4.9% 92.2% 2.9%
F1_score 0.59 0.98 0.94
Table 2.
Model Performance and Resource Usage
Raw data Analysis Classifier Total
Latency - - 1 ms 1 ms
RAM 0.1 K 1.3 K 3.2 K 3.2 K
Flash - - 37.1 K
Table 3.
Analysis of Detection Latency by Experimental Scenario
Scenario Event Actual Time (s) Detection Time (s) Latency (s)
Day / Light-off Smoke 80 80.28 0.28
Fire 93 - -
Day / Light-on Smoke 35 40.2 5.2
Fire 67 100 33
Night / Light-on Smoke 18 20.1 2.1
Fire 100 100.5 0.5
Night / Light-off Smoke 46 50.2 4.2
Fire 95 100 5

References

1. A. E. Çetin, K. Dimitropoulos, B. Gouverneur, N. Grammalidis, O. Günay, Y. H. Habiboǧlu, B. U. Töreyin and S. Verstockt, “Video Fire Detection - Review”, Digital Signal Processing, Vol. 23, No. 6, pp. 1827-1843 (2019), https://doi.org/10.1016/j.dsp.2013.07.003.
crossref
2. A. R. Pauchard, D. Manic, A. Flanagan, P. A. Besse and R. S. Popovic, “A Method for Spark Rejection in Ultraviolet Flame Detectors”, IEEE Transactions on Industrial Electronics, Vol. 47, No. 1, pp. 168-174 (2000), https://doi.org/10.1109/41.824139.
crossref
3. H. Kwon, S. Choi and H. Jung, “A Study on the Performance Analysis of Fire Detection Using a Light-Weight Convolutional Neural Network Model”, Fire Science and Engineering, Vol. 38, No. 6, pp. 75-83 (2024), https://doi.org/10.7731/KIFSE.0578853a.
crossref
4. J. W. Choi, S. H. Kim and H. Y. Jung, “Comparative Analysis of Fire-Detection Characteristics of Si-Based RGB Color Sensors and Existing Fire-Detection Sensors”, Fire Science and Engineering, Vol. 38, No. 6, pp. 84-93 (2024), https://doi.org/10.7731/KIFSE.7126e8ae.
crossref
5. C. T. Truong, T. H. Nguyen, V. Q. Vu, V. H. Do and D. T. Nguyen, “Enhancing Fire Detection Technology: A UV-Based System Utilizing Fourier Spectrum Analysis for Reliable and Accurate Fire Detection”, Applied Sciences, Vol. 13, No. 13, pp. 7845(2023), https://doi.org/10.3390/app13137845.
crossref
6. H. Bordbar, F. Alinejad, K. Conley, T. Ala-Nissila and S. Hostikka, “Flame Detection by Heat from the Infrared Spectrum: Optimization and Sensitivity Analysis”, Fire Safety Journal, Vol. 133, pp. 103673(2022), https://doi.org/10.1016/j.firesaf.2022.103673.
crossref
7. Y. J. Kim and W. T. Kim, “Uncertainty Assessment-Based Active Learning for Reliable Fire Detection Systems”, IEEE Access, Vol. 10, pp. 74722-74732 (2022), https://doi.org/10.1109/ACCESS.2022.3190852.
crossref
TOOLS
Share :
Facebook Twitter Linked In Google+ Line it
METRICS Graph View
  • 0 Crossref
  •    
  • 1,309 View
  • 13 Download
Related articles in Int J Fire Sci Eng.


ABOUT
BROWSE ARTICLES
EDITORIAL POLICY
AUTHOR INFORMATION
Editorial Office
Room 906, The Korea Science Technology Center The first building, 22, Teheran-ro 7 Gil, Gangnam-gu, Seoul, Republic of Korea
Tel: +82-2-555-2450/+82-2-555-2452    Fax: +82-2-3453-5855    E-mail: kifse@hanmail.net                

Copyright © 2026 by Korean Institute of Fire Science and Engineering.

Developed in M2PI

Close layer
prev next