A furnace flame detection method based on image
Through multiple judgment and morphological processing technologies, combined with multiple machine learning models, the size of the furnace flame can be accurately identified, solving the problems of false alarms and missed alarms in the existing technology, and improving the accuracy and safety of flame identification.
Patent Information
- Application Number
- CN202311310367.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-08
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2043-10-08
AI Technical Summary
Existing furnace flame identification technology has problems with false alarms and omissions when identifying flame size, making it difficult to ensure the stability of the flame, which may lead to safety accidents and equipment damage.
Using image segmentation and downsampling technology based on multiple color channels, combined with the flame detection model of Gaussian Naive Bayes, decision tree, perceptron and Lasso model, binary shaping and morphological processing are performed through multiple judgments of pixel value groups , extract the shape and area of the flame, and determine the flame size.
It improves the accuracy of flame identification, reduces false alarms and false alarms, ensures the stability of the flame, and reduces safety risks and equipment maintenance costs.
Smart Images

Figure CN117612078B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of fossil production, and in particular to an image-based furnace flame detection method. Background Art
[0002] In the production process of petrochemical plants, furnaces are usually used to carry out complex chemical reactions and heating processes. The extinguishing of the flame may cause the high temperature and pressure generated by the combustion to suddenly decrease, which may cause damage to the furnace and related equipment. Usually the flame in the furnace is a product of high temperature and high energy. After extinguishing, it may also cause gas accumulation, which may cause explosions or other safety accidents when re-ignited. Therefore, maintaining the stability of the flame can ensure that the combustion inside the furnace is controllable, thereby reducing the risk of accidents. Maintaining the stability of the flame can extend the life of the equipment and reduce maintenance costs. Keeping the flame in the furnace of a chemical plant is a key measure to ensure the stability, safety and efficiency of the production process. This is an important aspect that must be paid attention to in the chemical production process, which helps to ensure product quality, improve production efficiency and reduce safety risks. One of the existing furnace flame recognition technologies is to install a camera at the position to be inspected in the furnace, and train an effective flame recognition model by applying machine learning or deep learning algorithms through image processing. When the flame is found to be weakened or extinguished, the algorithm software will trigger an alarm.
[0003] In view of this, the present invention provides an image-based furnace flame detection method to improve the accuracy of identifying the flame size and reduce false alarms and missed alarms. Summary of the invention
[0004] The object of the present invention is to provide an image-based furnace flame detection method, comprising: based on multiple color channels, respectively segmenting the furnace image to obtain a sub-furnace image corresponding to each channel; respectively downsampling the multiple sub-furnace images to obtain multiple downsampled images; based on the multiple downsampled images, extracting the pixel value of each pixel in the multiple color channels to obtain a pixel value group of each pixel; combining the pixel value groups of the multiple pixels to obtain a pixel value set; inputting the pixel value set into a flame detection model, and the model outputting a pixel judgment set; the flame detection model includes multiple machine learning algorithms; The invention relates to a machine learning model; the pixel judgment set is used to indicate whether a pixel point belongs to a flame; the pixel value set is binary-shaped based on the pixel judgment set to obtain an initial furnace binary image; a part of the binary image represents the flame part, and the other part represents the non-flame part; the furnace binary image is upsampled to obtain an upsampled binary image; the upsampled binary image is morphologically processed to obtain a furnace binary image; the dimension of the furnace binary image is consistent with the dimension of the furnace image; the shape of the flame in the furnace binary image is extracted, and the size of the flame is determined based on the pixel area covered by the shape of the flame.
[0005] Furthermore, the flame detection model is obtained through training, including: collecting training samples; the training samples include a pixel value group of a pixel and a determination result of whether the pixel belongs to a flame; constructing an initial furnace flame detection model; inputting the training samples into the flame detection model, and constructing a loss function based on the output of the model and the determination result of the flame; updating the parameters of the flame detection model based on the loss function to obtain a trained flame detection model.
[0006] Furthermore, the initial furnace flame detection model includes Gaussian Naive Bayes, a decision tree, a perceptron and a Lasso model; the Gaussian Naive Bayes is used to receive the pixel value group and output a first probability that the pixel belongs to a flame; the decision tree is used to receive the pixel value group and output a second probability that the pixel belongs to a flame; the perceptron is used to receive the pixel value group and output a third probability that the pixel belongs to a flame; the Lasso model is used to determine whether the pixel belongs to a flame based on the first probability, the second probability and the third probability.
[0007] Furthermore, the calculation formula of the first probability is:
[0008]
[0009]
[0010] Where P(Y=C k ) indicates that Y is C k The probability, P(X j =x j |Y=C k ) indicates that Y is determined to be C k When X j =x j The probability of; j represents the variable of the feature; X j represents the j-th feature of X; x j represents the possible value of the j-th feature of X; Y represents the label; C k represents the kth category of Y; μ k and σ k Represent the first training set estimate and the second training set estimate, respectively.
[0011] Furthermore, obtaining the second probability includes: determining the discrete attributes of the training samples, and dividing the training samples based on the discrete attributes to obtain multiple branch nodes and branch node sets; respectively calculating the information gain of the branch node sets, and determining the weight of each branch node based on the information gain and the number of training samples of the corresponding branch node set; starting from the root node, repeatedly calculating the information gain of each node, and selecting the features of the discrete attributes represented by the nodes with the largest information gain to divide the data set until the stopping condition is reached.
[0012] Furthermore, the information gain is calculated as follows:
[0013]
[0014] Where Gain(D,a) represents information gain; D represents the training sample set, a represents the discrete attribute, and the discrete attribute a has V values {a 1 ,a 2 ,......,a V}; If a is used to divide the training sample set D, ν branch nodes will be generated, where the νth branch node contains all the nodes in D whose attribute a has a value of v The sample is denoted as D v ; Ent(*) indicates rounding; v indicates the value variable; V is the total number of values of the discrete attribute a;
[0015] The weight of each branch node is |D v | / |D|.
[0016] Furthermore, the expression of the input-output mapping of the perceptron is:
[0017] y u =sign(w 1 ·x i +b 1 )∈{-1,1}
[0018] Among them, w 1 represents the normal vector; b 1 represents the intercept, · represents the dot product of the vector; y i represents the third probability; sign(*) represents the sign of the input *: if * is a positive number, it returns 1; if * is a negative number, it returns _1; if * is zero, it returns 0; x i represents the i-th training sample;
[0019] The expression of the loss function of the perceptron is:
[0020]
[0021] Among them, loss 1 (*) represents the loss function of the perceptron; M represents the set of misclassified points of the hyperplane.
[0022] Furthermore, the loss function of the Lasso model is:
[0023]
[0024] Among them, loss 2 (*) represents the loss function of the Lasso model; x i represents the i-th training sample; n sample represents the number of samples; Z represents the new feature matrix composed of the first probability, the second probability, and the third probability; w 2 The coefficient representing the feature; y represents the pixel value group x i The result of judging whether it is a flame; a is a complex parameter for controlling the amount of contraction; ‖*‖ 1 represents the L1 norm; ‖*‖ 2 represents the L2 norm.
[0025] Furthermore, the color channels are BGR three channels, including B channel, G channel and R channel; the sub-furnace image includes sub-furnace image B, sub-furnace image G and sub-furnace image R.
[0026] Furthermore, the morphological processing is to use a 5x5 kernel to perform corrosion and expansion processing on the upsampled binary image.
[0027] The technical solution of the embodiment of the present invention has at least the following advantages and beneficial effects:
[0028] The present invention combines the dynamic change of the flame area in the flame image for detection, has the characteristics of multiple judgments, improves the accuracy and reduces false alarms. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 An exemplary flow chart of an image-based furnace flame detection method provided by the present invention;
[0030] Figure 2 An exemplary schematic diagram of a training furnace flame detection model provided by the present invention
[0031] Icons: 1-furnace image, 2-sub-furnace image, 3-downsampled image, 4-pixel value set, 5-pixel judgment set, 6-initial furnace binary image, 7-upsampled binary image. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0033] Figure 1 An exemplary flow chart of an image-based furnace flame detection method provided in some embodiments of the present invention. Figure 1 As shown, the image-based furnace flame detection method includes the following:
[0034] Based on multiple color channels, the furnace image 1 is segmented respectively to obtain a sub-furnace image 2 corresponding to each channel.
[0035] The color channels are BGR three channels, including a B channel, a G channel and an R channel; the sub-furnace images include a sub-furnace image B, a sub-furnace image G and a sub-furnace image R.
[0036] The plurality of sub-furnace images are downsampled respectively to obtain a plurality of downsampled images 3. The downsampling may be pyramid downsampling, and the sub-furnace images are scaled to half of their original size by downsampling to obtain the downsampled images.
[0037] Based on the multiple downsampled images, the pixel value of each pixel in the multiple color channels is extracted to obtain a pixel value group for each pixel. The pixel value group is x i =[BGR y] i .
[0038] The pixel value groups of the plurality of pixels are combined to obtain a pixel value set 4. The pixel value set is X=[x 1 x 2 x 3 …x i …x n ] T .
[0039] The pixel value set is input into the flame detection model, and the model outputs a pixel determination set 5; the flame detection model includes a plurality of machine learning models; the pixel determination set is used to indicate whether a pixel point belongs to a flame.
[0040] The flame detection model is obtained through training, including:
[0041] Collect training samples; the training samples include a pixel value group and a determination result of whether the pixel belongs to the flame. Each pixel point in the image can be taken as a sample, and the feature is the BGR three channels. For example, data is collected for a furnace flame image. Each sample data is a pixel in the furnace flame image. We extract feature values from its BGR three channels. The feature of the sample is the value of the BGR three channels. The label y of the sample indicates whether the sample is part of the flame, and x i =[BG R y] i . Collect the data to get the pixel value set X = [x 1 x 2 x 3 …x i …x n ] T where x i is the i-th sample, and there are n samples in total (that is, n pixels of the image).
[0042] Construct an initial furnace flame detection model. The initial furnace flame detection model includes Gaussian naive Bayes, decision tree, perceptron and Lasso model. Predict each sample three times (three models) and still get samples with three features.
[0043] The Gaussian Naive Bayes (GaussianNB) is used to receive the pixel value group and output a first probability that the pixel belongs to a flame. The calculation formula of the first probability is:
[0044]
[0045]
[0046] Where P(Y=C k ) indicates that Y is C k The probability, P(X j =x j |Y=C k ) indicates that Y is determined to be C k When X j =x j The probability of; j represents the variable of the feature; X j represents the j-th feature of X; x j represents the possible value of the j-th feature of X; Y represents the label; C k represents the kth category of Y; μ k and σ kRepresent the first training set estimate and the second training set estimate, respectively. After calculating the feature probability under each category, GaussianNB uses Bayes' theorem to calculate the posterior probability, that is, the probability of a category given the feature. It multiplies the probability of each feature and then multiplies it by the prior probability (that is, the probability of a category appearing in all categories) to get the posterior probability. After obtaining the posterior probability, GaussianNB will select the category with the highest posterior probability as the prediction result. This is based on the maximum a posteriori probability (MAP) decision rule.
[0047] The decision tree (DecisionTreeClassifier) is used to receive the pixel value group and output the second probability that the pixel belongs to the flame. The second probability is obtained by: determining the discrete attributes of the training sample, and dividing the training sample based on the discrete attributes to obtain multiple branch nodes and branch node sets; calculating the information gain of the branch node set respectively, and determining the weight of each branch node based on the information gain and the number of training samples of the corresponding branch node set; starting from the root node, repeatedly calculating the information gain of each node, and selecting the features of the discrete attributes represented by the node with the largest information gain to divide the data set until the stopping condition is reached. The calculation formula of the information gain is:
[0048]
[0049] Where Gain(D,a) represents information gain; D represents the training sample set, a represents the discrete attribute, and the discrete attribute a has V values {a 1 ,a 2 ,......,a V}; If a is used to divide the training sample set D, ν branch nodes will be generated, where the νth branch node contains all the nodes in D whose attribute a has a value of v The sample is denoted as D v ; Ent(*) indicates rounding; v indicates the value variable; V is the total number of values of the discrete attribute a;
[0050] D can be calculated according to the information entropy calculation formula v The information entropy of , and considering that different branch nodes contain different numbers of samples, the weight of each branch node is |D v | / |D|.
[0051] The stopping conditions include reaching a maximum depth, the number of samples in the data set being lower than a threshold, etc.
[0052] The perceptron is used to receive the pixel value group and output a third probability that the pixel belongs to a flame.
[0053] The linear equation of the perceptron is (the dimension is the hyperplane of n-1 dimension, n is the number of sample features):
[0054] w 1 ·x+b 1 =0
[0055] Among them, w 1 is the normal vector (normal vector of the hyperplane), b 1 is the intercept, and · represents the dot product of the vector. The left side of this linear equation is the projection of the eigenvector x on the hyperplane, and the right side is the intercept.
[0056] The expression of the input-output mapping of the perceptron is:
[0057] y i =sign(w 1 ·x i +b 1 )∈{-1,1}
[0058] Among them, w 1 represents the normal vector; b 1 represents the intercept, · represents the dot product of the vector; y i represents the third probability; sign(*) represents the sign of the input *: if * is a positive number, it returns 1; if * is a negative number, it returns _1; if * is zero, it returns 0; x i represents the i-th training sample;
[0059] The expression of the loss function of the perceptron is:
[0060]
[0061] Among them, loss 1 (*) represents the loss function of the perceptron; M represents the set of misclassified points on the hyperplane; w is adjusted by iteration 1 and b 1 , so as to correctly classify the training data.
[0062] The Lasso model is used to determine whether the pixel belongs to a flame based on the first probability, the second probability and the third probability. For example, the prediction results of the three models are weighted using lasso regression to obtain a final prediction value, and then the prediction value vector is rounded to {0, 1}. Lasso is a linear model used for regression analysis. When fitting a model, it not only considers the fitting error, but also constrains the coefficients in the model so that some coefficients become zero, thereby achieving feature selection and model simplification.
[0063] The linear equation of the Lasso model is:
[0064]
[0065] The loss function of the Lasso model is:
[0066]
[0067] Among them, loss 2 (*) represents the loss function of the Lasso model; x i represents the i-th training sample; n sample represents the number of samples; Z represents the new feature matrix composed of the first probability, the second probability, and the third probability; w 2 The coefficient representing the feature; y represents the pixel value group x i The result of judging whether it is a flame; a is a complex parameter for controlling the amount of contraction; ‖*‖ 1 represents the L1 norm; ‖*‖ 2 represents the L2 norm.
[0068] Inputting the training samples into the flame detection model, and constructing a loss function based on the output of the model and the flame determination result;
[0069] The parameters of the flame detection model are updated based on the loss function to obtain a trained flame detection model.
[0070] by Figure 2 For example, we can use the staking ensemble multi-model algorithm. First, divide the data set into three parts, take two parts each time (three methods in total), use two of them as training sets to train the model, and use the features of the remaining one to predict, and get one-third of the prediction value. Repeat multiple times (here three times) to get the features of all samples predicted by a model. Using GaussianNB, DecisionTree and Perceptron respectively, we can get three sets of prediction data for all samples. Here, each set of prediction data is used as a new feature to construct a new sample-feature matrix.
[0071] For the new sample-feature matrix, x i =[predict1 predict2 predict3 y] i , where predict1, predict2 and predict3 are the three models for sample x i The predicted value. Then the new sample-feature matrix is regressed using Lasso to obtain the weight of each model for the result prediction.
[0072] Based on the pixel judgment set, the pixel value set is binary-shaped to obtain an initial furnace binary image, wherein one part of the binary image represents the flame part, and the other part represents the non-flame part. For example, the pixel judgment set is reshaped into a single-channel binary image of the same size as that after the previous downsampling by using reshape.
[0073] The furnace binary image is upsampled to obtain an upsampled binary image, wherein the upsampling may be pyramid upsampling.
[0074] The upsampled binary image is subjected to morphological processing to obtain a furnace binary image, wherein the dimension of the furnace binary image is consistent with the dimension of the furnace image. The morphological processing is to perform corrosion and expansion processing on the upsampled binary image using a 5x5 kernel.
[0075] The shape of the flame in the furnace binary image is extracted, and the size of the flame is determined based on the pixel area covered by the shape of the flame. For example, the complete flame in the binary image can be deducted by the Hadamard product transform, and then the size of the flame can be determined based on the pixel area calculation, so as to accurately grasp the information of the flame in each time period to prevent various emergencies. And the threshold can be judged, and when the flame size is less than a certain threshold, the factory security system will be alarmed, so as to ensure the stability, safety and efficiency of the production process.
[0076] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A furnace flame detection method based on an image, characterized in that: include: Based on multiple color channels, the furnace image is segmented respectively to obtain a sub-furnace image corresponding to each channel; Downsampling the plurality of sub-furnace images respectively to obtain a plurality of downsampled images; Based on the multiple down-sampled images, extract the pixel value of each pixel in the multiple color channels to obtain a pixel value group for each pixel; Combining the pixel value groups of a plurality of pixels to obtain a pixel value set; The pixel value set is input into a flame detection model, and the model outputs a pixel determination set; the flame detection model includes a plurality of machine learning models; the pixel determination set is used to indicate whether a pixel point belongs to a flame; Based on the pixel determination set, the pixel value set is binary-shaped to obtain an initial furnace binary image; a part of the binary image represents the flame part, and the other part represents the non-flame part; Upsampling the furnace binary image to obtain an upsampled binary image; Performing morphological processing on the upsampled binary image to obtain a furnace binary image; the dimension of the furnace binary image is consistent with the dimension of the furnace image; The shape of the flame in the furnace binary image is extracted, and the size of the flame is determined based on the pixel area covered by the shape of the flame.
2. The image-based furnace flame detection method according to claim 1, characterized in that: The flame detection model is obtained through training, including: Collect training samples; the training samples include pixel value groups x of pixels i and the result of judging whether the pixel belongs to the flame; each sample data is a pixel in the furnace flame image, and the feature value is extracted from its three BGR channels. The feature of the sample is the value of the three BGR channels. The label y of the sample indicates whether the sample is part of the flame, and x i =[BGR y] i ; Collect data to obtain pixel value set X = [x1x2x3…x i …x n ] T , where x i is the i-th sample, there are n samples in total; Construct an initial furnace flame detection model; Inputting the training samples into the flame detection model, and constructing a loss function based on the output of the model and the flame determination result; The parameters of the flame detection model are updated based on the loss function to obtain a trained flame detection model.
3. The image-based furnace flame detection method according to claim 2, characterized in that: The initial furnace flame detection model includes Gaussian naive Bayes, decision tree, perceptron and Lasso model; The Gaussian Naive Bayes is used to receive the pixel value group and output a first probability that the pixel belongs to a flame; The decision tree is used to receive the pixel value group and output a second probability that the pixel belongs to a flame; The perceptron is used to receive the pixel value group and output a third probability that the pixel belongs to a flame; The Lasso model is used to determine whether the pixel belongs to a flame based on the first probability, the second probability and the third probability.
4. The image-based furnace flame detection method according to claim 3, characterized in that: The calculation formula of the first probability is: Where P(Y=C k ) indicates that Y is C k The probability, P(X j =x j |Y=C k ) indicates that Y is determined to be C k When X j =x j The probability of; j represents the variable of the feature; X j represents the j-th feature of X; x j represents the possible value of the j-th feature of X; Y represents the label; C k represents the kth category of Y; μ k and σ k Represent the first training set estimate and the second training set estimate, respectively.
5. The image-based furnace flame detection method according to claim 3, characterized in that: Obtaining the second probability includes: Determining discrete attributes of the training samples, and dividing the training samples based on the discrete attributes to obtain a plurality of branch nodes and branch node sets; Calculating the information gain of the branch node set respectively, and determining the weight of each branch node based on the information gain and the number of training samples of the corresponding branch node set; Starting from the root node, the information gain of each node is repeatedly calculated, and the features of the discrete attributes represented by the node with the largest information gain are selected to divide the data set until the stopping condition is reached.
6. The image-based furnace flame detection method according to claim 5, characterized in that: The calculation formula of the information gain is: Where Gain(D,a) represents information gain; D represents the training sample set, a represents the discrete attribute, and the discrete attribute a has V values {a1, a2, ..., a V }; If a is used to divide the training sample set D, ν branch nodes will be generated, where the νth branch node contains all the nodes in D whose attribute a has a value of v The sample is denoted as D v ; Ent(*) indicates rounding; v indicates the value variable; V is the total number of values of the discrete attribute a; The weight of each branch node is |D v | / |D|.
7. The image-based furnace flame detection method according to claim 3, characterized in that: The expression of the input-output mapping of the perceptron is: y i =sign(w1·x i +b1)∈{-1,1} Where w1 represents the normal vector; b1 represents the intercept, · represents the dot product of the vector; y i represents the third probability; sign(*) represents the sign of the input *: if * is a positive number, it returns 1; if * is a negative number, it returns -1; if * is zero, it returns 0; x i represents the i-th training sample; The expression of the loss function of the perceptron is: Among them, loss1(*) represents the loss function of the perceptron; M represents the set of misclassified points of the hyperplane.
8. The image-based furnace flame detection method according to claim 3, characterized in that: The loss function of the Lasso model is: Among them, loss2(*) represents the loss function of the Lasso model; x i represents the i-th training sample; n sample represents the number of samples; Z represents the new feature matrix composed of the first probability, the second probability, and the third probability; w2 represents the coefficient of the feature; y represents the pixel value group x i The result of judging whether it is a flame; a is a complex parameter that controls the amount of contraction; ‖*‖1 represents the L1 norm; ‖*‖2 represents the L2 norm.
9. The image-based furnace flame detection method according to claim 1, characterized in that: The color channels are BGR three channels, including a B channel, a G channel and an R channel; the sub-furnace images include a sub-furnace image B, a sub-furnace image G and a sub-furnace image R.
10. The image-based furnace flame detection method according to claim 1, characterized in that: The morphological processing is to use a 5x5 kernel to perform corrosion and expansion processing on the upsampled binary image.
Citation Information
Patent Citations
A smoke and fire detection method and system based on deep learning and image recognition
CN109815863A
Boiler operation data acquisition method, system and device and computer medium
CN111860317A
