A method and system for identifying defects in pipeline welds
By generating a defect prediction confidence map, uncertainty map, and geometric prior weight map and combining them with a cross-attention fusion module, the problems of information loss and uneven resource allocation in pipeline weld defect identification are solved, achieving efficient and accurate defect detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA CONSTR FIFTH ENG DIV CORP LTD
- Filing Date
- 2026-05-08
- Publication Date
- 2026-06-02
AI Technical Summary
Existing radiographic testing technologies suffer from the loss of information on defect depth, size, and spatial orientation in pipeline weld defect identification, making it difficult to achieve high-resolution multi-angle scanning. Furthermore, depth networks cannot actively request high-quality data input, resulting in unoptimized allocation of inspection resources, high uncertainty in defect identification, and an inability to fully utilize prior knowledge of the geometric structure of the weld area.
By combining deep convolutional networks and Bayesian variational inference, a defect prediction confidence map, uncertainty map, and geometric prior weight map are generated. Pixel-level weighted fusion is then performed to generate a probability heatmap. Composite sampling is used to guide the vector field for local high-resolution scanning. Feature fusion is performed by combining a cross-attention fusion module to output the defect category, spatial location, and size.
It has improved the accuracy and reliability of pipeline weld defect detection, reduced the rate of missed detection and false detection, optimized the allocation of detection resources, and improved detection efficiency and accuracy.
Smart Images

Figure CN122134731A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of defect detection, and in particular relates to a method and system for identifying defects in pipeline weld seams. Background Technology
[0002] Pipeline welds are the weakest link in the entire pipeline system, prone to various internal defects due to improper welding processes, material defects, or service environment influences. Radiographic testing is highly sensitive to volumetric defects and can provide transparent images of the internal structure. However, the generated two-dimensional radiographic images are projections of three-dimensional objects onto a two-dimensional plane; the depth, size, and spatial orientation of the defects are lost or blurred, and defects of different depths may overlap in the image, affecting accurate quantitative assessment and hazard classification. Image interpretation relies on certified radiographic engineers, which are susceptible to subjective factors and visual fatigue. For long-distance, large-diameter pipelines, high-resolution, multi-angle scanning is not feasible in terms of time and cost. Conventional global scanning compromises resolution and signal-to-noise ratio, potentially missing small or critically sized defects. Using deep convolutional neural networks for defect identification and segmentation of weld radiographic images, trained on large-scale datasets, can learn defect characteristics, improving detection objectivity. However, when faced with blurred, noisy, or atypical regions, the model cannot proactively request higher-quality data input. Deep networks, when providing prediction results, cannot express their own cognitive uncertainty about the prediction results, thus failing to identify suspicious areas requiring detailed investigation and resulting in inefficient allocation of inspection resources. The model treats X-ray images as general images, failing to fully utilize the inherent, physically meaningful prior knowledge of the geometric structure of the weld area. Even if local high-resolution data is acquired, how to fuse this data with global low-resolution features to achieve complementary information enhancement remains an unresolved technical challenge, hindering improvements in the reliability and intelligence of X-ray inspection systems. Summary of the Invention
[0003] To address the aforementioned problems, the first aspect of this invention provides a method for identifying defects in pipeline weld seams, comprising the following steps:
[0004] Initial radiographic image data of pipeline welds are acquired, a global feature map is obtained based on the first deep convolutional network, and a preliminary defect prediction confidence map is obtained based on the global feature map.
[0005] The initial ray image data is processed to identify and extract the key geometric structure of the weld, generating a geometric prior weight map representing the location of the key area; and by applying Bayesian variational inference to the first deep convolutional network, multiple random forward propagations are performed on the same initial ray image data and the dispersion of the prediction results is statistically analyzed to generate an uncertainty map.
[0006] The defect prediction confidence map, uncertainty map, and geometric prior weight map are pixel-level weighted fusion to generate a probability heatmap representing the priority region for supplementary sampling; and a composite sampling guidance vector field is obtained based on the probability heatmap, uncertainty map, and geometric prior weight map; two-dimensional supplementary sampling points are arranged along the integral curve of the composite sampling guidance vector field, and the X-ray imaging system is controlled to perform multi-angle scanning of the local three-dimensional space where each sampling point is located, acquiring a set of high-resolution local projection data;
[0007] The high-resolution local projection data is reconstructed in three dimensions to generate local features; the local features are fused with the global features at the corresponding spatial locations in the global feature map using a cross-attention fusion module to generate an enhanced defect representation; and based on the enhanced defect representation, the category, three-dimensional spatial location, and size of the weld defect are output through a defect parameter decoder.
[0008] A second aspect of the present invention provides a pipeline weld flaw detection defect identification system, comprising the following modules:
[0009] The decoding module is used to acquire the initial ray image data of the pipeline weld, obtain the global feature map based on the first deep convolutional network, and obtain the preliminary defect prediction confidence map based on the global feature map.
[0010] The generation module is used to perform image processing on the initial ray image data to identify and extract the key geometric structure of the weld, and generate a geometric prior weight map representing the location of the key area; and to perform multiple random forward propagations on the same initial ray image data by applying Bayesian variational inference to the first deep convolutional network and statistically analyzing the dispersion of the prediction results to generate an uncertainty map.
[0011] The acquisition module is used to perform pixel-level weighted fusion of the defect prediction confidence map, uncertainty map, and geometric prior weight map to generate a probability heat map representing the priority region for supplementary sampling; and to obtain a composite sampling guidance vector field based on the probability heat map, uncertainty map, and geometric prior weight map; to deploy two-dimensional supplementary sampling points along the integral curve of the composite sampling guidance vector field, and to control the ray imaging system to perform multi-angle scanning of the local three-dimensional space where each sampling point is located, acquiring a set of high-resolution local projection data;
[0012] The output module is used to perform three-dimensional reconstruction on the high-resolution local projection data to generate local features; the cross-attention fusion module is used to fuse the local features with the global features at the corresponding spatial locations in the global feature map to generate an enhanced defect representation; and based on the enhanced defect representation, the defect parameter decoder outputs the category, three-dimensional spatial location and size of the weld defect.
[0013] This invention improves the accuracy and reliability of pipeline weld defect detection by combining global preliminary prediction with local supplementary sampling. By fusing weld geometric priors, model uncertainties, and preliminary prediction results, composite guidance information is generated, directing high-resolution supplementary sampling resources to the most valuable areas for detection. This avoids the high time and computational costs of scanning the entire weld, thus improving detection efficiency while maintaining accuracy. Furthermore, a cross-attention mechanism is used to fuse high-resolution local 3D features with global feature maps, generating rich enhanced defect representations. This enables decoding of defect categories, 3D spatial locations, and sizes, reducing both false negative and false positive rates. Attached Figure Description
[0014] Figure 1 A flowchart of the first embodiment;
[0015] Figure 2 This is a diagram of the first-depth convolutional network structure;
[0016] Figure 3 A schematic diagram for calculating the vector field guided by composite sampling;
[0017] Figure 4 A spatial distribution map of the vector field guiding composite sampling;
[0018] Figure 5 This is a graph for evaluating the cognitive uncertainty of the model. Detailed Implementation
[0019] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0020] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0021] In the first embodiment, see Figure 1 This invention proposes a method for identifying defects in pipeline welds, comprising:
[0022] S1. Obtain initial ray image data of the pipeline weld, obtain global feature map based on the first deep convolutional network, and obtain preliminary defect prediction confidence map based on the global feature map.
[0023] A digital radiography (DR) system is used to acquire two-dimensional radiographic perspective views of the weld seam area of the pipeline network using a flat panel detector, obtaining initial radiographic image data in 16-bit depth TIFF or DCM format. This data is then normalized to a floating-point range of 0 to 1. A first deep convolutional network using a ResNet-50 encoder and an UNet architecture is constructed, taking the normalized initial radiographic image data as input. The encoder extracts features through successive convolutional layers, batch normalization layers, and ReLU activation functions, resulting in a 512-channel global feature map located at the network bottleneck. The decoder uses a series of upsampling layers, such as transposed convolutions, to fuse the feature maps from the corresponding layers of the encoder through skip connections, progressively restoring the image resolution. At the end of the decoder, a 1×1 convolutional layer reduces the number of feature channels to 1, and an activation function is applied, outputting a single-channel image of the same size as the original image. Each pixel value in the image represents the probability of a defect at that location; this is the preliminary defect prediction confidence map.
[0024] S2, perform image processing on the initial ray image data to identify and extract the key geometric structure of the weld, and generate a geometric prior weight map representing the location of the key area; and by applying Bayesian variational inference to the first deep convolutional network, perform multiple random forward propagations on the same initial ray image data and statistically analyze the dispersion of the prediction results to generate an uncertainty map.
[0025] To generate the geometric prior weight map, the initial ray image data was processed using the OpenCV library, converting the image to grayscale and performing Gaussian filtering to remove noise. The cv2.Canny algorithm was applied for edge detection, and combined with the cv2.HoughLinesP probabilistic Hough transform to extract the approximate straight boundary of the weld area. Based on the extracted boundary information, a binary mask covering the weld center and heat-affected zone was generated using the cv2.dilate morphological dilation operation. Based on this mask, the distance from each pixel to the nearest mask region was calculated, and the distance transformation result was mapped using a Gaussian function to generate a floating-point geometric prior weight map with high weights in the weld area and low weights far from the weld area. To generate the uncertainty map, all internal Dropout layers were enabled during the inference stage of the first deep convolutional network, i.e., the model.train() function was called to perform 30 forward propagations on the same initial ray image data. Each propagation, due to the randomness of Dropout, produced a slightly different defect prediction confidence map. The 30 prediction results were stored in a NumPy array. The `numpy.var` function is used to calculate the variance of the predicted value at each pixel location along the dimension of the propagation number, resulting in a two-dimensional array of the same size as the original image. This array is the uncertainty plot representing the cognitive uncertainty of the model. See [link to relevant documentation]. Figure 2 .
[0026] In one possible implementation, the step of performing image processing on the initial ray image data to identify and extract the key geometric structure of the weld, and generating a geometric prior weight map representing the location of the key region, includes:
[0027] A semantic segmentation network was used to process the initial ray image data to distinguish the weld area from the base material area;
[0028] Within the segmented weld area, edge detection algorithms are used to extract the edge contours of the weld root, fusion line, and bevel.
[0029] The extracted edge contours are subjected to morphological skeletonization to obtain a structural centerline with a single pixel width.
[0030] The distance from each pixel within the weld area to the nearest structural centerline is calculated, and the distance value is mapped to a weight using a preset kernel function to generate the geometric prior weight map, where the closer the distance, the higher the weight.
[0031] The semantic segmentation network is a deep neural network based on the U-Net architecture. This network structure includes an encoder path for detecting contextual information and a symmetric decoder path for localization, with features transferred between them via skip connections.
[0032] The input to the semantic segmentation network is initial ray image data with dimensions H×W×C, where the image height H is 2048 pixels, the image width W is 2048 pixels, and the number of channels C is 1.
[0033] The output of the semantic segmentation network is a binary segmentation mask with a data dimension of H×W×1, the same as the input image size. A pixel value of 1 represents the weld area and 0 represents the base material area.
[0034] After processing the initial ray image using this network to obtain the weld region, the Canny edge detection algorithm is applied within the weld region, with a low threshold of 50 and a high threshold of 150, to extract sub-pixel-level edge contours of the weld root, fusion line, and bevel. The extracted edge contours are then refined into single-pixel-width structural centerlines using the Zhang-Suen skeletonization algorithm. For each pixel p within the weld region, the Euclidean distance between that pixel and all structural centerline pixels is calculated, and the minimum value d(p) is used to generate a distance map. A Gaussian kernel function is then applied... The distance values are mapped to weight values in the range of 0 to 1, where the kernel function standard deviation is... The preferred range is 3.0 to 8.0 pixels, for example, a value of 5.0 can be used to generate a geometric prior weight map.
[0035] In one possible implementation, the step of applying Bayesian variational inference to a first deep convolutional network, performing multiple random forward propagations on the same initial ray image data, and statistically analyzing the dispersion of the prediction results to generate an uncertainty map includes:
[0036] Monte Carlo Dropout is used as a random regularization method in a specified network layer of the first deep convolutional network;
[0037] Using the same initial ray image data as input, the random forward propagation process is repeated a preset number of times to obtain a set of defect prediction results with differences.
[0038] For each pixel in the image, the statistical variance of that pixel in the set of prediction results is calculated, and the variance values of all pixels are combined into a two-dimensional image as the uncertainty map.
[0039] The first deep convolutional network is a deep neural network with an encoder-decoder structure. This network structure includes an encoder that extracts multi-scale features through a series of convolution and downsampling operations, and a decoder that gradually restores spatial resolution and performs pixel-level prediction through upsampling and convolution operations.
[0040] The input to the first deep convolutional network is the initial ray image data, with a data dimension of H×W×C.
[0041] The output of the first deep convolutional network consists of two parts: one part is a preliminary defect prediction confidence map with the same size as the input image, and a data dimension of H×W×1, where the pixel value represents the probability of a defect existing at the corresponding location; the other part is a global feature map for feature fusion, with a data dimension of H×W×1. For example, 128×128×256.
[0042] Monte Carlo Dropout layers are applied after the last three convolutional blocks in the encoder section and all convolutional blocks in the decoder section of the network, with a dropout rate p set to 0.5. During the model inference phase, the Dropout layers are kept active, and the same initial ray image data is used as input, repeating the forward propagation T times. The preferred range for T is 30 to 100, for example, it can be set to 50 times, producing 50 slightly different defect prediction confidence maps. For each pixel location (i,j) in the image, calculate the sample variance of the confidence values across 50 predictions. ,in This represents the average confidence level at that pixel location. The variance values of all pixels are combined into a two-dimensional image, and the pixel values are linearly scaled to the 0-1 range using a min-max normalization method to generate an uncertainty plot representing the cognitive uncertainty of the model.
[0043] S3, perform pixel-level weighted fusion of the defect prediction confidence map, uncertainty map, and geometric prior weight map to generate a probability heatmap representing the priority region for supplementary sampling; and obtain a composite sampling guidance vector field based on the probability heatmap, uncertainty map, and geometric prior weight map; deploy two-dimensional supplementary sampling points along the integral curve of the composite sampling guidance vector field, and control the ray imaging system to perform multi-angle scanning of the local three-dimensional space where each sampling point is located, and acquire a set of high-resolution local projection data.
[0044] The defect prediction confidence map, uncertainty map, and geometric prior weight map are subjected to min-max normalization to unify them to the 0-1 range. This is achieved by pre-setting weight coefficients. , , Using NumPy to perform pixel-level weighted summation, i.e. This generates a probability heatmap S. To construct the composite sampling guide vector field V, three components are calculated: the gradient field of the probability heatmap S is calculated using the numpy.gradient function. This serves as a driving force towards the region of high significance. The uncertainty plot is calculated using numpy.gradient. Gradient field positive gradient field and take the negative value. This acts as an attractive force converging towards regions of high uncertainty. The distance field along the centerline of the weld geometry is calculated, and after obtaining the gradient, the gradient vector is rotated by 90° to obtain the unit vector field T along the weld tangent. This is then processed through a weighted linear combination. Generate a composite sampling guide vector field, see [link / reference] Figure 3 To set up sampling points, a set of seed points is randomly or uniformly initialized on the image. The fourth-order Runge-Kutta method (RK4) is used for numerical integration. The trajectory of each seed point, i.e., the integral curve, is calculated iteratively based on the vector field V. (See [link to relevant documentation]). Figure 4 Several points are selected on the curve with a fixed step size as two-dimensional supplementary sampling points. The coordinates of the two-dimensional sampling points are converted into the coordinates of the three-dimensional robotic arm or gantry of the X-ray imaging system. Motion commands are sent through the control system API to drive the X-ray source and detector to perform multi-angle tomographic scanning within a range of ±15° around the three-dimensional spatial position corresponding to each sampling point, acquiring 30 frames of high-resolution local projection data.
[0045] In one possible implementation, the step of performing pixel-level weighted fusion of the defect prediction confidence map, uncertainty map, and geometric prior weight map to generate a probability heatmap representing the priority region for supplementary sampling includes:
[0046] The pixel values of the defect prediction confidence map, uncertainty map, and geometric prior weight map are normalized.
[0047] Obtain a pixel-level weighted fusion function, calculate the significance value for each pixel, and the characteristics of the fusion function are the numerical values of the uncertainty map, the positive modulation defect prediction confidence map, the modulation result and the geometric prior weight map are weighted and summed to generate the probability heatmap.
[0048] Ensure the confidence level of defect prediction Uncertainty diagram and geometric prior weight graph The pixel values have all been scaled to the 0-1 range using a min-max normalization method. The significance value S(p) of each pixel p is calculated using the following pixel-level weighted fusion function: .in, To balance the weighting coefficients of model prediction and geometric prior, a range of 0.5 to 0.8 is preferred. For example, a value of 0.6 can be used, indicating a greater emphasis on the model's own predictions and uncertainties. The modulation intensity factor for uncertainty, preferably ranging from 0.5 to 2.0, for example, can be 1.2, to amplify the confidence enhancement effect of high uncertainty regions. This function enables the model to obtain higher significance scores for regions with both high confidence and high uncertainty, as well as regions located on key geometries, thereby generating a probability heatmap that indicates the priority of supplementary sampling.
[0049] In one possible implementation, obtaining the composite sampling guide vector field based on the probability heatmap, uncertainty map, and geometric prior weight map includes:
[0050] The negative gradient field of the probability heatmap is calculated as the fundamental irrotational component of the vector field, which is used to guide the sampling path to the highly significant region.
[0051] Calculate the structural tensor of the geometric prior weight graph, extract the minimum eigenvector of the tensor, construct a guiding component tangent to the key geometric structure with the minimum eigenvector and superimpose it into the vector field, so that the sampling path tends to align along the tangent direction of the key geometric structure;
[0052] The gradient of the uncertainty map is superimposed on the vector field as an additional attraction component, increasing the convergence of the vector field and making the sampling path denser in the high uncertainty region, thus enhancing the exploration sampling.
[0053] Let S, , These represent the probability heatmap, geometric prior weight map, and uncertainty map, respectively. The gradient of S is calculated using the Sobel operator. To obtain the fundamental irrotational components .calculate Structure tensor For each pixel, the 2×2 structure tensor matrix is decomposed into eigenvectors, and the eigenvectors corresponding to the smaller eigenvalues are extracted. The direction of this vector is the same as The contour lines are tangent to the key geometric structures, and tangential guiding components are constructed. .calculate gradient Construct additional attraction components The direction points in the direction of the fastest growth in uncertainty. The three elements are then fused into a composite sampling guide vector field through weighted summation. The weighting coefficient , , The preferred range is 0.5 to 1.5, for example, it can be set to 1.0, 0.8 and 0.6 respectively to ensure that the sampling path mainly flows to the high significance area, while conforming to the weld geometry and intensively exploring in the high uncertainty area.
[0054] In one possible implementation, the step of arranging two-dimensional supplementary sampling points along the integral curve of the composite sampling guide vector field, and controlling the ray imaging system to perform multi-angle scanning of the local three-dimensional space where each sampling point is located, to acquire a set of high-resolution local projection data, including:
[0055] Several pixels with values higher than a preset threshold are selected from the probability heatmap as seed points for the integral curve.
[0056] A numerical integration method is used to trace the integral curve along the composite sampling guide vector field starting from various sub-points;
[0057] On each integral curve, a series of two-dimensional supplementary sampling points are set up with a preset step size, and the two-dimensional supplementary sampling points are mapped to three-dimensional spatial sampling points in combination with the three-dimensional geometric prior model of the pipeline network.
[0058] For each three-dimensional spatial sampling point, the X-ray source and detector are controlled to translate along the pipe axis and rotate around the pipe's central axis. Within a preset angle range and at preset angle intervals, they are rotated and scanned, and the X-ray beam is aligned with the three-dimensional spatial sampling point to collect a set of high-resolution local projection data.
[0059] In the probability heatmap S, a significance threshold is set. ,all The pixels are first selected as candidate seed points. Non-maximum suppression is then applied to these candidate points with a suppression radius of 10 pixels to obtain sparsely distributed local peak points, which are then used as seed points for the integral curve. Starting from each seed point, a fourth-order Runge-Kutta method is used along the composite sampling guide vector field. Bidirectional integral tracing is performed to generate streamlines. On each streamline, a series of two-dimensional supplementary sampling points (u, v) are placed with an arc length of 10 pixels as the step size. Utilizing the known geometry of the X-ray source-detector and the CAD model of the pipe, each two-dimensional point (u, v) is mapped to a three-dimensional spatial sampling point (x, y, z) on the weld surface via ray tracing back projection. For each three-dimensional sampling point, the X-ray imaging system performs a local tomographic scan: the X-ray source and detector are linked, rotating around the pipe center as the axis of rotation, scanning within an angle range of -45° to +45°, with an angle step size of 1.5°, acquiring a total of 61 frames of high-resolution local projection data. During the scan, the X-ray beam center is always aligned with the target three-dimensional sampling point to ensure the quality and relevance of the acquired data.
[0060] S4, perform three-dimensional reconstruction on the high-resolution local projection data to generate local features; use the cross-attention fusion module to fuse the local features with the global features at the corresponding spatial location in the global feature map to generate an enhanced defect representation; and based on the enhanced defect representation, output the category, three-dimensional spatial location and size of the weld defect through the defect parameter decoder.
[0061] Using the ASTRAToolbox or TIGRE library, the SART algorithm (Simultaneous Algebraic Reconstruction) technique is applied to each set of high-resolution local projection data for 3D reconstruction, generating a 64×64×64 voxel local 3D feature volume. A cross-attention fusion module is constructed to extract features from this 3D feature volume through a small 3D convolutional neural network, and after flattening, it is mapped to a query vector Q through a torch.nn.Linear fully connected layer. Simultaneously, based on the center 2D coordinates of the current local sample, a 3×3 neighborhood feature block is cropped from the global feature map output by the first deep convolutional network. After flattening, it is passed through two torch.nn.Linear fully connected layers to generate a key vector K and a value vector V. Standard scaled dot product attention calculation is performed, i.e., the dot product of Q and the transpose of K is calculated, divided by the square root of the feature dimension for scaling, and the attention weights are obtained through the torch.nn.Softmax function. The weights are then weighted and summed with V to obtain enhanced local features that incorporate global context information. This enhanced defect representation is fed into a multilayer perceptron, or defect parameter decoder, consisting of multiple torch.nn.Linear layers and ReLU activation functions. This decoder has two branches: a classification branch that uses a softmax activation function to output the probability distribution of the defect category, and a regression branch that outputs six continuous values representing the center coordinates (x, y, z) and length, width, and height of the defect's 3D bounding box. During training, the classification branch uses the cross-entropy loss function, and the regression branch uses the smoothed L1 loss function.
[0062] In one possible implementation, the step of fusing the local features with the global features at corresponding spatial locations in the global feature map using a cross-attention fusion module to generate an enhanced defect representation includes:
[0063] The local features generated by the 3D reconstruction are input into a 3D convolutional encoder, and the local features are encoded into a query feature map;
[0064] In the global feature map, a local feature block of a preset size is extracted, centered on the two-dimensional coordinates corresponding to the two-dimensional supplementary sampling points.
[0065] The local feature blocks are input into two parallel projection networks with independent parameters to generate key feature maps and value feature maps, respectively.
[0066] By using a scaled dot product attention mechanism, a weighted context feature map is calculated based on the query feature map, key feature map, and value feature map. The context feature map is then fused with the features at the corresponding spatial locations in the original global feature map to obtain the enhanced defect representation.
[0067] The 3D convolutional encoder is a deep neural network. The network structure consists of four sequentially connected 3D convolutional layers, each followed by an activation function. All convolutional layers have a kernel size of 3×3×3 and a stride of 2, with the number of output channels for each layer being 16, 32, 64, and 128, respectively.
[0068] The input to the 3D convolutional encoder is a local 3D feature volume reconstructed using the FDK algorithm, with a data dimension of [missing information]. Specifically, it is 64×64×64.
[0069] The output of the three-dimensional convolutional encoder is an encoded query feature map Q with a data dimension of 1×1×128.
[0070] The projection network is a shallow neural network implemented with a single 1×1 convolutional layer. The scheme employs a parallel projection network with two parameters, used to generate the key feature map and the value feature map, respectively.
[0071] The input to the projection network is a local feature block extracted from the global feature map, with a data dimension of h×w×c, specifically 3×3×256.
[0072] The output of the projection network is a key feature map K and a value feature map V, both of which are projected to N×d, where the sequence length N=9 and the feature dimension d=128.
[0073] During the fusion process, the FDK algorithm is applied to the 61 frames of high-resolution local projection data to generate a 64×64×64 voxel local 3D feature volume, which is then processed by a 3D convolutional encoder to obtain the query Q. Simultaneously, on the 128×128×256 global feature map output by the first deep convolutional network, a 3×3×256 local feature block is extracted centered on the coordinates corresponding to the 2D supplementary sampling points, and processed by two projection networks to obtain the key K and value V. A scaling dot product attention mechanism is applied. Calculate the weighted context features. Then, fuse the calculated 1×1×128 context features with the original feature vector at the center of the global feature map using a residual connection. This results in an enhanced representation of the defects.
[0074] Throughout the process, through preliminary analysis of the initial ray images, three key information maps are generated in parallel: a preliminary defect prediction confidence map obtained by decoding from the first deep convolutional network; a geometric prior weight map of the key geometric structure of the high-brightness weld, generated using image processing techniques such as U-Net segmentation, Canny edge detection, and distance transformation; and an uncertainty map representing the cognitive uncertainty of the model, obtained by applying Monte Carlo Dropout to the first deep convolutional network and performing 50 random forward propagation statistical variances. (See [link to relevant documentation]). Figure 5 The three are combined using a weighted fusion function. Pixel-level fusion is performed to generate a probabilistic heatmap that integrates model predictions, model uncertainties, and physical priors, identifying the areas most in need of exploration. Based on the negative gradient of this heatmap, the structural tensor tangential field of the geometric prior map, and the negative gradient of the uncertainty map, a composite sampling guide vector field is constructed with weights of 1.0:0.8:0.6. The streamlines of this vector field can plan a supplementary sampling path that both faces high-risk areas and conforms to the weld structure, strengthening exploration in areas of greatest model uncertainty.
[0075] Peak points above a threshold of 0.85 are selected as seeds on the probability heatmap. A sampling curve is generated by integrating along the vector field using the fourth-order Runge-Kutta method, and two-dimensional supplementary sampling points are placed on the curve with a step size of 10 pixels. These two-dimensional points are mapped to the three-dimensional spatial coordinates of the weld surface using the three-dimensional model of the pipeline. For each three-dimensional sampling point, the X-ray imaging system performs a local high-resolution tomographic scan within the range of -45° to +45° with a step size of 1.5° to acquire a set of local projection data. After the acquired data is reconstructed in three dimensions using the FDK algorithm, the features are encoded into a query vector by a 3D convolutional network. At the same time, 3×3 feature blocks are extracted at the corresponding positions in the global feature map, and the feature blocks are projected into key-value vectors. Through a cross-attention mechanism, the three-dimensional local features (i.e., queries) are used and weighted and fused with two-dimensional global context information (i.e., keys and values) to generate an enhanced defect representation that highly condenses the local structure and global context. The enhanced representation is fed into the defect parameter decoder to achieve reliable output of the weld defect category, three-dimensional spatial location, and size.
[0076] Four sets of control experiments were set up to verify the effectiveness of the geometric prior, uncertainty map, composite sampling guided vector field, and cross-attention fusion module in the scheme.
[0077] The experimental conditions were as follows: the dataset used was the WD-2024 industrial weld radiographic dataset, containing 2000 training images and 500 test images; the hardware platform was an NVIDIA RTX 4090; and the evaluation metrics were mean accuracy of defect detection (mAP@0.5), mean localization error (ALE) in millimeters, and mean dimensional measurement error (MAE) in cubic millimeters. The experimental setup was as follows: the baseline scheme used only a preliminary defect confidence map for uniform supplementation sampling, followed by simple feature stitching for fusion; scheme one, based on the baseline scheme, used geometric priors and uncertainty maps to generate a probability heatmap; scheme two, based on scheme one, used composite sampling to guide the vector field for path planning; and scheme three, the complete scheme proposed in this paper, used a cross-attention fusion module based on scheme two.
[0078] The specific experimental data are as follows: The baseline scheme achieved an average defect detection accuracy (mAP@0.5) of 85.2%, an average positioning error (ALE) of 1.85 mm, and an average dimensional measurement error (MAE) of 2.50 cubic millimeters. Scheme 1 improved mAP@0.5 to 89.5%, reduced ALE to 1.52 mm, and reduced MAE to 2.15 cubic millimeters. Scheme 2 achieved mAP@0.5 of 92.1%, reduced ALE to 1.28 mm, and reduced MAE to 1.88 cubic millimeters. Scheme 3, the complete scheme, achieved mAP@0.5 of 96.7%, an ALE of 0.95 mm, and a MAE of 1.42 cubic millimeters.
[0079] Experimental results show that utilizing geometric priors and uncertainty maps enhances the targeting of supplementary sampling, concentrating sampling resources on regions where model predictions are ambiguous or structurally critical, improving mAP by 4.3 percentage points and demonstrating the effectiveness of multi-information fusion in generating heatmaps. By using a composite sampling-guided vector field, the sampling path can conform to the weld structure and actively explore high-uncertainty regions, resulting in higher quality local data and improved positioning and dimensional measurement accuracy, further reducing ALE and MAE by 0.24 mm and 0.27 cubic millimeters, respectively. Employing a cross-attention mechanism instead of simple feature stitching achieves deep fusion of local and global contextual features, enhancing the discriminative power of defect representation and optimizing mAP, ALE, and MAE, validating the superiority of these metrics as the core fusion module.
[0080] In the second embodiment, the present invention also proposes a pipeline weld flaw detection defect identification system, comprising the following modules:
[0081] The decoding module is used to acquire the initial ray image data of the pipeline weld, obtain the global feature map based on the first deep convolutional network, and obtain the preliminary defect prediction confidence map based on the global feature map.
[0082] The generation module is used to perform image processing on the initial ray image data to identify and extract the key geometric structure of the weld, and generate a geometric prior weight map representing the location of the key area; and to perform multiple random forward propagations on the same initial ray image data by applying Bayesian variational inference to the first deep convolutional network and statistically analyzing the dispersion of the prediction results to generate an uncertainty map.
[0083] The acquisition module is used to perform pixel-level weighted fusion of the defect prediction confidence map, uncertainty map, and geometric prior weight map to generate a probability heat map representing the priority region for supplementary sampling; and to obtain a composite sampling guidance vector field based on the probability heat map, uncertainty map, and geometric prior weight map; to deploy two-dimensional supplementary sampling points along the integral curve of the composite sampling guidance vector field, and to control the ray imaging system to perform multi-angle scanning of the local three-dimensional space where each sampling point is located, acquiring a set of high-resolution local projection data;
[0084] The output module is used to perform three-dimensional reconstruction on the high-resolution local projection data to generate local features; the cross-attention fusion module is used to fuse the local features with the global features at the corresponding spatial locations in the global feature map to generate an enhanced defect representation; and based on the enhanced defect representation, the defect parameter decoder outputs the category, three-dimensional spatial location and size of the weld defect.
[0085] In one possible implementation, the step of performing image processing on the initial ray image data to identify and extract the key geometric structure of the weld, and generating a geometric prior weight map representing the location of the key region, includes:
[0086] A semantic segmentation network was used to process the initial ray image data to distinguish the weld area from the base material area;
[0087] Within the segmented weld area, edge detection algorithms are used to extract the edge contours of the weld root, fusion line, and bevel.
[0088] The extracted edge contours are subjected to morphological skeletonization to obtain a structural centerline with a single pixel width.
[0089] The distance from each pixel within the weld area to the nearest structural centerline is calculated, and the distance value is mapped to a weight using a preset kernel function to generate the geometric prior weight map, where the closer the distance, the higher the weight.
[0090] In one possible implementation, the step of applying Bayesian variational inference to a first deep convolutional network, performing multiple random forward propagations on the same initial ray image data, and statistically analyzing the dispersion of the prediction results to generate an uncertainty map includes:
[0091] Monte Carlo Dropout is used as a random regularization method in a specified network layer of the first deep convolutional network;
[0092] Using the same initial ray image data as input, the random forward propagation process is repeated a preset number of times to obtain a set of defect prediction results with differences.
[0093] For each pixel in the image, the statistical variance of that pixel in the set of prediction results is calculated, and the variance values of all pixels are combined into a two-dimensional image as the uncertainty map.
[0094] In one possible implementation, the step of performing pixel-level weighted fusion of the defect prediction confidence map, uncertainty map, and geometric prior weight map to generate a probability heatmap representing the priority region for supplementary sampling includes:
[0095] The pixel values of the defect prediction confidence map, uncertainty map, and geometric prior weight map are normalized.
[0096] Obtain a pixel-level weighted fusion function, calculate the significance value for each pixel, and the characteristics of the fusion function are the numerical values of the uncertainty map, the positive modulation defect prediction confidence map, the modulation result and the geometric prior weight map are weighted and summed to generate the probability heatmap.
[0097] In one possible implementation, obtaining the composite sampling guide vector field based on the probability heatmap, uncertainty map, and geometric prior weight map includes:
[0098] The negative gradient field of the probability heatmap is calculated as the fundamental irrotational component of the vector field, which is used to guide the sampling path to the highly significant region.
[0099] Calculate the structural tensor of the geometric prior weight graph, extract the minimum eigenvector of the tensor, construct a guiding component tangent to the key geometric structure with the minimum eigenvector and superimpose it into the vector field, so that the sampling path tends to align along the tangent direction of the key geometric structure;
[0100] The gradient of the uncertainty map is superimposed on the vector field as an additional attraction component, increasing the convergence of the vector field and making the sampling path denser in the high uncertainty region, thus enhancing the exploration sampling.
[0101] In one possible implementation, the step of arranging two-dimensional supplementary sampling points along the integral curve of the composite sampling guide vector field, and controlling the ray imaging system to perform multi-angle scanning of the local three-dimensional space where each sampling point is located, to acquire a set of high-resolution local projection data, including:
[0102] Several pixels with values higher than a preset threshold are selected from the probability heatmap as seed points for the integral curve.
[0103] A numerical integration method is used to trace the integral curve along the composite sampling guide vector field starting from various sub-points;
[0104] On each integral curve, a series of two-dimensional supplementary sampling points are set up with a preset step size, and the two-dimensional supplementary sampling points are mapped to three-dimensional spatial sampling points in combination with the three-dimensional geometric prior model of the pipeline network.
[0105] For each three-dimensional spatial sampling point, the X-ray source and detector are controlled to translate along the pipe axis and rotate around the pipe's central axis. Within a preset angle range and at preset angle intervals, they are rotated and scanned, and the X-ray beam is aligned with the three-dimensional spatial sampling point to collect a set of high-resolution local projection data.
[0106] In one possible implementation, the step of fusing the local features with the global features at corresponding spatial locations in the global feature map using a cross-attention fusion module to generate an enhanced defect representation includes:
[0107] The local features generated by the 3D reconstruction are input into a 3D convolutional encoder, and the local features are encoded into a query feature map;
[0108] In the global feature map, a local feature block of a preset size is extracted, centered on the two-dimensional coordinates corresponding to the two-dimensional supplementary sampling points.
[0109] The local feature blocks are input into two parallel projection networks with independent parameters to generate key feature maps and value feature maps, respectively.
[0110] By using a scaled dot product attention mechanism, a weighted context feature map is calculated based on the query feature map, key feature map, and value feature map. The context feature map is then fused with the features at the corresponding spatial locations in the original global feature map to obtain the enhanced defect representation.
[0111] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0112] The functional modules shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0113] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A method for identifying defects in pipeline weld seams, characterized in that, include: Initial radiographic image data of pipeline welds are acquired, a global feature map is obtained based on the first deep convolutional network, and a preliminary defect prediction confidence map is obtained based on the global feature map. The initial ray image data is processed to identify and extract the key geometric structure of the weld, generating a geometric prior weight map representing the location of the key area; and by applying Bayesian variational inference to the first deep convolutional network, multiple random forward propagations are performed on the same initial ray image data and the dispersion of the prediction results is statistically analyzed to generate an uncertainty map. The defect prediction confidence map, uncertainty map, and geometric prior weight map are pixel-level weighted fusion to generate a probability heatmap representing the priority region for supplementary sampling; and a composite sampling guidance vector field is obtained based on the probability heatmap, uncertainty map, and geometric prior weight map; two-dimensional supplementary sampling points are arranged along the integral curve of the composite sampling guidance vector field, and the X-ray imaging system is controlled to perform multi-angle scanning of the local three-dimensional space where each sampling point is located, acquiring a set of high-resolution local projection data; The high-resolution local projection data is reconstructed in three dimensions to generate local features; the local features are fused with the global features at the corresponding spatial locations in the global feature map using a cross-attention fusion module to generate an enhanced defect representation; and based on the enhanced defect representation, the category, three-dimensional spatial location, and size of the weld defect are output through a defect parameter decoder.
2. The method according to claim 1, characterized in that, The step of image processing and identification of the initial ray image data, extracting the key geometric structure of the weld, and generating a geometric prior weight map representing the location of the key area includes: A semantic segmentation network was used to process the initial ray image data to distinguish the weld area from the base material area; Within the segmented weld area, edge detection algorithms are used to extract the edge contours of the weld root, fusion line, and bevel. The extracted edge contours are subjected to morphological skeletonization to obtain a structural centerline with a single pixel width. The distance from each pixel within the weld area to the nearest structural centerline is calculated, and the distance value is mapped to a weight using a preset kernel function to generate the geometric prior weight map, where the closer the distance, the higher the weight.
3. The method according to claim 1, characterized in that, The process of applying Bayesian variational inference to a first deep convolutional network, performing multiple random forward propagations on the same initial ray image data, and statistically analyzing the dispersion of the prediction results to generate an uncertainty map includes: Monte Carlo Dropout is used as a random regularization method in a specified network layer of the first deep convolutional network; Using the same initial ray image data as input, the random forward propagation process is repeated a preset number of times to obtain a set of defect prediction results with differences. For each pixel in the image, the statistical variance of that pixel in the set of prediction results is calculated, and the variance values of all pixels are combined into a two-dimensional image as the uncertainty map.
4. The method according to claim 1, characterized in that, The step of performing pixel-level weighted fusion of the defect prediction confidence map, uncertainty map, and geometric prior weight map to generate a probability heatmap representing the priority region for supplementary sampling includes: The pixel values of the defect prediction confidence map, uncertainty map, and geometric prior weight map are normalized. Obtain a pixel-level weighted fusion function, calculate the significance value for each pixel, and the characteristics of the fusion function are the numerical values of the uncertainty map, the positive modulation defect prediction confidence map, the modulation result and the geometric prior weight map are weighted and summed to generate the probability heatmap.
5. The method according to claim 1, characterized in that, The step of obtaining the composite sampling guiding vector field based on the probability heatmap, uncertainty map, and geometric prior weight map includes: The negative gradient field of the probability heatmap is calculated as the fundamental irrotational component of the vector field, which is used to guide the sampling path to the highly significant region. Calculate the structural tensor of the geometric prior weight graph, extract the minimum eigenvector of the tensor, construct a guiding component tangent to the key geometric structure with the minimum eigenvector and superimpose it into the vector field, so that the sampling path tends to align along the tangent direction of the key geometric structure; The gradient of the uncertainty map is superimposed on the vector field as an additional attraction component, increasing the convergence of the vector field and making the sampling path denser in the high uncertainty region, thus enhancing exploratory sampling.
6. The method according to claim 1 or 5, characterized in that, The method involves deploying two-dimensional supplementary sampling points along the integral curve of the composite sampling guide vector field, and controlling the ray imaging system to perform multi-angle scanning of the local three-dimensional space where each sampling point is located, acquiring a set of high-resolution local projection data, including: Several pixels with values higher than a preset threshold are selected from the probability heatmap as seed points for the integral curve. A numerical integration method is used to trace the integral curve along the composite sampling guide vector field starting from various sub-points; On each integral curve, a series of two-dimensional supplementary sampling points are set up with a preset step size, and the two-dimensional supplementary sampling points are mapped to three-dimensional spatial sampling points in combination with the three-dimensional geometric prior model of the pipeline network. For each three-dimensional spatial sampling point, the X-ray source and detector are controlled to translate along the pipe axis and rotate around the pipe's central axis. Within a preset angle range and at preset angle intervals, they are rotated and scanned, and the X-ray beam is aligned with the three-dimensional spatial sampling point to collect a set of high-resolution local projection data.
7. The method according to claim 1, characterized in that, The method of fusing the local features with the global features at corresponding spatial locations in the global feature map using the cross-attention fusion module to generate an enhanced defect representation includes: The local features generated by the 3D reconstruction are input into a 3D convolutional encoder, and the local features are encoded into a query feature map; In the global feature map, a local feature block of a preset size is extracted, centered on the two-dimensional coordinates corresponding to the two-dimensional supplementary sampling points. The local feature blocks are input into two parallel projection networks with independent parameters to generate key feature maps and value feature maps, respectively. By using a scaled dot product attention mechanism, a weighted context feature map is calculated based on the query feature map, key feature map, and value feature map. The context feature map is then fused with the features at the corresponding spatial locations in the original global feature map to obtain the enhanced defect representation.
8. A defect identification system for pipeline weld seams, characterized in that, Includes the following modules: The decoding module is used to acquire the initial ray image data of the pipeline weld, obtain the global feature map based on the first deep convolutional network, and obtain the preliminary defect prediction confidence map based on the global feature map. The generation module is used to perform image processing on the initial ray image data to identify and extract the key geometric structure of the weld, and generate a geometric prior weight map representing the location of the key area; and to perform multiple random forward propagations on the same initial ray image data by applying Bayesian variational inference to the first deep convolutional network and statistically analyzing the dispersion of the prediction results to generate an uncertainty map. The acquisition module is used to perform pixel-level weighted fusion of the defect prediction confidence map, uncertainty map, and geometric prior weight map to generate a probability heat map representing the priority region for supplementary sampling; and to obtain a composite sampling guidance vector field based on the probability heat map, uncertainty map, and geometric prior weight map; to deploy two-dimensional supplementary sampling points along the integral curve of the composite sampling guidance vector field, and to control the ray imaging system to perform multi-angle scanning of the local three-dimensional space where each sampling point is located, acquiring a set of high-resolution local projection data; The output module is used to perform three-dimensional reconstruction of the high-resolution local projection data to generate local features; The local features are fused with the global features at the corresponding spatial locations in the global feature map using a cross-attention fusion module to generate an enhanced defect representation; and based on the enhanced defect representation, the category, three-dimensional spatial location, and size of the weld defect are output through a defect parameter decoder.
9. The system according to claim 8, characterized in that, The step of image processing and identification of the initial ray image data, extracting the key geometric structure of the weld, and generating a geometric prior weight map representing the location of the key area includes: A semantic segmentation network was used to process the initial ray image data to distinguish the weld area from the base material area; Within the segmented weld area, edge detection algorithms are used to extract the edge contours of the weld root, fusion line, and bevel. The extracted edge contours are subjected to morphological skeletonization to obtain a structural centerline with a single pixel width. The distance from each pixel within the weld area to the nearest structural centerline is calculated, and the distance value is mapped to a weight using a preset kernel function to generate the geometric prior weight map, where the closer the distance, the higher the weight.
10. The system according to claim 8, characterized in that, The process of applying Bayesian variational inference to a first deep convolutional network, performing multiple random forward propagations on the same initial ray image data, and statistically analyzing the dispersion of the prediction results to generate an uncertainty map includes: Monte Carlo Dropout is used as a random regularization method in a specified network layer of the first deep convolutional network; Using the same initial ray image data as input, the random forward propagation process is repeated a preset number of times to obtain a set of defect prediction results with differences. For each pixel in the image, the statistical variance of that pixel in the set of prediction results is calculated, and the variance values of all pixels are combined into a two-dimensional image as the uncertainty map.