Gas leakage area segmentation method and device, electronic equipment and storage medium

By using the difference between scene and background images and processing with a neural network model, the problem of low accuracy in gas leak area segmentation in complex backgrounds was solved, and accurate segmentation of the gas leak area was achieved.

CN122391255APending Publication Date: 2026-07-14SHENZHEN INST OF ADVANCED TECH CHINESE ACAD OF SCI

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN INST OF ADVANCED TECH CHINESE ACAD OF SCI
Filing Date
2025-01-12
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing gas leak area segmentation methods struggle to accurately distinguish gas regions from background noise in complex environments, leading to decreased segmentation accuracy.

Method used

By acquiring scene and background images and performing background subtraction, a target region image is generated. A pre-built gas leak region segmentation model is then used for segmentation. The model is trained by combining a contrast attention module, a thinning module, a feature extraction module, and an aggregation module to generate a segmented image of the target region.

Benefits of technology

It improves the accuracy of gas leak area segmentation, effectively distinguishing the target area from background noise in complex environments, and achieving accurate gas leak area segmentation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122391255A_ABST
    Figure CN122391255A_ABST
Patent Text Reader

Abstract

The application provides a gas leakage area segmentation method and device, and relates to the technical field of gas monitoring. The method comprises the following steps: monitoring a segmentation target in a gas leakage environment, and acquiring a scene image and a background image comprising the segmentation target; performing background difference on the background image and the scene image to generate a target area image indicating a difference area between the background image and the scene image; inputting the target area image and the scene image into a pre-constructed gas leakage area segmentation model to perform gas leakage area segmentation processing, and generating a target area segmentation image indicating a region where the segmentation target is located in the scene image. The application solves the problem of low accuracy of gas leakage area segmentation in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and more specifically, to a method, apparatus, electronic device, and storage medium for segmenting gas leak areas. Background Technology

[0002] Currently, gas leak detection is generally performed using infrared image monitoring. Existing gas infrared optical imaging technology can be divided into two-dimensional (2D) and three-dimensional (3D) imaging detection based on the type of data acquired. The difference lies in the fact that 3D infrared imaging detection includes spectral information. 2D infrared optical imaging detection is similar to visible light camera imaging, using optical lenses, infrared focal plane detectors, and related electronic devices to convert the detected signal into video output. To transmit mid-to-long-wave infrared light, the lens is typically made of germanium, resulting in higher costs. 3D infrared imaging detection adds spectral information to 2D imaging detection, relying on this information to identify the type of gas. However, due to the low resolution of spectral imaging, processing of the gas infrared image is particularly important. Furthermore, the gas leak area exhibits poor contrast and indistinct details in the infrared image, and interference from background environmental changes makes it difficult to distinguish the gas leak area from other interfering objects, leading to difficulties in detecting and segmenting the gas leak area. Therefore, it is necessary to determine and segment the gas leak area in the image.

[0003] Existing methods for segmenting gas leak areas involve capturing infrared radiation emitted by an object using an infrared camera and converting it into an electrical signal. This signal is then processed and converted to create a visualized thermal image, showing the temperature distribution on the object's surface. The brightness or color in the thermal image represents different temperature zones. By segmenting the infrared thermal image into gas leak areas, the area where the monitored target, such as gas, is leaking can be visually displayed.

[0004] Commonly used methods for gas leak region segmentation include computer vision methods based on optical gas imaging. These methods create a large-scale labeled dataset of methane leak videos containing different leak volumes and distances by adding labels to infrared images. Simultaneously, a GasNet network based on convolutional neural networks (CNNs) is constructed for automatic detection. Before the images are input into the GasNet network, background subtraction is performed on the images, and gas leak regions are segmented by inputting the images into the GasNet network.

[0005] In addition, there is a method for gas region monitoring and segmentation based on tensor factor-based leak detection algorithm. This leak detection algorithm first uses tensor factor to fuse infrared images and corresponding gradient maps to improve sensitivity, designs a finite state machine to maintain the gas leak foreground in the video stream, and finally uses a 50-layer ResNet50 for accurate detection.

[0006] A gas region detection and segmentation method based on a semantic segmentation architecture. This method creates an MR dataset (controlling methane release experiments) and a CR dataset (monitoring rumen gas emissions from dairy cows). It combines a Mix Vision Transformer encoder and a Light-Ham decoder to capture multi-scale features and refine the segmentation results for gas region detection.

[0007] The method for segmenting gas leak areas using the YOLOv5 object detection algorithm involves obtaining enhanced gas images using an infrared camera, then training the labeled infrared gas images with the YOLOv5 object detection algorithm. The trained model is used to identify the gas location. Next, the image is binarized using the Otsu method to segment the gas foreground and background. Finally, contour detection is used to extract the gas contour within the detection box, resulting in the final gas contour result.

[0008] As mentioned above, gas leak region segmentation methods use infrared images for segmentation. Due to limitations in their imaging mechanisms, these images typically have limited texture, resulting in a lack of detail and making accurate gas segmentation difficult. Furthermore, traditional gas leak region segmentation methods rely solely on gas image information, making it extremely difficult to distinguish gas regions from background noise (such as shadows or black patches) in complex backgrounds, thus reducing the accuracy of gas leak region segmentation.

[0009] As can be seen from the above, the problem of how to improve the accuracy of gas leak area segmentation still needs to be solved. Summary of the Invention

[0010] This application provides a method, apparatus, electronic device, and storage medium for segmenting gas leak areas, which can solve the problem of low accuracy in image region segmentation in related technologies. The technical solutions are as follows:

[0011] According to one aspect of this application, a method for segmenting a gas leakage area is characterized by comprising:

[0012] Acquire scene and background images, including the segmented target;

[0013] By performing background subtraction on the background image and the scene image, a target region image indicating the difference region between the background image and the scene image is generated;

[0014] The target region image and the scene image are input into a pre-built gas leak region segmentation model for gas leak region segmentation processing, generating a target region segmentation image that indicates the region where the segmented target is located in the scene image.

[0015] According to one aspect of this application, a method for constructing a gas leak region segmentation model is characterized by being applied to a neural network model, wherein the neural network model includes a contrastive attention module, a thinning module, a feature extraction module, and an aggregation module, and the gas leak region segmentation model construction method includes:

[0016] Acquire a scene image and a background image, and based on the background image, segment and label the image regions in the scene image related to the segmentation target to generate a target region image;

[0017] The target region image is paired with the background image to obtain a training set including the background image and at least one corresponding target region image;

[0018] Based on the training set, the contrast attention module, thinning module, feature extraction module, and aggregation module in the neural network model are trained to segment the gas leakage region, thereby obtaining a gas leakage region segmentation model.

[0019] According to one aspect of this application, a gas leak monitoring device is characterized by comprising:

[0020] The monitoring module is used to monitor the segmented target in a gas leak environment and generate scene images and background images including the segmented target.

[0021] The transmission module is used to transmit the scene image and background image of the segmented target to the gas leak area segmentation device for gas leak area segmentation, and / or to transmit the scene image and background image of the segmented target to the gas leak area segmentation model building device for gas leak area segmentation model building.

[0022] According to one aspect of this application, a gas leak area segmentation device includes:

[0023] The image acquisition module is used to acquire scene images and background images, including the segmentation target;

[0024] The difference module is used to perform background difference between the background image and the scene image to generate a target region image indicating the difference region between the background image and the scene image;

[0025] The gas leak region segmentation module is used to input the target region image and the scene image into a pre-constructed gas leak region segmentation model for gas leak region segmentation processing, generating a target region segmentation image indicating the region where the segmented target is located in the scene image. It acquires the scene image including the segmented target and the corresponding background image;

[0026] According to one aspect of this application, a gas leak area segmentation model construction apparatus includes:

[0027] The image annotation module is used to acquire scene images and background images, and to annotate the image regions in the scene images related to the segmentation target based on the background image, thereby generating a target region image;

[0028] An image pairing module is used to pair the target region image with the background image to obtain a training set including the background image and at least one corresponding target region image;

[0029] The training module is used to train the contrast attention module, refinement module, feature extraction module, and aggregation module in the neural network model to segment the gas leakage region based on the training set, thereby obtaining a gas leakage region segmentation model.

[0030] In an exemplary embodiment, the gas leakage area segmentation module includes:

[0031] The segmentation unit is used to input the target region image and the background image into the gas leak region segmentation model to perform gas leak region segmentation processing and generate segmented regions.

[0032] The overlay unit is used to overlay the segmented region with the scene image to generate a target region segmentation image.

[0033] In one exemplary embodiment, the segmentation unit includes:

[0034] The extraction sub-unit is used to extract features from the target area image and the background image based on the gas leakage area segmentation model, and generate the background features of the corresponding background image and the target features of the corresponding target area image.

[0035] The fusion subunit is used to fuse the background features and the target features based on the gas leakage area segmentation model to generate fused features;

[0036] The optimization subunit is used to perform feature optimization processing on the fused features based on the gas leakage area segmentation model to generate segmented regions.

[0037] In one exemplary embodiment, the image annotation module includes:

[0038] The difference unit is used to compare the scene image and the background image to determine the difference region between the background image and the scene image.

[0039] The annotation unit is used to annotate the difference regions in the target region image to generate a target region image with annotated segmented regions.

[0040] In one exemplary embodiment, the training module includes:

[0041] The prediction unit is used to determine the segmented regions of the target region image in the training set based on the contrastive attention module, thinning module, feature extraction module, and aggregation module in the neural network model, and to obtain the prediction region. The prediction region is used to indicate the prediction result of the segmented region in the target region image.

[0042] The parameter update unit is used to compare the segmented regions in the predicted region and the target region images, and update the parameters of the contrast attention module, thinning module, feature extraction module and aggregation module in the neural network model based on the comparison results, until the model parameters converge to obtain the gas leak area segmentation model.

[0043] In an exemplary embodiment, the prediction unit includes:

[0044] A feature extraction subunit is used to extract background features and target features through the feature extraction module;

[0045] The feature fusion subunit is used to perform feature fusion processing on the background features and the target features through the contrast attention module to obtain fused features;

[0046] The feature optimization subunit is used to perform feature optimization processing on the fused features through the refinement module;

[0047] The region generation subunit is used to upsample the fused features after feature optimization by the aggregation module to generate the prediction region.

[0048] The beneficial effects of the technical solution provided in this application are:

[0049] In the above technical solution, by comparing the scene image and the background image, and combining the effective information from both images, the gas leak area segmentation process is guided, thereby achieving accurate target labeling and improving the recognition accuracy of image difference regions. By using the gas leak area segmentation model to segment the target area image, information from both the background and scene images can be fully utilized to distinguish the target area from background noise in complex backgrounds, achieving accurate and efficient segmentation of the target area and avoiding the influence of complex backgrounds and moving objects on the gas leak area segmentation. This effectively solves the problem of low accuracy in image region segmentation in related technologies. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.

[0051] Figure 1This is a schematic diagram based on the implementation environment involved in this application;

[0052] Figure 2 This is a flowchart illustrating a gas leak area segmentation method according to an exemplary embodiment;

[0053] Figure 3 This is a flowchart illustrating a method for constructing a gas leakage area segmentation model according to an exemplary embodiment;

[0054] Figure 4 This is a flowchart of a target region image annotation process in an application scenario;

[0055] Figure 5 This is a schematic diagram illustrating the specific implementation of a gas leakage area segmentation model in an application scenario;

[0056] Figure 6 This is a schematic diagram illustrating the specific implementation of the contrast attention module in an application scenario;

[0057] Figure 7 This is a schematic diagram illustrating the detailed implementation of a module in an application scenario;

[0058] Figure 8 This is a schematic diagram illustrating the specific implementation of the aggregation module in an application scenario;

[0059] Figure 9 This is a schematic diagram illustrating the specific implementation of a gas leak area segmentation method in an application scenario;

[0060] Figure 10 This is a structural block diagram of a gas leak monitoring device according to an exemplary embodiment;

[0061] Figure 11 This is a structural block diagram of a gas leakage area segmentation device according to an exemplary embodiment;

[0062] Figure 12 This is a structural block diagram of a gas leakage area segmentation model construction device according to an exemplary embodiment. Detailed Implementation

[0063] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0064] Those skilled in the art will understand that, unless explicitly stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in the specification of this application means the presence of features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.

[0065] As mentioned earlier, current gas leak area segmentation technologies generally use infrared images for this purpose. However, due to limitations in their imaging mechanisms, these images typically have limited texture, resulting in a lack of detail and making accurate gas segmentation difficult. Furthermore, traditional gas detection methods rely solely on gas image information, making it extremely difficult to distinguish gas regions from background noise (such as shadows or black patches) in complex environments, thus reducing the accuracy of gas leak area segmentation.

[0066] As can be seen from the above, the accuracy of gas leak area segmentation in existing technologies is not high.

[0067] Therefore, the gas leak region segmentation method provided in this application can effectively improve the accuracy of gas leak region segmentation, thereby improving the accuracy of image region segmentation. Accordingly, this gas leak region segmentation method is applicable to a gas leak region segmentation device, which can be deployed on an electronic device. This electronic device can be a computer device configured with a von Neumann architecture, such as a desktop computer, laptop computer, or server. The electronic device can also be a portable mobile electronic device, such as a smartphone or tablet computer.

[0068] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0069] Figure 1 This is a schematic diagram of an implementation environment involved in a gas leak area segmentation method. It should be noted that this implementation environment is merely an example adapted to the present invention and should not be construed as providing any limitation on the scope of the invention.

[0070] The implementation environment includes a data acquisition terminal 110 and a server terminal 130.

[0071] Specifically, the acquisition terminal 110 can also be considered an image acquisition device, including but not limited to electronic devices with shooting functions such as cameras, camcorders, and video recorders. For example, the acquisition terminal 110 is a camera.

[0072] Server 130 can be an electronic device such as a desktop computer, laptop computer, or server, or it can be a computer cluster consisting of multiple servers, or even a cloud computing center consisting of multiple servers. Server 130 is used to provide backend services, such as, but not limited to, gas leak area segmentation services.

[0073] The server 130 and the acquisition terminal 110 establish a network communication connection in advance via wired or wireless means, and data transmission between the server 130 and the acquisition terminal 110 is realized through this network communication connection. The transmitted data includes, but is not limited to, scene images and background images, etc.

[0074] In one application scenario, through the interaction between the acquisition terminal 110 and the server terminal 130, the acquisition terminal 110 acquires scene images and background images, and uploads the scene images and background images to the server terminal 130 to request the server terminal 130 to provide gas leak area segmentation services.

[0075] For server 130, after receiving the scene image and background image uploaded by acquisition terminal 110, it calls the gas leak area segmentation service to convert the scene image and background image into the target area segmentation image through the gas leak area segmentation model, thereby improving the accuracy of gas leak area segmentation and solving the problem of low accuracy of image area segmentation in related technologies.

[0076] Please see Figure 2 This application provides a method for segmenting gas leakage areas. This method is applicable to electronic devices, such as desktop computers, laptops, servers, etc.

[0077] In the following method embodiments, for ease of description, the execution subject of each step of the method is an electronic device, but this does not constitute a specific limitation.

[0078] like Figure 2 As shown, the method may include the following steps:

[0079] Step 210: Obtain the scene image and background image including the segmented target.

[0080] The scene image refers to an image captured in an environment where a segmentation target exists. For example, when the segmentation target is a leaking gas, the image is captured by an image acquisition device to capture the environment in which the gas leak occurs. Alternatively, it can be a video frame captured by the image acquisition device in a video to be detected, which reflects the environmental conditions where the gas leak occurs. In other words, the scene images continuously acquired during the process of capturing the environment in which the segmentation target occurs can be from multiple independently captured images or from a continuously captured video, without any limitation here.

[0081] The background image is an image captured in an environment where no segmentation target exists, corresponding to the scene image. For example, when the scene image is an image captured by an image acquisition device of a pipeline where gas is leaking, the background image is an image captured of the pipeline when no gas leak is occurring.

[0082] One possible implementation is to obtain a static background image by photographing the static environment in order to reduce noise interference from moving objects.

[0083] Step 230: Perform background subtraction on the background image and the scene image to generate a target region image that indicates the difference between the background image and the scene image.

[0084] Specifically, background subtraction performs difference recognition image comparison processing on background image and scene image to determine the information related to the segmentation target in the scene image, determine the difference region where the segmentation target is located between the background image and the scene image, and then filter out background noise and motion interference generated during the shooting of background image and scene image, and indicate the difference region in the target region image.

[0085] One possible implementation is to generate a target region image by annotating the difference regions on the scene image.

[0086] Step 250: Input the target region image and the scene image into the pre-built gas leak region segmentation model to perform gas leak region segmentation processing, and generate a target region segmentation image indicating the region where the segmented target is located in the scene image.

[0087] Among them, the gas leak area segmentation model is used to extract information from the background image and the scene image. Based on the background information in the static background, noise other than the segmentation target is filtered out in the target area image. The corresponding area of ​​the segmentation target in the difference area is predicted. The predicted area is combined with the scene image to generate a target area segmentation image that indicates the area where the segmentation target is located in the scene image.

[0088] Through the above process, effective information from both the scene and background images is combined to filter out background noise, improving the accuracy of identifying image difference regions. The gas leak region segmentation model is used to segment the target region image, fully utilizing information from both the background and scene images. This allows for the differentiation of the target region from background noise in complex backgrounds, enabling precise determination of the target region within the scene image and accurate segmentation of the target region. This effectively avoids the influence of complex backgrounds and moving objects on gas leak region segmentation during gas monitoring, achieving accurate target labeling. By generating a target region segmentation image from the determined target region in the background image, potential motion interference in the scene image is reduced, preventing background noise and motion interference from affecting the gas leak region segmentation results and improving the accuracy of image region segmentation.

[0089] In one exemplary embodiment, step 250 may include the following steps:

[0090] Step 251: Input the target area image and background image into the gas leak area segmentation model to perform gas leak area segmentation processing and generate segmented regions.

[0091] The gas leak region segmentation model is a pre-trained neural network model. Specifically, after identifying the discrepancy regions in the target region image, the gas leak region segmentation model analyzes the target region image and the corresponding background image, identifies and filters out noise in the discrepancy regions, determines the remaining discrepancy regions as the regions where the segmentation target is located, and performs gas leak region segmentation, generating a segmentation region that only includes the region where the segmentation target is located.

[0092] In one exemplary embodiment, step 251 may include the following steps:

[0093] Step 2511: Based on the gas leak area segmentation model, feature extraction is performed on the target area image and the background image to generate the background features of the corresponding background image and the target features of the corresponding target area image.

[0094] It is understandable that background features extracted from the background image reflect the features of all other elements in the environment except for the segmented target. Target features extracted from the target region image, on the other hand, reflect the features of the environment related to the recognition and processing of the segmented target.

[0095] In one possible implementation, multiple feature extractors are used to perform multi-level feature extraction on the target region image and the background image to generate multi-scale target features and background features.

[0096] Step 2513: Based on the gas leak area segmentation model, the background features and target features are fused to generate fused features.

[0097] By fusing background and target features to generate fused features, the influence of background interference on feature recognition is reduced during the feature fusion process, ensuring the clarity and accuracy of the fused features. By making target features more prominent and easily identifiable in the target region image, the accuracy and efficiency of target segmentation by the fused features are enhanced.

[0098] In one possible implementation, a contrastive attention mechanism is used to fuse background and target features, thereby suppressing background features and highlighting target features in the fused features.

[0099] Step 2515: Based on the gas leakage area segmentation model, perform multi-level feature optimization processing on the fused features to generate at least two segmented regions.

[0100] Specifically, background features and target features can be multi-scale features collected through multi-level feature extraction. By generating multiple fusion features at different levels from the corresponding background features and target features at different levels, and by performing feature optimization processing such as upsampling, global context awareness and attention mechanisms, multi-stage segmentation regions at different levels can be obtained.

[0101] Through the above process, the generative network achieves the generation of segmented regions based on background and target features in the target region image and background image, and captures features at different levels. Through multi-level feature fusion and feature optimization, segmented regions are generated at different levels, thereby improving the accuracy of the generated segmented regions.

[0102] Step 253: Overlay the segmented region with the scene image to generate the target region segmentation image.

[0103] Specifically, the segmented region is compared with the three-dimensional space and environmental parameters of the scene image to determine the corresponding region on the scene image. The segmented region is then superimposed onto the corresponding region of the scene image to finally generate a target region segmentation image that indicates the specific region of the segmentation target on the scene image.

[0104] Through the above process, the segmented region and the scene image are fused, eliminating interference in the scene image while ensuring the accuracy of the target region in the segmented image.

[0105] In one exemplary embodiment, such as Figure 3 As shown, this application provides a method for constructing a gas leakage region segmentation model. The construction process of the gas leakage region segmentation model includes the following steps:

[0106] Step 310: Obtain the scene image and background image, and based on the background image, perform segmentation region annotation on the image regions in the scene image related to the segmentation target to generate the target region image.

[0107] In one exemplary embodiment, step 310 may include the following steps:

[0108] Step 311: Perform background subtraction on the background image and the scene image to determine the difference region between the background image and the scene image.

[0109] Among them, background subtraction is performed by subtracting the background image and the scene image, and by searching the background image and the scene image, the region where the difference in the pixel value of the image exceeds a certain threshold is identified as the difference region.

[0110] It is understandable that since there is no segmentation target in the background image, the area where the segmentation target is located is within the difference region in the scene image.

[0111] Step 313: Annotate the difference regions in the target region image to generate the target region image.

[0112] This involves annotating the discrepancies in the target region image to highlight these discrepancies and ensure rapid identification. For example, ... Figure 4 The process of generating the target area image, as shown, first involves using an image of the leak area taken in the gas leak environment as the scene image and performing differential processing with the background image to identify the difference regions in the leak area image, thus generating a differential image. Then, the difference regions in the differential image are manually annotated to generate a manually annotated image. Finally, the difference regions in the manually annotated image are exported to generate a labeled image.

[0113] Through the above process, the target area image is generated by background subtraction, ensuring the accuracy of the identification of the difference area. By identifying and labeling the difference area, the focus can be quickly placed on the difference area, avoiding invalid information redundancy, improving the accuracy and efficiency of the gas leak area segmentation results, and ensuring the efficiency of the identification of the difference area and the efficiency of the target area image data processing.

[0114] Step 330: Pair the target region image with the background image to obtain a training set including the background image and at least one corresponding target region image.

[0115] The training set includes pre-labeled target region images and corresponding background images.

[0116] It is understandable that since the background image does not contain the segmentation target, the background image can be used as a reference to determine the target region image with different forms of segmentation target corresponding to the background image by pairing.

[0117] Step 350: Based on the training set, train the contrast attention module, refinement module, feature extraction module, and aggregation module in the neural network model to segment the gas leak region, and obtain the gas leak region segmentation model.

[0118] The neural network model extracts features from the input background image and target region image through a semantic segmentation algorithm, performs multi-scale feature fusion on the extracted features, and optimizes the fused features in a hierarchical manner to obtain the predicted region of the segmented area on the target region image. Finally, the predicted region output from the multi-stage process is superimposed on the background image to output an intuitive target region segmentation image.

[0119] In one possible implementation, the neural network model can be a ResNet neural network of different depths, such as ResNet-18, ResNet-34, ResNet-50, ResNet-101, and ResNet-152, by selecting the neural network model according to the different depth requirements of the segmentation target.

[0120] The parameters of neural network models at different depths are shown in the table below:

[0121]

[0122] In one exemplary embodiment, step 350 may include the following steps:

[0123] Step 351: Based on the contrast attention module, thinning module, feature extraction module, and aggregation module in the neural network model, the target region image in the training set is segmented to determine the predicted region.

[0124] The prediction region is used to indicate the prediction result of the segmented region in the target region image.

[0125] In one exemplary embodiment, step 351 may include the following steps:

[0126] Step 3511: Extract background features and target features through the feature extraction module.

[0127] Step 3513: The background features and target features are fused by comparing the attention module to obtain the fused features.

[0128] Step 3515: The refinement module is used to perform feature optimization processing on the fused features.

[0129] Step 3517: The aggregation module is used to upsample the fused features after feature optimization to generate the prediction region.

[0130] The gas leak region segmentation model includes a contrast-attention module, a refinement module, a feature extraction module, and an aggregation module. The feature extraction module extracts background and target features. The contrast-attention module fuses these background and target features. The refinement module optimizes the fused features. The aggregation module upsamples the optimized results from the refinement module to generate the segmented region.

[0131] Specifically, such as Figure 5 As shown, after the target area image and background image are input into the gas leak area segmentation model, background and target features are extracted through a multi-layer feature extraction module. After extracting background and target features at each layer, the extracted background and target features are fused through a gas contrast attention module. The fused features of the lower layers are optimized by a refinement module and then upsampled by an aggregation module to obtain preliminary predicted region results. The fused features of the higher layers are further fused by the aggregation module and then directly upsampled to obtain more accurate predicted region results.

[0132] Through the above process, the neural network model introduces residual connections by comparing the attention module, refinement module, feature extraction module, and aggregation module, directly adding the identity mapping to the output of the convolutional layer, making it easier for the network to learn effective features. Specifically, each module of the neural network model bypasses one or more convolutional layers through "skip connections," directly superimposing the input features onto the output features, ensuring that the gradient can propagate backward without obstacles, thereby allowing the network depth to be further increased.

[0133] Among them, the contrast attention module, such as Figure 6 As shown in the figure, B represents the background feature and G represents the target feature.

[0134] Background and target features are extracted for attention through channel attention blocks and spatial attention blocks. By combining the two attention mechanisms, channel attention and spatial attention are used to focus on the parts of the background and target features that are relevant to the segmentation region, making the target region more prominent.

[0135] Detailed modules such as Figure 7 As shown, the fusion features are upsampled and fused point by point through the aggregation attention unit in the refinement module, thereby aggregating the input features, optimizing the low-level fusion features, and outputting a more accurate prediction region representation.

[0136] Aggregation modules such as Figure 8As shown, after the multi-scale features are input into the aggregation module, they are subjected to global context awareness by the global context module, highlighting the key features of the segmented region. Then, the multi-scale features of different resolutions are fused through upsampling, and finally the fused features are output.

[0137] Through the above process, the multi-layered gas leak region segmentation model superimposes input features onto output features, ensuring unimpeded gradient propagation and allowing for further increases in network depth, thus improving the accuracy of gas leak region segmentation. A dual-layer attention mechanism highlights segmented regions, suppressing background noise interference and improving the overall performance of the neural network model. A refinement module optimizes feature fusion quality, enabling the model to output more accurate predicted regions. An aggregation module integrates multi-scale features, generating refined feature representations that combine global semantic information with local details. Feature alignment at different resolutions dynamically highlights key features, suppresses redundant interference, and achieves efficient fusion of global and local information. The model ensures both semantic consistency and boundary clarity in the output feature representation, significantly improving the performance and accuracy of the gas leak region segmentation model in segmentation and detection tasks in complex scenes.

[0138] Step 353: Compare the segmented regions in the predicted region and the target region images. Based on the comparison results, update the parameters of the contrast attention module, thinning module, feature extraction module, and aggregation module in the neural network model until the model parameters converge to obtain the gas leak region segmentation model.

[0139] It is understandable that each target region image has a corresponding predicted region. After segmenting the target region image into a gas leak area, the segmentation effect is evaluated by comparing the difference between the generated predicted region and the corresponding segmented region in the target region image. The closer the predicted region is to the pre-defined segmented region, the better the gas leak area segmentation effect. The prediction results are used to adjust the model parameters, causing the neural network model to be trained in a direction where the predicted region is closer to the pre-defined segmented region. Finally, after the model parameters converge, the gas leak area segmentation model with the best segmentation ability is generated.

[0140] Under the above embodiments, the neural network model is trained based on the training set to improve the gas leakage region segmentation capability of the neural network model, and obtain a gas leakage region segmentation model that can stably perform gas leakage region segmentation. Through the neural network model, the problems of image segmentation gradient vanishing and performance degradation caused by the increase of network depth are solved, thereby improving the image segmentation effect.

[0141] Figure 9This is a schematic diagram illustrating a specific implementation of a gas leak area segmentation method in an application scenario. In this scenario, a background image and a leak scene image are obtained through corresponding hardware devices. Then, the leak scene image and the original static scene image are subjected to background subtraction. Different parts are manually labeled to obtain the precise gas leak range. The obtained gas leak area image is paired with the background image to obtain a training set. The neural network model is trained using the training set to generate a gas leak area segmentation model.

[0142] The trained gas leak region segmentation network uses ResNet as its backbone. Paired background and leak scene images are processed layer by layer by the ResNet network to extract multi-scale features. The background and gas features extracted at each layer are fused using a gas contrast attention module. Then, the low-level fused features are optimized by a refinement module and upsampled by an aggregation module to obtain preliminary gas region segmentation results. High-level features are further fused by the aggregation module, and the fused features are upsampled to obtain more accurate gas region segmentation results. Finally, the segmentation results are overlaid with the leak scene image to generate a gas leak region segmentation image, visually displaying the gas leak area.

[0143] In this application scenario, to verify the performance of the gas leak region segmentation network, semantic segmentation models (PSPNet, DeepLabV3+, YOLOv5, SegFormer, and GasFormer) were selected and tested on a manually annotated dataset. The results are shown in the table below:

[0144]

[0145]

[0146] It can be seen that this gas leak area segmentation model outperforms other models in terms of Acc (prediction accuracy), IoU (intersection over union ratio), and FScore.

[0147] Meanwhile, to verify that the proposed model can perform segmentation by incorporating background information, an ablation experiment was conducted. The background in the dataset was removed, and the experiment was performed on the neural network proposed in this method. The results are as follows:

[0148]

[0149] The experiments described above demonstrate that our proposed method can segment gas regions by incorporating background information, and it exhibits superior accuracy compared to mainstream segmentation models in gas leak region segmentation tasks. The gas leak region segmentation model proposed in this application outperforms traditional segmentation algorithms on labeled gas datasets, demonstrating superior performance and accuracy in gas leak region segmentation tasks.

[0150] The following are embodiments of the apparatus described in this application, which can be used to execute the gas leakage area segmentation method involved in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the method embodiments of the gas leakage area segmentation method involved in this application.

[0151] Please see Figure 10 This application provides a gas leak monitoring device 1000, including but not limited to: a monitoring module 1010 and a transmission module 1030.

[0152] The monitoring module 1010 is used to monitor the segmented target in a gas leak environment and generate scene images and background images including the segmented target.

[0153] The transmission module 1030 is used to transmit the scene image and background image of the segmented target to the gas leak area segmentation device for gas leak area segmentation, and / or to transmit the scene image and background image of the segmented target to the gas leak area segmentation model building device for gas leak area segmentation model building.

[0154] Please see Figure 11 This application provides a gas leak area segmentation device 1100, including but not limited to: an image acquisition module 1110, a differential module 1130, and a gas leak area segmentation module 1150.

[0155] The image acquisition module 1110 is used to acquire scene images and background images including the segmentation target;

[0156] Difference module 1130 is used to perform background difference between background image and scene image to generate target region image indicating the difference region between background image and scene image;

[0157] The gas leak region segmentation module 1150 is used to input the target region image and the scene image into a pre-built gas leak region segmentation model for gas leak region segmentation processing, generating a target region segmentation image indicating the region where the segmented target is located in the scene image. It acquires the scene image including the segmented target and the corresponding background image;

[0158] Please see Figure 12 This application provides a gas leak area segmentation model construction device 1200, including but not limited to: an image pairing module 1210 and a training module 1230.

[0159] The image pairing module 1210 is used to acquire the target region image and the background image of the pre-labeled segmented region, and to pair the target region image and the background image to obtain a training set including the background image and at least one corresponding target region image.

[0160] Training module 1230 is used to train the contrast attention module, refinement module, feature extraction module, and aggregation module in the neural network model to segment the gas leak area based on the training set, so as to obtain the gas leak area segmentation model.

[0161] It should be noted that the gas leak monitoring device, gas leak area segmentation device, and gas leak area segmentation model construction device provided in the above embodiments are only illustrated by the division of the above functional modules when performing the gas leak area segmentation method. In actual applications, the above functions can be assigned to different functional modules as needed. That is, the internal structure of the gas leak area segmentation device will be divided into different functional modules to complete all or part of the functions described above.

[0162] Furthermore, the embodiments of the gas leakage area segmentation device and the gas leakage area segmentation method provided in the above embodiments belong to the same concept, and the specific way in which each module performs its operation has been described in detail in the method embodiments, and will not be repeated here.

[0163] Compared with related technologies, this application achieves improved image difference region recognition accuracy by combining effective information from both scene and background images to filter out background noise. It utilizes a gas leak region segmentation model to segment the target region image, fully leveraging information from both the background and scene images to distinguish the target region from background noise in complex backgrounds. This enables precise segmentation of the target region within the scene image, effectively avoiding the influence of complex backgrounds and moving objects on gas leak region segmentation during gas monitoring, and achieving accurate target labeling. By generating a target region segmentation image from the background image, it reduces potential motion interference in the scene image, preventing background noise and motion interference from affecting the gas leak region segmentation results and improving image region segmentation accuracy. The introduction of a background difference processing method, through comparison of the background image and the leak scene image, combined with manual annotation, generates an accurate gas leak region range image, effectively solving the problems of complex backgrounds and motion interference. The gas leak region segmentation model is a neural network model that combines background and gas image information to accurately segment gas regions, effectively avoiding interference from complex backgrounds and moving objects, thus ensuring accurate gas leak region segmentation. This paper describes a generative network that generates segmentation regions based on background and target features in both the target region and background images. Features are captured at different levels, and multi-level feature fusion and optimization are used to generate segmented regions at various levels, improving accuracy. The network integrates segmented regions with the scene image, eliminating interference while ensuring the accuracy of the target region segmentation. A multi-layered gas leak region segmentation model superimposes input features onto output features, ensuring unimpeded gradient propagation and allowing for further increases in network depth, thus improving the accuracy of gas leak region segmentation. A dual-layer attention mechanism highlights segmented regions, suppressing background noise and improving the overall performance of the neural network model. A refinement module optimizes feature fusion quality, enabling the model to output more accurate predicted regions. An aggregation module integrates multi-scale features to generate refined feature representations that combine global semantic information with local details. Feature alignment at different resolutions dynamically highlights key features, suppresses redundant interference, and achieves efficient fusion of global and local information. Ensuring both semantic consistency and boundary clarity in the output feature representation significantly improves the performance and accuracy of the gas leak region segmentation model in segmentation and detection tasks in complex scenarios.

[0164] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0165] The above are only some embodiments of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for segmenting a gas leakage area, characterized in that, include: Acquire scene and background images, including the segmented target; By performing background subtraction on the background image and the scene image, a target region image indicating the difference region between the background image and the scene image is generated; The target region image and the scene image are input into a pre-built gas leak region segmentation model for gas leak region segmentation processing, generating a target region segmentation image that indicates the region where the segmented target is located in the scene image.

2. The method as described in claim 1, characterized in that, The step of inputting the target region image and the scene image into a pre-constructed gas leak region segmentation model for gas leak region segmentation processing, and generating a target region segmentation image indicating the region where the segmented target is located in the scene image, includes: The target region image and background image are input into the gas leak region segmentation model to perform gas leak region segmentation processing and generate segmented regions. The segmented region is overlaid with the scene image to generate a target region segmentation image.

3. The method as described in claim 2, characterized in that, The step of inputting the target region image and background image into the gas leak region segmentation model for gas leak region segmentation processing to generate segmented regions includes: Based on the gas leak area segmentation model, feature extraction is performed on the target area image and the background image to generate the background features of the corresponding background image and the target features of the corresponding target area image. Based on the gas leak area segmentation model, the background features and the target features are fused to generate fused features; The fused features are optimized using a gas leakage region segmentation model to generate at least two segmented regions.

4. A method for constructing a gas leakage area segmentation model, characterized in that, Applied to a neural network model, the neural network model includes a contrastive attention module, a refinement module, a feature extraction module, and an aggregation module. The method for constructing the gas leak region segmentation model includes: Acquire a scene image and a background image, and based on the background image, segment and label the image regions in the scene image related to the segmentation target to generate a target region image; The target region image is paired with the background image to obtain a training set including the background image and at least one corresponding target region image; Based on the training set, the contrast attention module, refinement module, feature extraction module, and aggregation module in the neural network model are trained to segment the gas leakage region, thereby obtaining a gas leakage region segmentation model.

5. The method as described in claim 4, characterized in that, The step of acquiring a scene image and a background image, and then segmenting and labeling the image regions related to the segmentation target in the scene image based on the background image to generate a target region image, includes: The scene image and the background image are compared to determine the difference area between the background image and the scene image; The difference regions in the target region image are labeled to generate the target region image.

6. The method as described in claim 4, characterized in that, The step of training the contrastive attention module, refinement module, feature extraction module, and aggregation module of the neural network model based on the training set to segment the gas leak region, thereby obtaining a gas leak region segmentation model, includes: Based on the contrastive attention module, thinning module, feature extraction module, and aggregation module in the neural network model, the target region image in the training set is segmented to determine the predicted region, which is used to indicate the prediction result of the segmented region in the target region image. The predicted region and the segmented region in the target region image are compared. Based on the comparison result, the parameters of the contrast attention module, thinning module, feature extraction module, and aggregation module in the neural network model are updated until the model parameters converge, thus obtaining the gas leak region segmentation model.

7. The method as described in claim 6, characterized in that, The contrastive attention module, thinning module, feature extraction module, and aggregation module in the neural network model segment and determine the target region image in the training set to obtain the predicted region, including: Background and target features are extracted using the feature extraction module. By comparing the background features and the target features using an attention module, a fused feature is obtained. The refinement module is used to perform feature optimization processing on the fused features; The aggregation module is used to upsample the fused features after feature optimization to generate the prediction region.

8. A gas leak monitoring device, characterized in that, include: The monitoring module is used to monitor the segmented target in a gas leak environment and generate scene images and background images including the segmented target; The transmission module is used to transmit the scene image and background image of the segmented target to the gas leak area segmentation device for gas leak area segmentation, and / or to transmit the scene image and background image of the segmented target to the gas leak area segmentation model building device for gas leak area segmentation model building.

9. A gas leakage area segmentation device, used to execute the gas leakage area segmentation method according to claims 1-3, characterized in that, include: The image acquisition module is used to acquire scene images and background images, including the segmentation target; The difference module is used to perform background difference between the background image and the scene image to generate a target region image indicating the difference region between the background image and the scene image; The gas leak region segmentation module is used to input the target region image and the scene image into a pre-constructed gas leak region segmentation model for gas leak region segmentation processing, generating a target region segmentation image indicating the region where the segmented target is located in the scene image. It also acquires the scene image including the segmented target and the corresponding background image.

10. A gas leakage region segmentation model construction apparatus, used to execute the gas leakage region segmentation model construction method according to claims 4-7, characterized in that, include: The image pairing module is used to acquire a target region image and a background image of a pre-labeled segmented region, and to perform image pairing between the target region image and the background image to obtain a training set including the background image and at least one corresponding target region image; The training module is used to train the contrast attention module, refinement module, feature extraction module, and aggregation module in the neural network model to segment the gas leakage region based on the training set, thereby obtaining a gas leakage region segmentation model.