Weld joint abnormity identification method and device, computer equipment and storage medium
By performing time-frequency transformation and multi-layer convolutional neural network processing on ultrasonic scanning data of welds, the problem of traditional weld inspection relying on manual interpretation has been solved, enabling accurate identification and classification of weld anomalies and improving inspection efficiency and intelligence.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-03-27
AI Technical Summary
Traditional ultrasonic testing of welds relies on manual interpretation, and the test results are highly dependent on the operator's subjective experience. The low degree of automation leads to unstable testing efficiency and poor consistency, making it difficult to achieve rapid and standardized operations in large-scale industrial scenarios.
By acquiring ultrasonic scanning data of the weld, performing time-frequency transformation, and using a preset anomaly detection model to process the ultrasonic time-frequency data, the model uses a multi-layer convolutional neural network to extract target features and maps them to the defect category space through a fully connected layer to output the defect probability distribution.
It significantly improves the intelligence level and detection efficiency of weld anomaly identification, provides intuitive data support, lays the foundation for weld quality assessment and repair, and realizes accurate identification and classification of weld anomalies.
Smart Images

Figure CN121741015A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automation technology, and in particular to a method, apparatus, computer equipment, storage medium and computer program product for identifying weld anomalies. Background Technology
[0002] With the development of ultrasonic nondestructive testing and industrial intelligent diagnostic technologies, automated identification of internal defects in welds has become an increasingly crucial aspect of ensuring structural safety. Traditionally, ultrasonic testing of welds relies primarily on technicians observing the amplitude and location of the scanning waveforms in the time domain, combined with personal experience, to determine and assess defects. However, this method, centered on manual interpretation, suffers from a fundamental problem: its results are highly dependent on the operator's subjective experience, resulting in low automation, unstable testing efficiency, poor consistency, and difficulty in achieving rapid, standardized operations in large-scale industrial settings. Summary of the Invention
[0003] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for identifying weld anomalies in response to the above-mentioned technical problems.
[0004] Firstly, this application provides a method for identifying weld anomalies. The method includes:
[0005] Acquire ultrasonic scanning data of the target weld; wherein, the ultrasonic scanning data includes ultrasonic scanning results and corresponding time data;
[0006] Based on the time data, time-frequency transformation is performed on each of the ultrasound scan data to obtain ultrasound time-frequency data;
[0007] The ultrasonic time-frequency data is input into a preset anomaly detection model, and anomaly detection results are output. The anomaly detection model is used to extract target features based on the input time-frequency data, and output the identification result of the target weld anomaly based on the target features.
[0008] In one embodiment, acquiring the ultrasonic scanning data of the target weld includes:
[0009] The target weld is scanned along a preset scanning path using an ultrasonic flaw detector to obtain the ultrasonic scanning results;
[0010] The ultrasound scan results are correlated with the corresponding time data to obtain ultrasound scan data.
[0011] In one embodiment, the step of performing time-frequency transformation on each of the ultrasound scan data based on the time data to obtain ultrasound time-frequency data includes:
[0012] Using a preset time-frequency transformation strategy, the ultrasound scan data are transformed according to the time data to obtain initial ultrasound time-frequency data; wherein, the time-frequency transformation strategy includes at least one of the following: continuous wavelet transform or short-time Fourier transform;
[0013] The initial ultrasonic time-frequency data is normalized to obtain the ultrasonic time-frequency data.
[0014] In one embodiment, obtaining the anomaly detection model includes:
[0015] Acquire labeled ultrasonic time-frequency data of the target weld and construct a neural network architecture containing multiple convolutional layers;
[0016] The neural network architecture is trained using labeled ultrasonic time-frequency data of the target weld. When the loss function of the neural network architecture converges to a preset condition, the neural network architecture is determined as an anomaly detection model.
[0017] In one embodiment, the step of inputting the ultrasound time-frequency data into a preset anomaly detection model and outputting anomaly detection results includes:
[0018] The ultrasonic time-frequency data is input into the input layer of the anomaly detection model, and features are extracted through multiple convolution and pooling operations to obtain the target features;
[0019] The target features are mapped to the defect category space through a fully connected layer, and the generated defect probability distribution is output.
[0020] In one embodiment, after the output yields the anomaly detection result, it further includes:
[0021] The three-dimensional position of the defect in the target weld is determined based on the time correspondence between the probe scanning position coordinates and the detection results.
[0022] The three-dimensional location and anomaly detection results are integrated into a structured detection report.
[0023] Secondly, this application also provides a weld anomaly identification device. The device includes:
[0024] The data acquisition module is used to acquire ultrasonic scanning data of the target weld; wherein, the ultrasonic scanning data includes ultrasonic scanning results and corresponding time data;
[0025] The data transformation module is used to perform time-frequency transformation on each of the ultrasound scan data according to the time data to obtain ultrasound time-frequency data;
[0026] An anomaly detection module is used to input the ultrasonic time-frequency data into a preset anomaly detection model and output anomaly detection results; wherein, the anomaly detection model is used to extract target features based on the input time-frequency data and output the identification results of the target weld anomaly based on the target features.
[0027] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the weld anomaly identification method as described in any one of the embodiments of this disclosure.
[0028] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the weld anomaly identification method as described in any one of the embodiments of this disclosure.
[0029] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the weld anomaly identification method as described in any one of the embodiments of this disclosure.
[0030] The aforementioned weld anomaly identification method, device, computer equipment, storage medium, and computer program products transform ultrasonic scanning data through time-frequency conversion. This converts ultrasonic signals, which originally only reflected time-domain characteristics, into ultrasonic time-frequency data containing both time and frequency dimensions. This effectively captures the dynamic characteristic changes of weld defects at different times and frequencies, significantly improving the richness and accuracy of feature representation compared to traditional analysis methods that rely solely on a single dimension of the time or frequency domain. Based on this, a pre-defined anomaly detection model processes the ultrasonic time-frequency data. This model, through multi-layer convolution and pooling operations, deeply mines subtle defect features within the ultrasonic time-frequency data and accurately maps the extracted target features to the defect category space via a fully connected layer, outputting a specific defect probability distribution. This achieves accurate identification and classification of weld anomalies. This not only provides intuitive and comprehensive data support for subsequent weld quality assessment and repair but also lays the foundation for the traceability and analysis of weld inspection results, thereby improving the overall intelligence level and detection efficiency of weld anomaly identification. Attached Figure Description
[0031] Figure 1 This is a diagram illustrating the application environment of a weld anomaly identification method in one embodiment.
[0032] Figure 2 This is a flowchart illustrating a weld anomaly identification method in one embodiment;
[0033] Figure 3This is a flowchart illustrating the implementation of a weld anomaly identification method in one embodiment;
[0034] Figure 4 This is a structural block diagram of a weld anomaly identification device in one embodiment;
[0035] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0036] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0037] The weld anomaly identification method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. In this application environment, terminal 102 can be used to collect or receive ultrasonic scanning data (including scanning results and corresponding time data) of the target weld from an ultrasonic testing device and upload it to server 104. Server 104 is configured to execute the method in this embodiment: perform time-frequency transformation on each ultrasonic scanning data according to the time data to generate ultrasonic time-frequency data; subsequently, input the ultrasonic time-frequency data into a preset anomaly detection model, which extracts target features from the input data to identify and classify weld anomalies and outputs anomaly detection results. After processing, server 104 can return the detection results to terminal 102 for display or alarm, or archive them to the data storage system for traceability and analysis. The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0038] In one embodiment, such as Figure 2 As shown, a method for identifying weld anomalies is provided, including the following steps:
[0039] Step S200: Obtain ultrasonic scanning data of the target weld; wherein, the ultrasonic scanning data includes ultrasonic scanning results and corresponding time data.
[0040] The ultrasonic scan results can include echo signals generated by reflection, refraction, and scattering of ultrasonic waves during their propagation within the target weld. These signals carry rich information about the internal structure of the weld, such as the presence of defects, their approximate location, and morphology. The corresponding time data provides precise timestamps for these echo signals, ensuring that each ultrasonic scan result corresponds to a specific moment in the scanning process. This temporal correlation not only facilitates subsequent time-series analysis of the scan data but also accurately tracks signal variation patterns during multi-data comparisons or dynamic scanning, laying a solid data foundation for subsequent time-frequency transformation and other processing steps.
[0041] In one exemplary embodiment, an ultrasonic flaw detector can be used to scan the target weld along a preset scanning path to obtain ultrasonic scanning results. Specifically, this can include: planning a zigzag or parallel line scanning path with the weld center as the reference, based on the length and width of the target weld and the preset scanning coverage requirements, to ensure that the scanning trajectory covers the weld area and the heat-affected zone; controlling the probe of the ultrasonic flaw detector to move at a uniform speed of 0.5-2 mm / s along the planned path, while maintaining good coupling between the probe and the workpiece surface; and collecting echo signals generated when the ultrasonic waves encounter the weld interface, defects, and base material during propagation in real time. After these echo signals are amplified and filtered by the internal circuit of the flaw detector, an ultrasonic scanning result containing information such as echo amplitude and propagation time is formed, and the data format can be an analog voltage signal or a digitized waveform data sequence.
[0042] Step S202: Based on the time data, perform time-frequency transformation on each of the ultrasound scan data to obtain ultrasound time-frequency data.
[0043] The time window parameters for time-frequency transformation can be determined based on the time data corresponding to each ultrasound scan. For example, for short-time Fourier transform, the window length can be set to 512 sampling points with a window overlap rate of 50% to achieve a balance between time resolution and frequency resolution. For continuous wavelet transform, Morlet wavelets can be used as the basis function, and an appropriate scale range can be set to cover the main frequency components of the ultrasound signal. Using the selected time-frequency transformation strategy, each ultrasound scan result is processed to decompose the time-domain signal into the variation of different frequency components over time, thus obtaining the initial ultrasound time-frequency data. This data is typically represented as a two-dimensional matrix, where rows represent time, columns represent frequency, and matrix element values represent the energy or amplitude of the frequency component at that moment. The initial ultrasound time-frequency data can be normalized. Normalization can be performed using the min-max normalization method, scaling the data to the [0,1] interval. This is achieved by calculating the difference between each element value and the minimum value in the time-frequency data, and then dividing by the difference between the maximum and minimum values in the time-frequency data, to obtain the final ultrasound time-frequency data used for model input.
[0044] In one exemplary embodiment, after obtaining the initial ultrasound time-frequency data, a Z-score normalization method can be used for normalization. Specifically, the mean μ and standard deviation σ of all elements in the initial ultrasound time-frequency data are calculated, and then each element value x is transformed using the formula (x-μ) / σ, so that the processed ultrasound time-frequency data exhibits a distribution characteristic with a mean of 0 and a standard deviation of 1. This normalization method can effectively eliminate the dimensional influence caused by factors such as equipment gain and coupling differences in different batches of ultrasound scan data, ensuring that the data input to the anomaly detection model has a uniform scale, and improving the model's stability and generalization ability for feature extraction. For example, when a batch of ultrasound scan data has a slightly lower overall echo signal amplitude due to slightly poor probe coupling, after Z-score normalization, its data distribution will tend to be consistent with the data distribution under normal coupling conditions, avoiding misjudgment by the model due to absolute numerical differences in the input data.
[0045] Step S204: Input the ultrasonic time-frequency data into a preset anomaly detection model and output the anomaly detection result; wherein, the anomaly detection model is used to extract target features based on the input time-frequency data and output the identification result of the target weld anomaly based on the target features.
[0046] In one exemplary embodiment, the anomaly detection model can be constructed as a deep neural network architecture containing multiple convolutional layers. When ultrasound time-frequency data is input to the model's input layer, it first passes through a first convolutional layer. This layer uses 32 3x3 convolutional kernels with a stride of 1 and "same" padding to perform preliminary feature extraction on the input two-dimensional time-frequency data, capturing local features such as specific frequency peaks and signal abrupt changes in the time domain. Subsequently, batch normalization and the ReLU activation function are applied to accelerate network training and enhance nonlinear expressive capabilities. Then, a 2x2 max-pooling layer is used to downsample the feature map, preserving key features while reducing computational load. Next, the data enters a second convolutional layer using 64 3x3 convolutional kernels, again employing batch normalization, the ReLU activation function, and a 2x2 max-pooling layer to further extract higher-level abstract features, such as defect-specific patterns formed by combinations of different frequency components. The data then flows through the third convolutional layer, employing 128 3x3 convolutional kernels to further refine feature extraction and capture more complex and subtle defect-related features. After multiple convolutional and pooling operations, the resulting high-dimensional feature map is flattened into a one-dimensional vector and input to the fully connected layer. The fully connected layer first performs a non-linear transformation and integration on the flattened feature vector through a hidden layer containing 512 neurons before connecting it to the output layer. The output layer, based on the classification requirements of weld defects in practical applications (such as porosity, cracks, lack of fusion, etc.), uses the Softmax activation function to map the integrated target features to a preset defect category space, ultimately outputting the probability distribution of each defect category. For example, when inputting certain ultrasonic time-frequency data, the model outputs a probability distribution of "porosity: 0.85, crack: 0.12, lack of fusion: 0.02, no defect: 0.01". Based on the principle of maximum probability, the abnormal detection result of this weld can be determined as "porosity".
[0047] In the aforementioned weld anomaly identification method, ultrasonic scanning data undergoes time-frequency transformation, converting the ultrasonic signal, which originally only reflected time-domain features, into ultrasonic time-frequency data containing both time and frequency dimensions. This effectively captures the dynamic feature changes of weld defects at different times and frequencies, significantly improving the richness and accuracy of feature representation compared to traditional analysis methods that rely solely on a single dimension of the time or frequency domain. Based on this, a pre-defined anomaly detection model processes the ultrasonic time-frequency data. This model, through multi-layer convolution and pooling operations, deeply mines subtle defect features within the ultrasonic time-frequency data and accurately maps the extracted target features to the defect category space via a fully connected layer, outputting a specific defect probability distribution. This achieves accurate identification and classification of weld anomalies. This not only provides intuitive and comprehensive data support for subsequent weld quality assessment and repair but also lays the foundation for the traceability and analysis of weld detection results, thereby improving the overall intelligence level and detection efficiency of weld anomaly identification.
[0048] In one embodiment, acquiring the ultrasonic scanning data of the target weld includes:
[0049] The target weld is scanned along a preset scanning path using an ultrasonic flaw detector to obtain the ultrasonic scanning results.
[0050] The ultrasound scan results are correlated with the corresponding time data to obtain ultrasound scan data.
[0051] When associating ultrasonic scan results with corresponding time data, the built-in clock module of the ultrasonic flaw detector can accurately timestamp each ultrasonic scan result (such as the echo signal amplitude of each sampling point) to the millisecond level, ensuring the accuracy of the time data. The specific association process is as follows: when the ultrasonic flaw detector begins scanning the target weld, time recording is simultaneously initiated. For each ultrasonic scan result acquired (for example, at a sampling frequency of 10MHz, one sampling point is generated every 0.1 microseconds), the current time data (such as "2024-05-2014:30:25.123456") is bound and stored with that scan result, forming a raw data structure containing "time data - ultrasonic scan result" key-value pairs. For example, when the probe moves to a specific position on the weld, an echo signal amplitude of 5.2V is acquired at the time "2024-05-2014:30:25.123456". These two data points are then associated and stored as a complete ultrasonic scan data record. This point-by-point association method ensures that subsequent time-frequency transformation based on time data can accurately correspond to the time series of each ultrasound scan result, guaranteeing the accuracy and reliability of the time-frequency transformation, and thus providing a data foundation for the subsequent anomaly detection model to extract accurate time-frequency features.
[0052] In one exemplary embodiment, the acquired ultrasound scan results can be preprocessed before data association. For example, a signal amplitude threshold of 0.5V can be set to filter out noise data with amplitudes below this threshold caused by electromagnetic interference or momentary poor probe contact. Simultaneously, by verifying time continuity, abnormal data points with timestamp intervals exceeding a preset sampling period (e.g., 0.1 microseconds based on a 10MHz sampling frequency) are removed to prevent time data jumps caused by equipment malfunctions from affecting the accuracy of subsequent association. After preprocessing, the timestamp binding operation is then performed to obtain high-quality ultrasound scan data.
[0053] In this embodiment, an ultrasonic flaw detector is used to scan the target weld along a preset scanning path to obtain ultrasonic scanning results. These results are then precisely correlated with corresponding time data to form complete and high-quality ultrasonic scanning data. This data acquisition and correlation method provides an accurate timing reference and reliable raw data source for subsequent time-frequency transformation, ensuring that each ultrasonic scanning result accurately corresponds to a specific moment in the scanning process. This allows subsequent time-frequency transformation based on time data to accurately capture the dynamic characteristics of the weld's internal structure over time, laying a solid data foundation for the anomaly detection model to extract effective target features.
[0054] In one embodiment, the step of performing time-frequency transformation on each of the ultrasound scan data based on the time data to obtain ultrasound time-frequency data includes:
[0055] Using a preset time-frequency transformation strategy, the ultrasound scan data are transformed according to the time data to obtain initial ultrasound time-frequency data; wherein, the time-frequency transformation strategy includes at least one of the following: continuous wavelet transform or short-time Fourier transform.
[0056] The initial ultrasonic time-frequency data is normalized to obtain the ultrasonic time-frequency data.
[0057] When selecting continuous wavelet transform as the time-frequency transformation strategy, appropriate wavelet basis functions (such as Morlet wavelets, Db series wavelets, etc.) and scale parameters can be chosen based on the temporal resolution requirements and frequency coverage range of the ultrasonic scanning data. For example, for the 0.5-10MHz ultrasonic signals commonly used in weld inspection, the scale range can be set to 1-128. By performing convolution operations on the ultrasonic scanning data using wavelet functions of different scales, wavelet coefficients corresponding to different frequency components at different time points are obtained. These coefficients constitute the amplitude information of the initial ultrasonic time-frequency data, with its time axis corresponding to the time data of the original scanning data, and the frequency axis determined by the conversion relationship between scale and frequency. If a short-time Fourier transform is used, the length of the sliding time window and the step size need to be preset. The window length can be determined comprehensively based on the shortest time event and the lowest frequency component to be analyzed in the signal. For example, for a signal containing rapidly changing characteristics at the millisecond level, a Hamming window with 256 sampling points can be selected, sliding on the time axis with a 50% overlap rate. Fourier transform is performed on the ultrasound scan data within each window to obtain the corresponding spectral information, which is then combined to form the initial ultrasound time-frequency data reflecting the frequency change over time. Normalization is a crucial step performed after obtaining the initial ultrasound time-frequency data to eliminate the influence of factors such as signal strength differences and equipment gain fluctuations under different detection conditions. Specifically, min-max normalization can be used to compress each element value in the initial data to the [0,1] interval, calculated as (x - x_min) / (x_max - x_min), where x is an element in the initial time-frequency data, and x_min and x_max are the minimum and maximum values in the initial data set, respectively. Alternatively, Z-score normalization can be used to convert the data into a distribution with a mean of 0 and a standard deviation of 1, calculated as (x - μ) / σ, where μ is the mean of the initial time-frequency data, and σ is its standard deviation. Through these normalization operations, ultrasound time-frequency data acquired in different batches and under different conditions have a uniform dimension and data distribution range, ensuring stable input and feature extraction for subsequent anomaly detection models.
[0058] In one exemplary embodiment, the time-frequency transformation strategy can be dynamically adjusted based on the signal characteristics and detection requirements of the ultrasonic scanning data. For example, when the target weld may contain high-frequency transient defects such as microcracks, continuous wavelet transform is preferred due to its advantages in time and frequency localization analysis, which can more accurately capture the high-frequency abrupt changes in the crack echo signal at a specific moment. For relatively stable defects such as porosity, short-time Fourier transform can quickly generate a time-frequency spectrum reflecting the changes in the frequency components of the defect echo over the scanning time due to its high computational efficiency and intuitive results. In the normalization stage, in addition to min-max normalization and Z-score normalization, logarithmic transform or power spectrum normalization can also be introduced. For example, for scenarios with extremely large differences in echo signal amplitude (such as the simultaneous presence of strong reflection interfaces and weak defect echoes), the initial ultrasonic time-frequency data can be first logarithmically compressed (e.g., by taking 10 times the logarithm or the natural logarithm) and then Z-score normalized to effectively suppress the excessive influence of strong signals and highlight the energy distribution of weak defect characteristics.
[0059] In this embodiment, by using a preset time-frequency transformation strategy and combining time data to process the ultrasound scanning data, the ultrasound signal in the time domain can be effectively converted to a time-frequency two-dimensional plane to generate initial ultrasound time-frequency data, thereby revealing the frequency components and their variation characteristics of the signal at different times.
[0060] In one embodiment, obtaining the anomaly detection model includes:
[0061] Acquire labeled ultrasonic time-frequency data of the target weld and construct a neural network architecture containing multiple convolutional layers.
[0062] The neural network architecture is trained using labeled ultrasonic time-frequency data of the target weld. When the loss function of the neural network architecture converges to a preset condition, the neural network architecture is determined as an anomaly detection model.
[0063] The labeled ultrasonic time-frequency data of the target weld can include a large number of time-frequency data samples of different types of weld defects (such as porosity, cracks, lack of fusion, slag inclusions, etc.) and corresponding defect category labeling information. This labeling information is usually determined jointly by domain experts based on actual weld inspection results, ultrasonic image analysis, and destructive testing results to ensure the accuracy and authority of the labeling. For example, for a sample labeled "crack," its corresponding ultrasonic time-frequency data should include the specific time-frequency characteristics exhibited by the crack defect during scanning, such as high-frequency, low-amplitude continuous or intermittent signal energy concentration areas appearing within a certain time period. When constructing a neural network architecture, in addition to the aforementioned multi-layer convolutional layers, batch normalization layers, ReLU activation functions, max-pooling layers, and fully connected layers, a Dropout layer can be introduced into the network to prevent overfitting. For example, setting a dropout ratio of 0.5 after a fully connected hidden layer randomly discards half of the neuron connections, reducing the co-adaptation relationship between neurons.
[0064] In one exemplary embodiment, during the model training phase, labeled ultrasonic time-frequency data can be divided into a training set, a validation set, and a test set according to a preset ratio (e.g., 7:2:1). The training set is used to learn model parameters, the validation set is used to monitor model performance during training and adjust hyperparameters (e.g., learning rate, batch size), and the test set is used to evaluate the generalization ability of the finally trained model. The training process uses the backpropagation algorithm with the cross-entropy loss function as the optimization objective. This loss function can effectively measure the difference between the defect probability distribution output by the model and the true labeled category of the sample. For example, for a sample with a true label of "pore", if the probability distribution output by the model is "pore: 0.85, crack: 0.12, non-fusion: 0.02, no defect: 0.01", the cross-entropy loss value will be small; if the model output deviation is large, such as "pore: 0.10, crack: 0.70, non-fusion: 0.15, no defect: 0.05", the loss value will increase significantly. The optimizer can be the Adam optimizer, with an initial learning rate of 0.001 and a learning rate decay strategy employed, such as reducing the learning rate to 0.9 times its original value every 10 epochs to accelerate convergence and improve convergence accuracy. During training iterations, the model can gradually reduce the loss function value by continuously adjusting the weights and bias parameters of each layer. The model is considered to have reached convergence when the loss function value on the validation set no longer decreases for several consecutive epochs (e.g., 15 epochs), or when the loss function values on both the training and validation sets converge to a preset threshold range (e.g., less than 0.01). At this point, the current neural network architecture and its parameters are saved and designated as the final anomaly detection model. For example, after 200 epochs of training, if the model's average loss function value on the validation set stabilizes at 0.008, and the defect identification accuracy on the test set reaches over 95%, meeting the preset performance metrics, training can be stopped and the model saved. Through this supervised training method based on labeled data, the anomaly detection model can fully learn the time-frequency characteristic patterns of different types of weld defects, thus enabling it to accurately identify weld anomalies in unknown weld time-frequency data.
[0065] In this embodiment, a training sample library is constructed by acquiring labeled ultrasonic time-frequency data of the target weld. Based on this sample library, a neural network architecture containing multiple convolutional layers is trained until the loss function converges to a preset condition, ultimately determining it as the anomaly detection model. This model construction method fully utilizes the defect feature knowledge contained in the labeled data. Through the deep learning capabilities of the neural network, the model can automatically learn and master the unique performance patterns of different weld defects in ultrasonic time-frequency data. The accuracy of the labeled data provides a reliable supervisory signal for model training, while the multi-layer convolutional network structure design ensures the effective extraction of complex time-frequency features. Once the model training is complete and convergence conditions are met, it possesses the ability to accurately process newly input ultrasonic time-frequency data and determine defect categories, thus providing the core intelligent analysis engine for the entire weld anomaly identification device.
[0066] In one embodiment, inputting the ultrasound time-frequency data into a preset anomaly detection model and outputting anomaly detection results includes:
[0067] The ultrasonic time-frequency data is input into the input layer of the anomaly detection model, and features are extracted through multiple convolution and pooling operations to obtain the target features.
[0068] The target features are mapped to the defect category space through a fully connected layer, and the generated defect probability distribution is output.
[0069] The target features, after deep extraction through multiple convolutional layers, can contain key visual and structural information about weld defects in the time-frequency domain, such as energy distribution patterns, frequency variation trends, and signal morphology in time series, unique to different defect types. The fully connected layer, serving as the model's classification decision part, maps the high-dimensional target feature vector to a predefined defect category space (e.g., porosity, cracks, lack of fusion, inclusions, and no defects), achieving a non-linear transformation from features to defect categories. For example, for a segment of input ultrasonic time-frequency data, the fully connected layer calculates the probability value of the data belonging to each defect category based on learned weight parameters, forming a probability distribution vector. For instance, the output probability distribution might be "porosity: 0.02, cracks: 0.89, lack of fusion: 0.05, inclusions: 0.03, no defects: 0.01," where the category with the highest probability value, "cracks," represents the model's initial judgment of the data.
[0070] In one exemplary embodiment, to further improve the reliability of anomaly detection results, the model can introduce a decision threshold mechanism after outputting the defect probability distribution. For example, a comprehensive probability threshold (e.g., 0.8) and a single-category probability threshold (e.g., 0.7) can be set. Only when the highest probability value exceeds the single-category probability threshold and the sum of the probabilities of all categories meets the requirements of the comprehensive probability threshold, is the category corresponding to the highest probability determined as the final anomaly detection result; otherwise, the sample is marked as "suspected anomaly" or "requires manual review," avoiding a decrease in detection accuracy due to the model's misjudgment of ambiguous samples. Simultaneously, for samples marked as "suspected anomaly," the top two defect categories in their probability distribution and their corresponding probabilities can be output, providing a reference direction for subsequent manual review. For example, if the probability distribution of a sample is "crack: 0.65, non-fusion: 0.25, other categories are all below 0.05," and the highest single-category probability of 0.65 is lower than the preset threshold of 0.7, then the model outputs "suspected crack (probability 0.65) or non-fusion (probability 0.25), manual review recommended."
[0071] In this embodiment, after inputting ultrasound time-frequency data into the input layer of the anomaly detection model, the model performs deep feature extraction on the input two-dimensional time-frequency data through multi-layer convolution operations. This achieves layer-by-layer abstraction of the data and capture of key information, improving the accuracy of anomaly detection.
[0072] In one embodiment, after the output yields the anomaly detection result, it further includes:
[0073] Based on the time correspondence between the probe scanning position coordinates and the detection results, the three-dimensional position of the defect in the target weld is determined.
[0074] The three-dimensional location and anomaly detection results are integrated into a structured detection report.
[0075] The probe scanning position coordinates are recorded in real time during the ultrasonic scanning process. These coordinates include the probe's three-dimensional coordinates along the weld length, width, and depth, and are precisely correlated with the scanning time data. When the anomaly detection model outputs an anomaly detection result (such as a "crack" and its probability distribution), the probe's scanning position coordinates at the same moment can be retrieved based on the timestamp of the corresponding ultrasonic time-frequency data. These coordinates correspond to the physical location of the abnormal defect inside the weld. For example, if the time data corresponding to a "crack" detection result is 15.3 seconds after the start of the scan, the mapping relationship between time and position coordinates indicates that the probe is located at 120mm in the weld length direction, 5mm in the width direction, and 8mm in the depth direction, thus locating the crack defect at this three-dimensional point in the weld. For continuously distributed defects (such as a crack extending along its length), the extension trajectory and distribution range of the defect in three-dimensional space can be fitted using the scanning position coordinates corresponding to multiple consecutive time points. In the process of integrating structured inspection reports, in addition to three-dimensional location and abnormal detection results (defect category, probability value), key visualization information of ultrasonic time-frequency data (such as time-frequency spectrum segments, highlighting defect feature areas), inspection time, equipment model, probe parameters, inspection standards, and other metadata can be included. The report format can adopt standardized JSON or PDF formats. JSON format facilitates subsequent data storage, transmission, and automated processing by computer systems, while PDF format is suitable for manual review and archiving. For example, a structured inspection report for a pipe circumferential weld would clearly list "Defect 1: Type - Crack, Probability - 0.92, Three-dimensional location - (Length: 120mm, Width: 5mm, Depth: 8mm), Time-frequency characteristic description - High-frequency (3-5MHz), low-amplitude energy concentration area appears within the time period of 15.2-15.4 seconds," along with a screenshot of the ultrasonic time-frequency spectrum for that time period. At the end of the report, the number and type distribution of all detected abnormal defects, as well as the overall weld quality assessment conclusion (such as "Meets XX standard requirements" or "XX level defect exists, requiring rework"), would be summarized. This structured report not only presents the test results intuitively, but also provides comprehensive and standardized data support for weld quality assessment, defect repair, and subsequent traceability.
[0076] In this embodiment, by precisely matching the probe scanning position coordinates with the time correspondence of the detection results, the defects identified in the abnormal detection results can be correlated with the actual spatial location of the weld. This realizes the mapping of defects from abstract time-frequency data features to specific physical locations, providing precise spatial guidance for subsequent weld quality assessment and repair work.
[0077] In one exemplary embodiment, the anomaly detection method may be as follows: Figure 3 The implementation shown can specifically include:
[0078] Step S300: Collect raw A-scan data; specifically, use a conventional ultrasonic flaw detector to scan the workpiece under test to obtain raw A-scan signal sequences, each signal being a one-dimensional time series.
[0079] Step S302: Preprocess the original signal; specifically, preprocess the original signal, including: using wavelet threshold denoising or adaptive filtering to eliminate high-frequency noise, performing distance gain compensation correction based on sound path, and normalizing the signal amplitude to the [0,1] interval.
[0080] Step S304, time-frequency feature extraction; specifically, time-frequency feature extraction: perform time-frequency transformation on each preprocessed A-scan signal to generate a two-dimensional time-frequency graph, which can be selected as continuous wavelet transform or short-time Fourier transform.
[0081] Step S306: Defect identification model judgment; specifically, a defect identification model based on a convolutional neural network is constructed. The aforementioned time-frequency image is used as input to the deep learning model, preserving the local time-frequency structure information of the signal, and outputting the probability distribution of defect categories, i.e., two categories: defective and non-defective. Combining the ultrasonic probe scanning trajectory with the identification results, the spatial coordinates of the defect in the workpiece are determined.
[0082] Step S308, Error reporting and manual review; specifically, output the confidence score of each test result to assist in manual review.
[0083] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0084] Based on the same inventive concept, this application also provides a weld anomaly identification device for implementing the weld anomaly identification method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more weld anomaly identification device embodiments provided below can be found in the limitations of the weld anomaly identification method described above, and will not be repeated here.
[0085] In one embodiment, such as Figure 4 As shown, a weld anomaly identification device is provided, comprising: a data acquisition module 401, a data transformation module 403, and an anomaly detection module 405, wherein:
[0086] The data acquisition module is used to acquire ultrasonic scanning data of the target weld; wherein, the ultrasonic scanning data includes ultrasonic scanning results and corresponding time data;
[0087] The data transformation module is used to perform time-frequency transformation on each of the ultrasound scan data according to the time data to obtain ultrasound time-frequency data;
[0088] An anomaly detection module is used to input the ultrasonic time-frequency data into a preset anomaly detection model and output anomaly detection results; wherein, the anomaly detection model is used to extract target features based on the input time-frequency data and output the identification results of the target weld anomaly based on the target features.
[0089] Each module in the aforementioned weld anomaly identification device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can call and execute the corresponding operations of each module.
[0090] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a weld anomaly identification method. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0091] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0092] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0093] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0094] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0095] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for identifying weld anomalies, characterized in that, The method includes: Acquire ultrasonic scanning data of the target weld; wherein, the ultrasonic scanning data includes ultrasonic scanning results and corresponding time data; Based on the time data, time-frequency transformation is performed on each of the ultrasound scan data to obtain ultrasound time-frequency data; The ultrasonic time-frequency data is input into a preset anomaly detection model, and anomaly detection results are output. The anomaly detection model is used to extract target features based on the input time-frequency data, and output the identification result of the target weld anomaly based on the target features.
2. The method according to claim 1, characterized in that, The acquisition of ultrasonic scanning data of the target weld includes: The target weld is scanned along a preset scanning path using an ultrasonic flaw detector to obtain the ultrasonic scanning results; The ultrasound scan results are correlated with the corresponding time data to obtain ultrasound scan data.
3. The method according to claim 1, characterized in that, The step of performing time-frequency transformation on each of the ultrasound scan data based on the time data to obtain ultrasound time-frequency data includes: Using a preset time-frequency transformation strategy, the ultrasound scan data are transformed according to the time data to obtain initial ultrasound time-frequency data; wherein, the time-frequency transformation strategy includes at least one of the following: continuous wavelet transform or short-time Fourier transform; The initial ultrasonic time-frequency data is normalized to obtain the ultrasonic time-frequency data.
4. The method according to claim 1, characterized in that, The acquisition of the anomaly detection model includes: Acquire labeled ultrasonic time-frequency data of the target weld and construct a neural network architecture containing multiple convolutional layers; The neural network architecture is trained using labeled ultrasonic time-frequency data of the target weld. When the loss function of the neural network architecture converges to a preset condition, the neural network architecture is determined as an anomaly detection model.
5. The method according to claim 4, characterized in that, The step of inputting the ultrasonic time-frequency data into a preset anomaly detection model and outputting anomaly detection results includes: The ultrasonic time-frequency data is input into the input layer of the anomaly detection model, and features are extracted through multiple convolution and pooling operations to obtain the target features; The target features are mapped to the defect category space through a fully connected layer, and the generated defect probability distribution is output.
6. The method according to claim 1, characterized in that, After obtaining the anomaly detection result, the output also includes: The three-dimensional position of the defect in the target weld is determined based on the time correspondence between the probe scanning position coordinates and the detection results. The three-dimensional location and anomaly detection results are integrated into a structured detection report.
7. A weld anomaly identification device, characterized in that, The device includes: The data acquisition module is used to acquire ultrasonic scanning data of the target weld; wherein, the ultrasonic scanning data includes ultrasonic scanning results and corresponding time data; The data transformation module is used to perform time-frequency transformation on each of the ultrasound scan data according to the time data to obtain ultrasound time-frequency data; An anomaly detection module is used to input the ultrasonic time-frequency data into a preset anomaly detection model and output anomaly detection results; wherein, the anomaly detection model is used to extract target features based on the input time-frequency data and output the identification results of the target weld anomaly based on the target features.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Cited By
A Defect Type Intelligent Judgment System and Method Based on Ultrasonic Detection
CN122259724A