An outdoor flame detection method based on principal component analysis and global-local feature fusion
By fusing local and global features using principal component analysis and combining them with kernel density estimation, the problem of complex models and high hardware requirements in outdoor flame detection is solved, enabling efficient and accurate detection of weak flames, which is suitable for outdoor security monitoring.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA UNIV OF PETROLEUM (EAST CHINA)
- Filing Date
- 2023-11-20
- Publication Date
- 2026-06-30
Smart Images

Figure CN117671583B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of flame detection technology and relates to an outdoor flame detection method based on principal component analysis and fusion of global and local features. By using principal component analysis to fuse global and local feature information respectively, it is possible to detect and judge weak flames in large outdoor areas. Background Technology
[0002] Fire is one of the major disasters causing loss of life and property. Due to the spread and uncontrollability of fire, research on weak flame detection technology is beneficial for timely detection of weak flames and control of fire spread, and has significant practical application value. Traditional flame detection technology mainly designs sensors based on data such as smoke particles, temperature, and gas composition. These sensors have shown good application results in indoor flame detection, but due to the open and complex outdoor environment, flame detection is more difficult, and existing flame detection technologies are difficult to apply to outdoor scenarios. With the widespread use of video surveillance systems and the gradual improvement of image resolution, surveillance systems collect and store a large amount of video data. How to use video image information to detect weak flames has become a research hotspot in recent years. In the early stages of a fire, the flame gradually grows from a weak spark, and the shape, color, position, temperature, area, and other characteristics of the flame change accordingly. Feature analysis methods analyze these features of pixels, achieving high detection accuracy. However, existing feature analysis methods often design and perform judgment conditions separately for image features, without considering the correlation between features, which can easily lead to misjudgment of pixels, thus affecting the detection effect of weak flames; furthermore, existing flame detection methods are relatively complex, computationally expensive, and inefficient.
[0003] In existing technology, Chinese patent CN109165577B discloses an early forest fire detection method based on video images, relating to the field of video remote monitoring of fires. This method includes flame detection and smoke detection. Flame detection first obtains suspected flame areas in forest video images; it extracts effective static and dynamic features of the flames from these suspected flame areas, performs feature fusion, and then uses a support vector machine for classification to determine whether flames exist in the acquired forest images. Smoke detection first obtains suspected smoke areas in forest video images; it extracts effective static features of the smoke from these suspected smoke areas, performs feature fusion, and then uses a support vector machine for classification to determine whether smoke exists in the acquired forest images. However, this patent relies on relatively complex algorithms and models, making it difficult to maintain and optimize.
[0004] Chinese patent CN108038867A discloses a flame detection and localization method based on multi-feature fusion and stereo vision, which relates to the field of computer vision. This method uses an improved Vibe algorithm and OHTA color segmentation to extract suspected flame regions; then it extracts the shape features, morphological overlap features, and area change rate features of the target within the suspected flame regions to establish a multi-feature fusion model to obtain the probability of flame presence, and detects the presence of flame based on this probability; finally, based on the flame detection results and the SSDA stereo matching algorithm, it performs flame localization according to the principle of a parallel binocular stereo vision system. However, this patent does not consider using local and global feature fusion to comprehensively describe flame characteristics, thus failing to improve detection accuracy and the method's robustness.
[0005] Chinese patent CN108074234A discloses a large-space flame detection method based on target tracking and multi-feature fusion, which relates to the field of computer vision. This method uses a modified Gaussian mixture model (Gaussian model) background difference method and color segmentation to extract suspected flame regions; then, Kalman filtering is used to track targets within these suspected flame regions; finally, shape features, morphological overlap features, and area change rate features of the targets within these suspected flame regions are extracted to establish a multi-feature fusion model to obtain the probability of flame presence. Finally, the presence of flame is detected based on this probability. However, this patent relies on complex calculations and requires high-level hardware, resulting in high operating costs and maintenance difficulties, making it unsuitable for widespread adoption.
[0006] The aforementioned existing technologies all suffer from problems such as reliance on complex model algorithms, high hardware requirements, poor robustness, low detection accuracy, and low efficiency. Through research and analysis, the inventors found that no simple and efficient multivariate statistical detection method has been disclosed in the existing technology that utilizes principal component analysis (PCA) and can fuse multiple pixel features locally and multiple color features globally. Therefore, the invention of an outdoor flame detection method based on PCA-based global-local feature fusion can improve upon the shortcomings of existing technologies, enabling real-time and accurate detection of weak outdoor flames, reducing operating costs, and increasing the overall robustness of the method. Summary of the Invention
[0007] The purpose of this invention is to overcome the shortcomings of the prior art. Based on the improvement of the prior art, this invention designs and provides a simple and efficient multivariate statistical detection method that utilizes principal component analysis and can fuse multiple pixel features locally in an image and multiple color features globally in an image. In particular, it is an outdoor flame detection method based on the fusion of global and local features of principal component analysis, which solves the problems of existing technologies that rely on complex model algorithms, have high hardware requirements, poor robustness, low detection accuracy, and low efficiency.
[0008] To achieve the above objectives, this invention provides an outdoor flame detection method based on principal component analysis (PCA) for global and local feature fusion. This method first uses PCA to fuse multiple local static features, then uses PCA to fuse multiple global static features, and finally utilizes the dynamic change features of the video. This can improve the detection rate of flame pixels and thus improve the detection results of weak flames.
[0009] This invention provides an outdoor flame detection method based on principal component analysis and global-local feature fusion, comprising the following steps:
[0010] S1: Constructing local pixel monitoring indicators: Acquire flame images and extract various features of pixels to form training data X. p Establish a flame principal component analysis model and construct a local pixel monitoring index Ψ.
[0011] S2: Constructing global graph monitoring metrics: Acquire images without flames, extract various features from the entire image to construct training data X. g Establish a flameless principal component analysis model and construct global graph monitoring indicators.
[0012] S3: Flame Determination: Acquire real-time monitoring images and calculate point monitoring index Ψ and image monitoring index. The area change rate ΔA is used to determine whether a flame exists.
[0013] The present invention relates to an outdoor flame detection method based on principal component analysis and global-local feature fusion, wherein step S1 specifically includes the following steps:
[0014] S101: Acquire flame images;
[0015] S102: Extract 9 features from each pixel in the image to form a vector.
[0016] x p =[R,G,B,H,S,I,Y,Cb,Cr] T ;
[0017] Where R represents the red component, G represents the green component, B represents the blue component, H represents the hue, S represents the color saturation, I represents the brightness, Y represents the intensity, Cb represents the blue chromaticity component, and Cr represents the red chromaticity component.
[0018] S103: Utilizing N p The training data matrix consists of the feature vectors of each pixel. Calculate the training data matrix X p The mean and standard deviation of matrix X p Standardization is performed so that the mean of each column of data is 0 and the standard deviation is 1, resulting in a standardized data matrix.
[0019] S104: For the matrix Principal component analysis is performed, and singular value decomposition is used to extract the directions of greatest change.
[0020]
[0021] Where U and V represent unitary matrices, V is the projection matrix, and Σ represents the singular value matrix, whose diagonal elements are the standard deviations, corresponding to the projection vectors;
[0022] S105: Select the first a column vectors of matrix V to form the projection matrix P based on the magnitude of the variance. p ;
[0023] S106: Use the mean and standard deviation of the training data to analyze the feature vector x p Standardization process yields vectors The point principal component vector t is obtained by fusing multiple point features using the projection matrix. p ,
[0024]
[0025] S107: To monitor changes in the principal component space, establish monitoring statistics.
[0026]
[0027] Where, Σ a This represents a square matrix with the first 'a' singular values as diagonal elements;
[0028] S108: Given a confidence level α, determine the statistic using the kernel density estimation method. Control Limits
[0029] S109: Because the training data for this principal component model comes from flame images, therefore when When, it indicates that the pixel is a flame; when When the value is zero, it indicates that the pixel is not a flame; to facilitate logical judgment, a local pixel monitoring index Ψ is constructed.
[0030]
[0031] If Ψ≤1, it means that the pixel is not a flame; if Ψ>1, it means that the pixel is a flame.
[0032] The outdoor flame detection method based on principal component analysis and global-local feature fusion involved in this invention includes the following steps in step S2:
[0033] S201: Acquire flameless images of the monitored scene;
[0034] S202: Extract 27 global features from each image to form a vector.
[0035] x g =[e R ,e G ,e B ,e H ,e S ,e I ,e Y ,e Cb ,e Cr ,σ R ,σ G ,σ B ,σ H ,σ S ,σ I ,σ Y ,σ Cb ,σ Cr ,s R ,s G ,s B ,s H ,s S ,s I ,s Y ,s Cb ,s Cr ] T ;
[0036] Among them, e R ,e G ,e B ,e H ,e S ,e I ,e Y ,e Cb ,e Cr Let σ represent the first-order color moments of each component of the RGB, HSI, and YCbCr color spaces, respectively. R ,σ G ,σ B ,σ H ,σ S ,σ I ,σ Y ,σ Cb ,σ Cr s represents the second-order color moment of each component of each color space. R ,s G ,s B ,s H ,s S ,s I ,s Y ,s Cb ,sCr The third-order color moment represents each component of each color space. Taking the R component of the RGB color space as an example, the formulas for calculating its first, second, and third-order color moments are as follows:
[0037]
[0038]
[0039]
[0040] Where M represents the number of pixels in an image, R i Represents the R component of the i-th pixel;
[0041] S203: Utilizing N g The feature vectors of the images constitute the training data matrix. Calculate the training data matrix X g The mean and standard deviation of matrix X g Standardization is performed so that the mean of each column of data is 0 and the standard deviation is 1, resulting in a standardized data matrix.
[0042] S204: For the matrix Principal component analysis is performed, and the projection matrix P is obtained through the singular value decomposition algorithm. g ;
[0043] S205: Use the mean and standard deviation of the training data to analyze the feature vector x. g Standardization process yields vectors Calculate the principal element vector t of the graph using the projection matrix g ;
[0044]
[0045] S206: Monitoring metrics using a global graph Monitor changes in the principal component space of the graph;
[0046]
[0047] Where, Σ b This represents a square matrix with the first b singular values as diagonal elements;
[0048] S207: Given a confidence level α, determine global graph monitoring indicators using kernel density estimation. Control Limits
[0049] S208: Because the training data for this principal component model comes from images without flames, therefore when When, it indicates that there is no flame in the image; when The time indicates that the image contains flames.
[0050] The present invention relates to an outdoor flame detection method based on principal component analysis and global-local feature fusion, wherein step S3 specifically includes the following steps:
[0051] S301: Acquires real-time monitoring images;
[0052] S302: Extract 9 types of feature data from each pixel to form a vector x p =[R,G,B,H,S,I,Y,Cb,Cr] T ;
[0053] S303: Use the mean and standard deviation of the training data to analyze x p Standardization process yields vectors
[0054] S304: Calculate the point principal vector t using equation (2). p Calculate according to formula (3) The statistics are then used to calculate the local pixel monitoring index Ψ according to equation (4);
[0055] S305: Determine whether the monitoring index Ψ of a local pixel exceeds the control limit; if Ψ≤1, it indicates that the pixel is not a flame; if Ψ>1, it indicates that the pixel is a flame.
[0056] S306: Use variable A to represent the number of pixels in the image that are identified as flames. If A > 0, proceed to step S307; otherwise, return to step S301.
[0057] S307: Retain the pixels identified as flames, and set the pixels not identified as flames to black to obtain the target image;
[0058] S308: Calculate the global feature data of the target image according to equations (5), (6), and (7) to form a vector x. g =[e R ,e G ,e B ,e H ,e S ,e I ,e Y ,e Cb ,e Cr ,σ R ,σ G ,σ B ,σ H ,σ S ,σ I ,σ Y ,σ Cb ,σ Cr,s R ,s G ,s B ,s H ,s S ,s I ,s Y ,s Cb ,s Cr ] T ;
[0059] S309: Use the mean and standard deviation of the training data to analyze the feature vector x g Standardization process yields vectors
[0060] S310: Calculate the principal element vector t using equation (8). g Calculate the global map monitoring indicators according to equation (9). The static characteristics of interference sources such as sunset are similar to those of flames, but their dynamic characteristics are different. In order to reduce misjudgment, the dynamic change characteristics of flames are considered and the flame area change rate ΔA is calculated.
[0061]
[0062] Where A′ represents the number of pixels in the previous frame that were identified as flames;
[0063] S311: In the early stages of a fire, the rate of change of flame area is generally greater than 5%, and 5% is taken as the control limit; for global monitoring indicators... The judgment is made based on the area change rate ΔA. If both ΔA and ΔA exceed the control limits, it indicates that there is a flame at the monitoring site, and a fire alarm is issued. Then, the process returns to step S301. Otherwise, the process returns directly to step S301.
[0064] Compared with the prior art, the present invention has the following advantages: (1) The weak flame detection method provided by the present invention detects flames by analyzing video image data collected by monitoring cameras, which is suitable for open scenes where it is difficult to install flame sensors and can meet the needs of outdoor safety monitoring; (2) The principal component analysis method is used to statistically fuse multiple features of flame pixels, eliminating the correlation between features, and the kernel density estimation method is used to determine the statistical control limit, thereby establishing a local pixel monitoring index with a constant control limit, avoiding the need for manual determination of the control limit; (3) The global features of the image are fused using statistical analysis methods to establish a global image monitoring index, realizing the simultaneous monitoring of local and global feature information; (4) The static and dynamic feature information of the flame are considered at the same time, reducing misjudgment of suspected flame interference sources such as sunset; its overall process is simple, the principle is reliable, the weak flame detection is accurate, the real-time safety monitoring effect is good, the adaptability is wide, the logic is strong, and the environment is friendly. Attached Figure Description
[0065] Figure 1 This is a flowchart illustrating the working principle of the flame detection method involved in this invention.
[0066] Figure 2 This is a flowchart illustrating the process flow of the flame detection method involved in this invention.
[0067] Figure 3 This is the target extraction result of the 16th frame image of the flame test video involved in this invention.
[0068] Figure 4 This is the target extraction result of the 30th frame image of the flame test video involved in the present invention.
[0069] Figure 5 This is the target extraction result of the 50th frame image of the flame test video involved in this invention.
[0070] Figure 6 This is a trend chart of the monitoring index of pixel point 1 involved in the present invention.
[0071] Figure 7 This is a trend chart of the pixel point 2 monitoring index involved in the present invention.
[0072] Figure 8 This is a trend chart of the global graph monitoring indicators based on texture features involved in Example 4.
[0073] Figure 9 This is a trend chart of the global monitoring indicators involved in Example 4.
[0074] Figure 10 This is a graph showing the trend of the number of pixels in the target image involved in Example 5.
[0075] Figure 11 This is a graph showing the rate of change of the area of the target image involved in Example 5.
[0076] Reference numerals: (a), (d), and (g) are the original images; (b), (e), and (h) are the target images extracted based on the RGB-HSI model; (c), (f), and (i) are the target images extracted by the method involved in this invention. Figure 10 (j) is a graph showing the changing trend of the number of pixels in the suspected flame area in the sunset video. Figure 10 (k) is a trend chart showing the change in the number of pixels in the target image in the flame video; Figure 11 (l) is a graph showing the rate of change of the area of the suspected flame region in the sunset video. Figure 11 (m) is a curve showing the rate of change of the area of the target image in the flame video. Detailed Implementation
[0077] The technical solution of the present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0078] Example 1:
[0079] like Figure 1 As shown, this embodiment relates to an outdoor flame detection method based on principal component analysis and global-local feature fusion, including the following steps:
[0080] S1: Constructing local pixel monitoring indicators: Acquire flame images and extract various features of pixels to form training data X. p Establish a flame principal component analysis model and construct a local pixel monitoring index Ψ.
[0081] S2: Constructing global graph monitoring metrics: Acquire images without flames, extract various features from the entire image to construct training data X. g Establish a flameless principal component analysis model and construct global graph monitoring indicators.
[0082] S3: Flame Determination: Acquire real-time monitoring images and calculate point monitoring index Ψ and image monitoring index. The area change rate ΔA is used to determine whether a flame exists.
[0083] The outdoor flame detection method based on principal component analysis and global-local feature fusion involved in this embodiment includes the following steps in step S1:
[0084] S101: Acquire flame images;
[0085] S102: Extract 9 features from each pixel in the image to form a vector.
[0086] x p =[R,G,B,H,S,I,Y,Cb,Cr] T ;
[0087] Where R represents the red component, G represents the green component, B represents the blue component, H represents the hue, S represents the color saturation, I represents the brightness, Y represents the intensity, Cb represents the blue chromaticity component, and Cr represents the red chromaticity component.
[0088] S103: Utilizing N p The training data matrix consists of the feature vectors of each pixel. Calculate the training data matrix X p The mean and standard deviation of matrix X p Standardization is performed so that the mean of each column of data is 0 and the standard deviation is 1, resulting in a standardized data matrix.
[0089] S104: For the matrix Principal component analysis is performed, and singular value decomposition is used to extract the directions of greatest change.
[0090]
[0091] Where U and V represent unitary matrices, V is the projection matrix, and Σ represents the singular value matrix, whose diagonal elements are the standard deviations, corresponding to the projection vectors;
[0092] S105: Select the first a column vectors of matrix V to form the projection matrix P based on the magnitude of the variance. p ;
[0093] S106: Use the mean and standard deviation of the training data to analyze the feature vector x p Standardization process yields vectors The point principal component vector t is obtained by fusing multiple point features using the projection matrix. p ,
[0094]
[0095] S107: To monitor changes in the principal component space, a monitoring statistic T is established. p 2 ,
[0096]
[0097] Where, Σ a This represents a square matrix with the first 'a' singular values as diagonal elements;
[0098] S108: Given a confidence level α, determine the statistic using the kernel density estimation method. Control Limits
[0099] S109: Because the training data for this principal component model comes from flame images, therefore when When, it indicates that the pixel is a flame; when When the value is zero, it indicates that the pixel is not a flame; to facilitate logical judgment, a local pixel monitoring index Ψ is constructed.
[0100]
[0101] If Ψ≤1, it means that the pixel is not a flame; if Ψ>1, it means that the pixel is a flame.
[0102] This embodiment relates to an outdoor flame detection method based on principal component analysis and global-local feature fusion, wherein step S2 specifically includes the following steps:
[0103] S201: Acquire flameless images of the monitored scene;
[0104] S202: Extract 27 global features from each image to form a vector.
[0105] x g =[e R ,e G ,e B ,e H ,e S ,e I ,e Y ,e Cb ,e Cr ,σ R ,σ G ,σ B ,σ H ,σ S ,σ I ,σ Y ,σ Cb ,σ Cr ,s R ,s G ,s B ,s H ,s S ,s I ,s Y ,s Cb ,s Cr ] T ;
[0106] Among them, e R ,e G ,e B ,e H ,e S ,e I ,e Y ,e Cb ,e Cr Let σ represent the first-order color moments of each component of the RGB, HSI, and YCbCr color spaces, respectively. R ,σ G ,σ B ,σ H ,σ S ,σ I ,σ Y ,σ Cb ,σ Cr s represents the second-order color moment of each component of each color space. R ,s G ,s B ,s H ,s S ,s I ,s Y ,s Cb ,s CrThe third-order color moment represents each component of each color space. Taking the R component of the RGB color space as an example, the formulas for calculating its first, second, and third-order color moments are as follows:
[0107]
[0108]
[0109]
[0110] Where M represents the number of pixels in an image, R i Represents the R component of the i-th pixel;
[0111] S203: Utilizing N g The feature vectors of the images constitute the training data matrix. Calculate the training data matrix X g The mean and standard deviation of matrix X g Standardization is performed so that the mean of each column of data is 0 and the standard deviation is 1, resulting in a standardized data matrix.
[0112] S204: For the matrix Principal component analysis is performed, and the projection matrix P is obtained through the singular value decomposition algorithm. g ;
[0113] S205: Use the mean and standard deviation of the training data to analyze the feature vector x. g Standardization process yields vectors Calculate the principal element vector t of the graph using the projection matrix g ;
[0114]
[0115] S206: Monitoring metrics using a global graph Monitor changes in the principal component space of the graph;
[0116]
[0117] Where, Σ b This represents a square matrix with the first b singular values as diagonal elements;
[0118] S207: Given a confidence level α, determine global graph monitoring indicators using kernel density estimation. Control Limits
[0119] S208: Because the training data for this principal component model comes from images without flames, therefore when When, it indicates that there is no flame in the image; when The time indicates that the image contains flames.
[0120] This embodiment relates to an outdoor flame detection method based on principal component analysis and global-local feature fusion, wherein step S3 specifically includes the following steps:
[0121] S301: Acquires real-time monitoring images;
[0122] S302: Extract 9 types of feature data from each pixel to form a vector x p =[R,G,B,H,S,I,Y,Cb,Cr] T ;
[0123] S303: Use the mean and standard deviation of the training data to analyze x p Standardization process yields vectors
[0124] S304: Calculate the point principal vector t using equation (2). p Calculate according to formula (3) The statistics are then used to calculate the local pixel monitoring index Ψ according to equation (4);
[0125] S305: Determine whether the monitoring index Ψ of a local pixel exceeds the control limit; if Ψ≤1, it indicates that the pixel is not a flame; if Ψ>1, it indicates that the pixel is a flame.
[0126] S306: Use variable A to represent the number of pixels in the image that are identified as flames. If A > 0, proceed to step S307; otherwise, return to step S301.
[0127] S307: Retain the pixels identified as flames, and set the pixels not identified as flames to black to obtain the target image;
[0128] S308: Calculate the global feature data of the target image according to equations (5), (6), and (7) to form a vector x. g =[e R ,e G ,e B ,e H ,e S ,e I ,e Y ,e Cb ,e Cr ,σ R ,σ G ,σ B ,σ H ,σ S ,σ I ,σ Y ,
[0129] σCb ,σ Cr ,s R ,s G ,s B ,s H ,s S ,s I ,s Y ,s Cb ,s Cr ] T ;
[0130] S309: Use the mean and standard deviation of the training data to analyze the feature vector x g Standardization process yields vectors
[0131] S310: Calculate the principal element vector t using equation (8). g Calculate the global map monitoring indicators according to equation (9). The static characteristics of interference sources such as sunset are similar to those of flames, but their dynamic characteristics are different. In order to reduce misjudgment, the dynamic change characteristics of flames are considered and the flame area change rate ΔA is calculated.
[0132]
[0133] Where A′ represents the number of pixels in the previous frame that were identified as flames;
[0134] S311: In the early stages of a fire, the rate of change of flame area is generally greater than 5%, and 5% is taken as the control limit; for global monitoring indicators... The judgment is made based on the area change rate ΔA. If both ΔA and ΔA exceed the control limits, it indicates that there is a flame at the monitoring site, and a fire alarm is issued. Then, the process returns to step S301. Otherwise, the process returns directly to step S301.
[0135] like Figure 2 As shown, in the above method, steps S1 to S2 are the offline modeling stage, and step S3 is the online detection stage.
[0136] Example 2:
[0137] like Figure 3-5 As shown, this embodiment applies the outdoor flame detection method based on principal component analysis and global-local feature fusion to a flame test video. The video contains 200 frames, each containing 600×500 pixels. Frames 1-15 represent a normal, flame-free scene, with flames appearing starting from frame 16. Frames 16, 30, and 50 of the video are shown in the diagram below. Figure 3 (a) Figure 4 (d) Figure 5 As shown in (g).
[0138] The specific implementation steps for performing flame detection on the above video using an outdoor flame detection method based on principal component analysis and global-local feature fusion are as follows:
[0139] S1: Constructing local pixel monitoring indicators: Acquire flame images and extract various features of pixels to form training data X. p Establish a flame principal component analysis model and construct a local pixel monitoring index Ψ.
[0140] S2: Constructing global graph monitoring metrics: Acquire images without flames, extract various features from the entire image to construct training data X. g Establish a flameless principal component analysis model and construct a global graph monitoring index T. g 2 ;
[0141] S3: Flame Determination: Acquire real-time monitoring images and calculate point monitoring index Ψ and image monitoring index T. g 2 The area change rate ΔA is used to determine whether a flame exists.
[0142] The outdoor flame detection method based on principal component analysis and global-local feature fusion involved in this embodiment includes the following steps in step S1:
[0143] S101: Acquire flame images, obtaining 12,000 flame pixels;
[0144] S102: Extract 9 features from each pixel in the image to form a vector.
[0145] x p =[R,G,B,H,S,I,Y,Cb,Cr] T ;
[0146] Where R represents the red component, G represents the green component, B represents the blue component, H represents the hue, S represents the color saturation, I represents the brightness, Y represents the intensity, Cb represents the blue chromaticity component, and Cr represents the red chromaticity component.
[0147] S103: Use the feature vectors of 12,000 pixels to construct the training data matrix X p ∈R 12000×9 Calculate the training data matrix X p The mean and standard deviation of matrix X p Standardization is performed so that the mean of each column of data is 0 and the standard deviation is 1, resulting in a standardized data matrix.
[0148] S104: For the matrix Principal component analysis is performed, and singular value decomposition is used to extract the directions of greatest change.
[0149]
[0150] Where U and V represent unitary matrices, V is the projection matrix, and Σ represents the singular value matrix, whose diagonal elements are the standard deviations, corresponding to the projection vectors;
[0151] S105: Select the first two column vectors of matrix V based on the magnitude of the variance to form the projection matrix P. p ;
[0152] S106: Use the mean and standard deviation of the training data to analyze the feature vector x p Standardization process yields vectors The point principal component vector t is obtained by fusing multiple point features using the projection matrix. p ,
[0153]
[0154] S107: To monitor changes in the principal component space, a monitoring statistic T is established. p 2 ,
[0155]
[0156] Where, Σ a This represents a square matrix whose first two singular values are diagonal elements;
[0157] S108: Given a confidence level of 0.05, determine the statistic using the kernel density estimation method. Control Limits
[0158] S109: Because the training data for this principal component model comes from flame images, therefore when When, it indicates that the pixel is a flame; when When the value is zero, it indicates that the pixel is not a flame; to facilitate logical judgment, a local pixel monitoring index Ψ is constructed.
[0159]
[0160] If Ψ≤1, it means that the pixel is not a flame; if Ψ>1, it means that the pixel is a flame.
[0161] This embodiment relates to an outdoor flame detection method based on principal component analysis and global-local feature fusion, wherein step S2 specifically includes the following steps:
[0162] S201: Acquire 300 frames of flame-free images of the monitored scene;
[0163] S202: Extract 27 global features from each image to form a vector.
[0164] x g =[e R ,e G ,e B ,e H ,e S ,e I ,e Y ,e Cb ,e Cr ,σ R ,σ G ,σ B ,σ H ,σ S ,σ I ,σ Y ,σ Cb ,σ Cr ,s R ,s G ,s B ,s H ,s S ,s I ,s Y ,s Cb ,s Cr ] T ;
[0165] Among them, e R ,e G ,e B ,e H ,e S ,e I ,e Y ,e Cb ,e Cr Let σ represent the first-order color moments of each component of the RGB, HSI, and YCbCr color spaces, respectively. R ,σ G ,σ B ,σ H ,σ S ,σ I ,σ Y ,σ Cb ,σ Cr s represents the second-order color moment of each component of each color space. R ,s G ,s B ,s H ,s S ,s I ,s Y ,s Cb ,s CrThe third-order color moment represents each component of each color space. Taking the R component of the RGB color space as an example, the formulas for calculating its first, second, and third-order color moments are as follows:
[0166]
[0167]
[0168]
[0169] Where M represents the number of pixels in an image, R i Represents the R component of the i-th pixel;
[0170] S203: Construct a training data matrix X using the feature vectors of 300 images. g ∈R 300×27 Calculate the training data matrix X g The mean and standard deviation of matrix X g Standardization is performed so that the mean of each column of data is 0 and the standard deviation is 1, resulting in a standardized data matrix.
[0171] S204: For the matrix Principal component analysis was performed, and four principal components were selected based on the variance information to obtain the projection matrix P. g ;
[0172] S205: Use the mean and standard deviation of the training data to analyze the feature vector x. g Standardization process yields vectors Calculate the principal element vector t of the graph using the projection matrix g ;
[0173]
[0174] S206: Monitoring metrics using a global graph Monitor changes in the principal component space of the graph;
[0175]
[0176] Where, Σ b This represents a square matrix whose first four singular values are diagonal elements;
[0177] S207: Given a confidence level of 0.05, determine the global graph monitoring indicators using the kernel density estimation method. Control Limits
[0178] S208: Because the training data for this principal component model comes from images without flames, therefore when When, it indicates that there is no flame in the image; when The time indicates that the image contains flames.
[0179] This embodiment relates to an outdoor flame detection method based on principal component analysis and global-local feature fusion, wherein step S3 specifically includes the following steps:
[0180] S301: Acquires real-time monitoring images;
[0181] S302: Extract 9 types of feature data from each pixel to form a vector x p =[R,G,B,H,S,I,Y,Cb,Cr] T ;
[0182] S303: Use the mean and standard deviation of the training data to analyze x p Standardization process yields vectors
[0183] S304: Calculate the point principal vector t using equation (2). p Calculate according to formula (3) The statistics are then used to calculate the local pixel monitoring index Ψ according to equation (4);
[0184] S305: Determine whether the monitoring index Ψ of a local pixel exceeds the control limit; if Ψ≤1, it indicates that the pixel is not a flame; if Ψ>1, it indicates that the pixel is a flame.
[0185] S306: Use variable A to represent the number of pixels in the image that are identified as flames. If A > 0, proceed to step S307; otherwise, return to step S301.
[0186] S307: Retain the pixels identified as flames, and set the pixels not identified as flames to black to obtain the target image;
[0187] S308: Calculate the global feature data of the target image according to equations (5), (6), and (7) to form a vector x. g =[e R ,e G ,e B ,e H ,e S ,e I ,e Y ,e Cb ,e Cr ,σ R ,σ G ,σ B ,σ H ,σ S ,σ I ,σ Y ,
[0188] σ Cb ,σ Cr ,s R ,s G ,s B ,s H ,s S ,s I ,s Y ,s Cb ,s Cr ] T ;
[0189] S309: Use the mean and standard deviation of the training data to analyze the feature vector x g Standardization is performed to obtain vector x~ g ;
[0190] S310: Calculate the principal element vector t using equation (8). g Calculate the global map monitoring indicators according to equation (9). The static characteristics of interference sources such as sunset are similar to those of flames, but their dynamic characteristics are different. In order to reduce misjudgment, the dynamic change characteristics of flames are considered and the flame area change rate ΔA is calculated.
[0191]
[0192] Where A′ represents the number of pixels in the previous frame that were identified as flames;
[0193] S311: In the early stages of a fire, the rate of change of flame area is generally greater than 5%, and 5% is taken as the control limit; for global monitoring indicators... The judgment is made based on the area change rate ΔA. If both ΔA and ΔA exceed the control limits, it indicates that there is a flame at the monitoring site, a fire alarm is issued, and then the process returns to step S301; otherwise, it directly returns to step S301.
[0194] like Figure 6 and Figure 7 As shown, in the local pixel monitoring stage, taking pixel 1 (550, 350) and pixel 2 (100, 250) as examples, the local pixel flame detection effect is illustrated: Pixel 1 is a normal, flame-free pixel in frames 1-15, and a flame pixel from frame 16 onwards. The changing trend of the pixel monitoring index Ψ is as follows. Figure 6 As shown, the monitoring index for the normal scene is below the control limit, while the monitoring index for the flame scene is above the control limit. Pixel 2 represents the normal scene in frames 1-123, and the flame pixel in frame 124 and thereafter. The trend of the pixel monitoring index Ψ is as follows. Figure 7 As shown, the monitoring index exceeded the control limit in frame 124; the monitoring curves of pixels 1 and 2 indicate that the method of this embodiment can detect flame pixels in a timely and effective manner.
[0195] Example 3:
[0196] In this embodiment, the method based on the RGB-HSI model is compared with the method in Embodiment 2 during the target image extraction stage.
[0197] The rule for determining flame pixels based on the RGB-HSI model is as follows:
[0198] rule1: R > R T
[0199] rule2: R ≥ G > B
[0200] rule 3: S ≥ (255 - R)S T / R T
[0201] Among them, R T and S T These are the thresholds for the red component and saturation, with reference ranges of 55–65 and 115–135, respectively. Target image extraction is performed based on pixel monitoring. The target extraction results for frames 16, 30, and 50 of the test video are as follows: Figure 3-5 As shown, (a), (d), and (g) are the original images, (b), (e), and (h) are the target images extracted based on the RGB-HSI model, and (c), (f), and (i) are the target images extracted by the method of Example 2. By comparison, it can be seen that the method of Example 2 of the present invention can extract the outer flame of the flame, thereby giving a more complete flame outline.
[0202] Example 4:
[0203] In this embodiment, during the global graph monitoring phase, a texture feature method is used for comparison with the method in Embodiment 2. The texture features used include energy, entropy, moment of inertia, and correlation.
[0204] Figure 8 The trend of global graph monitoring indicators based on texture features shows that during the flameless phase of frames 1-15, the monitoring indicators produced multiple false alarms. This is because texture features are greatly affected by factors such as lighting and reflection. Figure 9 The trend of the global monitoring indicators of this invention shows that the method of this invention has a low false alarm rate and can detect flames in a timely manner.
[0205] Example 5:
[0206] To compare the processing results of flames and other interference sources, this embodiment uses the method of Embodiment 2 to process the sunset video and calculate the area change rate of the target image.
[0207] Figure 10 (j) is a trend chart of the number of pixels in the suspected flame area in the sunset video. It can be seen that the area of the suspected flame area changes little. Figure 10 (k) is a trend graph showing the change in the number of pixels in the target image in the fire video. It can be seen that when a fire occurs, the area of the fire region increases rapidly. As the fire spreads, the area of the fire region gradually increases, which is significantly different from the area change of the suspected fire region in the sunset video.
[0208] Figure 11 (l) is a curve showing the rate of change of the area of the suspected flame area in the sunset video. It can be seen that the rate of change of the area is below the control limit of 5%. Figure 11 (m) is a curve showing the rate of change of the area of the target image in the flame video. It can be seen that in frames 1-15, the rate of change of the target image's area is below the control limit; in frame 16, the rate of change of the target image's area increases rapidly, exceeding the control limit, indicating that there is a flame at the monitoring site, triggering a fire alarm. The implementation results show that the method involved in Example 2 can effectively avoid misjudging suspected flame interference sources, promptly detect weak flames and issue alarms, helping regulatory personnel to take timely fire-fighting measures to reduce fire losses.
Claims
1. An outdoor flame detection method based on principal component analysis and global-local feature fusion, characterized in that, Includes the following steps: S1: Constructing local pixel monitoring indicators: Acquire flame images and extract various features of pixels to form training data. Establish a flame principal component analysis model and construct local pixel monitoring indicators. ; S2: Constructing global graph monitoring metrics: Acquire images without flames, extract various features from the entire image to form training data. Establish a flameless principal component analysis model and construct global graph monitoring indicators. ; S3: Flame Detection: Acquire real-time monitoring images and calculate point monitoring indicators. Graph monitoring indicators and area change rate To determine if a flame exists; Specifically, step S1 includes the following steps: S101: Acquire flame images; S102: Extract 9 features from each pixel in the image to form a vector. ; in, Indicates the red component. Indicates the green component. Indicates the blue component. Indicates hue, Indicates color saturation. Indicates brightness. Indicates intensity. Represents the blue chromaticity component. Indicates the red chromaticity component; S103: Exploit The training data matrix consists of the feature vectors of each pixel. Calculate the training data matrix The mean and standard deviation of the matrix Standardization is performed so that the mean of each column of data is 0 and the standard deviation is 1, resulting in a standardized data matrix. ; S104: For the matrix Principal component analysis is performed, and singular value decomposition is used to extract the directions of greatest change. Equation (1) in, and Represents a unitary matrix. Let be the projection matrix. This represents a singular value matrix, whose diagonal elements are the standard deviations, corresponding to the projection vectors; S105: Select the matrix based on the magnitude of the variance The first a column vectors form the projection matrix ; S106: Use the mean and standard deviation of the training data to analyze the feature vectors. Standardization process yields vectors The point principal component vector is obtained by fusing multiple point features using the projection matrix. , Equation (2) S107: To monitor changes in the principal component space, establish monitoring statistics. , Equation (3) in, This represents a square matrix with the first 'a' singular values as diagonal elements; S108: Given confidence level Determine the statistical measure Control Limits ; S109: When When, it indicates that the pixel is a flame; when When this occurs, it indicates that the pixel is not a flame; construct local pixel monitoring indicators. , Equation (4) if This indicates that the pixel is not a flame; if This indicates that the pixel represents a flame. Specifically, step S2 includes the following steps: S201: Acquire images without flame; S202: Extract 27 global features from each image to form a vector. ; in, These represent the first-order color moments of each component of the RGB, HSI, and YCbCr color spaces, respectively. Represents the second-order color moments of each component of each color space. The third-order color moment represents each component of each color space. Taking the R component of the RGB color space as an example, the formulas for calculating its first, second, and third-order color moments are as follows: Equation (5) Equation (6) Equation (7) in, This represents the number of pixels in an image. Indicates the first R component of each pixel; S203: Exploit The feature vectors of the images constitute the training data matrix. Calculate the training data matrix The mean and standard deviation of the matrix Standardization is performed so that the mean of each column of data is 0 and the standard deviation is 1, resulting in a standardized data matrix. ; S204: For the matrix Perform principal component analysis and obtain the projection matrix using the singular value decomposition algorithm. ; S205: Use the mean and standard deviation of the training data to analyze the feature vectors. Standardization process yields vectors Calculate the principal element vector of the graph using the projection matrix. ; Equation (8) S206: Monitoring metrics using a global graph Monitor changes in the principal component space of the graph; Equation (9) in, This represents a square matrix with the first b singular values as diagonal elements; S207: Given a confidence level Determine global monitoring metrics Control Limits ; S208: When When, it indicates that there is no flame in the image; when The time indicates that the image contains flames.
2. The outdoor flame detection method based on principal component analysis and global-local feature fusion according to claim 1, characterized in that: In step S108, the statistic is determined. Control Limits The method is the kernel density estimation method.
3. The outdoor flame detection method based on principal component analysis and global-local feature fusion according to claim 1, characterized in that: The image acquired in step S201 is a flameless image of the monitored scene.
4. The outdoor flame detection method based on principal component analysis and global-local feature fusion according to claim 1, characterized in that: In step S207, the global graph monitoring indicators are determined. Control Limits The method is the kernel density estimation method.
5. The outdoor flame detection method based on principal component analysis and global-local feature fusion according to claim 1, characterized in that: Step S3 specifically includes the following steps: S301: Acquires real-time monitoring images; S302: Extract 9 types of feature data from each pixel to form a vector. ; S303: Using the mean and standard deviation of the training data to... Standardization process yields vectors ; S304: Calculate the point principal vector using equation (2) Calculate according to formula (3) The statistics are then used to calculate the local pixel monitoring index according to equation (4). ; S305: Determine local pixel monitoring indicators Does it exceed the control limits? If This indicates that the pixel is not a flame; if This indicates that the pixel represents a flame. S306: Using Variables This represents the number of pixels in the image that are identified as flames. If not, proceed to step S307; otherwise, return to step S301. S307: Retain the pixels identified as flames, and set the pixels not identified as flames to other colors to obtain the target image; S308: Calculate the global feature data of the target image to form a vector according to equations (5), (6), and (7). ; S309: Use the mean and standard deviation of the training data to analyze the feature vectors. Standardization process yields vectors ; S310: Calculate the principal element vector using equation (8) Calculate the global map monitoring indicators according to equation (9). To reduce misjudgment, the dynamic characteristics of flame changes are considered, and the flame area change rate is calculated. ; Equation (10) in, This indicates the number of pixels in the previous frame that were identified as flames. S311: Monitoring metrics for the global graph and area change rate Make a judgment, if and If all exceed the control limits, it indicates that there is a flame at the monitored site, and a fire alarm is issued. Then, return to step S301; otherwise, return directly to step S301.
6. The outdoor flame detection method based on principal component analysis and global-local feature fusion according to claim 5, characterized in that: In step S307, pixels that are not identified as flames are set to black.
7. The outdoor flame detection method based on principal component analysis and global-local feature fusion according to claim 5, characterized in that: In step S311 The control limit is 5%.