Desoldering detection method based on photovoltaic module image acquired by unmanned aerial vehicle
The problem of insufficient samples and limited model generalization ability in photovoltaic module desoldering detection is solved by collecting photovoltaic module images by drones and using the combination of potential information diffusion to generate adversarial networks, heterogeneous bee colony algorithm and kernel density estimation support vector machine. , achieving high accuracy and real-time detection results.
Patent Information
- Application Number
- CN202411150728.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-08-21
AI Technical Summary
Existing photovoltaic module desoldering detection technology faces problems such as insufficient sample number, long training time, high computing resources, and limited model generalization capabilities, resulting in insufficient detection accuracy and real-time performance.
A data expansion and optimization method based on UAV-collected photovoltaic module images is adopted, data expansion is performed through potential information diffusion to generate an adversarial network, a heterogeneous bee colony algorithm is used to optimize neural network feature extraction, and a combined compressed sensing autoencoder and kernel density are used Estimated support vector machines perform feature dimensionality reduction and classification, and dynamically adjust the learning rate to improve model performance.
It improves the accuracy and reliability of desoldering detection, reduces the false alarm rate and false negative rate, and enhances the real-time nature of detection, making it suitable for timely discovery and treatment of desoldering problems in actual production.
Smart Images

Figure QLYQS_184 
Figure QLYQS_49 
Figure QLYQS_210
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data processing methods, and in particular relates to a desoldering detection method based on collecting photovoltaic component images by using an unmanned aerial vehicle. Background Art
[0002] Photovoltaic modules are the core components of solar power generation systems, and their quality directly affects the performance and reliability of solar power generation systems. In the manufacturing process of photovoltaic modules, welding is an important process step, which is responsible for welding photovoltaic cells, connecting wires between cells and other components into modules. The quality of welding directly affects the performance and life of the module.
[0003] However, during the operation and use of photovoltaic modules, solder joints may become desoldered, that is, the connection between the solder joint and the cell or connecting wire becomes loose or broken. Desoldering of solder joints can lead to poor or disconnected current transmission, affecting the power generation efficiency of the module, and may even cause damage to the module and failure of the solar power generation system. Therefore, timely detection and repair of solder joint desoldering problems are crucial to ensure the stable operation of solar power generation systems.
[0004] In response to the above problems, the Chinese invention patent with application number CN202211343209.9 proposes a method for identifying defects in welding radiographic films, including: obtaining images of historical welding radiographic films, and marking the defect features of the historical film images to obtain a first defect feature, and then inputting the historical film images into a preset defect recognition model to obtain a second defect feature, wherein the defect recognition model is trained based on a preset machine learning model; comparing and analyzing the first defect feature and the second defect feature, and adjusting the defect recognition model according to the analysis results; using the adjusted defect recognition model to analyze the defect features of the welding radiographic film to be identified. The present invention realizes the effective identification of defects in digital welding radiographic films, solves the storage problem of large-capacity digital films, and improves the reading efficiency of digital film files. The Chinese invention patent with application number CN202410215133.4 proposes a method for identifying and classifying weld defects based on machine vision. The invention obtains the welding video data of the current workpiece by collecting it, and uses the welding defect recognition model to identify and judge it. Based on the situation that the defect recognition signal contained in the judgment result is "1", according to the analysis of the pre- and post-retrospective time of the weld defects corresponding to each specification of the workpiece, the current workpiece is traced as the base point, and the cleaning reference video data is intercepted from its welding video data, and input into the cleaning strategy generation model to obtain the cleaning strategy corresponding to the current workpiece. In this way, the excessive unnecessary video data in the welding video data of the workpiece is reduced, so that the data input into the cleaning strategy generation model is greatly reduced, and the efficiency of the cleaning strategy generation model recognition is improved. In addition, the necessary video data is retained during the reduction process, the quality of model recognition is guaranteed, and the use of the cleaning strategy generation model is more intelligent. The Chinese invention patent with application number CN202110992821.8 proposes a method, device and storage medium for identifying chip welding defects by image. The method comprises the following steps: acquiring a target image, wherein the target image comprises a welding area after chip pin welding is completed; inputting the target image into a neural network algorithm; determining the shape and / or position of a defective area in the target image based on the neural network algorithm; determining the defect category based on the shape and / or position of the defective area; the neural network algorithm comprises a computer vision algorithm, a target detection algorithm and a semantic segmentation algorithm combined with an expert knowledge base; the computer vision algorithm is used to determine the shape and / or position of a defective area where the pin is skewed, the semantic segmentation algorithm combined with the expert knowledge base is used to determine the shape and / or position of a defective area with a low occurrence frequency, and the target detection algorithm is used to determine the shape and / or position of a defective area where the extension area is too short.
[0005] The above technical solutions are innovative, but the following problems still need to be further resolved: 1. In practical applications, it may be difficult to obtain a large number of high-quality training samples, especially for specific scenarios or problems. Insufficient number of samples may affect the generalization ability and detection effect of the model. 2. Some optimization methods may require a long training time and a large amount of computing resources, especially for complex neural network structures and large-scale data sets, the training cost is high. 3. In some cases, the optimized model may be too sensitive to specific scenarios or data distributions, resulting in limited generalization ability of the model and unsuitable for a wider range of application scenarios. Summary of the invention
[0006] The purpose of the present invention is to propose a desoldering detection method based on the collection of photovoltaic component images by unmanned aerial vehicles. Through data expansion and optimized model training methods, the accuracy and reliability of desoldering detection can be improved, and the false alarm rate and missed alarm rate can be reduced; the real-time performance of desoldering detection can also be improved, so that it can be quickly applied to actual production, and desoldering problems can be discovered and handled in time.
[0007] The technical solution adopted by the present invention is: A desoldering detection method based on collecting photovoltaic component images by unmanned aerial vehicle comprises the following steps: S1. Data collection and annotation: Photograph the PV panels using a high-resolution camera carried by the drone, collect image data, and store it in JPEG format; Automatically annotate the collected image data, and the annotated categories include normal solder joints and desoldering joints; S2, data expansion: In this task, the collection, labeling and preprocessing of training data are time-consuming and labor-intensive, and insufficient training samples can easily lead to poor generalization ability of the model and affect the accuracy of the model.
[0008] A generative adversarial network based on potential information diffusion is used to generate samples and thus achieve data augmentation; the generative adversarial network based on potential information diffusion consists of two parts: a generator (G) and a discriminator (D). The generator is responsible for creating new images that are almost indistinguishable from real images, while the discriminator attempts to distinguish the generated images from the real images. The traditional generative adversarial network loss function is based on the estimation of probability distribution distance, such as KL divergence or JS divergence. Specifically, it ensures that the generated images are visually indistinguishable from the real images by strengthening the similarity between the generated images and the real images at the high-level feature level, while maintaining the key structural features of the photovoltaic module images.
[0009] The training process of the generative adversarial network algorithm based on potential information diffusion is as follows: S201, initialize the parameters of the generator G and the discriminator D, where the weights and biases of the generator G and the discriminator D are set by random initialization. Suppose the parameters of the generator are and the parameters of the discriminator are , then the initialization methods are expressed as: ; In the formula, represents a Gaussian distribution with a mean of 0 and a covariance matrix equal to the identity matrix; S202, generator G receives random noise , generate images through the network , expressed as: ; in, The implementation is based on the ReLU activation function, expressed as: ; In the formula, is the generator operation function, z represents the input random noise vector, and are the weights and biases of the generator, ReLU activation function. The random noise data is processed by a series of convolutional layers. , which is obtained by adjusting the batch normalization layer , respectively expressed as: ; In the formula, , and is obtained from a randomly initialized weight matrix through singular value decomposition, and are the parameters of the batch normalization layer, is the input noise elements, m is the dimension of the noise vector; S203, discriminator D simultaneously receives images from the generator and the real photovoltaic image x, the discriminator output is and , respectively represent the discrimination results of real images and generated images, expressed as: ; In the formula, is the Sigmoid activation function, and are the weights and biases of the discriminator; S204. Using the deterministic equivalent loss function Evaluate the similarity between the generated image and the real image and feed it back to the generator and discriminator. The loss function The calculation method is expressed as: ; In the formula, is the actual data distribution, is the noise distribution, A mapping function that represents high-level features extracted from the data, is a hyperparameter that balances adversarial loss and feature similarity, Express expectations, Indicates compliance with a specific distribution; in, Through additional feature extraction network To achieve this, the network consists of multiple convolution and pooling layers, expressed as: ; In the formula, represents the convolution operation, and are the weights and biases of the feature extraction network, is the tanh hyperbolic tangent activation function; S205, through multiple rounds of adversarial training, continuously update and To optimize the performance of the generator and the discriminator, the update methods are expressed as follows: ; In the formula, and are the updated parameters of the generator and discriminator, is the learning rate of the generative adversarial network; in, By preset performance monitoring function Implement dynamic adjustment and performance monitoring functions The calculation method is expressed as: ; In the formula, and Represent the losses of the current and previous iterations respectively, is the adjustment weight factor; S206, repeating the iteration steps S201-S205 until the preset stop iteration condition is met, indicating that the model training is completed; S3. Feature extraction model training: The expanded data is input into the feature extraction model for training the feature extraction model, and a neural network feature extraction model optimized based on a heterogeneous bee colony algorithm is adopted. The neural network feature extraction model optimized based on a heterogeneous bee colony algorithm uses a variety of bee colony behavior models to optimize the weights and structure of the neural network, so that it can more effectively identify and extract key features in photovoltaic module images, such as the integrity and abnormal conditions of solder joints.
[0010] The training process of the algorithm is as follows: S301, initialize the deep neural network structure, which includes 3 convolutional layers, 1 activation layer and 1 pooling layer; suppose the neural network has L layers, Layer weights and bias Initialized to: ; In the formula, It means the mean is 0 and the variance is Normal distribution of is used to initialize weights; is the bias, initialized to 0; S302: Use a heterogeneous bee colony optimization mechanism to refine and optimize network weights. The heterogeneous bee colony optimization algorithm simulates the behavior of bee colonies in nature, adjusts network parameters by finding the optimal solution, and achieves efficient global search and local fine adjustment. For the network parameter set, the heterogeneous bee colony algorithm optimizes the parameters of each layer The update process is as follows: S3021, bee algorithm optimization : ; In the formula, is the best performing weight in the current iteration, are randomly selected weights, and is a learning factor that controls the search range; Learning factors calculated based on the simulation of bee dance behavior and , which controls the intensity and direction of the search, and is adjusted dynamically in the following ways: ; In the formula, and is the initial maximum value; is the attenuation coefficient; Indicates the time step of the current iteration; S3022, Ant Colony Optimization : ; In the formula, It is ants as bias The proposed changes, is the learning rate, K is the total number of ants; Each ant's suggestion for bias It is obtained based on the local optimal path observed by ants, and the calculation method is expressed as: ; In the formula, It is The local optimal bias value found by an ant on its path, is the influencing factor of pheromone, controlling the weight of local search and historical information; S303, during the feature extraction process, the network will dynamically adjust the structure and connection weights of the subsequent layers based on the information learned from the previous layer. Output Apply spatial evolution operations to adjust The feature mapping is expressed as: ; In the formula, is the adjusted feature map, It is a layer The spatial evolution coefficient of Yes The result of applying the pooling operation to simulate the local aggregation effect of features; S304. After each iteration, update the learning rate based on the feedback from the bee colony algorithm. And weight adjustment strategy, respectively expressed as: ; In the formula, is the sensitivity parameter for learning rate adjustment, is the loss function The derivative with respect to time, is the loss function with respect to weights The gradient of is the weight obtained after updating the learning rate, is the updated learning rate; S305, repeating the iteration steps S301-S304 until the preset stop iteration condition is met, indicating that the model training is completed; S4. Feature dimensionality reduction model training: The data after feature extraction is input into the feature dimension reduction model for training the feature dimension reduction model, and the autoencoder algorithm based on combined compressed sensing is used for feature dimension reduction. The autoencoder based on combined compressed sensing includes an encoder and a decoder. The encoder is responsible for converting high-dimensional input into a low-dimensional representation, and the decoder attempts to restore the original input from this low-dimensional representation. Specifically, the combined compressed sensing strategy is used to improve the data compression efficiency and accuracy in the encoding process.
[0011] The training process of the algorithm is as follows: S401, initialize the network parameters of the autoencoder and set the initial weights and bias For each layer The network parameters are initialized as follows: ; In the formula, Indicates that the weight initialization uses a mean of 0 and a standard deviation of Gaussian distribution of Indicates that the bias is initialized to 0; S402, the input feature vector obtained by feature extraction in step S3 is passed through the encoder layer layer by layer, and each layer applies a linear transformation and a nonlinear activation function until a compressed low-dimensional feature representation is generated, which can be expressed as: ; In the formula, represents the output of the previous layer of the encoder, represents the output of the current layer of the encoder, is the weighted input of the encoder’s current layer, is the ReLU nonlinear activation function; S403, using a combined compressed sensing strategy to further compress the low-dimensional feature representation. During compression, the most informative feature combination is selected to minimize the reconstruction error of the low-dimensional feature representation before and after compression, which is expressed as: ; In the formula, It is a compression matrix learned from the training data to reduce the feature dimension; is the output of the last encoding layer; is the compressed feature representation; The compression matrix is calculated by random projection method , expressed as: ; In the formula, R is a -dimensional matrix whose elements are taken from the standard normal distribution ; d is the dimension of the original data, p is the dimension after compression, is the normalization factor; S404, the low-dimensional feature representation is expanded back to the dimension of the original feature space layer by layer through the decoder, and each layer also applies linear and nonlinear transformations. The way to reversely reconstruct the input data is expressed as: ; In the formula, represents the output of the previous layer of the decoder, represents the output of the current layer of the decoder, and are the weights and biases of the decoding layer, is the ReLU nonlinear activation function; S405. The training goal of the entire network is to minimize the difference between the input features and the reconstructed features, which is represented by the total loss function, that is, the mean square error is used as the loss function, and a regularization term is used to prevent overfitting. Thus, the total loss function The calculation method is expressed as: ; Where x is the input feature, is the reconstruction output, is the mean square error, It is weighted Regularization, is the regularization coefficient; S406. Based on the loss function, the gradient is calculated by the back propagation algorithm, and the network parameters are updated. Specifically, the gradient descent method is used to update the parameters, which is expressed as: ; In the formula, and represents the updated weight and bias parameters, is the learning rate; S407, repeating iterative steps S401-S406 until a preset stop iteration condition is met, indicating that the model training is completed; S5. Classifier model training: A support vector machine classification algorithm based on kernel density estimation is adopted. The reduced-dimensional data is input into the classifier for classifier training. A hybrid feedback mechanism is adopted in the traditional support vector machine framework, combining the feedback information from previous detection results to dynamically adjust the classification boundary.
[0012] The training process of the algorithm is as follows: S501, initialize the support vector machine, and use the Gaussian radial basis function as the kernel function, the expression is: ; In the formula, and are two eigenvectors, It is the width parameter of the kernel function, which controls the decay speed of the function; in, The calculation method is expressed as: ; In the formula, is the variance of the distance between sample feature vectors; S502, using the low-dimensional feature vector obtained after dimensionality reduction as input, training the support vector machine classifier, specifically using the sequence minimum optimization algorithm to solve the support vector and decision function, including finding the optimal hyperplane and maximizing the margin, which is defined by the following optimization problem: ; In the formula, is the normal vector of the hyperplane, is the intercept, is the slack variable, is the regularization parameter; S503: After the initial training, a hybrid feedback mechanism is used to set a feedback adjustment function. As the decision boundary for adjusting the classification model, it is expressed as: ; In the formula, represents the input feature vector in the classification model training process, is the normal vector of the adjusted hyperplane, is the initial prediction function of the support vector machine, is the true label, is to adjust the intensity, is the learning rate, It is a mapping function that maps the input features to a high-dimensional space, transforming the nonlinear separable problem into a linear separable one; S504: Evaluate the model performance on an independent validation dataset, where the validation dataset is obtained from the labeled dataset in a preset proportion, and the optimal parameters are determined using a cross-validation method. and , expressed as: ; In the formula, It is The error rate of cross validation; S505, Optimal Parameters and Once confirmed, it means that the training of the support vector machine classification algorithm based on kernel density estimation is completed; S6, desoldering detection: The trained model is used to perform desoldering detection on the newly collected photovoltaic module images. First, the key features of the collected new photovoltaic module images are extracted using the trained feature extraction model. Then, the extracted features are converted into low-dimensional feature vectors through the trained data dimensionality reduction model. Finally, the trained classifier model is used to classify the reduced dimensionality feature vectors to determine whether it is a desoldering area.
[0013] Further, in step S205, based on As a result, dynamically adjust the learning rate The way is expressed as: ; In the formula, is the sensitivity parameter of learning rate adjustment, represents the loss change rate, is the learning rate of the current iteration, is the learning rate of the previous iteration.
[0014] Furthermore, in step S304, the loss change rate It is approximated by the following difference form: ; In the formula, and Represent the loss values of the current and previous time steps respectively, is the interval of time steps, which is set to 1 here; Among them, the loss function The calculation method is: ; In the formula, is the cross entropy loss, is the regularization loss, the regularization loss Used to assess the dispersion of features and the overfitting of the model.
[0015] Regularization loss The calculation method is expressed as: ; In the formula, Indicates The parameters of the layer, represents the L2 norm, represents the dynamic regularization weight, L represents the number of layers of the feature extraction neural network; Dynamic Regularization Weights The calculation method is expressed as: ; In the formula, is the maximum value of the regularization weight, is the local sensitivity index of the feature, is the adjustment factor; Local sensitivity index of a feature The calculation method is expressed as: ; In the formula, It is The activation output of the nth sample of the layer, is the function that calculates the standard deviation of the activation output, and N is the number of samples.
[0016] Furthermore, in step S504, the learning rate is dynamically adjusted according to the cross-validation error rate, that is, during the training process, if the error decreases, the learning rate is gradually increased to speed up convergence; if the error increases, the learning rate is reduced to stabilize the training process. The adjustment strategy is expressed as: ; In the formula, It is The learning rate of the iteration, It is The learning rate of the iteration, is the adjustment factor, is a sign function; in, represents the error change between two consecutive iterations. The error of the iteration and The error of the iteration Respectively expressed as: ; Where N is the total number of samples, It is a sample The real label, is the classification decision function, It is The model parameters of the iteration, express .
[0017] Beneficial effects of the present invention: 1. Use a generative adversarial network based on potential information diffusion for data augmentation, and use the generator to generate images similar to real images to increase the number and diversity of training samples.
[0018] 2. Using the neural network optimized by heterogeneous bee colony algorithm for feature extraction and the combined compressed sensing autoencoder algorithm for feature dimension reduction can more effectively identify and extract key features in photovoltaic module images.
[0019] 3. A hybrid feedback strategy is adopted in the support vector machine classification algorithm based on kernel density estimation to dynamically adjust the classification boundaries for more accurate classification.
[0020] Based on the above innovations, the technical effects are as follows: 1. Through data expansion and optimized model training methods, the accuracy and reliability of desoldering detection can be improved, and the false alarm rate and missed alarm rate can be reduced.
[0021] 2. The optimized model and algorithm can improve the real-time performance of desoldering detection, so that it can be quickly applied to actual production to detect and deal with desoldering problems in a timely manner. DETAILED DESCRIPTION
[0022] A desoldering detection method based on collecting photovoltaic component images by unmanned aerial vehicle comprises the following steps: S1. Data collection and annotation: The present invention uses a high-resolution camera carried by a drone to photograph the photovoltaic module, collect image data, and store it in JPEG format; Automatically annotate the collected image data, and the annotated categories include normal solder joints and desoldering joints; S2, data expansion: In the task of the present invention, the collection, acquisition, labeling and preprocessing of training data are time-consuming and labor-intensive, and insufficient training samples can easily lead to poor generalization ability of the model and affect the accuracy of the model.
[0023] A generative adversarial network based on potential information diffusion is used to generate samples, thereby achieving data expansion; the generative adversarial network based on potential information diffusion includes two parts: a generator (G) and a discriminator (D). The generator is responsible for creating new images that are almost indistinguishable from real images, while the discriminator attempts to distinguish the generated images from the real images. The traditional generative adversarial network loss function is based on the estimation of the probability distribution distance, such as KL divergence or JS divergence. The present invention ensures that the generated images are visually indistinguishable from the real images by strengthening the similarity between the generated images and the real images at the high-level feature level, while maintaining the key structural features of the photovoltaic module images.
[0024] The training process of the generative adversarial network algorithm based on potential information diffusion is as follows: S201, initialize the parameters of the generator G and the discriminator D, where the weights and biases of the generator G and the discriminator D are set by random initialization. Suppose the parameters of the generator are and the parameters of the discriminator are , then the initialization methods are expressed as: ; In the formula, represents a Gaussian distribution with a mean of 0 and a covariance matrix equal to the identity matrix; S202, generator G receives random noise , generate images through the network , expressed as: ; in, The implementation is based on the ReLU activation function, expressed as: ; In the formula, is the generator operation function, z represents the input random noise vector, and are the weights and biases of the generator, ReLU activation function. The random noise data is processed by a series of convolutional layers. , which is obtained by adjusting the batch normalization layer , respectively expressed as: ; In the formula, , and is obtained from a randomly initialized weight matrix through singular value decomposition, and are the parameters of the batch normalization layer, is the input noise elements, m is the dimension of the noise vector; preferably, and Set them to 10 and 0.5 respectively.
[0025] S203, discriminator D simultaneously receives images from the generator and the real photovoltaic image x, the discriminator output is and , respectively represent the discrimination results of real images and generated images, expressed as: ; In the formula, is the Sigmoid activation function, and are the weights and biases of the discriminator; S204. Using the deterministic equivalent loss function Evaluate the similarity between the generated image and the real image and feed it back to the generator and discriminator. The loss function The calculation method is expressed as: ; In the formula, is the actual data distribution, is the noise distribution, A mapping function that represents high-level features extracted from the data, is a hyperparameter that balances adversarial loss and feature similarity, Express expectations, represents subject to a specific distribution; preferably, Set to 0.3.
[0026] in, Through additional feature extraction network To achieve this, the network consists of multiple convolution and pooling layers, expressed as: ; In the formula, represents the convolution operation, and are the weights and biases of the feature extraction network, is the tanh hyperbolic tangent activation function; S205, through multiple rounds of adversarial training, continuously update and To optimize the performance of the generator and the discriminator, the update methods are expressed as follows: ; In the formula, and are the updated parameters of the generator and discriminator, is the learning rate of the generative adversarial network; preferably, It is set in a dynamic adjustment manner, and its initial value is set to 0.001.
[0027] in, By preset performance monitoring function Implement dynamic adjustment and performance monitoring functions The calculation method is expressed as: ; In the formula, and Represent the losses of the current and previous iterations respectively, is an adjustment weight factor; preferably, Set to 0.3.
[0028] based on As a result, dynamically adjust the learning rate The way is expressed as: ; In the formula, is the sensitivity parameter of learning rate adjustment, represents the loss change rate, is the learning rate of the current iteration, is the learning rate of the previous iteration; preferably, Set to 3.
[0029] S206. Repeat iterative steps S201-S205 until a preset stop iteration condition is met, indicating that the model training is completed; in this embodiment, the preset stop iteration condition is reaching a preset maximum number of iterations, which is set to 1000 times.
[0030] S3. Feature extraction model training: The expanded data is input into the feature extraction model for training the feature extraction model, and a neural network feature extraction model optimized based on a heterogeneous bee colony algorithm is adopted. The neural network feature extraction model optimized based on a heterogeneous bee colony algorithm uses a variety of bee colony behavior models to optimize the weights and structure of the neural network, so that it can more effectively identify and extract key features in photovoltaic module images, such as the integrity and abnormal conditions of solder joints.
[0031] The training process of the algorithm is as follows: S301, initialize the deep neural network structure, which includes 3 convolutional layers, 1 activation layer and 1 pooling layer; assume that the neural network has L layers. In this embodiment, L is equal to 5. Layer weights and bias Initialized to: ; In the formula, It means the mean is 0 and the variance is Normal distribution of is used to initialize weights; is the bias, initialized to 0; S302: Use a heterogeneous bee colony optimization mechanism to refine and optimize network weights. The heterogeneous bee colony optimization algorithm simulates the behavior of bee colonies in nature, adjusts network parameters by finding the optimal solution, and achieves efficient global search and local fine adjustment. For the network parameter set, the heterogeneous bee colony algorithm optimizes the parameters of each layer The update process is as follows: S3021, bee algorithm optimization : ; In the formula, is the best performing weight in the current iteration, are randomly selected weights, and is a learning factor that controls the search range; Learning factors calculated based on the simulation of bee dance behavior and , which controls the intensity and direction of the search, and is adjusted dynamically in the following ways: ; In the formula, and is the initial maximum value, preferably, and All are set to 1.0; is the attenuation coefficient, preferably, set to 0.1; Indicates the time step of the current iteration; S3022, Ant Colony Optimization : ; In the formula, It is ants as bias The proposed changes, is the learning rate, K is the total number of ants; preferably, Set to 0.001.
[0032] Each ant's suggestion for bias It is obtained based on the local optimal path observed by ants, and the calculation method is expressed as: ; In the formula, It is The local optimal bias value found by an ant on its path, is the influence factor of pheromone, controlling the weight of local search and historical information; preferably, The value is in the range of [0.1, 0.5].
[0033] S303, during the feature extraction process, the network will dynamically adjust the structure and connection weights of the subsequent layers based on the information learned from the previous layer. Output Apply spatial evolution operations to adjust The feature mapping is expressed as: ; In the formula, is the adjusted feature map, It is a layer The spatial evolution coefficient of Yes The result of applying a pooling operation to simulate the local aggregation effect of features; preferably, Set to 0.01.
[0034] S304. After each iteration, update the learning rate based on the feedback from the bee colony algorithm. And weight adjustment strategy, respectively expressed as: ; In the formula, is the sensitivity parameter for learning rate adjustment, is the loss function The derivative with respect to time, is the loss function with respect to weights The gradient of is the weight obtained after updating the learning rate, is the updated learning rate; preferably, Set to 0.01.
[0035] Loss change rate It is approximated by the following difference form: ; In the formula, and Represent the loss values of the current and previous time steps respectively, is the interval of time steps, which is set to 1 in the present invention; Among them, the loss function The calculation method is: ; In the formula, is the cross entropy loss, is the regularization loss, the regularization loss Used to assess the dispersion of features and the overfitting of the model.
[0036] Regularization loss The calculation method is expressed as: ; In the formula, Indicates The parameters of the layer, represents the L2 norm, represents the dynamic regularization weight, L represents the number of layers of the feature extraction neural network; Dynamic Regularization Weights The calculation method is expressed as: ; In the formula, is the maximum value of the regularization weight, is the local sensitivity index of the feature, is the adjustment factor; preferably, Set to 0.4.
[0037] Local sensitivity index of a feature The calculation method is expressed as: ; In the formula, It is The activation output of the nth sample of the layer, is the function that calculates the standard deviation of the activation output, and N is the number of samples.
[0038] S305. Repeat iterative steps S301-S304 until a preset stop iteration condition is met, indicating that the model training is completed; in this embodiment, the preset stop iteration condition is reaching a preset maximum number of iterations, which is set to 1000 times.
[0039] S4. Feature dimensionality reduction model training: The feature-extracted data is input into a feature dimensionality reduction model for training the feature dimensionality reduction model, and an autoencoder algorithm based on combined compressed sensing is used for feature dimensionality reduction. The autoencoder based on combined compressed sensing includes an encoder and a decoder. The encoder is responsible for converting high-dimensional input into a low-dimensional representation, and the decoder attempts to restore the original input from the low-dimensional representation. The present invention adopts a combined compressed sensing strategy to improve the data compression efficiency and accuracy in the encoding process.
[0040] The training process of the algorithm is as follows: S401, initialize the network parameters of the autoencoder and set the initial weights and bias For each layer The network parameters are initialized as follows: ; In the formula, Indicates that the weight initialization uses a mean of 0 and a standard deviation of Gaussian distribution of Indicates that the bias is initialized to 0; Preferably, the encoding layer of the autoencoder is designed to have three fully connected layers, and the number of neurons in each layer is set to 1024, 512, and 256.
[0041] S402, the input feature vector obtained by feature extraction in step S3 is passed through the encoder layer layer by layer, and each layer applies a linear transformation and a nonlinear activation function until a compressed low-dimensional feature representation is generated, which can be expressed as: ; In the formula, represents the output of the previous layer of the encoder, represents the output of the current layer of the encoder, is the weighted input of the encoder’s current layer, is the ReLU nonlinear activation function; S403, using a combined compressed sensing strategy to further compress the low-dimensional feature representation. During compression, the most informative feature combination is selected to minimize the reconstruction error of the low-dimensional feature representation before and after compression, which is expressed as: ; In the formula, It is a compression matrix learned from the training data to reduce the feature dimension; is the output of the last encoding layer; is the compressed feature representation; The compression matrix is calculated by random projection method , expressed as: ; In the formula, R is a dimensional matrix whose elements are taken from the standard normal distribution; ; d is the dimension of the original data, p is the dimension after compression, is the normalization factor; S404, the low-dimensional feature representation is expanded back to the dimension of the original feature space layer by layer through the decoder, and each layer also applies linear and nonlinear transformations. The way to reversely reconstruct the input data is expressed as: ; In the formula, represents the output of the previous layer of the decoder, represents the output of the current layer of the decoder, and are the weights and biases of the decoding layer, is the ReLU nonlinear activation function; S405. The training goal of the entire network is to minimize the difference between the input features and the reconstructed features, which is represented by the total loss function, that is, the mean square error is used as the loss function, and a regularization term is used to prevent overfitting. Thus, the total loss function The calculation method is expressed as: ; Where x is the input feature, is the reconstruction output, is the mean square error, is the L2 regularization of the weights, is the regularization coefficient; preferably, Set to 0.4.
[0042] S406. Based on the loss function, the gradient is calculated by the back propagation algorithm, and the network parameters are updated. The present invention adopts the gradient descent method to update the parameters, which is expressed as: ; In the formula, and represents the updated weight and bias parameters, is the learning rate; preferably, the learning rate Set to 0.01.
[0043] S407, repeating iterative steps S401-S406 until a preset stop iteration condition is met, indicating that the model training is completed; in this embodiment, the preset stop iteration condition is reaching a preset maximum number of iterations, which is set to 1000 times.
[0044] S5. Classifier model training: A support vector machine classification algorithm based on kernel density estimation is adopted. The reduced-dimensional data is input into the classifier for classifier training. A hybrid feedback mechanism is adopted in the traditional support vector machine framework, combining the feedback information from previous detection results to dynamically adjust the classification boundary.
[0045] The training process of the algorithm is as follows: S501, initialize the support vector machine, and use the Gaussian radial basis function as the kernel function, the expression is: ; In the formula, and are two eigenvectors, It is the width parameter of the kernel function, which controls the decay speed of the function; in, The calculation method is expressed as: ; In the formula, is the variance of the distance between sample feature vectors; S502, the low-dimensional feature vector obtained after dimensionality reduction is used as input to train the support vector machine classifier. The present invention adopts a sequence minimum optimization algorithm to solve the support vector and decision function, including finding the optimal hyperplane and maximizing the margin, which is defined by the following optimization problem: ; In the formula, is the normal vector of the hyperplane, is the intercept, is the slack variable, is the regularization parameter; S503: After the initial training, a hybrid feedback mechanism is used to set a feedback adjustment function. As the decision boundary for adjusting the classification model, it is expressed as: ; In the formula, represents the input feature vector in the classification model training process, is the normal vector of the adjusted hyperplane, is the initial prediction function of the support vector machine, is the true label, is to adjust the intensity, is the learning rate, is a mapping function that maps the input features to a high-dimensional space, transforming the nonlinear separable problem into a linear separable one; preferably, Set to 0.3, It is set for dynamic adjustment, and the initial setting is 0.001.
[0046] S504: Evaluate the model performance on an independent validation dataset, where the validation dataset is obtained from the labeled dataset in a preset proportion, and the optimal parameters are determined using a cross-validation method. and , expressed as: ; In the formula, It is The error rate of cross validation; The learning rate is dynamically adjusted according to the cross-validation error rate. That is, during the training process, if the error decreases, the learning rate is gradually increased to speed up convergence; if the error increases, the learning rate is reduced to stabilize the training process. The adjustment strategy is expressed as: ; In the formula, It is The learning rate of the iteration, It is The learning rate of the iteration, is the adjustment factor, is a sign function; preferably, Set to 0.5.
[0047] in, represents the error change between two consecutive iterations. The error of the iteration and The error of the iteration Respectively expressed as: ; Where N is the total number of samples, It is a sample The real label, is the classification decision function, It is The model parameters of the iteration, express ; S505, Optimal Parameters and Once confirmed, it means that the training of the support vector machine classification algorithm based on kernel density estimation is completed.
[0048] S6, desoldering detection: The trained model is used to perform desoldering detection on the newly collected photovoltaic module images. In this embodiment, the trained feature extraction model is used to extract key features from the collected new photovoltaic module images. Further, the extracted features are converted into low-dimensional feature vectors through the trained data dimension reduction model. Further, the trained classifier model is used to classify the reduced-dimensional feature vectors to determine whether they are desoldering areas. In this embodiment, the identified categories include "normal solder joints" and "desoldering joints", a total of 2 categories.
Claims
1. A desoldering detection method based on the acquisition of photovoltaic module images by drones. It is characterized in that The following steps are involved: S1. Data collection and annotation: Photograph the PV panels using a high-resolution camera carried by the drone, collect image data, and store it in JPEG format; Automatically annotate the collected image data, and the annotated categories include normal solder joints and desoldering joints; S2, data expansion: The generative adversarial network based on potential information diffusion is used to generate samples, thereby realizing data expansion. The training process of the generative adversarial network algorithm based on potential information diffusion is as follows: S201, initialize the parameters of the generator G and the discriminator D, where the weights and biases of the generator G and the discriminator D are set by random initialization. Suppose the parameters of the generator are and the parameters of the discriminator are , then the initialization methods are expressed as: ; In the formula, represents a Gaussian distribution with a mean of 0 and a covariance matrix equal to the identity matrix; S202, generator G receives random noise , generate images through the network , expressed as: ; in, The implementation is based on the ReLU activation function, expressed as: ; In the formula, is the generator operation function, z represents the input random noise vector, and are the weights and biases of the generator, ReLU activation function. The random noise data is processed by a series of convolutional layers. , which is obtained by adjusting the batch normalization layer , respectively expressed as: ; In the formula, , and is obtained from a randomly initialized weight matrix through singular value decomposition, and are the parameters of the batch normalization layer, is the input noise elements, m is the dimension of the noise vector; S203, discriminator D simultaneously receives images from the generator and the real photovoltaic image x, the discriminator output is and , respectively represent the discrimination results of real images and generated images, expressed as: ; In the formula, is the Sigmoid activation function, and are the weights and biases of the discriminator; S204. Using the deterministic equivalent loss function Evaluate the similarity between the generated image and the real image and feed it back to the generator and discriminator. The loss function The calculation method is expressed as: ; In the formula, is the actual data distribution, is the noise distribution, A mapping function that represents high-level features extracted from the data, is a hyperparameter that balances adversarial loss and feature similarity, Express expectations, Indicates compliance with a specific distribution; in, Through additional feature extraction network To achieve this, the network consists of multiple convolution and pooling layers, expressed as: ; In the formula, represents the convolution operation, and are the weights and biases of the feature extraction network, is the tanh hyperbolic tangent activation function; S205, through multiple rounds of adversarial training, continuously update and To optimize the performance of the generator and the discriminator, the update methods are expressed as follows: ; In the formula, and are the updated parameters of the generator and discriminator, is the learning rate of the generative adversarial network; in, By preset performance monitoring function Implement dynamic adjustment and performance monitoring functions The calculation method is expressed as: ; In the formula, and Represent the losses of the current and previous iterations respectively, is the adjustment weight factor; S206, repeating the iteration steps S201-S205 until the preset stop iteration condition is met, indicating that the model training is completed; S3. Feature extraction model training: The expanded data is input into the feature extraction model for training. The neural network feature extraction model optimized based on the heterogeneous bee colony algorithm is adopted. The training process of the algorithm is as follows: S301, initialize the deep neural network structure, which includes 3 convolutional layers, 1 activation layer and 1 pooling layer; suppose the neural network has L layers, Layer weights and bias Initialized to: ; In the formula, It means the mean is 0 and the variance is Normal distribution of is used to initialize weights; is the bias, initialized to 0; S302, using heterogeneous bee colony optimization mechanism to refine and optimize network weights, set For the network parameter set, the heterogeneous bee colony algorithm optimizes the parameters of each layer The update process is as follows: S3021, bee algorithm optimization : ; In the formula, is the best performing weight in the current iteration, are randomly selected weights, and is a learning factor that controls the search range; Learning factors calculated based on the simulation of bee dance behavior and , which controls the intensity and direction of the search, and is adjusted dynamically in the following ways: ; In the formula, and is the initial maximum value; is the attenuation coefficient; Indicates the time step of the current iteration; S3022, Ant Colony Optimization : ; In the formula, It is ants as bias The proposed changes, is the learning rate, K is the total number of ants; Each ant's suggestion for bias It is obtained based on the local optimal path observed by ants, and the calculation method is expressed as: ; In the formula, It is The local optimal bias value found by an ant on its path, is the influencing factor of pheromone, controlling the weight of local search and historical information; S303, during the feature extraction process, the network will dynamically adjust the structure and connection weights of the subsequent layers based on the information learned from the previous layer. Output Apply spatial evolution operations to adjust The feature mapping is expressed as: ; In the formula, is the adjusted feature map, It is a layer The spatial evolution coefficient of Yes The result of applying the pooling operation to simulate the local aggregation effect of features; S304. After each iteration, update the learning rate based on the feedback from the bee colony algorithm. And weight adjustment strategy, respectively expressed as: ; In the formula, is the sensitivity parameter for learning rate adjustment, is the loss function The derivative with respect to time, is the loss function with respect to weights The gradient of is the weight obtained after updating the learning rate, is the updated learning rate; S305, repeating the iteration steps S301-S304 until the preset stop iteration condition is met, indicating that the model training is completed; S4. Feature dimensionality reduction model training: The data after feature extraction is input into the feature dimensionality reduction model for training. The autoencoder algorithm based on combined compressed sensing is used for feature dimensionality reduction. The training process of the algorithm is as follows: S401, initialize the network parameters of the autoencoder and set the initial weights and bias For each layer The network parameters are initialized as follows: ; In the formula, Indicates that the weight initialization uses a mean of 0 and a standard deviation of Gaussian distribution of Indicates that the bias is initialized to 0; S402, the input feature vector obtained by feature extraction in step S3 is passed through the encoder layer layer by layer, and each layer applies a linear transformation and a nonlinear activation function until a compressed low-dimensional feature representation is generated, which can be expressed as: ; In the formula, represents the output of the previous layer of the encoder, represents the output of the current layer of the encoder, is the weighted input of the encoder’s current layer, is the ReLU nonlinear activation function; S403, using a combined compressed sensing strategy to further compress the low-dimensional feature representation. During compression, the most informative feature combination is selected to minimize the reconstruction error of the low-dimensional feature representation before and after compression, which is expressed as: ; In the formula, It is a compression matrix learned from the training data to reduce the feature dimension; is the output of the last encoding layer; is the compressed feature representation; The compression matrix is calculated by random projection method , expressed as: ; In the formula, R is a -dimensional matrix whose elements are taken from the standard normal distribution ; d is the dimension of the original data, p is the dimension after compression, is the normalization factor; S404, the low-dimensional feature representation is expanded back to the dimension of the original feature space layer by layer through the decoder, and each layer also applies linear and nonlinear transformations. The way to reversely reconstruct the input data is expressed as: ; In the formula, represents the output of the previous layer of the decoder, represents the output of the current layer of the decoder, and are the weights and biases of the decoding layer, is the ReLU nonlinear activation function; S405. The training goal of the entire network is to minimize the difference between the input features and the reconstructed features, which is represented by the total loss function, that is, the mean square error is used as the loss function, and a regularization term is used to prevent overfitting. Thus, the total loss function The calculation method is expressed as: ; Where x is the input feature, is the reconstruction output, is the mean square error, It is weighted Regularization, is the regularization coefficient; S406. Based on the loss function, the gradient is calculated by the back propagation algorithm, and the network parameters are updated. Specifically, the gradient descent method is used to update the parameters, which is expressed as: ; In the formula, and represents the updated weight and bias parameters, is the learning rate; S407, repeating iterative steps S401-S406 until a preset stop iteration condition is met, indicating that the model training is completed; S5. Classifier model training: The support vector machine classification algorithm based on kernel density estimation is used to input the reduced-dimensional data into the classifier for classifier training. The training process of the algorithm is as follows: S501, initialize the support vector machine, and use the Gaussian radial basis function as the kernel function, the expression is: ; In the formula, and are two eigenvectors, It is the width parameter of the kernel function, which controls the decay speed of the function; in, The calculation method is expressed as: ; In the formula, is the variance of the distance between sample feature vectors; S502, using the low-dimensional feature vector obtained after dimensionality reduction as input, training the support vector machine classifier, specifically using the sequence minimum optimization algorithm to solve the support vector and decision function, including finding the optimal hyperplane and maximizing the margin, which is defined by the following optimization problem: ; In the formula, is the normal vector of the hyperplane, is the intercept, is the slack variable, is the regularization parameter; S503: After the initial training, a hybrid feedback mechanism is used to set a feedback adjustment function. As the decision boundary for adjusting the classification model, it is expressed as: ; In the formula, represents the input feature vector in the classification model training process, is the normal vector of the adjusted hyperplane, is the initial prediction function of the support vector machine, is the true label, is to adjust the intensity, is the learning rate, It is a mapping function that maps the input features to a high-dimensional space, transforming the nonlinear separable problem into a linear separable one; S504: Evaluate the model performance on an independent validation dataset, where the validation dataset is obtained from the labeled dataset in a preset proportion, and the optimal parameters are determined using a cross-validation method. and , expressed as: ; In the formula, is the error rate of the k-fold cross validation; S505, Optimal Parameters and Once confirmed, it means that the training of the support vector machine classification algorithm based on kernel density estimation is completed; S6, desoldering detection: The trained model is used to perform desoldering detection on the newly collected photovoltaic module images. First, the key features of the collected new photovoltaic module images are extracted using the trained feature extraction model. Then, the extracted features are converted into low-dimensional feature vectors through the trained data dimensionality reduction model. Finally, the trained classifier model is used to classify the reduced dimensionality feature vectors to determine whether it is a desoldering area.
2. A desoldering detection method based on collecting photovoltaic module images by drone as claimed in claim 1, It is characterized in that In step S205, based on As a result, dynamically adjust the learning rate The way is expressed as: ; In the formula, is the sensitivity parameter of learning rate adjustment, represents the loss change rate, is the learning rate of the current iteration, is the learning rate of the previous iteration.
3. A desoldering detection method based on collecting photovoltaic module images by drone as claimed in claim 1, It is characterized in that In step S304, the loss change rate It is approximated by the following difference form: ; In the formula, and Represent the loss values of the current and previous time steps respectively, is the interval of time steps, which is set to 1 here; Among them, the loss function The calculation method is: ; In the formula, is the cross entropy loss, is the regularization loss; Regularization loss The calculation method is expressed as: ; In the formula, Indicates The parameters of the layer, express norm, represents the dynamic regularization weight, L represents the number of layers of the feature extraction neural network; Dynamic Regularization Weights The calculation method is expressed as: ; In the formula, is the maximum value of the regularization weight, is the local sensitivity index of the feature, is the adjustment factor; Local sensitivity index of a feature The calculation method is expressed as: ; In the formula, It is The activation output of the nth sample of the layer, is the function that calculates the standard deviation of the activation output, and N is the number of samples.
4. A desoldering detection method based on collecting photovoltaic module images by drone as claimed in claim 1, It is characterized in that In step S504, the learning rate is dynamically adjusted according to the cross-validation error rate, that is, during the training process, if the error decreases, the learning rate is gradually increased to speed up convergence; if the error increases, the learning rate is reduced to stabilize the training process. The adjustment strategy is expressed as: ; In the formula, is the learning rate of the tth iteration, It is The learning rate of the iteration, is the adjustment factor, is a sign function; in, It represents the error change between two consecutive iterations, and the error of the tth iteration is and The error of the iteration Respectively expressed as: ; Where N is the total number of samples, It is a sample The real label, is the classification decision function, are the model parameters for the tth iteration, express .
Citation Information
Patent Citations
Pedestrian detection tracking method based on compressed characteristic
CN106815562A
Pressure pipeline electromagnetic ultrasonic detection method based on artificial intelligence
CN118129088A
Medical image automatic analysis method based on artificial intelligence
CN118172364A
Decision-making method for unmanned aerial vehicle control system based on edge calculation
CN118394112A
Medical image segmentation method based on u-shaped network
WO2022199143A1
Cited By
3D face feature processing and recognition method based on machine learning
CN118823858A
Real-time steam generator state monitoring method based on artificial intelligence
CN119150079A
Deep learning photovoltaic cell welding effect identification method and system
CN119229193A
Industrial visual quality inspection method and device, electronic equipment and storage medium
CN119625426A
Medical image automatic classification method and system based on machine learning
CN119851047A
