Visible light sensing equipment-based vaporous gas leakage visual detection method and system

Through the visual detection method of mist gas leakage based on visible light sensing equipment, the transmittance, consistency, uniformity and HOG features are extracted, combined with the support vector machine classification model and adaptive weighted voting algorithm, to solve the problem of gas leakage in the existing technology. It solves the complexity and real-time problems of leak detection and achieves high accuracy and economical detection.

CN118628975AActive Publication Date: 2024-09-10NANJING UNIV OF AERONAUTICS & ASTRONAUTICS

Patent Information

Application Number
CN202410668085.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-09-10
Estimated Expiration
2044-05-28

AI Technical Summary

Technical Problem

Existing gas leak detection methods are complex and susceptible to external factors such as temperature, making it difficult to achieve economical real-time detection. Especially during aviation refueling, they cannot effectively determine the oil and gas leak status.

Method used

A foggy gas leak visual detection method based on visible light sensing equipment is used to obtain leakage scene images in real time, and extract transmittance, consistency, uniformity and HOG features, combined with a support vector machine classification model and an adaptive weighted voting algorithm. Determine the status of gas leakage.

Benefits of technology

It improves the accuracy of mist gas leak status determination, has low cost and is suitable for a variety of scenarios. It has strong versatility and can effectively detect gas leaks in various environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628975A
    Figure CN118628975A
Patent Text Reader

Abstract

The invention discloses a visual detection method and system for vaporific gas leakage based on visible light sensing equipment. The method comprises the following steps: acquiring a global image of a leakage scene in real time by utilizing the visible light sensing equipment; obtaining a suspected leakage area image; preprocessing the image data in the region to obtain a grayscale image and an RGB image; carrying out foggy gas leakage transmissivity and foggy gas leakage coincidence feature extraction on the RGB image to obtain a high-dimensional transmissivity feature and a high-dimensional coincidence feature of the RGB image; misty gas leakage uniformity and HOG feature extraction is carried out on the pre-grayscale image to obtain a high-dimensional uniformity feature and a high-dimensional HOG feature of the grayscale image; and respectively importing the extracted four groups of features into four SVM classification models, introducing a confidence coefficient real-time optimization weight into the classification models, designing an adaptive weight weighted voting algorithm, integrating prediction results of four base classifiers, and outputting a final gas leakage state. The method is low in cost and high in universality, and the accuracy of judging the leakage state of the vaporous gas is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image processing, and in particular relates to a visual detection method and system for mist gas leakage based on visible light sensing equipment. Background Art

[0002] Safety awareness and preventive measures for gas leakage are generally valued in various fields, and real-time monitoring of leakage incidents is also of great significance. In the modern industrial field, toxic gas leakage in chemical plants will not only harm workers, but may also have serious impacts on nearby residents and the ecosystem. In the aviation field, oil and gas leakage from the cone sleeve of the docking refueling section will not only cause visual interference to the pilot, but also pose a major safety hazard if it enters the engine. Therefore, timely and accurate provision of gas leakage status information can effectively reduce the probability of continuous occurrence of dangerous situations.

[0003] At present, in response to sudden safety issues such as toxic gas leakage during storage, laser gas detectors are used in combination with visible light sensing equipment to achieve full coverage of gas leakage detection in the area to be detected; some scholars have proposed using various gas sensors to build a wireless sensor network to monitor the leakage status of compressed toxic gas in the warehouse in real time; some institutions have realized real-time detection of cloud-like leaking gas based on the principle of thermal imaging, combined with scale-invariant feature transformation and support vector machine; in addition, there are methods such as ultrasound and optical flow to locate the gas leakage area and judge the leakage status. In response to the oil and gas leakage problem during aerial refueling, some scholars have proposed improvements in hardware, by improving the material properties of the oil hose and the refueling cone sleeve, and optimizing the mechanical structure between them, so as to reduce the probability of oil and gas leakage; however, the occurrence of oil leakage is inevitable, and this method cannot effectively judge the online oil and gas leakage status in real time. Therefore, some studies have proposed a method for detecting leaking oil and gas based on the principle of infrared thermal imaging. By installing an oil and gas leakage detection device embedded with an infrared detector on the refueling wing, regional gas detection is performed on the refueling area to determine whether there is an oil and gas leak.

[0004] However, in actual applications, both the methods based on sensor networks and infrared devices to detect gas leakage are relatively complex and difficult to implement. They lack economy and are easily affected by external factors such as temperature. In contrast, the method of using visible light sensing equipment such as warehouse monitoring equipment and cameras inside the receiving cabin to detect leaking gas is easy to implement and has strong environmental adaptability. Summary of the invention

[0005] Purpose of the invention: The present invention proposes a visual detection method and system for mist gas leakage based on visible light sensing equipment, which can be used for the detection of various atomized gases and can improve the accuracy of judging the leakage status of mist gas.

[0006] Technical solution: The present invention discloses a visual detection method for mist gas leakage based on a visible light sensing device, which specifically includes the following steps:

[0007] (1) Use visible light sensing equipment to obtain a global image of the leakage scene in real time;

[0008] (2) extracting the suspected leakage area from the global image to obtain an image of the suspected leakage area;

[0009] (3) Preprocessing the image data in the area to obtain a preprocessed grayscale image and RGB image;

[0010] (4) extracting the transmittance feature of mist leakage from the RGB image to obtain the high-dimensional transmittance feature of the RGB image;

[0011] (5) Extracting the consistency feature of mist leakage from the RGB image to obtain the high-dimensional consistency feature of the RGB image;

[0012] (6) Extracting the uniformity feature of mist leakage from the grayscale image to obtain the high-dimensional uniformity feature of the grayscale image;

[0013] (7) Extracting the HOG feature of fog gas leakage from the grayscale image to obtain the high-dimensional HOG feature of the grayscale image;

[0014] (8) The four sets of extracted features are respectively imported into four SVM classification models to obtain four prediction results of the corresponding features;

[0015] (9) Introduce confidence in real-time optimization weights in the classification model, design an adaptive weighted voting algorithm, integrate the prediction results of the four base classifiers, and output the final gas leakage status.

[0016] Furthermore, the implementation process of step (3) is as follows:

[0017] The image in the area is scaled normalized, and the edge detection algorithm is used to detect the edge of the grayscale image to highlight the contour information in the image; the coordinates of the non-zero pixel points in the image are obtained, and these coordinates are fitted into an ellipse through the ellipse fitting algorithm; finally, an elliptical mask is created on the grayscale image and RGB image respectively, and the corresponding elliptical area is extracted.

[0018] Furthermore, the implementation process of step (4) is as follows:

[0019] For each pixel (x, y) in the leakage image, its dark channel value Dark(x, y) is:

[0020] Dark(x,y)=min{R(x,y),G(x,y),B(x,y)} (1)

[0021] Among them, R(x,y), G(x,y), and B(x,y) are the RGB values ​​of the pixel point (x,y);

[0022] A certain RGB block in the image is H, with a size of M×N. The dark channel block is constructed by calculating the dark channel values ​​of all pixels in the block, and the block transmittance H is estimated T :

[0023]

[0024] Where W is a weight parameter used to control the smoothness of transmittance; H Al To estimate the atmospheric light, sort all pixel values ​​in the dark channel block in ascending order and take the maximum value of the first W% for estimation:

[0025] H Al =max{Dark(x,y)},(x,y)∈M×N×W% (3)

[0026] Use the boundary clipping method to limit the range of the calculated transmittance of all blocks:

[0027]

[0028] in, is the block transmittance that meets the specifications; the transmittance of each block of the input image is calculated, that is, the transmittance values ​​corresponding to M blocks are obtained, and they are compressed into a 1×M feature vector, that is, the M-dimensional transmittance feature describing the input image is obtained.

[0029] Furthermore, the implementation process of step (5) is as follows:

[0030] For a block H of size M×N in the leakage image, its RGB mean H avg for:

[0031]

[0032] Among them, R(x,y), G(x,y), and B(x,y) are the RGB values ​​of the pixel point (x,y) in the block respectively;

[0033] Calculate the RGB mean of the 8 adjacent blocks of block H and form a mean array V avg :

[0034] V avg = {V 1 ,V 2 ,…,V i},i=1,2,…,8 (6)

[0035] Among them, V1 , V 2 ···V i is the RGB mean of adjacent blocks;

[0036] To obtain the distance array H that represents the degree of color gamut change between block H and adjacent blocks dist , respectively, to obtain H avg With V avg The Euclidean distance of each element in is:

[0037] H dist ={D 1 ,D 2 ,…,D i},i=1,2,…,8 (7)

[0038] Among them, the difference D i The calculation formula is as follows:

[0039] D i =||H avg -V i ||,i=1,2,…,8 (8)

[0040] Based on the distance array H dist , calculate the compatibility feature H of block H cons. :

[0041]

[0042] in, It is the largest element in the distance array, representing the maximum difference in the color gamut; It is the smallest element in the distance array, representing the minimum difference in the color gamut; for each block matching feature of the input image, the matching values ​​corresponding to the M blocks are obtained, and they are compressed into a 1×M feature vector, that is, the M-dimensional matching feature describing the input image is obtained.

[0043] Furthermore, the implementation process of step (6) is as follows:

[0044] For a grayscale block I in the leakage image, whose size is M×N, calculate the grayscale average value of block I

[0045]

[0046] Where I(x,y) represents the pixel value with coordinates (x,y) in the block;

[0047] For each pixel in I, calculate its uniformity factor in turn, and accumulate and average the values ​​to get the block uniformity

[0048]

[0049] in, is the uniformity factor of a single pixel:

[0050]

[0051] The uniformity of each block of the input image is calculated, that is, the uniformity values ​​corresponding to M blocks are obtained, and they are compressed into a 1×M feature vector, that is, the M-dimensional uniformity feature describing the input image is obtained.

[0052] Furthermore, the implementation process of step (7) is as follows:

[0053] For the pixel point (x, y), first pass the gradient operator [-1, 0, 1] and [-1, 0, 1] in the horizontal and vertical directions respectively. T Perform convolution operation on the original image to obtain the gradient component G in the corresponding direction x (x,y) and G y (x, y), and then calculate the gradient magnitude G(x, y) and gradient direction θ(x, y) at the pixel:

[0054]

[0055] The 180° gradient direction is divided into M blocks, each block corresponds to an angular interval, and the gradient information of the corresponding interval is counted to form a gradient direction histogram; specifically, for a certain cell unit, its gradient direction and gradient amplitude are first calculated, and then the gradient amplitude is mapped to the angular interval corresponding to the gradient direction to obtain a gradient direction histogram containing M amplitudes, that is, the M-dimensional feature vector corresponding to the cell unit;

[0056] Adjacent cell units are grouped into a block, and multiple cell units in the block together constitute the features of the block, generating the HOG feature vector of the entire image.

[0057] Furthermore, in step (9), the confidence real-time optimization weight is introduced into the classification model, and the implementation process of the adaptive weighted voting algorithm is designed as follows:

[0058] Confidence represents the degree of trust the classifier has in the prediction result, which is measured by the decision function distance DFD. The decision function distance represents the distance between the sample point and the hyperplane. The support vector machine determines the category to which the sample point belongs based on its size. The larger the distance, the higher the probability of being classified into that category, and the more trust is given to that category. Specifically, in the decision function, the sign function classifies the input sample according to the size of the decision function distance. The confidence of the classification model is:

[0059]

[0060] Among them, C i is the current confidence of the i-th classification model; x is the input sample, x i is the support vector, α i is the Lagrange multiplier of the support vector, y i is the category label of the support vector, rho is the bias term, K(x i ,x) is the kernel function.

[0061] The present invention provides a visual detection system for mist gas leakage based on a visible light sensing device, comprising:

[0062] Image acquisition module, which acquires the global image of the leakage scene in real time based on visible light sensing equipment;

[0063] A suspected leakage area extraction module extracts the suspected leakage area and segments the area image;

[0064] The data preprocessing module takes the image of the suspected leakage area as input and further locates the background target area under different channels by using the structural characteristics of the leaking gas container itself;

[0065] A mist gas leakage multi-feature extraction module is used to extract several mist gas leakage features in the target area and generate corresponding mist gas leakage feature vectors;

[0066] The gas leakage status determination module is used to take multiple mist gas leakage feature vectors as input, combine the trained support vector machine classification model and adaptive weighted voting ensemble learning algorithm, determine the gas leakage status and output the result.

[0067] Furthermore, the mist gas leakage characteristics include transmittance characteristics, conformity characteristics, uniformity characteristics and HOG characteristics.

[0068] Furthermore, the support vector machine introduces confidence to optimize weights in real time, so that the weights can change dynamically with the degree of trust of the classification model to different input samples.

[0069] Beneficial effects: Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention can judge the gas leakage status in the suspected leakage area by relying only on visible light sensing equipment, with low cost and strong versatility, and is suitable for various scenarios; the present invention utilizes the motion characteristics of gas leakage, combines the structural characteristics of the leakage surface to introduce transmittance, consistency, uniformity and HOG features, improves the generalization ability of the gas leakage detection model, and is suitable for the detection of a variety of atomized gases; the present invention takes into account the strong correlation between features, designs a multi-classifier training strategy, integrates different classifier perspectives to reduce overfitting and thus improves model performance, and in view of the problem that weighted voting cannot adjust weights for different samples, introduces confidence to optimize weights in real time, thereby improving the accuracy of the judgment of the mist gas leakage status. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 is a flow chart of a visual detection method for mist gas leakage based on visible light sensing equipment;

[0071] Figure 2 It is a schematic diagram of the application scenario;

[0072] Figure 3 Schematic diagram of image preprocessing effect; (a) is a schematic diagram of image preprocessing effect taking a gas canister as an example; (b) is a schematic diagram of image preprocessing effect taking a cone sleeve as an example;

[0073] Figure 4 The images of each stage are taken as an example of the oil leakage of the cone sleeve; among them, (a) is the original image of oil and gas leakage; (b) is the original image without leakage; (c) is the effect diagram of the oil and gas leakage transmittance feature extraction; (d) is the effect diagram of the non-leakage transmittance feature extraction; (e) is the effect diagram of the oil and gas leakage consistency feature extraction; (f) is the effect diagram of the non-leakage consistency feature extraction; (g) is the effect diagram of the oil and gas leakage uniformity feature extraction; (h) is the effect diagram of the non-leakage uniformity feature extraction; (i) is the effect diagram of the oil and gas leakage HOG feature extraction; (j) is the effect diagram of the non-leakage HOG feature extraction;

[0074] Figure 5 It is a schematic diagram of confusion matrix of classification results of the present invention on the cone sleeve oil and gas leakage verification set;

[0075] Figure 6 It is a schematic diagram of the confusion matrix of the classification results of multiple SVM combined with ordinary weighted voting method on the cone sleeve oil and gas leakage verification set. DETAILED DESCRIPTION

[0076] The present invention is further described in detail below with reference to the accompanying drawings.

[0077] like Figure 1 As shown, the present invention proposes a visual detection method for mist gas leakage based on a visible light sensing device, which specifically includes the following steps:

[0078] Step 1: Use visible light sensor equipment to obtain a global image of the leakage scene in real time.

[0079] like Figure 2 As shown in the figure, taking two typical leakage scenarios of compressed poison gas in storage tanks and oil and gas leakage in aerial refueling drogue as examples, the global image of the leakage scene is obtained in real time by using visible light sensing equipment such as monitoring equipment in the warehouse and airborne cameras in the receiving aircraft cabin.

[0080] Step 2: Extract the suspected leakage area from the global image to obtain an image of the suspected leakage area;

[0081] Use the target detection algorithm to locate the suspected leakage area, and then use the image segmentation technology to extract the image of the suspected leakage area. The target detection algorithm can be a traditional machine learning method, such as decision tree, random forest, AdaBoost, etc., or a deep learning method, such as GhostNet, MobileNet series, ShuffleNet series, YOLO series, R-CNN series, etc.

[0082] Step 3: Preprocess the image data in the area to obtain a preprocessed image.

[0083] First, the input area image is scaled normalized and the image size is adjusted to 320×320. Then, the edge detection algorithm is used to detect the edge of the grayscale image to highlight the contour information in the image. Then, the coordinates of the non-zero pixel points in the image are obtained, and these coordinates are fitted into an ellipse through the ellipse fitting algorithm. Finally, an ellipse-shaped mask is created on the grayscale image and the RGB image respectively to extract the corresponding ellipse area.

[0084] By utilizing the structural characteristics of the leaking gas container, the circular area of ​​the container leakage surface is further located under different channels. Taking the canned gas leakage and the cone sleeve oil and gas leakage as examples, the image preprocessing effect of the present invention is as follows: Figure 3 As shown in (a) and (b), the segmented elliptical area image is the image required after preprocessing.

[0085] Step 4: extract the transmittance feature of the mist gas leakage from the RGB image to obtain the high-dimensional transmittance feature of the RGB image; the high-dimensional transmittance feature reflects the blurring degree of the gas leakage area by extracting the information of each channel of the leakage image.

[0086] Transmittance feature calculation: For each pixel (x, y) in the leakage image, its dark channel value Dark(x, y):

[0087] Dark(x,y)=min{R(x,y),G(x,y),B(x,y)} (1)

[0088] Among them, R(x,y), G(x,y), and B(x,y) are the RGB values ​​of the pixel point (x,y).

[0089] Assume that a certain RGB block in the image is H and its size is M×N. The dark channel block is constructed by calculating the dark channel values ​​of all pixels in the block and estimating the block transmittance H. T :

[0090]

[0091] Where W is a weight parameter used to control the smoothness of transmittance; H Al is the estimated value of atmospheric light. Generally, all pixel values ​​in the dark channel block are sorted in ascending order, and the maximum value of the first W% is taken for estimation. The calculation formula is as follows:

[0092] H Al =max{Dark(x,y)},(x,y)∈M×N×W% (3)

[0093] Considering that the transmittance value should be between 0 and 1, where 0 means that the light is completely absorbed and 1 means that the light is not absorbed or scattered. To ensure the validity of the transmittance results, the boundary trimming method is used to limit the range of the calculated transmittance of all blocks. The calculation formula is:

[0094]

[0095] in, is the block transmittance that meets the specification.

[0096] Transmittance feature extraction: For an input image of size 320×320, it is divided into M blocks. The processing steps for one of the blocks are as follows:

[0097] First, separate the RGB channels of the block, and calculate the minimum value of each channel according to formula (1) to generate a dark channel image (Dark Channel). Then stretch the obtained dark channel image into a row and sort it in ascending order. Combined with formula (3), the weight parameter W is set to select the maximum value of the first W% after sorting as the atmospheric light estimation value. Then, based on the atmospheric light estimation value, calculate the initial block transmittance according to formula (2). Finally, as shown in formula (4), use the min and max functions in OpenCV to limit the range of the initial block transmittance to between 0 and 1 to obtain the final block transmittance that meets the specifications. Among them, the weight parameter W is generally taken as 0.95.

[0098] Repeating the above processing steps for each block of the input image can obtain the transmittance values ​​corresponding to the M blocks, and compressing them into a 1×M feature vector to obtain the M-dimensional transmittance feature describing the input image.

[0099] Step 5: Extract the consistency feature of mist gas leakage from the RGB image to obtain the high-dimensional consistency feature of the RGB image; the consistency combines the maximum and minimum differences of the color gamut based on the degree of color gamut change, reflecting more realistic color gamut change information of the gas leakage area.

[0100] Compatibility feature calculation: For a block H of size M×N in the leakage image, its RGB mean H avg :

[0101]

[0102] Among them, R(x,y), G(x,y), and B(x,y) are the RGB values ​​of the pixel point (x,y) in the block respectively.

[0103] Calculate the RGB mean of the 8 adjacent blocks of block H and form a mean array V avg , of the form:

[0104] V avg = {V 1 ,V 2 ,…,V i},i=1,2,…,8 (6)

[0105] Among them, V 1 , V 2 ···V i is the RGB mean of adjacent blocks.

[0106] To obtain the distance array H that represents the degree of color gamut change between block H and adjacent blocks dist , respectively, to obtain H avg With V avg The Euclidean distance of each element in is:

[0107] H dist ={D 1 ,D 2 ,…,D i},i=1,2,…,8 (7)

[0108] Among them, the difference D i The calculation formula is as follows:

[0109] D i =||H avg -V i ||,i=1,2,…,8 (8)

[0110] Based on the above distance array H dist , and finally calculate the matching feature H of block H cons ., the calculation formula is

[0111]

[0112] in, It is the largest element in the distance array, representing the maximum difference in the color gamut; It is the smallest element in the distance array, representing the minimum difference in the color gamut.

[0113] Conformity feature extraction: Similar to the transmittance feature, for an input image of size 320×320, it is divided into M blocks. The processing steps for one of the blocks are as follows:

[0114] First, according to formula (5), for a given block and its eight adjacent blocks, their RGB three-channel average values ​​are calculated, and the average values ​​of the eight adjacent blocks are combined into a neighborhood average array, as shown in formula (7). Then, the Euclidean distance between the block mean and each element in the neighborhood average array is calculated by formula (8) to form a distance array that represents the color gamut consistency, as shown in formula (7). Furthermore, in order to comprehensively consider the maximum and minimum differences in the color gamut, the maximum and minimum elements are extracted from the distance array, and the square of their difference is calculated in combination with formula (9) to obtain the initial consistency feature of the block.

[0115] Repeating the above processing steps for each block of the input image can obtain the matching values ​​corresponding to the M blocks, and compressing them into a 1×M feature vector to obtain the M-dimensional matching feature describing the input image.

[0116] In addition, in order to avoid numerical overflow and improve the generalization of the model, a normalization method is used to map all calculated block consistency values ​​to the target range between 0 and 1.

[0117] Step 6: Extract the uniformity feature of mist gas leakage from the grayscale image to obtain the high-dimensional uniformity feature of the grayscale image; the uniformity is used to characterize the smoothness of the leakage image at the grayscale level, and by utilizing the grayscale mean information in a specific background target area, it reflects the smoothness difference when there is gas leakage in the area.

[0118] Uniformity feature calculation: For a grayscale block I in the leakage image with a size of M×N, first calculate the grayscale average value of block I

[0119]

[0120] Wherein, I(x,y) represents the pixel value with coordinates (x,y) in the block.

[0121] Then, for each pixel in I, the uniformity factor is calculated in turn, and the average value is accumulated to obtain the block uniformity The calculation formula is:

[0122]

[0123] in, is the uniformity factor of a single pixel, and the calculation formula is as follows:

[0124]

[0125] Uniformity feature extraction: Similar to the transmittance feature, for an input image of size 320×320, it is divided into M blocks. The processing steps for one of the blocks are as follows:

[0126] First, the grayscale average value of a given block is calculated according to formula (10). Then, the square of the difference between each pixel value in the block and the grayscale average value of the block is calculated using formula (11) to obtain the uniformity factor corresponding to each pixel. Finally, the uniformity factors of all pixels in the block are accumulated and averaged using formula (12) to obtain the initial uniformity feature of the block.

[0127] Repeat the above processing steps for each block of the input image to obtain the uniformity values ​​corresponding to the M blocks, and compress them into a 1×M feature vector to obtain the M-dimensional uniformity feature describing the input image.

[0128] Similar to the consistency feature, in order to avoid numerical overflow and improve the generalization of the model, a normalization method is used to map the calculated uniformity values ​​of all blocks to the target range between 0 and 1.

[0129] Step 7: Extract the HOG features of the mist gas leakage from the grayscale image to obtain the high-dimensional HOG features of the grayscale image; the HOG feature is essentially a statistical analysis of the gradient information in the local area of ​​the leakage image, reflecting the edge and texture information of the gas leakage area.

[0130] The specific implementation process of the HOG feature extraction algorithm is as follows:

[0131] Calculate the gradient. For the pixel point (x, y), first use the gradient operator [-1, 0, 1] and [-1, 0, 1] in the horizontal and vertical directions respectively. T Perform convolution operation on the original image to obtain the gradient component G in the corresponding direction x (x,y) and G y(x, y), and then calculate the gradient amplitude G(x, y) and gradient direction θ(x, y) at the pixel point. The calculation formula is:

[0132]

[0133] Construct a gradient direction histogram. Divide the 180° gradient direction into M blocks, each block corresponds to an angular interval, and count the gradient information of the corresponding intervals to form a gradient direction histogram. Specifically, for a certain cell unit, first calculate its gradient direction and gradient amplitude, and then map the gradient amplitude to the angular interval corresponding to the gradient direction, and you can get a gradient direction histogram containing M amplitudes, that is, the M-dimensional feature vector corresponding to the cell unit. Since the selection of cell units of different sizes will affect the dimension of the feature and the recognition effect, after multiple screening and verification, N×N cell units can be selected to classify and identify the leakage image adjusted to 64×64.

[0134] Normalize and generate HOG feature vector. Since the gradient of a cell unit is easily affected by external factors and is not robust enough, adjacent cell units are usually grouped into a block. Multiple cell units in the block together constitute the features of the block, and normalization is performed within the block to reduce the impact of illumination changes. The size of the pixel block generally needs to be larger than the cell unit to achieve a better normalization effect. Therefore, a 2N×2N pixel block containing 4 cell units can be selected, and the entire image can be traversed with a step size of N. The number of moves required is (64 / N-1)×(64 / N-1), and the HOG feature vector of the entire image is finally generated.

[0135] Figure 4 The images of each stage are taken as an example of the oil leakage of the cone sleeve; among them, (a) is the original image of oil and gas leakage; (b) is the original image without leakage; (c) is the effect image of the transmittance feature extraction of oil and gas leakage; (d) is the effect image of the transmittance feature extraction of no leakage; (e) is the effect image of the consistency feature extraction of oil and gas leakage; (f) is the effect image of the consistency feature extraction of no leakage; (g) is the effect image of the uniformity feature extraction of oil and gas leakage; (h) is the effect image of the uniformity feature extraction of no leakage; (i) is the effect image of the HOG feature extraction of oil and gas leakage; (j) is the effect image of the HOG feature extraction of no leakage.

[0136] Step 8: Import the four sets of extracted features into four SVM classification models respectively to obtain four prediction results of the corresponding features;

[0137] (1) Obtain gas leakage images and non-leakage images to create a mist gas leakage sample set.

[0138] After obtaining real warehouse toxic gas leakage or aerial refueling video data from the Internet, we divided the data into two categories: leakage data and non-leakage data. Considering that the extremely small amount of leaked gas has a negligible impact on the accident, after manually removing samples with poor quality containing such parts, we used editing software or target detection algorithms to frame the suspected leakage areas, and saved them to create a mist gas leakage sample set containing 3,600 images.

[0139] (2) Preprocessing the leaked and non-leaked images in the sample set to obtain preprocessed grayscale images and RGB images;

[0140] The image preprocessing here is consistent with the preprocessing process in step 3, and finally the elliptical area in the input sample is extracted.

[0141] (3) Label the preprocessed grayscale and RGB images, where the leakage image is marked as 1 and the non-leakage image is marked as -1, and randomly divide them into training set, test set and validation set;

[0142] The grayscale and RGB image data of the preprocessed leakage area are labeled and classified, where the leakage image is marked as 1 and the non-leakage image is marked as -1. Then, a sample set with label information is generated based on the labeled image data, and it is randomly divided into non-overlapping training sets, test sets, and validation sets according to a specific ratio.

[0143] (4) Extract four groups of mist leakage features from the preprocessed image and obtain four groups of feature vectors.

[0144] The feature extraction of mist gas leakage here is consistent with the feature extraction method in steps 4 to 7, and finally four sets of corresponding feature vectors are obtained.

[0145] (5) The four groups of mist gas leakage feature vectors and corresponding label information in the training set are respectively imported into different SVM classifiers for training to obtain four SVM classification models.

[0146] The features introduced in step 4 to step 7 have strong correlation with each other, so the present invention adopts a multi-classifier training strategy. Taking the leakage of canned toxic gas and the leakage of drogue oil and gas as examples, in order to obtain a high-performance classification model, the penalty coefficient, kernel function and the corresponding parameters of the kernel function are optimized by grid search and cross-validation. The training parameters of each classifier are finally shown in Table 1 and Table 2.

[0147] Table 1 Training parameters of each SVM classifier (canned gas)

[0148]

[0149] Table 2 Training parameters of each SVM classifier (cone casing oil and gas)

[0150]

[0151] Based on the above optimal training parameters, the four sets of features and their corresponding label information are respectively imported into four SVM classifiers for training, and finally four SVM classification models are obtained.

[0152] Step 9: Use the adaptive weighted voting algorithm to integrate the prediction results of the four base classifiers and output the final gas leakage status.

[0153] The four groups of mist gas leakage feature vectors and corresponding label information in the test set were input into four SVM classification models respectively, and the classification accuracy of each model was statistically obtained, and the initial weights of weighted voting were designed based on this.

[0154] First, use the given classification model to predict the category of the test set and assign it a predicted label. Then, cyclically compare the predicted label and the actual label value, and accumulate the number of correct predictions. Finally, calculate the ratio of the number of correct predictions to the total number of test samples to obtain the classification accuracy A of the classification model. According to the steps, the classification accuracy corresponding to each feature classification model is calculated, and the results are shown in Table 3.

[0155] For the i-th classification model, its corresponding initial weight w i :

[0156]

[0157] Among them, A(i) is the classification accuracy of the i-th classification model.

[0158] At this point, the initial weights w corresponding to the four classification models can be calculated 1 ,w 2 ,w 3 ,w 4 , the results are shown in Table 3.

[0159] Table 3 Classification accuracy of each SVM model and the corresponding initial weights (canned poison gas / cone oil and gas)

[0160]

[0161] Confidence is introduced from the classification model to optimize weights in real time, and an adaptive weighted voting algorithm is designed.

[0162] In order to give full play to the role of decision function distance in characterizing the degree of confidence of the classifier, the present invention takes the absolute value of the decision function distance and performs nonlinear mapping on the Sigmoid function to obtain the confidence of the classification model:

[0163]

[0164] Among them, C i is the current confidence of the i-th classification model, x is the input sample, x i is the support vector, α i is the Lagrange multiplier of the support vector, y i is the category label of the support vector, rho is the bias term, K(x i ,x) is the kernel function. The confidence value level is within the definition range of probability; when the decision function distance is 0, that is, the sample point is exactly located at the hyperplane, the confidence value is mapped to 0.5, which fits the uncertainty in this case in the binary classification problem.

[0165] In addition, the calculation of the new weights must ensure that the sum of the weights is constant and reflect the impact of the confidence optimization on the voting results. The calculation formula is as follows:

[0166]

[0167] Among them, w i ′ is the new weight corresponding to the i-th classification model.

[0168] The present invention also provides a visual detection system for mist gas leakage based on a visible light sensing device, comprising:

[0169] The image acquisition module acquires the global image of the leakage scene in real time based on the visible light sensing device.

[0170] The suspected leakage area extraction module extracts the suspected leakage area and segments the area image.

[0171] The data preprocessing module takes the image of the suspected leakage area as input and uses the structural characteristics of the leaking gas container to further locate the background target area under different channels.

[0172] The mist gas leakage multi-feature extraction module is used to extract the mist gas leakage emissivity feature, consistency feature, uniformity feature and HOG feature in the target area, and generate the corresponding mist gas leakage feature vector.

[0173] The gas leakage status determination module is used to take multiple mist gas leakage feature vectors as input, combine the trained support vector machine classification model and adaptive weighted voting ensemble learning algorithm, determine the gas leakage status and output the result. The support vector machine introduces confidence to optimize the weights in real time, so that the weights can change dynamically with the classification model's trust in different input samples.

[0174] In order to verify the effectiveness of the method of the present invention, the judgment accuracy of different algorithms on the gas leakage status on the verification set was compared.

[0175] ① Input the mist gas leakage feature vector and the corresponding label information into four SVM classification models, and use the ordinary weighted voting algorithm and the adaptive weighted voting algorithm to integrate all model prediction results and calculate the judgment accuracy.

[0176] ② The same mist gas leakage feature vector and corresponding label information are respectively input into the random forest classification model and the AdaBoost classification model to calculate the judgment accuracy.

[0177] Experiments were carried out on the leakage of canned toxic gas and the leakage of cone sleeve oil and gas respectively. The final experimental results obtained according to the above steps are shown in Table 4.

[0178] Table 4 Judgment accuracy of different classification methods (canned poison gas / cone sleeve oil gas)

[0179]

[0180] From the data in the table, we can see that in the application of two typical leakage scenarios, the method of the present invention improves by 4.32% and 4.89% respectively compared with the method of combining multiple SVMs with ordinary weighted voting. In addition, compared with the state judgment based on random forest and AdaBoost algorithms, the performance is also more outstanding, and the accuracy is significantly improved. Figure 5 and Figure 6 It can be seen from the confusion matrix that the method of the present invention has significant effects on the judgment of both leakage and non-leakage states.

[0181] In addition, the present invention is designed but not limited to the use of the above four features. In subsequent research, the present invention will further fit the leakage curve based on the continuous variable of leakage, using methods such as Robust regression, Ridge regression, Lasso regression, etc., to build a gas leakage concentration model, give each frame of leakage gas a corresponding score in real-time detection, and realize a more sophisticated method for determining the leakage state of mist gas.

[0182] The present invention is based on a multi-feature extraction method of a mist gas-container combination model and a leakage state determination method based on adaptive weighted voting. The key technical problem to be solved is to construct a mist gas-container combination model by utilizing the obvious relative position relationship between the container and the leaking gas when a suspected leakage area has been segmented, and to introduce transmittance, consistency, uniformity and HOG features to construct pixel-level features of the leaking gas. Based on the strong correlation between the features and the excellent small sample classification ability of machine learning, a multi-SVM learning strategy is used during training, and an adaptive weighted voting integrated learning algorithm is used during detection to synthesize the prediction results of all classification models, thereby achieving stable and reliable gas leakage state determination.

[0183] The technical solutions provided by the embodiments of the present invention are described in detail above. The principles and implementation methods of the embodiments of the present invention are described in this patent using specific examples. The above embodiments and features in the embodiments can be combined with each other without conflict. The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.

Claims

1. A visual detection method for mist gas leakage based on visible light sensing equipment, characterized in that: The following steps are involved: (1) Use visible light sensing equipment to obtain a global image of the leakage scene in real time; (2) extracting the suspected leakage area from the global image to obtain an image of the suspected leakage area; (3) Preprocessing the image data in the area to obtain a preprocessed grayscale image and RGB image; (4) extracting the transmittance feature of mist leakage from the RGB image to obtain the high-dimensional transmittance feature of the RGB image; (5) Extracting the consistency feature of mist leakage from the RGB image to obtain the high-dimensional consistency feature of the RGB image; (6) Extracting the uniformity feature of mist leakage from the grayscale image to obtain the high-dimensional uniformity feature of the grayscale image; (7) Extracting the HOG feature of fog gas leakage from the grayscale image to obtain the high-dimensional HOG feature of the grayscale image; (8) The four sets of extracted features are respectively imported into four SVM classification models to obtain four prediction results of the corresponding features; (9) Introduce confidence in real-time optimization weights in the classification model, design an adaptive weighted voting algorithm, integrate the prediction results of the four base classifiers, and output the final gas leakage status.

2. The visual detection method for mist gas leakage based on visible light sensing equipment according to claim 1 is characterized in that: The implementation process of step (3) is as follows: The image in the area is scaled normalized, and the edge detection algorithm is used to detect the edge of the grayscale image to highlight the contour information in the image; the coordinates of the non-zero pixel points in the image are obtained, and these coordinates are fitted into an ellipse through the ellipse fitting algorithm; finally, an elliptical mask is created on the grayscale image and RGB image respectively, and the corresponding elliptical area is extracted.

3. The visual detection method for mist gas leakage based on visible light sensing equipment according to claim 1 is characterized in that: The implementation process of step (4) is as follows: For each pixel (x, y) in the leakage image, its dark channel value Dark(x, y) is: Dark(x,y)=min{R(x,y),G(x,y),B(x,y)} (1) Among them, R(x,y), G(x,y), and B(x,y) are the RGB values ​​of the pixel point (x,y); A certain RGB block in the image is H, with a size of M×N. The dark channel block is constructed by calculating the dark channel values ​​of all pixels in the block, and the block transmittance H is estimated T : Where W is a weight parameter used to control the smoothness of transmittance; H Al To estimate the atmospheric light, sort all pixel values ​​in the dark channel block in ascending order and take the maximum value of the first W% for estimation: H Al =max{Dark(x,y)},(x,y)∈M×N×W% (3) Use the boundary clipping method to limit the range of the calculated transmittance of all blocks: in, is the block transmittance that meets the specifications; the transmittance of each block of the input image is calculated, that is, the transmittance values ​​corresponding to M blocks are obtained, and they are compressed into a 1×M feature vector, that is, the M-dimensional transmittance feature describing the input image is obtained.

4. The visual detection method for mist gas leakage based on visible light sensing equipment according to claim 1 is characterized in that: The implementation process of step (5) is as follows: For a block H of size M×N in the leakage image, its RGB mean H avg for: Among them, R(x,y), G(x,y), and B(x,y) are the RGB values ​​of the pixel point (x,y) in the block respectively; Calculate the RGB mean of the 8 adjacent blocks of block H and form a mean array V avg : V avg ={V1,V2,…,V i },i=1,2,…,8 (6) Among them, V1, V2, V i is the RGB mean of adjacent blocks; To obtain the distance array H that represents the degree of color gamut change between block H and adjacent blocks dist , respectively, to obtain H avg With V avg The Euclidean distance of each element in is: H dist ={D1,D2,…,D i },i=1,2,…,8 (7) Among them, the difference D i The calculation formula is as follows: D i =||H avg -V i ||,i=1,2,…,8 (8) Based on the distance array H dist , calculate the compatibility feature H of block H cons. : in, It is the largest element in the distance array, representing the maximum difference in the color gamut; It is the smallest element in the distance array, representing the minimum difference in the color gamut; for each block matching feature of the input image, the matching values ​​corresponding to the M blocks are obtained, and they are compressed into a 1×M feature vector, that is, the M-dimensional matching feature describing the input image is obtained.

5. The visual detection method for mist gas leakage based on visible light sensing equipment according to claim 1 is characterized in that: The implementation process of step (6) is as follows: For a grayscale block I in the leakage image, whose size is M×N, calculate the grayscale average value of block I Where I(x,y) represents the pixel value with coordinates (x,y) in the block; For each pixel in I, calculate its uniformity factor in turn, and accumulate and average the values ​​to get the block uniformity in, is the uniformity factor of a single pixel: The uniformity of each block of the input image is calculated, that is, the uniformity values ​​corresponding to M blocks are obtained, and they are compressed into a 1×M feature vector, that is, the M-dimensional uniformity feature describing the input image is obtained.

6. The visual detection method for mist gas leakage based on visible light sensing equipment according to claim 1 is characterized in that: The implementation process of step (7) is as follows: For the pixel point (x, y), first pass the gradient operator [-1, 0, 1] and [-1, 0, 1] in the horizontal and vertical directions respectively. T Perform convolution operation on the original image to obtain the gradient component G in the corresponding direction x (x,y) and G y (x, y), and then calculate the gradient magnitude G(x, y) and gradient direction θ(x, y) at the pixel: The 180° gradient direction is divided into M blocks, each block corresponds to an angular interval, and the gradient information of the corresponding interval is counted to form a gradient direction histogram; specifically, for a certain cell unit, its gradient direction and gradient amplitude are first calculated, and then the gradient amplitude is mapped to the angular interval corresponding to the gradient direction to obtain a gradient direction histogram containing M amplitudes, that is, the M-dimensional feature vector corresponding to the cell unit; Adjacent cell units are grouped into a block, and multiple cell units in the block together constitute the features of the block, generating the HOG feature vector of the entire image.

7. The visual detection method for mist gas leakage based on visible light sensing equipment according to claim 1 is characterized in that: Step (9) introduces the confidence real-time optimization weights into the classification model, and designs an adaptive weighted voting algorithm to achieve the following process: Confidence represents the degree of trust the classifier has in the prediction result, which is measured by the decision function distance DFD. The decision function distance represents the distance between the sample point and the hyperplane. The support vector machine determines the category to which the sample point belongs based on its size. The larger the distance, the higher the probability of being classified into that category, and the more trust is given to that category. Specifically, in the decision function, the sign function classifies the input sample according to the size of the decision function distance. The confidence of the classification model is: Among them, C i is the current confidence of the i-th classification model; x is the input sample, x i is the support vector, α i is the Lagrange multiplier of the support vector, y i is the category label of the support vector, rho is the bias term, K(x i ,x) is the kernel function.

8. A visual detection system for mist gas leakage based on a visible light sensing device using the method according to any one of claims 1 to 7, comprising: Image acquisition module, which acquires the global image of the leakage scene in real time based on visible light sensing equipment; A suspected leakage area extraction module extracts the suspected leakage area and segments the area image; The data preprocessing module takes the image of the suspected leakage area as input and further locates the background target area under different channels by using the structural characteristics of the leaking gas container itself; A mist gas leakage multi-feature extraction module is used to extract several mist gas leakage features in the target area and generate corresponding mist gas leakage feature vectors; The gas leakage status determination module is used to take multiple mist gas leakage feature vectors as input, combine the trained support vector machine classification model and adaptive weighted voting ensemble learning algorithm, determine the gas leakage status and output the result.

9. The mist gas leakage visual detection system based on visible light sensing equipment according to claim 8 is characterized in that: The mist gas leakage characteristics include transmittance characteristics, conformity characteristics, uniformity characteristics and HOG characteristics.

10. The mist gas leakage visual detection system based on visible light sensing equipment according to claim 8, characterized in that: The support vector machine introduces confidence to optimize weights in real time, so that the weights can change dynamically with the degree of trust of the classification model to different input samples.

Citation Information

Patent Citations

  • Leaked gas cloud cluster detection method based on thermal imaging video

    CN113628252A

  • Method and system for measuring and calculating coincidence degree between subjects based on multiple dimensions

    CN115186664A

  • Combustible gas leakage area detection method and detection system

    CN116051474A

Cited By

  • Exhaust gas leakage detection method for tar treatment

    CN120598956A

  • Valve well gas leakage detection system based on image region segmentation

    CN121391880A

  • Leakage detection model construction method, leakage detection method and device

    CN121767359A