Photovoltaic fault detection method based on CNN-LSTM hybrid neural network
Through the photovoltaic fault detection method based on CNN-LSTM hybrid neural network, the problem that the existing technology is difficult to monitor and locate internal faults in photovoltaic power stations in real time is solved, and the precise positioning and classification of faults is achieved, and the detection accuracy and operation and maintenance efficiency are improved.
Patent Information
- Application Number
- CN202411657380.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-18
AI Technical Summary
Existing photovoltaic fault detection technologies are difficult to monitor and locate internal faults in large photovoltaic power plants in real time, such as aging, short circuit, open circuit, etc., and the lack of data affects the detection accuracy.
The photovoltaic fault detection method based on CNN-LSTM hybrid neural network is adopted, and the power generation and meteorological data are collected through the inverter device, and the fault detection model is constructed after preprocessing. The focus loss function is used to deal with the category imbalance problem, and fault detection and classification are realized.
This method can achieve accurate positioning and classification of photovoltaic power station faults, reduce operation and maintenance costs, improve detection accuracy, and reduce the possibility of missed inspection and missed inspection.
Smart Images

Figure CN119646648A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of photovoltaic fault detection, and in particular relates to a photovoltaic fault detection method based on a CNN-LSTM hybrid neural network. Background Art
[0002] In recent years, the cost of photovoltaic cells has been greatly reduced, the photovoltaic industry has developed rapidly, and the installed capacity of photovoltaic power stations has continued to grow. Large photovoltaic power stations have a large number of components and complex structures. The operation of the power station is generally carried out without supervision. It is very difficult to detect and maintain the power stations that are widely distributed in the region. At the same time, factors such as the harsh environment have caused frequent power station failures. If the fault cannot be eliminated in time, the operating efficiency of the power station affected by the fault will be greatly reduced, and it may even seriously affect the safe operation of the photovoltaic power station. Therefore, it is very important to monitor the operating status of the photovoltaic array in real time and to detect and locate the fault in time for the safe operation of the photovoltaic power station.
[0003] The closest existing technology:
[0004] Photovoltaic fault detection mainly uses drone inspection technology, manual inspection, sensor installation and other technologies. Drone inspection technology uses the image information of photovoltaic modules to identify hot spots, thereby determining the size and location of the hot spots of photovoltaic modules. This technology is limited to detecting single hot spot faults and is difficult to detect internal faults such as general aging, short circuit, open circuit, communication, power restriction, etc. For large ground power stations, manual troubleshooting is difficult and consumes a lot of manpower and material resources.
[0005] In photovoltaic power generation data, outliers (such as sensor failure, sudden weather changes, etc.) and missing values (such as communication failure, equipment maintenance, etc.) will affect the training and prediction accuracy of the model. The problem of missing data affects the final detection accuracy. Direct deletion involves deleting all rows containing missing values and using only fully measured data. However, when there is a large amount of missing data, this data processing method can lead to significant information loss, which has an adverse effect on subsequent analysis. Linear interpolation involves replacing missing values with nearby data points. It is often used when missing data must be interpolated within a short time interval, and the interpolation performance decreases as the length of continuous missing data increases. The GAIN network can generate data similar to the missing data through adversarial training, which can improve subsequent detection accuracy.
[0006] Data collection and analysis at the string level can locate the fault type and location more precisely. Compared with overall system fault detection, string-level diagnosis can identify specific areas and fault types, thereby accurately locating and quickly handling faults, reducing the possibility of missed detection and false detection. Summary of the invention
[0007] In view of the problems existing in the prior art, the present invention provides a photovoltaic fault detection method based on a CNN-LSTM hybrid neural network.
[0008] The photovoltaic fault detection method based on the CNN-LSTM hybrid neural network specifically includes the following steps:
[0009] Step 1: Collect the power generation data of the electric field through the inverter device, and obtain the meteorological data of the power station including wind speed, air pressure, radiation, temperature, relative humidity, etc.
[0010] Step 2: Preprocess the collected data by first normalizing it and then processing missing values and outliers.
[0011] Step 3: Build a fault detection neural network model.
[0012] Step 4: Input data into the model, execute multiple epochs of training cycles, and output fault detection results.
[0013] In step 5, the focal loss function is used as the loss function of the model to deal with the category imbalance problem, calculate the category probability of each sample, and calculate the loss value of the sample based on the probability.
[0014] In step 6, the model’s performance is evaluated on the validation dataset using the saved best performing model weights to verify its accuracy in fault detection and classification.
[0015] Furthermore, the step 1 comprises the following steps:
[0016] Step 1.1, collect the power generation data in units of ten minutes, and save it in a CSV format file together with meteorological data such as wind speed, air pressure, and irradiance.
[0017] In step 1.2, each sample includes seven types of labels, including aging, occlusion, short circuit, open circuit, power limit, hot spot, and normal state.
[0018] Step 1.3, represent the input data as a two-dimensional matrix, where each row represents the data at a time point and each column represents different types of data.
[0019] Among them, N represents the number of samples and d represents the number of features.
[0020] Step 2.1: Use principal component analysis (PCA) to remove abnormal data from the stored data. First, normalize the data and scale the data to the range of [0,1].
[0021]
[0022] The normalized matrix X′ is expressed as:
[0023] Calculate the covariance matrix C of the normalized matrix X′:
[0024] Find the eigenvectors and eigenvalues of the covariance matrix C, and select the eigenvectors corresponding to the largest k eigenvalues.
[0025] Map X′ to the new feature space: Z = X′W k .
[0026] Among them, W k is the eigenvector of the first k principal components, and Z is the data after dimensionality reduction.
[0027] Project the reduced-dimensional data Z into the original space to reconstruct the data: The reconstruction error is calculated using the Euclidean distance between the original data and the reconstructed data: E = ‖X′-X″‖ 2 .
[0028] Calculate the mean μ of the reconstruction error E With standard deviation σ E , set the threshold: T = μ E +α·σ E , where α is a multiple of the control threshold (2 or 3). If E>T, the sample is considered an outlier.
[0029] Step 2.2, introduce the data set Y after removing outliers, and use the mask matrix M to represent missing values. First, use methods such as data mean to perform preliminary filling to generate a data set Then generate a noise matrix Z with the same shape as Y, and then fill it with the initial data The mask matrix M is input into the generator to generate the padding data
[0030] Step 2.3, fill in the data The original mask matrix M is input to the discriminator, and a probability matrix P is output. This matrix is used to represent the probability that the data point is real data. Its main purpose is to help the discriminator distinguish between real data and data generated by the generator, and provide feedback to the generator so that the generator can gradually generate more realistic filled data.
[0031] Step 2.4, the purpose is to make the generator loss function L 1 To achieve the minimum, the discriminator loss function L 2 to the maximum.
[0032] The above loss function is as follows:
[0033] According to step 3 of claim 1, step 3.1, the fault detection model is composed of a convolutional layer, a long short-term memory network, and a fully connected layer, which is used to process time series data and perform classification prediction. The fault detection module ultimately outputs a specific fault type (such as aging, occlusion, short circuit, open circuit, power shortage, hot spot) and a normal state.
[0034] In step 3.2, the preprocessed data is input into the neural network, and the spatial features are first extracted through the convolution layer. The diversity of features is enhanced through the channel rearrangement mechanism to ensure that the features of different categories are fully expressed.
[0035] In step 3.3, the extracted spatial features are passed to the LSTM layer. LSTM captures historical dependencies and trends based on the time series data to form a feature vector representing the time dependency. The hidden state of the LSTM layer records the important features in the time series and provides time information support for the final classification.
[0036] In step 3.4, the feature vector output by the LSTM layer is passed to the fully connected layer. The fully connected layer maps the feature vector to each category and generates the score (logits) for each category.
[0037] In step 3.5, the output of the fully connected layer passes through the Softmax layer to convert the score into the probability of each fault category. The category corresponding to the highest probability is selected as the final fault type prediction result.
[0038] Step 4.1, forward propagate the input data in batches to the model to obtain the predicted output; calculate the focal loss between the predicted output and the true label; backpropagate according to the loss value and update the model weights using the Adam optimization algorithm; monitor and record the accuracy on the validation set, and save the model weights that perform best on the validation set.
[0039] Step 5.1: Since the distribution and quantity of faults are different, the quantity of each type of fault data in the data set collected by the present invention is quite different. Therefore, the Focal Loss function is used to process the unbalanced data set.
[0040] The basic formula of Focal Loss is: FL(p t )=-α t (1-p t ) γ log(p t )
[0041] In the formula, p tis the model’s predicted probability for the correct category, α t is the balancing factor and γ is the adjustment factor.
[0042] Step 6.1: For a relatively balanced dataset, use accuracy to evaluate the model. For an unbalanced dataset, use precision, recall, F1 score, etc. to evaluate the model.
[0043] Through the label of each string in the data set, the model can accurately locate the name of each string and the corresponding fault type, thereby effectively reducing the difficulty of operation and maintenance and manual troubleshooting. This method can accurately locate and classify the fault location, greatly improve operation and maintenance efficiency, and reduce maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is the workflow diagram for photovoltaic fault detection.
[0045] Figure 2 Training flow chart of fault detection model.
[0046] Figure 3 This is a diagram of the fault detection neural network model of the invention. DETAILED DESCRIPTION
[0047] The photovoltaic fault detection method based on the CNN-LSTM hybrid neural network specifically includes the following steps:
[0048] Step 1: Collect the power generation data of the electric field through the inverter device, and obtain the meteorological data of the power station including wind speed, air pressure, radiation, temperature, relative humidity, etc.
[0049] Step 2: Preprocess the collected data by first normalizing it and then processing missing values and outliers.
[0050] Step 3: Build a fault detection neural network model.
[0051] Step 4: Input data into the model, execute multiple epochs of training cycles, and output fault detection results.
[0052] In step 5, the focal loss function is used as the loss function of the model to deal with the category imbalance problem, calculate the category probability of each sample, and calculate the loss value of the sample based on the probability.
[0053] In step 6, the model’s performance is evaluated on the validation dataset using the saved best performing model weights to verify its accuracy in fault detection and classification.
[0054] Furthermore, the step 1 comprises the following steps:
[0055] Step 1.1, collect power generation data in units of ten minutes, and save meteorological data such as wind speed, air pressure, and irradiance in a CSV format file.
[0056] In step 1.2, each sample includes seven types of labels, including aging, occlusion, short circuit, open circuit, power limit, hot spot, and normal state.
[0057] Step 1.3, represent the input data as a two-dimensional matrix, where each row represents the data at a time point and each column represents different types of meteorological data.
[0058] Among them, N represents the number of samples and d represents the number of features.
[0059] Step 2.1: Use principal component analysis (PCA) to remove abnormal data from the stored data. First, normalize the data and scale the data to the range of [0,1].
[0060]
[0061] The normalized matrix X′ is expressed as:
[0062] Calculate the covariance matrix C of the normalized matrix X′:
[0063] Find the eigenvectors and eigenvalues of the covariance matrix C, and select the eigenvectors corresponding to the largest k eigenvalues.
[0064] Map X′ to the new feature space: Z = X′W k .
[0065] Among them, W k is the eigenvector of the first k principal components, and Z is the data after dimensionality reduction.
[0066] Project the reduced-dimensional data Z into the original space to reconstruct the data: The reconstruction error is calculated using the Euclidean distance between the original data and the reconstructed data: E = ‖X′-X″‖ 2 .
[0067] Calculate the mean μ of the reconstruction error E With standard deviation σ E , set the threshold: T = μ E +α·σ E , where α is a multiple of the control threshold (2 or 3). If E>T, the sample is considered an outlier.
[0068] Step 2.2, introduce the data set Y after removing outliers, and use the mask matrix M to represent missing values. First, use methods such as data mean to perform preliminary filling to generate a data set Then generate a noise matrix Z with the same shape as Y, and then fill it with the initial data The mask matrix M is input into the generator to generate the padding data
[0069] Step 2.3, fill in the data The original mask matrix M is input to the discriminator, and a probability matrix P is output. This matrix is used to represent the probability that the data point is real data. Its main purpose is to help the discriminator distinguish between real data and data generated by the generator, and provide feedback to the generator so that the generator can gradually generate more realistic filled data.
[0070] Step 2.4, the purpose is to make the generator loss function L 1 To achieve the minimum, the discriminator loss function L 2 to the maximum.
[0071] The above loss function is as follows:
[0072] According to step 3 of claim 1, step 3.1, the fault detection model is composed of a convolutional layer, a long short-term memory network, and a fully connected layer, which is used to process time series data and perform classification prediction. The fault detection module ultimately outputs a specific fault type (such as aging, occlusion, short circuit, open circuit, power shortage, hot spot) and a normal state.
[0073] In step 3.2, the preprocessed data is input into the neural network, and the spatial features are first extracted through the convolution layer. The diversity of features is enhanced through the channel rearrangement mechanism to ensure that the features of different categories are fully expressed.
[0074] In step 3.3, the extracted spatial features are passed to the LSTM layer. LSTM captures historical dependencies and trends based on the time series data to form a feature vector representing the time dependency. The hidden state of the LSTM layer records the important features in the time series and provides time information support for the final classification.
[0075] In step 3.4, the feature vector output by the LSTM layer is passed to the fully connected layer. The fully connected layer maps the feature vector to each category and generates the score (logits) for each category.
[0076] In step 3.5, the output of the fully connected layer passes through the Softmax layer to convert the score into the probability of each fault category. The category corresponding to the highest probability is selected as the final fault type prediction result.
[0077] Step 4.1, forward propagate the input data in batches to the model to obtain the predicted output; calculate the focal loss between the predicted output and the true label; backpropagate according to the loss value and update the model weights using the Adam optimization algorithm; monitor and record the accuracy on the validation set, and save the model weights that perform best on the validation set.
[0078] Step 5.1: Since the distribution and quantity of faults are different, the quantity of each type of fault data in the data set collected by the present invention is quite different. Therefore, the Focal Loss function is used to process the unbalanced data set.
[0079] The basic formula of Focal Loss is: FL(p t )=-α t (1-p t ) γ log(p t )
[0080] In the formula, p t is the model's predicted probability for the correct category, α t is the balancing factor and γ is the adjustment factor.
[0081] Step 6.1: For a relatively balanced dataset, use accuracy to evaluate the model. For an unbalanced dataset, use precision, recall, F1 score, etc. to evaluate the model.
[0082] Through the label of each string in the data set, the model can accurately locate the name of each string and the corresponding fault type, thereby effectively reducing the difficulty of operation and maintenance and manual troubleshooting. This method can accurately locate and classify the fault location, greatly improve operation and maintenance efficiency, and reduce maintenance costs.
Claims
1. The photovoltaic fault detection method based on the CNN-LSTM hybrid neural network specifically includes the following steps: Step 1: Collect the power generation data of the electric field through the inverter device, and obtain the meteorological data of the power station including wind speed, air pressure, radiation, temperature, relative humidity, etc. Step 2: Preprocess the collected data by first normalizing it and then processing missing values and outliers. Step 3: Build a fault detection neural network model. Step 4: Input data into the model, execute multiple epochs of training cycles, and output fault detection results. In step 5, the focal loss function is used as the loss function of the model to deal with the category imbalance problem, calculate the category probability of each sample, and calculate the loss value of the sample based on the probability. In step 6, the model’s performance is evaluated on the validation dataset using the saved best performing model weights to verify its accuracy in fault detection and classification.
2. According to step 2 of claim 1, step 2.1, the stored data is subjected to abnormal data detection using principal component analysis (PCA). After the outliers are removed, some data are missing. In addition, the experimental data required by the present invention are all collected by the inverter device. Since the device may be in a non-working state for a short period of time, some data are missing. Therefore, a generative adversarial input network (GAIN) is used to process the missing values. The GAIN network fills the missing values in the data through adversarial training of the generator and the discriminator. Step 2.2, introduce the data set Y after removing outliers, and use the mask matrix M to represent missing values. First, use methods such as data mean to perform preliminary filling to generate a data set Then generate a noise matrix Z with the same shape as Y, and then fill it with the initial data The mask matrix M is input into the generator to generate the padding data Step 2.3, fill in the data The original mask matrix M is input to the discriminator, and a probability matrix P is output. This matrix is used to represent the probability that the data point is real data. Its main purpose is to help the discriminator distinguish between real data and data generated by the generator, and provide feedback to the generator so that the generator can gradually generate more realistic filled data. Step 2.4 aims to minimize the generator loss function L1 and maximize the discriminator loss function L2. The loss function is as follows:
3. According to step 3 of claim 1, step 3.1, the fault detection model is composed of a convolutional layer, a long short-term memory network, and a fully connected layer. The fault detection module ultimately outputs a specific fault type (such as aging, occlusion, short circuit, open circuit, power shortage, hot spot) and a normal state. In step 3.2, the preprocessed data is input into the neural network, and the spatial features are first extracted through the convolution layer. The diversity of features is enhanced through the channel rearrangement mechanism to ensure that the features of different categories are fully expressed. In step 3.3, the extracted spatial features are passed to the LSTM layer. LSTM captures historical dependencies and trends based on the time series data to form a feature vector representing the time dependency. The hidden state of the LSTM layer records the important features in the time series and provides time information support for the final classification. In step 3.4, the feature vector output by the LSTM layer is passed to the fully connected layer. The fully connected layer maps the feature vector to each category and generates the score (logits) for each category. In step 3.5, the output of the fully connected layer passes through the Softmax layer to convert the score into the probability of each fault category. The category corresponding to the highest probability is selected as the final fault type prediction result.
4. Each period in step 4 according to claim 1 comprises the following steps: Forward propagate the input data in batches to the model to obtain the predicted output; Calculate the focal loss between the predicted output and the true label; backpropagate the loss value and update the model weights using the Adam optimization algorithm; monitor and record the accuracy on the validation set, and save the model weights that perform best on the validation set.
5. According to step 5 of claim 1, in the data set collected by the present invention, the quantity of each type of fault data is quite different. Therefore, the Focal Loss function is used to process the unbalanced data set. The basic formula of Focal Loss is: FL(p t )=-a t (1-p t ) γ log(p t ) In the formula, p t is the model's predicted probability for the correct category, α t is the balancing factor and γ is the adjustment factor.
6. According to step 6 of claim 1, for a relatively balanced dataset, the accuracy is used to evaluate the model. For an unbalanced dataset, the precision, recall, F1 score, etc. are used to evaluate the model.
7. Through the label of each string in the data set, the model can accurately locate the name of each string and the corresponding fault type, thereby effectively reducing the difficulty of operation and maintenance and manual troubleshooting. This method can accurately locate and classify the fault location, greatly improve operation and maintenance efficiency, and reduce maintenance costs.
Citation Information
Cited By
Generative countermeasure simulation and early warning method for hot spots of photovoltaic backboard
CN120411639A
A Simulation and Early Warning Method for the Generation of Hot Spots on Photovoltaic Backsheets
CN120411639B
Temperature image sequence defect identification method for infrared nondestructive testing system
CN120525810A
A photovoltaic inverter input string fault tracing and attenuation monitoring method and system
CN122527964A