Infrared gas leak detection method and device based on selective scanning and boundary calibration
Patent Information
- Application Number
- CN202610934838.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-26
- Publication Date
- 2026-10-30
AI Technical Summary
传统基于卷积神经网络的方法(如U-Net、DeepLabv3)受限于固定的局部感受野和规则采样网格,难以建立跨越全图的长距离依赖来连接断裂的气羽,也无法自适应地拟合非刚性的模糊边界
[0010]借由上述技术方案,本发明提供的一种基于选择扫描与边界校准的红外气体泄漏检测方法及装置,通过本发明的技术方案,对初始像素级掩膜检测模型进行训练,初始像素级掩膜检测模型包括:特征提取模块、羽流连续性感知模块、自适应边缘重建策略模块、空间映射校准机制模块与分割头,通过羽流连续性感知模块,利用选择扫描,一方面,实现了全图像素级的长距离依赖建模,能有效抵抗背景热噪声的干扰,将被遮挡或断裂的离散气羽在语义层面重新关联,恢复气体羽流的拓扑连续性,另一方面,大幅降低了模型参数量和浮点运算量;通过自适应边缘重建策略模块,利用可变形卷积网络,能够根据气体的扩散趋势主动调整空间偏移量和调制标量,相比现有技术的固定采样,该模块显著提升了对低对比度、无定形模糊边缘的捕捉能力,避免了传统固定采样在处理低对比度边缘时的定位失真,确保了泄漏检测轮廓符合气体扩散的物理真实性;通过空间映射校准机制模块,利用通道注意力权重与残差连接相结合,有效消除了全局特征与局部边界特征在空间映射上的位移偏差,实现了全局结构与局部细节的深度融合,增强了在不同浓度、不同形状泄漏云团下的适应性,避免了复杂热环境造成的伪影干扰,提升了整体分割的稳定性和鲁棒性。因此,实现了兼顾全局拓扑连续性、局部边界精确性与计算高效性的红外气体泄漏检测,提高了泄漏检测准确性与效率。
Smart Images

Figure CN123015370A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of infrared imaging target detection technology, and in particular to an infrared gas leak detection method and apparatus based on selective scanning and boundary calibration. Background Technology
[0002] With the acceleration of global industrialization, gas leak detection in fields such as petrochemicals and natural gas storage and transportation has become a core task for ensuring industrial safety and achieving carbon neutrality. Currently, infrared gas leak detection is employed. This method utilizes infrared thermal imaging technology to perform non-contact, visual, and long-distance leak detection of leaked gases (such as methane and sulfur hexafluoride) in industrial sites. The technical principle is that gas molecules selectively absorb infrared radiation of specific wavelengths. When gas leaks and diffuses into a warm background (such as pipes or equipment surfaces), it weakens the intensity of thermal radiation transmitted towards the infrared thermal imager in that direction, thus forming a gas plume image with a significant temperature contrast to the background in the thermal image.
[0003] However, the aforementioned infrared gas leak detection faces two major challenges in complex industrial environments. First, the target exhibits topological structural fragmentation: infrared thermal imaging technology relies on the temperature difference between the gas and the background. When this temperature difference approaches the sensor's sensitivity threshold, background thermal noise (such as high-temperature reflections from pipes and ground thermal radiation) disrupts the spatial continuity of gas thermal radiation, causing severe fragmentation of the gas plume in the thermal image, making it difficult to form a complete connected region. This leads to missed detections and failure to locate the leak source. Second, the target exhibits non-rigid boundary ambiguity: driven by turbulence and wind speed, the gas plume exhibits highly non-rigid geometric deformation during diffusion, with its edges appearing amorphous, diffuse, and blurry, lacking clear contour definition. This results in inaccurate leak range detection.
[0004] Existing technologies can be broadly categorized into two types. Traditional convolutional neural network-based methods (such as U-Net and DeepLabv3) are limited by fixed local receptive fields and regular sampling grids, making it difficult to establish long-distance dependencies across the entire image to connect broken gas plumes, and also unable to adaptively fit non-rigid, fuzzy boundaries. While Transformer-based global modeling methods (such as SegFormer) can expand the receptive field, their computational complexity increases quadratically with image resolution, resulting in a large number of model parameters, low inference efficiency, and difficulty in real-time deployment on industrial edge devices. Therefore, there is an urgent need for an infrared gas leak detection method that can balance global topological continuity, local boundary accuracy, and computational efficiency. Summary of the Invention
[0005] In view of this, the present invention provides an infrared gas leak detection method and apparatus based on selective scanning and boundary calibration, which realizes infrared gas leak detection that takes into account global topological continuity, local boundary accuracy and computational efficiency, thereby improving the accuracy and efficiency of leak detection.
[0006] According to one aspect of the present invention, an infrared gas leak detection method based on selective scanning and boundary calibration is provided, the method comprising: Obtain a preprocessed set of infrared gas image samples, in which each infrared gas image sample is labeled with the corresponding real pixel-level mask and real boundary; An initial pixel-level mask detection model is trained based on the infrared gas image sample set. The parameters of the initial pixel-level mask detection model are updated based on boundary calibration according to the corresponding real pixel-level mask and real boundary until a preset stopping condition is reached, thus obtaining a trained pixel-level mask detection model. The initial pixel-level mask detection model includes: a feature extraction module, a plume continuity perception module, an adaptive edge reconstruction strategy module, a spatial mapping calibration mechanism module, and a segmentation head. An infrared gas image to be detected is acquired, and the image is detected based on the pixel-level mask detection model to obtain a target pixel-level mask, thereby completing the infrared gas leakage detection.
[0007] According to another aspect of the present invention, an infrared gas leak detection device based on selective scanning and boundary calibration is provided, the device comprising: The acquisition module is used to acquire a preprocessed infrared gas image sample set, wherein each infrared gas image sample is labeled with the corresponding real pixel-level mask and real boundary. The training module is used to train an initial pixel-level mask detection model based on the infrared gas image sample set. Based on the corresponding real pixel-level mask and real boundary, the parameters of the initial pixel-level mask detection model are updated according to the boundary calibration until a preset stopping condition is reached to obtain a trained pixel-level mask detection model. The initial pixel-level mask detection model includes: a feature extraction module, a plume continuity perception module, an adaptive edge reconstruction strategy module, a spatial mapping calibration mechanism module, and a segmentation head. The detection module is used to acquire an infrared gas image to be detected, and based on the pixel-level mask detection model, detect the infrared gas image to be detected to obtain a target pixel-level mask in order to complete the infrared gas leakage detection.
[0008] According to another aspect of the present invention, a storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the above-described infrared gas leak detection method based on selective scanning and boundary calibration.
[0009] According to another aspect of the present invention, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor, when executing the program, implements the above-described infrared gas leak detection method based on selective scanning and boundary calibration.
[0010] By employing the above technical solution, this invention provides an infrared gas leak detection method and apparatus based on selective scanning and boundary calibration. Through this invention's technical solution, an initial pixel-level mask detection model is trained. This initial pixel-level mask detection model includes: a feature extraction module, a plume continuity perception module, an adaptive edge reconstruction strategy module, a spatial mapping calibration mechanism module, and a segmentation head. Through the plume continuity perception module, using selective scanning, on the one hand, it achieves long-distance dependency modeling at the full-image pixel level, effectively resisting background thermal noise interference, and semantically re-associating occluded or broken discrete gas plumes to restore the topological continuity of the gas plume; on the other hand, it significantly reduces the number of model parameters and floating-point computation. Through the adaptive edge reconstruction strategy module... By utilizing deformable convolutional networks, the spatial offset and modulation scalar can be actively adjusted according to the gas diffusion trend. Compared with the fixed sampling of existing technologies, this module significantly improves the ability to capture low-contrast, amorphous, and blurred edges, avoiding the positioning distortion of traditional fixed sampling when processing low-contrast edges, and ensuring that the leak detection contour conforms to the physical reality of gas diffusion. Through the spatial mapping calibration mechanism module, the displacement deviation between global features and local boundary features in spatial mapping is effectively eliminated by combining channel attention weights and residual connections. This achieves deep fusion of global structure and local details, enhances adaptability under different concentrations and shapes of leak clouds, avoids artifact interference caused by complex thermal environments, and improves the stability and robustness of overall segmentation. Therefore, infrared gas leak detection that balances global topological continuity, local boundary accuracy, and computational efficiency is achieved, improving the accuracy and efficiency of leak detection.
[0011] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0012] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A schematic flowchart of an infrared gas leak detection method based on selective scanning and boundary calibration provided by an embodiment of the present invention is shown. Figure 2 This diagram illustrates another infrared gas leak detection method based on selective scanning and boundary calibration provided by an embodiment of the present invention. Figure 3 This diagram illustrates the structure of an infrared gas leak detection device based on selective scanning and boundary calibration, according to an embodiment of the present invention. Figure 4 This diagram illustrates another infrared gas leak detection device based on selective scanning and boundary calibration provided in an embodiment of the present invention. Figure 5 This diagram illustrates the overall architecture of an initial pixel-level mask detection model provided by an embodiment of the present invention. Figure 6 This diagram illustrates a process schematic of an adaptive edge reconstruction strategy module provided in an embodiment of the present invention. Figure 7 A schematic diagram comparing fixed sampling in the prior art with adaptive sampling provided in the embodiments of the present invention is shown; Figure 8 This diagram illustrates the process of selecting a scan in a plume continuity sensing module according to an embodiment of the present invention. Figure 9 This diagram illustrates a process schematic of a plume continuity sensing module provided in an embodiment of the present invention. Figure 10 This diagram illustrates a process schematic of a spatial mapping calibration mechanism module provided in an embodiment of the present invention. Figure 11 A comparison diagram of the pixel-level mask detection model provided in this embodiment of the invention and the detection results of the prior art is shown; Figure 12 The thermal visualization results of the infrared gas leak detection method based on selective scanning and boundary calibration provided in the embodiments of the present invention are shown in complex industrial background (a) and diffusion boundary (b) scenarios. Detailed Implementation
[0013] The present invention will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.
[0014] This embodiment provides an infrared gas leak detection method based on selective scanning and boundary calibration, such as... Figure 1 As shown, the method includes: 101. Obtain the preprocessed infrared gas image sample set, wherein each infrared gas image sample is labeled with the corresponding real pixel-level mask and real boundary.
[0015] In this embodiment, an initial infrared gas image sample set is obtained. Each initial infrared gas image sample in the initial infrared gas image sample set is an infrared thermal image of leakage of volatile organic compounds such as methane in a real industrial scenario. All initial infrared gas image samples in the initial infrared gas image sample set are uniformly scaled to a preset pixel size, such as 256×192 pixels. Then, each scaled initial infrared gas image sample is subjected to data enhancement operations such as random flipping and rotation to obtain a preprocessed infrared gas image sample set. Each infrared gas image sample in the infrared gas image sample set is manually labeled with a corresponding real pixel-level mask and real boundary.
[0016] 102. Train an initial pixel-level mask detection model based on the infrared gas image sample set. Update the parameters of the initial pixel-level mask detection model based on boundary calibration according to the corresponding real pixel-level mask and real boundary until a preset stopping condition is reached to obtain a trained pixel-level mask detection model. The initial pixel-level mask detection model includes: a feature extraction module, a plume continuity perception module, an adaptive edge reconstruction strategy module, a spatial mapping calibration mechanism module, and a segmentation head.
[0017] For this embodiment, as Figure 5 The diagram shown is a schematic of the overall architecture of an initial pixel-level mask detection model.
[0018] 103. Acquire the infrared gas image to be detected, and based on the pixel-level mask detection model, detect the infrared gas image to be detected to obtain the target pixel-level mask, so as to complete the infrared gas leakage detection.
[0019] In this embodiment, after obtaining the trained pixel-level mask detection model, the model is applied by inputting the infrared gas image to be detected into it and outputting a target pixel-level mask on the infrared gas image. The target pixel-level mask is a binary image of the same size as the infrared gas image to be detected, where each pixel is labeled as either gas or not. The area of the gas region in the mask is calculated; if the area is greater than a preset alarm threshold, a gas leak is detected, and an alarm is issued. A closed curve is extracted along the outermost contour of the gas region in the mask, which is the target boundary, used to show the gas diffusion shape and edge position, to quickly locate the leak source and diffusion range. Preferably, the target pixel-level confidence score corresponding to each pixel in the infrared gas image to be detected is also output, representing the probability that the corresponding pixel is predicted to be gas.
[0020] This invention provides an infrared gas leak detection method and apparatus based on selective scanning and boundary calibration. The technical solution of this invention trains an initial pixel-level mask detection model, which includes: a feature extraction module, a plume continuity perception module, an adaptive edge reconstruction strategy module, a spatial mapping calibration mechanism module, and a segmentation head. Through the plume continuity perception module, selective scanning is used to achieve, on the one hand, long-distance dependency modeling at the full-image pixel level, effectively resisting background thermal noise interference, and semantically re-associating occluded or broken discrete gas plumes to restore the topological continuity of the gas plume; on the other hand, it significantly reduces the number of model parameters and floating-point operations. The adaptive edge reconstruction strategy module utilizes variable... This convolutional network actively adjusts the spatial offset and modulation scalar based on the gas diffusion trend. Compared to the fixed sampling of existing technologies, this module significantly improves the ability to capture low-contrast, amorphous, and blurred edges, avoiding the localization distortion that traditional fixed sampling suffers from when processing low-contrast edges, and ensuring that the leak detection contour conforms to the physical reality of gas diffusion. Through a spatial mapping calibration mechanism module, which combines channel attention weights with residual connections, the displacement deviation between global features and local boundary features in spatial mapping is effectively eliminated, achieving deep fusion of global structure and local details. This enhances adaptability to leak clouds of different concentrations and shapes, avoids artifact interference caused by complex thermal environments, and improves the stability and robustness of overall segmentation. Therefore, it achieves infrared gas leak detection that balances global topological continuity, local boundary accuracy, and computational efficiency, improving the accuracy and efficiency of leak detection.
[0021] Furthermore, as a refinement and extension of the specific implementation methods described above, and to fully illustrate the specific implementation process in this embodiment, another infrared gas leak detection method based on selective scanning and boundary calibration is provided, such as... Figure 2 As shown, the method includes: 201. Obtain the preprocessed infrared gas image sample set, wherein each infrared gas image sample is labeled with the corresponding real pixel-level mask and real boundary.
[0022] The specific implementation steps in this embodiment are the same as those in step 101 of the embodiment, and will not be repeated here.
[0023] 202. Input any of the infrared gas image samples into the feature extraction module of the initial pixel-level mask detection model, perform feature extraction to obtain an initial feature map, and perform feature extraction on the initial feature map to obtain a deep feature map.
[0024] In this embodiment, the feature extraction module is used to extract features from the input infrared gas image sample to obtain an initial feature map, such as... Figure 5 As shown, the initial features Figure 1 One branch is input into the feature extraction module for feature extraction to obtain a deep feature map, and the other branch is input into the adaptive edge reconstruction strategy module.
[0025] 203. Input the initial feature map into the adaptive edge reconstruction strategy module of the initial pixel-level mask detection model to obtain a first local boundary feature map. Then, concatenate the deep feature map with the first local boundary feature map to obtain a first concatenated feature map. Finally, input the first concatenated feature map into the adaptive edge reconstruction strategy module to obtain a second local boundary feature map.
[0026] In this embodiment, the step of inputting the initial feature map into the adaptive edge reconstruction strategy module of the initial pixel-level mask detection model to obtain the first local boundary feature map includes: obtaining a preset number of branches; for each branch, extracting texture detail features of the initial feature map in parallel; simultaneously, for each sampling point corresponding to a pixel on the initial feature map, predicting the spatial offset and modulation scalar corresponding to the sampling point through a deformable convolutional network; adjusting the convolution sampling position according to the spatial offset and modulation scalar; calculating the geometric features corresponding to the sampling point through weighted convolution operation of deformable convolution; adding all the texture detail features and the geometric features element-wise to obtain the first fused feature; and sequentially inputting the first fused feature into a batch normalization layer, a second activation function layer, and an upsampling layer to obtain the first local boundary feature map.
[0027] like Figure 6 As shown, the preset number of branches are two branches, which are different and named the first branch and the second branch. (1) The first branch extracts the texture detail features of the initial feature map. (2) The second branch extracts the texture detail features of the initial feature map. (3) For each pixel corresponding to the sampling point on the initial feature map, the spatial offset and modulation scalar corresponding to the sampling point are predicted by the deformable convolutional network. The convolution sampling position is adjusted according to the spatial offset and modulation scalar. The geometric features corresponding to the sampling point are calculated by the weighted convolution operation of the deformable convolution. The three are parallel. The first branch extracts the texture detail features of the initial feature map using 1×1 Conv, and the second branch extracts the texture detail features of the initial feature map using 3×3 Conv. There is no limitation here.
[0028] Specifically, the spatial offset and modulation scalar corresponding to the sampling points are predicted by a deformable convolutional network, and non-rigid sampling is performed to make the receptive field adaptively fit the gas diffusion contour, so as to dynamically fit the diffusion contour of the non-rigid gas. The process of inputting the first stitched feature map into the adaptive edge reconstruction strategy module to obtain the second local boundary feature map is the same as the process of inputting the initial feature map into the adaptive edge reconstruction strategy module of the initial pixel-level mask detection model to obtain the first local boundary feature map, and will not be described again here.
[0029] like Figure 7 The embodiment shown uses adaptive sampling, and the resulting spatial offset is also called learnable bias. For each sampling point corresponding to a pixel on the initial feature map, a deformable convolutional network predicts the spatial offset and modulation scalar of the sampling point. The convolutional sampling position is adjusted according to the spatial offset and modulation scalar, and the geometric features corresponding to the sampling point are calculated through the weighted convolution operation of deformable convolution. Specifically:
[0030] in, Each sampling point uniquely corresponds to a pixel, representing the location of that pixel (which is a feature in the feature map). For regular sampling grid, In the regular sampling grid, excluding sampling points The fixed offset of the kth other sampling point relative to this sampling point. The convolution weights are the convolution weights corresponding to the kth other sampling point. This represents the spatial offset corresponding to the kth other sampling point. This represents the final sampling position corresponding to the kth other sampling point. For the modulation scalar corresponding to the kth other sampling point, It is a value-finding function. This refers to the feature value at the final sampling position corresponding to the kth other sampling point on the initial feature map. Sampling points The corresponding geometric features.
[0031] This leads to the geometric features corresponding to each sampling point. The texture detail features are then added element-wise to the geometric features to obtain the first fused feature. Specifically, the texture detail features obtained from the first branch are named the first texture detail feature, and the texture detail features obtained from the second branch are named the second texture detail feature. The first texture detail feature, the second texture detail feature, and the geometric features corresponding to the same sampling point are then added element-wise to obtain the first fused feature corresponding to that sampling point. This process is repeated to obtain the first fused feature corresponding to each sampling point.
[0032] 204. Input the deep feature map into the plume continuity sensing module of the initial pixel-level mask detection model to obtain the first global feature map, and input the first global feature map into the plume continuity sensing module to obtain the second global feature map.
[0033] In this embodiment, the step of inputting the deep feature map into the feather continuity perception module of the initial pixel-level mask detection model to obtain the first global feature map includes: based on selective scanning, unfolding the deep feature map into multiple one-dimensional sequences; performing parallel state updates for each one-dimensional sequence to obtain a corresponding one-dimensional output sequence; mapping each one-dimensional output sequence back to two-dimensional space to obtain a corresponding sub-feature map; aggregating all the sub-feature maps to obtain an aggregated feature map; inputting the aggregated feature map into multiple depthwise separable convolutions to output enhanced feature maps; adding all the enhanced feature maps element-wise to obtain a fused feature map; inputting the fused feature map into a second activation function layer to output a probability map; and multiplying the probability map element-wise with the aggregated feature map to obtain the first global feature map.
[0034] Specifically, the selection scan is a two-dimensional selection scan mechanism. This mechanism can involve cross-scanning in four directions, with each cross-scan corresponding to unfolding the depth feature map into a one-dimensional sequence, such as... Figure 8 The diagram illustrates the scanning process within the plume continuity sensing module. The depth feature map is numbered 1-9, and the cross-scanning in four directions unfolds the depth feature map into a one-dimensional sequence: Positions 1, 2, 3, 4, 5, 6, 7, 8, 9; Positions 1, 4, 7, 2, 5, 8, 3, 6, 9; Positions 9, 8, 7, 6, 5, 4, 3, 2, 1; Positions 9, 6, 3, 8, 5, 2, 7, 4, 1. Figure 9 As shown, for simplicity, the cross-scanning in two directions is displayed in one figure (this does not mean that the cross-scanning in two directions is used simultaneously in the depth feature map), and the cross-scanning in the other two directions is displayed in another figure (this does not mean that the cross-scanning in the other two directions is used simultaneously in the depth feature map). Instead, in the depth feature map, cross-scanning in four directions is used respectively, and the cross-scanning in each direction corresponds to unfolding the depth feature map into a one-dimensional sequence.
[0035] For each one-dimensional sequence, state updates are performed in parallel to obtain the corresponding one-dimensional output sequence. Specifically, for each one-dimensional sequence, the input-driven state-space evolution process is performed in parallel, and the state update equation is:
[0036]
[0037] in, Given a one-dimensional sequence, the input features at the current time t. This is the hidden state at the previous time step t-1. This represents the hidden state at time t, used for transmitting gas topology information across regions. , , These are the first coefficient, the second coefficient, and the third coefficient, all of which are derived from... Dynamically generated This determines how the memory is updated, allowing the network to actively reinforce the gas signal and suppress background interference, thereby achieving memory reinforcement of high-contrast gas regions and suppression of background clutter. Given the output features at the current time t, a one-dimensional output sequence is obtained from the output features at all times according to the time sequence, in order to capture long-distance dependencies and reconstruct the global topology of the plume.
[0038] For each one-dimensional output sequence, it is mapped back to two-dimensional space to obtain a corresponding sub-feature map. All the sub-feature maps are then aggregated to obtain an aggregated feature map. Specifically, according to the one-dimensional sequence corresponding to the one-dimensional output sequence, in the reverse order of the cross-scanning path, each feature vector in the one-dimensional output sequence is mapped back to the corresponding spatial position on the two-dimensional feature map, thereby obtaining a corresponding sub-feature map. Then, all the sub-feature maps are obtained. The features on all the sub-feature maps at the same spatial position are added together to obtain the second fused feature corresponding to that spatial position. Then, the second fused feature corresponding to each spatial position is obtained. The second fused features corresponding to all spatial positions are the aggregated feature map.
[0039] like Figure 9 As shown, the aggregated feature map is input into four different depthwise separable convolutions, and the corresponding outputs are enhanced feature maps. All the enhanced feature maps are added element-wise to obtain a fused feature map. The fused feature map is input into a second activation function layer, such as the Sigmoid function, and the output is a probability map. The probability map is multiplied element-wise with the aggregated feature map to obtain a first global feature map.
[0040] The process of inputting the first global feature map into the plume continuity sensing module to obtain the second global feature map is the same as the process of inputting the deep feature map into the plume continuity sensing module of the initial pixel-level mask detection model to obtain the first global feature map, and will not be described again here.
[0041] 205. The second local boundary feature map is concatenated with the first global feature map to obtain a second concatenated feature map. The second concatenated feature map is then input into the feature extraction module of the initial pixel-level mask detection model to extract features from the second concatenated feature map to obtain a third local boundary feature map.
[0042] In this embodiment, a feature extraction module is used to extract features from the second stitched feature map to obtain a third local boundary feature map.
[0043] 206. Input the second global feature map and the third local boundary feature map into the spatial mapping calibration mechanism module of the initial pixel-level mask detection model, output the first gas segmentation result, input the first gas segmentation result into the segmentation head of the initial pixel-level mask detection model, output the predicted pixel-level mask and predicted pixel-level confidence corresponding to the infrared gas image sample, based on boundary calibration, calculate the joint loss function value according to the predicted pixel-level mask, predicted pixel-level confidence, the real pixel-level mask corresponding to the infrared gas image sample and the real boundary corresponding to the infrared gas image sample, determine whether the joint loss function value is less than a preset threshold, if not, update the parameters of the initial pixel-level mask detection model until the joint loss function value is less than the preset threshold, and obtain the trained pixel-level mask detection model.
[0044] The initial pixel-level mask detection model includes: a feature extraction module, a feather continuity perception module, an adaptive edge reconstruction strategy module, a spatial mapping calibration mechanism module, and a segmentation head.
[0045] For this embodiment, as Figure 10 As shown, the step of inputting the second global feature map and the third local boundary feature map into the spatial mapping calibration mechanism module of the initial pixel-level mask detection model and outputting the first gas segmentation result includes: channel concatenating the second global feature map and the third local boundary feature map, and compressing and fusing them through a convolutional layer to obtain a first mixed feature map; performing feature recalibration on the first mixed feature map to obtain channel attention weights; multiplying the first mixed feature map and the channel attention weights element-wise to obtain a second mixed feature map; and adding the first mixed feature map and the second mixed feature map element-wise to obtain the first gas segmentation result.
[0046] To perform feature recalibration on the first hybrid feature map to obtain channel attention weights, specifically: the first hybrid feature map is sequentially input into a global average pooling layer, a first fully connected layer, a first activation function layer, a second fully connected layer, and a second activation function layer, and the channel attention weights are output.
[0047] The first mixed feature map is input into a global average pooling layer. Global average pooling compresses the spatial context of the first mixed feature map into a descriptor z. The descriptor z is then input into a first fully connected layer, which generates a dimensionality-reduced weight matrix. , with z Multiplying the first vector by the first fully connected layer yields the first vector output from the first fully connected layer. This first vector is then input into the first activation function layer, for example, the ReLU activation function, to obtain the second vector. This second vector is then input into the second fully connected layer, which generates the extended-dimensional weight matrix. , and the second vector Multiplying these results in a third vector output from the second fully connected layer. This third vector is then input into the second activation function layer, such as the sigmoid function, to obtain the channel attention weights. .
[0048] Feature calibration is achieved by eliminating spatial displacement bias between multi-scale features through channel attention weight calibration and residual mapping.
[0049] The first mixed feature map is multiplied element-wise with the channel attention weights to obtain the second mixed feature map; the first mixed feature map and the second mixed feature map are then added element-wise to obtain the first gas segmentation result. Specifically:
[0050] in, This is the first mixed feature map. For channel attention weights, This is the second mixed feature map. This is the result of the first gas segmentation.
[0051] The boundary-based calibration method, which calculates a joint loss function value based on the predicted pixel-level mask, the predicted pixel-level confidence score, the real pixel-level mask corresponding to the infrared gas image sample, and the real boundary corresponding to the infrared gas image sample, includes: calculating the predicted area of the predicted gas region based on the predicted pixel-level mask; calculating the real area of the real gas region based on the real pixel-level mask corresponding to the infrared gas image sample; calculating the overlap area between the predicted gas region and the real gas region; calculating a first loss function value based on the predicted area, the real area, and the overlap area; inputting the second global feature map into the auxiliary segmentation head and outputting an auxiliary predicted pixel-level mask; calculating a second loss function value based on the auxiliary predicted pixel-level mask and the real pixel-level mask corresponding to the infrared gas image sample; calculating a third loss function value based on the predicted pixel-level confidence score and the real boundary corresponding to the infrared gas image sample; and calculating a joint loss function value based on the first loss function value, the second loss function value, and the third loss function value.
[0052] Specifically, the predicted area of the predicted gas region is calculated based on the predicted pixel-level mask, the actual area of the actual gas region is calculated based on the actual pixel-level mask corresponding to the infrared gas image sample, the overlap area between the predicted gas region and the actual gas region is calculated, and a first loss function value is calculated based on the predicted area, the actual area, and the overlap area. The predicted pixel-level mask is a binary image of the same size as the infrared gas image sample, where each pixel is predicted as either a gas or not a gas. Thus, the predicted gas region on the infrared gas image sample can be determined by the predicted pixel-level mask. Similarly, the actual gas region on the infrared gas image sample can be determined based on the actual pixel-level mask corresponding to the infrared gas image sample, and thus the overlap area between the predicted gas region and the actual gas region can be determined. The predicted gas region corresponds to the predicted area, the actual gas region corresponds to the actual area, and the overlap area corresponds to the overlap area.
[0053] First loss function value =1-
[0054] The second global feature map is input into the auxiliary segmentation head, which outputs an auxiliary prediction pixel-level mask. Based on the auxiliary prediction pixel-level mask and the real pixel-level mask corresponding to the infrared gas image sample, the second loss function value is calculated. Specifically, the second global feature map is used as an intermediate layer feature and input into the auxiliary segmentation head, which outputs an auxiliary prediction pixel-level mask. Thus, the auxiliary prediction gas region on the infrared gas image sample can be determined by the auxiliary prediction pixel-level mask. Similarly, based on the real pixel-level mask corresponding to the infrared gas image sample, the real gas region on the infrared gas image sample can be determined. Furthermore, the auxiliary overlap region between the auxiliary prediction gas region and the real gas region can be determined. The auxiliary prediction gas region corresponds to the auxiliary prediction area, the real gas region corresponds to the real area, and the auxiliary overlap region corresponds to the auxiliary overlap area.
[0055] Second loss function value =1-
[0056] For boundary-based calibration, the third loss function value is calculated based on the predicted pixel-level confidence and the true boundary corresponding to the infrared gas image sample. Specifically, a closed curve is extracted along the outermost contour of the gas region in the predicted pixel-level mask, which is the predicted boundary, and the target pixels covered on the predicted boundary are obtained.
[0057]
[0058] in, The value of the third loss function. This represents the number of all target pixels in the infrared gas image sample. For target pixels Euclidean distance to the nearest true boundary For target pixels The corresponding prediction pixel-level confidence level refers to the target pixel. Let be the probability of a gas.
[0059] The joint loss function is defined as:
[0060] in, For the joint loss function value, The first loss function value, This is the value of the second loss function. The value of the third loss function. The first preset coefficient is, for example, 0.6. The second preset coefficient is 3. The first loss function value is used to maximize the overlap between the predicted pixel-level mask and the real pixel-level mask to alleviate the class imbalance problem. The second loss function value is used to enhance the learning of intermediate layer features and accelerate convergence. The third loss function value is used to apply a distance metric penalty between the predicted boundary and the real boundary to constrain the geometric accuracy of the gas contour to achieve boundary calibration.
[0061] 207. Acquire the infrared gas image to be detected, and based on the pixel-level mask detection model, detect the infrared gas image to be detected to obtain the target pixel-level mask, so as to complete the infrared gas leakage detection.
[0062] It should be noted that the overall architecture of the pixel-level mask detection model is the same as that of the initial pixel-level mask detection model, which also includes: a feature extraction module, a feather continuity perception module, an adaptive edge reconstruction strategy module, a spatial mapping calibration mechanism module, and a segmentation head.
[0063] In this embodiment, the step of detecting the infrared gas image to be detected based on the pixel-level mask detection model to obtain a target pixel-level mask includes: inputting the infrared gas image to be detected into the feature extraction module of the pixel-level mask detection model for feature extraction to obtain an initial target feature map; extracting features from the initial target feature map to obtain a deep target feature map; inputting the initial target feature map into the adaptive edge reconstruction strategy module of the pixel-level mask detection model to obtain a first local boundary feature map of the target; concatenating the deep target feature map with the first local boundary feature map of the target to obtain a first concatenated target feature map; inputting the first concatenated target feature map into the adaptive edge reconstruction strategy module to obtain a second local boundary feature map of the target; and then concatenating the deep target feature map with the first local boundary feature map of the target to obtain a second local boundary feature map of the target. The feature map is input into the plume continuity sensing module of the pixel-level mask detection model to obtain the first global feature map of the target. The first global feature map of the target is then input into the plume continuity sensing module to obtain the second global feature map of the target. The second local boundary feature map of the target is then concatenated with the first global feature map of the target to obtain the second concatenated feature map of the target. Feature extraction is performed on the second concatenated feature map of the target to obtain the third local boundary feature map of the target. The second global feature map of the target and the third local boundary feature map of the target are then input into the spatial mapping calibration mechanism module of the pixel-level mask detection model to output the second gas segmentation result. The second gas segmentation result is then input into the segmentation head of the pixel-level mask detection model to output the target pixel-level mask corresponding to the infrared gas image sample to be tested.
[0064] The specific process of detecting the infrared gas image to be detected based on the pixel-level mask detection model and obtaining the target pixel-level mask is the same as the specific process of inputting the infrared gas image sample into the initial pixel-level mask detection model and outputting the predicted pixel-level mask corresponding to the infrared gas image sample in steps 202-206 of the embodiment, and will not be repeated here.
[0065] The effectiveness of the method of the present invention was verified. Table 1 shows a comparison of the detection effects of the present invention and the prior art: Table 1:
[0066] Experimental results show that the pixel-level mask detection model of this invention outperforms all existing technologies in all three metrics. Based on the pixel-level mask detection model of this invention, a lightweight pixel-level mask detection model is obtained by reducing the number of parameters, achieving 90.87% mIoU with only 6.05M parameters and 0.94G FLOPs of computation, demonstrating the superior balance between accuracy and computational efficiency achieved by the pixel-level mask detection model of this invention. Figure 11 The diagram shows a comparison of the detection results of the pixel-level mask detection model provided in this embodiment of the invention with those of existing technologies. The pixel-level mask detection model provided in this embodiment of the invention... Figure 11 The corresponding network is CPP-Net. U-Net and DeepLabv3 are prone to fragmented predictions when processing diffuse gas plumes, and SegFormer still suffers from serious missed detections or blurred boundaries in low-contrast regions. In contrast, the CPP-Net of this invention exhibits stronger robustness under various extreme challenges, not only accurately locating tiny leak sources but also generating more complete and continuous detection areas.
[0067] The ablation experiments conducted using the method of this invention are shown in Table 2: Table 2:
[0068] Figure 12 The illustration shows the thermal visualization results of the infrared gas leak detection method based on selective scanning and boundary calibration provided by the embodiments of the present invention in complex industrial background (a) and diffusion boundary (b) scenarios. In the complex industrial background, the method of the present invention can accurately focus on the gas region, effectively suppress background noise, and reconstruct a complete and continuous gas structure. In the diffusion boundary scenario, the method of the present invention significantly enhances the feature extraction capability of blurred targets and minimizes the risk of missed detection.
[0069] In summary, the beneficial effects of this invention are as follows: 1. Suppressing Background Interference and Restoring Topological Continuity: By introducing a plume continuity sensing module, a two-dimensional selective scanning mechanism is used to achieve full-image pixel-level long-distance dependency modeling with linear computational complexity. This module can effectively resist the interference of background thermal noise, semantically re-associate occluded or broken discrete plumes, solve the problem of fragmented leak detection results caused by the limited receptive field in traditional CNNs, and restore the topological continuity of gas plumes.
[0070] 2. High-precision fitting of non-rigid fuzzy boundaries: Utilizing an adaptive edge reconstruction strategy module, a deformable convolutional mesh is used to actively adjust the spatial offset and modulation scalar based on the gas diffusion trend. Compared to the fixed sampling of existing technologies, this module significantly improves the ability to capture low-contrast, amorphous fuzzy edges, avoiding the positioning distortion that traditional fixed sampling suffers from when processing low-contrast edges, and ensuring that the leak detection contour conforms to the physical reality of gas diffusion.
[0071] 3. Lightweight architecture and efficient real-time early warning: The two-dimensional selective scanning mechanism with linear computational complexity is used to replace the quadratic complexity self-attention mechanism of Transformer, which greatly reduces the number of model parameters and floating-point operations, effectively balances model performance and computational overhead, and is easy to deploy in industrial edge monitoring equipment to meet the needs of large-scale real-time early warning.
[0072] 4. Eliminating Feature Bias to Enhance System Robustness: Through the spatial mapping calibration mechanism module, which combines channel attention weights with residual connections, the displacement deviation between global features and local boundary features in spatial mapping is effectively eliminated, achieving deep fusion of global structure and local details. This module enhances the adaptability of the pixel-level mask detection model under leakage clouds of different concentrations and shapes, avoids artifact interference caused by complex thermal environments, and improves the stability and robustness of overall segmentation.
[0073] This invention provides an infrared gas leak detection method and apparatus based on selective scanning and boundary calibration. The technical solution of this invention trains an initial pixel-level mask detection model, which includes: a feature extraction module, a plume continuity perception module, an adaptive edge reconstruction strategy module, a spatial mapping calibration mechanism module, and a segmentation head. Through the plume continuity perception module, selective scanning is used to achieve, on the one hand, long-distance dependency modeling at the full-image pixel level, effectively resisting background thermal noise interference, and semantically re-associating occluded or broken discrete gas plumes to restore the topological continuity of the gas plume; on the other hand, it significantly reduces the number of model parameters and floating-point operations. The adaptive edge reconstruction strategy module utilizes variable... This convolutional network actively adjusts the spatial offset and modulation scalar based on the gas diffusion trend. Compared to the fixed sampling of existing technologies, this module significantly improves the ability to capture low-contrast, amorphous, and blurred edges, avoiding the localization distortion that traditional fixed sampling suffers from when processing low-contrast edges, and ensuring that the leak detection contour conforms to the physical reality of gas diffusion. Through a spatial mapping calibration mechanism module, which combines channel attention weights with residual connections, the displacement deviation between global features and local boundary features in spatial mapping is effectively eliminated, achieving deep fusion of global structure and local details. This enhances adaptability to leak clouds of different concentrations and shapes, avoids artifact interference caused by complex thermal environments, and improves the stability and robustness of overall segmentation. Therefore, it achieves infrared gas leak detection that balances global topological continuity, local boundary accuracy, and computational efficiency, improving the accuracy and efficiency of leak detection.
[0074] Furthermore, as Figure 1 and Figure 2 The specific implementation of the method shown in this invention provides an infrared gas leak detection device based on selective scanning and boundary calibration, such as... Figure 3 As shown, the device includes: an acquisition module 31, a training module 32, and a detection module 33; The acquisition module 31 is used to acquire a preprocessed infrared gas image sample set, wherein each infrared gas image sample is labeled with the corresponding real pixel-level mask and real boundary. Training module 32 is used to train an initial pixel-level mask detection model based on the infrared gas image sample set, and update the parameters of the initial pixel-level mask detection model based on boundary calibration according to the corresponding real pixel-level mask and real boundary until a preset stopping condition is reached to obtain a trained pixel-level mask detection model. The initial pixel-level mask detection model includes: a feature extraction module, a plume continuity perception module, an adaptive edge reconstruction strategy module, a spatial mapping calibration mechanism module, and a segmentation head. The detection module 33 is used to acquire an infrared gas image to be detected, and based on the pixel-level mask detection model, detect the infrared gas image to be detected to obtain a target pixel-level mask in order to complete the infrared gas leakage detection.
[0075] Accordingly, in order to train an initial pixel-level mask detection model based on the infrared gas image sample set, the parameters of the initial pixel-level mask detection model are updated based on boundary calibration according to the corresponding real pixel-level mask and the real boundary, until a preset stopping condition is reached, thus obtaining a trained pixel-level mask detection model, as follows. Figure 4 As shown, the training module 32 includes: a feature extraction unit 321, an adaptive edge reconstruction strategy unit 322, a plume continuity perception unit 323, a stitching unit 324, and a spatial mapping calibration mechanism unit 325. The feature extraction unit 321 is used to input any of the infrared gas image samples into the feature extraction module of the initial pixel-level mask detection model, perform feature extraction to obtain an initial feature map, and perform feature extraction on the initial feature map to obtain a deep feature map; The adaptive edge reconstruction strategy unit 322 is used to input the initial feature map into the adaptive edge reconstruction strategy module of the initial pixel-level mask detection model to obtain a first local boundary feature map, to concatenate the deep feature map with the first local boundary feature map to obtain a first concatenated feature map, and to input the first concatenated feature map into the adaptive edge reconstruction strategy module to obtain a second local boundary feature map. The plume continuity sensing unit 323 is used to input the deep feature map into the plume continuity sensing module of the initial pixel-level mask detection model to obtain a first global feature map, and input the first global feature map into the plume continuity sensing module to obtain a second global feature map; The stitching unit 324 is used to stitch the second local boundary feature map with the first global feature map to obtain a second stitched feature map, input the second stitched feature map into the feature extraction module of the initial pixel-level mask detection model, and perform feature extraction on the second stitched feature map to obtain a third local boundary feature map; The spatial mapping calibration mechanism unit 325 is used to input the second global feature map and the third local boundary feature map into the spatial mapping calibration mechanism module of the initial pixel-level mask detection model, output the first gas segmentation result, input the first gas segmentation result into the segmentation head of the initial pixel-level mask detection model, output the predicted pixel-level mask and predicted pixel-level confidence corresponding to the infrared gas image sample, and calculate the joint loss function value based on the boundary calibration, according to the predicted pixel-level mask, the predicted pixel-level confidence, the real pixel-level mask corresponding to the infrared gas image sample and the real boundary corresponding to the infrared gas image sample, and determine whether the joint loss function value is less than a preset threshold. If not, the parameters of the initial pixel-level mask detection model are updated until the joint loss function value is less than the preset threshold, and the trained pixel-level mask detection model is obtained.
[0076] Accordingly, in order to input the initial feature map into the adaptive edge reconstruction strategy module of the initial pixel-level mask detection model to obtain the first local boundary feature map, the adaptive edge reconstruction strategy unit 322 is used to obtain a preset number of branches. For each branch, the texture detail features of the initial feature map are extracted in parallel. At the same time, for each sampling point corresponding to a pixel on the initial feature map, the spatial offset and modulation scalar corresponding to the sampling point are predicted by a deformable convolutional network. The convolution sampling position is adjusted according to the spatial offset and modulation scalar. The geometric features corresponding to the sampling point are calculated by weighted convolution operation of deformable convolution. All the texture detail features and the geometric features are added element-wise to obtain the first fused feature. The first fused feature is sequentially input into the batch normalization layer, the second activation function layer and the upsampling layer to obtain the first local boundary feature map.
[0077] Accordingly, in order to input the deep feature map into the plume continuity perception module of the initial pixel-level mask detection model to obtain the first global feature map, the plume continuity perception unit 323 is used to expand the deep feature map into multiple one-dimensional sequences based on selective scanning, perform state updates in parallel for each one-dimensional sequence to obtain the corresponding one-dimensional output sequence; map each one-dimensional output sequence back to two-dimensional space to obtain the corresponding sub-feature map, aggregate all the sub-feature maps to obtain an aggregated feature map; input the aggregated feature map into multiple depthwise separable convolutions to output enhanced feature maps, add all the enhanced feature maps element-wise to obtain a fused feature map, input the fused feature map into the second activation function layer to output a probability map, and multiply the probability map and the aggregated feature map element-wise to obtain the first global feature map.
[0078] Accordingly, in order to input the second global feature map and the third local boundary feature map into the spatial mapping calibration mechanism module of the initial pixel-level mask detection model and output the first gas segmentation result, the spatial mapping calibration mechanism unit 325 is used to concatenate the second global feature map and the third local boundary feature map through channels and compress and fuse them through a convolutional layer to obtain a first mixed feature map; perform feature recalibration on the first mixed feature map to obtain channel attention weights; multiply the first mixed feature map and the channel attention weights element-wise to obtain a second mixed feature map; and add the first mixed feature map and the second mixed feature map element-wise to obtain the first gas segmentation result.
[0079] Accordingly, for boundary-based calibration, a joint loss function value is calculated based on the predicted pixel-level mask, the predicted pixel-level confidence, the real pixel-level mask corresponding to the infrared gas image sample, and the real boundary corresponding to the infrared gas image sample. The spatial mapping calibration mechanism unit 325 is used to calculate the predicted area of the predicted gas region based on the predicted pixel-level mask, calculate the real area of the real gas region based on the real pixel-level mask corresponding to the infrared gas image sample, calculate the overlap area between the predicted gas region and the real gas region, and calculate a first loss function value based on the predicted area, the real area, and the overlap area; input the second global feature map into the auxiliary segmentation head, output an auxiliary predicted pixel-level mask, and calculate a second loss function value based on the auxiliary predicted pixel-level mask and the real pixel-level mask corresponding to the infrared gas image sample; based on boundary calibration, a third loss function value is calculated based on the predicted pixel-level confidence and the real boundary corresponding to the infrared gas image sample; and a joint loss function value is calculated based on the first loss function value, the second loss function value, and the third loss function value.
[0080] Accordingly, in order to detect the infrared gas image to be detected based on the pixel-level mask detection model and obtain the target pixel-level mask, the detection module 33 is used to input the infrared gas image to be detected into the feature extraction module of the pixel-level mask detection model for feature extraction to obtain an initial target feature map; to extract features from the initial target feature map to obtain a deep target feature map; to input the initial target feature map into the adaptive edge reconstruction strategy module of the pixel-level mask detection model to obtain a first local boundary feature map of the target; to concatenate the deep target feature map with the first local boundary feature map of the target to obtain a first concatenated target feature map; to input the first concatenated target feature map into the adaptive edge reconstruction strategy module to obtain a second local boundary feature map of the target; and to input the target... The deep feature map is input into the plume continuity sensing module of the pixel-level mask detection model to obtain the first global feature map of the target. The first global feature map of the target is then input into the plume continuity sensing module to obtain the second global feature map of the target. The second local boundary feature map of the target is then concatenated with the first global feature map of the target to obtain the second concatenated feature map of the target. Feature extraction is performed on the second concatenated feature map of the target to obtain the third local boundary feature map of the target. The second global feature map of the target and the third local boundary feature map of the target are then input into the spatial mapping calibration mechanism module of the pixel-level mask detection model to output the second gas segmentation result. The second gas segmentation result is then input into the segmentation head of the pixel-level mask detection model to output the target pixel-level mask corresponding to the infrared gas image sample to be tested.
[0081] It should be noted that other corresponding descriptions of the functional units involved in the infrared gas leak detection device based on selective scanning and boundary calibration provided in this embodiment can be found in [reference needed]. Figures 1 to 2 The corresponding description will not be repeated here.
[0082] Based on the above, Figures 1 to 2 Accordingly, this embodiment also provides a storage medium, which may be volatile or non-volatile, storing a computer program that, when executed by a processor, implements the above-described method. Figures 1 to 2 The infrared gas leak detection method based on selective scanning and boundary calibration is shown.
[0083] Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, portable hard drive, etc.) and includes several instructions to cause a computer device (such as a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present invention.
[0084] Based on the above, Figures 1 to 2 The method shown and Figure 3 , Figure 4 To achieve the above objectives, the present application also provides a computer device, specifically a personal computer, server, network device, etc., as shown in the illustrated embodiment. This computer device includes a storage medium and a processor; the storage medium stores a computer program; the processor executes the computer program to achieve the above-described objectives. Figure 1 and Figure 2 The infrared gas leak detection method based on selective scanning and boundary calibration is shown.
[0085] Optionally, the computer device may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB interfaces, card reader interfaces, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Wi-Fi interfaces), etc.
[0086] Those skilled in the art will understand that the computer device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or combine certain components, or have different component arrangements.
[0087] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the aforementioned computer device, supporting the operation of information processing programs and other software and / or programs. The network communication module is used to enable communication between the various components within the non-volatile storage medium, as well as communication with other hardware and software in the information processing entity device.
[0088] Through the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus necessary general-purpose hardware platform, or it can be implemented by hardware.
[0089] This invention provides an infrared gas leak detection method and apparatus based on selective scanning and boundary calibration. The technical solution of this invention trains an initial pixel-level mask detection model, which includes: a feature extraction module, a plume continuity perception module, an adaptive edge reconstruction strategy module, a spatial mapping calibration mechanism module, and a segmentation head. Through the plume continuity perception module, selective scanning is used to achieve, on the one hand, long-distance dependency modeling at the full-image pixel level, effectively resisting background thermal noise interference, and semantically re-associating occluded or broken discrete gas plumes to restore the topological continuity of the gas plume; on the other hand, it significantly reduces the number of model parameters and floating-point operations. The adaptive edge reconstruction strategy module utilizes variable... This convolutional network actively adjusts the spatial offset and modulation scalar based on the gas diffusion trend. Compared to the fixed sampling of existing technologies, this module significantly improves the ability to capture low-contrast, amorphous, and blurred edges, avoiding the localization distortion that traditional fixed sampling suffers from when processing low-contrast edges, and ensuring that the leak detection contour conforms to the physical reality of gas diffusion. Through a spatial mapping calibration mechanism module, which combines channel attention weights with residual connections, the displacement deviation between global features and local boundary features in spatial mapping is effectively eliminated, achieving deep fusion of global structure and local details. This enhances adaptability to leak clouds of different concentrations and shapes, avoids artifact interference caused by complex thermal environments, and improves the stability and robustness of overall segmentation. Therefore, it achieves infrared gas leak detection that balances global topological continuity, local boundary accuracy, and computational efficiency, improving the accuracy and efficiency of leak detection.
[0090] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing the present invention. Those skilled in the art will understand that the modules in the apparatus of the embodiment can be distributed within the apparatus of the embodiment as described, or they can be located in one or more apparatuses different from this embodiment, with corresponding changes. The modules of the above-described embodiment can be combined into one module, or further divided into multiple sub-modules.
[0091] The serial numbers used above are for descriptive purposes only and do not represent the superiority or inferiority of the implementation scenarios. The above disclosures are merely a few specific implementation scenarios of the present invention; however, the present invention is not limited thereto, and any variations conceived by those skilled in the art should fall within the protection scope of the present invention.
Claims
1. An infrared gas leak detection method based on selective scanning and boundary calibration, characterized in that, The method includes: Obtain a preprocessed set of infrared gas image samples, in which each infrared gas image sample is labeled with the corresponding real pixel-level mask and real boundary; An initial pixel-level mask detection model is trained based on the infrared gas image sample set. The parameters of the initial pixel-level mask detection model are updated based on boundary calibration according to the corresponding real pixel-level mask and real boundary until a preset stopping condition is reached, thus obtaining a trained pixel-level mask detection model. The initial pixel-level mask detection model includes: a feature extraction module, a plume continuity perception module, an adaptive edge reconstruction strategy module, a spatial mapping calibration mechanism module, and a segmentation head. An infrared gas image to be detected is acquired, and the infrared gas image to be detected is detected based on the pixel-level mask detection model to obtain a target pixel-level mask, thereby completing the infrared gas leakage detection.
2. The method according to claim 1, characterized in that... , The process of training an initial pixel-level mask detection model based on the infrared gas image sample set, updating the parameters of the initial pixel-level mask detection model based on boundary calibration according to the corresponding real pixel-level mask and real boundary, until a preset stopping condition is met, to obtain a trained pixel-level mask detection model, includes: Input any of the infrared gas image samples into the feature extraction module of the initial pixel-level mask detection model to perform feature extraction and obtain an initial feature map. Then, perform feature extraction on the initial feature map to obtain a deep feature map. The initial feature map is input into the adaptive edge reconstruction strategy module of the initial pixel-level mask detection model to obtain a first local boundary feature map. The deep feature map is then concatenated with the first local boundary feature map to obtain a first concatenated feature map. The first concatenated feature map is then input into the adaptive edge reconstruction strategy module to obtain a second local boundary feature map. The deep feature map is input into the plume continuity sensing module of the initial pixel-level mask detection model to obtain the first global feature map. The first global feature map is then input into the plume continuity sensing module to obtain the second global feature map. The second local boundary feature map is concatenated with the first global feature map to obtain a second concatenated feature map. The second concatenated feature map is then input into the feature extraction module of the initial pixel-level mask detection model to extract features from the second concatenated feature map, thereby obtaining a third local boundary feature map. The second global feature map and the third local boundary feature map are input into the spatial mapping calibration mechanism module of the initial pixel-level mask detection model, and the first gas segmentation result is output. The first gas segmentation result is input into the segmentation head of the initial pixel-level mask detection model, and the predicted pixel-level mask and predicted pixel-level confidence corresponding to the infrared gas image sample are output. Based on boundary calibration, the joint loss function value is calculated according to the predicted pixel-level mask, the predicted pixel-level confidence, the real pixel-level mask corresponding to the infrared gas image sample, and the real boundary corresponding to the infrared gas image sample. It is determined whether the joint loss function value is less than a preset threshold. If not, the parameters of the initial pixel-level mask detection model are updated until the joint loss function value is less than the preset threshold, and the trained pixel-level mask detection model is obtained.
3. The method according to claim 2, characterized in that, The step of inputting the initial feature map into the adaptive edge reconstruction strategy module of the initial pixel-level mask detection model to obtain the first local boundary feature map includes: A preset number of branches are obtained. For each branch, the texture detail features of the initial feature map are extracted in parallel. At the same time, for each sampling point corresponding to a pixel on the initial feature map, the spatial offset and modulation scalar corresponding to the sampling point are predicted by a deformable convolutional network. The convolution sampling position is adjusted according to the spatial offset and modulation scalar, and the geometric features corresponding to the sampling points are calculated through weighted convolution operation of deformable convolution. All the texture detail features and the geometric features are added element-wise to obtain the first fused feature. The first fused feature is then sequentially input into the batch normalization layer, the second activation function layer and the upsampling layer to obtain the first local boundary feature map.
4. The method according to claim 2, characterized in that, The step of inputting the deep feature map into the feather continuity perception module of the initial pixel-level mask detection model to obtain the first global feature map includes: Based on selective scanning, the deep feature map is expanded into multiple one-dimensional sequences. For each one-dimensional sequence, state updates are performed in parallel to obtain the corresponding one-dimensional output sequence. For each one-dimensional output sequence, map it back to two-dimensional space to obtain the corresponding sub-feature map, and aggregate all the sub-feature maps to obtain an aggregated feature map. The aggregated feature map is input into multiple depthwise separable convolutions, and corresponding enhanced feature maps are output. All the enhanced feature maps are added element-wise to obtain a fused feature map. The fused feature map is input into a second activation function layer, and a probability map is output. The probability map is multiplied element-wise with the aggregated feature map to obtain a first global feature map.
5. The method according to claim 2, characterized in that, The spatial mapping calibration mechanism module, which inputs the second global feature map and the third local boundary feature map into the initial pixel-level mask detection model, outputs the first gas segmentation result, including: The second global feature map and the third local boundary feature map are concatenated through channels and then compressed and fused through a convolutional layer to obtain a first hybrid feature map; The first hybrid feature map is recalibrated to obtain the channel attention weights; The first mixed feature map is multiplied element-wise with the channel attention weights to obtain the second mixed feature map; The first mixed feature map and the second mixed feature map are added element by element to obtain the first gas segmentation result.
6. The method according to claim 2, characterized in that, The boundary-based calibration involves calculating a joint loss function value based on the predicted pixel-level mask, the predicted pixel-level confidence score, the true pixel-level mask corresponding to the infrared gas image sample, and the true boundary corresponding to the infrared gas image sample. This includes: Based on the predicted pixel-level mask, the predicted area of the predicted gas region is calculated. Based on the real pixel-level mask corresponding to the infrared gas image sample, the real area of the real gas region is calculated. The overlap area between the predicted gas region and the real gas region is calculated. Based on the predicted area, the real area, and the overlap area, the first loss function value is calculated. The second global feature map is input into the auxiliary segmentation head, and the auxiliary prediction pixel-level mask is output. The second loss function value is calculated based on the auxiliary prediction pixel-level mask and the real pixel-level mask corresponding to the infrared gas image sample. Based on boundary calibration, the third loss function value is calculated according to the predicted pixel-level confidence and the true boundary corresponding to the infrared gas image sample. Calculate the joint loss function value based on the first loss function value, the second loss function value, and the third loss function value.
7. The method according to claim 1, characterized in that, The step of detecting the infrared gas image to be detected based on the pixel-level mask detection model to obtain the target pixel-level mask includes: The infrared gas image to be detected is input into the feature extraction module of the pixel-level mask detection model for feature extraction to obtain the initial feature map of the target. The initial feature map of the target is then subjected to feature extraction to obtain the deep feature map of the target. The initial feature map of the target is input into the adaptive edge reconstruction strategy module of the pixel-level mask detection model to obtain the first local boundary feature map of the target. The deep feature map of the target is concatenated with the first local boundary feature map of the target to obtain the first concatenated feature map of the target. The first concatenated feature map of the target is input into the adaptive edge reconstruction strategy module to obtain the second local boundary feature map of the target. The target deep feature map is input into the plume continuity perception module of the pixel-level mask detection model to obtain the target first global feature map. The target first global feature map is then input into the plume continuity perception module to obtain the target second global feature map. The second local boundary feature map of the target is concatenated with the first global feature map of the target to obtain the second concatenated feature map of the target. Feature extraction is performed on the second concatenated feature map of the target to obtain the third local boundary feature map of the target. The second global feature map of the target and the third local boundary feature map of the target are input into the spatial mapping calibration mechanism module of the pixel-level mask detection model, and the second gas segmentation result is output. The second gas segmentation result is input into the segmentation head of the pixel-level mask detection model, and the target pixel-level mask corresponding to the infrared gas image sample to be tested is output.
8. An infrared gas leak detection device based on selective scanning and boundary calibration, characterized in that, The device includes: The acquisition module is used to acquire a preprocessed infrared gas image sample set, wherein each infrared gas image sample is labeled with the corresponding real pixel-level mask and real boundary. The training module is used to train an initial pixel-level mask detection model based on the infrared gas image sample set. Based on the corresponding real pixel-level mask and real boundary, the parameters of the initial pixel-level mask detection model are updated according to the boundary calibration until a preset stopping condition is reached to obtain a trained pixel-level mask detection model. The initial pixel-level mask detection model includes: a feature extraction module, a plume continuity perception module, an adaptive edge reconstruction strategy module, a spatial mapping calibration mechanism module, and a segmentation head. The detection module is used to acquire an infrared gas image to be detected, and based on the pixel-level mask detection model, detect the infrared gas image to be detected to obtain a target pixel-level mask in order to complete the infrared gas leakage detection.
9. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the infrared gas leak detection method based on selective scanning and boundary calibration as described in any one of claims 1 to 7.
10. A computer device comprising a memory, a processor, and a computer program stored on a storage medium and executable on the processor, characterized in that, When the processor executes the program, it implements the infrared gas leak detection method based on selective scanning and boundary calibration as described in any one of claims 1 to 7.
