A Method for Ultrasonic Time-of-Flight Measurement Based on GAF Image Coding

By combining GAF image encoding and deep learning networks, the problem of insufficient accuracy of traditional ultrasonic thickness measurement technology in noisy environments is solved, achieving high-precision and robust thickness measurement suitable for complex industrial environments.

CN120741661BActive Publication Date: 2025-12-02XI'AN PETROLEUM UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511178284.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-22
Publication Date
2025-12-02
Estimated Expiration
2045-08-22

AI Technical Summary

Technical Problem

Traditional ultrasonic thickness measurement techniques have a high error rate in industrial high-noise environments, the peak method has weak resolution of overlapping echoes, and sound velocity drift under high-temperature conditions leads to calibration failure, making it difficult to meet the modern high-precision and high-robustness testing requirements.

Method used

An ultrasonic time-of-flight measurement method based on GAF image coding is adopted. Wavelet denoising and Gram angle field coding are used to form a two-dimensional image matrix. The improved Swing Transformer network is used to extract depth features and perform regression calculation to estimate the time of flight, outputting the material thickness or defect location results.

Benefits of technology

It significantly improves the accuracy and stability of thickness measurement, and is suitable for non-destructive testing in complex industrial scenarios such as high temperature and corrosion, solving the problems of noise sensitivity and limited resolution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120741661B_ABST
    Figure CN120741661B_ABST
Patent Text Reader

Abstract

This invention discloses an ultrasonic time-of-flight measurement method based on GAF image coding, comprising: acquiring raw ultrasonic echo signals and performing wavelet denoising processing; extracting envelope signals from the raw ultrasonic echo signals after wavelet denoising processing; encoding the envelope signals into a two-dimensional image matrix using a Gram angle field; inputting the image-normalized Gram angle field image into an improved Swin Transformer network for depth feature extraction; performing regression calculation based on the depth features to estimate the time of flight; and outputting material thickness or defect location results based on the estimated time of flight. This invention effectively solves the problems of noise sensitivity and limited resolution in traditional ultrasonic thickness measurement by fusing signal image coding and depth feature learning, significantly improving the accuracy and stability of thickness measurement, and is particularly suitable for non-destructive testing needs in complex industrial scenarios such as high temperature and corrosion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition technology, and in particular to an ultrasonic time-of-flight measurement method based on GAF image encoding. Background Technology

[0002] With increasingly stringent safety standards for industrial equipment (such as petrochemical pressure vessels and aerospace components), high-precision non-destructive testing of material thickness has become a core element in ensuring equipment reliability. In current mainstream ultrasonic thickness measurement technologies, the accuracy of Time-of-Flight (TOFD) measurement directly affects the accuracy of thickness assessment, thus determining the reliability of equipment lifespan prediction and risk warning. However, traditional measurement methods (threshold method, peak method) suffer from inherent limitations: in noisy industrial environments, the threshold method has a high false alarm rate, while the peak method has weak resolution of overlapping echoes and suffers calibration failure due to sound velocity drift under high-temperature conditions, making it difficult to meet the demands of modern high-precision and high-robustness testing. Summary of the Invention

[0003] This invention provides an ultrasonic time-of-flight measurement method based on GAF image encoding, which solves the problems in the prior art where the measurement accuracy of time difference of flight is high in industrial high-noise environments, the threshold method has a high misjudgment rate, the peak method has weak resolution of overlapping echoes, and the calibration fails due to sound velocity drift under high-temperature conditions, making it difficult to meet the requirements of modern high-precision and high-robustness detection.

[0004] On one hand, embodiments of the present invention provide a method for measuring ultrasonic time-of-flight based on GAF image encoding, including:

[0005] The raw ultrasonic echo signal was acquired and processed using wavelet noise reduction.

[0006] The envelope signal is extracted from the original ultrasonic echo signal after wavelet denoising processing.

[0007] The envelope signal is encoded into a two-dimensional image matrix using the Gram angle field;

[0008] The image-normalized Gram angle field image is input into the improved Swin Transformer network for deep feature extraction;

[0009] The estimated flight time is calculated based on the depth characteristics using regression analysis.

[0010] The material thickness or defect location result is output based on the estimated flight time.

[0011] In one possible implementation, acquiring the raw ultrasonic echo signal and performing wavelet noise reduction processing includes:

[0012] The original ultrasonic echo signal was denoised using a symmetrical wavelet with a center frequency of 7 Hz.

[0013] In one possible implementation, encoding the envelope signal into a two-dimensional image matrix using the Gram angle field includes:

[0014] Normalize the time series of the envelope signal;

[0015] The normalized time series is converted into image data using the Gram angular field matrix.

[0016] In one possible implementation, the Swing Transformer network includes a window-based multi-head self-attention mechanism, a moving window multi-head self-attention mechanism, and a feedforward neural network, with a normalized LayerNormlayer preceding the window-based multi-head self-attention mechanism, the moving window multi-head self-attention mechanism, and the feedforward neural network.

[0017] In one possible implementation, the extraction of deep features from an improved Swin Transformer network, inputting a Gram angle field image that has been image-normalized, includes:

[0018] The Swin Transformer network extracts features from the Gram field image in four stages.

[0019] In one possible implementation, the Swing Transformer network includes an auxiliary feedforward neural network module after its four stages, which is executed sequentially using a bottleneck structure.

[0020] In one possible implementation, the dropout rate in the window-based multi-head self-attention mechanism, the moving window multi-head self-attention mechanism, the feedforward neural network, and the additional feedforward neural network in the Swing Transformer network is set to 0.1.

[0021] In one possible implementation, the Swin Transformer network uses Log-Cosh loss as the optimization objective.

[0022] In one possible implementation, a time-of-flight estimate is calculated based on the depth features; the material thickness or defect location result is output based on the time-of-flight estimate, including:

[0023] The TOFD value of the corresponding echo signal is obtained by using the depth features output by the deep learning network;

[0024] The thickness of the sample to be tested is calculated based on the TOFD value, the estimated time of flight, and the pulse reflection method formula.

[0025] The ultrasonic time-of-flight measurement method based on GAF image encoding in this invention has the following advantages:

[0026] By integrating signal image coding and deep feature learning, the problems of noise sensitivity and limited resolution in traditional ultrasonic thickness measurement are effectively solved, significantly improving the accuracy and stability of thickness measurement. It is especially suitable for non-destructive testing needs in complex industrial scenarios such as high temperature and corrosion. Attached Figure Description

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

[0028] Figure 1 A flowchart illustrating an ultrasonic time-of-flight measurement method based on GAF image encoding, provided for embodiments of this application;

[0029] Figure 2 A diagram illustrating the process of converting a one-dimensional signal into a two-dimensional GAF image for an ultrasonic time-of-flight measurement method based on GAF image encoding, provided in an embodiment of this application.

[0030] Figure 3 A Swing-Transformer architecture diagram of an ultrasonic time-of-flight measurement method based on GAF image encoding provided for embodiments of this application;

[0031] Figure 4 A diagram of the core module of the Swing-Transformer for an ultrasonic time-of-flight measurement method based on GAF image encoding, provided for embodiments of this application;

[0032] Figure 5 A complete flowchart of the prediction of ultrasonic echo TOFD values ​​for an ultrasonic time-of-flight measurement method based on GAF image coding, provided for embodiments of this application;

[0033] Figure 6 This is a convergence proof diagram of an ultrasonic time-of-flight measurement method based on GAF image coding, provided in an embodiment of this application. Detailed Implementation

[0034] 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.

[0035] Figure 1 This invention provides a flowchart illustrating an ultrasonic time-of-flight measurement method based on GAF image coding, as shown in the embodiment of the invention. The embodiment of the invention provides an ultrasonic time-of-flight measurement method based on GAF image coding, comprising:

[0036] The raw ultrasonic echo signal was acquired and processed using wavelet noise reduction.

[0037] The envelope signal is extracted from the original ultrasonic echo signal after wavelet denoising processing.

[0038] The envelope signal is encoded into a two-dimensional image matrix using the Gram angle field;

[0039] The image-normalized Gram angle field image is input into the improved Swin Transformer network for deep feature extraction;

[0040] The estimated flight time is calculated based on the depth characteristics using regression analysis.

[0041] The material thickness or defect location result is output based on the estimated flight time.

[0042] Acquiring raw ultrasonic echo signals and performing wavelet noise reduction processing includes:

[0043] The original ultrasonic echo signal was denoised using a symmetrical wavelet with a center frequency of 7 Hz.

[0044] Encoding the envelope signal into a two-dimensional image matrix using the Gram angle field includes:

[0045] Normalize the time series of the envelope signal;

[0046] The normalized time series is converted into image data using the Gram angular field matrix.

[0047] The Swing Transformer network includes a window-based multi-head self-attention mechanism, a moving window multi-head self-attention mechanism, and a feedforward neural network, with a normalized LayerNorm layer preceding the window-based multi-head self-attention mechanism, the moving window multi-head self-attention mechanism, and the feedforward neural network.

[0048] The improved Swin Transformer network extracts deep features by inputting image-normalized Gram corner field images into the network, including:

[0049] The Swin Transformer network extracts features from the Gram field image in four stages.

[0050] The Swin Transformer network includes an auxiliary feedforward neural network module after its four stages, which is executed sequentially using a bottleneck structure.

[0051] The dropout rate in the window-based multi-head self-attention mechanism, the moving window multi-head self-attention mechanism, the feedforward neural network, and the additional feedforward neural network in the Swing Transformer network is set to 0.1.

[0052] The Swin Transformer network uses Log-Cosh loss as the optimization objective.

[0053] The flight time estimate is calculated based on the depth features using regression; the material thickness or defect location result is output based on the flight time estimate, including:

[0054] The TOFD value of the corresponding echo signal is obtained by using the depth features output by the deep learning network;

[0055] The thickness of the sample to be tested is calculated based on the TOFD value, the estimated time of flight, and the pulse reflection method formula.

[0056] For example, such as Figure 1 , 2 As shown, a Nakagami distribution model is used to simulate and generate an echo signal dataset model for training and generalizing the deep learning model's capabilities. Then, a symmetric wavelet with a center frequency of 7 Hz is used to denoise the ultrasonic signal, thereby extracting the envelope signal. Gram angle field is used to transform the one-dimensional time signal sequence... Convert to two-dimensional image data, where the Gram angle field is defined as follows:

[0057]

[0058] in Let be the total length of the sequence, the image block size be defined as 4×4, the extracted feature dimension be 4×4×3, and the feature dimension of the input image after linear embedding be denoted as C. The feature extraction process involves four stages of dimensionality reduction using the Sw-transformer network: the input size is... Stage 1 output size is Stage 2 output dimensions: Stage 3 output dimensions: Stage 4 output dimensions: .

[0059] The Swin Transformer block consists of three parts: window-based multi-head self-attention mechanism (W-MSA), moving window multi-head self-attention mechanism (SW-MSA), and feedforward neural network (MLP).

[0060] The Swin Transformer network's four-stage output is followed by an auxiliary MLP module, which employs a bottleneck structure to execute sequentially: compressing the feature dimension to 1 / 4 of the original through a fully connected layer; using the GELU activation function to handle nonlinear relationships; and adding a residual network to fuse the original output features.

[0061] The Swin Transformer network uses Log-Cosh loss as the optimization objective for this regression task, which is defined as:

[0062]

[0063] in Represents the true ultrasound echo TOFD value. This represents the TOFD value predicted by the model.

[0064] The TOFD value of the corresponding echo signal is obtained by outputting a deep learning network, and the formula based on the pulse reflection method is used. Calculate the sample thickness, where This indicates the speed at which ultrasound travels through the air.

[0065] In one possible embodiment, since training deep learning network models requires a large dataset of ultrasonic echo models, the mathematical expression of the ultrasonic echo model is crucial to the accuracy of the network model's predictions. Therefore, this application first determines the ultrasonic mathematical model to construct the ultrasonic training dataset. Ultrasonic waves propagate through the object being measured, producing multiple echo signals. The mathematical expression for ultrasonic echoes can be represented as:

[0066] (1)

[0067] in This represents the mathematical model of ultrasonic echo, with model parameters derived from... Sure, It is additive white Gaussian noise.

[0068] The performance of deep learning models is highly dependent on the similarity between simulated and real data. Therefore, a mathematical model that closely matches the actual transducer signal characteristics must be selected to ensure training accuracy and generalization ability. After rigorous screening and comparison, this invention uses the Nakagami distribution model to simulate actual ultrasonic signals. In the Nakagami distribution model, the mathematical expression for a single echo is as follows:

[0069] (2)

[0070] in ,in For amplitude, The shape of the density function is determined. The average power of the echo signal. For arrival time, The center frequency of the ultrasonic transducer. For phase, express The gamma function, It is a step function.

[0071] Multiple echo signals can be superimposed using the Nakagami distribution model via equation (2). Ultrasonic waves experience energy attenuation, time shift, and frequency dispersion as they propagate through the sample. In this invention, the parameters of the Nakagami distribution model... It is set to 1.3. To randomize the echo signal, the parameter vector... It follows a uniform distribution. Among them, [the following is also present]. It controls the echo width, and its range is within . The echo amplitude, its range is within . The starting point of the echo, its range is within The arrival time of subsequent echoes is determined by the TOFD value. Determined by the center frequency of the ultrasonic transducer, here Defined as 6dB bandwidth, its range is within Phase The range is .

[0072] In the superposition of multiple echo signals, the number of echoes follows a uniform distribution, ranging from [2, 6]. The TOFD values ​​between adjacent echoes follow a uniform distribution, ranging from... This was used to simulate different sample thicknesses. The echo signal sequence was 3000 points long. For each superimposed echo signal, additive white Gaussian noise was added to simulate actual measurement noise. The noise intensity was defined as... ,in For signal power, The noise power is denoised as follows: After adding noise, denoising is performed using a symmetrical wavelet with a center frequency of 7 Hz, and then the envelope signal is extracted.

[0073] Finally, the extracted temporal envelope signal is mapped into a two-dimensional image using GAF (Gram Field Image). This mapping explicitly encodes the nonlinear similarity between any two time points. The GAF image encoding method is as follows:

[0074] Step 1: Given a time series Normalization, range The calculation formula is as follows:

[0075] (3)

[0076] in For sequence The maximum value, For sequence The minimum value.

[0077] Step 2: Normalize the sequence Converting to polar coordinates and calculating using the inverse cosine function, the specific formula is as follows:

[0078] (4)

[0079] in Represents a timestamp. This represents a constant factor in polar coordinates. (Through time series) After converting to polar coordinates, the correlation between different time points can be identified.

[0080] Step 3: Then, the GAF matrix is ​​defined as follows:

[0081] (5)

[0082] in This represents the total length of the sequence. (Through the matrix...) Convert time series data into image data.

[0083] Figure 3This uses the Swin Transformer (Swin-T) network architecture. First, the image is divided into non-overlapping patches, each 4×4 in size with a feature dimension of 4×4×3. Each patch is treated as a token (similar to a word in NLP). Then, each patch is mapped to a fixed dimension (denoted as C) through a linear embedding layer, forming the first stage of the network with the Swin Transformer blocks. To extract image features more deeply, the Patch Merging layer groups each 2×2 patch, concatenates the vectors of each patch along the channel dimension, and then reduces the feature dimension to 2C through a linear layer. The Patch Merging layer and the Swin Transformer blocks constitute the second stage, where the feature map becomes... To focus on a larger receptive field, this process is repeated twice, labeled as the third and fourth stages, with the feature maps becoming... , The first to fourth stages enable the global extraction of high-level semantic information and the ability to understand image representations.

[0084] Figure 4 This is a diagram of the core Swin-transformer module in this invention. The Swin Transformer block consists of three parts: a window-based multi-head self-attention mechanism (W-MSA), a moving window multi-head self-attention mechanism (SW-MSA), and a feedforward neural network (MLP). W-MSA, SW-MSA, and MLP are preceded by a normalized LayerNorm layer.

[0085] To enable information exchange between windows, a moving window strategy is adopted. The Swing Transformer block can be defined as:

[0086] (6)

[0087] in and Representing blocks respectively The characteristic outputs of the W-MSA and MLP modules are shown. W-MSA and SW-MSA represent window-based multi-head self-attention using regular and shifted window partitioning configurations.

[0088] Figure 5This is a flowchart illustrating the complete process for predicting the TOFD value of ultrasonic echoes in this invention. First, the original ultrasonic echo signal undergoes wavelet transform for noise reduction preprocessing, and its envelope signal is extracted. Then, the GAF method is used to convert the one-dimensional signal into a two-dimensional image representation to better preserve the local patterns and global features of the time series. Next, the image size is scaled to 224×224 and input into the Swin-T network model for multi-scale feature extraction and deep modeling. To enhance the feature representation capability of the SwinTransformer, an additional feedforward neural network (MLP) structure is introduced after the output of the fourth module (stage 4). This structure employs a bottleneck design, compressing and restoring the feature dimensions layer by layer, and using a fully connected layer with a GELU function to further explore the nonlinear relationships between deep features. Simultaneously, residual connections are introduced to preserve the original features and improve the model's nonlinear modeling capability. The dropout rate in the W-MSA, SW-MSA, and MLP modules of the Swin Transformer block, as well as the additional MLP, is set to 0.1 to increase the model's generalization ability. Regarding the loss function, this paper adopts Log-Cosh loss as the optimization objective for the regression task, which is defined as:

[0089] (7)

[0090] in Represents the true ultrasound echo TOFD value. This represents the TOFD value predicted by the model. This loss function approximates the mean squared error (MSE) in the small error range and is closer to the mean absolute error (MAE) in the large error range, thus ensuring stronger robustness while maintaining regression accuracy and effectively suppressing the adverse effects of outliers on model training.

[0091] Figure 6The figure shows the convergence proof of the algorithm in this invention. In the deep learning model training, this invention simulates an ultrasonic echo dataset containing 10,000 samples, divided into training, validation, and test sets in a 7:2:1 ratio. The dataset covers five signal-to-noise ratios (5 dB, 10 dB, 15 dB, 20 dB, 25 dB). The sampling frequency of the simulated signal is 500 MHz, and the duration is 6 μs. The model uses the Adam optimizer with a learning rate of 0.0001, a batch size of 32, and a training cycle of 100 epochs. The training results are shown in the figure. The training loss and validation loss decrease rapidly in the initial stage and then gradually converge. The overall trend of the validation loss is similar to that of the training loss, without significant deviation, indicating good generalization ability of the model. After the 20th epoch, the loss values ​​tend to stabilize: the lowest training loss is 0.000462, and the lowest validation loss is 0.000576, indicating excellent model convergence performance and high prediction accuracy.

[0092] The system in this application mainly consists of a DP832 digital power supply, an MDO3052 digital storage oscilloscope, a thickness measurement circuit module, a 12V to 100V high-voltage module, a dual-crystal piezoelectric transducer with a center frequency of 5 MHz and a diameter of 10 mm, and a personal computer. Ultrasonic waves propagate in the sample and are reflected at the bottom surface to form echoes. These echoes are received by the transducer, processed by an automatic gain amplifier circuit, and then sent to the oscilloscope for acquisition and display. The sampling rate is 500 MHz. The signal is transmitted to the computer via a USB interface for subsequent digital processing and analysis.

[0093] The experimental samples were stainless steel discs with a radius of 50 mm and thicknesses of 3.983 mm, 4.984 mm, 5.941 mm, and 8.058 mm, respectively. The thickness values ​​were determined by averaging multiple measurements using a digital micrometer. Nine representative test points were selected in the central region of each sample, and ultrasonic echo signals were collected and used for thickness measurement and analysis.

[0094] The measurement errors for samples of different thicknesses are as follows: For the 3.983 mm sample, the error range is 0.0295 mm to 0.0611 mm, with a mean absolute error (MAE) of 0.0457 mm; the 4.984 mm sample has a relatively large error, between 0.067 mm and 0.119 mm, with an MAE of 0.0957 mm; the 5.941 mm sample has mainly negative errors, ranging from -0.014 mm to -0.097 mm, with an MAE of 0.0424 mm, indicating a certain degree of systematic bias; the 8.058 mm sample has an error between 0.027 mm and 0.104 mm, with an MAE of 0.0638 mm.

[0095] Overall, within the tested thickness range (3.983–8.058 mm), the system demonstrated good measurement accuracy and consistency, with the average error for all samples below 0.1 mm, and the 5.941 mm sample exhibiting the smallest error. Experimental results indicate that this thickness measurement system has strong thickness resolution, particularly in the 4–6 mm range, where its stability and reliability are particularly outstanding.

[0096] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0097] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for measuring ultrasonic time-of-flight based on GAF image encoding, characterized in that, include: The raw ultrasonic echo signal was acquired and processed using wavelet noise reduction. The envelope signal is extracted from the original ultrasonic echo signal after wavelet denoising processing. The envelope signal is encoded into a two-dimensional image matrix using the Gram angle field; The image-normalized Gram angle field image is input into the improved Swin Transformer network for deep feature extraction; The Swin Transformer network extracts features from the Gram angle field image in four stages. The Swin Transformer network includes a window-based multi-head self-attention mechanism, a moving window multi-head self-attention mechanism, and a feedforward neural network. A normalized LayerNorm layer precedes the window-based multi-head self-attention mechanism, the moving window multi-head self-attention mechanism, and the feedforward neural network. The estimated flight time is calculated based on the depth characteristics using regression analysis. The material thickness or defect location result is output based on the estimated flight time.

2. The ultrasonic time-of-flight measurement method based on GAF image encoding according to claim 1, characterized in that, Acquiring raw ultrasonic echo signals and performing wavelet noise reduction processing includes: The original ultrasonic echo signal was denoised using a symmetrical wavelet with a center frequency of 7 Hz.

3. The ultrasonic time-of-flight measurement method based on GAF image encoding according to claim 1, characterized in that, Encoding the envelope signal into a two-dimensional image matrix using the Gram angle field includes: Normalize the time series of the envelope signal; The normalized time series is converted into image data using the Gram angular field matrix.

4. The ultrasonic time-of-flight measurement method based on GAF image encoding according to claim 1, characterized in that, The Swin Transformer network includes an auxiliary feedforward neural network module after its four stages, which is executed sequentially using a bottleneck structure.

5. The ultrasonic time-of-flight measurement method based on GAF image encoding according to claim 1, characterized in that, The dropout rate in the window-based multi-head self-attention mechanism, the moving window multi-head self-attention mechanism, the feedforward neural network, and the additional feedforward neural network in the Swing Transformer network is set to 0.

1.

6. The ultrasonic time-of-flight measurement method based on GAF image encoding according to claim 1, characterized in that, The Swin Transformer network uses Log-Cosh loss as the optimization objective.

7. The ultrasonic time-of-flight measurement method based on GAF image coding according to claim 1, characterized in that, The flight time estimate is calculated based on the depth features using regression; the material thickness or defect location result is output based on the flight time estimate, including: The TOFD value of the corresponding echo signal is obtained by using the depth features output by the deep learning network; The thickness of the sample to be tested is calculated based on the TOFD value, the estimated time of flight, and the pulse reflection method formula.

Citation Information

Patent Citations

  • Crude oil condensation identification method, device and equipment based on feature fusion

    CN114861837A

  • Single-beam underwater target identification method based on GAF-D3Net

    CN115661627A