Indoor Automated Fire Extinguisher System using Computer Vision

This paper presents the development of an automated fire extinguisher robot by employing fire recognition using computer vision. This project aims to develop a robot that can search, detect and extinguish small flames for indoor purposes. The robot is developed by applying open-source image processing to recognize the presence of fire. A control program was built to control the movement of the robot’s servo motor. The performance of the fire recognition was analysed in different light intensities and angles. The development of this project makes use of a camera and computer vision in place of various sensors, such as gas sensors, temperature sensors, and infrared sensors, to detect fires. Furthermore, a microprocessor is employed to operate the water pump and servo motor, which drive the nozzle to the position specified by the microcontroller. The results reveal that the proposed vision-based fire detection system has a high classification accuracy correspond to fire recognition.


Introduction
With the advancement of technology, responses to situations that may result in human death have become more prevalent.One of these unavoidable issues brought on by the world's expanding population is fires, which are also one of the most catastrophic.Consequently, the robot business is seeing tremendous growth [1,2].The most recent industrial revolution has led to an increase in the use of robotic technologies [2][3][4][5].Artificially intelligent or remotely controlled robots must have minimal supervision when interacting with humans.A robot is a mechanical device that can perform human tasks or act in a human-like manner.As robotics technology progresses, less human contact occurs, and more people rely on robots to live safely [6].
Many humanoid robots are used for a variety of tasks, such as education and entertainment, personal support and caregiving, search and rescue [7,8], healthcare and production and maintenance.Some tasks have been programmed by these robots more effectively than it is by humans, while others should be left to people rather than to machines.Some human professions will ultimately be replaced by more sophisticated robots, but not all.Only 25% of the unpredictable, human-dependent fields like construction and nursing can now be simplified by robots.Robots nevertheless require human programming [9].There are as many kinds of robots as there are different kinds of jobs [10].
As the human population has grown and technology has progressed, fire incidents and dangers have risen.Firefighting is a risky profession that results in frequent fatalities [11] that frequently results in fatalities.Robotics has emerged as a viable solution for environmental and human life protection.As a consequence, robots are being deployed to reduce human labour.
The protection of a person's home, workplace, factory, and other structures is crucial.We create a fire prevention robot employing sensors as part of a security system was presented [12].The security system should be able to identify abnormal and dangerous situations and alert us.A fire-fighting robot with an extinguisher for the intelligent structure was also introduced.Additionally, it was difficult for humans to identify minor burns caused by electrical equipment [13].As a result, the user was too late to put out the fire.When attempting to extinguish a fire, the user may expend additional time, such as searching for a water supply, and the action may be slower due to panic or anxiety.Small burnt regions and difficult-to-reach spots make it difficult to detect the fire [14].Fire extinguishing can sometimes be difficult in some situations, such as when the area is difficult to view.In this project, we will focus on the issue of automated fire extinguisher robots that can detect and extinguish fires using machine vision.Existing in-house applications use the smoke detection method, which does not cover a wide angle and detects smoke or a larger flame [15].The machine vision fire recognition technique is more efficient because it can cover a larger area than conventional extinguishers [16].
Figure 1 shows statistic of various types of fire outbreaks in Malaysia took from the Department of Statistic Malaysia.According to the figure, building-related fires are among the most common.Hence, the proposed automated fire extinguisher robot should be capable of encountering and detecting fire for indoor use.

Methodology
Figure 2 depicts the automated fire extinguisher robot in conjunction with the imaging processing system.Figure 3 shows the overall proposed working mechanism.The system is initialised, and the camera is in a standby mode while it observes the surroundings.If fire is detected, the angle will be determined based on the location of the detected fire.Following that, the angle will be calculated with respect to the virtual centreline and converted into a servo motor sweeping angle.The servo motor will then cause the nozzle to rotate to the desired angle.The pump will begin to work to put out the fire if it is still burning.
In this work, Logitech C922 business webcam imaging system is built in a suitable environment for image acquisition process.Logi Capture software has been chosen as the OpenCV software's camera imaging source.After the video is captured, it is processed for image processing using IDLE software.The video is first converted into a grayscale colour model, with just black and white and different shades of grey in between.Next, the video is segmented through thresholding by the value of 250.Since the binarized video contained some imperfections, fill hole morphological operation is selected to fill up the holes of the image.The fire is identified by calculating the area of the largest white blob extracted.
After obtaining the area of fire in white blob, the centre of fire is then calculated by using the formula of ( / 2) xw + .Thus, if the fire is detected, the angle of centre of fire will be calculated and send servo angle to Arduino in order to give command to servo motor for driving the nozzle.

Results
In this section, the performance of fire recognition based on the different resistance, colour of fire, and distance results are discussed.The value of resistance is determined by using the LDR sensor, the value will be displayed on the software real time video.The larger the value of resistance, the dimmer the brightness of environment.Figure 4 and 5 depict the performance of fire detection based on three different light intensities.As the figures show, the higher the resistance value, the lower the light intensity of the environment.Figures 4(a)-(c) depict fire detection in various light intensities based on LDR sensor resistance.Figure 5 shows that the fire for a resistance of 296Ω is difficult to recognise by the system when compared to a resistance of 680Ω.This is due to the fact that the lower the brightness of the environment, the easier it is for the system to detect the presence of fire.  Figure 6 depicts the performance of the fire recognition analysis based on the different distances between the camera and the fire as well as the different colours of fire (purple-blue, green, yellow, orange red, and orange yellow).Various chemical powders are used to change the colour of fire, such as copper chloride to produce green fire, potassium chloride to produce purple-blue fire, and so on.According to Figure 6, the colour purple blue, green, yellow, and orange-yellow are all 100% capable of being recognised by the system.While the orange-red could be recognised 7 out of 10 at 70 cm and 90 cm away from the camera, and 6 out of 10 at 110 cm away from the camera.So, aside from the colour orange red, the system can recognise all four fire colours.This is because the colour orange red is dimmer than other fire colours.

Conclusions and Future Recommendations
In conclusion, an automated fire detection system based on computer vision was established, and a hardware of fire extinguisher was presented.We applied C++ coding to make the Arduino system work and Python coding to make the IDLE system operate.A combination of Arduino and the IDLE programme is required to run an automated fire extinguisher robot.Thus, Arduino code is added in python IDLE in order to achieve the objectives.The hardware for the robot has been completed.C++ coding enabled the connection of a water pump and a servo motor.The electronic components are able to perform in good condition.The PVC pipe used in the stand's design was strong enough to support the overall weight.The servo motor holder design was created so that the servo motor could be installed in the holder.Finally, the theoretical test run and evaluation of the overall system performance is completed successfully through analysis.
In the future, the robot's software can be improved to recognise fire in both brighter and darker environments, allowing the robot to be used both indoors and outdoors.Not only the software, but the resolution of the camera, could be one of the factors influencing the stability of the performance for detecting fire.Consequently, the fire detection system can be upgraded in conjunction with software and hardware.Furthermore, the robot's software can be improved to calculate if it detects fire in both the y and x axes.In terms of hardware, the nozzle should be driven by a motor in two directions, namely the x and y axes.So that it can extinguish the fire even if it spreads to every corner of the area.

Figure 1 .
Figure 1.Statistic of fire breakout in Malaysia in type of building.

Figure 5 .
Figure 5.The size of fire vs. stability of fire recognition and resistance.

Figure 6 .
Figure 6.Colour of fire vs. performance of fire recognition in different distance.