Flame identification method based on deep learning
Through the flame recognition method based on deep learning, combined with temperature data and image analysis, the problem of infrared sensors being allergic to temperature is solved, and accurate and efficient flame recognition is achieved.
Patent Information
- Application Number
- CN202410869983.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-10-01
AI Technical Summary
In the existing technology, infrared sensors are allergic to temperature, resulting in low flame recognition accuracy, high false alarm rate, and inability to effectively distinguish between flames and other non-flame sources with elevated temperatures.
The flame recognition method based on deep learning is used to capture video images and temperature data through smart cameras, calculate the characteristics of the temperature distribution shape, compare it with the preset ignition point threshold and flame recognition depth model, issue an alarm, and correct the depth model through feedback. Probability matrix to improve recognition accuracy.
It achieves accurate flame identification, reduces false alarms and false negatives, and improves the accuracy and efficiency of flame identification.
Smart Images

Figure CN118736491A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of flame recognition learning, and more specifically, to a flame recognition method based on deep learning. Background Art
[0002] The traditional image-based smart camera method is to find a flame-like shape, take the center point of the shape and N eigenvalues to find the square root error for fitting, and the square root error of the training flame-like shape is relatively large. If too many flame shapes are identified, many objects of the same shape will be identified as flames, and the false alarm rate will be high, so the recognition rate has always been low;
[0003] In the prior art, a flame recognition method for a dual-infrared channel flame detector with a Chinese invention patent publication number of "CN106097630A" is disclosed. The method calculates the infrared correlation coefficient ρab of the flame data Chc(i) and the reference data Chb(i) after Fourier transformation, and the visible light correlation coefficient ρac of the flame data Chc(i) and the illuminance data Chc(i) after Fourier transformation. The higher the correlation coefficient, the more likely it is an interference signal, so as to filter out the interference of light sources such as light and sunlight and improve the anti-interference ability. However, in the above method, an infrared sensor is used to collect the regional temperature, and the infrared sensor is very sensitive to temperature, but not all temperature increases are flames. For example, a cup of boiling water, a piece of red-hot iron, strong sunlight, etc., it is impossible to judge whether it is a flame, resulting in errors in the accuracy of flame recognition and low recognition accuracy. Summary of the invention
[0004] In order to solve the problem that the infrared sensor proposed in the above background technology is very sensitive to temperature, has errors in flame recognition accuracy, and has low recognition accuracy, the present invention provides a flame recognition method based on deep learning.
[0005] The flame recognition method based on deep learning provided by the present invention adopts the following technical solution:
[0006] A flame recognition method based on deep learning comprises the following steps:
[0007] Step 1: The smart camera captures the video and simultaneously collects the temperature data of the shooting area;
[0008] Step 2: After receiving the image and temperature data, conduct a comprehensive analysis of the two, use the infrared matrix formula to calculate the temperature distribution of the area, and correspond the temperature distribution to the space of the image data;
[0009] Step 3: Compare the regional temperature with the preset ignition point threshold. When the temperature in the region reaches the ignition point threshold, compare the characteristics of the temperature distribution shape in all regional images with the deep model of flame recognition. If the characteristics of the temperature distribution shape in all regional images are calculated according to the deep model, and the conclusion is that the similarity of the sudden ignition point shape characteristics is 80%, an alarm is issued;
[0010] Step 4: Use the features of the identified temperature distribution shape as correction data to provide feedback to the deep model of flame recognition, which is used to subsequently correct the probability matrix of each layer in the deep model of flame recognition to complete the feedback correction.
[0011] By adopting the above technical solution, when the temperature in the area reaches the ignition threshold, the characteristics of the temperature distribution shape also reach 80% similarity with the deep model of flame recognition, thereby achieving accurate recognition of the flame. At the same time, by providing feedback to the deep model of flame recognition, the probability matrix of each layer in the deep model of flame recognition is corrected, thereby improving the flame recognition effect of the deep model of flame recognition.
[0012] Preferably, in step 2, the monitored area transmitted by the camera is divided into several areas, each area corresponds to the infrared matrix one by one, and the infrared matrix is summed;
[0013] In step 3, when the total temperature value is greater than the preset ignition point threshold, or the temperature value of any detection point in the area is greater than the corresponding threshold, an alarm is directly issued:
[0014]
[0015] Q: represents the total temperature value, which is the sum of the temperatures of all detection points in the area;
[0016] a i : represents the temperature value of a single detection point;
[0017] N: is the total number of detection points in the area.
[0018] Preferably, in step 4, the characteristics of the identified temperature distribution shape are summed up in variance, and according to the summation result, the deep model parameters of flame recognition are adjusted, the probability matrix is corrected, and the neural network is updated by the gradient descent optimization strategy.
[0019] By adopting the above technical solution, by continuously accumulating and analyzing the variance information of the identified flame features and adjusting the deep model of flame recognition accordingly, the error of the model in identifying the characteristics of the temperature distribution shape can be gradually reduced, thereby improving the overall accuracy of flame recognition.
[0020] Preferably, the difference summation formula is:
[0021] σ 2 =∑(xi-μ) 2 / N;
[0022] σ 2 Used to represent the sum of variances, xi represents the i-th observation of the population, μ represents the mean of the population, and N represents the number of observations of the population.
[0023] Preferably, the probability matrix formula in step 4 is:
[0024]
[0025] X1: probability value of the deep model for flame recognition; Y1: newly added probability value of the deep model for flame recognition.
[0026] By adopting the above technical solution and adjusting the probability matrix, the model can learn the subtle differences between flame features and non-flame features, thereby reducing false positives and negatives and improving the accuracy of flame recognition.
[0027] Preferably, the training method of the deep model of flame recognition in step 4 is:
[0028] (1) The labeling information includes the center coordinates (x, y), relative width (w) and relative height (h) of the rectangular box. All coordinate values are normalized. After labeling is completed, the label information is stored in the labels folder.
[0029] (2) Create a fire.yaml configuration file in the data directory. In the fire.yaml configuration file, modify the number of deep models for flame recognition in the models / yolov5s.yaml file to at least 1;
[0030] (3) Modify the parameters of learning rate, number of iterations, and batch size in the train.py file, and modify the graphics preprocessing method in the test.py file;
[0031] (4) After completing the parameter adjustment, execute the train.py script to start the training process. This process will train at least one deep model for flame recognition based on the previously prepared flame image dataset.
[0032] By adopting the above technical solution, it is possible to establish a deep learning model specifically for flames, and it is also ensured that the model can be optimized according to specific training data, thereby improving the accuracy and efficiency of flame recognition.
[0033] Preferably, in step 3, in extracting the features of the temperature distribution shape in the regional image, it is necessary to pre-process the regional image, and remove the noise on the image by median filtering, and the specific method is: let S(z, y) represent the mask window corresponding to the central pixel point (x, y) during filtering, let Z1 be the minimum grayscale value in S(x, y), Z2 be the maximum grayscale value in S(x, y), Z3 be the median grayscale value in S(z, Y), Z(z, Y) be the grayscale at the coordinate (z, y), S be the maximum size allowed by S(x, y), and the two levels at which the adaptive median filter algorithm works are defined as layer A and layer B; wherein the calculation method of the grayscale median Z3 combines the mean idea, and the median obtained by sorting is weighted with the mean of all pixels in the window to obtain the grayscale median, the weight of the median is 0.3, and the weight of the mean is 0.7;
[0034] A layer: ZA1 = Zmed-ZminZA2 = Zmax-Zmed When ZA1>T (T is the threshold) and ZA2>T, go to B layer, otherwise, increase the window size; if the window size is less than, repeat A layer; otherwise, output Z(x, y);
[0035] B layer: ZB1 = Z(x, y)-Zmin, ZB2 = Zmax-Z(x, y), when ZR1>T, ZB2>T, then output Z(x, y); otherwise output ZmedA layer is used to determine whether it is a pulse, and B layer is used to determine whether Z(x, y) is a pulse; when neither A layer nor B layer is, the algorithm uses an unchanged pixel value Z(x, y) to replace the median as the output to avoid unnecessary loss of details, and then sets a threshold according to the temperature, divides the image into different areas, uses the K-means algorithm to identify areas with similar temperature characteristics, and then uses the Canny edge detection method to find areas with large temperature gradients, calculates the shape characteristics of the area, and obtains the characteristics of the temperature distribution shape.
[0036] Preferably, the electronic device used in the flame recognition method based on deep learning includes: at least one central processing unit, an intelligent camera electrically connected to the at least one central processing unit, an infrared detector for detecting the temperature in an area is installed inside the intelligent camera, and each area corresponds to at least one infrared detector, and a memory electrically connected to the at least one central processing unit; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one central processing unit, a network connector electrically connected to the at least one central processing unit, and the network connector is connected to the cloud storing the flame model via a wireless network, and the at least one processor is capable of executing the flame recognition method.
[0037] In summary, the present invention includes the following beneficial technical effects:
[0038] 1. Compare the regional temperature with the preset ignition threshold. When the temperature in the area reaches the ignition threshold, compare the temperature distribution shape features in the flame features in the regional image with the deep model of flame recognition. When the similarity between the temperature distribution shape features and the deep model of flame recognition reaches ≥80%, an alarm is issued, thereby improving the accurate recognition of flames indoors or outdoors.
[0039] 2. The present invention uses a central processing unit to perform variance summation on the features of the identified temperature distribution shape, and then adjusts the deep model parameters of flame recognition and corrects the probability matrix based on the variance summation result. This process may involve a back propagation algorithm, and the weights and biases of the neural network are updated through optimization strategies such as gradient descent, thereby achieving feedback on the deep model of flame recognition, correcting the probability matrix of each layer in the deep model of flame recognition, improving the accuracy of flame recognition, and achieving the effect of providing accurate recognition of flame images. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a schematic diagram of the structure of the content of the identification flow chart in an embodiment of the present invention;
[0041] Figure 2 is a schematic diagram of the flame depth model structure simulated and trained in an embodiment of the present invention;
[0042] Figure 3 It is a schematic diagram of the thermal map structure of the flame depth model simulated and trained in an embodiment of the present invention. DETAILED DESCRIPTION
[0043] It should be noted that the drawings are schematic and not to scale. For the sake of clarity and convenience, the relative sizes and proportions of the parts shown in the drawings are exaggerated or reduced in size, and any size is only illustrative and not restrictive. In addition, the same reference symbol is used for the same structure, element or accessory appearing in more than two figures to reflect similar features.
[0044] The embodiment of the present invention discloses a flame recognition method based on deep learning. Figure 1-3 The embodiment of the present invention discloses a flame recognition method based on deep learning, comprising the following steps:
[0045] Step 1: The smart camera captures the video and collects the temperature data of the shooting area simultaneously. At the same time, the monitored area transmitted by the camera is divided into several areas. Each area corresponds to the infrared matrix one by one, and the infrared matrix is summed at the same time;
[0046] In step 3, when the total temperature value is greater than the preset ignition point threshold, or the temperature value of any detection point in the area is greater than the corresponding threshold, an alarm is directly issued:
[0047]
[0048] Q: represents the total temperature value, which is the sum of the temperatures of all detection points in the area;
[0049] a i : represents the temperature value of a single detection point;
[0050] n is the total number of detection points in the area:
[0051] Step 2: After receiving the image and temperature data, conduct a comprehensive analysis of the two, use the infrared matrix formula to calculate the temperature distribution of the area, and correspond the temperature distribution to the space of the image data;
[0052] Step 3: Compare the regional temperature with the preset ignition threshold. When the temperature in the region reaches the ignition threshold, pre-process the image in the receiving region and remove the noise on the image by median filtering. The specific method is as follows: let S(z, y) represent the mask window corresponding to the central pixel (x, y) during filtering, let Z1 be the minimum grayscale value in S(x, y), Z2 be the maximum grayscale value in S(x, y), Z3 be the median grayscale value in S(z, Y), Z(z, Y) be the grayscale at the coordinate (z, y), S be the maximum size allowed by S(x, y), and the two levels at which the adaptive median filter algorithm works are defined as layer A and layer B; the calculation method of the grayscale median Z3 combines the mean idea, and the median obtained by sorting is weighted with the mean of all pixels in the window to obtain the grayscale median, the weight of the median is 0.3, and the weight of the mean is 0.7;
[0053] A layer: ZA1 = Zmed-ZminZA2 = Zmax-Zmed When ZA1>T (T is the threshold) and ZA2>T, go to B layer, otherwise, increase the window size; if the window size is less than, repeat A layer; otherwise, output Z(x, y);
[0054] B layer: ZB1 = Z(x, y)-Zmin, ZB2 = Zmax-Z(x, y), when ZR1>T, ZB2>T, then output Z(x, y); otherwise output ZmedA layer is used to determine whether it is a pulse, and B layer is used to determine whether Z(x, y) is a pulse; when neither A layer nor B layer is, the algorithm uses an unchanged pixel value Z(x, y) to replace the field median as the output to avoid unnecessary detail loss and improve the quality of the picture; then set the threshold according to the temperature, divide the image into different areas, use the K-means algorithm to identify areas with similar temperature characteristics, and then use the Canny edge detection method to find the area with a large temperature gradient, calculate the shape characteristics of the area, and obtain the characteristics of the temperature distribution shape, thereby improving the accuracy of the characteristics of the temperature distribution shape;
[0055] Compare the features of the temperature distribution shape in all areas of the screen with the deep model of flame recognition. If the features of the temperature distribution shape in all areas of the screen are calculated according to the deep model and the conclusion is that the similarity of the shape features of the sudden ignition point is ≥80%, an alarm is issued;
[0056] Step 4: The characteristics of the identified temperature distribution shape are summed through the variance formula:
[0057] σ 2 =∑(xi-μ) 2 / N;
[0058] σ 2 : used to represent the sum of variances, xi: represents the i-th observation value of the population, μ: represents the mean of the population, N: represents the number of observations of the population. The calculated results provide data support for adjusting the flame recognition model. When the sum of variances is greater than the set value, the probability of each ratio in the deep model of flame recognition is adjusted under manual intervention;
[0059] Adjust the parameters of the deep model of flame recognition, correct the probability matrix, and update the neural network through the optimization strategy of gradient descent to continuously accumulate and analyze the variance information of the characteristics of the identified temperature distribution shape, and adjust the deep model of flame recognition accordingly, which can gradually reduce the error of the model in identifying the characteristics of the temperature distribution shape and improve the overall accuracy of flame recognition;
[0060] Feedback is provided to the deep model of flame recognition, and then the deep model of flame recognition is trained as follows:
[0061] (1) Download the yolov5 code to the CPU, configure the environment, and install the requirements in sequence;
[0062] (2) Create a new data folder named fire_data in the data folder of yolov5. Create two subfolders images and labels in the folder. Put the pictures used to identify flames and the verification pictures into the images folder. Use the labelimg tool to label these pictures, that is, label the flame area. The labeling information includes the center coordinates (x, y), relative width (w) and relative height (h) of the rectangular box. The (x, y, w, h) coordinate values are normalized. After labeling, store the label information in the labels folder.
[0063] (3) Create a fire.yaml configuration file in the data directory of yolov5. In the fire.yaml configuration file, modify the number of deep models for flame recognition in the models / yolov5s.yaml file to at least 1;
[0064] (4) Modify the parameters of learning rate, number of iterations, and batch size in the train.py file, and modify the graphics preprocessing method in the test.py file;
[0065] (5) After completing the parameter adjustment, execute the train.py script to start the training process. This process will train at least one deep model for flame recognition based on the previously prepared flame image dataset;
[0066] By correcting the probability matrix of each layer of the neural network in the deep model of flame recognition, the model can learn the subtle differences between the characteristics of temperature distribution shape and the characteristics of non-temperature distribution shape, thereby reducing false positives and false negatives and improving the accuracy of flame recognition. The probability matrix formula is:
[0067]
[0068] X1: probability value of the deep model of flame recognition; Y1: newly added probability value of the deep model of flame recognition;
[0069] The electronic device used in the flame recognition method based on deep learning includes: at least one central processing unit, at least one smart camera electrically connected to the central processing unit, an infrared detector for detecting the temperature in the area is installed inside the smart camera, and each area corresponds to at least one infrared detector, and at least one memory electrically connected to the central processing unit; wherein the memory stores a computer program that can be executed by at least one processor, and the computer program is executed by at least one central processing unit, and at least one central processing unit is electrically connected to a network connector, and the network connector is connected to a cloud storing a flame model via a wireless network, and at least one processor can execute the flame recognition method.
[0070] Finally, a few points should be explained: First, in the description of the present invention, it should be noted that, unless otherwise specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, which may refer to mechanical connection or electrical connection, or internal communication between two components, or direct connection. "upper", "lower", "left", "right", etc. are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship may change;
[0071] Secondly: In the drawings of the embodiments disclosed in the present invention, only the structures related to the embodiments disclosed in the present invention are involved, and other structures can refer to the general design. In the absence of conflict, the same embodiment and different embodiments of the present invention can be combined with each other;
[0072] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A flame recognition method based on deep learning, characterized in that: The steps include: Step 1: The smart camera captures the video and simultaneously collects the temperature data of the shooting area; Step 2: After receiving the image and temperature data, conduct a comprehensive analysis of the two, use the infrared matrix formula to calculate the temperature distribution of the area, and correspond the temperature distribution to the space of the image data; Step 3: Compare the regional temperature with the preset ignition point threshold. When the temperature in the region reaches the ignition point threshold, compare the temperature distribution shape features in all regional images with the deep model of flame recognition. If the temperature distribution shape features in all regional images are calculated according to the deep model, and the conclusion is that the similarity of the sudden ignition point shape features is ≥80%, an alarm is issued; Step 4: Use the features of the identified temperature distribution shape as correction data to provide feedback to the deep model of flame recognition, which is used to subsequently correct the probability matrix of each layer in the deep model of flame recognition to complete the feedback correction.
2. A flame recognition method based on deep learning according to claim 1, characterized in that: In step 2, the monitored area transmitted by the camera is divided into several areas, each area is matched one-to-one with the infrared matrix, and the infrared matrix is summed; In step 3, when the total temperature value is greater than the preset ignition point threshold, or the temperature value of any detection point in the area is greater than the corresponding threshold, an alarm is directly issued: Q: represents the total temperature value, which is the sum of the temperatures of all detection points in the area; a i : represents the temperature value of a single detection point; n is the total number of detection points in the area.
3. The flame recognition method based on deep learning according to claim 1, characterized in that: In the step 4, the characteristics of the identified temperature distribution shape are summed up in variance, and according to the summation result, the deep model parameters of flame recognition are adjusted, the probability matrix is corrected, and the neural network is updated through the gradient descent optimization strategy.
4. The flame recognition method based on deep learning according to claim 3 is characterized in that: The variance summation formula is: s 2 =Σ(xi-μ) 2 / N; σ 2 : used to represent the sum of variances, xi: represents the i-th observation value of the population, μ: represents the mean of the population, N: represents the number of observations of the population If the sum of the variances is greater than the set value, the probability of each ratio in the deep model of flame recognition is adjusted under manual intervention.
5. The flame recognition method based on deep learning according to claim 1, characterized in that: The probability matrix formula in step 4 is: X1: probability value of the deep model for flame recognition; Y1: newly added probability value of the deep model for flame recognition.
6. The flame recognition method based on deep learning according to claim 1, characterized in that: The training method of the deep model of flame recognition in step 4 is: (1) Create two subfolders, images and labels, and put the images used to identify flames and the verification images into the images folder. Use the labelimg tool to label these images. The label information includes the center coordinates (x, y), relative width (w), and relative height (h) of the rectangular box. All coordinate values are normalized. After labeling, store the label information in the labels folder. (2) Create a fire.yaml configuration file in the data directory. In the fire.yaml configuration file, modify the number of deep models for flame recognition in the models / yolov5s.yaml file to at least 1; (3) Modify the parameters of learning rate, number of iterations, and batch size in the train.py file, and modify the graphics preprocessing method in the test.py file; (4) After completing the parameter adjustment, execute the train.py script to start the training process. This process will train at least one deep model for flame recognition based on the previously prepared flame image dataset.
7. The flame recognition method based on deep learning according to claim 1, characterized in that: In the step 3, in order to extract the features of the temperature distribution shape in the regional image, it is necessary to pre-process the regional image and remove the noise on the image by median filtering. The specific method is as follows: let S(z, y) represent the mask window corresponding to the central pixel (x, y) during filtering, let Z1 be the minimum grayscale value in S(x, y), Z2 be the maximum grayscale value in S(x, y), Z3 be the median grayscale value in S(z, Y), Z(z, Y) be the grayscale at the coordinate (z, y), S be the maximum size allowed by S(x, y), and the two levels at which the adaptive median filter algorithm works are defined as layer A and layer B; the calculation method of the grayscale median Z3 combines the mean idea, and the median obtained by sorting is weighted with the mean of all pixels in the window to obtain the grayscale median, the weight of the median is 0.3, and the weight of the mean is 0.7; A layer: ZA1 = Zmed-ZminZA2 = Zmax-Zmed When ZA1>T (T is the threshold) and ZA2>T, go to B layer, otherwise, increase the window size; if the window size is less than, repeat A layer; otherwise, output Z(x, y); B layer: ZB1 = Z(x, y)-Zmin, ZB2 = Zmax-Z(x, y), when ZR1>T, ZB2>T, then output Z(x, y); otherwise output ZmedA layer is used to determine whether it is a pulse, and B layer is used to determine whether Z(x, y) is a pulse; when neither A layer nor B layer is, the algorithm uses an unchanged pixel value Z(x, y) to replace the median as the output to avoid unnecessary loss of details, and then sets a threshold according to the temperature, divides the image into different areas, uses the K-means algorithm to identify areas with similar temperature characteristics, and then uses the Canny edge detection method to find areas with large temperature gradients, calculates the shape characteristics of the area, and obtains the characteristics of the temperature distribution shape.
8. The flame recognition method based on deep learning according to claim 1, characterized in that: The electronic device used in the flame recognition method based on deep learning includes: at least one central processing unit, an intelligent camera electrically connected to the at least one central processing unit, an infrared detector for detecting the temperature in an area is installed inside the intelligent camera, and each area corresponds to at least one infrared detector, and a memory electrically connected to the at least one central processing unit; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one central processing unit, and the at least one central processing unit is electrically connected to a network connector, and the network connector is connected to a cloud storing a flame model via a wireless network, and the at least one processor can execute the flame recognition method described in any one of claims 1 to 7.
Citation Information
Cited By
Flame image recognition and feature extraction method and system
CN121032995A
