Photovoltaic fault diagnosis method based on mRMR and PO-LightGBM
The mRMR algorithm is used to screen the fault characteristics of the photovoltaic array and optimize the hyperparameters in combination with the PO-LightGBM model, which solves the problem of ignoring redundancy and correlation in the feature selection in the existing technology, and achieves high accuracy and high efficiency photovoltaic fault diagnosis.
Patent Information
- Application Number
- CN202411684557.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-25
AI Technical Summary
The existing photovoltaic array fault diagnosis methods ignore the redundancy and correlation problems between fault features during the feature selection process, resulting in a degradation of model performance and reduced computing efficiency.
The mRMR algorithm is used for feature selection, and the feature set with the greatest correlation with the target variable and the least redundancy is selected through the incremental search method. The hyperparameters are optimized in combination with the PO-LightGBM model to establish an efficient photovoltaic fault diagnosis model.
It significantly improves the accuracy of photovoltaic fault diagnosis, reduces the complexity and computing burden of the model, and improves the accuracy and comprehensive performance of fault identification.
Smart Images

Figure CN119692169A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of photovoltaic array fault diagnosis, and in particular to a photovoltaic fault diagnosis method based on mRMR and PO-LightGBM. Background Art
[0002] In recent years, with the consumption of fossil energy and the serious environmental pollution problems it has brought, photovoltaic power generation has been widely used due to its huge installed capacity, pollution-free, small geographical restrictions, and flexible installation. However, since photovoltaic arrays work for a long time in complex outdoor environments, components are prone to open circuit, short circuit, aging, partial shading and other faults. Therefore, in order to ensure the long-term and excellent development of photovoltaic power generation, it is urgent to study fast and accurate photovoltaic array fault diagnosis methods.
[0003] At present, the commonly used fault array diagnosis methods include circuit structure method, infrared image method, mathematical model method and intelligent diagnosis method. The circuit structure method is to complete fault diagnosis and location by changing the connection mode of the circuit structure and combining the changes in parameters such as voltage and current of the circuit in the photovoltaic system. This method requires the use of sensors to monitor these parameters in real time, which increases the cost and complexity of system installation. The infrared image method uses the hot spot effect and uses the temperature difference between the normal and faulty photovoltaic array as the basis to collect infrared images of the photovoltaic array through a thermal imager to determine its fault phenomenon and location. This method requires the configuration of a large number of sensors and instruments, which limits its scope of use. The mathematical model method simulates and models the photovoltaic array, compares the actual operation status with the expected results of the simulation model, and performs fault diagnosis based on the differences between the models. This method has high accuracy requirements for the established simulation model, and the photovoltaic array has diverse operations and complex environmental changes, which makes modeling more difficult. The intelligent diagnosis method does not require the deployment of additional sensors and infrared cameras. Through photovoltaic data collection and the use of machine learning algorithms, different photovoltaic fault types can be quickly and accurately distinguished. In recent years, with the rapid development of artificial intelligence, it has been widely used.
[0004] However, most studies analyze the current-voltage (IV) curve or power-voltage (PV) curve of the photovoltaic system and select the electrical parameters with more obvious changes as photovoltaic fault features. In the feature selection process, the redundancy and correlation between fault features are ignored. The feature extraction of simple dependent curves may introduce redundant fault features, resulting in a decrease in model performance and reduced computational efficiency. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a photovoltaic fault diagnosis method based on mRMR and PO-LightGBM. On the one hand, based on the mRMR algorithm, an incremental search method is used to select features, and an input feature set with the maximum correlation with the target variable and the minimum redundancy between input features is selected to determine the fault feature group input into the photovoltaic array fault diagnosis model; on the other hand, by establishing a fault diagnosis model based on PO-LightGBM, the accuracy of photovoltaic fault diagnosis can be significantly improved.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0007] A photovoltaic fault diagnosis method based on mRMR and PO-LightGBM, comprising the following steps:
[0008] Step 1: Build a photovoltaic fault simulation model and extract the original fault feature group;
[0009] Step 2: Screen the original fault feature groups based on the mRMR algorithm and preliminarily select the fault feature groups that have a significant impact on the prediction effect;
[0010] Step 3: Build the PO-LightGBM model and re-screen the fault feature group in step 2 to obtain the optimal fault feature group;
[0011] Step 4: Verify the impact of the fault feature group in step 2 on the performance of the PO-LightGBM model, and analyze the alternative features U m Whether it needs to be included in the optimal fault feature group.
[0012] In the step 1, the SP structure is used to arrange the photovoltaic array, and a photovoltaic fault simulation model is built in MATLAB / Simulink; single faults and compound faults in the photovoltaic array are simulated and analyzed, and fault feature quantities are extracted according to the IU characteristic curve and the PU characteristic curve, and the fault feature quantities are combined into an original fault feature group.
[0013] Single faults include short circuit faults, open circuit faults, shadow faults and aging faults; an open circuit fault is simulated by disconnecting a branch on the photovoltaic array; a short circuit fault is simulated by short-circuiting two photovoltaic modules between photovoltaic strings; a slight aging fault and a severe aging fault are simulated by connecting a 5Ω resistor and a 15Ω resistor in series respectively; four shadow modes are selected for shadow fault analysis, and the four shadow modes are partial shading 1, partial shading 2, dirt, and dust; composite faults include short circuit shadow fault, open circuit shadow fault, aging shadow fault, short circuit aging fault, and open circuit aging fault.
[0014] In order to further distinguish abnormal aging faults, the filling factor is used as the fault diagnosis feature. When the photovoltaic array is in a shadow fault, in order to distinguish different types of shadow faults, the number of inflection points of the PU curve is introduced as the key variable. The number of inflection points is determined by analyzing the concave and convex changes of the curve to distinguish different types of shadow faults. The I oc , U oc ,I mp , U mp , P m , FF, and the number of inflection points are used as the 7-dimensional original electrical fault feature quantities.
[0015] In step 2, the mRMR algorithm uses an incremental search method to select the fault feature quantity, and the selection of the fault feature quantity specifically includes:
[0016] Step 2.1: Let the original feature set be S and the feature set to be selected be S o ; Calculate the correlation between each fault feature and the target variable, select the feature with the largest correlation as x1 and add it to the candidate feature set S o middle;
[0017] Step 2.2: Using the selected feature set S o The i-1 features selected in the i-th feature selection need to be in the remaining feature set SS i-1 According to step 2.1, select the feature S with the largest Φ value i ;
[0018]
[0019] Where: x i represents a variable in the feature set to be selected, c represents the fault sample category, x j Represents a variable in the selected feature set;
[0020] In the mRMR algorithm, Φ(D, R) is a metric, Φ(D, R) = DR, D represents relevance, R represents redundancy, and a larger Φ means that the selected features have higher relevance and lower redundancy. The larger the Φ, the better.
[0021] Step 2.3: Repeat step 2.2 until all fault features are sorted;
[0022] The importance of fault features is analyzed by the mRMR algorithm. The 7-dimensional electrical fault feature quantity is input, and the mutual information between each input feature and the predicted target variable is calculated to obtain the comprehensive score of each feature.
[0023] In step 3, the fault feature quantity obtained after preliminary screening of the 7-dimensional original electrical fault feature quantity by the mRMR method and the environmental factors G and T are used as model input, and the labels of different fault types are used as model output; combined with the requirements of the fault diagnosis model for efficiency and performance, the PO algorithm is used to optimize the three hyperparameters of the LightGBM model. The three hyperparameters are the number of leaf nodes, the learning rate and the depth of the tree. The specific designs of the three hyperparameters are as follows:
[0024] 1) The traversal range of leaf node number (num_leaves) is set to [4,64];
[0025] 2) The learning rate (learning_rate) traversal range is set to [0.01, 1];
[0026] 3) The tree depth (max_depth) traversal range is set to [1,15].
[0027] In step 3, the LightGBM model constructs multiple weak decision trees, each tree is trained according to the residual of the previous round, the model calculates the current residual in each iteration, builds a new tree by minimizing the loss function, and accumulates the prediction results of each tree to form the final prediction value; the calculation formula of the prediction result is shown in formula (10);
[0028]
[0029] In the formula, f n (x)——output value of each decision tree; F(x)——final weighted output;
[0030] In step 3, the PO algorithm includes the following steps:
[0031] 1) Population initialization
[0032] Assume that the population size is N and the maximum number of iterations is Max iter As well as the upper limit ub and lower limit lb of the search space, the initialization formula is as follows:
[0033]
[0034] In the formula, is the starting position of the i-th parrot; rand(0,1) is a random number in the range [0,1];
[0035] 2) Foraging behavior
[0036] During foraging, parrots mainly infer the approximate location of food by observing the location of food or the location of the owner, and then fly to the location. The location movement follows formula (12):
[0037]
[0038] In the formula, is the updated position; is the current position; X best is the optimal position currently searched; t is the number of iterations; is the average position of the current population; Levy(dim) means generating a random number from a Lévy distribution in each dimension as the search step length in that dimension;
[0039] in The definition is as shown in formula (13);
[0040]
[0041] The Levy distribution is described by formula (14), and γ is set to 1.5. The Levy distribution is used to ensure that the parrot's exploration route is more random, which helps to balance global exploration and local development;
[0042]
[0043] In the formula, μ represents the random number sampled from the normal distribution, σ represents a scaling factor of the Lévy distribution, which is used to control the amplitude of the step size, and |v| represents the absolute value of the random variable v. It is part of the Lévy distribution and controls the degree of change of the random step size. Γ(1+γ) represents the value of the gamma function with parameter 1+γ. Indicates that the parameter is The gamma function value of ;
[0044] 3) Staying behavior
[0045] The staying behavior mainly refers to the parrot suddenly flying to the owner's body and staying for a period of time. The formula (15) of this behavior is as follows:
[0046]
[0047] In the formula, Indicates the updated position. Indicates the current position, Ones(1,dim) is a vector of all 1s of dimension dim;
[0048] 4) Communication behavior
[0049] Parrots are naturally sociable, and their communication behaviors include flying into a flock and not flying into a flock. Assume that these two communication behaviors have the same probability of occurring in the parrot optimization algorithm PO, and the center of the population is represented by the average position of the current population. The process is expressed by formula (16):
[0050]
[0051] In the formula, P <= 0.5 indicates the process of interaction between the individual and the parrot; P > 0.5 indicates the process of the individual taking off immediately after the communication;
[0052] 5) Fearful behavior
[0053] Parrots will keep a distance from unfamiliar individuals and look for a safe environment again. This process can be expressed by formula (17):
[0054]
[0055] The first half of the formula represents the process of reorienting and flying toward the owner, while the second half represents the process of moving away from the stranger.
[0056] In step 4, analyze the candidate features U m Whether it needs to be included in the optimal fault feature group, specifically including: assuming that feature group 1 is the fault feature group after initial screening; feature group 2 adds alternative feature U on the basis of feature group 1; m ; The fault feature group is used as the model input and input into the LightGBM, PO-LightGBM, WOA-LightGBM and BKA-LightGBM fault diagnosis models respectively, and the fault diagnosis accuracy is used as the evaluation index.
[0057] In step 4, the impact of the fault feature group in step 2 on the performance of the PO-LightGBM model is verified. The selected model performance verification indicators are obtained by calculating the confusion matrix, including accuracy, precision, recall and F1 score; according to the difference between the predicted results and the actual results, the sample data is divided into true positive examples TP, true negative examples TN, false positive examples FP and false negative examples FN; the evaluation indicator formula is:
[0058]
[0059] In the formula, A c Indicates the accuracy rate, which means the proportion of samples predicted correctly by the model to the total samples, P r Represents the precision rate, which indicates the proportion of samples predicted to be positive that are actually positive. e Recall rate, which indicates the proportion of samples that are actually positive that are correctly predicted as positive. F1 score is a classification model performance evaluation indicator used to weigh the precision rate Pr and recall rate Re in classification tasks;
[0060] In order to test the fault diagnosis performance of the PO-LightGBM model, it was compared with the LightGBM, WOA_LightGBM, and BKA_LightGBM models; to reduce the randomness of the prediction results, each model was run independently 10 times, and the average value of these experiments was used to compare and analyze the fault diagnosis effect.
[0061] The present invention provides a photovoltaic fault diagnosis method based on mRMR and PO-LightGBM, which has the following technical effects:
[0062] (1) The present invention proposes a feature selection method based on mRMR, which collects fault data by simulating photovoltaic faults. All original fault feature quantities are extracted, and the fault features are ranked by importance using the mRMR principle and preliminary screening is completed. The optimal fault feature group is then determined by combining the PO-LightGBM diagnostic model. The algorithm has strong universality and can reduce the low model accuracy caused by artificial extraction of fault feature quantities.
[0063] (2) The PO-LightGBM photovoltaic array fault diagnosis model proposed in the present invention has significantly improved the fault diagnosis accuracy of the original LightGBM model through PO algorithm optimization. Compared with the LightGBM model optimized by other algorithms, the PO-LightGBM model is the best in all five evaluation indicators, with the highest fault identification accuracy and the best comprehensive performance, and can also be used for other types of fault diagnosis.
[0064] (3) The fault types in the present invention include 8 single faults and 5 compound faults. The photovoltaic fault diagnosis model used not only performs well in single fault diagnosis, but also has a fault diagnosis accuracy rate of more than 96% when facing compound faults, which can effectively perform photovoltaic fault classification diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:
[0066] Figure 1 This is a shadow mode diagram.
[0067] Figure 2(a) is the IV diagram at different temperatures.
[0068] Figure 2(b) shows the IV diagram at different irradiances.
[0069] Figure 3(a) is a single fault IU curve.
[0070] Figure 3(b) is a single fault PU curve.
[0071] Figure 3(c) is the IU curve of shadow fault.
[0072] Figure 3(d) is the PU curve of shadow fault.
[0073] Figure 3(e) is the IU curve of the composite fault.
[0074] Figure 3(f) is the PU curve of the composite fault.
[0075] Figure 4 It is a comprehensive score diagram of electrical fault characteristics.
[0076] Figure 5 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0077] A photovoltaic fault diagnosis method based on mRMR and PO-LightGBM, comprising the following steps:
[0078] (1) Establish a photovoltaic fault simulation model and extract the original fault feature group;
[0079] The photovoltaic cell model selected in the present invention is 1Soltech 1STH-215-P, and the most typical SP structure is used for photovoltaic array arrangement. A 5×4 photovoltaic fault simulation model is built in MATLAB / Simulink. Common single faults and compound faults in photovoltaic arrays are simulated and analyzed, and fault diagnosis feature quantities are extracted according to their IU characteristic curves and PU characteristic curves (first extract the fault diagnosis feature quantities, and then combine them into the original fault feature group).
[0080] The working environment of photovoltaic arrays is complex and prone to various circuit failures. The photovoltaic module wires have poor contact or are damaged by friction, resulting in short circuit failures; the photovoltaic module connectors become loose or disconnected, and the lines are worn out and misaligned due to long-term use, resulting in open circuit failures; when photovoltaic modules are blocked by dust, clouds, leaves, etc. for a long time, their components are transformed from energy storage elements to loads to consume energy, resulting in shadow failures; as the working cycle increases, the current collection capacity of photovoltaic modules decreases, causing the solar cells to age faster and resulting in aging failures.
[0081] The present invention selects common single faults and compound faults in photovoltaic arrays for analysis, studies the impact of different photovoltaic faults on the output characteristics of the photovoltaic system, obtains various fault characteristics, and conducts fault simulation experiments to obtain a large amount of fault data.
[0082] The probability of multiple branches in a photovoltaic array being open-circuited and short-circuited at the same time is relatively small, so only the open-circuit and short-circuit conditions of a single branch are considered during the research process. Table 1 is a table of overall fault types and their label diagrams.
[0083] Table 1 Fault type table
[0084]
[0085] An open circuit fault is simulated by disconnecting a branch on the photovoltaic array; a short circuit fault is simulated by short-circuiting two photovoltaic modules between photovoltaic strings. Aging types are simulated by connecting a 5Ω resistor and a 15Ω resistor in series to simulate a mild aging fault and a severe aging fault, respectively. There are many modes of shadow conditions. Combined with the actual common conditions in the photovoltaic platform, and the coverage area and degree of shading are different, this paper selects 4 typical shadow modes for analysis, and models 4 conditions of partial shading 1, partial shading 2, dirt, and dust, respectively. Figure 1 As shown. 0.4 and 0.7 are the transmittance of the shadow of the photovoltaic module, reflecting the severity of its shadow. Under normal circumstances, the default number is 1. For composite faults, the present invention combines the faults except the short circuit and open circuit faults and studies them as composite faults, including five types of composite faults: short circuit shadow fault, open circuit shadow fault, aging shadow fault, short circuit aging fault, and open circuit aging fault.
[0086] In the external environment, changes in light intensity S and temperature T will have a significant impact on the output characteristics of photovoltaic modules. In Figure 2, the photovoltaic characteristic curve is analyzed by changing the ambient temperature and light intensity respectively. As shown in Figure 2(a) and Figure 2(b), when the temperature T increases, the open circuit voltage U OC Significantly reduce the short-circuit current I SC Slightly increase; when the radiation S increases, the short-circuit current I SC and open circuit voltage U OC All show an upward trend. For electrical fault characteristics. Combined Figure 3(a) to Figure 3(f) The photovoltaic curve can be obtained. When an open circuit fault occurs in the photovoltaic array, the maximum power point current I m and short-circuit current I sc Significantly reduced; when a short circuit occurs, the maximum power point voltage U m and open circuit voltage U oc When the photovoltaic array is abnormally aged, the maximum power P m Slightly lower.
[0087] In order to further distinguish abnormal aging faults, the fill factor (FF) is used as a characteristic quantity. The smaller the fill factor, the more serious the aging fault. When the photovoltaic array is in a shadow fault, its output curve will produce "multiple peaks" and "multiple knees". In order to distinguish different types of shadow faults, the number of inflection points of the PU curve is introduced as a key variable. The number of inflection points is determined by analyzing the concave and convex changes of the curve to distinguish different types of shadow faults. Therefore, the present invention will use I oc , U oc ,I mp , U mp , P m, FF, and the number of inflection points are used as the 7-dimensional original electrical fault feature quantity (the original fault feature group includes the original electrical fault feature quantity + environmental feature quantity, of which the environmental feature quantity has been selected to have 2 dimensions, temperature T and radiation S. The original electrical fault feature quantity has 7 dimensions. Since the environmental feature quantity has been determined, the main task now is to screen the original electrical fault feature quantity.)
[0088] (2) Feature screening based on mRMR algorithm
[0089] In a complex working environment, photovoltaic modules may have different photovoltaic faults. Therefore, in the photovoltaic fault diagnosis model, it is necessary to select a fault feature group with a lower dimension and the highest classification accuracy. Inputting all features into the model will increase the computational burden, and the correlation between features will increase the complexity of the model; too few features will not be able to fully and accurately identify the fault type, affecting the model performance. Therefore, in order to improve the classification accuracy of the model and reduce the calculation time, the present invention adopts the maximum relevance minimum redundancy algorithm mRMR to sort and screen the feature importance.
[0090] Based on the mRMR algorithm, the incremental search method is used to select the fault feature quantity. The specific selection process is as follows:
[0091] Let the original feature set be S and the feature set to be selected be S o .
[0092] 1) Calculate the correlation between each feature and the target variable, select the feature with the largest correlation as x1 and add it to the selected feature set S o middle.
[0093] 2) Using the selected feature set S o The i-1 features selected in the i-th feature selection need to be in the remaining feature set SS i-1 In step 1), select the feature S with the largest Φ value i .
[0094]
[0095]
[0096] A variable in the selected feature set;
[0097] In the mRMR algorithm, Φ(D, R) is a metric, Φ(D, R) = DR, D represents relevance, R represents redundancy, and a larger Φ means that the selected features have higher relevance and lower redundancy. The larger the Φ, the better.
[0098] 3) Repeat step 2) until all features are sorted.
[0099] By using the mRMR algorithm to perform feature importance analysis and inputting 7-dimensional electrical fault features, the mutual information between each input feature and the predicted target variable can be calculated, and the comprehensive score of each feature can be obtained to reflect the importance of the feature, such as Figure 4 shown.
[0100] Depend on Figure 4 It can be seen that:
[0101] 1) The comprehensive scores of features 2, 4, 6, and 7 are very high, indicating that these features contribute greatly to model prediction and need to be retained;
[0102] 2) The combined scores of features 1 and 3 are negative, indicating that the features are negative or invalid for predicting the target variable and need to be removed;
[0103] 3) The comprehensive score of feature 5 is slightly lower than that of the features in 1), but it still has a certain correlation, so feature 5 should not be immediately excluded in the feature selection process. Since the mRMR method is independent of the subsequent fault diagnosis model, the selected feature combination will have different effects on the model performance. Therefore, the accuracy of the fault diagnosis model can be combined to further determine the optimal feature group, and feature 5 can be retained as an alternative feature.
[0104] (3) Building the PO-LightGBM model
[0105] The fault feature quantity obtained after preliminary screening of the 7-dimensional original features by the mRMR method, as well as the environmental factors G and T, are used as model inputs, and the labels of different fault types are used as model outputs. There are many hyperparameters in the LightGBM model. Combined with the requirements of the fault diagnosis model for efficiency and performance, the PO algorithm is used to optimize the three key hyperparameters of the LightGBM model, namely the number of leaf nodes, learning rate, and tree depth. The specific parameter designs are as follows:
[0106] 1) The range of leaf node number (num_leaves) is set to [4,64]. Increasing it within a certain range can improve model accuracy, but it may also increase the risk of overfitting;
[0107] 2) The learning rate (learning_rate) range is set to [0.01, 1]. It affects the step size of model iteration. If it is set too large, the model will oscillate around the optimal solution and be difficult to converge. If it is set too small, the training process will be slow.
[0108] 3) The tree depth (max_depth) traversal range is set to [1,15], which effectively prevents model overfitting by limiting the maximum depth of the tree model.
[0109] Construct a photovoltaic array fault diagnosis method based on mRMR and PO-LightGBM model. The specific diagnosis process is as follows: Figure 5 shown.
[0110] (4) Model verification
[0111] After the mRMR algorithm is used to perform feature screening, the influence of the obtained feature group on the performance of the fault diagnosis model needs to be verified, and the candidate feature U needs to be analyzed. m Whether it needs to be included in the optimal fault feature group.
[0112] Assume that feature group 1 is the initial screening feature group; feature group 2 adds alternative feature U m The fault feature group is used as the model input and input into the LightGBM, PO-LightGBM, WOA-LightGBM and BKA-LightGBM models respectively. The fault diagnosis accuracy is used as the evaluation index. The results are shown in Table 2. It can be seen that feature group 2 has the highest accuracy in the four diagnosis models. Subsequent model verification is carried out based on this feature group.
[0113] Table 2 Model accuracy of different feature groups
[0114]
[0115] The model performance verification indicators selected by the present invention include accuracy, precision, recall and F1 score, which can be calculated through the confusion matrix. According to the difference between the predicted results and the actual results, the sample data is divided into true positive examples (TP), true negative examples (TN), false positive examples (FP) and false negative examples (FN). The evaluation index formula is:
[0116]
[0117] In order to test the fault diagnosis performance of the PO_LightGBM model, it is compared with the LightGBM, WOA_LightGBM, and BKA_LightGBM models. To reduce the randomness of the prediction results, each model is run independently 10 times, and the fault diagnosis effects are compared and analyzed by the average values of these experiments using four evaluation indicators, accuracy, precision, recall, and F1 score, as shown in Table 3.
[0118] Table 3 Model evaluation index data table
[0119]
[0120] How it works
[0121] (1) mRMR algorithm
[0122] The mRMR algorithm is a feature selection method based on mutual information. The algorithm aims to select the input feature set with the greatest correlation with the target variable and the least redundancy between input features from the original feature set. Mutual information is an effective information measurement method that can be used to measure the correlation between variables.
[0123] The mutual information is defined as shown in formula (6).
[0124]
[0125] Where I(x;y) represents the definition symbol of mutual information, x and y are two random variables; p(x,y) is the joint probability density of x and y; p(x) is the probability density of random variable x; p(y) is the probability density of random variable y;
[0126] The definitions of maximum correlation and minimum redundancy are shown in equations (7) and (8) respectively.
[0127]
[0128] In the formula, S is the feature set; c is the sample category; D represents the correlation between the feature and the fault category; |S| is the number of features; x i represents a variable to be selected; R represents the redundancy between features; maxD(S,c), D represents the correlation between the two; minR(S), R represents the redundancy between the two;
[0129] Combining equations (7) and (8) to form the mRMR algorithm, denoted as maxΦ(D,R), as shown in equation (9).
[0130] maxΦ(D,R),Φ(D,R)=DR (9); (2)LightGBM algorithm
[0131] The LightGBM algorithm (Light Gradient Boosting Machine) is a gradient boosting framework based on the traditional gradient boosting decision tree. It has the characteristics of fast training speed, low memory usage, and relatively accurate prediction. The core idea of the algorithm is to build multiple weak decision trees, each of which is trained according to the residual of the previous round. The model calculates the current residual in each iteration, builds a new tree by minimizing the loss function, and accumulates the prediction results of each tree to form the final prediction value. The calculation formula of the prediction result is shown in formula (10).
[0132]
[0133] In the formula, f n (x)——the output value of each decision tree; F(x)——the final weighted output.
[0134] The LightGBM algorithm combines the histogram algorithm, leaf-wise growth strategy, one-sided sampling GOSS and feature bundling algorithm EFB on the basis of GBDT algorithm, solving the problems of low efficiency and poor scalability of GBDT algorithm and XGBoost algorithm when dealing with high-dimensional input features and large data volume. The histogram algorithm uses histograms to speed up the calculation of split points; the leaf-wise growth strategy finds the leaf with the maximum current split gain each time to split and gradually build a decision tree; one-sided sampling GOSS is used to reduce the amount of data that contributes less to the model; the feature bundling algorithm EFB reduces the feature dimension by bundling mutually exclusive features. The algorithm as a whole can ensure the integrity of model information and improve the running speed and model accuracy.
[0135] (3) Parrot Optimization Algorithm
[0136] Parrot Optimizer (PO) is a new and efficient meta-heuristic algorithm that includes four behaviors of parrots: foraging, staying, communicating, and fear, and encapsulates them in different formulas to more effectively find the optimal solution. Unlike traditional meta-heuristic algorithms, each individual in Parrot Optimizer (PO) randomly exhibits one of the four behaviors in each iteration. This randomness improves the flexibility of the algorithm and avoids falling into the local optimal solution.
[0137] 1) Population initialization
[0138] Assume that the population size is N and the maximum number of iterations is Max iter As well as the upper limit ub and lower limit lb of the search space, the initialization formula is as follows:
[0139]
[0140] In the formula, is the starting position of the i-th parrot; rand(0,1) is a random number in the range [0,1].
[0141] 2) Foraging behavior
[0142] During foraging, parrots mainly infer the approximate location of food by observing the location of food or the location of the owner, and then fly to the location. The location movement follows formula (12):
[0143]
[0144] In the formula, is the updated position; is the current position; X best is the optimal position currently searched; t is the number of iterations; is the average position of the current population; Levy(dim) means generating a random number from a Lévy distribution in each dimension as the search step length in that dimension. The specific formula is shown in formula (13);
[0145] in The definition is shown in formula (13).
[0146]
[0147] The Levy distribution is described by formula (14), with γ set to 1.5. The Levy distribution is used to ensure that the parrot’s exploration route is more random, which helps to balance global exploration and local development.
[0148]
[0149] Where μ represents the random number sampled from the normal distribution; σ represents a scaling factor of the Lévy distribution, which is used to control the amplitude of the step size; |v| represents the absolute value of the random variable v, It is part of the Lévy distribution and controls the degree of change of the random step size; Γ(1+γ) represents the value of the gamma function with parameter 1+γ;
[0150] 3) Staying behavior
[0151] The staying behavior mainly refers to the parrot suddenly flying to the owner's body and staying for a period of time. The formula (15) of this behavior is as follows:
[0152]
[0153] In the formula, Indicates the updated position; Indicates the current position; Ones(1,dim) is a vector of all 1s of dimension dim.
[0154] 4) Communication behavior
[0155] Parrots are naturally sociable, and their communication behaviors include flying into a flock and not flying into a flock. Assume that these two communication behaviors have the same probability of occurring in the Parrot Optimizer (PO), and the center of the population is represented by the average position of the current population. The process is represented by the following equation (16):
[0156]
[0157] In the formula, P <= 0.5 indicates the process of interaction between the individual and the parrot; P > 0.5 indicates the process of the individual taking off immediately after the communication;
[0158] 5) Fearful behavior
[0159] Parrots will keep a distance from unfamiliar individuals and look for a safe environment again. This process can be expressed by the following formula (17):
[0160]
[0161] The first half of the formula represents the process of reorienting and flying toward the owner, while the second half represents the process of moving away from the stranger.
[0162] The photovoltaic fault diagnosis method based on mRMR and PO-LightGBM of the present invention has the following characteristics:
[0163] (1) The present invention uses the mRMR feature screening method to sort the importance of the fault features on the original fault feature group. Based on the mRMR algorithm, the incremental search method is used to select features, and the input feature set with the maximum correlation with the target variable and the minimum redundancy between input features is selected to determine the fault feature group input to the photovoltaic array fault diagnosis model.
[0164] (2) The present invention introduces the Parrot optimization algorithm to optimize three parameters of LightGBM, namely the number of leaf nodes, learning rate and tree depth, and establishes a fault diagnosis model based on PO-LightGBM. The model performance verification indicators are calculated through the confusion matrix, including accuracy, precision, recall and F1 score. By optimizing the three hyperparameters, the accuracy of photovoltaic fault diagnosis can be significantly improved.
[0165] (3) The present invention selects different fault feature data as the input of the diagnostic model and takes the label corresponding to the fault type as the output. 2 and T∈[15,45]℃, respectively, with a step size of 15W / m 2 and 5℃, a total of 4018 sample data were collected, including 287 sample data for each of the 14 fault status types. The training set and the test set were randomly divided into a ratio of 7:3. The training set was used for model training and optimization, and the test set was used to evaluate the model effect.
[0166] (4) During the research process of this invention, the fault simulation of single and compound faults was carried out. A series 5Ω resistor and a 15Ω resistor were used to simulate the severity of aging, and 4 typical shadow modes were selected for simulation analysis. For compound faults, this paper combined the faults except short-circuit and open-circuit faults and studied them as compound faults.
Claims
1. A photovoltaic fault diagnosis method based on mRMR and PO-LightGBM, characterized in that: The following steps are involved: Step 1: Build a photovoltaic fault simulation model and extract the original fault feature group; Step 2: Screen the original fault feature groups based on the mRMR algorithm and preliminarily select the fault feature groups that have a significant impact on the prediction effect; Step 3: Build the PO-LightGBM model and re-screen the fault feature group in step 2 to obtain the optimal fault feature group; Step 4: Verify the impact of the fault feature group in step 2 on the performance of the PO-LightGBM model, and analyze the alternative features U m Whether it needs to be included in the optimal fault feature group.
2. The photovoltaic fault diagnosis method based on mRMR and PO-LightGBM according to claim 1, characterized in that: In the step 1, the SP structure is used to arrange the photovoltaic array, and a photovoltaic fault simulation model is built in MATLAB / Simulink; single faults and compound faults in the photovoltaic array are simulated and analyzed, and fault feature quantities are extracted according to the IU characteristic curve and the PU characteristic curve, and the fault feature quantities are combined into an original fault feature group.
3. A photovoltaic fault diagnosis method based on mRMR and PO-LightGBM according to claim 2, characterized in that: Single faults include short circuit faults, open circuit faults, shadow faults and aging faults; an open circuit fault is simulated by disconnecting a branch on the photovoltaic array; a short circuit fault is simulated by short-circuiting two photovoltaic modules between photovoltaic strings; a slight aging fault and a severe aging fault are simulated by connecting a 5Ω resistor and a 15Ω resistor in series respectively; four shadow modes are selected for shadow fault analysis, and the four shadow modes are partial shading 1, partial shading 2, dirt, and dust; composite faults include short circuit shadow fault, open circuit shadow fault, aging shadow fault, short circuit aging fault, and open circuit aging fault.
4. The photovoltaic fault diagnosis method based on mRMR and PO-LightGBM according to claim 3 is characterized in that: In order to further distinguish abnormal aging faults, the filling factor is used as the fault diagnosis feature. When the photovoltaic array is in a shadow fault, in order to distinguish different types of shadow faults, the number of inflection points of the PU curve is introduced as the key variable. The number of inflection points is determined by analyzing the concave and convex changes of the curve to distinguish different types of shadow faults. The I oc , U oc ,I mp , U mp , P m , FF, and the number of inflection points are used as the 7-dimensional original electrical fault feature quantities.
5. The photovoltaic fault diagnosis method based on mRMR and PO-LightGBM according to claim 1, characterized in that: In step 2, the mRMR algorithm uses an incremental search method to select the fault feature quantity, and the selection of the fault feature quantity specifically includes: Step 2.1: Let the original feature set be S and the feature set to be selected be S o ; Calculate the correlation between each fault feature and the target variable, select the feature with the largest correlation as x1 and add it to the candidate feature set S o middle; Step 2.2: Using the selected feature set S o The i-1 features selected in the i-th feature selection need to be in the remaining feature set SS i-1 According to step 2.1, select the feature S with the largest Φ value i ; Where: x i represents a variable in the feature set to be selected, c represents the fault sample category, x j Represents a variable in the selected feature set; In the mRMR algorithm, Φ(D, R) is a metric, Φ(D, R) = DR, D represents relevance, R represents redundancy, and a larger Φ means that the selected features have higher relevance and lower redundancy. The larger the Φ, the better. Step 2.3: Repeat step 2.2 until all fault features are sorted; The importance of fault features is analyzed by the mRMR algorithm. The 7-dimensional electrical fault feature quantity is input, and the mutual information between each input feature and the predicted target variable is calculated to obtain the comprehensive score of each feature.
6. The photovoltaic fault diagnosis method based on mRMR and PO-LightGBM according to claim 1, characterized in that: In step 3, the fault feature quantity obtained after preliminary screening of the 7-dimensional original electrical fault feature quantity by the mRMR method and the environmental factors G and T are used as model input, and the labels of different fault types are used as model output; combined with the requirements of the fault diagnosis model for efficiency and performance, the PO algorithm is used to optimize the three hyperparameters of the LightGBM model. The three hyperparameters are the number of leaf nodes, the learning rate and the depth of the tree. The specific designs of the three hyperparameters are as follows: 1) The leaf node number traversal range is set to [4,64]; 2) The learning rate traversal range is set to [0.01, 1]; 3) The depth traversal range of the tree is set to [1,15].
7. The photovoltaic fault diagnosis method based on mRMR and PO-LightGBM according to claim 6, characterized in that: In step 3, the LightGBM model constructs multiple weak decision trees, each tree is trained according to the residual of the previous round, the model calculates the current residual in each iteration, builds a new tree by minimizing the loss function, and accumulates the prediction results of each tree to form the final prediction value; the calculation formula of the prediction result is shown in formula (10); In the formula, f n (x)——output value of each decision tree; F(x)——final weighted output; In step 3, the PO algorithm includes the following steps: 1) Population initialization Assume that the population size is N and the maximum number of iterations is Max iter As well as the upper limit ub and lower limit lb of the search space, the initialization formula is as follows: In the formula, is the starting position of the i-th parrot; rand(0,1) is a random number in the range [0,1]; 2) Foraging behavior During foraging, parrots mainly infer the approximate location of food by observing the location of food or the location of the owner, and then fly to the location. The location movement follows formula (12): In the formula, is the updated position; is the current position; X best is the optimal position currently searched; t is the number of iterations; is the average position of the current population; Levy(dim) means generating a random number from a Lévy distribution in each dimension as the search step length in that dimension; in The definition is as shown in formula (13); The Levy distribution is described by formula (14), and γ is set to 1.
5. The Levy distribution is used to ensure that the parrot's exploration route is more random, which helps to balance global exploration and local development; In the formula, μ represents the random number sampled from the normal distribution, σ represents a scaling factor of the Lévy distribution, which is used to control the amplitude of the step size, and |v| represents the absolute value of the random variable v. It is part of the Lévy distribution and controls the degree of change of the random step size. Γ(1+γ) represents the value of the gamma function with parameter 1+γ. Indicates that the parameter is The gamma function value of ; 3) Staying behavior The staying behavior mainly refers to the parrot suddenly flying to the owner's body and staying for a period of time. The formula (15) of this behavior is as follows: In the formula, Indicates the updated position. Indicates the current position, Ones(1,dim) is a vector of all 1s of dimension dim; 4) Communication behavior Parrots are naturally sociable, and their communication behaviors include flying into a flock and not flying into a flock. Assume that these two communication behaviors have the same probability of occurring in the parrot optimization algorithm PO, and the center of the population is represented by the average position of the current population. The process is expressed by formula (16): In the formula, P <= 0.5 indicates the process of interaction between the individual and the parrot; P > 0.5 indicates the process of the individual taking off immediately after the communication; 5) Fearful behavior Parrots will keep a distance from unfamiliar individuals and look for a safe environment again. This process can be expressed by formula (17): The first half of the formula represents the process of reorienting and flying toward the owner, while the second half represents the process of moving away from the stranger.
8. The photovoltaic fault diagnosis method based on mRMR and PO-LightGBM according to claim 1, characterized in that: In step 4, analyze the candidate features U m Whether it needs to be included in the optimal fault feature group, specifically including: assuming that feature group 1 is the fault feature group after initial screening; feature group 2 adds alternative feature U on the basis of feature group 1; m ; The fault feature group is used as the model input and input into the LightGBM, PO-LightGBM, WOA-LightGBM and BKA-LightGBM fault diagnosis models respectively, and the fault diagnosis accuracy is used as the evaluation index.
9. The photovoltaic fault diagnosis method based on mRMR and PO-LightGBM according to claim 8, characterized in that: In step 4, the impact of the fault feature group in step 2 on the performance of the PO-LightGBM model is verified. The selected model performance verification indicators are obtained by calculating the confusion matrix, including accuracy, precision, recall and F1 score; according to the difference between the predicted results and the actual results, the sample data is divided into true positive examples TP, true negative examples TN, false positive examples FP and false negative examples FN; the evaluation indicator formula is: In the formula, A c Indicates the accuracy rate, which means the proportion of samples predicted correctly by the model to the total samples, P r Represents the precision rate, which indicates the proportion of samples predicted to be positive that are actually positive. e Recall rate, which indicates the proportion of samples that are actually positive that are correctly predicted as positive. F1 score is a classification model performance evaluation indicator used to weigh the precision rate Pr and recall rate Re in classification tasks; In order to test the fault diagnosis performance of the PO-LightGBM model, it was compared with the LightGBM, WOA_LightGBM, and BKA_LightGBM models; to reduce the randomness of the prediction results, each model was run independently 10 times, and the average value of these experiments was used to compare and analyze the fault diagnosis effect.