Polyethylene pipeline welding defect phased array image recognition method based on artificial intelligence

Through technologies such as generative adversarial networks and airflow dynamics neural networks based on enhanced rotational invariance, the problem of insufficient model generalization ability and the limitations of the gradient descent method in welding defect identification is solved, achieving efficient welding defect identification and improving identification accuracy. sex and efficiency.

CN118570180AInactive Publication Date: 2024-08-30XINJIANG YIAN SPECIAL INSPECTION ENG CO LTD

Patent Information

Application Number
CN202410742646.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-08-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology has problems in welding defect identification such as insufficient model generalization ability, limitations of the gradient descent method, insufficient feature extraction and low efficiency of high-dimensional data processing, resulting in insufficient recognition accuracy and low efficiency.

Method used

A generative adversarial network based on rotation invariance enhancement is used for data expansion, a neural network algorithm based on airflow dynamics is used for feature extraction, an autoencoder is used for feature dimensionality reduction, and gradient clipping technology is used in the classifier model to form a complete Welding defect identification process.

Benefits of technology

It improves the accuracy, robustness and efficiency of welding defect identification, enhances the generalization ability of the model, avoids the vanishing gradient and local optimal problems, and ensures the accuracy of feature extraction and the speed of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570180A
    Figure CN118570180A
Patent Text Reader

Abstract

The invention discloses a polyethylene pipeline welding defect phased array image recognition method based on artificial intelligence, and the method comprises the steps: S1, generating an original data set through image data collected by employing a phased array ultrasonic detection technology; s2, performing sample generation by adopting a generative adversarial network algorithm based on rotation invariance enhancement so as to realize data expansion; s3, inputting the expanded data into a feature extraction model, and training the feature extraction model to obtain a training data set after feature extraction; s4, inputting the data subjected to feature extraction into a feature dimension reduction model for training of the feature dimension reduction model to obtain a training data set subjected to feature dimension reduction; s5, inputting the data subjected to feature dimension reduction into a classifier model, and training the classifier model; and S6, performing defect phased array image recognition by using the trained feature extraction model, the feature dimension reduction model and the classifier model. And the accuracy of welding defect identification is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a phased array image recognition method for polyethylene pipeline welding defects based on artificial intelligence. Background Art

[0002] During the welding process of the pipeline, various defects may occur, such as holes, lack of fusion, over-welding, etc. If these defects are not accurately identified and handled in a timely manner, they may cause the failure of the pipeline during use and cause safety accidents. Traditional detection methods rely on manual visual inspection or simple automated tools, which are often labor-intensive, inefficient and have limited accuracy, especially in the case of complex or difficult-to-observe welds. With the development of industrial automation and intelligent technology, the use of advanced image processing and machine learning technologies for automatic detection and classification of welding defects has become an inevitable trend in the development of the industry. In particular, deep learning technology, due to its excellent performance in the field of image recognition, has been widely used in the analysis and processing of various complex image data, which can greatly improve the accuracy and efficiency of detection. However, due to the diversity and complexity of welding defects and the difficulty in obtaining a large amount of high-quality data required to train effective models, existing technologies still face some challenges, such as insufficient model generalization ability and limitations of optimization algorithms.

[0003] The existing technology mainly has the following problems: 1. Traditional methods may not be able to effectively generate image data under different perspectives and states, which limits the generalization ability of the model.

[0004] 2. The gradient descent method in the existing technology is prone to fall into the local optimal solution and is sensitive to gradient disappearance or explosion, which affects the efficiency and effect of model training.

[0005] 3. Traditional methods may not fully utilize the key information in the data in terms of feature extraction, resulting in insufficient recognition accuracy.

[0006] 4. The processing efficiency of high-dimensional data is usually low, and existing technologies may lack effective dimensionality reduction strategies, resulting in a waste of computing resources. Summary of the invention

[0007] The purpose of the present invention is to overcome the existing defects and provide a polyethylene pipe welding defect phased array image recognition method based on artificial intelligence, thereby improving the accuracy, robustness and efficiency of welding defect recognition.

[0008] The technical solution to achieve the above purpose is: The artificial intelligence-based phased array image recognition method for polyethylene pipe welding defects includes: Step S1, generating an original data set by using image data collected by phased array ultrasonic detection technology; Step S2, using a generative adversarial network algorithm based on rotation invariance enhancement to generate samples, thereby achieving data expansion; Step S3, inputting the expanded data into the feature extraction model, training the feature extraction model, and obtaining a training data set after feature extraction; Step S4, inputting the feature-extracted data into a feature dimensionality reduction model to train the feature dimensionality reduction model, and obtaining a training data set after feature dimensionality reduction; Step S5, inputting the data after feature dimension reduction into the classifier model to train the classifier model; Step S6, using the trained feature extraction model, feature dimension reduction model and classifier model to perform defect phased array image recognition.

[0009] Preferably, in step S1, the collected image data is stored in a two-dimensional matrix format, and the grayscale value of each pixel ranges from 0 to 255.

[0010] Preferably, in step S2, the training process of the generative adversarial network algorithm based on rotational invariance enhancement is as follows: Initialization settings generator and the discriminator The network parameters, taking the weight parameters as an example, can be initialized as follows: ; In the formula, Indicates The weight of the parameters, is the number of nodes input to the current layer; Extract samples from the original dataset , and apply the rotation transformation to generate a new image sample , and its transformation can be expressed as: ; is a rotation matrix, is the rotation angle, which can be expressed as: ; Generating Images: Generators Receives input random noise vector , and generate images through a feed-forward network , which can be expressed as: ; In the formula, are the parameters of the generator; Discriminator Training: Discriminator For the generated images and the real rotated image Classify and output authenticity score and , which can be expressed as: ; ; In the formula, is the Sigmoid activation function, and The discriminator The weights and biases of Described in pixel level, it can be expressed as: ; ; In the formula, Represents the input image No. feature extraction function, is the total number of feature extraction functions, and It is a discriminator The weights and biases are applied to the Features Generator Training: In the discriminator While distinguishing generated images from real images, the generator The training objective is to deceive the discriminator , so that it misjudges the generated image as a real image, by adjusting the generator Parameters to minimize the difference between the generated image and the real image in the discriminator The degree of differentiation in Update using gradient descent and , which can be expressed as: ; ; In the formula, is the learning rate, set to 0.01, is the loss function, and Represents the generator and the discriminator Gradients of parameters; Using a composite loss function Training, compound loss function Contains adversarial loss and feature enhancement loss, calculated as: ; In the formula, is the feature enhancement loss, is the balance coefficient, set to 0.3, and are the discriminant scores for real and generated images, Indicates the desired action; Feature enhancement loss The calculation method can be expressed as: ; In the formula, Indicates that it is applied to an image and The feature extraction function is is the number of samples in the batch, and denote the generated image and the real image respectively. samples, represents the L2 norm; The above steps are iterated repeatedly until the preset stop iteration condition is met, which means that the training of the generative adversarial network algorithm based on rotation invariance enhancement is completed.

[0011] Preferably, in step S3, a neural network algorithm model based on airflow dynamics is used as a feature extraction model, and the training process of the neural network algorithm model based on airflow dynamics is as follows: Using the parameters of the neural network as particles, initialize the position and velocity of the parameters in the parameter space. Specifically, each parameter in the neural network and its speed In the initial stage, it is randomly generated, and the initialization process can be expressed as: ; ; In the formula, and Indicates the minimum and maximum values ​​of the parameters, and Indicates the minimum and maximum values ​​of the speed, Generate a random number in the interval [0, 1]; Calculate the fitness value for each parameter, the fitness function is the inverse of the error, which is obtained based on the preset logistic regression classifier, that is, the fitness function can be expressed as: ; In the formula, is the error function, which is the cross entropy loss; Error function It is expressed as: ; In the formula, is the sample size, It is The actual labels of samples, The neural network is The prediction of samples depends on the parameters ; Simulate the air pressure difference according to the fitness value, the air pressure difference Determined by fitness, high fitness corresponds to low pressure, and vice versa, so a baseline fitness is set , the pressure difference can be expressed as: ; In the formula, is the adjustment factor, set to 1.5, is the highest fitness value in the population; Update the position and speed of each parameter according to the pressure difference and wind speed, simulating the influence of wind flow on the parameter position. The update of the parameter is affected by the pressure difference and "wind speed", and the new position of the parameter and new speed The calculation method can be expressed as: ; ; In the formula, is the inertia weight, set to 0.9, which controls the influence of the previous speed on the current speed. is the learning factor, set to 2, to control the effect of air pressure differences on speed; The wind speed is dynamically adjusted according to the feedback during the search process to adapt to different regions and characteristics of the parameter space. The wind speed is adjusted by dynamically adjusting the inertia weight. and learning factor To adapt to different stages of the search process, it can be expressed as: ; ; In the formula, is the natural base in mathematics, is the current iteration number, is the maximum number of iterations, and is the adaptive environmental perception adjustment factor, is the environmental perception factor, and are the maximum and minimum values ​​of the inertia weight, which are set to 0.9 and 0.4 respectively. and are the maximum and minimum values ​​of the learning factor, which are set to 2.5 and 0.5 respectively; Environmental perception factor It is calculated based on the rate of change of the objective function in successive iterations to indicate the adjustment range required for the parameter update strategy. For in time Parameters The fitness of the neural network, the environmental perception factor is defined as the relative rate of fitness change between two consecutive iterations, which can be expressed as: ; Therefore, use and The wind speed is adjusted by introducing nonlinear adjustment through exponential decay function to ensure that the adjustment amplitude is significant when the environmental changes are large; By introducing mutations in a random or strategic way, turbulence effects in natural wind are simulated to maintain the diversity of the parameter population and avoid premature convergence. In order to maintain the diversity of the population, turbulence in the wind is simulated by random mutations. Each parameter There is a certain probability Mutation occurs, and the parameter value after mutation It can be expressed as: ; In the formula, is a random number generated from the interval [-1, 1]. is the mutation probability, set to 0.1, is the wind direction variable of the tth iteration; Wind direction variable It is used to simulate the change of wind direction in the real world, thereby increasing the diversity of the search process, which can be expressed as: ; In the formula, is the maximum angle of wind direction change, set to 30 degrees; The above steps are repeated until the preset stop iteration condition is met, which means that the training of the neural network algorithm model based on airflow dynamics is completed.

[0012] Preferably, in step S4, an autoencoder algorithm is used as the feature dimension reduction model, and the training process of the autoencoder algorithm is as follows: The weights of the encoder and decoder are randomly initialized according to the preset distribution, and the weights of the autoencoder and bias Using Gaussian distribution random initialization, it can be expressed as: ; ; In the formula, For the The weight of the layer, For the The bias of the layer, The mean is 0 and the variance is The normal distribution of is the standard deviation, set to 0.1; Through forward propagation, input data The encoder converts it into a low-dimensional feature representation, which is then passed to the decoder to reconstruct the original data. The output of the encoder is and the decoder output The calculation method can be expressed as: ; ; In the formula, is the input data, is the output of the encoder, i.e., the feature representation, is the decoder reconstructed output, and are the weights and biases of the encoder, respectively. and are the weights and biases of the decoder, is the Sigmoid activation function; The total loss is calculated using the mean square error based on L2 regularization to avoid overfitting and ensure that the model can learn effective data compression. The loss function The calculation method is expressed as: ; In the formula, is the reconstruction error, calculated using the Euclidean distance, is the regularization parameter, and is the L2 regularization term of the weight; Reconstruction error term The calculation method can be expressed as: ; In the formula, is the input data vector No. elements, is the reconstructed data vector No. elements, is the number of elements in the data vector; Regularization term and Expressed as the sum of squares of all encoder and decoder weights respectively, it can be expressed as: ; ; In the formula, is the encoder weight matrix Middle Line The elements of the column, is the decoder weight matrix Middle Line Elements of a column; In the process of back propagation, the network weights are updated through the gradient descent algorithm according to the loss function, which can be expressed as: ; ; In the formula, is the learning rate, which is set in an adaptive adjustment manner. The initial learning rate is set to 0.01. and They are the gradients of the loss function with respect to the encoder and decoder weights, respectively; The learning rate is adaptively adjusted according to the training progress, and the exponential decay strategy is used to optimize the learning process. The calculation method can be expressed as: ; In the formula, is the base of natural logarithms, is the decay rate, is the number of iterations; Decay rate is the rate of change related to time, and the calculation method can be expressed as: ; In the formula, is the initial learning rate, set to 0.01, Is to reach the specified learning rate The number of iterations required; Repeat the above steps until the preset stop iteration condition is met, which means that the feature dimensionality reduction model training is completed.

[0013] Preferably, in step S5, a neural network model based on gradient clipping is used as the classifier model, and the training process of the neural network model based on gradient clipping is as follows: Initialize the neural network classification model parameters by random initialization; The feature vector after input feature dimensionality reduction To the network, through 2 convolutional layers, 2 ReLU activation layers, 1 pooling layer and 1 fully connected layer, and finally through the Softmax layer to get the classification result , which can be expressed as: ; In the formula, is the predicted value output by the model, is the Sigmoid activation function, and are weight and bias parameters respectively, is the first feature vector of the input elements, is the dimension of the feature vector; The loss function is used to calculate the error between the model output and the true label. The calculation method is: ; In the formula, is the loss function, For Category The importance weight of is the first category labels, is the first outputs, is the total number of categories; The calculation method can be expressed as: ; In the formula, Indicates category Frequency of occurrence in the training data; The gradient of the loss function with respect to each parameter is calculated by back propagation. The gradient calculation method can be expressed as: ; In the formula, is the loss function About weight The gradient of is the sample size, , Respectively The predicted value and true value of samples, For the The sample Features The calculated gradient is clipped to limit the maximum value of the gradient to prevent gradient explosion during training. The gradient clipping method can be expressed as: ; In the formula, For the The gradient of the parameters, is the gradient clipping threshold; The network parameters are updated using the clipped gradients and the Adam optimizer is used for parameter update, which can be expressed as: ; In the formula, is the updated weight, is the learning rate, Represents the gradient update value calculated using the Adam algorithm; Repeat the above steps until the preset stop iteration condition is met, which means the classifier model training is completed.

[0014] Preferably, in the steps S2-S5, the preset conditions for stopping iteration are all that a preset maximum number of iterations is reached, and the preset maximum number of iterations is set to 1000 times.

[0015] Preferably, in step S6, key welding defect features are extracted through a trained feature extraction model; the extracted features are subjected to dimensionality reduction processing through a trained feature dimensionality reduction model; and the reduced dimensionality features are input into a classifier model to identify welding defect categories.

[0016] Preferably, in step S6, the welding defect categories include: fusion surface inclusions, holes, lack of fusion, resistance wire misalignment, cold welding and over-welding, a total of 6 categories.

[0017] The beneficial effects of the present invention are: The present invention adopts rotation invariance to generate adversarial networks to enhance the effect of data expansion, can generate multi-angle image data, and improve the generalization ability of the model; The present invention adopts the formation mechanism of wind in nature as a strategy for parameter optimization, does not rely on gradient information, and updates parameters by simulating air pressure differences and wind speed, thereby solving the gradient vanishing or local optimal problems that may be encountered in the traditional gradient descent method, and improving the search efficiency and global convergence ability. The present invention combines adversarial loss and feature enhancement loss to optimize the model in a targeted manner to enhance the learning of key features, so that the model is more accurate in maintaining the key features of the data and improves the accuracy of classification. The present invention adopts an autoencoder to perform feature compression to reduce the dimension of input data, and uses L2 regularization to prevent overfitting, thereby ensuring that important information of the data is not lost during the feature dimensionality reduction process, thereby improving the efficiency of data processing and the running speed of the model; The present invention adopts gradient clipping technology to control the maximum threshold of gradient during the neural network training process, prevents gradient explosion, ensures the stability of the training process, and avoids the degradation of model performance caused by unstable training.

[0018] The present invention improves the accuracy, robustness and efficiency of welding defect recognition by adopting a generative adversarial network with enhanced rotational invariance, a neural network algorithm model based on airflow dynamics, a composite loss function, an autoencoder for feature dimensionality reduction, and a neural network model based on gradient clipping. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a flow chart of the phased array image recognition method for polyethylene pipeline welding defects based on artificial intelligence of the present invention; Figure 2 It is a simulation schematic diagram of feature dimensionality reduction performed by the autoencoder algorithm in the present invention. DETAILED DESCRIPTION

[0020] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. In the description of the present invention, it should be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside" and the like indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.

[0021] The present invention will be further described below in conjunction with the accompanying drawings.

[0022] like Figure 1 As shown, the polyethylene pipe welding defect phased array image recognition method based on artificial intelligence includes: Step S1, generating an original data set by acquiring image data using phased array ultrasonic detection technology.

[0023] In an embodiment, the collected image data is stored in a two-dimensional matrix format, and the grayscale value of each pixel ranges from 0 to 255.

[0024] In the embodiment, the marked categories include: fusion surface inclusions, holes, lack of fusion, resistance wire misalignment, cold welding and over-welding, a total of 6 categories.

[0025] In step S2, a generative adversarial network algorithm based on rotational invariance enhancement is used to generate samples, thereby achieving data expansion.

[0026] In the embodiment, the collection, acquisition, annotation and preprocessing of training data are time-consuming and labor-intensive, and insufficient training samples easily lead to poor generalization ability of the model, while affecting the accuracy of the model; the present invention adopts a generative adversarial network based on rotational invariance enhancement to generate samples, thereby realizing data expansion, and the generative adversarial network based on rotational invariance enhancement includes two components: a generator (G) and a discriminator (D), the generator (G) is responsible for creating visually realistic image data, and the discriminator (D) is tasked with distinguishing the generated image from the real image; the generator (G) receives a random noise signal as input and converts it into image data through a series of convolutional network layers; the discriminator (D) evaluates the authenticity of the image; the present invention integrates a rotational invariance network layer in the generator (G) and the discriminator (D), so that the model can generate and recognize images at different rotation angles, thereby enhancing the applicability and robustness of the model to welding defect images in practical applications.

[0027] Specifically, the training process of the generative adversarial network algorithm based on rotation invariance enhancement is as follows: Initialization settings generator and the discriminator The network parameters, taking the weight parameters as an example, can be initialized as follows: ; In the formula, Indicates The weight of the parameters, is the number of nodes input to the current layer; Extract samples from the original dataset , and apply the rotation transformation to generate a new image sample , and its transformation can be expressed as: ; is a rotation matrix, is the rotation angle, which can be expressed as: ; Generating Images: Generators Receives input random noise vector , and generate images through a feed-forward network , which can be expressed as: ; In the formula, are the parameters of the generator; Discriminator Training: Discriminator For the generated images and the real rotated image Classify and output authenticity score and , which can be expressed as: ; ; In the formula, is the Sigmoid activation function, and The discriminator The weights and biases of Described in pixel level, it can be expressed as: ; ; In the formula, Represents the input image No. feature extraction function, is the total number of feature extraction functions, and It is a discriminator The weights and biases are applied to the Features Generator Training: In the discriminator While distinguishing generated images from real images, the generator The training objective is to deceive the discriminator , so that it misjudges the generated image as a real image, by adjusting the generator Parameters to minimize the difference between the generated image and the real image in the discriminator The degree of differentiation in Update using gradient descent and , which can be expressed as: ; ; In the formula, The learning rate is set to 0.01. is the loss function, and Represents the generator and the discriminator Gradients of parameters; Using a composite loss function Training, compound loss function Contains adversarial loss and feature enhancement loss, calculated as: ; In the formula, is the feature enhancement loss, is the balance coefficient, set to 0.3, and are the discriminant scores for real and generated images, Indicates the desired action; Feature enhancement loss The calculation method can be expressed as: ; In the formula, Indicates that it is applied to an image and The feature extraction function is is the number of samples in the batch, and denote the generated image and the real image respectively. samples, represents the L2 norm; The above steps are repeated until the preset stop iteration condition is met, which means that the training of the generative adversarial network algorithm based on rotational invariance enhancement is completed. The preset stop iteration condition is to reach the preset maximum number of iterations, and the preset maximum number of iterations is set to 1000 times.

[0028] Step S3, inputting the expanded data into the feature extraction model, training the feature extraction model, and obtaining a training data set after feature extraction.

[0029] In the embodiments, some schemes use neural networks for feature extraction. In some neural network structures, problems such as gradient vanishing, gradient exploding, or falling into local optimal solutions may be encountered, affecting the stability of training and the performance of the model. The present invention proposes a neural network algorithm model based on airflow dynamics, which is inspired by the formation mechanism of wind in nature and its impact on the environment. Wind is generated by air flow, and its direction and intensity are determined by air pressure differences, terrain and other natural factors. Wind can carry energy, transmit information, and cause the circulation and renewal of matter in the ecosystem. Traditional optimization methods based on gradient descent may encounter difficulties in complex parameter spaces, such as gradient vanishing, local minimum, etc. The neural network algorithm model based on airflow dynamics proposed in the present invention updates parameters by simulating wind flow and air pressure differences, does not rely on gradient information, and is therefore able to search in a wider parameter space, improving the ability to avoid local optimality and accelerate convergence.

[0030] Specifically, the neural network algorithm model based on airflow dynamics is used as the feature extraction model. Then, the training process of the neural network algorithm model based on airflow dynamics is as follows: Using the parameters of the neural network as particles, initialize the position and velocity of the parameters in the parameter space. Specifically, each parameter in the neural network and its speed In the initial stage, it is randomly generated, and the initialization process can be expressed as: ; ; In the formula, and Indicates the minimum and maximum values ​​of the parameters, and Indicates the minimum and maximum values ​​of the speed, Generate a random number in the interval [0, 1]; Calculate the fitness value for each parameter, the fitness function is the inverse of the error, which is obtained based on the preset logistic regression classifier, that is, the fitness function can be expressed as: ; In the formula, is the error function, which is the cross entropy loss; Error function It is expressed as: ; In the formula, is the sample size, It is The actual labels of samples, The neural network is The prediction of samples depends on the parameters ; Simulate the air pressure difference according to the fitness value, the air pressure difference Determined by fitness, high fitness corresponds to low pressure, and vice versa, so a baseline fitness is set , the pressure difference can be expressed as: ; In the formula, is the adjustment factor, set to 1.5, is the highest fitness value in the population; Update the position and speed of each parameter according to the pressure difference and wind speed, simulating the influence of wind flow on the parameter position. The update of the parameter is affected by the pressure difference and "wind speed", and the new position of the parameter and new speed The calculation method can be expressed as: ; ; In the formula, is the inertia weight, set to 0.9, which controls the influence of the previous speed on the current speed. is the learning factor, set to 2, to control the effect of air pressure differences on speed; The wind speed is dynamically adjusted according to the feedback during the search process to adapt to different regions and characteristics of the parameter space. The wind speed is adjusted by dynamically adjusting the inertia weight. and learning factor To adapt to different stages of the search process, it can be expressed as: ; ; In the formula, is the natural base in mathematics, is the current iteration number, is the maximum number of iterations, and is the adaptive environmental perception adjustment factor, is the environmental perception factor, and are the maximum and minimum values ​​of the inertia weight, which are set to 0.9 and 0.4 respectively. and are the maximum and minimum values ​​of the learning factor, which are set to 2.5 and 0.5 respectively; Environmental perception factor It is calculated based on the rate of change of the objective function in successive iterations to indicate the adjustment range required for the parameter update strategy. For in time Parameters The fitness of the neural network, the environmental perception factor is defined as the relative rate of fitness change between two consecutive iterations, which can be expressed as: ; Therefore, use and The wind speed is adjusted by introducing nonlinear adjustment through exponential decay function to ensure that the adjustment amplitude is significant when the environmental changes are large; By introducing mutations in a random or strategic way, turbulence effects in natural wind are simulated to maintain the diversity of the parameter population and avoid premature convergence. In order to maintain the diversity of the population, turbulence in the wind is simulated by random mutations. Each parameter There is a certain probability Mutation occurs, and the parameter value after mutation It can be expressed as: ; In the formula, is a random number generated from the interval [-1, 1]. is the mutation probability, set to 0.1, is the wind direction variable of the tth iteration; Wind direction variable It is used to simulate the change of wind direction in the real world, thereby increasing the diversity of the search process, which can be expressed as: ; In the formula, is the maximum angle of wind direction change, set to 30 degrees; The above steps are repeated until the preset stop iteration condition is met, which means that the training of the neural network algorithm model based on airflow dynamics is completed. The preset stop iteration condition is to reach the preset maximum number of iterations, and the preset maximum number of iterations is set to 1000 times.

[0031] Step S4, inputting the feature-extracted data into a feature dimensionality reduction model to train the feature dimensionality reduction model, and obtaining a training data set after feature dimensionality reduction.

[0032] In the embodiment, the data after feature extraction is input into the feature dimensionality reduction model to train the feature dimensionality reduction model. The present invention adopts an autoencoder algorithm to perform feature dimensionality reduction. The autoencoder algorithm includes two parts: an encoder and a decoder. The encoder is responsible for converting high-dimensional feature data into low-dimensional feature representations, and the decoder attempts to reconstruct the original data from these low-dimensional representations. The present invention uses a mean square error based on L2 regularization to calculate the total loss to avoid overfitting and ensure that the model can learn effective data compression. The simulation schematic diagram of the autoencoder algorithm for feature dimensionality reduction is shown in FIG. Figure 2 shown.

[0033] Specifically, the autoencoder algorithm is used as the feature dimension reduction model, and the training process of the autoencoder algorithm is as follows: The weights of the encoder and decoder are randomly initialized according to the preset distribution, and the weights of the autoencoder and bias Using Gaussian distribution random initialization, it can be expressed as: ; ; In the formula, For the The weight of the layer, For the The bias of the layer, The mean is 0 and the variance is The normal distribution of is the standard deviation, set to 0.1; Through forward propagation, input data The encoder converts it into a low-dimensional feature representation, which is then passed to the decoder to reconstruct the original data. The output of the encoder is and the decoder output The calculation method can be expressed as: ; ; In the formula, is the input data, is the output of the encoder, i.e., the feature representation, is the decoder reconstructed output, and are the weights and biases of the encoder, respectively. and are the weights and biases of the decoder, is the Sigmoid activation function; The total loss is calculated using the mean square error based on L2 regularization to avoid overfitting and ensure that the model can learn effective data compression. The loss function The calculation method is expressed as: ; In the formula, is the reconstruction error, calculated using the Euclidean distance, is the regularization parameter, and is the L2 regularization term of the weight; Reconstruction error term The calculation method can be expressed as: ; In the formula, is the input data vector No. elements, is the reconstructed data vector No. elements, is the number of elements in the data vector; Regularization term and Expressed as the sum of squares of all encoder and decoder weights respectively, it can be expressed as: ; ; In the formula, is the encoder weight matrix Middle Line The elements of the column, is the decoder weight matrix Middle Line Elements of a column; In the process of back propagation, the network weights are updated through the gradient descent algorithm according to the loss function, which can be expressed as: ; ; In the formula, is the learning rate, which is set in an adaptive adjustment manner. The initial learning rate is set to 0.01. and They are the gradients of the loss function with respect to the encoder and decoder weights, respectively; The learning rate is adaptively adjusted according to the training progress, and the exponential decay strategy is used to optimize the learning process. The calculation method can be expressed as: ; In the formula, is the base of natural logarithms, is the decay rate, is the number of iterations; Decay rate is the rate of change related to time, and the calculation method can be expressed as: ; In the formula, is the initial learning rate, set to 0.01, Is to reach the specified learning rate The number of iterations required; Repeat the above steps until the preset stop iteration condition is met, which means that the feature dimensionality reduction model training is completed. The preset stop iteration condition is to reach the preset maximum number of iterations, and the preset maximum number of iterations is set to 1000 times.

[0034] Step S5, inputting the data after feature dimension reduction into the classifier model to train the classifier model.

[0035] In the embodiment, the reduced-dimensional data is input into a classifier model to train the classifier. The present invention adopts a neural network model based on gradient clipping as a classifier. The neural network model based on gradient clipping includes 2 convolutional layers, 2 ReLU activation layers, 1 pooling layer and 1 fully connected layer, and finally outputs the classification result of the welding defect through a softmax layer. In view of the gradient explosion problem that may occur in traditional deep learning models when processing welding defect images, the present invention adopts gradient clipping technology in the training process of the neural network to effectively control the maximum threshold of the gradient and avoid the problem of training instability caused by excessive gradient during back propagation.

[0036] Specifically, a neural network model based on gradient clipping is used as the classifier model. Then, the training process of the neural network model based on gradient clipping is as follows: Initialize the neural network classification model parameters by random initialization; The feature vector after input feature dimensionality reduction To the network, through 2 convolutional layers, 2 ReLU activation layers, 1 pooling layer and 1 fully connected layer, and finally through the Softmax layer to get the classification result , which can be expressed as: ; In the formula, is the predicted value output by the model, is the Sigmoid activation function, and are weight and bias parameters respectively, is the first feature vector of the input elements, is the dimension of the feature vector; The loss function is used to calculate the error between the model output and the true label. The calculation method is: ; In the formula, is the loss function, For Category The importance weight of is the first category labels, is the first outputs, is the total number of categories; The calculation method can be expressed as: ; In the formula, Indicates category Frequency of occurrence in the training data; The gradient of the loss function with respect to each parameter is calculated by back propagation. The gradient calculation method can be expressed as: ; In the formula, is the loss function About weight The gradient of is the sample size, , Respectively The predicted value and true value of samples, For the The sample Features The calculated gradient is clipped to limit the maximum value of the gradient to prevent gradient explosion during training. The gradient clipping method can be expressed as: ; In the formula, For the The gradient of the parameters, is the gradient clipping threshold; The network parameters are updated using the clipped gradients and the Adam optimizer is used for parameter update, which can be expressed as: ; In the formula, is the updated weight, is the learning rate, Represents the gradient update value calculated using the Adam algorithm; Repeat the above steps until the preset stop iteration condition is met, which means that the classifier model training is completed. The preset stop iteration condition is to reach the preset maximum number of iterations, and the preset maximum number of iterations is set to 1000 times.

[0037] Step S6, using the trained feature extraction model, feature dimension reduction model and classifier model to perform defect phased array image recognition.

[0038] In the embodiment, key welding defect features are extracted through a trained feature extraction model; the extracted features are subjected to dimensionality reduction processing through a trained feature dimensionality reduction model; the reduced dimensionality features are input into a classifier model to identify welding defect categories.

[0039] In the embodiment, the welding defect categories include: fusion surface inclusions, holes, lack of fusion, resistance wire misalignment, cold welding and over-welding, a total of 6 categories.

[0040] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments may still be modified, or some or all of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A phased array image recognition method for polyethylene pipe welding defects based on artificial intelligence, characterized in that: include: Step S1, generating an original data set by using image data collected by phased array ultrasonic detection technology; Step S2, using a generative adversarial network algorithm based on rotational invariance enhancement to generate samples, thereby achieving data expansion; Step S3, inputting the expanded data into the feature extraction model, training the feature extraction model, and obtaining a training data set after feature extraction; Step S4, inputting the feature-extracted data into a feature dimension reduction model to train the feature dimension reduction model, and obtaining a training data set after feature dimension reduction; Step S5, inputting the data after feature dimension reduction into the classifier model to train the classifier model; Step S6, using the trained feature extraction model, feature dimension reduction model and classifier model to perform defect phased array image recognition.

2. The artificial intelligence-based phased array image recognition method for polyethylene pipeline welding defects according to claim 1 is characterized in that: In step S1, the collected image data is stored in a two-dimensional matrix format, and the grayscale value of each pixel ranges from 0 to 255.

3. The artificial intelligence-based phased array image recognition method for polyethylene pipe welding defects according to claim 1 is characterized in that: In step S2, the training process of the generative adversarial network algorithm based on rotation invariance enhancement is as follows: Initialization settings generator and the discriminator The network parameters, taking the weight parameters as an example, can be initialized as follows: ; In the formula, Indicates The weight of the parameters, is the number of nodes input to the current layer; Extract samples from the original dataset , and apply the rotation transformation to generate a new image sample , and its transformation can be expressed as: ; is a rotation matrix, is the rotation angle, which can be expressed as: ; Generating Images: Generators Receives input random noise vector , and generate images through a feed-forward network , which can be expressed as: ; In the formula, are the parameters of the generator; Discriminator Training: Discriminator For the generated images and the real rotated image Classify and output authenticity score and , which can be expressed as: ; ; In the formula, is the Sigmoid activation function, and The discriminator The weights and biases of Described in pixel level, it can be expressed as: ; ; In the formula, Represents the input image No. feature extraction function, is the total number of feature extraction functions, and It is a discriminator The weights and biases are applied to the Features Generator Training: In the discriminator While distinguishing generated images from real images, the generator The training objective is to deceive the discriminator , so that it misjudges the generated image as a real image, by adjusting the generator Parameters to minimize the difference between the generated image and the real image in the discriminator The degree of differentiation in Update using gradient descent and , which can be expressed as: ; ; In the formula, is the learning rate, set to 0.01, is the loss function, and Represents the generator and the discriminator Gradients of parameters; Using a composite loss function Training, compound loss function Contains adversarial loss and feature enhancement loss, calculated as: ; In the formula, is the feature enhancement loss, is the balance coefficient, set to 0.3, and are the discriminant scores for real and generated images, Indicates the desired action; Feature enhancement loss The calculation method can be expressed as: ; In the formula, Indicates that it is applied to an image and The feature extraction function is is the number of samples in the batch, and denote the generated image and the real image respectively. samples, represents the L2 norm; The above steps are iterated repeatedly until the preset stop iteration condition is met, which means that the training of the generative adversarial network algorithm based on rotation invariance enhancement is completed.

4. The artificial intelligence-based phased array image recognition method for polyethylene pipe welding defects according to claim 3 is characterized in that: In step S3, a neural network algorithm model based on airflow dynamics is used as a feature extraction model. Then, the training process of the neural network algorithm model based on airflow dynamics is as follows: Using the parameters of the neural network as particles, initialize the position and velocity of the parameters in the parameter space. Specifically, each parameter in the neural network and its speed In the initial stage, it is randomly generated, and the initialization process can be expressed as: ; ; In the formula, and Indicates the minimum and maximum values ​​of the parameters, and Indicates the minimum and maximum values ​​of the speed, Generate a random number in the interval [0, 1]; Calculate the fitness value for each parameter, the fitness function is the inverse of the error, which is obtained based on the preset logistic regression classifier, that is, the fitness function can be expressed as: ; In the formula, is the error function, which is the cross entropy loss; Error function It is expressed as: ; In the formula, is the sample size, It is The actual labels of samples, The neural network is The prediction of samples depends on the parameters ; Simulate the air pressure difference according to the fitness value, the air pressure difference Determined by fitness, high fitness corresponds to low pressure, and vice versa, so a baseline fitness is set , the pressure difference can be expressed as: ; In the formula, is the adjustment factor, set to 1.5, is the highest fitness value in the population; Update the position and speed of each parameter according to the pressure difference and wind speed, simulating the influence of wind flow on the parameter position. The update of the parameter is affected by the pressure difference and "wind speed", and the new position of the parameter and new speed The calculation method can be expressed as: ; ; In the formula, is the inertia weight, set to 0.9, which controls the influence of the previous speed on the current speed. is the learning factor, set to 2, to control the effect of air pressure differences on speed; The wind speed is dynamically adjusted according to the feedback during the search process to adapt to different regions and characteristics of the parameter space. The wind speed is adjusted by dynamically adjusting the inertia weight. and learning factor To adapt to different stages of the search process, it can be expressed as: ; ; In the formula, is the natural base in mathematics, is the current iteration number, is the maximum number of iterations, and is the adaptive environmental perception adjustment factor, is the environmental perception factor, and are the maximum and minimum values ​​of the inertia weight, which are set to 0.9 and 0.4 respectively. and are the maximum and minimum values ​​of the learning factor, which are set to 2.5 and 0.5 respectively; Environmental perception factor It is calculated based on the rate of change of the objective function in successive iterations to indicate the adjustment range required for the parameter update strategy. For in time Parameters The fitness of the neural network, the environmental perception factor is defined as the relative rate of fitness change between two consecutive iterations, which can be expressed as: ; Therefore, use and The wind speed is adjusted by introducing nonlinear adjustment through exponential decay function to ensure that the adjustment amplitude is significant when the environmental changes are large; By introducing mutations in a random or strategic way, turbulence effects in natural wind are simulated to maintain the diversity of the parameter population and avoid premature convergence. In order to maintain the diversity of the population, turbulence in the wind is simulated by random mutations. Each parameter There is a certain probability Mutation occurs, and the parameter value after mutation It can be expressed as: ; In the formula, is a random number generated from the interval [-1, 1]. is the mutation probability, set to 0.1, is the wind direction variable of the tth iteration; Wind direction variable It is used to simulate the change of wind direction in the real world, thereby increasing the diversity of the search process, which can be expressed as: ; In the formula, is the maximum angle of wind direction change, set to 30 degrees; The above steps are repeated until the preset stop iteration condition is met, which means that the training of the neural network algorithm model based on airflow dynamics is completed.

5. The artificial intelligence-based phased array image recognition method for polyethylene pipeline welding defects according to claim 4 is characterized in that: In step S4, the autoencoder algorithm is used as the feature dimension reduction model, and the training process of the autoencoder algorithm is as follows: The weights of the encoder and decoder are randomly initialized according to the preset distribution, and the weights of the autoencoder and bias Using Gaussian distribution random initialization, it can be expressed as: ; ; In the formula, For the The weight of the layer, For the The bias of the layer, The mean is 0 and the variance is The normal distribution of is the standard deviation, set to 0.1; Through forward propagation, input data The encoder converts it into a low-dimensional feature representation, which is then passed to the decoder to reconstruct the original data. The output of the encoder is and the decoder output The calculation method can be expressed as: ; ; In the formula, is the input data, is the output of the encoder, i.e., the feature representation, is the decoder reconstructed output, and are the weights and biases of the encoder, respectively. and are the weight and bias of the decoder, is the Sigmoid activation function; The total loss is calculated using the mean square error based on L2 regularization to avoid overfitting and ensure that the model can learn effective data compression. The loss function The calculation method is expressed as: ; In the formula, is the reconstruction error, calculated using the Euclidean distance, is the regularization parameter, and is the L2 regularization term of the weight; Reconstruction error term The calculation method can be expressed as: ; In the formula, is the input data vector No. elements, is the reconstructed data vector No. elements, is the number of elements in the data vector; Regularization term and Expressed as the sum of squares of all encoder and decoder weights respectively, it can be expressed as: ; ; In the formula, is the encoder weight matrix Middle Line The elements of the column, is the decoder weight matrix Middle Line Elements of a column; In the process of back propagation, the network weights are updated through the gradient descent algorithm according to the loss function, which can be expressed as: ; ; In the formula, is the learning rate, which is set in an adaptive adjustment manner. The initial learning rate is set to 0.

01. and They are the gradients of the loss function with respect to the encoder and decoder weights, respectively; The learning rate is adaptively adjusted according to the training progress, and the exponential decay strategy is used to optimize the learning process. The calculation method can be expressed as: ; In the formula, is the base of natural logarithms, is the decay rate, is the number of iterations; Decay rate is the rate of change related to time, and the calculation method can be expressed as: ; In the formula, is the initial learning rate, set to 0.01, Is to reach the specified learning rate The number of iterations required; Repeat the above steps until the preset stop iteration condition is met, which means that the feature dimensionality reduction model training is completed.

6. The artificial intelligence-based phased array image recognition method for polyethylene pipeline welding defects according to claim 5 is characterized in that: In step S5, a neural network model based on gradient clipping is used as a classifier model. Then, the training process of the neural network model based on gradient clipping is as follows: Initialize the neural network classification model parameters by random initialization; The feature vector after input feature dimensionality reduction To the network, through 2 convolutional layers, 2 ReLU activation layers, 1 pooling layer and 1 fully connected layer, and finally through the Softmax layer to get the classification result , which can be expressed as: ; In the formula, is the predicted value output by the model, is the Sigmoid activation function, and are weight and bias parameters respectively, is the first feature vector of the input elements, is the dimension of the feature vector; The loss function is used to calculate the error between the model output and the true label. The calculation method is: ; In the formula, is the loss function, For Category The importance weight of is the first category labels, is the first outputs, is the total number of categories; The calculation method can be expressed as: ; In the formula, Indicates category Frequency of occurrence in the training data; The gradient of the loss function with respect to each parameter is calculated by back propagation. The gradient calculation method can be expressed as: ; In the formula, is the loss function About weight The gradient of is the sample size, , Respectively The predicted value and true value of samples, For the The sample Features The calculated gradient is clipped to limit the maximum value of the gradient to prevent gradient explosion during training. The gradient clipping method can be expressed as: ; In the formula, For the The gradient of the parameters, is the gradient clipping threshold; The network parameters are updated using the clipped gradients and the Adam optimizer is used for parameter update, which can be expressed as: ; In the formula, is the updated weight, is the learning rate, Represents the gradient update value calculated using the Adam algorithm; Repeat the above steps until the preset stop iteration condition is met, which means the classifier model training is completed.

7. The artificial intelligence-based phased array image recognition method for polyethylene pipeline welding defects according to claim 6 is characterized in that: In the steps S2-S5, the preset conditions for stopping iteration are all that a preset maximum number of iterations is reached, and the preset maximum number of iterations is set to 1000 times.

8. The artificial intelligence-based phased array image recognition method for polyethylene pipeline welding defects according to claim 7 is characterized in that: In step S6, key welding defect features are extracted through the trained feature extraction model; the extracted features are reduced in dimension through the trained feature dimension reduction model; the reduced features are input into the classifier model to identify the welding defect category.

9. The artificial intelligence-based phased array image recognition method for polyethylene pipeline welding defects according to claim 8 is characterized in that: In step S6, the welding defect categories include: fusion surface inclusions, holes, lack of fusion, resistance wire misalignment, cold welding and over-welding, a total of 6 categories.

Citation Information

Patent Citations

  • Pressure pipeline electromagnetic ultrasonic detection method based on artificial intelligence

    CN118129088A

  • Internet of Things risk intrusion identification method based on artificial intelligence

    CN118133146A

  • Power plant carbon emission accounting method and device based on big data and server

    CN118134058A

  • Insulator quality detection method

    CN118154997A

  • Data augmentation method based on high-dimensional spatial sampling

    WO2020168796A1

Cited By

  • 3D face feature processing and recognition method based on machine learning

    CN118823858A

  • Security radar false alarm management method and system based on traction learning

    CN119199843A