Ultrasonic phased array defect detection method based on dual-domain cross-scale fusion RT-DETR

By using a dual-domain, cross-scale fusion RT-DETR model, which combines spatial and frequency domain feature enhancement and noise suppression, the problem of missed detection of weak feature defects and misjudgment due to noise interference in ultrasonic phased array scanning images is solved, enabling accurate detection of multi-scale defects and improving detection accuracy and reliability.

CN121904026APending Publication Date: 2026-04-21TAIYUAN UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TAIYUAN UNIVERSITY OF SCIENCE AND TECHNOLOGY
Filing Date
2026-01-23
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing ultrasonic phased array scanning images suffer from problems such as missed detection of weak feature defects, misjudgment due to noise interference, and inaccurate detection of multi-scale defects. In particular, when small-sized defects such as pores and weld defects with a large scale range are encountered, conventional image processing algorithms are difficult to effectively capture weak features, and their noise suppression and signal discrimination capabilities are insufficient, resulting in low detection accuracy.

Method used

A dual-domain, cross-scale fusion RT-DETR model is adopted. Through a backbone network, a dual-domain channel mapper, a cross-scale adaptive fusion pyramid, and a Transformer encoding and decoding module, feature extraction, enhancement, and fusion of ultrasonic phased array scanning images are achieved. By combining feature enhancement and noise suppression in the spatial and frequency domains, and using the Transformer encoding and decoding module for global feature correlation modeling, accurate detection of defect features is achieved.

Benefits of technology

It significantly improves the detection rate and identification accuracy of weld defects such as micropores, low-contrast incomplete fusion, and cracks, reduces the false alarm rate, and achieves accurate detection of defects across all scales, meeting the industrial demand for highly reliable automated non-destructive testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121904026A_ABST
    Figure CN121904026A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of ultrasonic non-destructive testing, and discloses an ultrasonic phased array defect detection method based on dual-domain cross-scale fusion RT-DETR, which comprises the following steps of: processing channel mean value characteristics by combining grouped convolution with a dynamic convolution kernel through a dynamic space attention module, generating a space weight map through Sigmoid, weighting element by element, strengthening defect characteristics and suppressing noise; and constructing a cross-scale adaptive fusion pyramid, and performing up-sampling from top to bottom, dimension reduction adaptation, feature splicing and DFEM enhanced transmission of deep semantics, down-sampling from bottom to top, residual addition and CSPLayer enhanced supplementation of shallow details to realize multi-scale feature bidirectional fusion. And subsequently, through residual transformation and dynamic space attention secondary enhancement, high-quality features are output. The model is trained by adopting a total loss function of classification, bounding box and GIoU loss weighting, multi-scale defects of the welding seam can be accurately detected, and the problems of leak detection of weak feature defects and noise misjudgment are solved.
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 technology, specifically a dual-domain, cross-scale fusion RT-DETR ultrasonic phased array defect detection method. Background Technology

[0002] Phased Array Ultrasonic Testing (PAUT) technology, with its core advantages such as controllable beam angle, dynamically adjustable focusing depth, and intuitive imaging, has become a core means of ensuring the quality of welded components in critical fields such as aerospace, petrochemicals, and machinery manufacturing. During the testing process, this technology generates scanned images reflecting the internal structure of the workpiece. Analysis of these images allows for the precise identification of various weld defects, including porosity, cracks, lack of fusion, and incomplete penetration, providing crucial support for the operational safety of core components.

[0003] Currently, the post-processing and defect interpretation of ultrasonic phased array scan images mainly rely on image processing algorithms and the automatic detection software built into some high-end instruments. In recent years, general target detection algorithms such as the YOLO series and Faster R-CNN have been introduced into the field of ultrasonic phased array defect detection, thereby effectively improving the detection accuracy to a certain extent.

[0004] However, the above-mentioned methods also face some problems in practical use: Firstly, conventional image processing algorithms struggle to effectively capture subtle features such as small-sized defects like pores and low-contrast, weak-feature defects like incomplete fusion. General deep learning models lack targeted feature enhancement mechanisms, making it impossible to fully extract effective information from weak-feature defects.

[0005] Secondly, in ultrasonic phased array scanning images, electronic noise, grain scattering noise, and structural noise generated by weld excess height and misalignment coexist. The above processing methods lack efficient noise suppression and signal discrimination capabilities, and are prone to misjudging noise or non-hazardous signals as real defects, resulting in a persistently high false alarm rate.

[0006] Third, weld defects span a wide range of scales, from micron-sized pores to through-cracks. Existing models have imperfect cross-scale feature fusion mechanisms, either losing semantic information of small targets in deep feature extraction or lacking detailed supplementation of large-scale defects in shallow features, resulting in missed detection of small defects, misdetection or positioning of large-scale defects, and failing to achieve accurate detection of defects across all scales.

[0007] Therefore, there is an urgent need for an ultrasonic phased array defect detection technology that can simultaneously solve the problems of strong noise interference, difficulty in weak feature extraction, and cross-scale defect detection, in order to meet the high-precision and high-reliability detection needs of the industrial field. Summary of the Invention

[0008] To address the common technical problems of missed detection of weak feature defects, misjudgment due to noise interference, and inaccurate multi-scale defect detection in ultrasonic phased array scanning images, this invention provides a dual-domain cross-scale fusion RT-DETR model for defect detection in ultrasonic phased arrays. Based on this dual-domain cross-scale fusion RT-DETR model, this invention also provides a defect detection method based on ultrasonic phased arrays and an electronic product.

[0009] To achieve the above objectives, the present invention provides the following technical solution: A dual-domain, cross-scale fusion RT-DETR model for ultrasonic phased array defect detection includes: Backbone network extracts multi-scale features from input images; The dual-domain channel mapper receives multi-scale features and generates enhanced features, and includes sequentially connected channel unification and normalization units, spatial domain feature enhancement branches, frequency domain feature enhancement branches, feature splicing layers, and dynamic spatial attention modules. The cross-scale adaptation fusion pyramid receives enhanced features and performs bidirectional cross-scale fusion through a top-down semantic delivery path and a bottom-up detail supplementation path. The bidirectional paths respectively pass through deep feature enhancement units and cross-stage local layer processing fusion nodes to generate feature pyramids. The Transformer encoding / decoding module performs global feature association modeling on the feature pyramid and interacts with the initialized target query vector to output defect feature representations; The detection head predicts the probability of defect categories and the bounding box regression offset based on defect feature representation.

[0010] Further improvements based on the above technical solution: The backbone network is a ResNeSt-50 network, which includes four consecutive feature extraction stages for downsampling the input image layer by layer to extract multi-scale features. The parameters of the first feature extraction stage are frozen during training and inference.

[0011] Further improvements to the above technical solution: The components of the dual-domain channel mapper are as follows: The channel unification and standardization unit is used to perform channel number unification mapping and batch normalization on the input multi-scale features to obtain standardized features; The spatial domain feature enhancement branch is used to perform convolution operations on the normalized features to expand the receptive field and capture fine-grained spatial features, and fuse the input and output through residual connections; The frequency domain feature enhancement branch is used to transform the normalized features to the frequency domain and decompose them into amplitude and phase components. The amplitude and phase components are optimized based on the attention mechanism, and the optimized components are resynthesized and inversely transformed back to the spatial domain to obtain the denoised and enhanced frequency domain features. The feature concatenation layer is used to concatenate the output of the spatial domain feature enhancement branch and the output of the frequency domain feature enhancement branch in the channel dimension to obtain dual-domain concatenated features. The dynamic spatial attention module is used to generate a spatial attention map based on the two-domain concatenation features, and to weight the two-domain concatenation features to output enhanced features.

[0012] Further improvements to the above technical solution: The frequency domain feature enhancement branch specifically performs the following operations: The normalized features are transformed to the frequency domain by fast Fourier transform and decomposed into amplitude and phase components. The amplitude component is sequentially processed by a first 1×1 convolution, LeakyReLU activation, SELayer-based channel attention weighting, and a second 1×1 convolution. The output of the second 1×1 convolution is then added to the original amplitude component via a residual connection to obtain the optimized amplitude component. The phase component is processed in the same way as the amplitude component to obtain the optimized phase component; The optimized amplitude and phase components are recombined into complex features and mapped back to the spatial domain through inverse Fourier transform.

[0013] Further improvements to the above technical solution: The cross-scale adaptation and fusion pyramid includes: The top-down semantic transmission path is used to sequentially upsample the deep enhancement features from the dual-domain channel mapper, concatenate them with the corresponding scale mid-layer and shallow enhancement features, and input the concatenated features into the deep feature enhancement unit for processing, thereby realizing the transmission of semantic information from top to bottom. The Bottom-Up detail supplementation path is used to downsample the shallow fusion features obtained by the Top-Down semantic transfer path, fuse them with the corresponding scale of mid-level and deep features, and input them into the cross-stage local layer for processing, so as to supplement detailed information from bottom to top. The output layer is used to perform 1×1 convolution and batch normalization calibration on the shallow, middle and deep fused features obtained from the Top-Down semantic delivery path and the Bottom-Up detail supplementation path, and the output forms a feature pyramid.

[0014] Based on the above technical solution, the processing procedure of the deep feature enhancement unit is as follows: Step 1: Perform 1×1 convolution on the input features to compress the channels. After batch normalization and distribution calibration, introduce nonlinear transformation through the ReLU activation function and add the first residual with the original input features of the deep feature enhancement unit to obtain the preprocessed features. Step 2: Weight the preprocessed features using a dynamic spatial attention mechanism to enhance the features of the defect region and suppress background redundancy; Step 3: Perform 3×3 convolution on the weighted features to extract fine-grained details. After batch normalization and calibration, process them with the ReLU activation function and add them to the residuals of the weighted features in Step 2 for the second time. The features output from step three are processed again by the ReLU activation function, and after a third residual addition with the original input features of the deep feature enhancement unit, the final enhanced features are output.

[0015] Further improvements to the above technical solution: The Transformer encoding / decoding module includes: The encoder is used to perform global feature association modeling on the input feature pyramid. It adopts a multi-head self-attention mechanism and embeds sinusoidal positional coding. The decoder is a multi-layer deformable Transformer decoder used to initialize a set of target queries and use a deformable attention mechanism to allow the target queries to interact with the features output by the encoder, and output feature representations after iterative updates.

[0016] Further improvements based on the above technical solution: the detection head is optimized using a multi-task collaborative loss function during training; the multi-task collaborative loss function is a weighted sum of classification loss, bounding box regression loss and GIoU loss; the classification loss adopts IoU-weighted variable focus loss, and the bounding box regression loss adopts L1 loss.

[0017] A defect detection method based on ultrasonic phased array includes the following detection steps: S1. Acquire ultrasonic phased array scanning images of the workpiece to be inspected, and preprocess the scanning images; S2. Input the preprocessed scanned image into the above-mentioned dual-domain cross-scale fusion RT-DETR model for ultrasonic phased array defect detection. S3. Based on the category probability and bounding box regression offset output by the detection head, after filtering out duplicate predicted boxes through non-maximum suppression processing, the category and location information of the defect are determined and output, thus completing the defect detection.

[0018] An electronic device includes 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 aforementioned defect detection method based on an ultrasonic phased array.

[0019] Compared with the prior art, the beneficial effects of the present invention are: This invention presents a dual-domain, cross-scale fusion RT-DETR model for ultrasonic phased array defect detection. Through a collaborative architecture design of a backbone network, a dual-domain channel mapper, a cross-scale adaptive fusion pyramid, a Transformer encoding / decoding module, and a detection head, it provides a targeted solution for the entire process from feature extraction, enhancement, fusion to modeling and prediction. This model accurately addresses common technical problems in ultrasonic phased array scanning images, such as missed detection of weak feature defects, misjudgment due to noise interference, and inaccurate multi-scale defect detection. The model's dual-domain channel mapper serves as the core enhancement unit. Its spatial domain branch expands the receptive field and captures fine-grained spatial features of defects through convolution operations, while residual connections prevent the dilution of weak features. The frequency domain branch decomposes amplitude and phase components through frequency domain transformation, optimizes and amplifies high-frequency defect signals while suppressing low-frequency noise through an attention mechanism, and then the dynamic spatial attention module adaptively weights the dual-domain features, making weak feature defects stand out at the feature level, thus fundamentally solving the problem of weak feature defects. This addresses the issue of missed detections. Simultaneously, the noise suppression capability of the frequency domain branch, combined with the enhancement of cross-scale semantic-detail features of real defects by the cross-scale adaptive fusion pyramid, along with the global feature association modeling of the Transformer encoding / decoding module, effectively distinguishes the feature differences between noise, non-hazardous signals, and real defects, avoiding misjudgments caused by local similarity and reducing the false alarm rate caused by noise interference. Furthermore, the multi-scale basic features extracted by the backbone network, through the bidirectional path of top-down semantic transmission and bottom-up detail supplementation of the cross-scale adaptive fusion pyramid, are optimized at the fusion node by deep feature enhancement units. This achieves the supplementation of semantic information for small-scale defects and the enhancement of detailed information for large-scale defects. Combined with the deformable attention mechanism and target query interaction of the Transformer encoding / decoding module, and the accurate prediction of the detection head, this ensures that small defects are not missed and avoids misdetection or location deviation of large-scale defects, achieving accurate detection of defects across all scales. Attached Figure Description

[0020] Figure 1 This is a schematic diagram of the detection process of the ultrasonic phased array in this invention.

[0021] Figure 2 This is a schematic diagram of the overall architecture of the DCSF-RTDETR model in this invention.

[0022] Figure 3 This is a schematic diagram of the dual-domain channel mapper in this invention.

[0023] Figure 4 This is a schematic diagram of the cross-scale adaptation and fusion pyramid structure in this invention.

[0024] Figure 5 This is a schematic diagram of the structure of the depth feature enhancement unit in this invention.

[0025] Figure 6 This is a visualization of the weld defect detection in this invention. Detailed Implementation

[0026] 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 embodiments of the present invention, and not all embodiments. 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.

[0027] like Figures 1-5 As shown, this invention addresses the technical bottlenecks of existing ultrasonic phased array scanning image defect detection methods in terms of missed detection of weak feature defects, misjudgment due to complex noise interference, and accurate simultaneous identification of multi-scale defects. It proposes a dual-domain cross-scale fusion RT-DETR model (DCSF-RTDETR) and a corresponding detection method. By constructing a dedicated network architecture including a dual-domain channel mapper (DDCM) and a cross-scale adaptive fusion pyramid (CSAFP), defect features are enhanced and noise suppressed in both the spatial and frequency domains. A bidirectional cross-scale fusion mechanism is used to balance semantic and detail information. Finally, a Transformer encoder-decoder is used to achieve global modeling and accurate prediction. Experiments show that the detection method of this invention significantly outperforms existing mainstream models on the constructed PAUT-Welds dataset, effectively improving the detection rate and recognition accuracy of various weld defects such as micropores, low-contrast incomplete fusion, and cracks, meeting the practical needs of industrial scenarios for automated, high-reliability non-destructive testing.

[0028] I. Data Processing

[0029] like Figure 1 As shown, the entire process of using ultrasonic phased array (PAUT) to inspect weld defects in an industrial setting is fully demonstrated: starting from the production site on the left, various weld defects generated during the welding process are presented. Then, the inspection stage begins. First, a suitable ultrasonic phased array probe is selected, and then the weld is scanned using ultrasonic phased array equipment to generate a fan-shaped ultrasonic image containing defect features (such as...). Figure 6 (As shown in the figure). Finally, in the defect analysis stage, professional software is used to process and identify the detection images, accurately distinguishing typical weld defects such as air-hole, crack, incomplete penetration, unfused, and non-critical defects, clearly presenting the complete technical chain from defect generation to accurate detection and analysis.

[0030] use Figure 1 The process involves acquiring ultrasonic phased array scan images, performing data augmentation and defect annotation, and constructing the PAUT-Welds dataset. The specific steps are as follows: 1. A high-precision ultrasonic phased array detector is used, equipped with a linear array probe suitable for inspecting welded products. Through dynamic focusing and curved surface coupling technology, scanned images of weld seams in membrane walls and small-diameter pipes (outer diameter ≤ 100mm) are acquired. The acquired scanned images are named according to a standardized system to ensure traceability of image information.

[0031] 2. To improve the model's generalization ability, multimodal data augmentation processing is performed on the scanned images, including but not limited to geometric transformations, grayscale transformations, and composite enhancements: Random rotation simulates image changes under different detection angles; horizontal flipping increases image diversity; scaling adapts to defect features under different imaging ratios; Gaussian noise is added to simulate electronic and scattering noise in actual detection; contrast is adjusted to highlight low-contrast defects; histogram equalization improves the overall visual effect of the image; MixUp technology generates new synthetic images to increase sample diversity; CutOut technology simulates local image occlusion to improve model robustness.

[0032] 3. LabelMe was used to annotate the enhanced images, including the defect category and bounding box coordinates. The PAUT-Welds dataset contains 2943 weld scan images and annotates 3961 defect samples. A 7:3 stratified sampling strategy was used to divide the dataset into a training set (2060 images, 2773 defects) and a validation set (883 images, 1188 defects) to ensure that the proportion of each defect type in the two subsets is consistent with the total. The distribution of each category is shown in Table 1 below. Table 1. Class Distribution of PAUT-Welds Dataset

[0033] II. Defect Identification

[0034] like Figure 2As shown, the overall architecture of the dual-domain cross-scale fusion RT-DETR model includes input preprocessing, a ResNeSt-50 backbone network, a dual-domain channel mapper (DDCM), a cross-scale adaptive fusion pyramid (CSAFP), a Transformer encoding / decoding module, and a detection head. The backbone network uses ResNeSt-50 to extract multi-scale basic features; the dual-domain channel mapper achieves weak feature enhancement and noise suppression; the cross-scale adaptive fusion pyramid generates a semantically-detail-balanced feature pyramid; the Transformer encoding / decoding module captures global feature associations; and the detection head outputs defect category and bounding box information. The dual-domain cross-scale fusion RT-DETR model is trained and used on the PAUT-Welds dataset to identify weld defects, specifically including six core steps: feature extraction, dual-domain enhancement, cross-scale fusion, encoding / decoding modeling, detection head prediction, and model training.

[0035] (a) Dual-domain channel mapper

[0036] 1. Multi-scale feature extraction of backbone network

[0037] The preprocessed image C is first input into the ResNeSt-50 backbone network. The backbone network downsamples layer by layer through four consecutive feature extraction stages, using grouped convolution and multi-path feature fusion to capture fine-grained texture and defect edge features of the scanned image. To avoid the low-level texture features being corrupted by overtraining, the parameters of the first stage of the network are normalized, and the weights of this stage are not updated during forward propagation, ensuring that the basic details of the original image are not lost. The output consists of the second, third, and fourth groups of multi-scale features S2, S3, and S4, which have decreasing resolution and increasing semantics, forming S={S2,S3,S4}. Among them, S2 focuses on fine-grained details such as defect edges and texture; S3 balances details and semantic information, adapting to medium-sized defects; and S4 captures high-level semantic features such as the global distribution and overall shape of defects.

[0038] 2. Unified and standardized channel units

[0039] The structure of the Dual Domain Channel Mapper (DDCM) is as follows: Figure 3 As shown, to address the issues of inconsistent feature channel numbers and distribution offsets across different scales, a 1×1 convolution is used in the channel unification and normalization unit to uniformly map S2, S3, and S4 to channels of the same dimension. Then, batch normalization is performed to calibrate the feature distribution, avoiding information interference caused by dimensional redundancy in subsequent dual-domain processing. The formula is: ; ; In the formula, X represents the preprocessed feature; X' represents the standardized feature; Conv 1×1represents a 1×1 convolution operation; BN represents batch normalization.

[0040] 3. Spatial Domain Feature Enhancement Branch

[0041] A 3×3 convolution is performed on the standardized feature X' to expand the receptive field and capture fine-grained spatial features such as defect edges and shapes. A non-linear transformation is introduced through the GELU activation function to enhance feature expressiveness and avoid gradient vanishing. Two dimension-invariant 3×3 convolutions are then used to strengthen the local semantic associations of defect details. Finally, residual connections are used to fuse the preprocessed feature X with the convolutional output features, ensuring that basic details in the original features are not lost and specifically enhancing the spatial discriminability of weak feature defects. The formula is as follows: ; ; ; ; Among them, Conv 3×3 This represents a 3×3 convolution operation; X'' is the intermediate feature obtained after performing a 3×3 convolution on the input feature X'; GELU is the Gaussian error linear unit activation function; X G Features after GELU activation; X C For X G The features obtained after performing two consecutive 3×3 convolutions; ⊕ represents the element-wise addition operation of the residual connection; X''' represents the final output feature of the spatial domain feature enhancement branch.

[0042] 4. Frequency Domain Feature Enhancement Branch

[0043] The normalized feature X' is transformed to the frequency domain and decomposed into amplitude and phase components. The amplitude component reflects the frequency intensity of the feature, and the phase component reflects the spatial location information of the feature. The formula is: ; Wherein, FFT is the two-dimensional real fast Fourier transform (2D-iFFT); j is the imaginary unit; mag corresponds to the original amplitude component feature obtained by decomposing the ultrasonic phased array feature after Fourier transform in the frequency domain branch; pha is the original phase component feature obtained by decomposing the ultrasonic phased array feature after Fourier transform, reflecting the spatial position and phase relationship of the frequency signal, and is one of the core components of the frequency domain feature.

[0044] mag through Convolution adjusts the channel dimension of the amplitude component, and then LeakyReLU activation is used to introduce non-linearity to avoid gradient vanishing of low-activation-value features. LeakyReLU is the activation function that avoids gradient vanishing of low-activation-value features; the formula is: ; ; Among them, mag c These are the intermediate features obtained after performing a 1×1 convolution on mag; mag L For mag c The amplitude component enhancement feature obtained after LeakyReLU activation.

[0045] An attention mechanism, SELayer, is introduced to focus on key information and filter out redundancy and noise. SELayer generates channel attention weights through global average pooling and fully connected layers, achieving adaptive enhancement of effective frequency channels. The convolution optimizes the amplitude component, which is then connected to the original amplitude component via a residual to preserve the original information and avoid feature loss due to over-optimization. The formula is as follows: ; ; ; Among them, SELayer is the squeeze-excitement attention layer; mag SE The enhancement magnitude feature of mag after SELayer attention weighting; mag c : for mag SE Intermediate amplitude features after 1×1 convolution; mag out This represents the final output amplitude component characteristic of the process.

[0046] Similarly, the phase component is optimized using the same structure as the amplitude component. Phase offset is compensated through residual connections to improve the spatial positioning accuracy of defects and generate the amplitude component pha. out The formula is: ; ; ; ; ; Among them, pha c The intermediate phase feature obtained after 1×1 convolution of the original pha; pha L for pha c The nonlinear phase characteristics obtained after LeakyReLU activation; pha SE for pha L Enhanced phase features obtained after SELayer attention weighting; pha c pha SEThe adjusted phase feature obtained after another 1×1 convolution; pha out The final output phase component characteristics of this process are derived from the processed pha. c It is obtained by fusing with the pha residual.

[0047] The optimized amplitude component mag out With phase component pha out The formula for resynthesizing complex frequency domain features is: ; Wherein, G' represents the synthesized, optimized complex frequency domain feature, which is the core output of the frequency domain processing; cos(pha) out ), sin(pha) out ) are the phase components pha out The cosine and sine transformations are the core operations for converting the "amplitude-phase polar coordinate form" into the "real-imaginary rectangular coordinate form".

[0048] Then, by applying an inverse Fourier transform, it is mapped back to the spatial domain to obtain the denoised frequency domain enhanced features: ; Where G'' is the output of this step, which is the enhanced spatial domain feature mapped back from the frequency domain to the spatial domain; iRFFT is the inverse real fast Fourier transform.

[0049] 5. Feature splicing layer

[0050] Spatial domain feature X''' and frequency domain feature G'' are concatenated along the channel dimension to achieve preliminary complementarity between spatial details and the denoised signal, outputting a dual-domain concatenated feature P: ; Contcat is used for concatenation operations.

[0051] 6. Dynamic Spatial Attention Module

[0052] Global average pooling is performed on the concatenated two-domain features P to extract the global feature descriptor for each sample, reflecting the overall feature distribution of the samples: ; Here, P' is the output of this step, which is the global average feature obtained after P is averaged. AvgPool is the average pooling operation, which compresses spatial information while retaining global statistical features of the channel dimension by calculating the mean of the feature's spatial dimension.

[0053] By using 1×1 convolution and the ReLU activation function, and then reshaping the spatial dimensions, sample-specific 3×3 convolution kernel parameters are generated: ; ; ; Among them, P c P is the intermediate feature obtained after P' is convolved with a 1×1 matrix; P R For P c The nonlinear features obtained after ReLU activation; Reshape is a shape reshaping operation that adjusts the dimensional layout of the features; K is the output of this process, i.e., the dynamic convolution kernel adapted to subsequent convolution operations.

[0054] To generate a spatial attention map consistent with the feature resolution, the channel-dimensional average of the concatenated bi-domain feature P is performed to obtain the spatial descriptor: ; Where, mean is the mean operation of the channel dimension, which is the average of all channel dimensions of the feature; The output of this step is the mean feature of P in the channel dimension.

[0055] Will Perform grouped convolutions with a dedicated kernel K to ensure that each sample uses only its own kernel: ; Here, GroupConv is a grouped convolution operation that groups the input features and convolution kernels by channel before performing convolution, combining lightweight and channel independence characteristics; P'' is the output of this step, i.e. Intermediate features after grouped convolution processing.

[0056] Performing sigmoid activation on P'' maps the output to... From the intervals, we obtain the spatial attention map: ; Here, Sigmoid is the Sigmoid activation function, which maps the values ​​of the input features to the range of 0 to 1; P''' is the output of this step, i.e., the spatial attention weight map.

[0057] Element-wise multiplication is performed between the spatial attention map P''' and the dual-domain concatenated feature P to achieve weighted enhancement of defect region features and weighted suppression of background region features, resulting in the final output features of the DDSCM model: ; Here, S' is the output of this step, which is the feature after attention enhancement.

[0058] DDSCM unifies the number of feature channels at each scale through convolution, and then embeds a dual-domain nonlinear mapping and dynamic spatial attention to enhance target features in the spatial and frequency domains respectively, adaptively suppressing background interference. It solves the problems of poor spatial heterogeneity adaptation and insufficient target localization accuracy of traditional channel mappers, and significantly improves feature discriminativeness.

[0059] (II) Cross-scale Adaptation and Fusion Pyramid

[0060] The network structure of the Cross-Scale Adaptive Fusion Pyramid (CSAFP) is as follows: Figure 4 As shown, the enhanced features Inputting into the CSAFP module, a semantically-detail-balanced feature pyramid is generated through bidirectional cross-scale fusion and DFEM deep enhancement. The specific process is as follows: 1. Top-Down semantic delivery path Multiscale features with DDCM as input Deep semantic features Through upsampling and Size adaptation, resulting in adaptation features : ; in, The input attention enhancement features (combined with the previous process, corresponding to the deep low-resolution features in the cross-scale fusion pyramid, have already completed the enhancement of defect information and noise suppression through dynamic spatial attention); Upsample is an upsampling operation (usually using bilinear interpolation or transposed convolution) used to improve the spatial resolution of features and achieve dimensional alignment of features at different scales. The output of this step, i.e., the upsampled features, is matched with the shallow features in the pyramid (such as the 3rd layer) at a resolution that prepares for subsequent cross-scale feature fusion.

[0061] Features Channel layer compression (ReduceLayers) is performed for channel calibration before cross-scale feature fusion: ; Among them, ReduceLayers are dimensionality reduction adaptation layers (usually including 1×1 convolution, batch normalization, etc.) used to compress the feature channel dimension and eliminate feature distribution shifts caused by scale differences. The output of this step, namely the dimensionality-reduced and adapted features, is matched with the number of channels and shallow features to prepare for subsequent cross-scale fusion.

[0062] With mid-layer details Channel concatenation is performed and input into a Deep Feature Enhancement Unit (DFEM). Dynamic attention is used to enhance the complementary information of the two channels, suppress redundant noise, and output fused features. ; ; in, The concatenated cross-scale fusion features possess both deep semantic information and shallow detail information; DFEM stands for Deep Feature Enhancement Module, which typically includes operations such as convolution and dynamic spatial attention to enhance the expressive power of cross-scale features; The final cross-scale fusion feature after DFEM enhancement is the output feature of the third layer of the pyramid.

[0063] Similarly, Through upsampling and Size adaptation, achieved through channel compression and low-level semantic features The input is concatenated into a DFEM, and the output is a low-scale fused feature. .

[0064] Top-down processing enables the transfer of semantics from deep layers to shallow features, addressing the semantic deficiencies caused by small-scale defects. The formula is as follows: ; ; ; ; in, The upsampled features prepare for subsequent cross-scale fusion; ReduceLayers are dimensionality reduction adaptation layers (usually containing 1×1 convolutions and batch normalization) that compress the channel dimensions of the upsampled features, making them compatible with the original shallow features of the second layer of the pyramid. Matching the number of channels; The features are adapted for dimensionality reduction, with aligned channel numbers and more compact information; The spliced ​​cross-scale fusion features possess both deep semantic information and shallow detail information. The final enhanced fusion feature of the second layer is the output of the second layer of the pyramid.

[0065] 2. Bottom-Up Detail Supplement Path

[0066] shallow high-resolution features It transmits detailed information to deeper levels to supplement large-scale defects.

[0067] First, through downsampling and Scale matching yields features While preserving shallow details: ; in, The downsampled features of the output serve as key inputs to the bottom-up path, supplementing the details of the third-layer features.

[0068] shallow detail features With the semantic features of the middle layer Fusion: ; in, The output is the final feature after bidirectional fusion of the third layer, which has both high semantic and high detail information.

[0069] The fused features The input is fed into the cross-stage local layer (CSPLayer). CSPLAYE employs a branched architecture with a lightweight preprocessing branch and a RepVGG fine-grained enhancement branch to achieve accurate extraction of local discriminative features and effective suppression of redundant information. ; Among them, CSPlayer is the Cross Stage Partial Layer, which is the core module of CSPNet. It achieves efficient feature enhancement through feature splitting, branch convolution and residual fusion. The output is the third layer feature enhanced by CSPlayer, which has stronger discriminative power and higher computational efficiency.

[0070] Similarly, By downsampling and Size adaptation, in conjunction with deep semantic features Feature fusion is performed, and the fused features are then input into CSPLAYer to obtain features containing large-scale defect details. .

[0071] The bottom-up path supplements shallow details to deep features, enriching the details of edges and textures in large-scale defects. The formula is as follows: ; ; ; in, The downsampled features of the output are used as input to the bottom-up path to supplement the 4th layer with detailed information about small-scale defects; The output fused features possess both the details of small-scale defects and the semantic information of large-scale defects. The fourth layer of output is the final enhanced feature, which has stronger discriminative power and less redundant information, providing high-quality input for subsequent defect detection.

[0072] Finally, the shallow high-resolution fusion features are... Mesoscale structural features Large-scale defect detail features The features are output to the Transformer encoder via 1×1 convolution and batch normalization (BN): ; Among them, P2, P3, and P4 correspond to the three levels of input features, which are adapted features with unified channel dimensions and stable distribution, providing a consistent input basis for subsequent modules.

[0073] 3. Deep Feature Enhancement Unit

[0074] The Deep Feature Enhancement Unit (DFEM) improves the discriminative power of defect features by extracting semantic and detail associations from cross-scale spliced ​​features through channel preprocessing, global feature guidance, dynamic attention generation, and residual enhancement. Its structure is as follows: Figure 5 As shown.

[0075] The input to DFEM is the features concatenated at two scales in the Top-Down path, which are then compressed in dimensionality using a 1×1 convolution. Layers eliminate the distribution differences in splicing features and introduce... The nonlinear discriminative power of enhanced features is activated to complete channel compression and feature preprocessing, while the original input is preserved through residual connections, as shown in the following formula: ; ; ; ; Among them, F D The input is enhanced features (such as features from a certain layer after cross-scale fusion, containing semantic and detailed information about multi-scale defects); M c Adjust the intermediate features of the output channels; M B M represents the normalized features of the output. R M is the nonlinear activation feature of the output; M′ is the final enhanced feature after residual fusion of the output.

[0076] To accurately enhance defect regions and suppress background redundancy in cross-scale features, Dynamic Spatial Attention (DSA) proposed by Dual Domain Channel Mapper (DDCM) is introduced. DSA is applied to the preprocessed feature M′ to perform feature weighting, achieving both defect region response enhancement and background redundancy suppression across scales. ; Among them, M D The output dynamic spatial attention-enhanced features further enhance the features of the defect region while suppressing the background and noise regions.

[0077] Attention-weighted features M D Local fine-grained details of defects are extracted using 3×3 convolution. The convolutional features are then fed into a Batch Normalization (BN) layer to calibrate the feature distribution. The normalized features are then fed into a ReLU activation function, and finally combined with Dynamic Spatial Attention (DSA) to output feature M. D The formula for summing the residuals is as follows: ; ; ; ; Here, M′′ represents the final fusion enhancement feature of the output, which simultaneously possesses the defect information of spatial attention focusing and the correlation information of channel nonlinear transformation.

[0078] The discriminative power of secondary amplification of defect features is enhanced by introducing residual connections to suppress potentially redundant background information. The signal is then fed again into the ReLU activation function, along with F... D Add the residuals together to get the final output: ; Where F′′ is the final enhanced feature tensor output, which is the final result of the entire deep feature enhancement module.

[0079] This step enhances the local details and discriminative power of defects while preserving the global semantics of features through residual connections. DFEM ensures the signal strength of weak feature defects and the feature continuity of long defects, providing semantically detailed and highly discriminative features for subsequent cross-scale fusion. CSAFP, through bidirectional cross-scale fusion and DFEM depth enhancement, balances semantic and detailed features, improves the distinguishability of similar signals, and effectively solves the problems of misjudgment of weld defects and detection of long defects.

[0080] (III) Transformer Encoding / Decoding Module

[0081] The Transformer encoder and head structure using the RTDETR framework are used to fuse the cross-scale features output by CSAFP. After concatenation, the data is input into a Transformer encoder, which uses a multi-head self-attention mechanism to capture global correlation information and enhance the continuity of defect features. At the same time, sinusoidal positional encoding is embedded to preserve spatial positional relationships, and the encoded features E are output.

[0082] A multi-layer deformable Transformer decoder (Transformer dncoder) is employed to initialize 300 target queries. By generating reference points and using a deformable attention mechanism, the decoder focuses on the defect region and deeply interacts with the encoded features E. The query vector is iteratively updated to output a feature representation D that accurately represents the defect information. feat .

[0083] (iv) Detection head

[0084] To address the challenges of weak feature classification, inaccurate boundary localization, and easy confusion between similar signals in weld defect detection, DCSF-RTDETR employs a multi-task collaborative loss function. This function provides comprehensive and targeted supervision signals for model training through a weighted fusion of classification loss, bounding box regression loss, and GIoU loss. The total loss function... The definition is as follows: ; in, , , These are classification loss, bounding box regression loss, and GIoU loss, respectively.

[0085] , , These are the weighting coefficients for each loss component, used to balance the training priorities of classification and localization tasks, adapting to the scenario requirements of weld defect detection.

[0086] 1. Classification of losses

[0087] use Weighted Varifocal Loss balances positive and negative sample ratios with weak feature defect supervision: ; in, For the model Predicted probability after activation Used to strengthen the weights of hard-to-separate samples Balance the loss contributions of positive and negative samples; for Weighting factor, which compares the predicted bounding box with the ground truth bounding box. The value is incorporated into the loss calculation, and higher supervisory weights are given to weak feature defects such as micropores and low-contrast non-fusion, which effectively alleviates the problem of missed detection caused by the imbalance of positive and negative samples.

[0088] 2. Bounding box regression loss

[0089] Select The loss function directly optimizes the coordinate deviation between the predicted bounding box and the ground truth bounding box. ; in, and These are the center coordinates and width and height of the predicted and actual bounding boxes, respectively. This loss function is sensitive to bounding box position offsets, enabling rapid and accurate positioning of irregular or long-distance weld defects and reducing incomplete inspections.

[0090] 3. loss

[0091] In response to traditional To address the vanishing gradient limitation of loss functions when bounding boxes do not overlap, we employ... Loss optimization: Reasonableness of bounding box position and size.

[0092]

[0093] in, For intersection, union, and comparison, For generalized intersection and comparison; For the prediction box, For the true frame, The area of ​​the intersection of the two frames Let be the area of ​​the union of the two frames. For inclusion and The smallest closure rectangle, For its area, This represents the area of ​​the region within the closure rectangle that is not covered by the two bounding boxes. Therefore... Loss is defined as: ; This loss not only focuses on the degree of overlap of the boxes, but also constrains the position of the bounding boxes through the penalty term of the closure region. It can provide effective gradients even if the predicted box does not overlap with the real box, which is particularly suitable for the needs of blurred weld defect boundaries and similar signal differentiation, thus improving the accuracy of defect boundary prediction.

[0094] III. Experimental Evaluation

[0095] To quantify the comprehensive performance of the ultrasonic phased array scanning image defect detection model, a multi-level evaluation system was constructed, including basic classification indicators and detection accuracy indicators, based on true instances of the core elements of the confusion matrix. False negatives False positives , true negative example Calculate the mean precision ( ), accuracy ( ), recall rate ( ).

[0096] ; ; ; in, This represents the total number of defect categories. It is the first Class defects in Average accuracy over time Is The average precision over time.

[0097] Recall reflects the model's overall ability to recall various types of defects; Precision measures the model's accuracy in classifying various types of defects. By comparing these metrics, the model's performance in defect detection can be evaluated. See Table 2 for details: This is the mAP when the IoU threshold is 0.5.

[0098] This is the mAP when the IoU threshold is 0.75.

[0099] (Small AP) evaluates the model's ability to detect difficult-to-detect defects such as microcracks and small pores by assessing the average accuracy of small defects with a size ≤2mm.

[0100] (Medium AP) focuses on the average accuracy for medium-sized defects ranging from 2 to 10 mm, with particular attention to the detection performance of irregular defects.

[0101] Grid-RCNN is an improved model based on the R-CNN series. It optimizes target localization accuracy through grid prediction and is suitable for scenarios with high localization requirements.

[0102] defficientDet is a high-efficiency detection model proposed by Google. It balances accuracy and speed through "composite scaling", making it lightweight and high-performing.

[0103] Gfl stands for Generalized Focal Loss, which extends Focal Loss and optimizes the quality estimation of classification and localization, thereby improving detection accuracy.

[0104] Paa stands for Probabilistic Anchor Assignment, which dynamically assigns the matching relationship between anchors and targets, thus solving the irrationality of traditional anchor assignment.

[0105] Centernet is a keypoint-based anchorless detection model that transforms detection into keypoint detection. It is fast, accurate, and suitable for real-time scenarios.

[0106] Centripetalnet is an improved version of CenterNet that introduces "centripetal offset" to optimize key point localization, thereby improving the detection performance of small and dense targets.

[0107] rtmdet is a real-time detection model proposed by Meituan, which balances accuracy and speed and performs well on both mobile and server-side devices.

[0108] Deformable-detr is an improved DETR model that introduces a deformable attention mechanism, reducing computational cost and improving small target detection performance.

[0109] hdino stands for High-Resolution DETR, which combines high-resolution features with a Transformer structure to improve the utilization of detailed information.

[0110] Diffusiondet is a detection model based on a diffusion model. It generates bounding boxes through a diffusion process and performs well in small sample sizes and complex scenarios.

[0111] DCSF-RTDETR is the model proposed in this invention, used to compare with the aforementioned mainstream models and demonstrate the performance advantages of its own method.

[0112] Table 2. Performance Comparison of Multiple Models for Ultrasonic Phased Arrays

[0113] As shown in Table 2, the overall detection performance of the model of this invention is significantly superior to that of the comparative model: The accuracy rate reached 52.0%, which is 2.90% higher than the second-best RTMDET, fully verifying the model's adaptability to weld defects of different shapes and sizes. It outperforms Centripetalnet, and can still stably distinguish between defects and background areas even in complex scenarios with background noise interference in ultrasound images and small differences in grayscale between defects and background, demonstrating stronger basic recognition capabilities. It surpasses RTMDET and can effectively support the actual needs of defect quantification analysis in industrial scenarios. This advantage stems from the dual-domain feature optimization mechanism designed specifically for the model, which can enhance the representation of weak defect signals and edge details, avoiding the problem of insufficient feature extraction of small, low-discrimination defects by traditional models.

[0114] From the perspective of detailed scale indicators The accuracy reached 49.8%, which is 2.1% and 4.1% higher than RTMDET and CentripetalNet, respectively, and it has a better ability to capture small-scale weak feature defects such as micropores and fine cracks. It outperforms models such as RTMDET and Grid-RCNN, and has higher accuracy in identifying medium-sized inclusions and local non-fusion. This confirms that the cross-scale adaptation and fusion mechanism can effectively balance the details of small defects and the semantics of medium defects, and solves the common problems of missed detection of small defects and misjudgment of medium defects in traditional models.

[0115] Compared to the robustness limitations of Transformer base models like Hdino in small defect detection, and the shortcomings of single-stage models like defficientdet in multi-scale feature fusion, DCSF-RTDETR achieves balanced and efficient detection of different types of defects such as porosity, microcracks, and incomplete penetration through an efficient feature interaction and adaptation mechanism, without any obvious performance shortcomings. While its precision is slightly lower than models like RTMDEt and Grid-RCNN, and its recall is slightly lower than Grid-RCNN and Hdino, this is an inherent trade-off between precision and recall in detection tasks. Some models improve precision by increasing the confidence threshold, but this may miss low-recognition defects. DCSF-RTDETR uses a low threshold design to ensure defect coverage, and a small number of false positives can be corrected through manual verification in industrial scenarios.

[0116] As can be seen from the comparison, other models either suffer from metric imbalances or insufficient core detection accuracy, while DCSF-RTDETR... , , and subdivision scale , While outperforming the comparison models, it achieves a reasonable balance between Precision and Recall, making it more suitable for the actual needs of accurate and reliable detection of industrial weld defects.

[0117] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A dual-domain, cross-scale fusion RT-DETR model for ultrasonic phased array defect detection, characterized in that, include: Backbone network extracts multi-scale features from input images; The dual-domain channel mapper receives multi-scale features and generates enhanced features, and includes sequentially connected channel unification and normalization units, spatial domain feature enhancement branches, frequency domain feature enhancement branches, feature splicing layers, and dynamic spatial attention modules. The cross-scale adaptation fusion pyramid receives enhanced features and performs bidirectional cross-scale fusion through a top-down semantic delivery path and a bottom-up detail supplementation path. The bidirectional paths respectively pass through deep feature enhancement units and cross-stage local layer processing fusion nodes to generate feature pyramids. The Transformer encoding / decoding module performs global feature association modeling on the feature pyramid and interacts with the initialized target query vector to output defect feature representations; The detection head predicts the probability of defect categories and the bounding box regression offset based on defect feature representation.

2. The dual-domain cross-scale fusion RT-DETR model for ultrasonic phased array defect detection according to claim 1, characterized in that, The backbone network is a ResNeSt-50 network, which includes four consecutive feature extraction stages for downsampling the input image layer by layer to extract multi-scale features. The parameters of the first feature extraction stage are frozen during training and inference.

3. The dual-domain cross-scale fusion RT-DETR model for ultrasonic phased array defect detection according to claim 1, characterized in that, The components of the dual-domain channel mapper are as follows: The channel unification and standardization unit is used to perform channel number unification mapping and batch normalization on the input multi-scale features to obtain standardized features; The spatial domain feature enhancement branch is used to perform convolution operations on the normalized features to expand the receptive field and capture fine-grained spatial features, and fuse the input and output through residual connections; The frequency domain feature enhancement branch is used to transform the normalized features to the frequency domain and decompose them into amplitude and phase components. The amplitude and phase components are optimized based on the attention mechanism, and the optimized components are resynthesized and inversely transformed back to the spatial domain to obtain the denoised and enhanced frequency domain features. The feature concatenation layer is used to concatenate the output of the spatial domain feature enhancement branch and the output of the frequency domain feature enhancement branch in the channel dimension to obtain dual-domain concatenated features. The dynamic spatial attention module is used to generate a spatial attention map based on the two-domain concatenation features, and to weight the two-domain concatenation features to output enhanced features.

4. The dual-domain cross-scale fusion RT-DETR model for ultrasonic phased array defect detection according to claim 3, characterized in that, The frequency domain feature enhancement branch performs the following operations: The normalized features are transformed to the frequency domain by fast Fourier transform and decomposed into amplitude and phase components. The amplitude component is sequentially processed by a first 1×1 convolution, LeakyReLU activation, SELayer-based channel attention weighting, and a second 1×1 convolution. The output of the second 1×1 convolution is then added to the original amplitude component via a residual connection to obtain the optimized amplitude component. The phase component is processed in the same way as the amplitude component to obtain the optimized phase component; The optimized amplitude and phase components are recombined into complex features and mapped back to the spatial domain through inverse Fourier transform.

5. The dual-domain cross-scale fusion RT-DETR model for ultrasonic phased array defect detection according to claim 1, characterized in that, The cross-scale adaptation and fusion pyramid includes: The top-down semantic transmission path is used to sequentially upsample the deep enhancement features from the dual-domain channel mapper, concatenate them with the corresponding scale mid-layer and shallow enhancement features, and input the concatenated features into the deep feature enhancement unit for processing, thereby realizing the transmission of semantic information from top to bottom. The Bottom-Up detail supplementation path is used to downsample the shallow fusion features obtained by the Top-Down semantic transfer path, fuse them with the corresponding scale of mid-level and deep features, and input them into the cross-stage local layer for processing, so as to supplement detailed information from bottom to top. The output layer is used to perform 1×1 convolution and batch normalization calibration on the shallow, middle and deep fused features obtained from the Top-Down semantic delivery path and the Bottom-Up detail supplementation path, and the output forms a feature pyramid.

6. The dual-domain cross-scale fusion RT-DETR model for ultrasonic phased array defect detection according to claim 5, characterized in that, The processing procedure of the deep feature enhancement unit is as follows: Step 1: Perform 1×1 convolution on the input features to compress the channels. After batch normalization and distribution calibration, introduce nonlinear transformation through the ReLU activation function and add the first residual with the original input features of the deep feature enhancement unit to obtain the preprocessed features. Step 2: Weight the preprocessed features using a dynamic spatial attention mechanism to enhance the features of the defect region and suppress background redundancy; Step 3: Perform 3×3 convolution on the weighted features to extract fine-grained details. After batch normalization and calibration, process them with the ReLU activation function and add them to the residuals of the weighted features in Step 2 for the second time. The features output from step three are processed again by the ReLU activation function, and after a third residual addition with the original input features of the deep feature enhancement unit, the final enhanced features are output.

7. The dual-domain cross-scale fusion RT-DETR model for ultrasonic phased array defect detection according to claim 1, characterized in that, The Transformer encoding / decoding module includes: The encoder is used to perform global feature association modeling on the input feature pyramid. It adopts a multi-head self-attention mechanism and embeds sinusoidal positional coding. The decoder is a multi-layer deformable Transformer decoder used to initialize a set of target queries and use a deformable attention mechanism to allow the target queries to interact with the features output by the encoder, and output feature representations after iterative updates.

8. A dual-domain cross-scale fusion RT-DETR model for ultrasonic phased array defect detection according to claim 1, characterized in that, The detection head is optimized using a multi-task collaborative loss function during training; the multi-task collaborative loss function is a weighted sum of classification loss, bounding box regression loss and GIoU loss; the classification loss adopts IoU-weighted variable focus loss, and the bounding box regression loss adopts L1 loss.

9. A defect detection method based on ultrasonic phased array, characterized in that, The following testing steps are included: S1. Acquire ultrasonic phased array scanning images of the workpiece to be inspected, and preprocess the scanning images; S2. Input the preprocessed scanned image into the dual-domain cross-scale fusion RT-DETR model for ultrasonic phased array defect detection according to any one of claims 1-8; S3. Based on the category probability and bounding box regression offset output by the detection head, after filtering out duplicate predicted boxes through non-maximum suppression processing, the category and location information of the defect are determined and output, thus completing the defect detection.

10. An electronic 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 defect detection method based on ultrasonic phased array as described in claim 9.