Fire early warning method based on image processing
By generating a learning set based on image processing, sliding boxes and random forest algorithms, the problems of lag and narrow monitoring range of traditional fire early warning technology are solved, and real-time and accurate fire early warning effects are achieved.
Patent Information
- Application Number
- CN202510761705.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-07-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional fire early warning technology relies on sensors to have lag and narrow monitoring range, so it is impossible to accurately locate the fire source position, and the existing image monitoring methods are poorly adaptable in complex scenarios.
Using an image-based processing method, a learning set is generated using a sliding box, combined with a random forest algorithm, a fire area is distinguished by the expected pixel degree and RMSE features, and a learning subset of multi-dimensional feature depth is generated for fire warning.
Real-time and accurate fire warning is achieved, reducing calculation redundancy, enhancing algorithm stability, adapting to different scenarios, and improving early warning accuracy.
Smart Images

Figure CN120279646A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to a fire warning method based on image processing. Background Art
[0002] The limitation of traditional fire warning technology lies in its reliance on sensors. Traditional smoke / temperature sensors can only be triggered when a fire has developed to a certain stage, resulting in a lag, and they are unable to locate the position of the fire source. Moreover, traditional sensors adopt a distributed dot layout, and a single detector can only monitor an area of approximately 60 - 80 ㎡, with a relatively narrow monitoring range. Traditional fire warning technology also includes image monitoring, but existing image monitoring methods rely on fixed thresholds or manually designed features (such as color histograms), and it is difficult to adapt to complex scenarios (such as indoor and outdoor lighting differences). Summary of the Invention
[0003] In order to solve the above problems, the present invention proposes a fire warning method based on image processing.
[0004] The technical solution of the present invention is as follows: A fire warning method based on image processing includes the following steps:
[0005] S1. Collect surveillance images of the monitored area;
[0006] S2. Horizontally slide and traverse the surveillance image using a sliding box to generate a learning set for the surveillance image;
[0007] S3. Determine the feature parameters of the random forest using the learning set, and use the random forest to label the fire area.
[0008] Further, S2 includes the following sub - steps:
[0009] S21. Set the step size of the sliding box and the window width of the sliding box to be the same;
[0010] S22. Horizontally slide and traverse the surveillance image using the sliding box to obtain the expected pixel degree of each column of the surveillance image;
[0011] S23. Generate a learning set for the surveillance image according to the expected pixel degree of each column of the surveillance image.
[0012] The beneficial effect of the above - mentioned further solution is as follows: In the present invention, the step - size design reduces the amount of calculation, and the non - overlapping area reduces redundant calculation, which is suitable for real - time monitoring; random perturbation and variance normalization enhance the stability of the algorithm. Using the expected pixel degree as a weight adjustment, and the RMSE is directly related to the physical characteristics of the fire (high brightness, rapid change), improving the accuracy of the warning.
[0013] Further, in S22, for the expected pixel degree of the The calculation formula is as follows:
[0014] ;
[0015] In the formula, represents the maximum pixel value of the th column of the monitoring image, represents the minimum pixel value of the th column of the monitoring image, represents the variance of the pixel values of all pixel points included in the sliding window when traversing the th column, represents the maximum pixel value of all pixel points included in the sliding window when traversing the th column, represents taking a random number between 0 and 1.
[0016] The beneficial effect of the above further solution is: In the present invention, by combining the maximum pixel value within the window with random perturbation, the robustness to the local dynamic range is enhanced. By comprehensively considering the global contrast, local dynamic range, and pixel value volatility, the "expected pixel degree" of each column is quantified. A high expected pixel degree indicates that the pixel change in this column is gentle (such as a static background), and a low expected pixel degree indicates a drastic change (such as a flame area).
[0017] Further, in S23, calculate the pixel value mean of the four-neighborhood pixel points around the pixel point, take the product of the pixel value mean and the expected degree of the column where the pixel point is located as the predicted pixel value of the pixel point, calculate the root mean square error between the pixel value of the pixel point and the predicted pixel value, and generate a learning set of the monitoring image.
[0018] The beneficial effect of the above further solution is: In the present invention, the four-neighborhood mean reflects local smoothness. The fire area (such as the flame edge) usually has a large difference from the surrounding pixels, resulting in a high prediction error. The expected pixel degree adjusts the weight of the predicted value, reducing the predicted value in the area with drastic changes (low expected pixel degree) and amplifying the difference between the actual value and the predicted value. The RMSE feature is used to distinguish the normal area from the abnormal area (such as a flame), providing training data for subsequent classification models (such as random forest).
[0019] Further, S3 includes the following sub-steps:
[0020] S31. Extract the standard deviation of the learning set of the monitoring image;
[0021] S32. Randomly split the learning set into several learning subsets;
[0022] S33. Generate the feature depth of the learning subset according to the standard deviation of the learning set;
[0023] S34. Use several learning subsets to label the fire area of the monitoring image.
[0024] The beneficial effects of the above further solution are as follows: In the present invention, the global variance of the learning set is calculated to quantify the overall dispersion degree of the data. By generating multiple learning subsets, the sampling process with replacement of the random forest is simulated. Each subset contains some samples and features, increasing the model diversity. The feature depth is directly related to the subset complexity, facilitating the debugging of the model behavior. The output of the feature importance of the random forest can further explain the basis for fire detection. In the random forest, there is only one feature subset ratio parameter for the entire model, and all decision trees follow this parameter setting during training.
[0025] Further, in S33, the feature depth has the following calculation formula:
[0026] ;
[0027] In the formula, represents the th element of the learning subset, represents the logarithmic function, represents the standard deviation of all elements of the learning subset, represents the number of elements of the learning subset.
[0028] Further, in S34, the mean value of the feature depths of all learning subsets is used as the feature subset ratio parameter of the random forest, and the random forest is used to mark the fire area of the monitored image.
[0029] The beneficial effects of the present invention are as follows: The present invention uses a sliding frame with a step size consistent with the window width to slide horizontally, combines the column expected pixel degree and the four-neighborhood prediction, focuses on the vertical spread characteristics of the flame, and suppresses the horizontal noise interference; the learning set generated by the present invention contains multi-dimensional features such as RMSE and column dynamic range, quantifying the physical characteristics of the fire area (such as high contrast, rapid change); in addition, the present invention quantifies the learning subset complexity through the feature depth, dynamically sets the random forest parameters, avoids manual parameter tuning, reduces the error correlation of a single tree, and adapts to different scenarios. The present invention combines the anti-overfitting ability of the random forest with the efficiency of the sliding frame to accurately warn of fires and provide an efficient and scalable fire warning solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a flowchart of a fire warning method based on image processing. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0031] The embodiments of the present invention will be further described below with reference to the drawings.
[0032] As Figure 1As shown in the figure, the present invention provides a fire warning method based on image processing, including the following steps:
[0033] S1. Collect the monitoring images of the monitoring area;
[0034] S2. Horizontally slide and traverse the monitoring images using a sliding box to generate a learning set for the monitoring images;
[0035] S3. Determine the feature parameters of the random forest using the learning set and label the fire area using the random forest.
[0036] In the embodiment of the present invention, S2 includes the following sub-steps:
[0037] S21. Set the step size of the sliding box and the window width of the sliding box to be the same;
[0038] S22. Horizontally slide and traverse the monitoring images using the sliding box to obtain the expected pixel degree of each column of the monitoring images;
[0039] S23. Generate a learning set for the monitoring images according to the expected pixel degree of each column of the monitoring images.
[0040] In the present invention, the step size design reduces the calculation amount, and the non-overlapping area reduces the redundant calculation, which is suitable for real-time monitoring; the random perturbation and variance normalization enhance the algorithm stability. Using the expected pixel degree as the weight adjustment, and the RMSE is directly related to the fire physical characteristics (high brightness, rapid change), which improves the warning accuracy.
[0041] In the embodiment of the present invention, in S22, for the expected pixel degree of the th column of the monitoring image, the calculation formula is:
[0042] ;
[0043] In the formula, represents the maximum pixel value of the th column of the monitoring image, represents the minimum pixel value of the th column of the monitoring image, represents the variance of the pixel values of all pixel points included in the sliding window when traversing the th column, represents the maximum pixel value of all pixel points included in the sliding window when traversing the th column, represents taking a random number between 0 and 1.
[0044] In the present invention, by combining the maximum pixel value within the window with random perturbations, the robustness to the local dynamic range is enhanced. By comprehensively considering the global contrast, local dynamic range, and pixel value volatility, the "expected pixel degree" of each column is quantified. A high expected pixel degree indicates that the pixels in that column change smoothly (such as a static background), while a low expected pixel degree indicates drastic changes (such as a flame area).
[0045] In an embodiment of the present invention, in S23, the mean pixel value of the four neighboring pixel points around the pixel point is calculated, and the product of the mean pixel value and the expected degree of the column where the pixel point is located is used as the predicted pixel value of the pixel point. The root mean square error between the pixel value of the pixel point and the predicted pixel value is calculated to generate a learning set of the monitored image.
[0046] In the present invention, the four-neighbor mean reflects local smoothness. In a fire area (such as the flame edge), there are usually large differences from the surrounding pixels, resulting in a high prediction error. The expected pixel degree adjusts the weight of the predicted value, reducing the predicted value in areas with drastic changes (low expected pixel degree) and amplifying the difference between the actual value and the predicted value. The RMSE feature is used to distinguish normal areas from abnormal areas (such as flames), providing training data for subsequent classification models (such as random forests).
[0047] In an embodiment of the present invention, S3 includes the following sub-steps:
[0048] S31. Extract the standard deviation of the learning set of the monitored image;
[0049] S32. Randomly split the learning set into several learning subsets;
[0050] S33. Generate the feature depth of the learning subset according to the standard deviation of the learning set;
[0051] S34. Use several learning subsets to label the fire areas of the monitored image.
[0052] In the present invention, the global variance of the learning set is calculated to quantify the overall dispersion degree of the data. By generating multiple learning subsets, the sampling process with replacement of the random forest is simulated. Each subset contains some samples and features, increasing the diversity of the model. The feature depth is directly related to the complexity of the subset, facilitating the debugging of the model behavior. The output of the feature importance of the random forest can further explain the basis for fire detection. In the random forest, there is only one feature subset ratio parameter for the entire model, and all decision trees follow this parameter setting during training.
[0053] In an embodiment of the present invention, in S33, the feature depth is calculated by the formula:
[0054] ;
[0055] In the formula, Represents the th element of the learning subset, represents the logarithmic function, represents the standard deviation of all elements of the learning subset, represents the number of elements in the learning subset.
[0056] In the embodiment of the present invention, in S34, the mean value of the feature depths of all learning subsets is used as the feature subset ratio parameter of the random forest, and the random forest is used to label the fire area of the monitored image.
[0057] Those of ordinary skill in the art will realize that the embodiments described herein are for helping the reader understand the principles of the present invention, and it should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those of ordinary skill in the art can make various other specific deformations and combinations without departing from the essence of the present invention based on these technical revelations disclosed in the present invention, and these deformations and combinations are still within the protection scope of the present invention.
Claims
1. A fire warning method based on image processing, characterized in that, It includes the following steps: S1. Collect the monitoring images of the monitoring area; S2. Horizontally slide and traverse the monitoring images using a sliding box to generate a learning set for the monitoring images; S3. Determine the feature parameters of the random forest using the learning set and label the fire area using the random forest.
2. The fire warning method based on image processing according to claim 1, wherein The S2 includes the following sub-steps: S21. Set the step size of the sliding box and the window width of the sliding box to be the same; S22. Horizontally slide and traverse the monitoring images using the sliding box to obtain the expected pixel degrees of each column of the monitoring images; S23. Generate a learning set for the monitoring images according to the expected pixel degrees of each column of the monitoring images.
3. The fire warning method based on image processing according to claim 2, wherein, In S22, the expected pixel degree of the column of the monitoring image is calculated by the following formula: ; In the formula, represents the maximum pixel value of the th column of the monitoring image, represents the minimum pixel value of the th column of the monitoring image, represents the variance of the pixel values of all pixel points included in the sliding window when traversing the th column, represents the maximum pixel value of all pixel points included in the sliding window when traversing the th column, represents taking a random number between 0 and 1.
4. The fire warning method based on image processing according to claim 2, characterized in that, In the S23, calculate the mean value of the pixel values of the four neighboring pixel points around the pixel point, take the product between the mean value of the pixel values and the expected degree of the column where the pixel point is located as the predicted pixel value of the pixel point, calculate the root mean square error between the pixel value of the pixel point and the predicted pixel value, and generate the learning set of the monitoring images.
5. The fire warning method based on image processing according to claim 1, wherein The S3 includes the following sub-steps: S31. Extract the standard deviation of the learning set of the monitoring images; S32. Randomly split the learning set into several learning subsets; S33. Generate the feature depth of the learning subsets according to the standard deviation of the learning set; S34. Label the fire area of the monitoring images using several learning subsets.
6. The fire warning method based on image processing according to claim 5, characterized in that, In S33, the characteristic depth is calculated by the formula: ; In the formula, represents the th element of the learning subset, represents the logarithmic function, represents the standard deviation of all elements of the learning subset, represents the number of elements in the learning subset.
7. The fire warning method based on image processing according to claim 5, characterized in that, In the S34, take the mean value of the feature depths of all learning subsets as the feature subset ratio parameter of the random forest, and label the fire area of the monitoring images using the random forest.
Citation Information
Patent Citations
Target detection method and device
CN105869148A
Low-false-alarm flame smoke monitoring system, method and application
CN116778144A
Image sample construction method, target recognition model training method and related device
CN116912621A
Fire monitoring and early warning method and device based on big data analysis
CN119992742A