Photovoltaic array fault diagnosis method based on LSTM-DAE
By using the LSTM-DAE model for semi-supervised learning in photovoltaic array fault diagnosis and automatically extracting features, the problems of low accuracy of fault classification and high learning cost in the prior art are solved, and higher recognition accuracy and lower learning cost are achieved.
Patent Information
- Application Number
- CN202411402246.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-10-09
AI Technical Summary
Among the existing photovoltaic array fault diagnosis methods, a single fault classification method based on artificial intelligence algorithms has the problem of insufficient identification accuracy and high learning cost.
Using a semi-supervised learning method based on long and short-term memory networks and deep automatic encoder (LSTM-DAE) is used to pre-train the LSTM-DAE model through a large amount of unidentified data to automatically extract useful features for photovoltaic array failure classification.
It improves the accuracy of identification of photovoltaic array fault types, reduces dependence on labeled data, reduces learning costs, and is suitable for actual photovoltaic scenarios.
Smart Images

Figure CN119557722A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of photovoltaic fault diagnosis, and specifically relates to a photovoltaic array fault diagnosis method based on LSTM-DAE. Background Art
[0002] Solar photovoltaic system is a clean and renewable energy source that can convert sunlight into electrical energy to provide power for human production and life. However, photovoltaic system may have faults during operation, such as damaged panels, aging wires, inverter failure, etc. If these faults are not discovered and handled in time, they may cause the system's output power to decrease, affect the normal operation of the system, and may even cause safety accidents such as fire.
[0003] In the fault diagnosis research of photovoltaic modules, there is a complex nonlinear relationship between the symptoms of the fault and the fault type, which makes it difficult to build an accurate fault diagnosis mathematical model. Common faults of photovoltaic modules include local shading and abnormal aging. Under different working conditions, the output characteristics of photovoltaic modules will show different changes. In order to simplify the application of fault diagnosis methods, after careful observation and research, four key output parameters, namely maximum power point current, maximum power point voltage, short circuit current and open circuit voltage, were determined as the main basis for diagnosing photovoltaic module faults.
[0004] Therefore, the diagnosis of faults in solar photovoltaic systems is the key to ensuring reliable and efficient operation of the system. With the continuous expansion of the scale of photovoltaic power generation systems, higher requirements are placed on the fault diagnosis of photovoltaic arrays. Generally, a single fault classification method based on artificial intelligence algorithms is adopted, including: convolutional neural networks, random forests, gradient boosting machines, long short-term memory networks, autoencoders, etc.
[0005] Among them, the fault classification method based on convolutional neural network requires a large amount of labeled data for training, but obtaining high-quality data may be costly, the training process requires a lot of computing resources, and the training time may be long; the fault diagnosis method based on random forest is difficult to handle data with particularly strong nonlinear relationships; the fault diagnosis method based on gradient boosting machine is prone to overfitting, especially when the data set is small or the number of features is large, a large number of parameters need to be carefully adjusted, the learning time is long, and the recognition accuracy is relatively low; the fault diagnosis method based on long short-term memory network has many model parameters and requires a large amount of data to avoid overfitting. It has poor interpretability and it is difficult to understand how the model makes decisions; the fault diagnosis method based on denoising autoencoder: for complex data, it may not be able to extract sufficiently effective features, resulting in a decrease in accuracy.
[0006] The accuracy of the above single artificial intelligence algorithm is still not high enough in practical applications, so we need to find a way to improve the accuracy. Summary of the invention
[0007] Purpose of the invention: In order to solve the problem that the recognition accuracy of a single algorithm is not high enough and the learning cost is high when using a machine learning method for fault classification, the present invention provides a photovoltaic array fault diagnosis method based on LSTM-DAE, which is based on a long short-term memory network and a deep autoencoder (Long Short-term Memory and DeepAuto-encoder, LSTM-DAE), adopts a semi-supervised learning method to reduce the dependence on labeled data, and uses a large amount of unlabeled data to pre-train the LSTM-DAE model. The pre-trained LSTM-DAE model can automatically extract useful features for subsequent fault classification tasks.
[0008] Technical solution: The present invention discloses a photovoltaic array fault diagnosis method based on LSTM-DAE, comprising the following steps:
[0009] S1: Obtain the current and voltage collected from the photovoltaic array, perform preprocessing, use box plot analysis to remove abnormal values of current and voltage, smooth the IV curve, perform denoising and filtering, and reduce the impact of noise;
[0010] S2: Draw the pre-processed IV curve, perform fault pre-diagnosis, and detect the i at the maximum power point pv and v pv , calculate and determine whether the power at the point exceeds the fault warning threshold. If it exceeds the threshold, it is judged as a fault and a fault sample data set is prepared;
[0011] S3: Label the fault sample data set and make it into training set and test set; use the LSTM-DAE fault classification model constructed by denoising autoencoder based on long short-term memory network to extract features of fault samples, align the extracted features with labels, and train the LSTM-DAE fault classification model; adjust the model through feature selection of support vector machine SVM and parameter optimization of logistic regression LR, and then perform k-fold cross validation to obtain the trained fault classification model;
[0012] S4: Input the pre-diagnosed fault samples into the LSTM-DAE model to confirm the fault type of the PV array.
[0013] Furthermore, the S1 pre-processes the photovoltaic array data, specifically: obtaining the current and voltage collected in the photovoltaic array, analyzing the current and voltage with a box plot, and performing IV curve smoothing and denoising filtering:
[0014] S1.1: The method for removing abnormal points by box plot analysis of the current and voltage collected in the photovoltaic array is as follows: Ensure that complete IV curve data is collected, including current and voltage values under different light and temperature conditions, calculate quartiles Q1, Q2 and Q3, and calculate the interquartile range IQR:
[0015] IQR=Q3-Q1
[0016] Determine the outlier limits: lower limit = Q1-1.5*IQR, upper limit = Q3+1.5*IQR, use Python to draw a box plot of current and voltage data, analyze and determine the outliers on the box plot that exceed the upper and lower limits, and delete the outlier data points;
[0017] S1.2: The method for denoising the IV curve of the current and voltage after removing the abnormal points is as follows: determine the window size of the filter to be 5, and select a binomial polynomial as:
[0018] y=ax 2 +bx+c
[0019] Where y is the fitted value, x is the original data point, and a, b, and c are the coefficients of the polynomial, which are used to determine the weights of the quadratic term, the linear term, and the constant term;
[0020] A Savitzky-Golay filter is used to smooth each data point on the IV curve. The filter performs local polynomial fitting on the data points and then replaces the original data points with the corresponding points on the fitting curve to obtain a smoothed IV curve.
[0021] Furthermore, the method of drawing the pre-processed IV curve in S2 and performing fault pre-diagnosis on it is specifically as follows:
[0022] The IV curve measured under the standard test condition STC is determined as the reference curve, and then the IV curve under the actual working condition after the previous preprocessing is used to calculate the maximum power point of the measured curve and the reference curve, that is, the point with the maximum power in the curve;
[0023] Calculate the deviation between the measured maximum power point MPP and the reference MPP, and determine whether the deviation exceeds the warning threshold. If it exceeds the threshold, it is determined that there is a fault in the photovoltaic array. The deviation judgment conditions are as follows:
[0024]
[0025] Wherein, Pmax1 is the reference curve MPP, Pmax2 is the measured curve MPP, and λ is the fault warning threshold, which is taken as λ=5% according to the situation of the photovoltaic module.
[0026] Furthermore, the method of the S3 fault classification model based on LSTM-DAE is specifically as follows:
[0027] At different levels of solar insolation G and temperature T, the maximum power point MPP pv and v pv It is used as an extended input feature, and the architecture of denoising autoencoder based on long short-term memory network LSTM-DAE is used for automatic feature extraction;
[0028] The LSTM network is used as an encoder to extract the temporal features of the input data, and the LSTM network is also used as a decoder to reconstruct the encoder input. The encoder and decoder are connected through a fully connected layer, and the output of the encoder is used as the input of the decoder. The output of the decoder is compared with the original input to calculate the reconstruction error. During the training process, the back propagation algorithm is used to minimize the reconstruction error to train the model parameters. The loss function is the mean square error of the reconstruction error.
[0029] In LSTM-DAE, both encoding and decoding are done by LSTM. When LSTM is used as an encoder, the output is the same as i pv and v pv The characteristics of the samples are the same. For LSTM as a decoder, the output is the same as i pv and v pv The samples are of the same length;
[0030] The encoder uses a nonlinear deterministic mapping function given by t The transformation is given by the hidden feature representation y t :
[0031] y t =ρ(W t X t +B)
[0032] Where ρ is the activation function, W is the matrix between the weight hidden layers, y is the output, and B is the bias; X t is represented by the continuous updating of W and B by mini-batch stochastic gradient descent (SGD) in all hidden layers during training. Backpropagation is used to train the DAE. The input X t The representation will produce Similar output, the formula is given below:
[0033]
[0034]
[0035] In the formula, X t is the tth input sample, is the reconstructed sample corresponding to the input;
[0036] Furthermore, the specific network structure of the denoising autoencoder based on the long short-term memory network includes:
[0037] Gaussian noise layer, introduces Gaussian noise into the preprocessed data, and the standard deviation of the noise distribution is set to 0.1; use LSTM modules to build an LSTM autoencoder network, with 3 encoders and 3 decoders; use a small batch stochastic gradient descent optimization algorithm to update the weights; use ReLU as the activation function; set the learning rate of the LSTM-DAE network model to 0.0001, the batch size to 16, and the number of epochs to 100.
[0038] Furthermore, the model is adjusted through feature selection of support vector machine (SVM) and parameter optimization of logistic regression (LR), and then k-fold cross validation is performed, as follows:
[0039] The structure of the SVM classifier was combined with the same number of LSTM-DAE output data samples. The SVM model was trained and validated by k-fold cross validation and finally merged with the LR classifier. The binomial method was used to fit the selected variables in the SVM to the LR classifier. The Gaussian kernel with the highest accuracy was selected as the kernel of the SVM.
[0040] The SVM classifier is used for feature selection. Due to the use of kernel techniques, it has a good effect in selecting useful features. SVM uses a fine Gaussian kernel, and its mathematical expression is as follows:
[0041] K(x,y)=exp(-γx-y 2 )
[0042] Where x and y are two vectors in the original feature space; γ is the parameter of the Gaussian kernel, which controls the complexity of the feature mapping; ||xy|| is the square of the Euclidean distance between vectors x and y;
[0043] A ten-fold cross validation was performed on the SVM classifier to screen and determine the best features selected by the SVM, and the SVM classifier was used to select features from the original features. In each iteration, 9 training subsets were used to train the SVM, and the remaining 1 subset was used as the validation set. The performance of the SVM classifier was evaluated on the validation set, and related performance indicators were calculated. Based on the results of the cross validation, the best features selected by the SVM were determined, and the parameters of the LR classifier were optimized later to obtain the final LSTM-DAE model for fault classification.
[0044] Beneficial effects:
[0045] The present invention inputs the pre-diagnosed fault samples into the LSTM-DAE model to confirm the fault type of the photovoltaic array. The present invention uses the LSTM-DAE network model to extract features, then uses the support vector machine SVM for feature selection, uses the logistic regression LR to optimize the model parameters, and finally uses the k-fold cross validation to complete the verification of the final model to improve the recognition accuracy of the fault type.
[0046] The present invention introduces LSTM to improve the DAE model, combines the advantages of LSTM and DAE, and uses the LSTM network as an encoder to extract the temporal characteristics of the input data. In LSTM-DAE, the encoding and decoding processes are completed by LSTM. When LSTM is used as an encoder, the output is consistent with i pv and v pv The characteristics of the samples are the same. For LSTM as a decoder, the output is the same as i pv and v pv The samples have the same length, and back propagation is used to train DAE, improve the model's feature learning ability, and mine the time series information in the original data.
[0047] The present invention applies SVM-LR hybrid classifier to output input features and optimizes model parameters to classify photovoltaic faults with different performances, uses support vector machine SVM classifier for feature selection, fits the output of SVM to logistic regression LR classifier through binomial method, and mixes SVM and LR classifiers to avoid noise that may cause low fault classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a flow chart of the photovoltaic fault diagnosis method based on LSTM-DAE of the present invention;
[0049] Figure 2 is a flow chart of photovoltaic array sampling data preprocessing of the present invention;
[0050] Figure 3 is a photovoltaic array pre-diagnosis flow chart of the present invention;
[0051] Figure 4 It is the block diagram of the LSTM-DAE model of the present invention;
[0052] Figure 5 It is a network structure diagram of the long short-term memory network LSTM of the present invention;
[0053] Figure 6 It is the confusion matrix corresponding to the test results of the present invention under the LSTM-DAE and SVM-LR classifier simulation 5×5 photovoltaic array grid-connected mode;
[0054] Figure 7It is a loss curve graph of the LSTM-DAE model training and validation data set. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0056] The present invention discloses a photovoltaic array fault diagnosis method based on LSTM-DAE. The whole method flow chart is as follows: Figure 1 As shown in the figure, it specifically includes: photovoltaic data information collection and preprocessing, and pre-diagnosis of the data to determine whether there is a fault, then organize and mark the fault sample data, combine the historical non-fault sample data to make training sets and test sets; a denoising autoencoder based on a long short-term memory network is used for feature extraction, a feature alignment label training model, a hybrid classifier of support vector machine SVM and logistic regression LR, and after k-fold cross validation, the LSTM-DAE fault classification model is determined; the collected fault sample data is input into the LSTM-DAE fault classification model to determine the fault type.
[0057] This example creates a simulation environment in PSCAD / EMTDC software, simulates a 5×5 photovoltaic module array in grid-connected mode, and introduces fault events to create a training data set with four fault labels to generate training and test data to verify the classification algorithm. The introduced fault events include:
[0058] (1) Line-to-line faults: Two-phase interphase faults with mismatch levels of 20%, 60%, and 100% are created. Interphase faults of all cross-string combinations, such as 1-2, 1-3, 1-4, 1-5, and 2-3, are also considered to prepare the initial data set.
[0059] (2) Ground fault LG: Create two-phase ground faults with mismatch levels of 20%, 60%, and 100%.
[0060] (3) Open circuit fault OC: Similar to the ten fault combinations of the above two-phase fault.
[0061] (4) Shade PSC: The shadow of the photovoltaic module panels in a single string.
[0062] The test data set was tested in the temperature range of -1℃ to 40℃ at 25W / m 2 For a data collection interval, from 150W / m 2Up to 1000W / m 2 Within the range of solar insolation variation, the data information collected from the real-time photovoltaic array is obtained, and new faults with unlabeled data points are used to test the accuracy of the above fault classification.
[0063] Step 1: Figure 2 As shown in the preprocessing flowchart, the current i collected in the photovoltaic array is obtained. pv and voltage v pv , and pre-processing, using box plot analysis to remove abnormal values of current and voltage, smoothing the IV curve, and denoising and filtering it to reduce the impact of noise;
[0064] Step 1.1: Perform box plot analysis on the current and voltage collected in the photovoltaic array. The method to remove abnormal points is as follows: Ensure that complete IV curve data is collected, including current and voltage values under different light and temperature conditions, calculate quartiles Q1, Q2 and Q3, and calculate interquartile range IQR:
[0065] IQR=Q3-Q1
[0066] Determine the outlier limits: lower limit = Q1-1.5*IQR, upper limit = Q3+1.5*IQR. Use Python to draw a box plot of current and voltage data, analyze and determine the outliers on the box plot that exceed the upper and lower limits, and delete the outlier data points.
[0067] Step 1.2: The method for denoising the IV curve of the current and voltage after removing the abnormal points is as follows: Determine the window size of the filter as 5 and select a binomial polynomial as:
[0068] y=ax 2 +bx+c
[0069] Where y is the fitted value, x is the original data point, and a, b, and c are the coefficients of the polynomial, which are used to determine the weights of the quadratic term, the linear term, and the constant term.
[0070] A Savitzky-Golay filter is used to smooth each data point on the IV curve. The filter performs local polynomial fitting on the data points and then replaces the original data points with the corresponding points on the fitting curve to obtain a smoothed IV curve.
[0071] Step 2: If Figure 3 Pre-diagnosis flow chart, draw the pre-processed IV curve, perform fault pre-diagnosis, and detect the i at its maximum power point pv and v pv , calculate and determine whether the power at the point exceeds the fault warning threshold. If it exceeds the threshold, it is judged as a fault and a fault sample data set is created.
[0072] The IV curve measured under standard test conditions STC is determined as the reference curve, and then the IV curve under actual working conditions after preprocessing is used to calculate the maximum power points of the measured curve and the reference curve, that is, the points with the maximum power in the curve.
[0073] Calculate the deviation between the measured maximum power point MPP and the reference MPP to see whether the deviation exceeds the warning threshold. If it exceeds the threshold, it is judged that there is a fault in the photovoltaic array. The deviation judgment conditions are as follows:
[0074]
[0075] In the formula, α is the maximum power point deviation, Pmax1 is the reference curve MPP, and Pmax2 is the measured curve MPP. It is necessary to determine whether the sample data has a fault through judgment conditions. The judgment conditions are as follows:
[0076] α>λ
[0077] Wherein, λ is the fault warning threshold, and according to the situation of the photovoltaic module, the value is λ = 5%; if the above conditions are met, it is judged that the sample data has a fault, and the curve to be diagnosed is output; if not, it is judged that no fault has occurred, and the calculation of the pre-diagnosis step of the next set of sample data is returned, and the above operation is repeated.
[0078] Step 3: Label the fault data samples and make them into training sets and test sets; extract features of the fault samples using the fault classification model constructed by the denoising autoencoder based on the long short-term memory network, align the extracted features with the labels, and train the denoising autoencoder LSTM-DAE model based on the long short-term memory network, such as Figure 4 The LSTM-DAE network structure model diagram is shown in the figure; the model is adjusted by feature selection of Hybrid Support Vector Machine (SVM) and parameter optimization of Logistic Regression (LR), and then k-fold cross validation is performed to obtain a trained fault classification model.
[0079] Step 3.1: The ipv and vpv at the maximum power point (MPP) under different solar insolation (G) and temperature (T) levels are used as extended input features. Combining the respective advantages of LSTM and DAE, the architecture of denoising autoencoder based on long short-term memory network LSTM-DAE is used for automatic feature extraction.
[0080] In order to improve the feature learning ability of the model and mine the time series information in the original data, LSTM is introduced to improve the DAE model. The three gate structures of "forget gate", "input gate" and "output gate" in LSTM interact in a special way to form its unique network structure, such as Figure 1 As shown, where x t-1 、x t 、x t+1 represents the input of LSTM, h t-1 、h t 、h t+1 represents the output of LSTM; σ and tanh represent the Sigmoid activation function and the tanh activation function respectively; It means element-wise multiplication between vectors. Represents element-wise addition of vectors. Figure 5 The LSTM structure uses an LSTM network as an encoder to extract the temporal features of the input data. In addition, the LSTM network is used as a decoder to reconstruct the encoder input. The encoder and decoder are connected through a fully connected layer. The output of the encoder is used as the input of the decoder. The output of the decoder is compared with the original input to calculate the reconstruction error. During the training process, the back propagation algorithm is used to minimize the reconstruction error to train the model parameters. The loss function is the mean square error of the reconstruction error. In LSTM-DAE, both the encoding and decoding processes are completed by LSTM. When LSTM is used as an encoder, the output is the same as i pv and v pv The characteristics of the samples are the same. For LSTM as a decoder, the output is the same as i pv and v pv The samples are of the same length.
[0081] The encoder uses a nonlinear deterministic mapping function given by t The transformation is given by the hidden feature representation y t
[0082] y t =ρ(W t X t +B)
[0083] Where ρ is the activation function, W is the weight matrix between hidden layers, y is the output, and B is the bias. t is represented by the continuous updating of W and B by mini-batch stochastic gradient descent (SGD) in all hidden layers during training. Backpropagation is used to train the DAE. The input X t The representation will produce Similar output, the formula is given below:
[0084]
[0085] In the formula, X t is the tth input sample, is the reconstructed sample corresponding to the input.
[0086] In this implementation, the specific network structure of the denoising autoencoder based on the long short-term memory network includes:
[0087] Gaussian noise layer, Gaussian noise is introduced into the preprocessed data, and the standard deviation of the noise distribution is set to 0.1; LSTM modules are used to build LSTM autoencoder networks, with 3 encoders and 3 decoders; the small batch stochastic gradient descent optimization algorithm is used to update the weights; ReLU is used as the activation function. The learning rate of the LSTM-DAE network model is set to 0.0001, the batch size is 16, and the number of epochs is 100.
[0088] Step 3.2: Apply the SVM-LR hybrid classifier to output input features and optimize model parameters to classify photovoltaic faults with different performance. Use the support vector machine SVM classifier for feature selection, perform a ten-fold cross validation on the SVM classifier, evaluate its performance indicators, fit the SVM output to the logistic regression LR classifier through the binomial method, train the LR classifier to optimize the model performance parameters, and finally determine the fault type. The specific steps include:
[0089] SVM is a widely used machine learning method. Due to the use of kernels, it has shown better results in solving complex classification problems. LR is also an excellent classifier due to its ability to solve classification problems linearly. LR has a fast response speed and is simple to implement. However, when dealing with a small amount of random photovoltaic array data and semi-supervised learning, the data set used for training may be unbalanced. In order to avoid this situation, the two classifiers SVM and LR are mixed to avoid noise that may lead to low fault classification accuracy.
[0090] The structure of the SVM classifier is combined with the same number of LSTM-DAE output data samples. The SVM model is trained and validated by k-fold cross validation and finally merged with the LR classifier. The binomial method is used to fit the selected variables in the SVM to the LR classifier, and the Gaussian kernel with the highest accuracy is selected as the kernel of the SVM.
[0091] The SVM classifier is used for feature selection. Due to the use of kernel techniques, it has a good effect in selecting useful features. SVM uses a fine Gaussian kernel, and its mathematical expression is as follows:
[0092] K(x,y)=exp(-γx-y 2 )
[0093] In the formula, x and y are two vectors in the original feature space; γ is the parameter of the Gaussian kernel, which controls the complexity of the feature mapping; ||xy|| is the square of the Euclidean distance between vectors x and y. The use of the kernel function maps points in the original feature space to a higher-dimensional feature space, allowing for more efficient selection of the optimal features.
[0094] In LSTM-DAE, both encoding and decoding are done by LSTM. When LSTM is used as an encoder, the output is the same as i pv and v pv The characteristics of the samples are the same. For LSTM as a decoder, the output is the same as i pv and v pv The samples are of the same length.
[0095] The loss function is the mean square error (MSE) of the reconstruction error, which is the average of the sum of the squares of the difference between the input and the reconstructed output. The stochastic gradient descent method is used to optimize the loss function and update the model parameters. The model is trained by 10-fold cross validation, using nine data sets as training sets and one data set as validation sets, and repeated validation ten times to ensure that the model has good generalization ability and can improve the accuracy in the case of less labeled data and more unlabeled data.
[0096] The sampling frequency is 1kHz and the i at the maximum power point is recorded. pv and v pv Sample, after the LSTM-DAE model is trained, the previously measured i pv and v pv Import data information and perform feature extraction.
[0097] Step 3.2.1: Use the SVM classifier for feature selection. Due to the use of kernel techniques, it has a good effect in selecting useful features. The kernel technique of SVM allows it to handle nonlinear problems and select features that are most capable of distinguishing different categories of features.
[0098] Step 3.2.2: Perform 10-fold cross validation on the SVM classifier to screen and determine the best features selected by the SVM. Use the SVM classifier to perform feature selection on the original features. In each iteration, use 9 training subsets to train the SVM, and use the remaining 1 subset as the validation set. Evaluate the performance of the SVM classifier on the validation set and calculate relevant performance indicators. Based on the results of cross validation, determine the best features selected by the SVM to prepare for the subsequent LR classifier.
[0099] Step 3.2.3: According to the results of cross-validation, the features filtered by the SVM classifier are fitted into the LR classifier using the binomial method and trained. The performance of the LR classifier is evaluated using the validation set, and the parameters of the LR classifier are adjusted and optimized.
[0100] The logistic regression LR model relates multiple predictor variables to a binomial target variable. It uses a linear function as input to another function, as shown in the following formula:
[0101] h θ (x) = g(θ T x)0≤h θ ≤1
[0102] In the following formula, g(x) is the logistic or sigmoid function:
[0103]
[0104] The following gradient descent equation explains the loss optimization:
[0105]
[0106] In the following formula, J(θ) is the loss function:
[0107]
[0108] Where m is the input sample, h is the weight, and y is the output.
[0109] This embodiment builds a LSTM-DAE-SVM-LR model, which has relatively good verification results, as shown in Table 1. It can be seen from the table that the method proposed in this article achieves an accuracy rate of 99% with the support of a fine Gaussian kernel, indicating that the method has a relatively high accuracy rate and high precision.
[0110] Table 1 Comparison between a machine learning method and the method of this embodiment
[0111]
[0112]
[0113] from Figure 6 and Figure 7 It can be seen that the loss curve has a relatively good effect during training, and the confusion matrix summarizes the performance of the classification method in predicting a specific label. From the figure, it can be seen that in the simulation environment, the proposed algorithm is able to achieve 100% classification accuracy.
[0114] In summary, the photovoltaic fault classification method based on LSTM-DAE proposed in the present invention utilizes a small amount of labeled data and a large amount of unlabeled data, reducing the dependence on a large amount of labeled data, making the method more suitable for actual photovoltaic scenarios.
[0115] Finally, it should be noted that the method steps described in the embodiments disclosed in the present invention can be configured to build a programming environment for implementation. Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A photovoltaic array fault diagnosis method based on LSTM-DAE, characterized in that: The steps include: S1: Obtain the current and voltage collected from the photovoltaic array, perform preprocessing, use box plot analysis to remove abnormal values of current and voltage, smooth the IV curve, perform denoising and filtering, and reduce the impact of noise; S2: Draw the pre-processed IV curve, perform fault pre-diagnosis, and detect the i at the maximum power point pv and v pv , calculate and determine whether the power at the point exceeds the fault warning threshold. If it exceeds the threshold, it is judged as a fault and a fault sample data set is prepared; S3: Label the fault sample data set and make it into training set and test set; use the LSTM-DAE fault classification model constructed by denoising autoencoder based on long short-term memory network to extract features of fault samples, align the extracted features with labels, and train the LSTM-DAE fault classification model; adjust the model through feature selection of support vector machine SVM and parameter optimization of logistic regression LR, and then perform k-fold cross validation to obtain the trained fault classification model; S4: Input the pre-diagnosed fault samples into the LSTM-DAE model to confirm the fault type of the PV array.
2. The photovoltaic array fault diagnosis method based on LSTM-DAE according to claim 1 is characterized in that: The S1 pre-processes the photovoltaic array data, specifically: obtaining the current and voltage collected in the photovoltaic array, analyzing the current and voltage with a box plot, and performing IV curve smoothing and denoising filtering: S1.1: The method for removing abnormal points by box plot analysis of the current and voltage collected in the photovoltaic array is as follows: Ensure that complete IV curve data is collected, including current and voltage values under different light and temperature conditions, calculate quartiles Q1, Q2 and Q3, and calculate the interquartile range IQR: IQR=Q3-Q1 Determine the outlier limits: lower limit = Q1-1.5*IQR, upper limit = Q3+1.5*IQR, use Python to draw a box plot of current and voltage data, analyze and determine the outliers on the box plot that exceed the upper and lower limits, and delete the outlier data points; S1.2: The method for denoising the IV curve of the current and voltage after removing the abnormal points is as follows: determine the window size of the filter to be 5, and select a binomial polynomial as: y=ax 2 +bx+c Where y is the fitted value, x is the original data point, and a, b, and c are the coefficients of the polynomial, which are used to determine the weights of the quadratic term, the linear term, and the constant term; A Savitzky-Golay filter is used to smooth each data point on the IV curve. The filter performs local polynomial fitting on the data points and then replaces the original data points with the corresponding points on the fitting curve to obtain a smoothed IV curve.
3. The photovoltaic array fault diagnosis method based on LSTM-DAE according to claim 1 is characterized in that: The method of drawing the pre-processed IV curve and performing fault pre-diagnosis on it is specifically as follows: The IV curve measured under the standard test condition STC is determined as the reference curve, and then the IV curve under the actual working condition after the previous preprocessing is used to calculate the maximum power point of the measured curve and the reference curve, that is, the point with the maximum power in the curve; Calculate the deviation between the measured maximum power point MPP and the reference MPP, and determine whether the deviation exceeds the warning threshold. If it exceeds the threshold, it is determined that there is a fault in the photovoltaic array. The deviation judgment conditions are as follows: Wherein, Pmax1 is the reference curve MPP, Pmax2 is the measured curve MPP, and λ is the fault warning threshold, which is taken as λ=5% according to the situation of the photovoltaic module.
4. The photovoltaic array fault diagnosis method based on LSTM-DAE according to claim 1 is characterized in that: The S3 method of the fault classification model based on LSTM-DAE is specifically as follows: At different levels of solar insolation G and temperature T, the maximum power point MPP pv and v pv It is used as an extended input feature, and the architecture of denoising autoencoder based on long short-term memory network LSTM-DAE is used for automatic feature extraction; The LSTM network is used as an encoder to extract the temporal features of the input data, and the LSTM network is also used as a decoder to reconstruct the encoder input. The encoder and decoder are connected through a fully connected layer, and the output of the encoder is used as the input of the decoder. The output of the decoder is compared with the original input to calculate the reconstruction error. During the training process, the back propagation algorithm is used to minimize the reconstruction error to train the model parameters. The loss function is the mean square error of the reconstruction error; In LSTM-DAE, both encoding and decoding are done by LSTM. When LSTM is used as an encoder, the output is the same as i pv and v pv The characteristics of the samples are the same. For LSTM as a decoder, the output is the same as i pv and v pv The samples are of the same length; The encoder uses a nonlinear deterministic mapping function given by t The transformation is given by the hidden feature representation y t : y t =ρ(W t X t +B) Where ρ is the activation function, W is the matrix between the weight hidden layers, y is the output, and B is the bias; X t is represented by the continuous updating of W and B by mini-batch stochastic gradient descent (SGD) in all hidden layers during training. Backpropagation is used to train the DAE. The input X t The representation will produce Similar output, the formula is given below: In the formula, X t is the tth input sample, is the reconstructed sample corresponding to the input.
5. The photovoltaic array fault diagnosis method based on LSTM-DAE according to claim 4 is characterized in that: The specific network structure of the denoising autoencoder based on the long short-term memory network includes: Gaussian noise layer, introduces Gaussian noise into the preprocessed data, and the standard deviation of the noise distribution is set to 0.1; use LSTM modules to build an LSTM autoencoder network, with 3 encoders and 3 decoders; use a small batch stochastic gradient descent optimization algorithm to update the weights; use ReLU as the activation function; set the learning rate of the LSTM-DAE network model to 0.0001, the batch size to 16, and the number of epochs to 100.
6. The photovoltaic array fault diagnosis method based on LSTM-DAE according to claim 4 or 5, characterized in that: The model is adjusted through feature selection of support vector machine (SVM) and parameter optimization of logistic regression (LR), and then k-fold cross validation is performed, as follows: The structure of the SVM classifier was combined with the same number of LSTM-DAE output data samples. The SVM model was trained and validated by k-fold cross validation and finally merged with the LR classifier. The binomial method was used to fit the selected variables in the SVM to the LR classifier. The Gaussian kernel with the highest accuracy was selected as the kernel of the SVM. The SVM classifier is used for feature selection. Due to the use of kernel techniques, it has a good effect in selecting useful features. SVM uses a fine Gaussian kernel, and its mathematical expression is as follows: K(x,y)=exp(-γx-y 2 ) Where x and y are two vectors in the original feature space; γ is the parameter of the Gaussian kernel, which controls the complexity of the feature mapping; ||xy|| is the square of the Euclidean distance between vectors x and y; Perform ten-fold cross validation on the SVM classifier to screen and determine the best features selected by the SVM, and use the SVM classifier to perform feature selection on the original features; In each iteration, 9 training subsets are used to train the SVM, and the remaining 1 subset is used as the validation set. The performance of the SVM classifier is evaluated on the validation set, and the relevant performance indicators are calculated. Based on the results of cross-validation, the best features selected by the SVM are determined, and the parameters of the LR classifier are optimized later to obtain the final LSTM-DAE model for fault classification.
Citation Information
Patent Citations
Photovoltaic power generation array fault diagnosis and classification method based on sparse representation and SVM
CN109672406A
Photovoltaic array fault diagnosis method based on integrated learning
CN113221468A
Flywheel fault identification method based on LSTM deep noise reduction auto-encoder
CN113850161A
Photovoltaic array fault detection method and device and electronic equipment
CN115630563A
Classification method based on feature selection and model combination optimization
CN115795361A
Cited By
Intelligent fault diagnosis method and device for heat exchange module
CN120144984A