A method and system for real-time detection of weld defects in pressure pipelines

CN122656980APending Publication Date: 2026-08-28POWERCHINA ZHONGNAN ENG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610501179.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-16
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

[0005]本发明旨在解决现有技术中压力管道焊缝缺陷检测效率差的问题,提供一种能够兼顾检测精度、抗干扰能力和实时性的压力管道焊缝缺陷实时检测方法及系统

Benefits of technology

本发明通过构建覆盖裂纹缺陷、气孔类缺陷和飞溅类缺陷的压力管道焊缝图像数据集,再构建并训练层次化自适应增强检测Transformer模型,最后利用训练后的模型对待检测图像进行缺陷类别识别和边界框定位。可以针对压力管道焊缝缺陷中目标尺度变化大、边界弱、背景干扰强以及实时检测要求高等问题,对RT-DETR架构进行改进,从而提高多尺度缺陷识别能力、复杂场景下的抗干扰能力以及整体检测效率,从而实现压力管道焊缝缺陷的实时检测,与传统人工判读方式相比,能够提高检测效率,并减少人为经验差异对检测结果的影响。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122656980A_ABST
    Figure CN122656980A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of industrial visual detection and pressure pipeline weld defect identification, and provides a pressure pipeline weld defect real-time detection method and system, comprising: acquiring a pressure pipeline weld image and constructing a data set containing crack defects, pore defects and spatter defects; constructing a hierarchical adaptive enhancement detection Transformer model based on an RT-DETR architecture, the model comprising a partial reparameterization enhancement module, a deep hierarchical adaptive feature fusion module and a global encoder; training the model based on the data set to obtain a trained defect detection model; inputting a to-be-detected image into the trained model to output a defect category and a positioning bounding box. The method can improve multi-scale defect recognition capability, anti-interference capability in complex background and detection efficiency, realize real-time detection of pressure pipeline weld defects, and reduce result differences caused by manual interpretation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial visual inspection and pressure pipeline weld defect identification technology, specifically to a real-time detection method and system for pressure pipeline weld defects. Background Technology

[0002] Compressed air energy storage technology is one of the important technologies for clean energy grid connection. It compresses and stores surplus electricity during off-peak hours and releases high-pressure air to generate electricity during peak hours. The air storage tank and related pressure pipelines in compressed air energy storage systems are usually made of welded steel plates. Due to environmental corrosion and internal high-pressure loads, stress concentration can easily occur at the weld joints due to structural discontinuities. During long-term operation, defects such as cracks, slag inclusions, porosity, and spatter are prone to occur, which in turn affect the structural integrity and operational safety.

[0003] Existing non-destructive testing methods for welds mainly include ultrasonic testing, radiographic testing, eddy current testing, and penetrant testing. However, these methods all have certain limitations in terms of testing conditions, applicable scenarios, testing costs, or testing efficiency. Machine vision-based weld inspection methods, on the other hand, offer advantages such as non-contact operation, high testing efficiency, and ease of automation, making them promising for future applications.

[0004] Traditional image processing methods based on human experience or manually designed features are highly sensitive to imaging conditions, on-site environment, and background interference, resulting in poor detection stability. With the development of deep learning technology, target detection methods based on convolutional neural networks and self-attention mechanisms have been gradually applied to the field of defect detection, achieving some progress in detection accuracy and automation. However, in the detection of weld defects in pressure pipelines, existing methods still suffer from insufficient detection accuracy and anti-interference capabilities due to the differences in morphology, scale, and boundary features of different defects, as well as variations in weld surface texture, interference from adhering substances, and changes in illumination. Summary of the Invention

[0005] The present invention aims to solve the problem of poor detection efficiency of weld defects in pressure pipelines in the prior art, and to provide a real-time detection method and system for weld defects in pressure pipelines that can take into account detection accuracy, anti-interference ability and real-time performance.

[0006] To achieve the above objectives, the first aspect of the present invention provides a method for real-time detection of weld defects in pressure pipelines, comprising the following steps:

[0007] S1. Obtain images of pressure pipeline welds and construct a pressure pipeline weld image dataset. The defect categories of the pressure pipeline weld image dataset include crack defects, porosity defects, and spatter defects. S2. Construct a hierarchical adaptive enhancement detection Transformer model. This model is based on the RT-DETR architecture and includes a partially reparameterized enhancement module, a deep hierarchical adaptive feature fusion module, and a global encoder. The hierarchical adaptive enhancement detection Transformer model receives the pressure pipeline weld image, extracts and enhances multi-scale features through the partially reparameterized enhancement module, fuses the multi-scale features through the deep hierarchical adaptive feature fusion module, and models the fused features using global and local contexts through the global encoder to obtain encoded features. Based on these encoded features, it outputs the defect category and localization bounding box. S3. Based on the pressure pipeline weld image dataset, the hierarchical adaptive enhancement detection Transformer model is trained to obtain the trained pressure pipeline weld defect detection model. S4. Input the image of the pressure pipeline weld to be detected into the trained pressure pipeline weld defect detection model, and output the defect category and location bounding box in the image to achieve real-time detection of pressure pipeline weld defects.

[0008] A second aspect of this application provides a real-time detection system for weld defects in pressure pipelines, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.

[0009] Based on the above technical solution, this application has the following beneficial effects: This invention constructs a dataset of pressure pipeline weld images covering crack defects, porosity defects, and spatter defects. It then builds and trains a hierarchical adaptive enhancement detection Transformer model, and finally uses the trained model to identify defect categories and locate bounding boxes in the images to be detected. This invention addresses the challenges of large target scale variations, weak boundaries, strong background interference, and high real-time detection requirements in pressure pipeline weld defects by improving the RT-DETR architecture. This enhances multi-scale defect recognition capabilities, anti-interference capabilities in complex scenes, and overall detection efficiency, enabling real-time detection of pressure pipeline weld defects. Compared to traditional manual interpretation methods, this improves detection efficiency and reduces the impact of human experience differences on detection results. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a schematic diagram of the overall structure of the HAE-DETR model in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a partial reparameterization enhancement module PRE in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of the partially reparameterized convolution PRConv in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of the attention-maximizing mechanism (EMA) in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of the deep hierarchical adaptive feature fusion module DHAFF in an embodiment of the present invention; Figure 6 This is a schematic diagram of the binary attention fusion mechanism (BAF) in an embodiment of the present invention. Figure 7 This is a schematic diagram of the fusion unit structure in DHAFF in an embodiment of the present invention; Figure 8 This is a schematic diagram of the structure of the global encoder FDT in an embodiment of the present invention.

[0012] Figure 9 This is an example diagram of weld defects in a pressure pipeline according to an embodiment of the present invention; Figure 10 This is a performance comparison chart of different target detection models in the embodiments of the present invention; Figure 11 This is a three-dimensional bar chart of the ablation experiment in an embodiment of the present invention; Figure 12 This is a comparison chart of the baseline model and the HAE-DETR test results in an embodiment of the present invention; Figure 13 This is a comparison chart of the baseline model and the HAE-DETR feature activation heatmap in an embodiment of the present invention; Figure 14 This is a flowchart of an embodiment of the present invention. Detailed Implementation

[0013] To facilitate understanding of this application, the following description will be more comprehensive and detailed in conjunction with the accompanying drawings and preferred embodiments, but the scope of protection of this application is not limited to the following specific embodiments.

[0014] Unless otherwise defined, all technical terms used herein have the same meaning as commonly understood by those skilled in the art. The technical terms used herein are for the purpose of describing particular embodiments only and are not intended to limit the scope of this application.

[0015] like Figure 14 As shown in the figure, this embodiment provides a method for real-time detection of weld defects in pressure pipelines, including the following steps: S1. Obtain images of pressure pipeline welds and construct a pressure pipeline weld image dataset. The defect categories of the pressure pipeline weld image dataset include crack defects, porosity defects, and spatter defects. S2. Construct a hierarchical adaptive enhancement detection Transformer model (HAE-DETR model). The hierarchical adaptive enhancement detection Transformer model is based on the RT-DETR architecture and includes a partially reparameterized enhancement module (PRE), a deep hierarchical adaptive feature fusion module (DHAFF), and a global encoder (FDT). The hierarchical adaptive enhancement detection Transformer model is used to receive images of pressure pipeline welds. It extracts and enhances multi-scale features through the partially reparameterized enhancement module, fuses the multi-scale features through the deep hierarchical adaptive feature fusion module, and models the global and local contexts of the fused features through the global encoder to obtain encoded features. Based on the encoded features, it outputs the defect category and local bounding box. In this step, the model is improved based on the RT-DETR architecture. Specifically, a partially reparameterized enhancement module is added in the backbone feature extraction stage, a deep hierarchical adaptive feature fusion module is added in the multi-scale feature fusion stage, and a global encoder is added in the encoding stage. Through the synergistic effect of these three structures, the ability to represent micro-cracks, defects with blurred boundaries, irregular defects, and mixed defects can be improved, while balancing detection accuracy and inference speed.

[0016] S3. Based on the pressure pipeline weld image dataset, the hierarchical adaptive enhancement detection Transformer model is trained to obtain the trained pressure pipeline weld defect detection model. In this step, the training process can use the AdamW optimizer and a cosine annealing strategy to adjust the learning rate, so as to balance the convergence speed in the early stage of training and the parameter stability in the later stage of training.

[0017] S4. Input the image of the pressure pipeline weld to be detected into the trained pressure pipeline weld defect detection model, and output the defect category and location bounding box in the image to achieve real-time detection of pressure pipeline weld defects.

[0018] In this embodiment, a pressure pipeline weld image dataset covering crack defects, porosity defects, and spatter defects is constructed. A hierarchical adaptive enhancement detection Transformer model is then built and trained. Finally, the trained model is used to identify defect categories and locate bounding boxes in the images to be detected. This approach addresses the challenges of large target scale variations, weak boundaries, strong background interference, and high real-time detection requirements in pressure pipeline weld defects. By improving the RT-DETR architecture, it enhances multi-scale defect recognition capabilities, anti-interference capabilities in complex scenarios, and overall detection efficiency. This enables real-time detection of pressure pipeline weld defects, improving detection efficiency and reducing the impact of human experience differences on detection results compared to traditional manual interpretation methods.

[0019] In one embodiment, such as Figure 1 As shown, the hierarchical adaptive enhancement detection Transformer model is based on the RT-DETR architecture and includes a partially reparameterized enhancement module, a deep hierarchical adaptive feature fusion module (HAFM, upsampling, Conv(3×3,s=2), and the feature fusion structure in the figure all belong to the deep hierarchical adaptive feature fusion module), and a global encoder. The hierarchical adaptive enhancement detection Transformer model is used to receive images of pressure pipeline welds. It extracts and enhances multi-scale features through the partially reparameterized enhancement module, fuses the multi-scale features through the deep hierarchical adaptive feature fusion module, and models the global and local contexts of the fused features through the global encoder to obtain encoded features. The query selection unit and decoder in the RT-DETR architecture decode the encoded features and output the defect category and local bounding box through the classification branch and bounding box regression branch.

[0020] In one embodiment, the partial reparameterization enhancement module is used to perform multi-scale feature extraction and feature enhancement on the input pressure pipeline weld image, including: Feature extraction is performed on the input pressure pipeline weld image to obtain features at different scales; Features of different scales are divided into first sub-features and second sub-features according to channels. The first sub-features are subjected to reparameterized convolution processing, while the second sub-features are left unchanged. Attention enhancement is applied to the first sub-feature after reparameterized convolution; The attention-enhanced first sub-feature is fused with the second sub-feature to obtain enhanced features at different scales.

[0021] Specifically, such as Figures 2 to 4 As shown, after feature extraction from the input pressure pipeline weld image, features at different scales can be obtained. Let the feature map at any of these scales be... ,but It can be divided into the first sub-feature according to the channel. Second sub-feature ,Right now:

[0022] in, This represents a feature map of any scale extracted from the input image of a pressure pipeline weld. This represents the first sub-feature that participates in the reparameterized convolution process. The second sub-feature, which remains unchanged, is represented by the symbol. This indicates a channel-based splicing operation.

[0023] Reparameterized convolution processing of the first sub-feature can be represented as:

[0024] in, This represents the first sub-feature after reparameterized convolution. This indicates a reparameterized convolution operation.

[0025] Reparameterized convolution can be represented as:

[0026] in, This represents the features input to the reparameterized convolutional unit; Indicates the process Branch outputs after convolution and batch normalization; Indicates the process Branch outputs after convolution and batch normalization; This indicates the output of the identity branch that has only undergone batch normalization. This represents the SiLU activation function.

[0027] Furthermore, attention enhancement is applied to the first sub-feature after reparameterized convolution, which can be expressed as:

[0028] in, This represents the first sub-feature after attention enhancement. This indicates an attention enhancement operation.

[0029] The attention enhancement mechanism can be represented as:

[0030] in, Represents input features; This indicates a global average pooling operation; and They represent Convolution and convolution; This indicates element-wise multiplication. Formula (5) means that global statistical information and local convolutional information are first extracted from the input features, and then attention weights are generated based on these two types of information to adaptively weight the input features in order to highlight the defect-related regions and suppress background interference.

[0031] The fusion of the attention-enhanced first sub-feature and the second sub-feature can be represented as:

[0032] in, This represents the enhanced feature at the corresponding scale. Formula (6) means that the enhanced feature is obtained by concatenating the first sub-feature after attention enhancement with the second sub-feature that remains unchanged by channel.

[0033] In a specific implementation, the forward propagation process of some reparameterized enhancement modules can be further represented as:

[0034] in, Indicates a random deactivation operation; Indicates passing through in sequence The processing results after convolution, batch normalization, and ReLU activation; This indicates a partially reparameterized convolution operation. This indicates that after dividing the input features by channel, only the first sub-feature is subjected to a partially reparameterized convolution operation (the plus sign in the formula represents a residual connection). Formula (7) indicates that, based on the partially reparameterized convolution, channel mapping, regularization, and attention enhancement are further introduced, and the training stability and feature representation ability are improved through residual connections.

[0035] Through the above structure, the partial reparameterization enhancement module can enhance the extraction capabilities of fine cracks, weak texture edges and irregular defects at a lower computational cost, thereby improving the fine representation capability when performing multi-scale feature extraction on the input pressure pipeline weld image.

[0036] In one embodiment, the deep hierarchical adaptive feature fusion module is used to fuse enhanced features of different scales output by the partially reparameterized enhancement module, including: Channel adjustment and spatial scale unification are performed for enhanced features at different scales; After achieving spatial scale unification, each enhanced feature is divided into multiple corresponding feature blocks according to the channel. Perform binary attention fusion on the corresponding feature blocks; The fused feature blocks are then concatenated and normalized to obtain the fused features.

[0037] Specifically, such as Figures 5 to 7 As shown, let the enhancement features at different scales output by the partially reparameterized enhancement module be the high-resolution enhancement features. Mesoscale enhancement features and low-resolution enhancement features To fuse enhanced features at different scales, channel adjustment and spatial scale unification are first performed on the enhanced features at different scales. This process can be represented as:

[0038]

[0039] in, This indicates a step size of 2. High-resolution enhanced features after convolution processing; This represents the low-resolution enhanced features after interpolation. This indicates a step size of 2. convolution; This indicates the operation of interpolation alignment using intermediate-scale enhanced features as a spatial reference. Equations (8) and (9) indicate that enhanced features at different scales are transformed to a unified spatial scale, providing consistent input conditions for subsequent feature block-level fusion.

[0040] After achieving spatial scale unification, each enhanced feature is divided into multiple corresponding feature blocks according to channel, and binary attention fusion is performed on the corresponding feature blocks. Binary attention fusion can be represented as:

[0041] in, This represents a binary attention fusion operation; This represents the attention weights generated by the intermediate-scale enhanced features; This indicates element-wise multiplication. Formula (10) means that, guided by intermediate-scale enhancement features, high-resolution enhancement features and low-resolution enhancement features after spatial scale unification are adaptively weighted and fused. When edge and detail information is more needed at a certain location, the proportion of high-resolution enhancement features is higher; when semantic and contextual information is more needed at a certain location, the proportion of low-resolution enhancement features is higher.

[0042] Furthermore, the fused feature blocks are concatenated and then subjected to convolution and normalization to obtain the fused features. This process can be represented as:

[0043] in, to This represents the result after the corresponding feature blocks have been fused. This indicates a channel-based splicing operation; Indicates skip connection characteristics; This indicates a batch normalization operation; Indicates the activation function; The fusion features are represented by formula (11). Formula (11) means that after the fusion feature blocks are reassembled and integrated by convolution, the bypass features are superimposed to preserve the original information and enhance the stability of the fusion result.

[0044] In one embodiment, the deep hierarchical adaptive feature fusion module adopts a two-stage fusion method. In the first stage, the enhanced features at different scales are fused to obtain the first fused feature. In the second stage, the first fused feature is fused with the enhanced features at different scales to obtain the second fused feature.

[0045] Specifically, in the first stage, enhanced features at different scales are fused according to the aforementioned channel adjustment, spatial scale unification, feature block partitioning, binary attention fusion, and splicing and normalization processes to obtain the first fused feature. In the second stage, the first fused feature is fused with enhancement features of different scales again in the manner described above to obtain the second fused feature. Second fusion feature The output of the deep hierarchical adaptive feature fusion module is used for subsequent global and local context modeling. Through two-stage fusion, information loss caused by single-stage fusion can be reduced, improving the representation ability of small target defects, blurred boundary defects, and mixed defects.

[0046] In one embodiment, the global encoder is used to perform global and local context modeling on the second fused feature, including: in the first stage, dividing the second fused feature into multiple local regions by window partitioning, and using a region self-attention mechanism to model the features in each local region; in the second stage, using a global self-attention mechanism to model the second fused feature; and the global encoder also uses an attention weight sharing mechanism.

[0047] like Figure 8 As shown, let the second fusion feature be... The query matrix is ​​generated from the second fusion feature. Key matrix Sum matrix In the first stage, the second fused feature is divided into multiple local regions through windowing, and region self-attention computation is performed within each local region. The region self-attention mechanism can be represented as:

[0048]

[0049] in, Indicates the region self-attention weight; This represents the modeling results for a local region. This indicates a normalization operation; Indicates the scaling factor; This indicates the matrix transpose. Formulas (12) and (13) indicate that the correlation between features is calculated within a local region, and the value matrix is ​​weighted using this correlation, thereby highlighting local texture changes, edge changes, and short-distance dependencies.

[0050] In the second stage, a global self-attention mechanism is used to model the second fused feature to obtain global contextual information. The global self-attention mechanism can be represented as:

[0051]

[0052] in, Represents the global self-attention weights; The results represent the global modeling results. Formulas (14) and (15) indicate that long-distance dependencies are established throughout the entire second fusion feature range to model the global associations between different defect regions and between defect regions and background regions, thereby enhancing the overall semantic understanding capability.

[0053] Furthermore, the global encoder employs an attention weight sharing mechanism in both the local and global self-attention mechanisms to reduce the additional computational overhead caused by duplicate parameters and improve modeling consistency. After integrating the local and global modeling results, the output update process of the global encoder can be represented as follows:

[0054] in, This represents the features input to the global encoder; This represents the features after attention modeling; Presentation layer normalization operation; This represents a feedforward neural network; This represents the encoded features output by the global encoder. Equation (16) indicates that, based on the attention output, feature updates are further completed through residual connections, layer normalization, and feedforward networks, thereby enhancing feature representation capabilities and maintaining the stability of the training process.

[0055] By combining local and global modeling, the global encoder can simultaneously capture the local details of weld defects and understand the overall scene, thereby improving multi-target recognition, contextual discrimination, and inference efficiency in complex weld scenarios.

[0056] In a specific embodiment, such as Figure 9 As shown, the defect categories in the pressure pipeline weld image dataset include crack defects (a), porosity defects and spatter defects (d), as well as composite defects (e), specifically defects formed by porosity (c) plus spatter (d), where porosity defects include porosity (c) and slag inclusions (b).

[0057] In a specific embodiment, the parameter settings for training the hierarchical adaptive enhancement detection Transformer model include: a batch size of 8, an initial learning rate of 1×10^-4, the AdamW optimizer, a weight decay coefficient of 0.0001, momentum parameters β1 of 0.9 and β2 of 0.999, and a cosine annealing strategy for 300 training rounds.

[0058] The experimental environment was a Windows operating system, equipped with an NVIDIA RTX 4070Ti Super GPU and an Intel i7 14700KF processor.

[0059] To verify the detection effect of the method in this embodiment, a comparative experiment was conducted. Table 1 and Figure 10 Comparison results with models such as the YOLO series and RT-DETR series are presented. (See Table 1 and...) Figure 10 As can be seen, HAE-DETR has a precision of 87.5%, a recall of 80.6%, a map50 accuracy of 84.1%, and a map50:95 accuracy of 60.1%. Compared with the baseline RT-DETR, map50 is improved by 3.1%, with 18.5M parameters and a computational cost of 58.4 GFLOPs.

[0060] Table 1 shows the performance comparison results of different object detection models.

[0061] Table 2 and Figure 11 Ablation experiments are presented to analyze the impact of each module on detection accuracy and speed. Specifically, some reparameterization enhancement modules reduced the number of parameters and computational load while maintaining detection accuracy; the deep hierarchical adaptive feature fusion module improved detection accuracy; and the global encoder achieved a good balance between detection accuracy and inference speed. Experimental results of multi-module combinations show that when all modules are introduced simultaneously, the map50 reaches 84.1%, indicating that the above module combination can improve the detection effect of weld defects.

[0062] Table 2 shows the ablation experimental results of each component module of the HAE-DETR model.

[0063] Figure 12 and Figure 13 The visualization results show that the method in this embodiment can accurately focus on the defect area and complete the localization in scenarios of crack defects, pore defects, spatter defects and mixed defects.

[0064] In one embodiment, this application also provides a real-time detection system for weld defects in pressure pipelines, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above method.

[0065] By introducing a partially reparameterized enhancement module, a deep hierarchical adaptive feature fusion module, and a global encoder into the RT-DETR architecture, the model can simultaneously improve its ability to extract multi-scale features from input pressure pipeline weld images, its ability to fuse enhanced features at different scales, and its ability to model the global and local context of the second fused features in the pressure pipeline weld defect detection task. This improves the detection accuracy and real-time performance for multi-scale, small-target, weak-boundary, and complex-background defects.

[0066] The above are merely preferred embodiments of this application. It should be noted that this application is not limited to the above embodiments. For those skilled in the art, several improvements and modifications can be made without departing from the principles of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should also be considered within the scope of protection of this application.

Claims

1. A method for real-time detection of weld defects in pressure pipelines, characterized in that, Including the following steps: S1. Obtain images of pressure pipeline welds and construct a pressure pipeline weld image dataset. The defect categories of the pressure pipeline weld image dataset include crack defects, porosity defects, and spatter defects. S2. Construct a hierarchical adaptive enhancement detection Transformer model. This model is based on the RT-DETR architecture and includes a partially reparameterized enhancement module, a deep hierarchical adaptive feature fusion module, and a global encoder. The hierarchical adaptive enhancement detection Transformer model receives the pressure pipeline weld image, extracts and enhances multi-scale features through the partially reparameterized enhancement module, fuses the multi-scale features through the deep hierarchical adaptive feature fusion module, and models the fused features using global and local contexts through the global encoder to obtain encoded features. Based on these encoded features, it outputs the defect category and localization bounding box. S3. Based on the pressure pipeline weld image dataset, the hierarchical adaptive enhancement detection Transformer model is trained to obtain the trained pressure pipeline weld defect detection model. S4. Input the image of the pressure pipeline weld to be detected into the trained pressure pipeline weld defect detection model, and output the defect category and location bounding box in the image to achieve real-time detection of pressure pipeline weld defects.

2. The method for real-time detection of weld defects in pressure pipelines according to claim 1, characterized in that, The partial reparameterization enhancement module is used to perform multi-scale feature extraction and feature enhancement on the input pressure pipeline weld image, including: Feature extraction is performed on the input pressure pipeline weld image to obtain features at different scales; Each scale feature is divided into a first sub-feature and a second sub-feature according to the channel. The first sub-feature is subjected to reparameterized convolution processing, while the second sub-feature remains unchanged. Attention enhancement is applied to the first sub-feature after reparameterized convolution; The attention-enhanced first sub-feature is fused with the second sub-feature to obtain enhanced features at different scales.

3. The method for real-time detection of weld defects in pressure pipelines according to claim 2, characterized in that, The deep hierarchical adaptive feature fusion module is used to fuse the enhanced features of different scales output by the partially reparameterized enhancement module, including: Channel adjustment and spatial scale unification are performed on the enhanced features at different scales; After achieving spatial scale unification, each enhanced feature is divided into multiple corresponding feature blocks according to the channel. Binary attention fusion is performed on the corresponding feature blocks; the fused feature blocks are then concatenated and processed by convolution and normalization to obtain the fused features.

4. The method for real-time detection of weld defects in pressure pipelines according to claim 3, characterized in that, The deep hierarchical adaptive feature fusion module adopts a two-stage fusion method. In the first stage, the enhanced features at different scales are fused to obtain the first fused feature. The second stage involves fusing the first fusion feature with the enhancement features of different scales to obtain the second fusion feature.

5. The method for real-time detection of weld defects in pressure pipelines according to claim 4, characterized in that, The global encoder is used to perform global and local context modeling on the second fused feature, including: in the first stage, dividing the second fused feature into multiple local regions by window partitioning, and using a region self-attention mechanism to model the features in each local region; in the second stage, using a global self-attention mechanism to model the second fused feature; and the global encoder also uses an attention weight sharing mechanism.

6. The method for real-time detection of weld defects in pressure pipelines according to claim 1, characterized in that, The porosity defects include pores and inclusions.

7. The method for real-time detection of weld defects in pressure pipelines according to claim 1, characterized in that, When training the hierarchical adaptive augmentation detection Transformer model, the batch size is 8, the initial learning rate is 1×10^-4, the AdamW optimizer is used, the weight decay coefficient is 0.0001, the momentum parameters β1 are 0.9 and β2 are 0.999, and a cosine annealing strategy is used for 300 training rounds.

8. A real-time detection system for weld defects in pressure pipelines, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.