Weld defect recognition method and device based on double-path fusion, equipment and medium

By employing a dual-path fusion method for weld defect identification, which combines 3D voxel data processing and deep learning networks, the problem of balancing detection sensitivity and false detection rate in traditional methods is solved, achieving efficient and accurate weld defect identification.

CN122859586BActive Publication Date: 2026-11-06GUANGDONG INNOVATION CENTER OF INTELLIGENT ULTRASOUND IMAGING EQUIPMENT CO LTD +2
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202611340048.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-09-01
Publication Date
2026-11-06
Estimated Expiration
2046-09-01

AI Technical Summary

Technical Problem

Traditional weld defect identification methods struggle to balance detection sensitivity and false detection rate, and deep learning models suffer from limitations in terms of computational resource consumption and result stability.

Method used

By employing a dual-path fusion approach, combining a phased array ultrasonic probe and a deep learning network, and through three-dimensional voxel data processing and multi-stage spatial merging, combined with AI confidence set and spatial consistency matching, automated identification and quantitative assessment of weld defects are achieved.

Benefits of technology

While maintaining detection sensitivity, it significantly reduces the false detection rate, improves the accuracy and stability of weld defect identification, and has engineering compliance and intelligent discrimination capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122859586B_ABST
    Figure CN122859586B_ABST
Patent Text Reader

Abstract

The present application relates to the field of weld ultrasonic nondestructive testing, and discloses a weld defect identification method, device, equipment and medium based on double-path fusion, which comprises the following steps: using a phased array probe to scan along the weld, stacking multiple B-scan results into three-dimensional voxel data; using union-find connected component labeling and marker three-dimensional watershed segmentation, combining multi-stage merging to output a candidate defect set; taking artificial atlas as supervision, using StarNet backbone network and AIFI attention module to extract slices for each candidate defect and perform multi-scale feature fusion and global self-attention modeling to output the confidence of each AI candidate; matching the candidate defect and the AI candidate according to the spatial position and the overlap degree, and adding the candidate defect that meets the existing matching AI candidate, the confidence being greater than or equal to a threshold, and the spatial overlap degree being greater than or equal to a threshold to the final defect set. The present application can effectively reduce the false detection rate while ensuring the sensitivity of weld detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of ultrasonic nondestructive testing of welds, and in particular to a method, apparatus, equipment and medium for weld defect identification based on dual-path fusion. Background Technology

[0002] Traditional frame-by-frame thresholding methods based on national standards (such as the -6dB method and half-wave height method) can locate defects and measure their dimensions, but they lack utilization of the spatial continuity between scanning layers. This can easily lead to the same defect being segmented into multiple regions or repeatedly detected in different scanning frames due to echo fluctuations. Furthermore, the internal structure of welds is complex, and some structural echoes closely resemble the characteristics of actual defects. Relying solely on thresholds can result in false alarms, while relying solely on manual image evaluation is inefficient and susceptible to variations in human experience. In recent years, AI-based recognition methods, such as deep learning, can learn from human image evaluation experience to intelligently distinguish between genuine and false defects. However, in the quantitative defect assessment stage, they generally suffer from high computational resource consumption, poor result stability, and the tendency for single models to miss detections.

[0003] In summary, there is an urgent need to find a new method for weld defect identification to ensure detection sensitivity while effectively reducing the false detection rate. Summary of the Invention

[0004] This invention provides a method, apparatus, computer equipment, and storage medium for weld defect identification based on dual-path fusion, so as to effectively reduce the false detection rate while ensuring detection sensitivity.

[0005] A weld defect identification method based on dual-path fusion includes:

[0006] A phased array ultrasonic probe and encoder are used to perform longitudinal vertical scanning along the weld seam, and the results of multiple B-scans are stacked into three-dimensional voxel data according to the scanning position.

[0007] Based on the disjoint set-based 3D connected component labeling and the marker-based 3D watershed segmentation, combined with multi-stage spatial merging, the 3D voxel data is subjected to standard threshold screening, candidate voxel generation, adhesion defect separation and region optimization, and a candidate defect set is output.

[0008] Using manually evaluated maps as supervised samples, the StarNet backbone network combined with the AIFI attention module is used to extract continuous slices along the scanning direction for each candidate defect in the candidate defect set, and perform multi-scale feature fusion and global self-attention modeling to output an AI confidence set; the AI ​​confidence set includes each AI candidate and its corresponding true or false confidence.

[0009] Based on spatial location and regional overlap, the candidate defect set and the AI ​​confidence set are spatially consistent and matched. Candidate defects that meet the dual-path joint confirmation conditions are added to the final defect set. The dual-path joint confirmation conditions include: the candidate defect has a matching AI candidate, the truth or false confidence of the AI ​​candidate is not less than a preset confidence threshold, and the spatial overlap with the AI ​​candidate is not less than a preset overlap threshold.

[0010] Optionally, the three-dimensional connected component labeling based on disjoint-set data structure and the three-dimensional watershed segmentation based on labeled points, combined with multi-stage spatial merging, perform standard threshold initial screening, candidate voxel generation, adhesion defect separation, and region optimization on the three-dimensional voxel data, outputting a candidate defect set, including:

[0011] The three-dimensional voxel data were initially screened using an evaluation line as a threshold to obtain a set of suspected defective voxels;

[0012] The disjoint-set data structure algorithm is used to perform three-dimensional connected component labeling on the suspected defective voxel set to generate initial connected components;

[0013] A three-dimensional watershed algorithm based on marker points is used to separate adhesion defects in the initial connected domain to obtain a three-dimensional segmentation label map.

[0014] Perform multi-stage spatial merging on the three-dimensional segmentation label map to output a candidate defect set.

[0015] Optionally, the step of using a marker-based 3D watershed algorithm to separate adhesion defects in the initial connected component to obtain a 3D segmentation label map includes:

[0016] Construct the grayscale gradient map of the three-dimensional voxel data;

[0017] Based on the grayscale gradient map, local amplitude extreme points are extracted within each initial connected domain to form a set of marker points;

[0018] Using the marked points in the set of marked points as initial seeds, the unmarked voxels are expanded in regions according to the principle of minimizing the gradient cost in their neighborhoods to obtain a three-dimensional segmentation label map; wherein, for a voxel p to be assigned, if there is a voxel with an assigned label in its three-dimensional neighborhood, the voxel p to be assigned inherits the label corresponding to the neighborhood with the minimum gradient cost.

[0019] Optionally, the step of performing multi-stage spatial merging on the three-dimensional segmented label map to output a candidate defect set includes:

[0020] Based on the three-dimensional segmentation label map, regions originating from the same initial connected region are merged to obtain the first merging result;

[0021] Based on the first merging result, cross-regional connectivity analysis is re-executed to re-establish associations for candidate regions that cross regional boundaries and maintain spatial continuity, resulting in the second merging result.

[0022] Based on the second merging result, redundant regions are removed according to the bounding box containment relationship to obtain the third merging result;

[0023] Based on the third merging result, and combining the peak position, bounding box distance, and voxel set, spatial fusion is performed on candidate regions whose Euclidean distance from the bounding box center point is less than a preset threshold, and a candidate defect set is output.

[0024] Optionally, using manually evaluated maps as supervised samples, and employing a StarNet backbone network combined with an AIFI attention module, for each candidate defect in the candidate defect set, continuous slices are extracted along the scanning direction, and multi-scale feature fusion and global self-attention modeling are performed to output an AI confidence set, including:

[0025] For each candidate defect in the candidate defect set, continuous slices within its bounding box are extracted along the scanning direction and uniformly cropped to a fixed size to form the network input tensor;

[0026] The network input tensor is input into the StarNet backbone network, and features at different levels are extracted and fused at multiple scales to obtain multi-scale fused features.

[0027] An AIFI attention module is introduced onto the highest layer features of the StarNet backbone network. Global self-attention modeling is performed through the multi-head self-attention mechanism of the AIFI attention module to obtain attention-enhanced features.

[0028] Based on the attention enhancement features, the probability that each candidate defect belongs to a real defect is output, and an AI confidence set is generated; the AI ​​confidence set includes each AI candidate and its corresponding true / false confidence.

[0029] Optionally, the step of performing spatial consistency matching between the candidate defect set and the AI ​​confidence set based on spatial location and regional overlap, and adding candidate defects that meet the dual-path joint confirmation condition to the final defect set, includes:

[0030] For each candidate defect in the candidate defect set, find the AI ​​candidate in the AI ​​confidence set whose intersection-union ratio of its 3D bounding box or the Euclidean distance of its center point meets a preset threshold. When there are multiple AI candidates, select the AI ​​candidate with the highest Dice coefficient as the matching object.

[0031] For each candidate defect, if there is a matching AI candidate, and the confidence level of the AI ​​candidate is not less than the preset confidence threshold, and the spatial overlap between the candidate defect and the AI ​​candidate is not less than the preset overlap threshold, then the candidate defect is added to the final defect set.

[0032] For each defect in the final defect set, the three-dimensional bounding box, peak position and voxel set of the candidate defects corresponding to that defect are fused together with the confidence level and morphology parameters of the AI ​​candidates. The final coordinate position, true size and morphology parameters of the defect are output according to the preset standard.

[0033] For candidate defects that do not meet the dual-path joint confirmation conditions, they are marked as pending review and prompted for manual evaluation. The review results are then written back to the database.

[0034] Optionally, the method adopts a side-side AI deployment model, including:

[0035] The edge AI performs scanning, outputs candidate defect set, outputs AI confidence set, and performs spatial consistency matching locally to generate the edge AI preliminary judgment result.

[0036] The initial AI judgment results of the side are manually reviewed and confirmed, and the map and results are temporarily stored locally and uploaded to the cloud in batches after the network is restored.

[0037] And / or,

[0038] The method adopts a cloud-based AI deployment model, including:

[0039] Upload the three-dimensional voxel data to the cloud AI;

[0040] The cloud-based AI executes the output of the candidate defect set, the output of the AI ​​confidence set, and the spatial consistency matching to output the cloud-based AI's initial judgment result.

[0041] The initial judgment results of the cloud AI are manually reviewed, and the reviewed results are sent back to the cloud AI for archiving and export of the detection report. The cloud then performs secondary training on the full historical map to continuously improve the model's capabilities.

[0042] A weld defect identification device based on dual-path fusion includes:

[0043] The data acquisition and 3D voxel construction module is used to complete longitudinal vertical scanning along the weld seam using a phased array ultrasonic probe and encoder, and stack the results of multiple B-scans according to the scanning position to form 3D voxel data.

[0044] The 3D detection path module is used for 3D connected component labeling based on disjoint set and 3D watershed segmentation based on label points. Combined with multi-stage spatial merging, it performs standard threshold screening, candidate voxel generation, adhesion defect separation and region optimization on the 3D voxel data and outputs a candidate defect set.

[0045] The intelligent decision path module uses manually evaluated maps as supervised samples and employs a StarNet backbone network combined with an AIFI attention module to extract continuous slices along the scanning direction for each candidate defect in the candidate defect set, perform multi-scale feature fusion and global self-attention modeling, and output an AI confidence set; the AI ​​confidence set includes each AI candidate and its corresponding true / false confidence.

[0046] The fusion judgment module is used to perform spatial consistency matching between the candidate defect set and the AI ​​confidence set based on spatial location and regional overlap, and add candidate defects that meet the dual-path joint confirmation conditions to the final defect set; the dual-path joint confirmation conditions include: the candidate defect has a matching AI candidate, and the authenticity confidence of the AI ​​candidate is not less than a preset confidence threshold, and the spatial overlap with the AI ​​candidate is not less than a preset overlap threshold.

[0047] A computer device includes 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 above-described weld defect identification method based on dual-path fusion.

[0048] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described weld defect identification method based on dual-path fusion.

[0049] The aforementioned weld defect identification method, device, computer equipment, and storage medium based on dual-path fusion, through the parallel execution and spatial consistency association fusion of the three-dimensional detection path and the intelligent judgment path, effectively suppresses false alarms caused by complex microstructure echoes while maintaining the detection sensitivity of national standards. It solves the problems of repeated detection and dimensional inconsistencies caused by the lack of interlayer spatial continuity in traditional frame-by-frame thresholding methods, as well as the shortcomings of single AI models in quantitative defect assessment, such as high computational cost and poor result stability. The final output defects are jointly confirmed by both paths, combining engineering compliance with intelligent discrimination capabilities, significantly improving the accuracy, stability, and engineering applicability of weld defect identification. This invention can effectively reduce the false detection rate while ensuring weld detection sensitivity. Attached Figure Description

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

[0051] Figure 1 This is a flowchart of a weld defect identification method based on dual-path fusion in one embodiment of the present invention;

[0052] Figure 2 This is a schematic diagram of the geometric parameters and burial location of a typical weld defect in one embodiment of the present invention;

[0053] Figure 3 This is a schematic diagram of a weld defect identification device based on dual-path fusion in one embodiment of the present invention;

[0054] Figure 4 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0055] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0056] In one embodiment, such as Figure 1 As shown, a weld defect identification method based on dual-path fusion is provided, including the following steps S10~S40.

[0057] S10. Use a phased array ultrasonic probe and encoder to complete a longitudinal vertical scan along the weld seam direction, and stack the multi-frame B-scan results into three-dimensional voxel data according to the scan position.

[0058] S20. Based on the disjoint set, the three-dimensional connected component labeling and the three-dimensional watershed segmentation based on the label points are combined with multi-stage spatial merging. The three-dimensional voxel data is then subjected to standard threshold screening, candidate voxel generation, adhesion defect separation and region optimization to output a candidate defect set.

[0059] S30. Using manually evaluated maps as supervised samples, the StarNet backbone network combined with the AIFI attention module is used to extract continuous slices along the scanning direction for each candidate defect in the candidate defect set and perform multi-scale feature fusion and global self-attention modeling to output an AI confidence set; the AI ​​confidence set includes each AI candidate and its corresponding true / false confidence.

[0060] S40. Based on spatial location and regional overlap, perform spatial consistency matching between the candidate defect set and the AI ​​confidence set, and add candidate defects that meet the dual-path joint confirmation conditions to the final defect set; the dual-path joint confirmation conditions include: the candidate defect has a matching AI candidate, and the confidence of the AI ​​candidate is not less than a preset confidence threshold, and the spatial overlap with the AI ​​candidate is not less than a preset overlap threshold.

[0061] Understandably, this embodiment involves using phased array ultrasonic testing equipment to perform three-dimensional scanning of welds in industrial components such as pressure equipment, pipelines, and pressure vessels. By stacking multiple frames of B-scan results into three-dimensional voxel data, and combining three-dimensional spatial standard defect detection based on national standards with intelligent judgment based on deep learning-based human image evaluation knowledge learning, the automatic identification, location, and quantitative evaluation of internal defects in welds can be achieved.

[0062] Specifically, a phased array ultrasonic probe (such as a 5 MHz, 32-element probe, model 5.0L32-0.5-10) can be used in conjunction with an encoder (such as PES-02) and a phased array ultrasonic imaging detector (such as SyncScan32P) to perform longitudinal vertical scanning along the weld seam. During the scanning process, a B-scan image is acquired for each step the probe moves, and the encoder records the corresponding scanning position. All B-scan results are stacked in chronological order of scanning positions to form three-dimensional voxel data. Where x and y are the image plane coordinates (corresponding to the transverse and depth directions of the ultrasound, respectively), and z is the scan frame number along the scanning direction. This three-dimensional voxel data completely preserves the echo amplitude information of each point inside the weld in three-dimensional space, providing a data foundation for subsequent multidimensional analysis.

[0063] Three-dimensional engineering analysis based on national standards was performed on the three-dimensional voxel data. First, using the evaluation line specified in NB / T 47013.15—2021 as a threshold, all voxels exceeding the evaluation line were screened, forming a set of suspected defect voxels, F1. Next, the Union-Find algorithm was used to label the three-dimensional connected components of F1: traversing the 26 neighborhoods of each voxel (i.e., all 26 adjacent voxels in three-dimensional space sharing faces, edges, or vertices with the voxel), voxels with connectivity were merged into the same label, and a path compression strategy was used to accelerate label remapping to obtain the initial connected components. Since the initial connected components are prone to adhesion when multiple defects in the weld are close together, a three-dimensional watershed algorithm based on marker points was further used for segmentation: first, a gradient map of the grayscale data was constructed. Regions with large gradient values ​​correspond to defect boundaries with drastic amplitude changes; then, local amplitude extrema points are extracted within each initial connected region as a set of marker points. Using these marked points as seeds, region expansion is performed according to the rule that "the voxel to be assigned inherits the label of the neighborhood with the minimum gradient cost in its 26-neighborhood," i.e. Where p represents the voxel currently being processed for allocation. Describes the 26-neighborhood set of voxel p. This represents the gradient magnitude of the neighborhood voxel q. This involves finding the neighborhood voxel with the minimum gradient cost within the 26-neighborhood of voxel p. The final result is a 3D segmentation label map. Voxels with the same label belong to the same defect region. After segmentation, a multi-stage spatial merging process is performed: first, regions originating from the same initial connected component are merged; then, cross-regional connected component analysis is re-performed to establish spatial continuity across region boundaries; subsequently, redundant regions are removed based on bounding box inclusion relationships; finally, candidate regions with relatively close proximity are spatially fused by combining peak positions, bounding box distances, and voxel sets to output a candidate defect set. Each candidate defect contains a 3D bounding box. Peak position voxel mask and amplitude confidence .

[0064] Using manually evaluated ultrasound atlases as supervised samples, a lightweight convolutional neural network, StarNet, was trained, and an AIFI (Attention-based Intra-scale Feature Interaction) module was introduced to enhance global semantic modeling capabilities. This was applied to the candidate defect set. Each candidate defect in Continuous slices within the bounding box are extracted along the scanning direction (z-axis) and uniformly cropped to a fixed size (e.g., 64×64 pixels) to form the network input tensor, thus preserving the temporal context information of the defect along the scanning direction. The network input tensor is then fed into the StarNet backbone network, and features from different levels are fused at multiple scales: shallow features retain texture details and edge information, facilitating the detection of small-sized, weak-echo defects; deeper features have a larger receptive field and can learn abstract semantics. Fusion is achieved through 1×1 convolution to unify the channel dimension, nearest-neighbor interpolation to progressively upsample high-level features, and a convolutional fusion module. An AIFI module is introduced on the highest-level features to unfold the two-dimensional feature map into a sequence and add two-dimensional sinusoidal positional encoding. The correlation between different positions is calculated through a multi-head self-attention mechanism, i.e.: In this model, Q, K, and V are the query matrix, key matrix, and value matrix obtained from the input features through linear mapping, respectively. d represents the feature dimension of a single attention head. The Softmax function is used to calculate the attention weights between different locations, ensuring higher attention is given to the defect region while suppressing background noise and tissue texture. After residual connections, a feedforward network, and normalization, the model outputs the probability that the current candidate region belongs to a true defect, i.e., the AI ​​confidence score. Finally, the AI ​​confidence set is obtained. Each candidate defect is assigned a confidence level derived from human evaluation knowledge.

[0065] The fusion judgment module receives the candidate defect set. AI confidence set This involves performing spatial consistency association and dual-path joint confirmation. Firstly, for... Each candidate defect in ,exist Find the intersection and union of its 3D bounding box ( AI candidates whose center point Euclidean distance meets a preset threshold are selected; when multiple matches exist, the AI ​​candidate with the highest Dice coefficient is selected as the matching object. Here, the Dice coefficient is an indicator that measures the spatial overlap between the 3D detection region and the AI's region of interest, and its calculation formula is... Let A represent the set of voxels of candidate defects output by the 3D detection path, and B represent the set of voxels of AI candidates matching the candidate defect in the intelligent judgment path. Then, the judgment is made. Does the following dual-path joint confirmation condition simultaneously meet: ① There is a successfully matched AI candidate; ② The confidence level of the AI ​​candidate's authenticity? Not less than the preset confidence threshold (Default 0.7, can be calibrated on-site); ③ This AI candidate and Spatial overlap (Dice coefficient) is not less than the preset overlap threshold. (Default 0.6). Candidate defects that meet the conditions are added to the final defect set. For candidates that fail the joint confirmation, the system automatically marks them as "pending review" and prompts for manual evaluation. The review results are then written back to the database as training samples for subsequent model iterations. Finally, for... For each defect, the three-dimensional bounding box, peak position and voxel set given by the three-dimensional detection path, as well as the confidence level and morphological parameters (aspect ratio, area and roundness) given by the intelligent judgment path are integrated. Based on NB / T 47013.15—2021, the final coordinate position, true size and morphological parameters of the defect are output to generate inspection results that can be used for engineering delivery.

[0066] This embodiment achieves parallel execution and spatial consistency association fusion of the three-dimensional detection path and the intelligent judgment path, effectively suppressing false alarms caused by complex tissue echoes while maintaining the detection sensitivity of national standards. It solves the problems of repeated detection and inconsistent dimensions caused by the lack of interlayer spatial continuity in the traditional frame-by-frame threshold method, as well as the defects of single AI models in quantitative defect assessment, such as high computational consumption and poor result stability. The final output defects are all confirmed by dual paths, combining engineering compliance and intelligent discrimination capabilities, significantly improving the accuracy, stability and engineering applicability of weld defect identification.

[0067] Optionally, step S20, namely the three-dimensional connected component labeling based on disjoint-set data structure and the three-dimensional watershed segmentation based on labeled points, combined with multi-stage spatial merging, performs standard threshold screening, candidate voxel generation, adhesion defect separation, and region optimization on the three-dimensional voxel data, outputting a candidate defect set, including:

[0068] S201. The three-dimensional voxel data is initially screened using the evaluation line as a threshold to obtain a set of suspected defective voxels.

[0069] S202. The disjoint-set data structure algorithm is used to perform three-dimensional connected component labeling on the suspected defective voxel set to generate an initial connected component.

[0070] S203. The initial connected domain is separated for adhesion defects using a marker-based three-dimensional watershed algorithm to obtain a three-dimensional segmentation label map.

[0071] S204. Perform multi-stage spatial merging on the three-dimensional segmentation label map and output a candidate defect set.

[0072] Understandably, in obtaining three-dimensional voxel data Subsequently, in accordance with the national standard NB / T 47013.15—2021, an initial screening was conducted using the evaluation threshold. The evaluation threshold is the lowest echo amplitude threshold used in the national standard to determine suspected defects; all voxels with echo amplitudes exceeding this threshold are considered potential defect signals. Through voxel-by-voxel comparison, all voxels exceeding the evaluation threshold were selected, forming a set of suspected defect voxels. This set excludes a large number of noise voxels below the threshold, significantly narrowing the scope of subsequent analysis while ensuring that no potentially defective signal regions are missed.

[0073] For the suspected defective voxel set F1, the Union-Find algorithm is used to perform 3D connected component labeling. Union-Find is an efficient data structure specifically designed to manage the dynamic connectivity of elements. Its core operations include "Find" (determining the set to which an element belongs) and "Union" (merging two sets into one). Specifically, it iterates through the 26 neighborhoods of each voxel in F1 (i.e., all 26 adjacent voxels in 3D space that share faces, edges, or vertices with that voxel). If two adjacent voxels both belong to F1, they are merged under the same label using the Union-Find algorithm. A path compression strategy is also introduced—in the search operation, nodes along the path are directly pointed to the root node to accelerate subsequent searches, thus balancing detection efficiency and connectivity accuracy when processing large-scale 3D data. After labeling, each connected component corresponds to an initial connected component, representing a potential defect region.

[0074] Because multiple defects in a weld are close together, the initial connected regions often exhibit adhesion (i.e., multiple defects are incorrectly merged into one region). Therefore, it is necessary to further segment each initial connected region. This step uses a marker-controlled 3D watershed algorithm. First, the gradient map of the grayscale data I(x) is constructed. The gradient value reflects the drastic change in voxel echo amplitude—a larger gradient typically corresponds to the boundary region between different defects. Then, local amplitude extrema (i.e., local maxima of echo amplitude) are extracted within each initial connected region to form a set of marker points M, which serve as the initial seed for the watershed algorithm. Next, region expansion is performed starting from these marker points: for the voxel p to be assigned, its 26-neighborhood is checked. If a voxel with an assigned label exists in the neighborhood, the current voxel inherits the label corresponding to the neighborhood with the minimum gradient cost. Regions with small gradients exhibit gentle grayscale changes; preferential expansion along these regions maintains continuity within the same defect. Regions with large gradients naturally form watershed boundaries between different defects. The resulting 3D segmentation label map shows voxels with the same label belonging to the same defect region. This algorithm, while preserving the integrity of individual defects, automatically separates multiple defects that were originally adhered together, significantly improving the segmentation accuracy for complex defect regions.

[0075] After completing the 3D watershed segmentation, a multi-stage spatial merging strategy is executed to optimize the region division. The first stage involves merging regions originating from the same initial connected domain, re-aggregating fragments of the same defect that were scattered due to over-segmentation. The second stage re-executes cross-regional connected domain analysis, re-establishing associations for candidate regions that cross region boundaries while maintaining spatial continuity, ensuring that spatially continuous defects are not incorrectly split. The third stage removes redundant regions based on bounding box inclusion relationships—if the bounding box of one region completely contains another region, it is considered redundant and discarded. The fourth stage combines peak location (the point with the maximum echo amplitude within a region), bounding box distance, and voxel set to spatially fuse candidate regions that are relatively close to each other within different regions. After these multi-stage merging processes, a candidate defect set is output. Each candidate defect It includes four attributes: 3D bounding box (Define the smallest circumscribed cuboid of the defect in space), peak location (3D coordinates of the point with the strongest echo of the defect), voxel mask (All voxel indices belonging to this defect) and amplitude confidence. (Defect confidence level based on echo amplitude assessment).

[0076] This embodiment extends the national standard -6dB method in three-dimensional space: the disjoint-set data structure algorithm efficiently completes the three-dimensional connected component labeling of large-scale voxels, the three-dimensional watershed algorithm based on the labeled points accurately separates adhesion defects, and the multi-stage spatial merging strategy further optimizes the region integrity. Compared with the traditional frame-by-frame thresholding method, this embodiment fully utilizes the spatial continuity between scanning layers, effectively avoiding the problem of the same defect being repeatedly detected or inconsistent in size measurement in different scanning frames. At the same time, it significantly improves the resolution of adjacent defects and the segmentation accuracy of complex defect regions, providing high-quality candidate defect input for subsequent intelligent decision-making paths.

[0077] Optionally, step S203, namely, using a marker-based 3D watershed algorithm to separate adhesion defects in the initial connected component to obtain a 3D segmentation label map, includes:

[0078] S2031. Construct the grayscale gradient map of the three-dimensional voxel data;

[0079] S2032. Based on the grayscale gradient map, extract local amplitude extreme points within each initial connected domain to form a set of marker points;

[0080] S2033. Using the marked points in the set of marked points as initial seeds, expand the region of unmarked voxels according to the principle of minimizing the gradient cost in their neighborhood to obtain a three-dimensional segmentation label map; wherein, for a voxel p to be assigned, if there is a voxel with an assigned label in its three-dimensional neighborhood, the voxel p to be assigned inherits the label corresponding to the neighborhood with the minimum gradient cost.

[0081] Understandably, firstly, regarding the grayscale data in the three-dimensional voxel data... (i.e., the echo amplitude value of each voxel) Calculate its gradient and construct a grayscale gradient map. The gradient is a mathematical quantity describing the rate of change of grayscale. In three-dimensional space, it is obtained by calculating the partial derivatives of each voxel in the x, y, and z directions and then determining the modulus. The magnitude of the gradient value reflects the degree of change in echo amplitude: a larger gradient value indicates a more drastic amplitude change, typically corresponding to the boundary region between different defects or the transition zone between a defect and the substrate; a smaller gradient value indicates a gentler grayscale change, corresponding to the interior of a defect or a region of uniform material. This gradient map will serve as a topological topographic map for subsequent watershed segmentation, providing guidance on "elevation" for regional expansion.

[0082] Based on the gray-level gradient map, local amplitude extrema points are extracted within each initial connected component to form a set of marker points. Local amplitude extrema points refer to voxel points whose echo amplitude values ​​are all the largest (or smallest) within their 26 neighborhoods. In practice, local amplitude maxima are usually selected as marker points because the defect center often corresponds to the location with the strongest echo. These marker points represent the "core" region of each potential defect and will serve as the initial seeds for the watershed algorithm, guiding subsequent region expansion to grow outward from the defect center, thereby avoiding over-segmentation due to noise or minor fluctuations. Multiple marker points may be extracted within each initial connected region, corresponding to multiple potential defect cores.

[0083] With the set of marker points Using the marked points as initial seeds, unlabeled voxels are expanded in regions according to the principle of minimizing gradient cost within their neighborhoods, ultimately resulting in a 3D segmentation label map. Specifically, for any voxel p to be assigned, its 3D neighborhood is checked. (i.e., a 26-neighborhood, containing all adjacent voxels that share a face, edge, or vertex with the voxel); if there is a labeled voxel within this neighborhood, then calculate the gradient value at each labeled neighbor voxel q. The label corresponding to the neighborhood with the smallest gradient value is assigned to p, i.e. A small gradient value means a gentle change in grayscale, and preferential expansion along low-gradient regions can maintain the continuity and consistency within the same defect; while high-gradient regions (such as defect boundaries) naturally become watersheds between different defects, preventing the merging of different marked regions. Through this "water flowing downhill" simulation, the marked points gradually expand outward until they encounter a high-gradient boundary and stop. Ultimately, each voxel is assigned a unique label, forming a 3D segmentation label map, where voxels with the same label belong to the same defect region.

[0084] This embodiment effectively solves the problem of adhesion in the initial connected domain when multiple defects are close together in the weld by using a marker-based 3D watershed algorithm. The gradient map provides accurate positioning of the defect boundary, and the local amplitude extreme points ensure that the segmentation starts from the defect core. The region expansion rule with the minimum gradient cost automatically separates multiple adhesion defects while maintaining the integrity of a single defect, which significantly improves the segmentation accuracy of complex defect regions and the accuracy of subsequent size measurement, and provides more reliable candidate defect regions for the output of the 3D detection path.

[0085] Optionally, step S204, namely performing multi-stage spatial merging on the three-dimensional segmentation label map to output a candidate defect set, includes:

[0086] S2041. Based on the three-dimensional segmentation label map, regions originating from the same initial connected domain are merged to obtain the first merging result;

[0087] S2042. Based on the first merging result, re-execute the cross-regional connectivity analysis, re-establish the association between candidate regions that cross regional boundaries and maintain spatial continuity, and obtain the second merging result;

[0088] S2043. Based on the second merging result, redundant regions are removed according to the bounding box inclusion relationship to obtain the third merging result;

[0089] S2044. Based on the third merging result, and combining the peak position, bounding box distance, and voxel set, spatial fusion is performed on candidate regions whose Euclidean distance from the center point of the bounding box is less than a preset threshold, and a candidate defect set is output.

[0090] Understandably, based on the 3D segmentation label map, regions originating from the same initial connected component are first merged to obtain the first merging result. Here, "same origin" refers to the same initial connected component labeled by the disjoint-set data structure algorithm in step S202. Since the 3D watershed segmentation in step S203 may over-segment the same defect within an initial connected component into multiple sub-regions (e.g., due to excessive labeling points caused by local noise), it is necessary to re-merge these spatially adjacent sub-regions originating from the same initial connected component into a single entity. The merging is based on checking whether each sub-region belongs to the parent label of the same initial connected component; if so, its label is unified, restoring the integrity of the defect. This step effectively corrects the over-segmentation problem that the watershed algorithm may cause, ensuring that the same defect is not incorrectly split into multiple fragments.

[0091] Based on the first merging result, cross-regional connected component analysis is re-executed to re-establish associations for candidate regions that cross region boundaries while maintaining spatial continuity, resulting in the second merging result. Specifically, in the first merging result, some defects may have been assigned to different initial connected components because the boundaries of the initial region division happened to pass through the defect entity. In this case, by traversing the 26 neighborhoods of all voxels again, it is checked whether there are voxels with different labels that are spatially adjacent and have continuous grayscale values ​​(i.e., no significant jump in echo amplitude). If the condition is met, they are merged into the same region. This step compensates for the boundary errors that may exist in the initial connected component division, ensuring that spatially continuous real defects are not incorrectly split.

[0092] Based on the second merging result, redundant regions are removed according to the bounding box inclusion relationship to obtain the third merging result. Each candidate region has a 3D bounding box (i.e., the smallest cuboid that can contain all voxels in the region). If the bounding box of region A completely contains the bounding box of region B, and the voxel sets of region A and region B overlap or are adjacent, then region B is determined to be a redundant region (possibly a sub-region inside region A or noise fragment) and is removed. This step effectively removes false small regions nested inside larger defects through the geometric inclusion relationship of the bounding boxes, reducing interference in subsequent processing.

[0093] Based on the third merging result, and combining the peak position, bounding box distance, and voxel set, candidate regions with a bounding box center point Euclidean distance less than a preset threshold are spatially fused to output a candidate defect set. Here, the peak position refers to the 3D coordinates of the point with the maximum echo amplitude within the region; the bounding box distance refers to the Euclidean distance (i.e., straight-line distance) between the center points of the bounding boxes of two regions; the preset threshold can be set according to actual detection needs (e.g., 5-10 voxel units). When the distance between the center points of the bounding boxes of two candidate regions is less than this threshold, they are considered spatially close enough to potentially belong to different parts of the same defect. Therefore, their voxel sets are merged, their bounding boxes are updated to the union of the two, and the peak position is recalculated. After the above four-stage merging, the final candidate defect set is output. Each candidate defect contains a 3D bounding box. Peak position voxel mask and amplitude confidence .

[0094] This embodiment, based on the 3D segmentation label map, sequentially performs homogeneous fragment aggregation, cross-regional continuity repair, redundant region removal, and near-range defect fusion, effectively solving the problems of over-segmentation that may be caused by watershed segmentation and boundary errors in the initial connected component division. This embodiment ensures the spatial integrity and independence of each candidate defect, avoiding the same defect being counted multiple times or incorrectly segmented, providing high-quality, low-redundancy candidate defect input for subsequent intelligent decision-making paths, thereby improving the overall accuracy and reliability of defect identification.

[0095] Optionally, in step S30, using the manually evaluated map as a supervised sample, the StarNet backbone network combined with the AIFI attention module is used to extract continuous slices along the scanning direction for each candidate defect in the candidate defect set, and multi-scale feature fusion and global self-attention modeling are performed to output an AI confidence set, including:

[0096] S301. For each candidate defect in the candidate defect set, extract continuous slices within its bounding box along the scanning direction and uniformly crop them to a fixed size to form a network input tensor.

[0097] S302. Input the network input tensor into the StarNet backbone network, extract features from different levels and perform multi-scale fusion to obtain multi-scale fused features;

[0098] S303. An AIFI attention module is introduced onto the highest layer features of the StarNet backbone network. Global self-attention modeling is performed through the multi-head self-attention mechanism of the AIFI attention module to obtain attention-enhanced features.

[0099] S304. Based on the attention enhancement features, output the probability that each candidate defect belongs to a real defect, and generate an AI confidence set; the AI ​​confidence set includes each AI candidate and its corresponding true / false confidence.

[0100] Understandably, for the candidate defect set Each candidate defect in Extract its 3D bounding box along the scanning direction (i.e., the z-axis direction). The network input tensor is formed by extracting continuous slices within the bounding box and uniformly cropping them to a fixed size (e.g., 64×64 pixels). Here, continuous slices refer to two-dimensional image frames arranged sequentially along the z-axis, with each frame corresponding to a B-scan image at a scanning position; the network input tensor refers to a three-dimensional data block formed by stacking these slices along the depth direction, which serves as the input to the subsequent deep learning network. By extracting continuous slices within the bounding box, the temporal context information of the defect in the scanning direction (i.e., the echo evolution pattern of the defect at different scanning positions) is preserved, while the processing range is limited to the vicinity of the candidate defect, significantly reducing interference from irrelevant regions and improving the efficiency and targeting of subsequent feature extraction.

[0101] The input tensor is fed into the StarNet backbone network to extract features from different levels and perform multi-scale fusion to obtain multi-scale fused features. StarNet is a lightweight convolutional neural network designed for efficient inference in industrial scenarios. Its shallow feature maps have high resolution and small receptive fields, preserving rich texture details and edge information, and have good expressive ability for small-sized defects with weak echoes. Deep feature maps have low resolution and large receptive fields, enabling them to learn more abstract semantic information and have strong discriminative ability for the overall shape and category of defects. In specific implementation, feature maps output from different levels of the backbone network (such as layers 2, 3, and 4) are selected. 1×1 convolutions are used to unify the channel dimension of features from each layer. Nearest neighbor interpolation is used to upsample high-level features to the same resolution as shallow features. Then, a convolutional fusion module (such as 3×3 convolution + batch normalization + ReLU activation) is used to complete the element-wise addition and fusion of multi-scale features. This process enables the network to perceive both local details and overall structure simultaneously, improving its ability to identify different types of weld defects.

[0102] An AIFI attention module (Attention-based Intra-scale Feature Interaction) is introduced onto the highest-level features of the StarNet backbone network. Global self-attention modeling is performed through the multi-head self-attention mechanism of this module to obtain attention-enhanced features. Specifically, the highest-level two-dimensional feature map is first flattened into a sequence representation (i.e., the feature vectors at each spatial location are arranged sequentially), and a two-dimensional sinusoidal positional encoding is added to preserve the spatial positional information of each feature vector. Then, the multi-head self-attention mechanism is used to calculate the correlation between different positions in the sequence. The calculation process is as follows: Here, Q, K, and V are the query matrix, key matrix, and value matrix obtained from the input features through linear mapping, respectively, d is the feature dimension of a single attention head, and the Softmax function is used to calculate the attention weights between each position. Through this mechanism, the network can adaptively allocate weights according to the correlation between different regions in the feature map: defective regions receive higher attention weights due to their high feature similarity, while background noise and tissue texture are suppressed due to their large differences from defective features. After completing the attention calculation, the features are sequentially processed through residual connections (adding the input features to the attention output to alleviate gradient vanishing), a feedforward network (two fully connected layers to further enhance nonlinear expressive power), and layer normalization to improve training stability.

[0103] Finally, based on the attention-enhanced features, a fully connected classification layer outputs the probability that each candidate defect belongs to a true defect, generating an AI confidence set. Specifically, the attention-enhanced features are reduced to a one-dimensional feature vector through global average pooling, and then input into a binary classifier consisting of a fully connected layer and a sigmoid activation function, outputting a probability value between 0 and 1. This represents the AI ​​confidence score that the candidate defect is a real defect. The final AI confidence score set is obtained. Each AI candidate corresponds to a candidate defect. and its confidence level AI candidates refer to candidate defects in the AI ​​confidence set. It is important to emphasize that this step does not detect defects independently, but rather adds a confidence level learned from human image evaluation knowledge to each candidate defect provided by the 3D detection path, providing an intelligent judgment basis for subsequent dual-path fusion determination.

[0104] This embodiment constructs a lightweight and efficient intelligent auxiliary judgment path: the candidate slice generation retains the temporal context information of the defect, the StarNet multi-scale feature fusion takes into account both local details and global semantics, and the AIFI attention module effectively suppresses the interference of background noise and tissue texture through a global self-attention mechanism; the final output AI confidence set provides a reliable intelligent discrimination basis for each candidate defect, significantly improving the accuracy of defect authenticity judgment in complex weld patterns without increasing excessive computing resource consumption, and laying a solid foundation for subsequent dual-path fusion judgment.

[0105] Optionally, step S40, which involves performing spatial consistency matching between the candidate defect set and the AI ​​confidence set based on spatial location and regional overlap, and adding candidate defects that meet the dual-path joint confirmation condition to the final defect set, includes:

[0106] S401. For each candidate defect in the candidate defect set, find an AI candidate in the AI ​​confidence set whose intersection-union ratio of its 3D bounding box or Euclidean distance from its center point satisfies a preset threshold. When there are multiple AI candidates, select the AI ​​candidate with the highest Dice coefficient as the matching object.

[0107] S402. For each candidate defect, if there is a matching AI candidate, and the confidence level of the AI ​​candidate is not less than the preset confidence threshold, and the spatial overlap between the candidate defect and the AI ​​candidate is not less than the preset overlap threshold, then the candidate defect is added to the final defect set.

[0108] S403. For each defect in the final defect set, fuse the three-dimensional bounding box, peak position and voxel set of the candidate defects corresponding to the defect, as well as the confidence level and morphology parameters of the AI ​​candidates, and output the final coordinate position, true size and morphology parameters of the defect according to the preset standard.

[0109] S404. For candidate defects that do not meet the dual-path joint confirmation conditions, mark them as pending review and prompt for manual evaluation, and write the review results back to the database.

[0110] Understandably, for the candidate defect set Each candidate defect in In the AI ​​confidence set The algorithm searches for AI candidates whose 3D bounding box intersection-union ratio (IU) or center point Euclidean distance satisfies a preset threshold. The IU is determined by the IU of the bounding box. The Dice coefficient (intersection over union) is the ratio of the intersection volume to the union volume of two 3D bounding boxes, used to measure the degree of spatial overlap between the two regions. It ranges from 0 to 1, with values ​​closer to 1 indicating greater overlap. The Euclidean distance between the center points is the straight-line distance between the center points of the two bounding boxes, used to measure the distance between the two regions. When multiple AI candidates meet the threshold condition with the same candidate defect, the AI ​​candidate with the highest Dice coefficient is selected as the matching object. The Dice coefficient is another indicator for measuring spatial overlap, calculated as follows: Here, A is the voxel set of candidate defects, and B is the voxel set of AI candidates. The Dice coefficient also ranges from 0 to 1, with values ​​closer to 1 indicating a higher degree of overlap. Through this step, the best-matching AI candidate is found for each candidate defect, establishing a spatial correspondence between the two paths.

[0111] For each candidate defect, determine whether it simultaneously meets the following three dual-path joint confirmation conditions: ① There is a successfully matched AI candidate (i.e., a suitable AI candidate was found in S401); ② The confidence level of the AI ​​candidate. Not less than the preset confidence threshold (Default value is 0.7, which can be calibrated according to on-site testing requirements); ③ The spatial overlap (i.e., Dice coefficient) between the candidate defect and the AI ​​candidate is not less than the preset overlap threshold. (Default value is 0.6). Only when all three conditions are met is the candidate defect determined to be a "defect jointly confirmed by both parties" and added to the final defect set. This mechanism ensures that every defect in the final output passes both the screening of the national standard 3D inspection and the intelligent judgment of the deep learning model, effectively reducing the false detection rate.

[0112] For the final defect set For each defect, the system integrates the 3D bounding box, peak position, and voxel set of the corresponding candidate defects, along with the confidence level and morphological parameters (such as aspect ratio, area, and roundness) of the matched AI candidates. Based on the national standard NB / T 47013.15—2021, the system outputs the final coordinate position, true size, and morphological parameters of the defect. The final coordinate position combines the geometric positioning of the 3D detection path with spatial correction for AI judgment; the true size is obtained by combining the physical size conversion of the voxel set (obtained from probe scanning step distance and image resolution calibration) with depth calculation using the half-wave height method; and the morphological parameters reflect the shape characteristics of the defect (such as the elongated shape of cracks or the circular shape of pores). The final detection results can be directly used for engineering deliverables, such as quality inspection reports or as a basis for maintenance decisions.

[0113] For candidate defects that do not meet the joint confirmation conditions of both paths (i.e., those that fail any of the three conditions in S402), the system automatically marks them as "pending review" and prompts the inspectors to conduct manual evaluation. The inspectors manually judge the marked candidate defects based on their experience to confirm whether they are real or false defects. The review results (including the final judgment, corrected defect parameters, etc.) are written back to the database as incremental samples for subsequent model iterations, continuously improving the intelligent judgment path recognition capability. This fallback mechanism ensures that even when the two paths' judgments are inconsistent, real defects are not missed, while also providing data support for continuous model optimization.

[0114] This embodiment achieves deep integration of the 3D detection path and the intelligent judgment path: spatial consistency association establishes the correspondence between the two paths, the joint confirmation conditions of the two paths ensure the reliability of the output defects, the fused output generates detection results that meet national standards, and the manual review fallback mechanism provides a safety guarantee for abnormal situations. While maintaining the detection sensitivity of national standards, this embodiment effectively suppresses false alarms through the dual constraints of AI confidence and spatial overlap, and the manual review mechanism avoids the risk of missed detections, significantly improving the accuracy, robustness, and engineering applicability of weld defect identification.

[0115] Optionally, the method adopts a side-side AI deployment model, including:

[0116] S11. Perform scanning, candidate defect set output, AI confidence set output and spatial consistency matching on the edge AI to generate the edge AI preliminary judgment result.

[0117] S12. Manually review and confirm the preliminary AI judgment results of the side, and temporarily store the map and results locally, and upload them to the cloud in batches after the network is restored;

[0118] And / or,

[0119] The method adopts a cloud-based AI deployment model, including:

[0120] S21. Upload the three-dimensional voxel data to the cloud AI;

[0121] S22. The cloud AI executes the output of the candidate defect set, the output of the AI ​​confidence set, and the spatial consistency matching to output the cloud AI preliminary judgment result.

[0122] S23. The preliminary judgment result of the cloud AI is manually reviewed, the reviewed result is sent back to the cloud AI for archiving and a detection report is exported, and the cloud performs secondary training on the full historical map to continuously improve the model's capabilities.

[0123] Understandably, in the edge AI deployment model, the inspection workstation independently completes the entire process from data acquisition to preliminary judgment locally. Edge AI refers to the local computing environment deployed on the industrial field inspection workstation, typically equipped with a high-performance GPU or NPU (Neural Processing Unit), capable of running a complete dual-path fusion algorithm under conditions of no network connection or limited bandwidth. Specifically, the workstation first controls the phased array probe to complete scanning and construct 3D voxel data. Then, it sequentially executes the candidate defect set output (3D inspection path), the AI ​​confidence set output (intelligent judgment path), and spatial consistency matching (fusion judgment module) locally, ultimately generating the edge AI preliminary judgment result. This preliminary judgment result includes a list of defects jointly confirmed by both paths, along with their coordinates, dimensions, and morphological parameters, as well as a mark indicating defects that have not passed joint confirmation and require further review. The advantage of this mode is that it does not rely on cloud computing power and network connection, and can independently complete the entire "acquisition-analysis-preliminary judgment" process, adapting to scenarios with poor network conditions such as field operations and offshore platforms.

[0124] The initial AI-based assessment results can be manually reviewed and confirmed. Specifically, inspectors view the initial assessment results through the workstation software interface, manually judge candidate defects marked as "pending review," and sample and verify or correct the results of the automatic assessment. After confirmation, the final inspection results (including image atlas, defect parameters, review records, etc.) are temporarily stored locally on the workstation's hard drive. Once the network connection is restored, the data is uploaded in batches to the cloud for archiving. This design ensures the immediacy of on-site inspections while achieving unified management and traceability of inspection data through centralized cloud storage.

[0125] In a cloud-based AI deployment, front-end inspection equipment (such as a portable phased array detector) uploads the 3D voxel data to a cloud-based AI server cluster via a network after completing the scanning and constructing the data. Cloud-based AI refers to a high-performance computing cluster deployed in a remote data center, equipped with large-scale GPU resources and high-capacity storage systems, capable of processing massive amounts of inspection data and providing high-precision analysis services. The upload process can employ technologies such as resume upload and data compression to ensure transmission efficiency and reliability.

[0126] The cloud-based AI performs candidate defect set output, AI confidence set output, and spatial consistency matching to output the initial judgment result. Unlike edge AI, cloud-based AI can utilize more powerful computing resources and more complex models (such as larger-scale backbone networks or ensembles of multiple models) to achieve higher detection accuracy. Simultaneously, cloud-based AI can access all historical detection data, referencing historical characteristics of similar defects when performing the current detection task, further improving the accuracy of the judgment. The initial judgment result from the cloud-based AI also includes a defect list jointly confirmed by both paths and a mark indicating areas for further review.

[0127] The initial assessment results from the cloud-based AI are then manually reviewed. Specifically, inspectors log into the cloud platform via remote terminals or clients to view and verify the initial assessment results. The reviewed results (including final defect parameters, review comments, etc.) are then sent back to the cloud-based AI for archiving, and the system automatically generates a test report that conforms to national standards for download or printing. In addition, the cloud-based AI utilizes the accumulated full historical data (including newly annotated data after this review) for regular secondary training, continuously optimizing the model parameters of the StarNet and AIFI attention modules, thereby continuously improving the ability to identify intelligent judgment paths and forming a positive cycle of "detection—review—training—improvement".

[0128] This embodiment adopts two deployment modes: edge AI and cloud AI, which takes into account the diverse network conditions and computing power requirements of industrial sites. The edge AI mode ensures independent operation capability in offline scenarios, while the cloud AI mode leverages the powerful computing power of the cloud to achieve higher accuracy and continuous evolution. The two modes share the same dual-path fusion algorithm logic, only differing in the location of computing power and the data flow method, thereby covering various engineering scenarios from single-workstation offline detection to large-scale cloud collaboration, significantly improving the universality and engineering practicality of this embodiment.

[0129] In one application example, to verify the effectiveness of the technical solution of this application, experimental verification was conducted using real phased array weld ultrasonic testing data. For example... Figure 2 As shown, Figure 2 This is a schematic diagram showing the geometric parameters and location of typical weld defects. The test samples cover typical internal defect morphologies of butt welds, focusing on the construction and parameter calibration of common defect types such as longitudinal cracks on the upper surface, incomplete penetration at the root, and incomplete fusion at the internal root bevel. A total of 57 images were selected as test samples, of which 174 defects were manually confirmed. After processing using the method described in this application, 25 defects were missed and 30 were false positives, corresponding to a recall rate of 85.7% and a precision rate of 83.3%.

[0130] Comparative experimental results show that single-path 3D detection (using the CN117871694A scheme) has more false detections in complex backgrounds; single-path intelligent judgment (using the CN121027321A scheme) is prone to missed detections at weak echo defects; while after adopting the dual-path fusion judgment strategy of this application, the recognition accuracy of cloud AI has basically matched the accuracy of manual recognition, and with the increase of the number of training maps, the recall and precision are expected to be further improved.

[0131] The comparative experimental results above show that three-dimensional spatial analysis improves the continuity and stability of candidate defect extraction, intelligent auxiliary judgment further reduces misjudgment in complex backgrounds, and the dual-path fusion strategy combines the advantages of three-dimensional detection and intelligent recognition, improving the reliability of the final detection results and meeting the practical application requirements of the ultrasonic automatic inspection system for welds.

[0132] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0133] In one embodiment, a weld defect identification device based on dual-path fusion is provided, which corresponds one-to-one with the weld defect identification method based on dual-path fusion described in the above embodiments. For example... Figure 3 As shown, the weld defect identification device based on dual-path fusion includes:

[0134] The data acquisition and 3D voxel construction module 10 is used to complete longitudinal vertical scanning along the weld seam using a phased array ultrasonic probe and encoder, and stack the results of multiple B-scans according to the scanning position into 3D voxel data.

[0135] The 3D detection path module 20 is used for 3D connected component labeling based on disjoint set and 3D watershed segmentation based on label points. Combined with multi-stage spatial merging, it performs standard threshold screening, candidate voxel generation, adhesion defect separation and region optimization on the 3D voxel data and outputs a candidate defect set.

[0136] The intelligent decision path module 30 is used to extract continuous slices along the scanning direction for each candidate defect in the candidate defect set, using the manually evaluated map as a supervised sample, and employing the StarNet backbone network combined with the AIFI attention module. It then performs multi-scale feature fusion and global self-attention modeling, and outputs an AI confidence set. The AI ​​confidence set includes each AI candidate and its corresponding true / false confidence.

[0137] The fusion judgment module 40 is used to perform spatial consistency matching between the candidate defect set and the AI ​​confidence set based on spatial location and regional overlap, and add the candidate defects that meet the dual-path joint confirmation conditions to the final defect set; the dual-path joint confirmation conditions include: the candidate defect has a matching AI candidate, and the confidence of the AI ​​candidate is not less than a preset confidence threshold, and the spatial overlap with the AI ​​candidate is not less than a preset overlap threshold.

[0138] Optionally, the 3D detection path module 20 is also used for:

[0139] The three-dimensional voxel data were initially screened using an evaluation line as a threshold to obtain a set of suspected defective voxels;

[0140] The disjoint-set data structure algorithm is used to perform three-dimensional connected component labeling on the suspected defective voxel set to generate initial connected components;

[0141] A three-dimensional watershed algorithm based on marker points is used to separate adhesion defects in the initial connected domain to obtain a three-dimensional segmentation label map.

[0142] Perform multi-stage spatial merging on the three-dimensional segmentation label map to output a candidate defect set.

[0143] Optionally, the step of using a marker-based 3D watershed algorithm to separate adhesion defects in the initial connected component to obtain a 3D segmentation label map includes:

[0144] Construct the grayscale gradient map of the three-dimensional voxel data;

[0145] Based on the grayscale gradient map, local amplitude extreme points are extracted within each initial connected domain to form a set of marker points;

[0146] Using the marked points in the set of marked points as initial seeds, the unmarked voxels are expanded in regions according to the principle of minimizing the gradient cost in their neighborhoods to obtain a three-dimensional segmentation label map; wherein, for a voxel p to be assigned, if there is a voxel with an assigned label in its three-dimensional neighborhood, the voxel p to be assigned inherits the label corresponding to the neighborhood with the minimum gradient cost.

[0147] Optionally, the step of performing multi-stage spatial merging on the three-dimensional segmented label map to output a candidate defect set includes:

[0148] Based on the three-dimensional segmentation label map, regions originating from the same initial connected region are merged to obtain the first merging result;

[0149] Based on the first merging result, cross-regional connectivity analysis is re-executed to re-establish associations for candidate regions that cross regional boundaries and maintain spatial continuity, resulting in the second merging result.

[0150] Based on the second merging result, redundant regions are removed according to the bounding box containment relationship to obtain the third merging result;

[0151] Based on the third merging result, and combining the peak position, bounding box distance, and voxel set, spatial fusion is performed on candidate regions whose Euclidean distance from the bounding box center point is less than a preset threshold, and a candidate defect set is output.

[0152] Optionally, the intelligent path determination module 30 is also used for:

[0153] For each candidate defect in the candidate defect set, continuous slices within its bounding box are extracted along the scanning direction and uniformly cropped to a fixed size to form the network input tensor;

[0154] The network input tensor is input into the StarNet backbone network, and features at different levels are extracted and fused at multiple scales to obtain multi-scale fused features.

[0155] An AIFI attention module is introduced onto the highest layer features of the StarNet backbone network. Global self-attention modeling is performed through the multi-head self-attention mechanism of the AIFI attention module to obtain attention-enhanced features.

[0156] Based on the attention enhancement features, the probability that each candidate defect belongs to a real defect is output, and an AI confidence set is generated; the AI ​​confidence set includes each AI candidate and its corresponding true / false confidence.

[0157] Optionally, the fusion determination module 40 is also used for:

[0158] For each candidate defect in the candidate defect set, find the AI ​​candidate in the AI ​​confidence set whose intersection-union ratio of its 3D bounding box or the Euclidean distance of its center point meets a preset threshold. When there are multiple AI candidates, select the AI ​​candidate with the highest Dice coefficient as the matching object.

[0159] For each candidate defect, if there is a matching AI candidate, and the confidence level of the AI ​​candidate is not less than the preset confidence threshold, and the spatial overlap between the candidate defect and the AI ​​candidate is not less than the preset overlap threshold, then the candidate defect is added to the final defect set.

[0160] For each defect in the final defect set, the three-dimensional bounding box, peak position and voxel set of the candidate defects corresponding to that defect are fused together with the confidence level and morphology parameters of the AI ​​candidates. The final coordinate position, true size and morphology parameters of the defect are output according to the preset standard.

[0161] For candidate defects that do not meet the dual-path joint confirmation conditions, they are marked as pending review and prompted for manual evaluation. The review results are then written back to the database.

[0162] Optionally, the weld defect identification device based on dual-path fusion adopts a side-mounted AI deployment configuration, used for:

[0163] The edge AI performs scanning, outputs candidate defect set, outputs AI confidence set, and performs spatial consistency matching locally to generate the edge AI preliminary judgment result.

[0164] The initial AI judgment results of the side are manually reviewed and confirmed, and the map and results are temporarily stored locally and uploaded to the cloud in batches after the network is restored.

[0165] And / or,

[0166] The weld defect identification device based on dual-path fusion adopts a cloud-based AI deployment model and is used for:

[0167] Upload the three-dimensional voxel data to the cloud AI;

[0168] The cloud-based AI executes the output of the candidate defect set, the output of the AI ​​confidence set, and the spatial consistency matching to output the cloud-based AI's initial judgment result.

[0169] The initial judgment results of the cloud AI are manually reviewed, and the reviewed results are sent back to the cloud AI for archiving and export of the detection report. The cloud then performs secondary training on the full historical map to continuously improve the model's capabilities.

[0170] Specific limitations regarding the weld defect identification device based on dual-path fusion can be found in the limitations of the weld defect identification method based on dual-path fusion described above, and will not be repeated here. Each module in the aforementioned weld defect identification device based on dual-path fusion can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0171] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores data related to the dual-path fusion-based weld defect identification method. The network interface communicates with external terminals via a network connection. When the processor executes the computer program, it implements a dual-path fusion-based weld defect identification method.

[0172] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the weld defect identification method based on dual-path fusion described in the above embodiment; to avoid repetition, this will not be repeated here. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the embodiment of the weld defect identification device based on dual-path fusion; to avoid repetition, this will not be repeated here.

[0173] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When executed by a processor, the computer program implements the weld defect identification method based on dual-path fusion described in the above embodiment. To avoid repetition, this will not be repeated here. Alternatively, when executed by a processor, the computer program implements the functions of each module / unit in the weld defect identification device based on dual-path fusion described in this embodiment. To avoid repetition, this will not be repeated here.

[0174] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0175] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0176] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A weld defect identification method based on dual-path fusion, characterized in that, include: A phased array ultrasonic probe and encoder are used to perform longitudinal vertical scanning along the weld seam, and the results of multiple B-scans are stacked into three-dimensional voxel data according to the scanning position. Based on the disjoint set-based 3D connected component labeling and the marker-based 3D watershed segmentation, combined with multi-stage spatial merging, the 3D voxel data is subjected to standard threshold screening, candidate voxel generation, adhesion defect separation and region optimization, and a candidate defect set is output. Using manually evaluated maps as supervised samples, the StarNet backbone network combined with the AIFI attention module is used to extract continuous slices along the scanning direction for each candidate defect in the candidate defect set, and perform multi-scale feature fusion and global self-attention modeling to output an AI confidence set; the AI ​​confidence set includes each AI candidate and its corresponding true or false confidence. Based on spatial location and regional overlap, the candidate defect set and the AI ​​confidence set are spatially consistent and matched. Candidate defects that meet the dual-path joint confirmation conditions are added to the final defect set. The dual-path joint confirmation conditions include: the candidate defect has a matching AI candidate, and the confidence level of the AI ​​candidate is not less than a preset confidence threshold, and the spatial overlap with the AI ​​candidate is not less than a preset overlap threshold. The 3D connected component labeling based on disjoint-set data structure and the 3D watershed segmentation based on labeled points, combined with multi-stage spatial merging, perform standard threshold initial screening, candidate voxel generation, adhesion defect separation, and region optimization on the 3D voxel data, outputting a candidate defect set, including: The three-dimensional voxel data were initially screened using an evaluation line as a threshold to obtain a set of suspected defective voxels; The disjoint-set data structure algorithm is used to perform three-dimensional connected component labeling on the suspected defective voxel set to generate initial connected components; A three-dimensional watershed algorithm based on marker points is used to separate adhesion defects in the initial connected domain to obtain a three-dimensional segmentation label map. Perform multi-stage spatial merging on the three-dimensional segmentation label map to output a candidate defect set; The method uses manually evaluated maps as supervised samples, employs a StarNet backbone network combined with an AIFI attention module, and extracts continuous slices along the scanning direction for each candidate defect in the candidate defect set, performing multi-scale feature fusion and global self-attention modeling to output an AI confidence set, including: For each candidate defect in the candidate defect set, continuous slices within its bounding box are extracted along the scanning direction and uniformly cropped to a fixed size to form the network input tensor; The network input tensor is input into the StarNet backbone network, and features at different levels are extracted and fused at multiple scales to obtain multi-scale fused features. An AIFI attention module is introduced onto the highest layer features of the StarNet backbone network. Global self-attention modeling is performed through the multi-head self-attention mechanism of the AIFI attention module to obtain attention-enhanced features. Based on the attention enhancement features, the probability that each candidate defect belongs to a real defect is output, and an AI confidence set is generated; the AI ​​confidence set includes each AI candidate and its corresponding true / false confidence. The step involves performing spatial consistency matching between the candidate defect set and the AI ​​confidence set based on spatial location and regional overlap, and adding candidate defects that meet the dual-path joint confirmation condition to the final defect set, including: For each candidate defect in the candidate defect set, find the AI ​​candidate in the AI ​​confidence set whose intersection-union ratio of its 3D bounding box or the Euclidean distance of its center point meets a preset threshold. When there are multiple AI candidates, select the AI ​​candidate with the highest Dice coefficient as the matching object. For each candidate defect, if there is a matching AI candidate, and the confidence level of the AI ​​candidate is not less than the preset confidence threshold, and the spatial overlap between the candidate defect and the AI ​​candidate is not less than the preset overlap threshold, then the candidate defect is added to the final defect set. For each defect in the final defect set, the three-dimensional bounding box, peak position and voxel set of the candidate defects corresponding to that defect are fused together with the confidence level and morphology parameters of the AI ​​candidates. The final coordinate position, true size and morphology parameters of the defect are output according to the preset standard. For candidate defects that do not meet the dual-path joint confirmation conditions, they are marked as pending review and prompted for manual evaluation. The review results are then written back to the database.

2. The weld defect identification method based on dual-path fusion according to claim 1, characterized in that, The method employs a marker-based 3D watershed algorithm to separate adhesion defects in the initial connected components, resulting in a 3D segmentation label map, including: Construct the grayscale gradient map of the three-dimensional voxel data; Based on the grayscale gradient map, local amplitude extreme points are extracted within each initial connected domain to form a set of marker points; Using the marked points in the set of marked points as initial seeds, the unmarked voxels are expanded in regions according to the principle of minimizing the gradient cost in their neighborhoods to obtain a three-dimensional segmentation label map; wherein, for a voxel p to be assigned, if there is a voxel with an assigned label in its three-dimensional neighborhood, the voxel p to be assigned inherits the label corresponding to the neighborhood with the minimum gradient cost.

3. The weld defect identification method based on dual-path fusion according to claim 1, characterized in that, The process of performing multi-stage spatial merging on the 3D segmented label map and outputting a candidate defect set includes: Based on the three-dimensional segmentation label map, regions originating from the same initial connected region are merged to obtain the first merging result; Based on the first merging result, cross-regional connectivity analysis is re-executed to re-establish associations for candidate regions that cross regional boundaries and maintain spatial continuity, resulting in the second merging result. Based on the second merging result, redundant regions are removed according to the bounding box containment relationship to obtain the third merging result; Based on the third merging result, and combining the peak position, bounding box distance, and voxel set, spatial fusion is performed on candidate regions whose Euclidean distance from the bounding box center point is less than a preset threshold, and a candidate defect set is output.

4. The weld defect identification method based on dual-path fusion according to claim 1, characterized in that, The method adopts a side-side AI deployment model, including: The edge AI performs scanning, outputs candidate defect set, outputs AI confidence set, and performs spatial consistency matching locally to generate the edge AI preliminary judgment result. The initial AI judgment results of the side are manually reviewed and confirmed, and the map and results are temporarily stored locally and uploaded to the cloud in batches after the network is restored. And / or, The method adopts a cloud-based AI deployment model, including: Upload the three-dimensional voxel data to the cloud AI; The cloud-based AI executes the output of the candidate defect set, the output of the AI ​​confidence set, and the spatial consistency matching to output the cloud-based AI preliminary judgment result. The initial judgment results of the cloud AI are manually reviewed, and the reviewed results are sent back to the cloud AI for archiving and export of the detection report. The cloud then performs secondary training on the full historical map to continuously improve the model's capabilities.

5. A weld defect identification device based on dual-path fusion, characterized in that, include: The data acquisition and 3D voxel construction module is used to complete longitudinal vertical scanning along the weld seam using a phased array ultrasonic probe and encoder, and stack the results of multiple B-scans according to the scanning position to form 3D voxel data. The 3D detection path module is used for 3D connected component labeling based on disjoint set and 3D watershed segmentation based on label points. Combined with multi-stage spatial merging, it performs standard threshold screening, candidate voxel generation, adhesion defect separation and region optimization on the 3D voxel data and outputs a candidate defect set. The intelligent decision path module uses manually evaluated maps as supervised samples and employs a StarNet backbone network combined with an AIFI attention module to extract continuous slices along the scanning direction for each candidate defect in the candidate defect set, perform multi-scale feature fusion and global self-attention modeling, and output an AI confidence set; the AI ​​confidence set includes each AI candidate and its corresponding true / false confidence. The fusion judgment module is used to perform spatial consistency matching between the candidate defect set and the AI ​​confidence set based on spatial location and regional overlap, and add the candidate defects that meet the dual-path joint confirmation conditions to the final defect set. The dual-path joint confirmation conditions include: the candidate defect has a matching AI candidate, and the confidence level of the AI ​​candidate is not less than a preset confidence threshold, and the spatial overlap with the AI ​​candidate is not less than a preset overlap threshold. The three-dimensional detection path module is also used for: The three-dimensional voxel data were initially screened using an evaluation line as a threshold to obtain a set of suspected defective voxels; The disjoint-set data structure algorithm is used to perform three-dimensional connected component labeling on the suspected defective voxel set to generate initial connected components; A three-dimensional watershed algorithm based on marker points is used to separate adhesion defects in the initial connected domain to obtain a three-dimensional segmentation label map. Perform multi-stage spatial merging on the three-dimensional segmentation label map to output a candidate defect set; The intelligent path determination module is also used for: For each candidate defect in the candidate defect set, continuous slices within its bounding box are extracted along the scanning direction and uniformly cropped to a fixed size to form the network input tensor; The network input tensor is input into the StarNet backbone network, and features at different levels are extracted and fused at multiple scales to obtain multi-scale fused features. An AIFI attention module is introduced onto the highest layer features of the StarNet backbone network. Global self-attention modeling is performed through the multi-head self-attention mechanism of the AIFI attention module to obtain attention-enhanced features. Based on the attention enhancement features, the probability that each candidate defect belongs to a real defect is output, and an AI confidence set is generated; the AI ​​confidence set includes each AI candidate and its corresponding true / false confidence. The fusion determination module is also used for: For each candidate defect in the candidate defect set, find the AI ​​candidate in the AI ​​confidence set whose intersection-union ratio of its 3D bounding box or the Euclidean distance of its center point meets a preset threshold. When there are multiple AI candidates, select the AI ​​candidate with the highest Dice coefficient as the matching object. For each candidate defect, if there is a matching AI candidate, and the confidence level of the AI ​​candidate is not less than the preset confidence threshold, and the spatial overlap between the candidate defect and the AI ​​candidate is not less than the preset overlap threshold, then the candidate defect is added to the final defect set. For each defect in the final defect set, the three-dimensional bounding box, peak position and voxel set of the candidate defects corresponding to that defect are fused together with the confidence level and morphology parameters of the AI ​​candidates. The final coordinate position, true size and morphology parameters of the defect are output according to the preset standard. For candidate defects that do not meet the dual-path joint confirmation conditions, they are marked as pending review and prompted for manual evaluation. The review results are then written back to the database.

6. A computer device 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 weld defect identification method based on dual-path fusion according to any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the weld defect identification method based on dual-path fusion according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Three-dimensional pipeline weld defect automatic detection method based on phased array

    CN117871694A

  • Ultrasonic defect detection method based on AI identification

    CN121027321A

  • Tunnel defect identification method based on dielectric distribution diagram

    CN120726408A

  • Weld joint ultrasonic phased array detection data intelligent analysis system

    CN121186221A