Gas leakage detection method, program product and equipment
By acquiring the target gas type in gas detection and combining deep learning and prior knowledge for precise segmentation, the problem of gas being masked by background in complex scenarios is solved, and gas leakage detection with high accuracy is achieved.
Patent Information
- Application Number
- CN202510471436.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-07-11
AI Technical Summary
In the existing gas detection technology, gas is easily masked by the background during image processing, resulting in a decrease in detection accuracy, especially in scenarios with a wide temperature range, which is difficult to accurately detect gas leakage.
By obtaining the current scene image and target gas type in the monitoring scenario, using a binary classification model based on deep learning for rough detection, combining prior knowledge of gas type for precise segmentation, determining the profile of the gas area, and improving detection accuracy.
It realizes accurate detection of gas leakage in complex scenarios, reduces the misjudgment rate of non-gas areas, is suitable for scenes where background is fixed or changed, and improves the accuracy and scope of application of gas detection.
Smart Images

Figure CN120293422A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of gas detection, and particularly relates to a gas leakage detection method, a computer program product, and a gas leakage detection device. Background Art
[0002] In the prior art, in order to see as many targets as possible in image processing algorithms, regions with large gradient differences and rich details are often highlighted. However, gases have diffusibility and absorb infrared radiation from the surrounding background. Therefore, compared with other objects in the scene, gases have very few details and obvious gradient changes. When the temperature range in the scene is wide, the gases detected in the original data are easily masked into the background during the image processing process, resulting in the failure to detect gases and affecting the accuracy of gas detection. Summary of the Invention
[0003] In order to solve the existing technical problems, the present invention provides a gas leakage detection method, a computer program product, and a gas leakage detection device, which can improve the accuracy of gas detection.
[0004] In a first aspect, a gas leakage detection method is provided, including: obtaining a current scene image of a monitoring scene; obtaining a target gas type in the monitoring scene, where the target gas type is a type divided according to the high or low temperature of the gas; and determining a target gas region in the current scene image based on the target gas type.
[0005] In a second aspect, a computer program product is provided, including a computer program, where when the computer program is executed by a processor, it implements a gas leakage detection method as described in any item of the first aspect of the present application.
[0006] In a third aspect, a gas leakage detection device is provided, including a memory and a processor, where the memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to execute a gas leakage detection method as described in any item of the first aspect of the present application.
[0007] The present application obtains the current scene image and the target gas type in the monitoring scene. The target gas type indicates whether the monitored gas is a high-temperature gas or a low-temperature gas. According to various prior knowledge such as high-temperature gas or low-temperature gas, precise segmentation is performed on the current scene image to obtain the contour of the target gas region, accurately mark the contour of the leaked gas, and improve the accuracy of gas detection at the same time. Brief Description of the Drawings
[0008] Figure 1 It is an application environment diagram of a gas leakage detection method in an embodiment;
[0009] Figure 2Flow chart of a gas leakage detection method in an embodiment;
[0010] Figure 3 Flow chart of determining the target gas area in the current scene image based on the target gas type in an embodiment;
[0011] Figure 4 Schematic diagram of the target box corresponding to the gas area label in an embodiment;
[0012] Figure 5 Schematic diagram of coloring and displaying the gas area in an embodiment;
[0013] Figure 6 Schematic diagram of coloring and displaying the gas area in another embodiment;
[0014] Figure 7 Schematic diagram of coloring and displaying the gas area in another embodiment;
[0015] Figure 8 Schematic diagram of a gas leakage detection device in an embodiment;
[0016] Figure 9 Schematic diagram of a gas leakage detection device in an embodiment. Detailed implementation manners
[0017] The technical solution of the present invention will be further elaborated in detail below in conjunction with the accompanying drawings of the specification and specific embodiments.
[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments, and are not intended to limit the protection scope of the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0019] In the following description, the expression "some embodiments" describes a subset of all possible embodiments. However, it should be understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
[0020] Refer to Figure 1, which is an application environment diagram of the gas leakage detection method in an embodiment. The gas leakage detection method is applied to a gas leakage detection device 10 (hereinafter simply referred to as "detection device 10"). The detection device 10 includes an image acquisition device 12, a processor 13, and a memory 14. The image acquisition device 12 is used to acquire the current scene image of the scene to be monitored by the detection device 10. The processor 13 identifies the target gas area in the current scene image based on the current scene image acquired by the image acquisition device 12 and displays the target gas area based on the current scene image. The memory 14 is used to store the program corresponding to the gas leakage detection method and various types of data.
[0021] The detection device 10 includes, but is not limited to, a handheld detection device, a non-handheld autonomously movable detection device, and a non-handheld non-autonomously movable detection device. Among them, the handheld detection device includes, but is not limited to, a handheld imaging device with infrared thermal imaging function and a handheld imaging device with visible light imaging function. Among them, the non-handheld autonomously movable detection device includes, but is not limited to, an autonomously movable detection device with infrared thermal imaging function and an autonomously movable detection device with visible light imaging function. The non-handheld non-autonomously movable detection device includes, but is not limited to, a non-handheld and non-autonomously movable device with infrared thermal imaging function and a non-handheld and non-autonomously movable device with visible light imaging function. Among them, through the handheld detection device and the non-handheld autonomously movable detection device, the user can perform gas detection on the current moving scene during movement, or can perform gas detection on a certain fixed scene. Through the non-handheld non-autonomously movable detection device, gas detection can be performed on a certain fixed scene. Therefore, the gas detection method provided in this application can be applied to various complex moving and changing scenes and fixed scenes.
[0022] The image acquisition device 12 can be a combination of one or more sensors. The image acquisition device 12 can be a monocular vision sensor or a multiocular vision sensor. For example, it can be a combination of one or more sensors such as a thermal imaging sensor, a visible light image sensor, a millimeter wave sensor, a lidar sensor, an infrared thermal imaging sensor, a depth sensor, a back-illuminated CMOS sensor, an electron multiplying CCD sensor, a scientific-grade CMOS sensor, an InGaAs sensor, a microchannel plate sensor, and a quantum dot sensor.
[0023] Among them, the processor 13 can be one or more. When there are multiple processors 13, the multiple processors can be integrated on one chip or independently set on each chip. The gas detection device 10 is a device installed on any type of moving body, such as a vehicle, an electric vehicle, a hybrid electric vehicle, a motorcycle, a bicycle, a personal mobility device, an aircraft, a drone, a ship, or a robot, etc. The gas detection device 10 can also be fixedly installed on a certain fixed device or at a fixed position in a fixed scenario.
[0024] The detection device 10 may further include other sensor modules, including but not limited to environmental perception sensors and motion attitude sensors. The environmental perception sensors include but are not limited to one or more combinations of the following sensors: environmental sensors such as brightness sensors, temperature sensors, and haze sensors. The motion attitude sensors include but are not limited to one or more combinations of the following: inertial sensors (Inertial Measurement Unit, IMU), speed sensors, acceleration sensors, gyroscope sensors, geomagnetic sensors, rotation vector sensors, steering wheel angle sensors, horizontal sensors, tilt sensors, vibration sensors, displacement sensors, and gravity sensors, etc.
[0025] Among them, the detection device 10 may further include a display terminal for displaying images.
[0026] In the field of gas detection, different gases have specific infrared absorption spectra. When infrared radiation passes through the area containing the gas to be detected, gas molecules will absorb the infrared light corresponding to their characteristic absorption frequencies. In actual scenarios, in addition to the absorption of infrared radiation by the gas, there is also the infrared radiation of background objects and the thermal radiation of the gas itself. Background objects (such as the ground, buildings, etc.) emit their own infrared radiation, and these radiations interact with the gas during propagation. At the same time, due to the gas having a certain temperature, it will also emit infrared radiation outward. The infrared thermal imager receives the remaining part of the background radiation after being absorbed and scattered by the gas, as well as the radiation of the gas itself, and converts it into an electrical signal or a digital signal. Then, through signal processing and image reconstruction algorithms, these signals are converted into a visualized thermal image. In this process, the absorption and emission differences of the gas to infrared radiation will be manifested as different gray levels or color distributions in the image, thus realizing the imaging detection of the gas. High-sensitivity detectors can detect weaker infrared radiation changes and have a stronger detection ability for low-concentration gases. Since the original infrared data has a wider range, such as 16-bit or 14-bit, these weak infrared radiation differences can be reflected in the original infrared data. Since the displayed gray level range is 8-bit, in order to see as many targets as possible, the infrared image processing algorithm often highlights the areas with large gradient differences and rich details. However, the gas has diffusivity and absorbs the infrared radiation of the surrounding background. Therefore, compared with other objects in the scene, it has very few details and the gradient change is not obvious. When the temperature range in the scene is wide, the gas detected in the original data is easily masked into the background during the infrared image processing, resulting in the gas not being detected.
[0027] Currently, infrared gas detection algorithms include those based on gas background modeling, which subtract each frame of infrared original image from the background image to obtain a foreground sub-image, and then perform threshold segmentation on the foreground sub-image to obtain the foreground gas region (CN118196117A). This method is usually used in the monitoring field and requires ensuring that only gas is the moving target in the background. When there are people or other moving targets in the scene, it is prone to false detection. There is also a gas detection model based on TSDNET network image segmentation (CN118823649A), which is trained by pixel-level calibration of gas contours in a large number of scenes to detect gas contours. Although a large amount of simulation data is used, saving the cost of data acquisition, due to gas diffusion in the scene, the boundaries are blurred, the difficulty of pixel-level calibration of gas contours is high, the accuracy of label production is not high, and the gas detection performance is low. There is also a leakage gas detection method based on deep learning and optical flow method, which uses the Gaussian plume model to simulate the image data of real gas leakage to produce a data set; uses the deep learning network YOLOv8-seg model for training; uses an infrared camera to monitor the area where leakage may occur; when leakage occurs, detects and segments the leakage gas area to generate a binary segmentation mask of the leakage gas; uses the optical flow method to analyze the movement direction of the gas plume in the binary segmentation mask (CN119151929A). It solves the problem that it is difficult to find leakage points in existing gas detection means, but there is still the problem that the gas detection fails due to background changes. To solve the above problems, this application proposes a gas leakage detection method.
[0028] Please refer to Figure 2 , which is a flowchart of a gas leakage detection method provided by an embodiment of this application. A gas leakage detection method is applied to a gas leakage detection device. The gas leakage detection method includes the following steps:
[0029] S10. Obtain the current scene image under the monitoring scene.
[0030] In this embodiment, the monitoring scene can be a fixed scene or a moving scene. The current scene image is the current frame image, and the current scene image can be an infrared image, a visible light image, an infrared image and a visible light image, a fused image of an infrared image and a visible light image, a low-light image, or a fused image of a low-light image and an infrared image. A low-light image is usually captured by a sensor with high sensitivity and low noise characteristics. These sensors can capture enough light under extremely low light conditions to generate an image. Low-light images are mainly used to replace visible light when the visible light is poor at night. The imaging effect is relatively close to visible light, but under low light conditions, the effect is better than visible light.
[0031] S11. Obtain the target gas type under the monitoring scene, where the target gas type is the type divided according to the temperature of the gas.
[0032] In this embodiment, the gas temperature indicates the boiling point temperature or the thermal radiation temperature affected by the environment. The way to obtain the target gas type can be automatic detection or configured by the user through a user interface, where the user interface can be a voice interface or a user interface. For example, the boiling point temperatures of some gases are lower than the ambient temperature. For example, the boiling point of methane is about -161.5 degrees Celsius. In actual industrial inspection scenarios, whether it is winter or summer, the temperature at the leakage point where methane leaks into the environment is lower than the background temperature. For some gases, the boiling point temperature leaked into the environment is not necessarily lower than the ambient temperature and may also be higher than the ambient temperature. For example, sulfur hexafluoride is greatly affected by the critical temperature and different pressures. In cold regions and hot regions, the sulfur hexafluoride leaked into the environment is not necessarily lower than the ambient temperature and may also be higher than the ambient temperature. For these gases for which it is difficult to detect the temperature accurately through sensors, the user can configure the gas type through the user interface.
[0033] The target gas type can be a high-temperature gas type or a low-temperature gas type. For example, a gas type higher than or equal to the gas temperature threshold is a high-temperature gas type, and a gas type lower than the gas temperature threshold is a low-temperature gas type, etc.
[0034] S12. Based on the target gas type, determine the target gas region in the current scene image.
[0035] In this embodiment, the target gas region indicates the gas leakage region in the current scene image. Since the boiling points of gases with different gas temperatures are different, some are lower than the ambient temperature and some are higher than the ambient temperature, different gas segmentation strategies can be adopted according to the gas type to accurately segment the gas region in the current scene image.
[0036] In the above embodiment, the current scene image is obtained and the target gas type in the monitoring scene is obtained. The target gas type indicates whether the monitored gas is a high-temperature gas or a low-temperature gas. Based on various prior knowledge such as high-temperature gas or low-temperature gas, accurate segmentation is performed in the current scene image to obtain the contour of the target gas region, accurately mark the contour of the leaked gas, and improve the gas detection accuracy at the same time.
[0037] In some embodiments, the obtaining of the target gas type in the monitoring scene includes at least one of the following:
[0038] Obtain gas type configuration data through the user interface, and determine the target gas type according to the gas type configuration data, where the gas type configuration data includes at least one of the following: gas type configuration item, gas temperature configuration item;
[0039] Obtain the gas temperature data monitored in the monitoring scene, and determine the target gas type according to the gas temperature data.
[0040] In this embodiment, the user interface can be a voice interface, a gesture interface, a user interface, etc. For example, the user interface provides a gas type control. The target gas type is selected through the gas type control. The gas type control includes, but is not limited to, a drop-down box, a button control, a text box, a checkbox, a slider, etc. When the gas type control is triggered through the user interface, the corresponding gas type configuration data is obtained, and the target gas type is determined according to the gas type configuration data. It is possible to directly select whether it is a high-temperature gas type or a low-temperature gas type on the user interface, or the gas temperature can be configured on the user interface. According to the pre-stored temperature threshold range, the gas type corresponding to the configured gas temperature is judged. For example, when the configured gas temperature is within the first temperature range, it corresponds to a high-temperature gas, and when the configured gas temperature is within the second temperature range, it corresponds to a low-temperature gas, where the first temperature range is higher than the second temperature range. In some embodiments, the temperature data when the gas leaks can also be detected by a sensor, and the monitored gas temperature data is compared with the pre-stored temperature threshold range to judge the gas type corresponding to the configured gas temperature.
[0041] In the above embodiment, the determination method of the gas type is provided in multiple ways. It can be configured through user interaction through the user interface, or can be configured through an automatic detection method, thereby improving the user experience.
[0042] In some embodiments, Figure 3 FIG. 10 is a flowchart for determining a target gas region in a current scene image based on a target gas type in an embodiment; determining the target gas region in the current scene image based on the target gas type includes:
[0043] S121. Form input data of a pre-trained gas detection model based on the current scene image, and output a rough gas region in the current scene image through the gas detection model.
[0044] In this embodiment, the gas detection model is a binary classification model based on deep learning. The gas detection model is trained based on a training data set. The training data set includes a simulation data set and sample images collected in an actual scene. This step is a rough detection step for preliminarily determining a rough gas region using a pre-trained gas detection model. The rough gas region here is marked by detection frames of whether it is a gas region in a large number of simulations and actual scenes, and then trained using a classification deep learning classification algorithm. The obtained rough gas region contains gas and may also have a part of the non-gas background, which needs to be further accurately segmented. The rough detection step is used to preliminarily determine a rough gas region using a deep learning classification algorithm, including several stages such as gas region label production, model training, model conversion, and implementation.
[0045] Optionally, the method further includes:
[0046] Obtaining a training data set, where each training sample in the training data set includes a sample image and a gas region label corresponding to the sample image, and the region box corresponding to the gas region label in the sample image is represented by a regular geometric shape;
[0047] Constructing an initial gas detection model;
[0048] Based on the training data set, iteratively training the initial gas detection model until an iteration termination condition is met, to obtain a pre-trained gas detection model.
[0049] In this embodiment, compared with the AI algorithm for image segmentation, the production of labels changes from pixel-level segmentation of gas regions to whether the region with a regular geometric shape (rectangular box) is a gas region, greatly reducing the difficulty and cost of label production. Among them, the gas label in the label production stage has a blurred boundary and no definite shape in a single-frame image due to the diffusibility of gas. If a segmentation model is used, as Figure 4 shown, Figure 4 is a schematic diagram of the target box corresponding to the gas region label in an embodiment. Pixel-level annotation of gas regions and non-gas regions has a large marking difficulty, a long time period, and a high cost. Now, a classification algorithm based on deep learning is adopted to determine the rough gas region. Only a rectangular box needs to be used for marking to mark the approximate gas region, greatly reducing the marking difficulty, improving the marking efficiency, and saving the marking cost. In order to enrich the scenarios, a method combining the simulation of a part of gas data using the Ansys Fluent fluid simulation tool and the acquisition of real gas leakage data in the actual scenario is adopted, greatly saving the cost of gas data acquisition before label production.
[0050] During the model training process, not only data with gas in the scenario but also data without gas in the scenario need to be used, including not only laboratory scenarios but also industrial scenarios, to increase the scenario adaptability of the model. In the model conversion and implementation stage, model conversion needs to be carried out according to the specific platform and specific resources to meet the performance requirements of the specific platform. After actual application, continuous frame image data is obtained. Through the rough detection step, a series of detection boxes and the possibility of the corresponding gas regions are obtained through a classification algorithm based on deep learning. Using threshold segmentation, some detection boxes that may be gas are obtained, and the parts of the regions of these detection boxes that have intersections are merged to obtain one or more rough gas regions.
[0051] In this embodiment, during the model training process, sample images are obtained from the training dataset to form the input of the gas detection model being trained, and the gas detection data for the current iteration is output. Based on the loss function, the loss between the gas detection data for the current iteration and the gas region labels of the sample images is calculated to obtain the loss value for the current iteration. According to the loss value for the current iteration, it is determined whether the iteration termination condition is met. The iteration termination condition includes, but is not limited to, the number of iterations, the loss value being less than a preset loss value, etc. When the iteration termination condition is not met, sample images are continuously obtained from the training dataset for training until the iteration termination condition is met, and a pre-trained gas detection model is obtained. During the training process, the gas detection model learns the features of the gas region labels and background features in the sample images. After the model training is completed, the gas region can be recognized from various scenarios.
[0052] S122. Based on the rough gas region, determine the background region in the current scene image, calculate the background gray level of the background region, and based on the background gray level, determine the segmentation threshold. Based on the target gas type and the segmentation threshold, accurately determine the target gas region in the rough gas region.
[0053] In this embodiment, this step is a refinement contour step, which is used to further finely segment according to various prior knowledge such as whether the high-temperature gas or low-temperature gas is selected by the user, and the rough gas region determined in the previous step to obtain the contour of the gas region. The specific implementation method is as follows: Use the infrared data on the outer edge of the rough gas region obtained in the rough detection step as the background, and calculate the background gray level. For example, the mode / average value of the gray level data outside the outer edge of the gas region detection box can be used as the background gray level. Determine the segmentation threshold based on the background gray level. Specifically, the background gray level can be used as the segmentation threshold, or the background gray level can be fine-tuned. For example, it can be used as the segmentation threshold after floating up or down a preset ratio on the basis of the background gray level.
[0054] According to the determined target gas type, use the segmentation threshold to perform segmentation within the rough gas region to further refine the gas region and obtain a refined gas contour. Optionally, the accurately determining the target gas region in the rough gas region based on the target gas type and the segmentation threshold includes:
[0055] When the target gas type is a high-temperature gas type, retain multiple first target pixel points with pixel values higher than the segmentation threshold in the rough gas region, and based on the contour region formed by the multiple first target pixel points, determine the target gas region;
[0056] When the target gas type is a cryogenic gas type, a plurality of second target pixel points with pixel values lower than the segmentation threshold are retained in the rough gas region, and the target gas region is determined based on the contour region formed by the plurality of second target pixel points.
[0057] In this embodiment, when a cryogenic gas is selected, the region with a value lower than the segmentation threshold is retained in the rough detection region as the refined gas region; when a high-temperature gas is selected, the region with a value higher than the segmentation threshold is retained in the rough detection region as the refined gas region.
[0058] In the above embodiment, the gas at the gas leakage point in the original data with leaked gas collected from the simulation and the actual scenario is regionally marked, and trained using a binary classification model based on deep learning. In the actual scenario, first, whether it is leaked gas is detected to obtain a roughly determined rough gas region, and then the gas region is post-processed to obtain a finely segmented gas region; then, in the gas post-processing, according to whether the target gas type is a high-temperature gas or a cryogenic gas, and the rough gas region determined in the previous step, further detailed segmentation is performed to obtain an accurate gas region. The deep learning algorithm and the traditional method are effectively combined, and the rough judgment of the gas region and the use of interpretable prior knowledge for detailed segmentation of the gas region are combined, reducing the detection difficulty, reducing the misjudgment of non-gas regions as gas regions, accurately marking the contour of the leaked gas, and having a higher detection accuracy at the same time. This application is applicable to the detection of multiple gases, with a wider range of use. Compared with the background modeling method, this application can be used not only in monitoring scenarios with a fixed background but also in handheld detection scenarios with a changing background, and has a lower misjudgment rate for other moving targets such as people, and has a wider application scenario.
[0059] In some embodiments, the method further includes:
[0060] Obtaining gas display configuration data through a user interface, where the gas display configuration data includes one or more of the following combinations: whether the gas contour is prominent, whether the gas detection frame is displayed, the coloring color of the non-gas region, the coloring method of the target gas region, the display image type corresponding to the non-gas region, and the display image type corresponding to the target gas region;
[0061] Display the target gas region according to the gas display configuration data.
[0062] In this embodiment, the user interface includes but is not limited to a voice interface and a user interface. For example, gas display configuration controls may be provided on the user interface, and there may be one or more gas display configuration controls. One or more combinations of display items in the gas area can be made through the gas display configuration controls. After the user triggers the gas display configuration controls, gas display configuration data can be obtained through the gas display configuration controls, where the gas display configuration data includes one or more of the following combinations: whether the gas contour is prominent, whether the gas detection frame is displayed, the coloring color of the non-gas area, the coloring method of the target gas area, the display image type corresponding to the non-gas area, and the display image type corresponding to the target gas area. Whether the gas contour is prominent means highlighting the gas contour corresponding to the target gas area. Whether the gas detection frame is displayed means whether the detection frame corresponding to the target gas area is displayed. The coloring color of the non-gas area is the display color corresponding to the non-gas area. The display image type corresponding to the non-gas area is the image type displayed in the non-gas area, and the display image type corresponding to the non-gas area includes at least one of the following: visible light image, infrared image, fused image of visible light and infrared image, low-light image, fused image of low-light image and infrared image; the display image type corresponding to the target gas area includes at least one of the following: visible light image, infrared image, fused image of visible light and infrared image, low-light image, fused image of low-light image and infrared image.
[0063] In the above embodiment, through the user interface, the user can configure the display items of the target gas area and the non-gas area, and combined display can be performed through one or more of the gas display configuration data, which is convenient for the user to intuitively observe the situation of the leaked gas.
[0064] Optionally, there can be multiple coloring methods for the target gas area. The coloring methods of the target gas area include at least one of: gas concentration coloring method, gas probability coloring method, gas gray difference coloring method. According to the gas display configuration data, the display of the target gas area includes at least one of the following:
[0065] When the coloring method of the target gas area is indicated as the gas concentration coloring method, the gas concentration of each pixel point in the target gas area is obtained, and the target gas area is colored according to the gas concentration of each pixel point and the mapping relationship between the gas concentration and the color value;
[0066] When the coloring method of the target gas area is indicated as the gas probability coloring method, the gas detection probability value corresponding to each pixel point in the target gas area is obtained, and the target gas area is colored according to the gas detection probability value corresponding to each pixel point and the mapping relationship between the gas detection probability value and the color value;
[0067] When the coloring method of the target gas area is indicated as the gas gray-scale difference coloring method, calculate the difference between the gray-scale value of each pixel point in the target gas area and the background gray-scale to obtain the gray-scale difference corresponding to each pixel point, and color the target gas area according to the gray-scale difference corresponding to each pixel point and the mapping relationship between the gray-scale difference and the color value.
[0068] The gas concentration coloring method indicates coloring according to the gas concentration values of each pixel point in the target gas area. Optionally, obtaining the gas concentration of each pixel point in the target gas area includes:
[0069] Obtain the mapping relationship between the concentration influence parameter and the gas concentration, where the concentration influence parameter includes at least one of the following: the gray-scale value of the pixel point in the gas area, the ambient temperature, the background gray-scale, the gas type, the measurement distance;
[0070] Obtain the values of each target concentration influence parameter, and use the values of each target concentration influence parameter as the input of the mapping relationship between the concentration influence parameter and the gas concentration to obtain the gas concentration of each pixel point.
[0071] In this embodiment, the concentration influence parameter includes one or more variables, such as the gray-scale value of the pixel point in the gas area, the ambient temperature, the background gray-scale, the gas type, the measurement distance. The gas type represents the name of the gas, such as methane, sulfur hexafluoride, etc., and the measurement distance represents the distance between the target gas area and the detection device. In the laboratory scenario, the infrared gray-scale value of the gas area can be tested as the ambient temperature, background gray-scale, gas type, and gas concentration change, that is, for each variable, data is collected at a specified interval to form multiple groups of sampling data. Based on the multiple groups of sampling data, the least squares method is used to fit each variable to obtain the mapping relationship between the concentration influence parameter and the gas concentration. For example, calculate the mapping relationship table of the corresponding gas concentration under different ambient temperatures, background gray-scales, different gas types, and different infrared gray-scale values. After obtaining the mapping relationship between the concentration influence parameter and the gas concentration, the gray-scale data, background gray-scale, current ambient temperature, selected gas type, and current test distance in the refined gas area are used as the input of the mapping relationship between the concentration influence parameter and the gas concentration to calculate the gas concentration corresponding to each pixel point in the target gas area. In actual use, the ambient temperature can be manually input or automatically updated according to the temperature sensor, and the measurement distance can be manually input or automatically updated according to the ranging sensor.
[0072] Among them, the gas probability coloring method is to perform coloring display according to the probability that each pixel point in the target gas region is a gas pixel point. In the rough detection step, while outputting the rough gas region through a pre-trained gas detection model, the probability that each pixel point in the rough gas region is a gas pixel point can also be output. Among them, the gas gray difference coloring method is to obtain the corresponding gray difference value for each pixel point according to the difference between the gray value of each pixel point in the target gas region and the background gray value, and perform coloring display according to the corresponding gray difference value of each pixel point.
[0073] In this embodiment, through the mapping relationship between the gas concentration and the color value, using the color mapping technology, the gas concentration value corresponding to each pixel point is mapped to different color values. Through the mapping relationship between the gas detection probability value and the color value, using the color mapping technology, the gas detection probability value corresponding to each pixel point is mapped to different color values. Through the mapping relationship between the gray difference value and the color value, using the color mapping technology, the gray difference value corresponding to each pixel point is mapped to different color values.
[0074] For example, in one embodiment, the gas region is highlighted by the gas contour; in one embodiment, Figure 5 , the gas region is colored with a color pseudocolor according to the gas concentration of each point, and the non-gas region is colored with a black-and-white pseudocolor. Optionally, the gas detection frame can be displayed or not. By highlighting the gas region and the concentration of the gas region, this method can be used to visually check the leakage concentration of the leaked gas. When the leakage concentration reaches a certain level, it will cause harm to the surrounding environment. Using this method, it is possible to visually check whether the current leakage gas concentration is within the safe range to assist in judging whether maintenance is required and the urgency of maintenance.
[0075] For example, in one embodiment, the gas region is colored with a color pseudocolor according to the gas gray level of each point, and the non-gas region is colored with a black-and-white pseudocolor; in one embodiment, as Figure 6 shown, the gas region is colored with a color pseudocolor according to the possibility that each point is a gas, and the non-gas region is colored with a black-and-white pseudocolor; in one embodiment, the gas region is colored with a color pseudocolor according to the difference between the gas gray level and the background gray level of each point, and the non-gas region is colored with a black-and-white pseudocolor. By highlighting the gas region and the temperature difference between the gas region and the background region, considering that some gases are often used in combination with other gases and the specific concentration calibration is not in the manufacturer's database, using this coloring method can highlight the temperature difference between the gas region and the background region and emphasize the impact of gas leakage on the environment.
[0076] Such as Figure 7As shown, in one embodiment, the gas region is colored with a color pseudocolor according to the gas concentration at each point, and then the gas region and visible light are fused. The non-gas region displays the visible light image, and the gas region is displayed using an image colored with an infrared pseudocolor and an image fused with visible light in a specified ratio. By highlighting the gas region and the concentration of the gas region, the fusion with visible light is more intuitive. In an actual scenario, when it is a pure gas and within the gas concentration mapping table range of the scenario, this method can be used to visually check the leakage concentration of the leaked gas. When the leakage concentration reaches a certain level, it will cause harm to the surrounding environment. Use this method to visually check whether the current leakage gas concentration is within the safe range to assist in judging whether maintenance is required and the urgency of maintenance.
[0077] In the above embodiment, through the user interface, the user can configure the display items of the target gas region and the non-gas region, and combine and display them through one or more items in the gas display configuration data, which is convenient for the user to visually observe the situation of the leaked gas. There are multiple coloring methods to choose from for the coloring method of the target gas region, so as to improve the diversification of coloring display.
[0078] In the combination of the above one or more embodiments, the present application has at least the following features:
[0079] Mark the gas in the gas leakage point of the infrared raw data with leaked gas collected from the simulation scenario and the actual scenario, and use a binary classification model based on deep learning for training. In the actual scenario, in the first step, detect whether it is a leaked gas to obtain a roughly determined rough gas region, and then post-process the gas region to obtain a finely segmented gas region. In the second step, according to whether the high-temperature gas or the low-temperature gas selected by the user and the rough gas region judged in the previous step, further refine the segmentation to obtain an accurate gas region. In the third step, use the mapping relationship between the internally calibrated concentration influence parameter and the gas concentration to map the gas data and concentration of the accurate gas region to obtain the current gas concentration. According to the selected display requirements, color the gas region and / or display the gas concentration of the gas region.
[0080] Compared with the AI algorithms for image segmentation, the production of labels has changed from pixel-level segmentation of gas regions to whether a rectangular box is a gas region, greatly reducing the difficulty and cost of label production. Compared with the background modeling method, the present application can be used not only in monitoring scenarios with fixed backgrounds but also in handheld detection scenarios with changing backgrounds, and has a lower misjudgment rate for other moving targets such as people, with a wider application scenario. The present application effectively combines deep learning algorithms and traditional methods, combines the rough judgment of gas regions and the detailed segmentation of gas regions using interpretable prior knowledge, reduces the detection difficulty, avoids the problem of abnormal concentration calculation caused by misjudging non-gas regions as gas regions, can accurately mark the contour of the leaked gas, and has a higher detection accuracy. This patent is applicable to the detection of multiple gases and has a wider range of use.
[0081] On the other hand, the present application provides a computer program product, including a computer program, which when executed by a processor implements the gas leakage detection method described in any embodiment of the present application.
[0082] Among them, in the computer program product, an optional implementation form of the program module architecture of the computer program that implements each step of the gas leakage detection method can be a gas leakage detection device.
[0083] The above mainly introduces the solution provided by the embodiments of the present application from the perspective of the method. To implement the above functions, the gas leakage detection device includes the corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments disclosed in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0084] The embodiments of the present application can, according to the above method, exemplarily divide the functional modules of the gas leakage detection device. For example, the gas leakage detection device can include each functional module corresponding to each function division, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software function modules. It should be noted that the division of modules in the embodiments of the present application is illustrative, only a logical function division, and there can be other division methods in actual implementation.
[0085] Please refer to Figure 8, an embodiment of the present application provides a gas leakage detection device, including: an acquisition module 81, configured to acquire a current scene image in a monitoring scene; the acquisition module 81 is further configured to acquire a target gas type in the monitoring scene, where the target gas type is a type divided according to the level of gas temperature; a detection module 82, configured to determine a target gas region in the current scene image based on the target gas type.
[0086] Optionally, the acquisition module 81 is further configured to:
[0087] Acquire gas type configuration data through a user interface, and determine the target gas type according to the gas type configuration data, where the gas type configuration data includes at least one of the following: a gas type configuration item, a gas temperature configuration item;
[0088] Acquire gas temperature data monitored in the monitoring scene, and determine the target gas type according to the gas temperature data.
[0089] Optionally, the detection module 82 is further configured to:
[0090] Form input data of a pre-trained gas detection model based on the current scene image, and output a rough gas region in the current scene image through the gas detection model;
[0091] Based on the rough gas region, determine a background region in the current scene image, calculate the background gray level of the background region, and determine a segmentation threshold based on the background gray level. Based on the target gas type and the segmentation threshold, accurately determine the target gas region in the rough gas region.
[0092] Optionally, the detection module 82 is further configured to:
[0093] When the target gas type is a high-temperature gas type, retain a plurality of first target pixel points with pixel values higher than the segmentation threshold in the rough gas region, and determine the target gas region based on the contour region formed by the plurality of first target pixel points;
[0094] When the target gas type is a low-temperature gas type, retain a plurality of second target pixel points with pixel values lower than the segmentation threshold in the rough gas region, and determine the target gas region based on the contour region formed by the plurality of second target pixel points.
[0095] Optionally, it further includes a training module 83, configured to:
[0096] Obtain a training dataset, where each training sample in the training dataset includes a sample image and a gas region label corresponding to the sample image, and the region box corresponding to the gas region label in the sample image is represented by a regular geometric shape;
[0097] Construct an initial gas detection model;
[0098] Based on the training dataset, iteratively train the initial gas detection model until the iteration termination condition is met, and obtain a pre-trained gas detection model.
[0099] Optionally, it further includes a display module 84 for:
[0100] Obtain gas display configuration data through a user interface, where the gas display configuration data includes one or more of the following combinations: whether the gas contour is prominent, whether the gas detection box is displayed, the coloring color of the non-gas region, the coloring method of the target gas region, the display image type corresponding to the non-gas region, and the display image type corresponding to the target gas region;
[0101] Display the target gas region according to the gas display configuration data.
[0102] Optionally, the coloring method of the target gas region includes at least one of: gas concentration coloring method, gas probability coloring method, gas gray difference coloring method, and the display module 84 is further used for:
[0103] When the coloring method of the target gas region indicates the gas concentration coloring method, obtain the gas concentration of each pixel point in the target gas region, and color the target gas region according to the gas concentration of each pixel point and the mapping relationship between the gas concentration and the color value;
[0104] When the coloring method of the target gas region indicates the gas probability coloring method, obtain the gas detection probability value corresponding to each pixel point in the target gas region, and color the target gas region according to the gas detection probability value corresponding to each pixel point and the mapping relationship between the gas detection probability value and the color value;
[0105] When the coloring method of the target gas region indicates the gas gray difference coloring method, calculate the difference between the gray value of each pixel point in the target gas region and the background gray value to obtain the gray difference value corresponding to each pixel point, and color the target gas region according to the gray difference value corresponding to each pixel point and the mapping relationship between the gray difference value and the color value.
[0106] Optionally, the display module 84 is further used for:
[0107] Obtain the mapping relationship between the concentration influence parameter and the gas concentration, where the concentration influence parameter includes at least one of the following: the gray value of the pixel points in the gas region, the ambient temperature, the background gray level, the gas type, and the measurement distance;
[0108] Obtain the values of each target concentration influence parameter, and use the values of each target concentration influence parameter as the input of the mapping relationship between the concentration influence parameter and the gas concentration to obtain the gas concentration of each pixel point.
[0109] Optionally, the display image types corresponding to the non-gas regions include at least one of the following: visible light image, infrared image, low-light image, fused image of low-light image and infrared image, fused image of visible light and infrared image; the display image types corresponding to the target gas regions include at least one of the following: visible light image, infrared image, low-light image, fused image of low-light image and infrared image, fused image of visible light and infrared image.
[0110] Please refer to Figure 9 , on the other hand, an embodiment of the present application further provides a gas leakage detection device 10, including a processor 13 and a memory 14. The memory 14 stores a computer program. When the computer program is executed by the processor, the processor 13 is caused to execute the steps of a gas leakage detection method provided in any one of the above embodiments of the present application.
[0111] Among them, the processor 13 is the control center, which connects various parts of the entire gas leakage detection device through various interfaces and lines. By running or executing the software programs and / or modules stored in the memory 14, and by calling the data stored in the memory 14, it executes various functions of the gas leakage detection device and processes data. Optionally, the processor 13 may include one or more processing cores; preferably, the processor 13 may integrate an application processor and a modulation and demodulation processor. Among them, the application processor mainly processes the operating system, user interfaces, and application programs, etc., and the modulation and demodulation processor mainly processes wireless communication. It can be understood that the above modulation and demodulation processor may not be integrated into the processor 13 either.
[0112] The memory 14 can be used to store software programs and modules. By running the software programs and modules stored in the memory 14, the processor 13 can execute various functional applications and data processing. The memory 14 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of a gas leakage detection device. In addition, the memory 14 can include a high-speed random access memory and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 14 can also include a memory processor to provide the processor 13 with access to the memory 14.
[0113] In another aspect of the embodiments of the present application, a storage medium is further provided, storing a computer program, which when executed by a processor, causes the processor to execute the steps of a gas leakage detection method provided in any of the above embodiments of the present application.
[0114] In another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, which when executed by a processor, implements a gas leakage detection method as described in any of the embodiments of the present application.
[0115] Those of ordinary skill in the art can understand that all or part of the processes of the methods provided in the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or an external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0116] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered within the protection scope of the present invention. The protection scope of the present invention shall be subject to the protection scope of the claims described above.
Claims
1. A gas leakage detection method, characterized in that, Including: Obtain the current scene image in the monitoring scene; Obtain the target gas type in the monitoring scene, where the target gas type is a type divided according to the level of gas temperature; Based on the target gas type, determine the target gas area in the current scene image.
2. The gas leakage detection method according to claim 1, characterized in that, The obtaining of the target gas type in the monitoring scene includes at least one of the following: Through a user interface, obtain gas type configuration data, and determine the target gas type according to the gas type configuration data, where the gas type configuration data includes at least one of the following: gas type configuration item, gas temperature configuration item; Obtain the gas temperature data monitored in the monitoring scene, and determine the target gas type according to the gas temperature data.
3. The gas leakage detection method according to claim 1, wherein The determining of the target gas area in the current scene image based on the target gas type includes: Form input data of a pre-trained gas detection model based on the current scene image, and output a rough gas area in the current scene image through the gas detection model; Based on the rough gas area, determine the background area in the current scene image, calculate the background gray level of the background area, and determine a segmentation threshold based on the background gray level. Based on the target gas type and the segmentation threshold, accurately determine the target gas area in the rough gas area.
4. The gas leakage detection method according to claim 3, wherein The accurately determining of the target gas area in the rough gas area based on the target gas type and the segmentation threshold includes: When the target gas type is a high-temperature gas type, retain a plurality of first target pixel points with pixel values higher than the segmentation threshold in the rough gas area, and determine the target gas area based on the contour area formed by the plurality of first target pixel points; When the target gas type is a low-temperature gas type, retain a plurality of second target pixel points with pixel values lower than the segmentation threshold in the rough gas area, and determine the target gas area based on the contour area formed by the plurality of second target pixel points.
5. The gas leakage detection method according to claim 3, characterized in that, The method further includes: Obtain a training data set, where each training sample in the training data set includes a sample image and a gas area label corresponding to the sample image, and the area box corresponding to the gas area label in the sample image is represented by a regular geometric shape; Construct an initial gas detection model; Based on the training data set, iteratively train the initial gas detection model until an iteration termination condition is met, and obtain a pre-trained gas detection model.
6. The gas leakage detection method according to claim 1, wherein, The method further includes: Obtain gas display configuration data through a user interface, where the gas display configuration data includes one or more of the following combinations: whether the gas contour is prominent, whether the gas detection box is displayed, the coloring color of the non-gas area, the coloring method of the target gas area, the display image type corresponding to the non-gas area, the display image type corresponding to the target gas area; According to the gas display configuration data, display the target gas area.
7. The gas leakage detection method according to claim 6, characterized in that, The coloring methods for the target gas area include at least one of: gas concentration coloring method, gas probability coloring method, gas gray-scale difference coloring method. The display of the target gas area according to the gas display configuration data includes at least one of the following: When the coloring method of the target gas area is indicated as the gas concentration coloring method, obtain the gas concentration of each pixel point in the target gas area, and color the target gas area according to the gas concentration of each pixel point and the mapping relationship between the gas concentration and the color value; When the coloring method of the target gas area is indicated as the gas probability coloring method, obtain the gas detection probability value corresponding to each pixel point in the target gas area, and color the target gas area according to the gas detection probability value corresponding to each pixel point and the mapping relationship between the gas detection probability value and the color value; When the coloring method of the target gas area is indicated as the gas gray-scale difference coloring method, calculate the difference between the gray-scale value of each pixel point in the target gas area and the background gray-scale to obtain the gray-scale difference value corresponding to each pixel point, and color the target gas area according to the gray-scale difference value corresponding to each pixel point and the mapping relationship between the gray-scale difference value and the color value.
8. The gas leakage detection method according to claim 7, wherein, The obtaining of the gas concentration of each pixel point in the target gas area includes: Obtain the mapping relationship between the concentration influence parameter and the gas concentration, where the concentration influence parameter includes at least one of the following: the gray-scale value of the pixel point in the gas area, the ambient temperature, the background gray-scale, the gas type, the measurement distance; Obtain the values of each target concentration influence parameter, and use the values of each target concentration influence parameter as the input of the mapping relationship between the concentration influence parameter and the gas concentration to obtain the gas concentration of each pixel point.
9. The gas leakage detection method according to claim 6, wherein, The display image types corresponding to the non-gas area include at least one of the following: visible light image, infrared image, fused image of visible light and infrared image, low-light image, fused image of low-light image and infrared image; the display image types corresponding to the target gas area include at least one of the following: visible light image, infrared image, fused image of visible light and infrared image, low-light image, fused image of low-light image and infrared image.
10. A computer program product comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements a gas leakage detection method as described in any one of claims 1 to 9.
11. A gas leakage detection device, characterized in that, It includes a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor is caused to execute a gas leakage detection method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Combustible gas leakage detection method based on foreground region extraction and semantic segmentation
CN118196117A
Infrared natural gas leakage video detection method based on TSDNet
CN118823649A
Leakage gas detection method based on deep learning and optical flow method
CN119151929A
Cited By
Gas detection method, equipment and medium
CN121504952A
Gas flow rate estimation method and device, program product and medium
CN121522194A