A flame detection method and system based on monitoring video
By combining the YoloV4 model and motion feature extraction method in flame detection, comprehensively considering the color, shape and motion information of the flame, the problem of high error detection rate in the prior art is solved, and high precision and robust flame detection is achieved.
Patent Information
- Application Number
- CN202110934946.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-16
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2041-08-16
AI Technical Summary
The existing flame detection methods based on image processing and deep learning have the problem of high error detection rates, and cannot effectively distinguish between objects with similar colors, resulting in low detection accuracy.
The flame detection method based on surveillance video is adopted, combined with the YoloV4 model, and the motion detection, motion feature extraction and discrimination methods are integrated to consider the color, shape and motion information of the flame, and filter through background modeling and inter-frame information to improve the detection accuracy.
It significantly improves the accuracy of flame detection, reduces the false detection rate, ensures the accuracy and robustness of the candidate boxes, and avoids the impact of single-frame false detection or missed detection.
Smart Images

Figure CN113657250B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a flame detection method and system based on monitoring video, belonging to the technical field of video monitoring security. Background Art
[0002] In recent years, the losses caused by fires have become increasingly serious, and fire detection has received more and more attention. Traditional fire detection methods are mainly divided into two categories: the first category is based on sensors, which are usually deployed indoors and have low sensitivity. Only large fires or very close flames can be detected. The second category is based on image processing technology, which uses the color information of flames for identification. Its accuracy is not ideal and it is easy to identify some yellow objects as flames, resulting in false detection.
[0003] Sensors cannot be deployed in any place, but the deployment restrictions of surveillance videos are much fewer, and many existing surveillance cameras can be used directly to collect data. Therefore, this patent focuses on the flame detection method based on surveillance video information.
[0004] With the rapid development of neural networks in image recognition, it has become possible to accurately identify the objects to be identified in the image. However, flames have their own special properties. Their color information is obvious, but they have no fixed shape, that is, they lack effective shape information. Therefore, using only neural networks cannot accurately identify flames, and there is also a possibility of false detection of objects with similar colors.
[0005] Patent 1: "A flame recognition algorithm based on image processing technology", CN104504382B. This patent provides a traditional image processing method, which uses the internal and external flame extraction algorithm to find the highest point and center of gravity of the flame, and records the coordinates of the two points respectively; then a line is made between the two points and the RGB value on the line is extracted; at the same time, the RGB value on the line between the two points is compared with the standard flame RGB feature library, and a matching value is obtained by comparison, and then the size of the matching value is used to determine whether the image is a flame image. Patent 2: "Flame target detection method based on digital image and convolution features", CN110751089A. This patent is mainly based on the Faster RCNN VGG16 model for adjustment, and uses a pure deep learning method to detect flames. Summary of the invention
[0006] The disadvantages of the prior art are: Patent 1 relates to a flame recognition algorithm based on image processing technology. The main disadvantage of its design is that it only uses color features for matching, and cannot filter out some yellow objects well. These objects may be coats worn by pedestrians, helmets worn by takeaway staff, etc. This situation is very common, so its false detection rate cannot be guaranteed. Patent 2 relates to a flame target detection method based on digital images and convolution features. The main disadvantage of its design is the use of a pure deep learning network. Since flames do not have fixed shape features, the deep learning network can only learn their color features, so there is also a high false detection rate.
[0007] The purpose of the present invention is to overcome the technical defects of the prior art and solve the above technical problems. The present invention proposes a flame detection method and system based on monitoring video. The method is based on monitoring video and only requires a server that can run the method and access the video to complete the deployment. Based on the latest YoloV4 model of deep learning, the method integrates motion detection, motion feature extraction and discrimination methods, and comprehensively considers information such as flame color, shape, and motion, which significantly improves the accuracy of flame detection.
[0008] The present invention specifically adopts the following technical solution: a flame detection method based on monitoring video, comprising the following steps:
[0009] The moving object detection step specifically includes: inputting a set of continuous frame image sequences, detecting whether there is a moving object in each frame, and outputting the candidate frame result to the flame detector step;
[0010] The flame detector step specifically includes: receiving the candidate box result output by the flame detector step, and if there is a moving object, identifying the candidate area using a deep learning network;
[0011] The detection and matching step specifically includes: matching the area detected by the flame detector step with the area detected by the moving object detection step, and only the area that meets a certain intersection-and-union ratio is retained;
[0012] The motion feature filtering step specifically includes: the area retained after the detection and matching step is further screened using the motion features between frames, and the area finally determined is the flame area.
[0013] As a preferred embodiment, the moving object detection step specifically includes:
[0014] Step SS11: The continuous frames captured by the static camera are used to obtain the foreground image through the adaptive mixed Gaussian model MOG;
[0015] Step SS12: performing morphological operations on the acquired foreground images to reduce the number of foreground images;
[0016] Step SS13: using the digitized binary image topology analysis based on boundary tracking to obtain the minimum bounding rectangle of each foreground image;
[0017] Step SS14: Filter the candidate minimum bounding rectangle according to the non-maximum suppression algorithm to obtain a candidate box based on the background modeling method.
[0018] As a preferred embodiment, the flame detector step specifically includes:
[0019] Step SS21: scaling the input single frame image to a fixed size as input data of the detector;
[0020] Step SS22: Run the flame detection model to process the input data and obtain candidate boxes whose scores exceed the set threshold;
[0021] Step SS23: Filter the candidate areas according to the set candidate area ratio conditions to obtain the candidate area results of the flame detector.
[0022] As a preferred embodiment, the detection and matching step specifically includes:
[0023] Step SS31: traverse the candidate frames obtained in the flame detector step, and if the score exceeds the threshold, it is confirmed as a flame candidate frame and no subsequent filtering is required;
[0024] Step SS32: For the candidate boxes obtained in the flame detector step whose scores do not exceed the threshold, the intersection-over-union ratio (IOU) of each candidate box C and the candidate box G obtained by background modeling is calculated, and the calculation formula is as follows:
[0025]
[0026] If it exceeds the set threshold, the candidate box is considered legal and retained; otherwise, it is discarded.
[0027] As a preferred embodiment, the motion feature filtering step specifically includes:
[0028] Step SS41: Obtain the flame area determined by the previous n frames. If the current frame sequence is less than n, the flame area determined by the previous three frames is used as the final flame area.
[0029] Step SS42: Match the candidate frame of the current frame with the flame area of the previous n frames of data. If there is a candidate frame whose intersection-over-union ratio exceeds the threshold, the number of candidate frames detected in the current frame, num, is increased by 1, and the score of each candidate frame is calculated as follows:
[0030]
[0031] The candidate boxes whose scores exceed the set threshold are retained as the final flame area;
[0032] Step SS43: retain all determined flame frames of the current frame into the flame frame queue for comparison with subsequent frames.
[0033] The present invention also proposes a flame detection system based on monitoring video, comprising:
[0034] The moving object detection module is used to perform: input a set of continuous frame image sequences, detect whether there is a moving object in each frame, and output the candidate frame result to the flame detector module;
[0035] The flame detector module is used to perform: receiving the candidate box result output by the flame detector module, and if there is a moving object, identifying the candidate area using a deep learning network;
[0036] A detection and matching module, used to perform: matching the area detected by the flame detector module with the area detected by the moving object detection step, and only the area that meets a certain intersection-and-union ratio is retained;
[0037] The motion feature filtering module is used to perform: the area retained by the detection and matching module is further screened using the motion features between frames, and the final area is the flame area.
[0038] As a preferred embodiment, the moving object detection module specifically performs the following steps: obtaining a foreground image from continuous frames captured by a static camera through an adaptive mixed Gaussian model MOG; performing morphological operations on the obtained foreground images to reduce the number of foreground images; obtaining the minimum bounding rectangle of each foreground image using a digitized binary image topological structure analysis based on boundary tracking; filtering the candidate minimum bounding rectangles according to a non-maximum suppression algorithm to obtain a candidate frame obtained based on a background modeling method.
[0039] As a preferred embodiment, the flame detector module specifically performs: scaling the input single-frame image to a fixed size as the input data of the detector; running the flame detection model to process the input data to obtain candidate boxes whose scores exceed a set threshold; filtering the candidate areas according to the set candidate area ratio conditions to obtain the candidate area results of the flame detector.
[0040] As a preferred embodiment, the detection and matching module specifically performs: traversing the candidate boxes obtained in the flame detector step, if the score exceeds the threshold, confirming it as a flame candidate box, no subsequent filtering is required; for the candidate boxes obtained in the flame detector step whose scores do not exceed the threshold, calculating the intersection and union ratio IOU of each candidate box C and the candidate box G obtained by background modeling, the calculation formula is as follows:
[0041]
[0042] If it exceeds the set threshold, the candidate box is considered legal and retained; otherwise, it is discarded.
[0043] As a preferred embodiment, the motion feature filtering module specifically includes: obtaining the flame area determined by the previous n frames, and if the current frame sequence is less than n, taking the flame area determined by the previous three frames as the final flame area;
[0044] The candidate box of the current frame is matched with the flame area of the previous n frames. If there is a candidate box whose intersection-over-union ratio exceeds the threshold, the number of candidate boxes detected in the current frame is increased by 1, and the score of each candidate box is calculated as follows:
[0045]
[0046] The candidate boxes whose scores exceed the set threshold are retained as the final flame area;
[0047] All confirmed flame frames of the current frame are kept in the flame frame queue for comparison with subsequent frames.
[0048] The beneficial effects achieved by the present invention are as follows: First, the present invention proposes a flame detection method and system based on surveillance video. Based on the motion feature of the flame moving slowly, combined with the traditional motion object detection and deep learning methods, the surveillance video data is analyzed to provide a flame detection method and system with simple deployment and reliable accuracy. Second, the present invention determines the candidate frame by background modeling and deep learning methods, and screens the candidate frame using the inter-frame motion position information to finally determine the flame area. Third, the present invention mainly uses the color information of the flame for traditional flame detection and pure deep learning flame detection algorithms, which are very susceptible to interference from objects with similar colors. On the basis of deep learning, the present invention not only retains the color and shape characteristics, but also combines the video inter-frame information to filter the false detection existing in the existing methods. Fourth, the present invention uses a flame detector trained separately based on the YoloV4 model, which reaches the current optimal level in single-frame recognition, ensuring the missed detection of the candidate frame. Fifth, the present invention makes the detection more robust through the use of inter-frame information, and will not be directly affected by the false detection or missed detection of a single frame. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a flow chart of a preferred embodiment of a flame detection method based on monitoring video of the present invention.
[0050] Figure 2 This is a diagram of the neural network structure used in the flame detector module of the present invention. DETAILED DESCRIPTION
[0051] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0052] Embodiment 1: A flame detection method based on monitoring video of the present invention, Figure 1 This is the overall framework diagram of the method. Specifically, under a static camera, a sequence of N images is input. Step 1: The continuous frames captured under the dynamic camera are used to obtain the foreground image through an adaptive mixed Gaussian model (MOG); Step 2: The foreground is enlarged by a morphological closing operation, and the binary image obtained by MOG is mainly corroded to achieve the effect of enlarging the foreground target and clustering it; Step 3: All connected areas in the image are found on the binary image, and then the connected domain is fitted with an external rectangle to obtain the detection frame, and only rectangles with a certain area ratio are retained as flames detected by background modeling; Step 4: The current frame image is detected using a flame detector based on YoloV4 fine-tuned using flame data alone to obtain the candidate frames detected by the flame detector and the corresponding scores; Step 5: The candidate frames obtained by the flame detector are classified, and the candidate frames with a score exceeding 0.8 are directly judged as flames, and recorded in the queue of each frame of the flame frame for comparison with the frames to be identified in the following frames; For candidate frames whose scores do not exceed 0.8, further judgment is required; Step 6: The candidate frame C obtained by the flame detector that needs to be further judged is compared with the candidate frame G obtained by the background modeling, and the intersection-union ratio of the two is calculated. The calculation formula is as follows:
[0053]
[0054] If the intersection-over-union ratio exceeds 0.1, the detector candidate box is considered legal, otherwise it is discarded; the reason why a relatively low threshold of 0.1 is used here is that the actual motion area of the flame may account for a very small proportion, so a lower intersection-over-union ratio is required.
[0055] Step 7: For the candidate box C obtained in step 6, perform motion detection on the previous and next frames, obtain the flame box G recorded in the 20 frames before the current frame, and similarly calculate the intersection and union ratio of each box of C and G. If the intersection and union ratio exceeds 0.7, the count corresponding to the box is num+1, and the score of each box is calculated as follows:
[0056]
[0057] If the score exceeds the set threshold of 0.5, it is regarded as the final flame frame and added to the flame frame queue for comparison in subsequent frames.
[0058] Embodiment 2: The present invention also proposes a flame detection system based on monitoring video, comprising:
[0059] The moving object detection module is used to perform: input a set of continuous frame image sequences, detect whether there is a moving object in each frame, and output the candidate frame result to the flame detector module;
[0060] The flame detector module is used to perform: receiving the candidate box results output by the flame detector module, and if there is a moving object, using the deep learning network to identify the candidate area, such as Figure 2 As shown;
[0061] A detection and matching module, used to perform: matching the area detected by the flame detector module with the area detected by the moving object detection step, and only the area that meets a certain intersection-and-union ratio is retained;
[0062] The motion feature filtering module is used to perform: the area retained by the detection and matching module is further screened using the motion features between frames, and the final area is the flame area.
[0063] As a preferred embodiment, the moving object detection module specifically performs the following steps: obtaining a foreground image from continuous frames captured by a static camera through an adaptive mixed Gaussian model MOG; performing morphological operations on the obtained foreground images to reduce the number of foreground images; obtaining the minimum bounding rectangle of each foreground image using a digitized binary image topological structure analysis based on boundary tracking; filtering the candidate minimum bounding rectangles according to a non-maximum suppression algorithm to obtain a candidate frame obtained based on a background modeling method.
[0064] As a preferred embodiment, the flame detector module specifically performs: scaling the input single-frame image to a fixed size as the input data of the detector; running the flame detection model to process the input data to obtain candidate boxes whose scores exceed a set threshold; filtering the candidate areas according to the set candidate area ratio conditions to obtain the candidate area results of the flame detector.
[0065] As a preferred embodiment, the detection and matching module specifically performs: traversing the candidate frames obtained by the flame detector module, if the score exceeds the threshold, confirming it as a flame candidate frame, and no subsequent filtering is required; for the candidate frames obtained by the flame detector module whose scores do not exceed the threshold, calculating the intersection and union ratio of each candidate frame with the candidate frame obtained by background modeling, if it exceeds the set threshold, the candidate frame is considered legal and retained; otherwise, it is discarded.
[0066] As a preferred embodiment, the motion feature filtering module specifically includes: obtaining the flame area determined by the previous n frames, if the current frame sequence is less than n, then taking the flame area determined by the previous three frames as the final flame area; matching the candidate frame of the current frame with the flame area of the previous n frames of data, if there is a candidate frame whose intersection-over-union ratio exceeds a threshold, then adding 1 to the number num of candidate frames detected in the current frame, retaining the candidate frame whose detection ratio ratio exceeds the set threshold as the final flame area; retaining all the determined flame frames of the current frame in the flame frame queue for comparison with the following frames.
[0067] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A flame detection method based on monitoring video, characterized in that: The steps include: The moving object detection step specifically includes: inputting a set of continuous frame image sequences, detecting whether there is a moving object in each frame, using the digital binary image topology structure analysis based on boundary tracking to obtain the minimum bounding rectangle of each foreground image; filtering the candidate minimum bounding rectangle according to the non-maximum suppression algorithm to obtain the candidate frame based on the background modeling method, and outputting the candidate frame to the flame detector step; The flame detector step specifically includes: receiving the candidate frame output by the moving object detection step, and if there is a moving object, using a flame detector based on YoloV4 fine-tuned using flame data alone to detect the current frame image, and obtaining the candidate frame detected by the flame detector and the corresponding score; The detection and matching step specifically includes: matching the candidate frames detected by the flame detector step and the candidate frames detected by the moving object detection step, and only the candidate frames that meet a certain intersection-over-union ratio are retained; the detection and matching step specifically includes: step SS31: traversing the candidate frames obtained by the flame detector step, if the score exceeds the threshold, confirming that it is a flame candidate frame, no subsequent filtering is required, and directly recording it in the queue of each frame of the flame frame for comparison with the subsequent frames; step SS32: for the candidate frames obtained by the flame detector step whose scores do not exceed the threshold, calculating the intersection-over-union ratio IOU of each candidate frame C and the candidate frame G obtained by background modeling, the calculation formula is as follows: If it exceeds the set threshold, the candidate box is considered legal and retained; otherwise, it is discarded; The motion feature filtering step specifically includes: the candidate frame retained in step SS32 of the detection and matching step is further screened using the motion features between frames, and the candidate frame finally determined is the flame frame; the motion feature filtering step specifically includes: Step SS41: Obtain the flame frame determined by the previous n frames. If the current frame is less than n, the flame frame determined by the previous three frames is used as the final flame frame. Step SS42: Match the candidate frame of the current frame with the flame frame of the previous n frames of data. If there is a candidate frame whose intersection-over-union ratio exceeds the threshold, the number of candidate frames detected in the current frame, num, is increased by 1, and the score of each candidate frame is calculated as follows: The candidate boxes whose scores exceed the set threshold are retained as the final flame boxes; Step SS43: retain all determined flame frames of the current frame into the flame frame queue for comparison with subsequent frames.
2. A flame detection method based on monitoring video according to claim 1, characterized in that: The moving object detection step specifically includes: Step SS11: The continuous frames captured by the static camera are used to obtain the foreground image through the adaptive mixed Gaussian model MOG; Step SS12: performing morphological operations on the acquired foreground images to reduce the number of foreground images; Step SS13: using the digitized binary image topology analysis based on boundary tracking to obtain the minimum bounding rectangle of each foreground image; Step SS14: Filter the candidate minimum bounding rectangle according to the non-maximum suppression algorithm to obtain a candidate box based on the background modeling method.
3. A flame detection system based on surveillance video, characterized in that: include: The moving object detection module is used to perform: input a set of continuous frame image sequences, detect whether there is a moving object in each frame, and output a candidate frame to the flame detector module; The flame detector module is used to perform the following steps: receiving the candidate frame output by the moving object detection module, and if there is a moving object, detecting the current frame image using a flame detector based on YoloV4 fine-tuned using flame data alone, and obtaining the candidate frame detected by the flame detector and the corresponding score; The detection and matching module is used to perform: matching the candidate frames detected by the flame detector module with the candidate frames detected by the moving object detection module, and only the candidate frames that meet a certain intersection-and-union ratio are retained; the detection and matching module specifically performs: traversing the candidate frames obtained by the flame detector step, if the score exceeds the threshold, it is confirmed to be a flame candidate frame, and no subsequent filtering is required, and it is directly recorded in the queue of each frame of the flame frame for comparison with the subsequent frames; for the candidate frames obtained by the flame detector step whose scores do not exceed the threshold, the intersection-and-union ratio IOU of each candidate frame C and the candidate frame G obtained by background modeling is calculated, and the calculation formula is as follows: If it exceeds the set threshold, the candidate box is considered legal and retained; Otherwise, discard; The motion feature filtering module is used to perform: the candidate frames retained by the detection and matching module are further screened by using the motion features between frames, and the candidate frames finally determined are the flame frames; the motion feature filtering module specifically includes: obtaining the flame frames determined by the previous n frames, and if the current frame is less than n, the flame frames determined by the previous 3 frames are used as the final flame frame; The candidate frame of the current frame is matched with the flame frame of the previous n frames. If there is a candidate frame whose intersection-over-union ratio exceeds the threshold, the number of candidate frames detected in the current frame is increased by 1, and the score of each candidate frame is calculated as follows: The candidate boxes whose scores exceed the set threshold are retained as the final flame boxes; All confirmed flame frames of the current frame are kept in the flame frame queue for comparison with subsequent frames.
4. A flame detection system based on monitoring video according to claim 3, characterized in that: The moving object detection module specifically performs the following steps: obtaining a foreground image from continuous frames captured by a static camera through an adaptive mixed Gaussian model (MOG); performing morphological operations on the obtained foreground images to reduce the number of foreground images; obtaining the minimum bounding rectangle of each foreground image using a digitized binary image topological structure analysis based on boundary tracking; and filtering the candidate minimum bounding rectangles according to a non-maximum suppression algorithm to obtain a candidate frame obtained based on a background modeling method.
Citation Information
Patent Citations
A Flame Recognition Algorithm Based on Image Processing Technology
CN104504382B
Flame target detection method based on digital image and convolution features
CN110751089A
Flame detection method based on image target detection
CN108537215A
Real-time video field fire smoke detection method based on convolutional neural network
CN109147254A
Positioning method and system based on deep learning
CN109977945A
