Real-Time Fire Hazard Monitoring with Deep Learning
Real-Time Fire Hazard Monitoring with Deep Learning
Abstract: Fire outbreaks pose a significant threat to lives and property, making early detection crucial for minimizing
damage. Traditional fire detection methods often rely on manual monitoring or conventional image analysis techniques,
which can lead to delayed detection and lower accuracy. To address these challenges, this project implements an AI-powered
fire detection system using the yolo8 object detection model. The model has been trained on a dataset of 2,509 images, with
1,004 used for training, 754 for validation, and 751 for testing. The system processes video input in real time, detecting fire
and marking affected areas with a bounding box and confidence score. Detection details, including the timestamp, fire status,
and confidence level, are logged in a CSV file for record-keeping. Additionally, an automated alert system is integrated using
Twilio’s SMS service, which immediately notifies designated authorities upon fire detection. The model achieves a mean
Average Precision (mAP) of 91.3%, a precision of 90.3%, and a recall of 86.9%, demonstrating high reliability in identifying
fire incidents. With its ability to detect fire efficiently and provide real-time alerts, this system offers a scalable and effective
solution for fire monitoring and prevention.
Keywords: Computer Vision, Fire Detection, Image Processing, Twilio SMS Notification, Bounding Boxes Detection, Deep
Learning.
How to Cite: Sai Nivedha N.; Dhamotharan R. (2025). Real-Time Fire Hazard Monitoring with Deep Learning. International
Journal of Innovative Science and Research Technology, 10(2), 2060-2069. https://doi.org/10.38124/ijisrt/25feb1629.
The trained model, best.pt, detects fire in real-time by a confidence score above 0.5, it is considered a valid
drawing bounding boxes around affected areas with detection.
confidence scores. The final model achieves a mean Average
Precision (mAP) of 91.3%, a precision of 90.3%, and a recall After detecting fire, the system logs detection details
of 86.9%, ensuring efficient and accurate fire detection such as timestamp, fire status, and confidence score into a
suitable for real-time monitoring applications. CSV file for documentation. To enhance interpretability, a
bounding box is drawn around the detected fire region in the
III. YOLO v8 ALGORITHM video frame.
The process begins with preprocessing the input data, Additionally, an automated alert system is integrated
where each video frame undergoes auto orientation using Twilio’s SMS service. When fire is detected for the
correction to ensure proper alignment. Additionally, the first time, the system sends an SMS alert to designated
frames are resized to 640x640 pixels, maintaining a authorities, ensuring a quick response. To prevent redundant
consistent input size for the model, which helps in improving alerts, the system ensures that an SMS is sent only once per
detection accuracy and computational efficiency. fire detection event.
Once the frames are pre-processed, the YOLOv8 model The system operates in real-time, continuously
(best.pt) is loaded. Each video frame is passed through the analysing video frames until the video ends or a specified
model, which applies convolutional layers to extract features time limit is reached. Finally, the system releases the video
and uses bounding box regression to locate potential fire stream and closes all windows, completing the fire detection
regions. The model then classifies the detected objects and process. The inclusion of pre-processing techniques such as
assigns a confidence score. If the fire class is identified with auto-orientation correction and resizing further enhances
detection reliability and model performance.
IV. TRAINING ALGORITHM / METHODOLOGY map is created, and the YOLOv8 model is configured with
appropriate parameters. The model is then trained, and key
This section outlines the methodology for detecting and metrics like loss and accuracy are monitored. After training,
localizing fire zones using the YOLOv8 model. The system the testing phase involves adjusting parameters and feeding
is designed to automatically identify fire patterns in an image test images into the model for prediction. The system
and accurately determine their location. The process begins analyses the images, detects fire zones, and generates
with collecting data from various sources, followed by bounding boxes around the identified areas. This structured
preprocessing steps such as resizing and annotation. Once approach ensures reliable detection, making it suitable for
the data is prepared, the training phase begins, where a label real-time fire monitoring applications.
A. Image Acquisition diverse scenarios such as day and night fires, aerial views,
Image acquisition is a crucial step in developing an fixed-shot fires, surface fires, trunk fires, and canopy fires.
effective fire detection system. For this study, a total of 2,509 The collected images ensure a comprehensive representation
images were collected from various online sources, of different fire conditions, enhancing the robustness of the
including crime and emergency response websites, which detection model.
provide real-world fire incident images. The dataset includes
To maintain a balanced and structured dataset, the best.pt, was selected for further evaluation. This structured
images were divided into 1,004 for training, 754 for dataset and well-defined training process ensure high
validation, and 751 for testing. The YOLOv8 model was accuracy in detecting fire in real-time applications.
trained using this dataset, and the best-performing model,
Image Labelling or Annotating Once the labelling process was completed, the dataset
Roboflow labelling software was used to select the underwent a structured data preprocessing workflow. The
appropriately scaled images. The fire regions in the dataset images were divided into three sets: 40% for training, 30%
were annotated using the bounding box tool and polygon for testing, and 30% for validation, ensuring a balanced
tool, ensuring precise labelling. The annotations were distribution for model development. After pre-processing,
automatically saved, and the export option generated a TXT the dataset was prepared for further data processing steps to
file containing detailed information about the marked fire enhance model performance and accuracy.
regions.
Fig 5: Flowchart for (a) Labelling the Resized Image Data and (b) Data Pre-Processing Steps
To prevent overfitting, an early stopping mechanism measure of computational complexity, indicating the number
was applied, halting training if no improvement was seen for of computations performed by a model. FPS stands for
50 consecutive epochs. The pre-trained YOLOv8 model frames per second, representing the rate at which frames are
helped in faster convergence. transmitted.
Performance evaluation using mAP@50 showed a The YOLOv8 model was evaluated for fire detection
steady increase, indicating better fire detection accuracy. The using Google Colab GPU. The model consists of 129 layers,
box loss, class loss, and object loss graphs showed a 11,135,987 parameters, and 11,135,971 gradients, with a
significant decline, confirming effective learning. GFLOP value of 28.6, ensuring efficient computation.
B. Analysis of Results
The results indicate a steady improvement in precision,
recall, and mean Average Precision (mAP) over training
epochs. The precision and recall curves show an upward
trend, suggesting that the model's ability to correctly detect
fire and smoke has improved. The loss plots for training and
True positive (TP) signifies accurate classification of a validation exhibit a consistent decline, which indicates
sample as positive, while false positive (FP) denotes effective learning and reduced error over time. The final
incorrect classification of a sample as positive. False mAP@50 score is high, reflecting strong object detection
negative (FN) signifies the misclassification of a sample as performance. However, the mAP@50-95 value is lower,
negative. 'n' represents the count of categories. FLOPs are a implying that performance varies across different thresholds.
D. Real Time Fire Detection Upon detection, the system sends an alert message to a
The real-time fire detection system processes incoming designated person, ensuring quick response. Additionally, a
images and detects fire with a confidence score using deep log entry is created, recording the timestamp of the fire event
learning techniques. It identifies fire regions by drawing along with the confidence score, providing a record for
bounding boxes around them and assigns a confidence value. future analysis and verification.
REFERENCES