A synthetic data pre-training and domain adaptation method for an ultrasonic nondestructive testing deep learning model
By employing synthetic data pre-training and a hierarchical learning rate strategy for 3D convolutional neural network models, the problems of data scarcity and domain differences in ultrasonic nondestructive testing were solved, achieving efficient training and excellent performance on real data.
Patent Information
- Application Number
- CN202611204025.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-10
- Publication Date
- 2026-11-24
AI Technical Summary
Deep learning models face the problem of data scarcity in ultrasonic nondestructive testing. There is a large domain difference between synthetic data and real data. Existing fine-tuning strategies lead to shallow forgetting of physical features by the encoder and overfitting by the decoder. There is a lack of effective training objective design.
A 3D convolutional neural network model was used for pre-training on synthetic data. A hierarchical learning rate strategy and a defect region weighted loss function were used. Synthetic data was generated by an analytical ray tracing simulator and fine-tuned with real data to preserve shallow features of the encoder and optimize defect region reconstruction.
It effectively reduces the domain difference between synthetic and real data, improves model performance using limited real data, and ensures that the model performs well on real data.
Smart Images

Figure CN123160989A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of deep learning technology, specifically to a synthetic data pre-training and domain adaptation method for deep learning models for ultrasonic nondestructive testing. Background Technology
[0002] Deep learning technology is increasingly being used in the field of ultrasonic nondestructive testing (NDT), covering tasks such as defect classification, segmentation, and end-to-end imaging. However, training deep learning models in the NDT field faces a fundamental problem of data scarcity: real defect samples are extremely difficult to obtain—preparing test blocks with known defects is costly, and the annotation of defect types, locations, and sizes requires destructive testing verification. This results in the scale of real labeled data available in industrial NDT scenarios typically being only tens to hundreds of samples, far smaller than the scale of standard datasets in the natural image domain.
[0003] To alleviate the problem of data scarcity, a common practice in existing technologies is to pre-train the model using synthetic simulation data, followed by fine-tuning on a small amount of real labeled data. Synthetic data simulates ultrasonic propagation and defect scattering through analytical or numerical simulation, enabling the generation of labeled data pairs on a large scale without the need for physical test blocks.
[0004] However, existing synthetic data pre-training methods have the following technical drawbacks: First, there is a significant domain difference (sim-to-real gap) between synthetic simulation data and real-world acquired data. Taking ultrasonic FMC data acquisition as an example, synthetic data is usually based on an idealized point reflector model, assuming a homogeneous medium, no grain noise, and no complex geometric reflections; while real-world acquired data includes complex acoustic phenomena such as extended defects, grain noise, and back echo clutter. This domain difference means that the model weights pre-trained on synthetic data cannot directly produce high-quality results on real data, and the actual benefits of pre-training are limited.
[0005] Second, existing fine-tuning strategies typically employ a globally uniform learning rate to fine-tune the entire pre-trained model. This leads to the shallow layers of the encoder quickly forgetting the physical features learned on synthetic data (such as the physical structure of the FMC and sound wave propagation patterns) in the early stages of fine-tuning, while the deeper layers of the decoder are prone to overfitting due to the small scale of real data. There is a lack of a hierarchical fine-tuning strategy that can effectively preserve the physical feature learning results of the synthetic pre-training stage while allowing the image space level to be specialized to the distribution of real data.
[0006] Third, existing technologies do not design training objectives specifically for the evaluation dimensions of the NDT field. NDT detection focuses on the imaging quality of defect areas, while conventional image reconstruction loss functions (such as mean square error) are dominated by background pixels and cannot effectively guide the model to learn accurate reconstruction of defect areas.
[0007] Therefore, there is a need for a deep learning model training method for the NDT field that can effectively narrow the sim-to-real gap and make full use of limited real labeled data. Summary of the Invention
[0008] To address the problems existing in the prior art, this invention provides a synthetic data pre-training and domain adaptation method for deep learning models of ultrasonic nondestructive testing.
[0009] To achieve the above objectives, the present invention provides the following technical solution: a synthetic data pre-training and domain adaptation method for deep learning models of ultrasonic nondestructive testing, comprising the following steps: S1. The analytical ray tracing simulator calculates the full matrix capture FMC tensor under the assumption of a homogeneous medium, and calculates the corresponding TFM reference image through the analytical delay summation operator to form a synthetic training corpus. S2. The three-dimensional convolutional neural network model is pre-trained using synthetic training corpus to obtain the pre-trained model weights. The three-dimensional convolutional neural network model has an architecture of a three-dimensional convolutional encoder, a time axis compression bridging module, and a two-dimensional transposed convolutional decoder. All convolution operations of the three-dimensional convolutional encoder are three-dimensional convolutions, and the structure of the three physical axes of the FMC tensor, namely the transmit axis, the receive axis, and the time axis, is maintained. S3. Acquire real acquisition data of ultrasonic phased array PAUT, wherein the real acquisition data includes real FMC tensor and corresponding real TFM reference image; S4. Using the pre-trained model weights as initial weights, fine-tune the 3D convolutional neural network model with real collected data, and adopt a hierarchical learning rate strategy during the fine-tuning process. S5. Obtain the trained 3D convolutional neural network model for TFM image reconstruction or defect detection tasks in ultrasonic nondestructive testing.
[0010] On the other hand, the present invention also provides an ultrasonic nondestructive testing model training system, comprising: The synthetic data generation module is used to generate synthetic FMC-TFM image pairs by analyzing the ray tracing simulator; The pre-training module is used to pre-train a 3D convolutional neural network model using synthetic data; The fine-tuning module is used to fine-tune the model with real data, using the pre-trained model weights as initial weights and employing a hierarchical learning rate strategy. The model output module is used to output the trained 3D convolutional neural network model.
[0011] The hierarchical learning rate strategy in the fine-tuning module is as follows: the shallow stage weights of the encoder remain fixed during fine-tuning, the deep stage and bridging module of the encoder are updated with a first learning rate, and the decoder and output head are updated with a second learning rate higher than the first learning rate.
[0012] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method.
[0013] The beneficial effects of this invention are: This invention provides a synthetic data pre-training and domain adaptation method for deep learning models in ultrasonic nondestructive testing. By freezing the shallow layers of the encoder, the model retains the FMC physical structure features learned during synthetic pre-training, while only allowing deep layers and image spatial levels to specialize to the real data distribution. This strategy effectively utilizes the physical priors of synthetic data, narrowing the simulation-to-real gap, even with limited real data. By matching the statistical distributions of defect amplitude, depth, and lateral position in the synthetic data with those in the real data corpus, the synthetic data better covers the distribution of the real data, improving the domain adaptation capability of the pre-trained weights.
[0014] This invention uses a composite loss function weighted by defect regions in both the pre-training and fine-tuning stages. By amplifying the reconstruction error contribution of the defect indication region with an exponential weight based on the local amplitude of the reference TFM image, the model optimization effort focuses on the defect regions that NDT detection is truly concerned with, rather than being dominated by background pixels.
[0015] This invention employs a leakage-controlled grouped cross-validation protocol during the real-data fine-tuning stage, grouping nearly duplicated collected data into the same fold to prevent data leakage from exaggerating evaluation results and ensuring the statistical rigor of model performance evaluation. Attached Figure Description
[0016] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0017] 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.
[0018] Please see Figure 1 This invention provides a technical solution: a synthetic data pre-training and domain adaptation method for deep learning models of ultrasonic nondestructive testing, comprising the following steps: An analytical ray tracing simulator is used to calculate the full-matrix capture FMC tensor under the assumption of a homogeneous medium, and the corresponding TFM reference image is calculated by the analytical delay summation operator to form a synthetic training corpus. The analytical ray tracing simulator operates under the assumption of a homogeneous medium, and the sound velocity parameters are matched with the sound velocity of the material under test in the actual detection scenario. The synthesized FMC tensor is generated by calculating the round-trip propagation time from each transmitting element to each reflector and receiving element, generating a band-limited Gaussian window pulse signal, and adding calibrated Gaussian background noise.
[0019] The statistical distribution of the defect amplitude, depth, lateral position, and number of scattering points in the synthetic training corpus is determined by calibrating the real collected corpus, so that the amplitude-depth distribution and signal-to-noise ratio distribution of the synthetic training corpus match the real collected corpus.
[0020] The real acquisition geometry (64-element linear array, center frequency 5 MHz, sampling rate 50 MHz, sound velocity c=5900 m / s, matching a steel weld inspection scenario) was modeled using a custom MATLAB ray tracing simulator. From the initially generated 6000 synthetic acquisitions, 2790 synthetic FMC-TFM pairs were retained as pre-training corpus after filtering by depth-amplitude and signal-to-noise ratio distribution.
[0021] For each synthetic acquisition, 1-5 point reflectors are placed at random locations within the probe's field of view (0-64 mm laterally and 5-80 mm deep). The depth-related amplitude attenuation of the point reflectors is determined by calibration to the actual data.
[0022] For each transmitting element, the simulator calculates the round-trip propagation time to each reflector and receiver element, generates a band-limited 5 MHz Gaussian window pulse signal, and adds calibrated Gaussian background noise to form a synthetic FMC tensor. The conventional TFM calculates the simulated FMC by applying the same delay summation operator as the real data, using the same reconstruction mesh (641×499).
[0023] The three-dimensional convolutional neural network model is pre-trained using synthetic training corpus to obtain pre-trained model weights. The three-dimensional convolutional neural network model has an architecture of a three-dimensional convolutional encoder, a time axis compression bridging module, and a two-dimensional transposed convolutional decoder. All convolution operations of the three-dimensional convolutional encoder are three-dimensional convolutions, and the structure of the three physical axes of the FMC tensor, namely the transmit axis, the receive axis, and the time axis, is maintained. Each downsampling stage of the 3D convolutional encoder is a 3D convolution with a kernel size of 3×3×3. Downsampling is performed with a stride of 2 in all three axes. Each downsampling stage is followed by batch normalization and the ReLU activation function.
[0024] The time axis compression bridging module compresses the time axis sequentially through two convolutional layers with a kernel size of 1×1×5 along the time axis. Each convolutional layer along the time axis is followed by batch normalization and ReLU activation function. Finally, the remaining time axis sampling points are compressed to size 1 through an adaptive average pooling layer.
[0025] The output layer of the 2D transposed convolutional decoder consists of a 2D convolutional layer and a ReLU activation function, which enforces a non-negativity constraint on the TFM image intensity.
[0026] Pre-training uses the AdamW optimizer with a learning rate of 1×10⁻⁶. -4 The scale is as follows: batch size is 4, and 200 training rounds are performed. Pre-training uses a complete composite reconstruction loss function (mean squared error term + structural similarity term + gradient magnitude term + defect region weighting term), and the weights of each term are determined in the early training experiments to balance the numerical magnitude.
[0027] The loss function is: ; The mean squared error (L_MSE) is the pixel-by-pixel squared error between the predicted pixel and the ground truth pixel: ; The structural similarity term (L_SSIM) is 1 minus the structural similarity index calculated on an 11×11 Gaussian window, capturing local structural consistency. ; The gradient magnitude term is the L1 distance between the spatial gradient magnitudes of the predicted image and the ground truth image, where the gradient... This penalty blurring is calculated using a Sobel-like finite difference operator and encourages the predicted image to retain sharp edges indicating defects: ; The defect region weighting term is the L1 reconstruction loss, where the pixel-wise error is amplified by a weighting function with base e and exponential magnitude, based on the local magnitude of the ground truth image. This results in high-magnitude pixels (typically defect indicators) contributing more to the total loss than low-magnitude background pixels. ; Where γ = 3.0; this exponential weighting function enhances the contribution of high-amplitude pixels (usually defect indication signals) to low-amplitude background pixels: the weight of pixels with amplitudes reaching half maximum is about 4.5, while the weight of pixels at the peak of the image is about 20.
[0028] Validation was performed on a retained 10% of the synthetic corpus, with the optimal pre-training checkpoint identified using the combined loss as an indicator; in the reported run, the optimal checkpoint appeared at round 76 (val_combined=0.1371), and overfitting began after round 87. Pre-training took approximately 12 hours on a single NVIDIA A800 80GB GPU.
[0029] The checkpoints output at this stage are called the "synthetic data pre-training baseline," and all subsequent fine-tuning results are compared against this baseline.
[0030] The output of the pre-training is a checkpoint weight file, which serves as the initial weights for subsequent fine-tuning with real data.
[0031] Acquire real acquisition data from the ultrasonic phased array PAUT, wherein the real acquisition data includes the real FMC tensor and the corresponding real TFM reference image; All real-world data acquisition was performed using a 64-element linear phased array transducer with a center frequency of 5 MHz and in direct-contact mode. The system digitized all 4,096 transmit-receive A-scans generated by each FMC at a frequency of 50 MHz, generating a tensor of shape (64, 64, T). The velocity of sound was c = 5900 m / s. The system was calibrated using a steel reference block with side-drilled holes for TCG calibration; this reference block was not included in the experimental dataset.
[0032] This real-world data corpus contains PAUT data from 72 sets of steel weld specimens, all acquired during experiments in the same laboratory. Each set of data is stored as an HDF5 file, containing the original FMC tensor and a standard TFM image. The data was processed as follows during loading: the FMC was standardized file-by-file for z-values, and the TFM target image was standardized file-by-file for minimum-maximum values (range [0,1]).
[0033] The corpus comprises two collection groups: Group A (41 collections, T=2001 samples, 641×1001 pixels) and Group B (31 collections, T=4001 samples, 641×1501 pixels). The TFM images for both groups were resampled to a uniform 641×499 grid resolution using bilinear interpolation. The model handles varying T values using adaptive pooling.
[0034] Using the pre-trained model weights as initial weights, the 3D convolutional neural network model is fine-tuned with real collected data, and a hierarchical learning rate strategy is adopted during the fine-tuning process. The pre-trained checkpoints were then fine-tuned on the real PAUT corpus (72 acquisitions) using a hierarchical learning rate strategy designed to preserve physical features while allowing for hierarchical specialization of the image space.
[0035] The hierarchical learning rate strategy includes setting the learning rate of the shallow stages of the encoder to zero to freeze the weights of that part, setting the learning rate of the deep stages of the encoder and the bridging module to a first base learning rate, and setting the learning rate of the decoder and the output head to a second learning rate higher than the first base learning rate. This allows the shallow stages of the encoder to retain the physical features learned during the synthesis pre-training, while the image spatial level is specialized to the real data distribution.
[0036] The specific settings for the tiered learning rate are as follows: Encoder phase 0-1 (shallow layer): learning rate = 0 (frozen), keeping the FMC physical features learned during synthesis pre-training unchanged; Encoder stages 2-3 (deep) + bridging module: Base learning rate = 5 × 10⁻⁶ -6 ; Decoder + Output Head: Learning Rate = 1.5 × 10⁻⁶ -5 (3 times the base learning rate) allows the image spatial hierarchy to be more actively specialized to the real data distribution.
[0037] Training protocol details: Fine-tuning was performed using 5 rounds of linear warm-up, followed by cosine annealing defined over 200 rounds of vision to 1×10. -6 Based on early experimental results showing convergence within the budget at 60 rounds, fine-tuning was performed with each fold capped at 60 rounds.
[0038] The correlation was validated as a robust convergence signal using an exponential moving average (EMA, decay rate 0.999). A composite loss function was used throughout the fine-tuning process.
[0039] Each five-fold cross-validation takes approximately 18 minutes (single A800 GPU); a complete five-fold cross-validation activity with multiple seeds (seeds 42, 123, 456) (15 fine-tuning runs) takes approximately 4.5 GPU hours.
[0040] The real-world data collection corpus contains 72 PAUT captures, which include near-repeated captures (captures of the same weld area from multiple angles or locations). Dividing these near-repeated captures into different trade-offs between the training and test sets could cause the model to "peep" at the training data on the test set, exaggerating its performance evaluation.
[0041] To address this issue, this invention employs a grouped cross-validation protocol: nearly duplicated collected data are grouped into the same fold, ensuring that the training data in the test set of each fold does not appear in the training set if the nearly duplicated data was collected.
[0042] The specific fold sizes are: 14, 14, 14, 14, 16 acquisitions (5 folds). The protocol repeats across three random seeds (42, 123, 456), generating 15 runs. Image-level metrics are reported as multiple sub-aggregates; defect region metrics are reported as aggregates spanning all n=72 retained test acquisitions.
[0043] Under grouped cross-validation, the model warm-started from the synthetic pre-trained checkpoint achieved closely comparable defect region quality (defect gCNR 0.61 vs 0.60) compared to the model trained from scratch, with no metric showing a significant difference. This result indicates that, at the scale of data-scarce corpora, synthetic pre-training does not provide measurable performance gains—its previously exaggerated contribution in ungrouped evaluations is an artificial product of data leakage.
[0044] Direct out-of-distribution detection corroborates this conclusion: applying the pre-trained synthetic weights directly to real data collection (with the same evaluation pipeline) without fine-tuning only achieves a defect gCNR of 0.23 (single seed), confirming that the transferability of the synthetic representation is weak, and that pre-training plays the role of lazy initialization within the corpus size.
[0045] Although pre-training does not yield a measurable gain in the final reconstruction quality, its benefits in accelerating convergence remain: pre-trained checkpoint-based warm-start models typically converge earlier than models trained from scratch. This property may have even more significant benefits in scenarios involving large-scale real-world data collection corpora.
[0046] The trained model has an inference time of 6.93 ± 0.30 milliseconds for a single FMC data acquisition (average of 50 forward propagations using a single NVIDIA A800 GPU). This inference speed meets the real-time processing requirements of production-grade acquisition rates (10-50 Hz).
[0047] The TFM reconstructed image obtained through inference is input into subsequent defect detection, dimensional measurement, or reliability evaluation algorithms to complete a fully automated ultrasonic phased array inspection pipeline.
[0048] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A synthetic data pre-training and domain adaptation method for an ultrasonic nondestructive testing deep learning model, characterized in that, Includes the following steps: S1. The analytical ray tracing simulator calculates the full matrix capture FMC tensor under the assumption of a homogeneous medium, and calculates the corresponding TFM reference image through the analytical delay summation operator to form a synthetic training corpus. S2. The three-dimensional convolutional neural network model is pre-trained using synthetic training corpus to obtain the pre-trained model weights. The three-dimensional convolutional neural network model has an architecture of a three-dimensional convolutional encoder, a time axis compression bridging module, and a two-dimensional transposed convolutional decoder. All convolution operations of the three-dimensional convolutional encoder are three-dimensional convolutions, and the structure of the three physical axes of the FMC tensor, namely the transmit axis, the receive axis, and the time axis, is maintained. S3. Acquire real acquisition data of ultrasonic phased array PAUT, wherein the real acquisition data includes real FMC tensor and corresponding real TFM reference image; S4. Using the pre-trained model weights as initial weights, fine-tune the 3D convolutional neural network model with real collected data, and adopt a hierarchical learning rate strategy during the fine-tuning process. S5. Obtain the trained 3D convolutional neural network model for TFM image reconstruction or defect detection tasks in ultrasonic nondestructive testing.
2. The method of claim 1, wherein, In step S1, the analytical ray tracing simulator operates under the assumption of a homogeneous medium, and the sound velocity parameter matches the sound velocity of the material under test in the actual detection scenario; the synthesized FMC tensor is generated by calculating the round-trip propagation time from each transmitting element to each reflector and receiving element, generating a band-limited Gaussian window pulse signal, and adding calibrated Gaussian background noise.
3. The method of claim 1, wherein, In step S1, the statistical distribution of the defect amplitude, depth, lateral position and number of scattering points of the synthetic training corpus is determined by calibrating the real collected corpus, so that the amplitude-depth distribution and signal-to-noise ratio distribution of the synthetic training corpus match the real collected corpus.
4. The method of claim 1, wherein, In step S2, the pre-training is performed using an AdamW optimizer with a learning rate of 1 x 10 -4 magnitudes, a batch size of 4, for 200 training epochs; a composite reconstruction loss function including mean squared error, structural similarity, gradient magnitude, and defect region weighting terms is used during pre-training.
5. The method of claim 1, wherein, In step S4, the hierarchical learning rate strategy includes: setting the learning rate of the shallow stage of the encoder to zero to freeze that part of the weights, setting the learning rate of the deep stage of the encoder and the bridging module to a first base learning rate, and setting the learning rate of the decoder and the output head to a second learning rate higher than the first base learning rate, so that the shallow layer of the encoder retains the physical features learned during the synthesis pre-training, while the image spatial level is specialized to the real data distribution.
6. The method of claim 5, wherein, In step S4, the layer-wise learning rate strategy is specifically: the 0-1 stage of the encoder is frozen, and the learning rate is 0; the 2-3 stage of the encoder and the bridging module are fine-tuned with a base learning rate of 5x10 -6 -3 The decoder and output head are fine-tuned with a second learning rate of 1.5 x 10 -5 magnitude.
7. The method of claim 1, wherein, In step S4, the fine-tuning of the real-collected data adopts a leakage-controlled grouped cross-validation protocol to prevent near-repeated data from crossing the training and test set partitions, ensuring the statistical rigor of model evaluation. After the fine-tuning of the real-collected data is completed, the trained model is used to infer new FMC data and directly output the corresponding TFM reconstructed image with an inference time of less than 10 milliseconds.
8. An ultrasonic non-destructive testing model training system, characterized by, include: The synthetic data generation module is used to generate synthetic FMC-TFM image pairs by analyzing the ray tracing simulator; The pre-training module is used to pre-train a 3D convolutional neural network model using synthetic data; The fine-tuning module is used to fine-tune the model with real data, using the pre-trained model weights as initial weights and employing a hierarchical learning rate strategy. The model output module is used to output the trained 3D convolutional neural network model.
9. The system of claim 8, wherein: The hierarchical learning rate strategy in the fine-tuning module is as follows: the shallow stage weights of the encoder remain fixed during fine-tuning, the deep stage and bridging module of the encoder are updated with a first learning rate, and the decoder and output head are updated with a second learning rate higher than the first learning rate.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 7.
