Flame detection early warning method and system based on improved YOLOv5

By improving the YOLOv5 model and combining the multi-scale fusion module and the attention module, the problems of limited flame detection capability and high false alarm rate in the existing technology are solved, and more accurate and real-time flame detection warning and automatic fire extinguishing functions are achieved.

CN119360535APending Publication Date: 2025-01-24ANHUI POLYTECHNIC UNIV MECHANICAL & ELECTRICAL COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411348923.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The prior art has limited detection capabilities in flame detection, especially poor flame recognition capabilities for different combustion stages, and may have high false alarm rates or low detection rates when processing video streams in real time.

Method used

Using the flame detection and warning method based on improving YOLOV5, the YOLOV5 model is trained through multi -scale fusion modules and attention modules to enhance the model's recognition of different sizes and morphological flames, and a warning signal is issued through the alarm equipment to start the automatic fire extinguishing system.

Benefits of technology

Improve the accuracy and robustness of flame detection, reduce the misunderstanding rate, effectively identify the flames of different combustion stages, and achieve real -time fire warning and automatic fire extinguishing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119360535A_ABST
    Figure CN119360535A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of flame detection and early warning, in particular to a flame detection and early warning method and system based on improved YOLOv5, and the method comprises the steps: carrying out the preprocessing of first image data, and obtaining the processed second image data; inputting the second image data into a first YOLOv5 model, training the first YOLOv5 model through a multi-scale fusion module and an attention module based on the second image data to obtain a second YOLOv5 model meeting requirements, and performing flame detection through the second YOLOv5 model to obtain a flame detection result. When the flame is detected, the position and category information of the flame is output, a corresponding confidence score is provided, when the confidence score exceeds a set threshold value, an early warning signal is sent out through alarm equipment, and an automatic fire extinguishing system is started. According to the invention, the combustion stage of the flame can be identified according to the color, shape, size, flicker and other characteristics of the flame, and the false alarm rate can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of flame detection and early warning, and in particular to a flame detection and early warning method and system based on improved YOLOv5. Background Art

[0002] Fire is a high-incidence disaster. Its rapid spread and strong destructiveness require an effective monitoring and early warning system. With the popularization of video surveillance technology, automatic fire detection and early warning technology based on images and videos has important research significance and practical value.

[0003] The shortcomings of existing image and video technologies in flame detection generally include limited change detection capabilities: the color, shape, size, flicker and other characteristics of flames vary greatly, and existing technologies are difficult to cover all situations, especially the identification of flames at different combustion stages, as well as high false alarm rates or low detection rates that may occur when processing video streams in real time. Summary of the invention

[0004] In view of this, the purpose of the present invention is to propose a flame detection and early warning method and system based on improved YOLOv5 to solve the problems of limited detection capability and high false alarm rate in the prior art.

[0005] Based on the above purpose, the present invention provides a flame detection and early warning method based on improved YOLOv5, comprising:

[0006] Receiving first image data of flames of different colors, shapes, sizes, and flickering;

[0007] Preprocessing the first image data to obtain processed second image data;

[0008] Inputting the second image data into the first YOLOv5 model, training the first YOLOv5 model through a multi-scale fusion module and an attention module based on the second image data to obtain a trained first YOLOv5 model, evaluating the trained first YOLOv5 model, and selecting the trained first YOLOv5 model that meets the requirements as the second YOLOv5 model;

[0009] The second YOLOv5 model is used to detect flames. When a flame is detected, the flame location and category information are output and a corresponding confidence score is provided. The category information includes the flame combustion stage identified according to the color, shape, size, and flickering characteristics of the flame. When the confidence score exceeds the set threshold, a warning signal is issued through the alarm device and the automatic fire extinguishing system is started.

[0010] Optionally, the first image data of flames of different colors, shapes, sizes and flickering flames are acquired by collecting them through ground equipment and unmanned aerial vehicle equipment.

[0011] Optionally, the preprocessing of the first image data includes adjusting the image size and normalizing the image.

[0012] Optionally, the multi-scale fusion module includes pixel-level fusion and feature-level fusion.

[0013] Optionally, the pixel-level fusion is to perform feature fusion on the original pixel space of the second image data, extract features of multiple scales on the pixel space of the second image data through multiple convolution kernels of different sizes, and fuse them together.

[0014] Optionally, the feature-level fusion is to fuse flame feature maps of different scales in the feature extraction stage of the first YOLOv5 model, and merge the feature maps of different scales into a large feature map by splicing and weighted averaging.

[0015] Optionally, the attention module compresses the spatial information of each channel in the first YOLOv5 model into a single value through a global average pooling operation to obtain a global feature vector with channel statistical information, and then feeds the global feature vector into a network module through an excitation operation. The network module includes a fully connected layer and a nonlinear activation function. The importance of the features of each channel for flame detection is learned through the network module, and a weight coefficient of the features of each channel is output based on the importance. The features that have important contributions to flame detection are amplified through the weight coefficient, and the features that have unimportant contributions are suppressed. The weight coefficient is calculated by the following formula:

[0016]

[0017] Where X represents the input second image data, q represents the query vector used to calculate the correlation with the input second image data, N represents the number of channels used to extract features of the second image data, and x i represents the feature of the i-th channel, a i represents the attention weight of the i-th channel feature, where a i It is calculated by the following formula:

[0018]

[0019] Where p(z=i|X,q) represents the probability that the random feature z in the second image data is equal to the feature of the i-th channel given the input X and the query vector q;

[0020] s(x i ,q) represents the similarity function, which measures the feature x of the i-th channel iThe similarity between q and the query vector q, j represents the total number of channel features, and exp represents the exponential function used to calculate the exponential value of the similarity.

[0021] Based on the same invention, the present invention also provides a system for executing a flame detection early warning method based on improved YOLOv5, comprising:

[0022] Receiving module: used for receiving first image data of flames of different colors, shapes, sizes and flickering flames;

[0023] Preprocessing module: used for preprocessing the first image data to obtain processed second image data;

[0024] Training module: inputting the second image data into the first YOLOv5 model, training the first YOLOv5 model based on the second image data through a multi-scale fusion module and an attention module to obtain a trained first YOLOv5 model, evaluating the trained first YOLOv5 model, and selecting the trained first YOLOv5 model that meets the requirements as the second YOLOv5 model;

[0025] Detection and warning module: Flame detection is performed through the second YOLOv5 model. When a flame is detected, the location and category information of the flame is output and the corresponding confidence score is provided. The category information includes the flame combustion stage identified according to the color, shape, size, and flickering characteristics of the flame. When the confidence score exceeds the set threshold, a warning signal is issued through the alarm device and the automatic fire extinguishing system is started.

[0026] When performing flame detection and early warning by using this method, firstly, first image data of flames of different colors, shapes, sizes and flickering flames are received to improve the comprehensiveness of the data, then the first image data is preprocessed to obtain processed second image data, the second image data is input into the first YOLOv5 model, the first YOLOv5 model is trained through a multi-scale fusion module and an attention module based on the second image data to obtain a trained first YOLOv5 model, the trained first YOLOv5 model is evaluated, the trained first YOLOv5 model that meets the requirements is selected as the second YOLOv5 model, flame detection is performed through the second YOLOv5 model, when a flame is detected, the location and category information of the flame is output and a corresponding confidence score is provided, when the confidence score exceeds the set threshold, a warning signal is issued through the alarm device, and the automatic fire extinguishing system is started, and at the same time, the detection personnel can observe the flame location of each area in real time through the visualization large screen.

[0027] From the above, it can be seen that in this method, by receiving the first image data of flames of different colors, shapes, sizes and flickering, the first image data of the flames with various characteristics such as color, shape, size, flickering, etc. can be obtained, and then based on the processed data, the multi-scale fusion module is used for processing, so that the recognition ability of flame targets of different sizes can be improved. The attention module can be used to increase the attention to important features such as the color and shape of the flame, thereby improving the recognition ability of the flame, and the combustion stage of the flame can be identified according to the color, shape, size, flickering and other characteristics of the flame. At the same time, the related processing of the multi-scale fusion module and the attention module can reduce the false alarm rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only for the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0029] Figure 1 The figure is a flow chart of a flame detection and early warning method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.

[0031] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0032] like Figure 1 As shown, a flame detection and early warning method based on improved YOLOv5 includes:

[0033] S1: receiving first image data of flames of different colors, shapes, sizes and flickering flames;

[0034] S2: preprocessing the first image data to obtain processed second image data, wherein the optional preprocessing includes at least adjusting the image size and normalization processing, etc.;

[0035] S3: input the second image data into the first YOLOv5 model, train the first YOLOv5 model through the multi-scale fusion module and the attention module based on the second image data, obtain the trained first YOLOv5 model, evaluate the trained first YOLOv5 model, and select the trained first YOLOv5 model that meets the requirements as the second YOLOv5 model;

[0036] S4: Perform flame detection through the second YOLOv5 model. When a flame is detected, the location and category information of the flame is output and a corresponding confidence score is provided. The category information includes the flame combustion stage identified according to the color, shape, size, and flickering characteristics of the flame. When the confidence score exceeds the set threshold, a warning signal is issued through the alarm device, and the automatic fire extinguishing system is started.

[0037] When performing flame detection and early warning by using this method, firstly, first image data of flames of different colors, shapes, sizes and flickering flames are received to improve the comprehensiveness of the data, then the first image data is preprocessed to obtain processed second image data, the second image data is input into the first YOLOv5 model, the first YOLOv5 model is trained through a multi-scale fusion module and an attention module based on the second image data to obtain a trained first YOLOv5 model, the trained first YOLOv5 model is evaluated, the trained first YOLOv5 model that meets the requirements is selected as the second YOLOv5 model, flame detection is performed through the second YOLOv5 model, when a flame is detected, the location and category information of the flame is output and a corresponding confidence score is provided, when the confidence score exceeds the set threshold, a warning signal is issued through the alarm device, and the automatic fire extinguishing system is started, and at the same time, the detection personnel can observe the flame location of each area in real time through the visualization large screen.

[0038] From the above, it can be seen that in this method, by receiving the first image data of flames of different colors, shapes, sizes and flickering, the first image data of the flames with various characteristics such as color, shape, size, flickering, etc. can be obtained, and then based on the processed data, the multi-scale fusion module is used for processing, so that the recognition ability of flame targets of different sizes can be improved. The attention module can be used to increase the attention to important features such as the color and shape of the flame, thereby improving the recognition ability of the flame, and the combustion stage of the flame can be identified according to the color, shape, size, flickering and other characteristics of the flame. At the same time, the related processing of the multi-scale fusion module and the attention module can reduce the false alarm rate.

[0039] In some embodiments, the first image data of flames of different colors, shapes, sizes, and flickering flames are acquired by collecting the first image data of flames of different colors, shapes, sizes, and flickering flames through ground equipment and unmanned aerial vehicle equipment. The ground equipment and unmanned aerial vehicle equipment can collect image data from multiple angles and directions, thereby acquiring the first image data of flames of different colors, shapes, sizes, and flickering flames.

[0040] In some embodiments, the multi-scale fusion module includes pixel-level fusion and feature-level fusion.

[0041] Optionally, the pixel-level fusion is to perform feature fusion on the original pixel space of the second image data, extract features of multiple scales on the pixel space of the second image data through multiple convolution kernels of different sizes, and fuse them together.

[0042] Optionally, the feature-level fusion is to fuse the flame feature maps of different scales in the feature extraction stage of the first YOLOv5 model, and merge the feature maps of different scales into a large feature map by splicing and weighted averaging. In this way, richer information can be obtained and the detection capability of small-sized flame targets can be improved. In this way, the feature information of each scale can be fully utilized to improve the accuracy and robustness of flame detection.

[0043] In some embodiments, the attention module compresses the spatial information of each channel in the first YOLOv5 model into a single value through a global average pooling operation, obtains a global feature vector with channel statistical information, and then feeds the global feature vector to the network module through an Excitation operation. The network module includes a fully connected layer and a nonlinear activation function. The importance of the features of each channel for flame detection is learned through the network module, and the weight coefficient of the features of each channel is output based on the importance. The features that contribute significantly to flame detection are amplified through the weight coefficient, and the features that contribute less significantly are suppressed. This allows the model to focus more on the key information in the image, thereby improving the performance of flame detection. The weight coefficient is calculated by the following formula:

[0044]

[0045] Where X represents the input second image data, q represents the query vector used to calculate the correlation with the input second image data, N represents the number of channels used to extract features of the second image data, and x i represents the feature of the i-th channel, a i represents the attention weight of the i-th channel feature, where a i It is calculated by the following formula:

[0046]

[0047] Where p(z=i|X,q) represents the probability that the random feature z in the second image data is equal to the feature of the i-th channel given the input X and the query vector q;

[0048] s(x i ,q) represents the similarity function, which measures the feature x of the i-th channel i The similarity between q and the query vector q, j represents the total number of channel features, and exp represents the exponential function used to calculate the exponential value of the similarity.

[0049] Different weights are assigned according to the relevance of the input features and the query vector, helping the model focus on the most relevant information parts in the image.

[0050] In order to further implement the present invention, the present invention also provides a system for executing a flame detection early warning method based on an improved YOLOv5, comprising:

[0051] Receiving module: used for receiving first image data of flames of different colors, shapes, sizes and flickering flames;

[0052] Preprocessing module: used for preprocessing the first image data to obtain processed second image data;

[0053] Training module: inputting the second image data into the first YOLOv5 model, training the first YOLOv5 model based on the second image data through a multi-scale fusion module and an attention module to obtain a trained first YOLOv5 model, evaluating the trained first YOLOv5 model, and selecting the trained first YOLOv5 model that meets the requirements as the second YOLOv5 model;

[0054] Detection and warning module: Flame detection is performed through the second YOLOv5 model. When a flame is detected, the location and category information of the flame is output and the corresponding confidence score is provided. The category information includes the flame combustion stage identified according to the color, shape, size, and flickering characteristics of the flame. When the confidence score exceeds the set threshold, a warning signal is issued through the alarm device and the automatic fire extinguishing system is started.

[0055] In this system, by receiving first image data of flames of different colors, shapes, sizes and flickering, first image data of flames with various characteristics such as color, shape, size, flickering, etc. can be obtained. Then, based on the processed data, the multi-scale fusion module is used for processing, so that the recognition ability of flame targets of different sizes can be improved. The attention module can increase the attention to important characteristics such as the color and shape of the flame, thereby improving the recognition ability of the flame. The combustion stage of the flame can be identified according to the color, shape, size, flickering and other characteristics of the flame. At the same time, the related processing of the multi-scale fusion module and the attention module can reduce the false alarm rate.

[0056] In summary, the beneficial effects of the present invention include:

[0057] 1. Improved detection accuracy: By introducing attention mechanisms, such as the SE attention mechanism, the YOLOv5s-SE model has improved the mean average precision (mAP) by 6.9 percentage points compared to the original model. This shows that the attention mechanism can effectively improve the accuracy of the model in detecting small targets such as flames.

[0058] 2. Enhanced positioning accuracy: Through multi-scale feature fusion, the system can more accurately identify flames of different sizes and shapes, which can further improve the positioning accuracy of the model. In the YOLOv5s-SE model, this improvement has increased the mean average precision (mAP) value by another 1.6 percentage points, and overall increased by 8.5 percentage points compared to the original model.

[0059] 3. Real-time: The improved YOLOv5 model can achieve real-time flame detection, which is crucial for early detection and warning of fires, and can promptly notify relevant personnel to take measures.

[0060] 4. Adaptability: Due to the diversity of training data, the improved system can adapt to different environments and lighting conditions, which enhances the generalization ability of the model and enables it to work effectively in a variety of scenarios.

[0061] 5. Degree of automation: The system can automatically perform functions such as detection and early warning, reducing dependence on manual monitoring and improving the efficiency of fire early warning.

[0062] It should be understood by those skilled in the art that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present invention (including the claims) is limited to these examples. Within the scope of the present invention, the technical features in the above embodiments or in different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the above aspects of the present invention, which are not provided in detail for the sake of simplicity.

[0063] The present invention is intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A flame detection and early warning method based on improved YOLOv5, characterized in that: include: Receiving first image data of flames of different colors, shapes, sizes, and flickering; Preprocessing the first image data to obtain processed second image data; Inputting the second image data into the first YOLOv5 model, training the first YOLOv5 model through a multi-scale fusion module and an attention module based on the second image data to obtain a trained first YOLOv5 model, evaluating the trained first YOLOv5 model, and selecting the trained first YOLOv5 model that meets the requirements as the second YOLOv5 model; The second YOLOv5 model is used to detect flames. When a flame is detected, the flame location and category information are output and a corresponding confidence score is provided. The category information includes the flame combustion stage identified according to the color, shape, size, and flickering characteristics of the flame. When the confidence score exceeds the set threshold, a warning signal is issued through the alarm device and the automatic fire extinguishing system is started.

2. A flame detection early warning method based on improved YOLOv5 according to claim 1, characterized in that: The first image data of flames of different colors, shapes, sizes and flickering flames are acquired through collection by ground equipment and unmanned aerial vehicle equipment.

3. A flame detection early warning method based on improved YOLOv5 according to claim 1, characterized in that: The preprocessing of the first image data includes adjusting the image size and normalizing the image.

4. A flame detection early warning method based on improved YOLOv5 according to claim 1, characterized in that: The multi-scale fusion module includes pixel-level fusion and feature-level fusion.

5. A flame detection and early warning method based on improved YOLOv5 according to claim 4, characterized in that: The pixel-level fusion is to perform feature fusion on the original pixel space of the second image data, extract features of multiple scales on the pixel space of the second image data through multiple convolution kernels of different sizes, and fuse them together.

6. A flame detection and early warning method based on improved YOLOv5 according to claim 4, characterized in that: The feature-level fusion is to fuse the flame feature maps of different scales in the feature extraction stage of the first YOLOv5 model, and merge the feature maps of different scales into a large feature map by splicing and weighted averaging.

7. A flame detection and early warning method based on improved YOLOv5 according to claim 1, characterized in that: The attention module compresses the spatial information of each channel in the first YOLOv5 model into a single value through a global average pooling operation, obtains a global feature vector with channel statistical information, and then feeds the global feature vector into the network module through an excitation operation. The network module includes a fully connected layer and a nonlinear activation function. The importance of the features of each channel for flame detection is learned through the network module, and the weight coefficient of the features of each channel is output based on the importance. The features that have important contributions to flame detection are amplified through the weight coefficient, and the features that have unimportant contributions are suppressed. The weight coefficient is calculated by the following formula: Where X represents the input second image data, q represents the query vector used to calculate the correlation with the input second image data, N represents the number of channels used to extract features of the second image data, and x i represents the feature of the i-th channel, a i represents the attention weight of the i-th channel feature, where a i It is calculated by the following formula: Where p(z=i|X,q) represents the probability that the random feature z in the second image data is equal to the feature of the i-th channel given the input X and the query vector q; s(x i ,q) represents the similarity function, which measures the feature x of the i-th channel i The similarity between q and the query vector q, j represents the total number of channel features, and exp represents the exponential function used to calculate the exponential value of the similarity.

8. A system for executing a flame detection and early warning method based on improved YOLOv5 as described in any one of claims 1 to 7, characterized in that: include: Receiving module: used for receiving first image data of flames of different colors, shapes, sizes and flickering flames; Preprocessing module: used for preprocessing the first image data to obtain processed second image data; Training module: inputting the second image data into the first YOLOv5 model, training the first YOLOv5 model based on the second image data through a multi-scale fusion module and an attention module to obtain a trained first YOLOv5 model, evaluating the trained first YOLOv5 model, and selecting the trained first YOLOv5 model that meets the requirements as the second YOLOv5 model; Detection and warning module: Flame detection is performed through the second YOLOv5 model. When a flame is detected, the location and category information of the flame is output and the corresponding confidence score is provided. The category information includes the flame combustion stage identified according to the color, shape, size, and flickering characteristics of the flame. When the confidence score exceeds the set threshold, a warning signal is issued through the alarm device and the automatic fire extinguishing system is started.