Electric vehicles in the charging process of the charging battery failure,prone to spontaneous combustion explosion caused by fire Fast and accurate fire detection technology can effectively reduce the harm caused by fire.This paper firstly designs a lightweight fire detection network based on YOLOv5-Lite model,secondly proposes a small flame target detection network based on improved YOLOv5-Lite model to improve the accuracy of small flame recognition,and finally designs a vision-based fire target tracking system combined with vision closed-loop PID control algorithm to provide fire warning and target tracking for fire water cannons and other equipment.The system provides fire warning and target tracking functions for the fire water cannon and other equipment.The main research contents and results are as follows:The YOLOv5-Lite target detection model is used as the lightweight solution for the system.Traditional embedded devices generally have small memory and limited computing resources,making it difficult to run complex target detection models smoothly.In order to accelerate the detection speed of the model in embedded devices,reduce the size of the model,and facilitate the implementation of subsequent fire target tracking functions,the YOLOv5-Lite model makes the following lightweight improvements based on the YOLOv5 s neural network model: using the Shuffle Net V2 network structure as the backbone network;removing the Focus layer to avoid multiple slicing operations;removing the 1024 convolutional layers and 7×7 pooling layers from the Shuffle Net V2 structure;pruning operations were performed on the neck network.It is experimentally verified that the average flame detection accuracy of the YOLOv5-Lite model decreases by 4% compared with the YOLOv5 s model,the detection speed of the image in embedded devices improves from 494ms/frame to 96ms/frame,and the model size decreases from15.3MB to 3.4MB.Enhance the detection effect of the model for small flame targets.Considering the situation that the fire target location is far from the camera and the fire target only occupies a small part of the camera field of view,it is difficult for the fire detection model to detect the small flame target quickly and accurately.To enhance the detection effect of the model on small flame targets,the following improvements are made to the YOLOv5-Lite model: a coordinated attention mechanism is added to the backbone network of the model,and the EIo U loss is introduced as the localization loss function of the model.It is experimentally verified that in the small flame dataset,the improved YOLOv5-Lite model improves the average flame detection accuracy from 66.14% to 69.7%,and the detection speed decreases from 96ms/frame to 102ms/frame compared to before the improvement,and the model size is basically unchanged.Finally,a Raspberry Pi 4B-based target tracking system for electric car parking fires was built.The fire detection method based on the improved YOLOv5-Lite model is used to obtain the position information of the fire target,and the visual PID controller controls the camera rotation to make the center position of the fire target mass coincide with the center area of the camera field of view to realize the fire target tracking function.The system test verifies that the detection speed of the system reaches 10 frames/s.When the fire target is between 5m and 10 m away from the system,the system can transfer the fire target from the edge position of the field of view to the center region of the field of view in 5s time to complete the tracking of the fire target. |