A three-branch attention feature fusion method and system for ultrasonic defect detection
Through the three-branch attention feature fusion method, combined with Gaussian filtering and multi-scale feature extraction, the problem of data imbalance and similarity in ultrasonic defect detection is solved, and high-accuracy and efficient defect detection is achieved.
Patent Information
- Application Number
- CN202111522758.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-13
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-12-13
AI Technical Summary
Existing ultrasonic defect detection technology faces problems such as data imbalance, large differences within groups, and high similarity between groups, resulting in low classification accuracy. Traditional methods rely on human feature selection and are inefficient.
Using a three-branch attention feature fusion method, through Gaussian filtering, short-time Fourier transform and multi-scale feature extraction, combined with a deep multi-modal feature fusion algorithm, one-dimensional data features and time-frequency map features are extracted, and the attention mechanism is used for feature fusion , perform defect detection and classification.
It improves the classification accuracy, reduces misjudgments caused by data imbalance, intra-group differences and inter-group similarities, and enables complex ultrasonic echo signal defect detection in unknown environments with fewer parameters and less calculations.
Smart Images

Figure CN114201993B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ultrasonic defect detection, and in particular to a three-branch attention feature fusion method and system for detecting ultrasonic defects. Background Art
[0002] In the field of industrial production, quality is an important indicator of product quality. If defective products are not discovered in time, it is very likely to cause major safety accidents. These defects may be hidden inside the product or on the surface of the product. Because of this, ultrasound, as a sound energy with strong penetrating power, is widely used in the field of non-destructive testing. When operating an ultrasonic flaw detector, the ultrasonic exciter emits ultrasonic waves into the workpiece, and then the echo signal is received by the ultrasonic transducer for evaluation, and the characteristics of the ultrasonic A-scan signal are analyzed to detect and classify defects in the workpiece. Due to the complexity of defects, the use of ultrasonic flaw detectors for automatic defect detection tasks faces the following challenges: 1) Data imbalance: In the industrial field, defective workpieces are far less than defect-free ones, and there is an imbalance in data samples. 2) Intra-group differences: In the industrial field, the shapes of the same defect are not exactly the same, and the echoes after the ultrasonic wave passes through the defect are also quite different. 3) Similarity between different classes: The shapes and sizes of different defects are very likely to be very similar, and the ultrasonic echoes cannot be distinguished by the naked eye.
[0003] Traditional ultrasonic flaw detection methods focus more on manually selecting representative features and feeding them into probability and machine learning models with low computational complexity. This method is inefficient, overly dependent on professional knowledge, and has low classification accuracy, so it is not widely used. In the face of actual industrial scenarios, it is necessary to propose an efficient, automatic and accurate defect detection method. With the rise of neural networks, there is no need to manually select representative features, which has given new ideas to ultrasonic defect detection tasks. Many researchers are pursuing automatic signal classification systems. Neural networks have played a certain role in ultrasonic detection systems, but existing network models still cannot solve the problem of low classification accuracy caused by large differences within data groups and high similarities between groups.
[0004] In view of the above problems, the present invention proposes a triple-branch attention feature fusion (TAF2) method for ultrasonic defect detection. The ultrasonic echo signal is first processed by a Gaussian filter, and then the time-frequency diagram of the ultrasonic echo signal is generated using a short-time Fourier transform. After preprocessing, the ultrasonic echo signal and the time-frequency diagram are input into the three-branch attention feature fusion network for identification and classification. Experimental results show that the average accuracy of the three-branch attention feature fusion method reaches 96.54% without Gaussian filtering, and the accuracy can reach 100% after a suitable Gaussian filter, which can effectively improve the problem of low classification accuracy caused by the intra-group differences of defects and the similarities between different classes. Summary of the invention
[0005] The present invention proposes a three-branch attention feature fusion method and system for detecting ultrasonic defects to solve the defects of the prior art mentioned above.
[0006] In one aspect, the present invention proposes a three-branch attention feature fusion method for detecting ultrasonic defects, the method comprising the following steps:
[0007] S1: using the Gaussian filtering method to denoise the collected one-dimensional ultrasonic echo signal, and then performing time-frequency conversion on the denoised one-dimensional ultrasonic echo signal to obtain the corresponding time-frequency diagram;
[0008] S2: extracting features from the denoised one-dimensional ultrasonic echo signal and the time-frequency graph using a multi-scale feature extraction algorithm, thereby obtaining one-dimensional data features and time-frequency graph features, respectively;
[0009] S3: using a deep multi-mode feature fusion algorithm to fuse the one-dimensional data feature and the time-frequency graph feature to obtain a fusion feature, and then extracting a time feature from the fusion feature;
[0010] S4: fusing the one-dimensional data feature, the time-frequency graph feature and the time feature to obtain a final fusion feature, and using the final fusion feature to perform defect detection and classification.
[0011] The above method uses three branches to extract features from one-dimensional ultrasonic echo signals, and then uses the attention mechanism for feature fusion. It uses a feature extraction method for defect shape level and time series level. Only a small amount of training data is needed to detect and classify different types of defects in industrial scenarios. It can effectively reduce the misjudgment caused by data imbalance, intra-group differences and similarities between different groups, and perform defect detection on complex ultrasonic echo signals in unknown environments. This method uses fewer parameters, obtains high accuracy of classification results, and has a small amount of training calculations. In addition, a Gaussian filter is used to filter out the noise in the ultrasonic echo. The noise mainly presents a Gaussian distribution. Gaussian filtering is very effective for noise that obeys a normal distribution. It can filter out noise to the maximum extent and preserve the shape characteristics of the original signal.
[0012] In a specific embodiment, the time-frequency conversion specifically includes performing time-frequency conversion on the denoised one-dimensional ultrasonic echo signal using short-time Fourier transform to generate the time-frequency diagram. The time-frequency diagram of the ultrasonic echo signal is obtained using short-time Fourier transform. For non-stationary signals, short-time Fourier transform itself has no interference from cross terms and has obvious effects in analyzing the time-varying characteristics of ultrasonic echo signals.
[0013] In a specific embodiment, S2 specifically includes: using a multi-scale feature extraction algorithm to extract multi-scale features at the shape level from the denoised one-dimensional ultrasonic echo signal and the time-frequency diagram, respectively, to obtain one-dimensional data features and time-frequency diagram features, respectively.
[0014] In a specific embodiment, the method of using a deep multi-mode feature fusion algorithm to fuse the one-dimensional data feature and the time-frequency graph feature to obtain a fusion feature specifically includes:
[0015] Unifying the dimensions of the one-dimensional data feature and the time-frequency graph feature according to the dimensions respectively corresponding to the one-dimensional data feature and the time-frequency graph feature, thereby converting the dimensions of the one-dimensional data feature and the dimensions of the time-frequency graph feature into the same value;
[0016] The one-dimensional data features and the time-frequency graph features after the dimensions are unified are concatenated in the channel dimension to obtain an input feature matrix;
[0017] Inputting the input feature matrix into the attention model for learning and classification to obtain an output feature matrix of the attention model;
[0018] The fusion feature is obtained by enhancing the relative features between the output feature matrix and the input feature matrix.
[0019] In a specific embodiment, extracting the time feature from the fused feature specifically includes: extracting the time feature from the fused feature according to the size of the fused feature and using a gated recurrent unit.
[0020] In a specific embodiment, the S4 specifically includes:
[0021] The one-dimensional data feature, the time-frequency graph feature and the time feature are fused to obtain a final fused feature, and then the final fused feature is passed through a fully connected layer for defect detection and classification, and a defect classification result is output.
[0022] In a specific embodiment, the S3 further includes:
[0023] S301: after obtaining the fused feature, restoring the fused feature according to the dimensions of the one-dimensional data feature and the time-frequency graph feature, thereby obtaining a new one-dimensional data feature whose dimension is consistent with the one-dimensional data feature, and obtaining a new time-frequency graph feature whose dimension is consistent with the time-frequency graph feature;
[0024] S302: extracting features from the new one-dimensional data features and the new time-frequency graph features using a multi-scale feature extraction algorithm, and fusing the two features to obtain a fused feature;
[0025] S303: Repeat the loop execution of S301 to S302, and obtain the final one-dimensional data features and time-frequency graph features after several repeated loop executions. At the same time, extract the time features of the fused features obtained after each execution according to their sizes, and then unify the dimensions of the results of each extraction and accumulate them to obtain the final time features.
[0026] According to a second aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a computer processor, the above method is implemented.
[0027] According to a third aspect of the present invention, a three-branch attention feature fusion system for detecting ultrasonic defects is proposed, the system comprising:
[0028] Signal preprocessing module: configured to denoise the collected one-dimensional ultrasonic echo signal by using Gaussian filtering method, and then perform time-frequency conversion on the denoised one-dimensional ultrasonic echo signal, so as to obtain the corresponding time-frequency diagram;
[0029] A multi-scale feature extraction module: configured to extract features from the denoised one-dimensional ultrasonic echo signal and the time-frequency graph using a multi-scale feature extraction algorithm, thereby obtaining one-dimensional data features and time-frequency graph features, respectively;
[0030] Feature fusion module: configured to use a deep multi-mode feature fusion algorithm to fuse the one-dimensional data feature and the time-frequency graph feature to obtain a fusion feature, and then extract a time feature from the fusion feature;
[0031] Detection and classification module: configured to fuse the one-dimensional data features, the time-frequency graph features and the time features to obtain final fusion features, and use the final fusion features to perform defect detection and classification.
[0032] The present invention uses a Gaussian filtering method to denoise the collected one-dimensional ultrasonic echo signal, and then performs time-frequency conversion on the denoised one-dimensional ultrasonic echo signal to obtain a corresponding time-frequency diagram; the multi-scale feature extraction algorithm is used to extract features from the denoised one-dimensional ultrasonic echo signal and the time-frequency diagram, respectively, to obtain one-dimensional data features and time-frequency diagram features; the deep multi-mode feature fusion algorithm is used to fuse the one-dimensional data features and the time-frequency diagram features to obtain fusion features, and then the time features are extracted from the fusion features; the one-dimensional data features, the time-frequency diagram features and the time features are fused to obtain the final fusion features, and the final fusion features are used to detect and classify defects. The present invention only requires a small amount of training data to detect and classify defects of different categories in industrial scenarios, effectively reducing misjudgments caused by data imbalance, intra-group differences and similarities between different groups, and has the characteristics of few parameters, high classification accuracy and small training calculation amount. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and together with the description are used to explain the principles of the present invention. Other embodiments and many expected advantages of the embodiments will be readily appreciated as they become better understood by reference to the following detailed description. Other features, objects and advantages of the present application will become more apparent by reading the detailed description of the non-limiting embodiments made with reference to the following drawings:
[0034] Figure 1 is a flow chart of a three-branch attention feature fusion method for detecting ultrasonic defects according to an embodiment of the present invention;
[0035] Figure 2 is a framework diagram of a defect detection system according to a specific embodiment of the present invention;
[0036] Figure 3 is a comparison diagram of an ultrasonic echo signal before and after Gaussian filtering in a specific embodiment of the present invention;
[0037] Figure 4 is a time-frequency diagram of different types of defect signals according to a specific embodiment of the present invention;
[0038] Figure 5It is a structural diagram of a three-branch attention feature fusion algorithm for defect detection according to a specific embodiment of the present invention;
[0039] Figure 6 is a structural diagram of an MSFE module of a specific embodiment of the present invention;
[0040] Figure 7 is a structural diagram of a DMF2 module of a specific embodiment of the present invention;
[0041] Figure 8 is a structural diagram of a temporal feature pyramid module of a specific embodiment of the present invention;
[0042] Fig. 9 is a structural diagram of a gated recurrent unit (GRU) according to a specific embodiment of the present invention;
[0043] Fig.10 is a comparison chart of the accuracy of different algorithms under different σ Gaussian filters in a specific embodiment of the present invention;
[0044] Fig.11 is a defect detection result of a specific embodiment of the present invention without Gaussian filtering;
[0045] Fig.12 It is the classification result of different types of defects by different algorithms when σ=1.5 in a specific embodiment of the present invention;
[0046] Fig.13 It is a framework diagram of a three-branch attention feature fusion system for detecting ultrasonic defects according to an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0048] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0049] According to an embodiment of the present invention, a three-branch attention feature fusion method for detecting ultrasonic defects is provided. Figure 1 FIG. 4 is a flow chart showing a three-branch attention feature fusion method for detecting ultrasonic defects according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0050] S1: using the Gaussian filtering method to denoise the collected one-dimensional ultrasonic echo signal, and then performing time-frequency conversion on the denoised one-dimensional ultrasonic echo signal to obtain the corresponding time-frequency diagram;
[0051] S2: extracting features from the denoised one-dimensional ultrasonic echo signal and the time-frequency graph using a multi-scale feature extraction algorithm, thereby obtaining one-dimensional data features and time-frequency graph features, respectively;
[0052] S3: using a deep multi-mode feature fusion algorithm to fuse the one-dimensional data feature and the time-frequency graph feature to obtain a fusion feature, and then extracting a time feature from the fusion feature;
[0053] S4: fusing the one-dimensional data feature, the time-frequency graph feature and the time feature to obtain a final fusion feature, and using the final fusion feature to perform defect detection and classification.
[0054] In a specific embodiment, the time-frequency conversion specifically includes performing time-frequency conversion on the denoised one-dimensional ultrasonic echo signal using short-time Fourier transform to generate the time-frequency diagram.
[0055] In a specific embodiment, S2 specifically includes: using a multi-scale feature extraction algorithm to extract multi-scale features at the shape level from the denoised one-dimensional ultrasonic echo signal and the time-frequency diagram, respectively, to obtain one-dimensional data features and time-frequency diagram features, respectively.
[0056] In a specific embodiment, the method of using a deep multi-mode feature fusion algorithm to fuse the one-dimensional data feature and the time-frequency graph feature to obtain a fusion feature specifically includes:
[0057] Unifying the dimensions of the one-dimensional data feature and the time-frequency graph feature according to the dimensions respectively corresponding to the one-dimensional data feature and the time-frequency graph feature, thereby converting the dimensions of the one-dimensional data feature and the dimensions of the time-frequency graph feature into the same value;
[0058] The one-dimensional data features and the time-frequency graph features after the dimensions are unified are concatenated in the channel dimension to obtain an input feature matrix;
[0059] Inputting the input feature matrix into the attention model for learning and classification to obtain an output feature matrix of the attention model;
[0060] The fusion feature is obtained by enhancing the relative features between the output feature matrix and the input feature matrix.
[0061] In a specific embodiment, extracting the time feature from the fused feature specifically includes: extracting the time feature from the fused feature according to the size of the fused feature and using a gated recurrent unit.
[0062] In a specific embodiment, the S4 specifically includes:
[0063] The one-dimensional data feature, the time-frequency graph feature and the time feature are fused to obtain a final fused feature, and then the final fused feature is passed through a fully connected layer for defect detection and classification, and a defect classification result is output.
[0064] In a specific embodiment, the S3 further includes:
[0065] S301: after obtaining the fused feature, restoring the fused feature according to the dimensions of the one-dimensional data feature and the time-frequency graph feature, thereby obtaining a new one-dimensional data feature whose dimension is consistent with the one-dimensional data feature, and obtaining a new time-frequency graph feature whose dimension is consistent with the time-frequency graph feature;
[0066] S302: extracting features from the new one-dimensional data features and the new time-frequency graph features using a multi-scale feature extraction algorithm, and fusing the two features to obtain a fused feature;
[0067] S303: Repeat the loop execution of S301 to S302, and obtain the final one-dimensional data features and time-frequency graph features after several repeated loop executions. At the same time, extract the time features of the fused features obtained after each execution according to their sizes, and then unify the dimensions of the results of each extraction and accumulate them to obtain the final time features.
[0068] In a specific embodiment, the original ultrasonic echo data is first processed by a Gaussian filter, and then a short-time Fourier transform is used to generate a time-frequency graph of the ultrasonic echo data. After preprocessing, they are placed in a triple-branch attentive feature fusion network (TAF2-Net) for detection and classification. The steps of the three-branch attention fusion network described in the present invention are as follows: first, the multi-scale features of the ultrasonic echo one-dimensional signal and the time-frequency graph are extracted from the multi-scale feature extraction module; then, these features are fused using a deep multi-modal feature fusion module; then, the fused features of different scales are unified in scale through a temporal feature pyramid, and then sent to a gate recurrent unit (GRU) to extract temporal features; finally, the features extracted by the multi-scale feature extraction module and the GRU are fused to obtain the final prediction result. In order to introduce the content of the present invention in detail, some concepts in the three-branch attention fusion network of the present invention are explained or specified below:
[0069] Definition 1: Multi-Scale Feature Extraction (MSFE) module
[0070] This module mainly consists of two branches: the first is downsampling, which reduces the number of channels to half of the original input channels; the second branch cooperates with bottleneck to reduce the number of parameters and the required computing resources, and then obtains the multi-scale features of the input signal through two convolution kernels of different sizes;
[0071] The downsampling branch is described by formula (1):
[0072]
[0073] Where X represents the input feature matrix, W 1×1 is a convolution kernel of size 1×1, * indicates convolution, BN is batchnorm, is the output feature of the first branch.
[0074] In order to reduce the number of parameters, the second branch first passes through the bottleneck to reduce the number of channels to one-fourth of the original, as shown in formula (2); where σ(·) represents ReLU, defined as formula (3); then, the convolution kernel size is 1×3, and W is used to convolution the kernel size. 1×3 and a convolution kernel size of 1×5 W 1×5 To extract multi-scale shape features, and then splice them in the channel dimension to obtain the output features of the second branch As shown in formula (4).
[0075] Y1=Θ(X|W 1×1 )
[0076] =σ(Φ(X|W 1×1 ))
[0077] =σ(BN(downsample(W 1×1 *X))) (2)
[0078]
[0079]
[0080] The definition of Θ(·) is shown in formula (2). Finally, the features of the two branches are numerically added to obtain the output feature
[0081] Definition 2: Deep Multimodal Feature Fusion module (DMF2)
[0082] In order to link the one-dimensional data features extracted in the previous step with the time-frequency graph features, a deep multi-mode feature fusion module is proposed. Due to the different dimensions of the two, the feature fusion operation cannot be performed directly, and the dimensions of the two need to be unified first. The dimension of the one-dimensional data feature Y1 is converted to B×C×n according to formula (5) (where B represents batch size, C represents the number of channels, and n represents the length of the signal at this time), and Y is obtained. 1D :
[0083] Y 1D = linear(L, n) (5)
[0084] Then, the feature map Y2 (W represents the width of the image at this time, H represents the height) of the time-frequency map is flattened through formula (6) and then converted into Y 1D Same dimension Y 2D , Y 1D and Y 2D Concatenate in the channel dimension to get Y I , as shown in formula (7).
[0085] Y 2D =linear(flatten(W×H),n) (6)
[0086] Y I =CAT(Y 1D , Y 2D ) (7)
[0087] Then, Y I =[I1, I2, I3, ..., I2C ] Input cross attention and obtain Q, K and V through learning, as shown in formula (8).
[0088] Q=W q I, K = W k I, V = W v I (8)
[0089] Among them, I is the input feature matrix, W q Denotes the matrix q, W k Denotes the matrix k, W v W represents the matrix v. q , W k and W v It is obtained through cross attention learning. The calculation formula of the output matrix O is as follows (9):
[0090] O=A′V
[0091] =(softmax(A))·V
[0092] =(softmax(K T Q))·V (9)
[0093] Finally, in order to strengthen the relative characteristics between the output feature matrix and the input feature matrix, the two are subtracted according to formula (10) and then passed through a convolution kernel W of size 1×1 1x1 , and add it to the input matrix to get the fused matrix O′.
[0094] O′=Θ((IO)|W 1×1 )+I
[0095] =σ(BN(W 1×1 *(IO)))+I (10)
[0096] So far, information exchange between features of different dimensions has been achieved. Finally, O′ is restored to its original dimension according to the opposite operation of unifying the dimension, and sent to the corresponding MSFE module to continue feature extraction.
[0097] Definition 3: Time Series Feature Extraction Module
[0098] After each convolution, the MSFE module obtains feature maps of different scales, which naturally have a pyramid structure. We use different step sizes to send the feature maps of different scales obtained from the MSFE module to the GRU to extract time series features.
[0099] First, k inputs are given with sizes L1×H1, L2×H2, L3×H3, ..., L k ×Hk The feature extraction module of k features can be represented by the feature set F: F = (f1, f2, f3, ..., f k ). Through experiments, we take k = 4. For f1, the module is folded with a step size of eight and then input into the GRU module. The output feature map G1 is as shown in formula (11):
[0100] G1=maxpool(Ψ(φ(f1,8)))+avgpool(Ψ(φ(f1,8))) (11)
[0101] Among them, maxpool represents the maximum sampling, avgpool represents the average sampling, Ψ represents the GRU module, and φ(a, b) represents taking every b elements of sequence a as an element of the new sequence.
[0102] Similarly, the output of G2 is G2 = maxpool(Ψ(φ(f2,4)))+avgpool(Ψ(φ(f2,4))),
[0103] The output of G3 is G3 = maxpool(Ψ(φ(f3,2)))+avgpool(Ψ(φ(f3,2))),
[0104] The output of G4 is G4=maxpool(Ψ(φ(f4,1)))+avgpool(Ψ(φ(f4,1))).
[0105] At this time, the dimensions of G1, G2, G3, and G4 are unified to L4×H4, and matrix addition can be performed, and the final output is G=flatten(G1+G2+G3+G4).
[0106] Based on the above conceptual explanations and regulations, the method of the present invention is explained below using a specific three-branch attention fusion network of the present invention:
[0107] Figure 2 This is a framework diagram of the defect detection system based on the three-branch attention fusion network of this embodiment. In this embodiment, the one-dimensional echo signal of the test block collected by the ultrasonic flaw detector is sent to Gaussian filtering for denoising, and then its time-frequency diagram is obtained by short-time Fourier transform, and then the time-frequency diagram and the one-dimensional ultrasonic echo signal are used for defect detection and classification through the three-branch attention feature fusion algorithm.
[0108] The specific implementation process is as follows:
[0109] Step 1: A one-dimensional ultrasonic echo signal is collected on a test block by an ultrasonic flaw detector to create a data set for the experiment. In order to simulate the phenomenon of unbalanced and insufficient data in industrial scenarios, the number of samples in each category of the data set created by the present invention is inconsistent, and the number of samples in each category does not exceed 400;
[0110] Step 2: Use Gaussian filter to remove noise from the collected one-dimensional ultrasonic echo signal. It should be noted that if the standard deviation σ is set too small, the noise filtering effect will not be thorough enough, and if σ is set too large, some useful details in the original signal will be filtered out. Therefore, the setting of σ is very important. Fig. 9 The influence of different values of σ on the final classification results was tested in ;
[0111] Step 3: Convert the one-dimensional ultrasonic echo signal into a time-frequency diagram through short-time Fourier transform. In order to prevent spectrum leakage and Gibbs phenomenon, a Gaussian window function is selected, and its length is set to 95, and finally the power distribution in the time-frequency domain is obtained;
[0112] Step 4: Input the time-frequency graph and one-dimensional echo signal into the three-branch attention feature fusion network for defect detection and classification.
[0113] Through the above method, the problem of low classification accuracy caused by imbalanced defect data, intra-group differences and similarities between different classes can be effectively solved, ensuring the accuracy and efficiency of defect detection.
[0114] Figure 3 3 is a comparison diagram of an ultrasonic echo signal before and after Gaussian filtering in this embodiment, wherein (301), (302), and (303) represent Gaussian filtering result diagrams under three conditions with different parameters σ. It can be seen that the smaller the σ is designed, the less obvious the smoothing effect of the image is, and the larger the σ is designed, the smoother the waveform of the image becomes.
[0115] Figure 4 is a time-frequency diagram of different types of defect signals in this embodiment, Figure 4 In the figure, (401), (402), (403), and (404) represent the time-frequency characteristic diagrams of four different types of defects respectively;
[0116] Figure 5 is a structural diagram of the three-branch attention feature fusion algorithm for defect detection in this embodiment, such as Figure 5 As shown, the three-branch attention feature fusion algorithm of this embodiment includes: MSFE-1D module, MSFE-2D module, DMF2 module, temporal feature pyramid module, GRU and back-end feature fusion module;
[0117] Figure 6is a structural diagram of the MSFE module of this embodiment, wherein (601) and (602) are structural diagrams of the MSFE-1D module and the MSFE-2D module in the three-branch attention feature fusion algorithm, which are used to extract shape features of a one-dimensional time series and a time-frequency diagram, respectively;
[0118] Figure 7 is a structural diagram of the DMF2 module of this embodiment, which is used to deeply fuse the one-dimensional data features extracted in the previous step with the time-frequency graph features;
[0119] Figure 8 is a structural diagram of the temporal feature pyramid module of this embodiment, which unifies the dimensions of feature matrices of different scales extracted by the temporal feature pyramid module and then feeds them into the GRU to extract temporal features;
[0120] Fig. 9 is a structural diagram of the GRU of this embodiment, which is used to extract the temporal features of the input feature matrix;
[0121] Fig.10 : is a comparison chart of the accuracy of different algorithms under different σ Gaussian filtering of a specific embodiment of the present invention; Fig.10 The results show that: 1) No matter what value σ takes, the accuracy of the three-branch attention feature fusion algorithm is the highest; 2) When σ=1.5, the three-branch attention feature fusion algorithm proposed in this invention obtains the best classification result, with an accuracy of 100%; 3) When σ=2, the accuracy of each algorithm is greatly improved, and the signal denoising achieves the best effect; 4) When σ=5,10, the accuracy of each algorithm begins to decrease.
[0122] The experiment of this embodiment shows that when σ takes an appropriate value, Gaussian filtering greatly improves the classification accuracy of the three-branch attention feature fusion network. The algorithm proposed in the present invention can solve the problem of large intra-group differences and high inter-group similarity in the automatic defect detection task;
[0123] Fig.11 This is a defect detection result of a specific embodiment of the present invention without Gaussian filtering, and the comparison results of the parameter amount and the amount of operation. The results show that the proposed three-branch attention feature fusion has the highest classification accuracy. Compared with SqueezeNet, GRU and LSTM, although the parameter amount is much smaller than that of the three-branch attention feature fusion algorithm, the classification accuracy is far less than that of the three-branch attention feature fusion algorithm, and the practical application significance is not great. Compared with AlexNet, resnet and VGG, the three-branch attention feature fusion algorithm has a smaller parameter amount than them and still achieves high accuracy;
[0124] Fig.12This is a specific embodiment of the present invention, when σ=1.5, the classification results of different algorithms for defects of different categories. The results show that the three-branch attention feature fusion algorithm proposed in the present invention has the best performance in the classification task of each category. The lossless class has the best classification result in each algorithm, and the classification result of the pore class is slightly worse.
[0125] The above content is a further detailed description of the present invention by a specific preferred embodiment. The specific embodiments of the present invention cannot be considered to be limited to these descriptions. The present invention is carried out on an ultrasonic defect detection system, and for defect detection research in other systems, as well as defect detection and classification using a three-branch attention feature fusion algorithm method, without departing from the concept of the present invention, making several simple deductions or substitutions should all fall within the scope of protection of the present invention.
[0126] Fig.13 The framework diagram of a three-branch attention feature fusion system for detecting ultrasonic defects according to an embodiment of the present invention is shown. The system includes a signal preprocessing module 1301 , a multi-scale feature extraction module 1302 , a feature fusion module 1303 and a detection classification module 1304 .
[0127] In a specific embodiment, the signal preprocessing module 1301 is configured to denoise the collected one-dimensional ultrasonic echo signal using a Gaussian filtering method, and then perform time-frequency conversion on the denoised one-dimensional ultrasonic echo signal to obtain a corresponding time-frequency diagram;
[0128] The multi-scale feature extraction module 1302 is configured to extract features from the denoised one-dimensional ultrasonic echo signal and the time-frequency graph using a multi-scale feature extraction algorithm, thereby obtaining one-dimensional data features and time-frequency graph features, respectively;
[0129] The feature fusion module 1303 is configured to use a deep multi-mode feature fusion algorithm to fuse the one-dimensional data feature and the time-frequency graph feature to obtain a fusion feature, and then extract a time feature from the fusion feature;
[0130] The detection and classification module 1304 is configured to fuse the one-dimensional data feature, the time-frequency graph feature and the time feature to obtain a final fusion feature, and use the final fusion feature to perform defect detection and classification.
[0131] This system uses the Gaussian filtering method to denoise the collected one-dimensional ultrasonic echo signal, and then performs time-frequency conversion on the denoised one-dimensional ultrasonic echo signal to obtain the corresponding time-frequency diagram; the multi-scale feature extraction algorithm is used to extract features from the denoised one-dimensional ultrasonic echo signal and the time-frequency diagram, respectively, to obtain one-dimensional data features and time-frequency diagram features, respectively; the one-dimensional data features and the time-frequency diagram features are fused using a deep multi-mode feature fusion algorithm to obtain fusion features, and then the time features are extracted from the fusion features; the one-dimensional data features, the time-frequency diagram features and the time features are fused to obtain the final fusion features, and the final fusion features are used for defect detection and classification. The present invention only requires a small amount of training data to detect and classify defects of different categories in industrial scenarios, effectively reducing the misjudgment caused by data imbalance, intra-group differences and similarities between different groups, and has the characteristics of few parameters, high classification accuracy and small training calculation.
[0132] An embodiment of the present invention further relates to a computer-readable storage medium having a computer program stored thereon, which implements the method described above when the computer program is executed by a computer processor. The computer program includes program code for executing the method shown in the flowchart. It should be noted that the computer-readable medium of the present application may be a computer-readable signal medium or a computer-readable medium or any combination of the above two.
[0133] The present invention uses a Gaussian filtering method to denoise the collected one-dimensional ultrasonic echo signal, and then performs time-frequency conversion on the denoised one-dimensional ultrasonic echo signal to obtain a corresponding time-frequency diagram; the multi-scale feature extraction algorithm is used to extract features from the denoised one-dimensional ultrasonic echo signal and the time-frequency diagram, respectively, to obtain one-dimensional data features and time-frequency diagram features; the deep multi-mode feature fusion algorithm is used to fuse the one-dimensional data features and the time-frequency diagram features to obtain fusion features, and then the time features are extracted from the fusion features; the one-dimensional data features, the time-frequency diagram features and the time features are fused to obtain the final fusion features, and the final fusion features are used to detect and classify defects. The present invention only requires a small amount of training data to detect and classify defects of different categories in industrial scenarios, effectively reducing misjudgments caused by data imbalance, intra-group differences and similarities between different groups, and has the characteristics of few parameters, high classification accuracy and small training calculation amount.
[0134] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.
Claims
1. A three-branch attention feature fusion method for ultrasonic defect detection, characterized in that: The following steps are involved: S1: using the Gaussian filtering method to denoise the collected one-dimensional ultrasonic echo signal, and then performing time-frequency conversion on the denoised one-dimensional ultrasonic echo signal to obtain the corresponding time-frequency diagram; S2: extracting multi-scale features at the shape level from the denoised one-dimensional ultrasonic echo signal and the time-frequency graph using a multi-scale feature extraction algorithm, thereby obtaining one-dimensional data features and time-frequency graph features, respectively; S3: Using a deep multi-mode feature fusion algorithm to fuse the one-dimensional data feature and the time-frequency graph feature to obtain a fusion feature, specifically including: Unifying the dimensions of the one-dimensional data feature and the time-frequency graph feature according to the dimensions respectively corresponding to the one-dimensional data feature and the time-frequency graph feature, thereby converting the dimensions of the one-dimensional data feature and the dimensions of the time-frequency graph feature into the same value; The one-dimensional data features and the time-frequency graph features after the dimensions are unified are concatenated in the channel dimension to obtain an input feature matrix; Inputting the input feature matrix into the attention model for learning and classification to obtain an output feature matrix of the attention model; The fusion feature is obtained by strengthening the relative features between the output feature matrix and the input feature matrix; Then, the time feature is extracted from the fusion feature, which specifically includes: S301: after obtaining the fused feature, restoring the fused feature according to the dimensions of the one-dimensional data feature and the time-frequency graph feature, thereby obtaining a new one-dimensional data feature whose dimension is consistent with the one-dimensional data feature, and obtaining a new time-frequency graph feature whose dimension is consistent with the time-frequency graph feature; S302: extracting features from the new one-dimensional data features and the new time-frequency graph features using a multi-scale feature extraction algorithm, and fusing the two features to obtain a fused feature; S303: Repeat the loop execution of S301 to S302, and obtain the final one-dimensional data features and time-frequency graph features after repeated loop execution for several times, and extract the time features of the fusion features obtained after each execution according to their sizes, and then unify the dimensions of the results of each extraction and then accumulate them to obtain the final time features; S4: fusing the one-dimensional data feature, the time-frequency graph feature and the time feature to obtain a final fusion feature, and using the final fusion feature to perform defect detection and classification.
2. The method according to claim 1, characterized in that: The time-frequency conversion specifically includes performing time-frequency conversion on the denoised one-dimensional ultrasonic echo signal using short-time Fourier transform to generate the time-frequency diagram.
3. The method according to claim 1, characterized in that The extracting the time feature from the fused feature specifically includes: extracting the time feature from the fused feature according to the size of the fused feature and using a gated recurrent unit.
4. The method according to claim 1, characterized in that: The S4 specifically includes: The one-dimensional data feature, the time-frequency graph feature and the time feature are fused to obtain a final fused feature, and then the final fused feature is passed through a fully connected layer for defect detection and classification, and a defect classification result is output.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a computer processor, the method according to any one of claims 1 to 4 is implemented.
6. A three-branch attention feature fusion system for detecting ultrasonic defects, characterized in that: include: Signal preprocessing module: configured to denoise the collected one-dimensional ultrasonic echo signal by using Gaussian filtering method, and then perform time-frequency conversion on the denoised one-dimensional ultrasonic echo signal, so as to obtain the corresponding time-frequency diagram; A multi-scale feature extraction module: configured to use a multi-scale feature extraction algorithm to extract multi-scale features at the shape level from the denoised one-dimensional ultrasonic echo signal and the time-frequency graph, thereby obtaining one-dimensional data features and time-frequency graph features, respectively; Feature fusion module: configured to use a deep multi-mode feature fusion algorithm to fuse the one-dimensional data feature and the time-frequency graph feature to obtain a fusion feature, specifically including: Unifying the dimensions of the one-dimensional data feature and the time-frequency graph feature according to the dimensions respectively corresponding to the one-dimensional data feature and the time-frequency graph feature, thereby converting the dimensions of the one-dimensional data feature and the dimensions of the time-frequency graph feature into the same value; The one-dimensional data features and the time-frequency graph features after the dimensions are unified are concatenated in the channel dimension to obtain an input feature matrix; Inputting the input feature matrix into the attention model for learning and classification to obtain an output feature matrix of the attention model; The fusion feature is obtained by strengthening the relative features between the output feature matrix and the input feature matrix; Then, the time feature is extracted from the fusion feature, which specifically includes: S301: after obtaining the fused feature, restoring the fused feature according to the dimensions of the one-dimensional data feature and the time-frequency graph feature, thereby obtaining a new one-dimensional data feature whose dimension is consistent with the one-dimensional data feature, and obtaining a new time-frequency graph feature whose dimension is consistent with the time-frequency graph feature; S302: extracting features from the new one-dimensional data features and the new time-frequency graph features using a multi-scale feature extraction algorithm, and fusing the two features to obtain a fused feature; S303: Repeat the loop execution of S301 to S302, and obtain the final one-dimensional data features and time-frequency graph features after repeated loop execution for several times, and extract the time features of the fusion features obtained after each execution according to their sizes, and then unify the dimensions of the results of each extraction and then accumulate them to obtain the final time features; Detection and classification module: configured to fuse the one-dimensional data features, the time-frequency graph features and the time features to obtain final fusion features, and use the final fusion features to perform defect detection and classification.
