IDBO optimization-based LSTM photovoltaic panel dust deposition degree prediction method and system
By improving the LSTM network model based on the dung beetle optimization algorithm and combining it with CNN layers and attention mechanisms, the problems of high time cost and low accuracy in predicting the degree of dust accumulation on photovoltaic panels were solved, achieving efficient and accurate real-time monitoring.
Patent Information
- Application Number
- CN202410967204.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-11-22
AI Technical Summary
Existing methods for predicting the degree of dust accumulation on photovoltaic panels suffer from high time costs and poor accuracy. Furthermore, traditional direct detection methods are complex and susceptible to environmental factors, making it impossible to achieve real-time monitoring and accurate prediction.
An LSTM network model optimized based on an improved dung beetle optimization algorithm is adopted to predict the transmittance of photovoltaic panels. The parameters of the LSTM network are optimized using the improved dung beetle optimization algorithm, and a CNN layer and attention mechanism are added to extract local features and adapt to changing environmental factors, so as to achieve fast and economical real-time prediction.
It improves the accuracy of predicting the degree of dust accumulation on photovoltaic panels, reduces prediction costs, and achieves efficient real-time monitoring and accurate prediction, adapting to complex environmental conditions.
Smart Images

Figure CN119004307A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic panel dust accumulation prediction, and in particular to an LSTM photovoltaic panel dust accumulation prediction method and system based on IDBO optimization. Background Art
[0002] As the core component of the solar power generation system, the dust accumulation on the surface of the photovoltaic module is directly related to the photoelectric conversion efficiency. Dust accumulation will not only reduce the transmittance of the photovoltaic panel and reduce the light intensity reaching the surface of the cell, but also increase the thermal resistance of the module, causing the operating temperature of the module to increase, further affecting the efficiency and life of the photovoltaic module. In addition, dust accumulation may also cause the hot spot effect of the photovoltaic module, resulting in excessive local temperature, increasing the risk of fire and affecting the safe operation of the system. According to research, for every 1% decrease in transmittance, the photoelectric conversion efficiency of the photovoltaic module decreases by about 0.5%. Therefore, accurately predicting and optimizing the dust accumulation of photovoltaic panels is of great significance to improving system performance.
[0003] In addition to relying on physical models and empirical formulas, traditional methods for predicting the degree of dust accumulation in photovoltaic panels also include methods for directly detecting dust accumulation. Although these direct detection methods, such as dust weighing or image processing technology, provide a direct means of measuring the amount of dust accumulation, they have a series of shortcomings. First, these methods often require complex equipment and cumbersome operating procedures, resulting in a time-consuming and costly prediction process. Second, direct detection methods may not be able to reflect changes in dust accumulation in real time because they usually need to be performed at specific time points rather than continuous monitoring. In addition, these methods may be affected by environmental factors, such as changes in lighting conditions and dust characteristics, which can affect the accuracy of the measurement. Due to these limitations, direct detection methods of dust accumulation have obvious shortcomings in real-time monitoring and prediction of the degree of dust accumulation in photovoltaic panels.
[0004] In contrast, the LSTM network model proposed in this application based on the improved dung beetle algorithm optimization can more efficiently and accurately predict the degree of dust accumulation by analyzing the transmittance data of photovoltaic panels. This method not only reduces the dependence on complex equipment and a large amount of experimental data, but also can adapt to changing environmental factors and achieve fast and economical real-time prediction.
[0005] With the rapid development of deep learning technology, especially the successful application of convolutional neural networks (CNN) and long short-term memory networks (LSTM) in image recognition and time series prediction, researchers have begun to explore their application in the prediction of dust accumulation in photovoltaic panels. These technologies can handle complex nonlinear relationships and provide more accurate prediction results. However, a single LSTM network has limited ability to capture spatial information, and has high computational costs and difficulty in adjusting parameters, resulting in high prediction time costs and low prediction result accuracy, which cannot meet the real-time prediction needs of photovoltaic panel dust accumulation.
[0006] According to incomplete statistics, in the past five years, global photovoltaic module manufacturers have reported more than thousands of repair and replacement incidents caused by dust accumulation-related quality problems, resulting in huge economic losses. This data highlights the importance of accurately predicting and controlling the degree of dust accumulation in photovoltaic panels. Existing dust accumulation prediction models mainly rely on dust weighing or image processing. Although they can predict dust accumulation to a certain extent, the methods are complex, with large errors and high costs, as well as limitations in the generalization ability of the model. There are still deficiencies in prediction accuracy and real-time performance. Summary of the invention
[0007] The present invention aims to provide a method and system for predicting the dust accumulation degree of LSTM photovoltaic panels based on IDBO optimization, which reflects the dust accumulation degree through the transmittance, overcomes the problems of high prediction time cost and poor prediction accuracy in the prior art, and efficiently realizes the prediction of the dust accumulation degree of photovoltaic panels.
[0008] In order to solve the above technical problems, the present invention provides the following technical solutions: a LSTM photovoltaic panel dust accumulation degree prediction method based on IDBO optimization, comprising the following steps:
[0009] S1. Based on the training of photovoltaic panel transmittance data samples, an LSTM photovoltaic panel transmittance prediction model optimized by the Improved Dung Beetle Optimization (IDBO) algorithm is established to reflect the degree of dust accumulation through the transmittance.
[0010] The process of establishing a photovoltaic panel transmittance prediction model includes the following operations:
[0011] a. After obtaining the photovoltaic panel transmittance data samples as required, automatically preprocess them to form an experimental data sample data set, including a training data sample set and a test data sample set;
[0012] b. Based on the LSTM photovoltaic panel transmittance prediction model optimized by the improved dung beetle optimization algorithm, the improved dung beetle optimization algorithm is used to calculate the optimal parameters of the LSTM network, including the number of units in the LSTM layer, the initial value of the learning rate, and the strength of the L2 regularization term; a CNN layer is added before the LSTM layer, and an attention module is added after it to extract and focus on local features that affect the output to adapt the photovoltaic panel transmittance prediction model;
[0013] c. using the training data sample set in the experimental data sample data set to train the photovoltaic panel transmittance prediction model until the set training conditions are met, and using the test data sample set to perform testing;
[0014] S2, obtaining the real-time transmittance of the photovoltaic panel to be predicted and the environmental factor data affecting the transmittance;
[0015] S3, making the real-time detection data into a data set and inputting it into the LSTM photovoltaic panel transmittance prediction model optimized based on the improved dung beetle optimization algorithm for prediction; the real-time detection data includes photovoltaic panel transmittance, ambient temperature, humidity, wind speed, PM10 concentration and rainfall;
[0016] S4. Analyze the fitting coefficient and root mean square error and other indicators obtained from the prediction results. If the fitting coefficient and root mean square error and other indicators meet the set requirements, output prompts based on the dust accumulation degree reflected by different transmittances.
[0017] Further, when constructing the LSTM photovoltaic panel transmittance prediction model based on the improved dung beetle optimization algorithm in step b, the improved dung beetle optimization algorithm designs the rolling, dancing, foraging, breeding and stealing behaviors of dung beetles as modeling rules, and optimizes the model hyperparameters, wherein each dung beetle population is composed of four different dung beetles, including rolling dung beetles, breeding dung beetles, foraging dung beetles and stealing dung beetles, specifically including:
[0018] a1. Initialize the parameters and use the Logistic mapping formula (1) to initialize the dung beetle population:
[0019] x n+1 =r×x n ×(1-x n ) (1)
[0020] Where r is the control parameter, usually between 3 and 4, x represents dung beetles, and n is the number of dung beetles;
[0021] a2. Calculate the fitness value of each dung beetle, find out the current optimal fitness value and the worst fitness value, as well as the corresponding position;
[0022] a3. Execute the rolling behavior of the golden sine strategy and update the position according to formula (2);
[0023] x i (t+1)=x i (t)×|sin R 1 |+R 2 ×sin R 2 ×|C 1 × i (t)-C 2 × i (t+1)| (2)
[0024] where x i (t+1) represents the updated position, x i (t) represents the position before updating, R 1 and R 2 is based on the random number generation angle, C 1 and C 2 is the angle associated with the golden section;
[0025] When encountering an obstacle and being unable to move forward, the dancing behavior is simulated to regain the route and the position is updated according to formula (3);
[0026] x i (t+1)=x i (t)+tanθ|x i (t)-x i (t-1)| (3)
[0027] Among them, θ is the deflection angle belonging to [0-π]. If θ is 0, π, π / 2, the dung beetle does not update its position. i (t)-x i (t-1)| represents the difference between the position of the i-th dung beetle at the t-th iteration and its position at the t-1-th iteration;
[0028] a4, execute the reproduction behavior and update the position according to formula (4);
[0029] B i (t+1)=X * +b 1 ×(B i (t)-Lb * )+b 2 ×(B i (t)-Ub * ) (4)
[0030]
[0031] Among them, B i(t) represents the position information of the i-th brooding ball in the t-th iteration, b 1 and b 2 are all 1×D random variables, where D represents the dimension of the optimization problem; X* represents the current optimal position, Lb* and Ub* represent the upper and lower bounds of the spawning area, respectively, and R = 1-t / T max , T max It is expressed as the maximum number of iterations, Lb and Ub represent the lower and upper bounds of the optimization problem respectively;
[0032] a5, execute the foraging behavior of integrating the adaptive t-distribution strategy and update the position according to formula (6);
[0033] x i (t+1)=bestXX+trnd(freen)×bestXX (6)
[0034]
[0035] Where bestXX is the current optimal solution, trnd is a function that generates random numbers that conform to the t distribution; t is the number of iterations, and M is the maximum number of iterations;
[0036] a6. Perform the stealing behavior and update the position according to formula (8);
[0037] x i (t+1)=X b +S×g×(|x i (t)-X * |+|x i (t)-X b |) (8)
[0038] Among them, x i (t) represents the position of the i-th thief dung beetle in the t-th iteration, g is a 1×D random vector that follows a normal distribution, and S is a constant;
[0039] a7, determine whether the end condition is met, if so, proceed to the next step, otherwise jump to a2;
[0040] a8. The program ends and the optimal result is output.
[0041] Furthermore, in step b, when constructing the LSTM photovoltaic panel transmittance prediction model based on the improved dung beetle optimization algorithm, a CNN layer is added before the LSTM layer, and the CNN layer is used to capture local features to improve the model's expressiveness, operating efficiency, and robustness.
[0042] Furthermore, in step b, when constructing the LSTM photovoltaic panel transmittance prediction model based on the improved dung beetle optimization algorithm, an attention mechanism is added after the LSTM layer. Running the attention mechanism can process all parts of the input sequence in parallel. The model can capture information in different representation subspaces, which helps to improve different time series features and improve the computational efficiency and flexibility of the model.
[0043] Furthermore, in the step b, an ablation experiment is carried out on the LSTM photovoltaic panel transmittance prediction model constructed based on the improved dung beetle optimization algorithm, and the prediction effects of different optimization designs are compared and analyzed through multiple evaluation indicators; the evaluation indicators include: fitting coefficient, root mean square error, mean square error, mean absolute error and mean absolute percentage error.
[0044] Furthermore, in step a, multi-level preprocessing operations are performed on the acquired photovoltaic panel transmittance data and influencing factor data samples, including data cleaning, feature engineering, outlier and missing value processing, and data smoothing operations.
[0045] An LSTM photovoltaic panel transmittance prediction system, comprising:
[0046] Data acquisition unit: responsible for collecting real-time transmittance data of photovoltaic panels and data on environmental factors that may affect transmittance;
[0047] Data preprocessing unit: automatically cleans the collected data, performs feature engineering, processes outliers and missing values, and performs data smoothing operations to form a sample data set suitable for model training;
[0048] Model training unit: Use the LSTM network optimized by the improved dung beetle optimization algorithm to train the photovoltaic panel transmittance prediction model; the model training unit includes:
[0049] The parameter initialization module initializes the dung beetle population according to the Logistic mapping and performs fitness calculations on the individuals in the population;
[0050] The behavior simulation module simulates the rolling, dancing, foraging, reproduction, and stealing behaviors of dung beetles to optimize the hyperparameters of the LSTM network;
[0051] Hyperparameter optimization module: Based on the results of the simulation behavior, the optimal parameters of the LSTM network are calculated, including the number of units, the initial value of the learning rate, and the L2 regularization strength;
[0052] Prediction model unit: An LSTM network that integrates a CNN layer and a self-attention mechanism to improve the model's ability to capture local features and the efficiency of processing time series features;
[0053] Prediction execution unit: receives the data set prepared by the data preprocessing unit, inputs it into the trained LSTM prediction model, and performs real-time prediction of transmittance;
[0054] Result analysis unit: analyzes the prediction results, including calculating the fitting coefficient, root mean square error and other indicators, and judges the dust accumulation degree of the light transmittance based on these indicators, and outputs the corresponding prompt signal;
[0055] System evaluation unit: conducts ablation experiments on the constructed prediction model, and compares and analyzes the prediction effects of different optimization designs through multiple evaluation indicators to verify the effectiveness of the model.
[0056] Beneficial effects of the present invention:
[0057] 1. The present invention provides a LSTM photovoltaic panel transmittance prediction method and system based on the improved dung beetle algorithm optimization. Based on data sample training, a LSTM photovoltaic panel transmittance prediction network model based on the improved dung beetle algorithm optimization is established; first, the acquired transmittance and environmental factor data samples affecting the transmittance are preprocessed as experimental sample data sets, and data outliers, missing values and outliers are processed through preprocessing operations, and the data is smoothed to form a comprehensive and reliable sample data foundation.
[0058] When constructing an LSTM photovoltaic panel transmittance prediction network model based on the improved dung beetle algorithm optimization, the dung beetle optimization algorithm is improved to find the optimal hyperparameters of the model to improve the model training speed and prediction accuracy; a CNN layer is added before the LSTM layer to strengthen the model extraction and focus on local features that affect the output, thereby improving the model training speed; and an attention module is added to the LSTM layer to enhance the prediction network model's ability to extract important features, suppress useless features, and improve the prediction accuracy of the photovoltaic panel transmittance; based on this, the real-time transmittance data of the photovoltaic panel to be tested and the environmental factors affecting the transmittance are obtained, and input into the established photovoltaic panel transmittance prediction model to perform transmittance prediction, and output a dust accumulation prompt signal based on the prediction result; compared with the existing algorithm, it has higher prediction accuracy, reduces prediction cost, and has great practical application potential in actual application scenarios.
[0059] In this solution, an LSTM photovoltaic panel transmittance prediction system achieves efficient and accurate prediction of photovoltaic panel transmittance through the collaborative work of the above components. The design of the system takes into account key steps such as data processing, model training, prediction execution and result evaluation in practical applications, ensuring the reliability and practicality of the prediction results. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1It is a comparison diagram of the convergence curves of the LSTM photovoltaic panel dust accumulation degree prediction method based on IDBO optimization of the present invention and other comparison algorithms on the test function;
[0061] Figure 2 A flow chart of a prediction method for predicting dust accumulation degree of LSTM photovoltaic panels based on IDBO optimization of the present invention;
[0062] Figure 3 A structural schematic diagram of an LSTM photovoltaic panel dust accumulation degree prediction system based on IDBO optimization in the present invention. DETAILED DESCRIPTION
[0063] Example 1
[0064] Figure 1 and Figure 2 The schematic diagram of the process of predicting the dust accumulation degree of LSTM photovoltaic panels based on IDBO optimization provided by Example 1 of the present invention is shown. Figure 1 It can be seen that the method includes the following steps.
[0065] Step 1: Based on the photovoltaic panel transmittance data sample training, an LSTM photovoltaic panel transmittance prediction model based on the improved dung beetle optimization algorithm is established;
[0066] The process of establishing the photovoltaic panel transmittance prediction model includes the following operations:
[0067] Step 1.1: After obtaining the photovoltaic panel transmittance data samples as required, automatically preprocess them to form an experimental data sample data set, including a training data sample set and a test data sample set;
[0068] Step 1.2: Based on the LSTM photovoltaic panel transmittance prediction model optimized by the improved dung beetle optimization algorithm, the improved dung beetle optimization algorithm is used to calculate the optimal parameters of the LSTM network, including the number of units in the LSTM layer, the initial value of the learning rate, and the strength of the L2 regularization term; a CNN layer is added before the LSTM layer, and an attention module is added after it to extract and focus on local features that affect the output to adapt the photovoltaic panel transmittance prediction model;
[0069] Step 1.3: Using the training sample set in the experimental sample data set to train the photovoltaic panel transmittance prediction model until the set training conditions are met, and using the test sample set to test;
[0070] Step 2: Obtain the real-time transmittance of the photovoltaic panel to be predicted and the environmental factor data affecting the transmittance;
[0071] Step 3: The real-time detected data is made into a data set and input into the LSTM photovoltaic panel transmittance prediction model optimized based on the improved dung beetle optimization algorithm for prediction; the real-time detected data includes but is not limited to photovoltaic panel transmittance, ambient temperature, humidity, wind speed, PM10 concentration and rainfall;
[0072] Step 4: Analyze the fitting coefficient and root mean square error and other indicators obtained from the prediction results. If the fitting coefficient and root mean square error and other indicators meet the set requirements, output prompts based on the degree of dust accumulation reflected by different transmittances.
[0073] In an optional embodiment, in step 1.2, when constructing an LSTM photovoltaic panel transmittance prediction model based on the improved dung beetle optimization algorithm, the specific steps of the improved dung beetle optimization algorithm include:
[0074] Step 1.2.1: Design the ball rolling, dancing, foraging, reproduction and stealing behaviors of dung beetles as modeling rules, and optimize the model hyperparameters, wherein each dung beetle population is composed of four different dung beetles, including ball rolling dung beetles, breeding dung beetles, foraging dung beetles and stealing dung beetles, specifically including:
[0075] (1) Initialize the parameters and use the Logistic mapping formula (1) to initialize the dung beetle population:
[0076] x n+1 =r×x n ×(1-x n ) (1)
[0077] Where r is a control parameter, usually between 3 and 4. x represents dung beetles, and n is the number of dung beetles.
[0078] (2) Calculate the fitness value of each dung beetle, find the current optimal fitness value and the worst fitness value, as well as the corresponding position;
[0079] (3) Execute the rolling behavior of the fusion golden sine strategy and update the position according to formula (2);
[0080] x i (t+1)=x i (t)×|sin R 1 |+R 2 ×sin R 2 ×|C 1 × i (t)-C 2 × i (t+1)| (2)
[0081] where x i (t+1) represents the updated position, xi (t) represents the position before updating, R 1 and R 2 is based on the random number generation angle, C 1 and C 2 is the angle associated with the golden section;
[0082] When encountering an obstacle and being unable to move forward, the dancing behavior is simulated to regain the route and the position is updated according to formula (3);
[0083] x i (t+1)=x i (t)+tanθ|x i (t)-x i (t-1)| (3)
[0084] Among them, θ is the deflection angle belonging to [0-π]. If θ is 0, π, or π / 2, the dung beetle does not update its position. i (t)-x i (t-1)| represents the difference between the position of the i-th dung beetle at the t-th iteration and its position at the t-1-th iteration.
[0085] (4) Execute the reproduction behavior and update the position according to formula (4);
[0086] B i (t+1)=X * +b 1 ×(B i (t)-Lb * )+b 2 ×(B i (t)-Ub * ) (4)
[0087]
[0088] Among them, B i (t) represents the position information of the i-th brooding ball in the t-th iteration, b 1 and b 2 are all 1×D random variables, where D represents the dimension of the optimization problem; X* represents the current optimal position, Lb* and Ub* represent the upper and lower bounds of the spawning area, respectively, and R = 1-t / T max , T max It is expressed as the maximum number of iterations, Lb and Ub represent the lower bound and upper bound of the optimization problem respectively.
[0089] (5) Execute the foraging behavior of the fusion adaptive t-distribution strategy and update the position according to formula (6);
[0090] x i(t+1)=bestXX+trnd(freen)×bestXX (6)
[0091]
[0092] Where bestXX is the current optimal solution, trnd is a function that generates random numbers that conform to the t distribution; t is the number of iterations, and M is the maximum number of iterations.
[0093] (6) Execute the theft behavior and update the position according to formula (8);
[0094] x i (t+1)=X b +S×g×(|x i (t)-X * |+|x i (t)-X b |) (8)
[0095] Among them, x i (t) represents the position of the i-th thief dung beetle in the t-th iteration, g is a 1×D random vector obeying the normal distribution, and S is a constant.
[0096] (7) Determine whether the end condition is met. If so, proceed to the next step; otherwise, jump to (2);
[0097] (8) The program ends and the optimal result is output.
[0098] The LSTM photovoltaic panel transmittance prediction method and system based on the improved dung beetle algorithm optimization of the above-mentioned embodiment of the present invention improves the prediction accuracy from the aspects of optimization algorithm, attention mechanism and neural network, so as to achieve the purpose of predicting the transmittance of photovoltaic panels;
[0099] Preferably, in one embodiment, in step 1.2, when constructing an LSTM photovoltaic panel transmittance prediction model based on the improved dung beetle optimization algorithm, a CNN layer is added before the LSTM layer, and the CNN layer is used to capture local features to improve the expression ability, operation efficiency and robustness of the model.
[0100] Preferably, in one embodiment, in step 1.2, when constructing an LSTM photovoltaic panel transmittance prediction model based on the improved dung beetle optimization algorithm, a self-attention mechanism is added after the LSTM layer. Running the attention mechanism can process all parts of the input sequence in parallel. The model can capture information in different representation subspaces, which helps to improve different time series characteristics and improve the computational efficiency and flexibility of the model.
[0101] Build a photovoltaic panel transmittance data acquisition model, which includes a material with the same material and tilt angle as the photovoltaic panel, and 12-16 light sensors installed under the material and a light sensor not covered by any material. The sensor is used to obtain the photovoltaic panel transmittance data, and other sensors are set near it to obtain other environmental data. In actual application, relevant data is obtained through detection and made into a transmittance prediction data set;
[0102] In an optional embodiment, the data set includes 5 influencing factor data and photovoltaic panel transmittance data; optionally, the embodiment of the present invention uses matlab technology to perform multi-level preprocessing operations on the data set, including data cleaning, feature engineering, outlier and missing value processing, and data smoothing operations; the specific steps are as follows:
[0103] Input original data set D;
[0104] Check whether there are missing values in the data set and calculate the total number of missing values N miss , if there are missing values, delete the rows containing missing values. The processing formula is:
[0105] D′=D(D≠miss) (9)
[0106] Check whether there are outliers in the data set and calculate the total number of outliers N out , if there are outliers, delete or replace them. The outlier processing formula is:
[0107] D″=D′(D′≠outlier) (10)
[0108] The processed data is smoothed by using Savitzkky-Golay filter. The smoothing formula is:
[0109]
[0110] Among them, S(i) represents the smoothing value at position i, W represents the window length, M represents the filter order, and a jk Represents the filter coefficients, and uses matlab technology to generate the corresponding .mat file, and obtains a processed data set of 312 groups of data; based on this, the data set is divided into training sets and test sets in a ratio of 8:2.
[0111] The embodiment of the present invention establishes an LSTM photovoltaic panel transmittance prediction model based on the improved dung beetle optimization algorithm through step 1 based on photovoltaic panel transmittance data sample training; the LSTM algorithm involved in the present invention includes a forget gate, an input gate and an output gate. The forget gate determines which information should be discarded or retained. Its formula is as follows:
[0112] f t =σ(W f ·[h t+1 ,x t ]+b f ) (12)
[0113] c t ' -1 =f t ×c t-1 (13)
[0114] Among them, f t is the output of the forget gate, σ is the sigmoid activation function, W f is the weight matrix of the forget gate, b f is the bias term, h t-1 is the hidden state of the previous time step, x t is the input of the current time step, c t-1 is the cell state at the previous time step.
[0115] The input gate and candidate hidden state determine which parts of the new input information should be added to the cell state. The formula is as follows:
[0116] i t =σ(W i ·[h t-1 ,x t ]+b i ) (14)
[0117]
[0118] Among them, i t is the output of the input gate, r t is the output of the forget gate, is the new candidate cell state, C t is the cell state at the current time step.
[0119] The output gate determines the final output. Its formula is as follows:
[0120] o t =σ(W o ·[ht-1 ,x t ]+b o ) (17)
[0121] h t =o t ×tanh(C t ) (18)
[0122] Among them, t is the output of the output gate, h t is the hidden state at the current time step.
[0123] In a preferred embodiment, in step 1.2, when constructing a photovoltaic panel transmittance prediction model, the present invention adds a CNN layer and a self-attention mechanism in front of the LSTM layer to capture local features and improve the prediction accuracy and robustness of the model; specifically, the following steps are included:
[0124] A sequence input layer is established to adapt to the time series characteristics of the input data. The scale of the input data is set to [15,1,1], which means that the time step is 15, the number of features is 1, and the data of each time step has 1 channel;
[0125] Construct a one-dimensional convolution layer, use 1 convolution kernel, the convolution kernel size is 32, and set "Padding" to "same" to keep the output size unchanged. The convolution operation is expressed as:
[0126]
[0127] Among them, x is the input feature sequence, w is the convolution kernel weight, i is the output sequence index, N is the convolution kernel size, and j is the index of the convolution kernel sliding;
[0128] Add a batch normalization layer to normalize the convolution output. The normalization formula is:
[0129]
[0130] Where x is the output of the convolutional layer, μ B and are the mean and variance of the batch data, respectively, and ε is a small constant added to avoid division by zero;
[0131] The ReLU activation layer is introduced to increase nonlinearity and accelerate the convergence of the model.
[0132] Add a self-attention layer to enhance the model's attention to key time step features by calculating attention scores and weighted averages. The calculation of the self-attention mechanism is expressed as:
[0133]
[0134] Among them, Q, K, and V are query, key, and value matrices respectively. K is the dimension of the key;
[0135] Preferably, in one embodiment, the method further comprises:
[0136] Step 1.4: Conduct an ablation experiment on the constructed LSTM photovoltaic panel transmittance prediction model based on the improved dung beetle optimization algorithm, and compare and analyze the prediction effects of different optimization designs through multiple evaluation indicators; the evaluation indicators include: fitting coefficient, root mean square error, mean square error, mean absolute error, and mean absolute percentage error.
[0137] In actual application, an ablation experiment is carried out on the LSTM photovoltaic panel transmittance prediction model optimized by the improved dung beetle optimization algorithm, and the prediction effects of different improvement points are compared and analyzed through multiple evaluation indicators; specifically, in order to verify the actual effect of the present invention on the prediction of photovoltaic panel transmittance, ablation experiments and comparative tests are carried out according to the following settings for comparative analysis.
[0138] The experimental environment is Windows operating system, the CPU is i7-13700K, the graphics card is NVIDIA GeForce RTX4060, the video memory is 16GB, and it is run using MATLAB R2023b version.
[0139] The training environment is the same as the test environment; the fitting coefficient R2, root mean square error RMSE, mean square error MSE, mean absolute error MAE, and mean absolute percentage error MAPE are used as the main evaluation indicators. The calculation formula is as follows:
[0140]
[0141] Where n is the number of data points, y i is the ith actual value, is the i-th predicted value. The closer R2 is to 1, the higher the prediction accuracy; the smaller the values of RMSE, MSE, MAE, and MAPE are, the more accurate the model's prediction is, which means the difference between the predicted value and the actual value is smaller.
[0142] In actual application, in ablation experiment 1, the LSTM photovoltaic panel transmittance prediction model optimized by the improved dung beetle optimization algorithm of the present invention (the improved dung beetle optimization algorithm) has three improved parts. In order to analyze the impact of each improved part on the model and verify whether each improved part is effective, seven groups of different improved methods can be designed to compare and analyze with the original model. All experiments are trained under the same constructed data set, the same environment and parameters. The results are shown in Table 1 below; "√" represents the application of the improved method, and "×" represents the non-application of the improved method:
[0143] Table 1 Ablation experiment 1 results
[0144]
[0145] From the ablation experiment results in Table 1, we can see that:
[0146] Baseline model (DBO-LSTM): Without any improvement method applied, the performance indicators of the model are R2=0.88589, RMSE=0.034676, MSE=0.000387, MAE=0.016716, and MAPE=1.6696%.
[0147] Improvement 1: Logistic mapping was applied, and R2 was improved to 0.89453, indicating that Logistic mapping had a positive impact on model performance.
[0148] Improvement 2: The golden sine strategy was applied, and R2 was further improved to 0.90897, indicating that the golden sine strategy also has a positive effect on model performance.
[0149] Improvement 3: The adaptive t-distribution strategy was applied, and the R2 reached 0.92354. The RMSE and MSE also decreased, indicating that the adaptive t-distribution strategy also has a significant effect on improving model performance.
[0150] Improvement 4: When Logistic Mapping and Golden Sine strategies were applied simultaneously, R2 decreased slightly to 0.92156, which may indicate that the combination of these two strategies did not produce a synergistic effect.
[0151] Improvement 5: Logistic mapping and adaptive t distribution strategies were applied simultaneously, and R2 was improved to 0.92954, which shows that the combination of these two strategies further improves the model performance.
[0152] Improvement 6: The golden sine strategy and adaptive t-distribution strategy were applied simultaneously, and the R2 reached 0.93062, further verifying the positive impact of these two strategies.
[0153] Improvement 7: All three improvement methods were applied at the same time, with the highest R2, reaching 0.93752, the lowest RMSE, MSE and MAE, and the smallest MAPE, indicating that the best model performance can be obtained by combining all the improvement methods. In summary, the results of ablation experiment 1 show that the three improvement methods of Logistic mapping, golden sine strategy and adaptive t distribution strategy can significantly improve the performance of the LSTM model in the photovoltaic panel transmittance prediction task, and the combination of these methods can further improve the prediction accuracy of the model. These findings have important guiding significance for further optimizing the model and improving the accuracy of prediction.
[0154] In ablation experiment 2, the LSTM photovoltaic panel transmittance prediction model (improved LSTM network) optimized by the improved dung beetle optimization algorithm of the present invention has two improved parts. In order to analyze the impact of each improved part on the model and verify whether each improved part is effective, 4 groups of different improved methods can be designed to compare and analyze with the original model. All experiments are trained under the same constructed data set, the same environment and parameters. The results are shown in Table 2 below; "√" represents the application of the improved method, and "×" represents the non-application of the improved method:
[0155] Table 2 Ablation experiment 2 results
[0156]
[0157] From the analysis of the experimental data in Table 2, we can see that IDBO-LSTM is a baseline model that does not use CNN layers and self-attention mechanisms. Its R2 value is 0.93752, which is a very good performance.
[0158] Improvement 10: The CNN layer was introduced. Compared with the baseline model, the R2 value increased to 0.94561, and the RMSE, MSE, and MAE all decreased, indicating that the CNN layer has a positive impact on the model performance.
[0159] Improvement 20: The CNN layer was removed and the self-attention mechanism was introduced. The R2 value dropped slightly to 0.94002, but the RMSE, MSE, and MAE also decreased compared with the baseline model, indicating that the self-attention mechanism also improved the model performance to a certain extent.
[0160] Improvement 30: CNN layer and self-attention mechanism are introduced at the same time. This configuration achieves the best performance in all indicators, with an R2 value of 0.97563, the lowest RMSE, MSE and MAE, and the smallest MAPE, indicating that combining CNN layer and self-attention mechanism can significantly improve the prediction performance of the model.
[0161] In summary, ablation experiment 2 shows that both the CNN layer and the self-attention mechanism can improve the performance of the LSTM network in the photovoltaic panel transmittance prediction task, and the combination of the two can bring the greatest performance improvement. This provides valuable insights for further optimizing the model.
[0162] Furthermore, in an optional embodiment, the evaluation index described in step 1.4 is used to compare the performance of the LSTM photovoltaic panel transmittance prediction model optimized by the improved dung beetle optimization algorithm with other prediction methods to evaluate the effectiveness of the LSTM photovoltaic panel transmittance prediction model optimized by the improved dung beetle optimization algorithm.
[0163] Specifically, in order to further verify the feasibility of the prediction network model algorithm of the present invention, the improved algorithm of the present invention is compared with other mainstream prediction methods, including NGO-LSTM, WOA-LSTM, DBO-LSTM, etc. The above algorithms are compared from five aspects: fitting coefficient, root mean square error, mean square error, mean absolute error and mean absolute percentage error. The results are shown in Table 3.
[0164] Table 3 Comparison of experimental results
[0165]
[0166] Analysis of the experimental data in Table 3 shows that under the same data set and experimental environment, the improved prediction model of the present invention has obvious advantages over the current mainstream prediction models; among them, the improved model IDBO-CNN-LSTM-Attention has improved fitting coefficients by 0.07001, 0.08742 and 0.02818 respectively compared with DBO-CNN-LSTM-Attention, NGO-CNN-LSTM-Attention and WOA-CNN-LSTM-Attention. RMSE, MSE, MAE and MAPE are all the lowest, and the comprehensive prediction effect is the best.
[0167] For the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the order of the actions described, because according to the present invention, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0168] It should be pointed out that in other embodiments of the present invention, the method can also obtain a new improved LSTM photovoltaic panel transmittance prediction method optimized by the dung beetle optimization algorithm by combining one or several of the above embodiments to achieve accurate prediction of the transmittance of the photovoltaic panel.
[0169] It should be noted that, based on the method in any one or more of the above-mentioned embodiments of the present invention, the present invention also provides a storage medium, on which is stored a program code that can implement the method as described in any one or more of the above-mentioned embodiments, and when the code is executed by the operating system, it can implement the LSTM photovoltaic panel transmittance prediction based on the improved dung beetle optimization algorithm as described above.
[0170] An LSTM photovoltaic panel transmittance prediction system, such as Figure 3 Shown include:
[0171] Data acquisition unit: responsible for collecting real-time transmittance data of photovoltaic panels and data on environmental factors that may affect transmittance;
[0172] Data preprocessing unit: automatically cleans the collected data, performs feature engineering, processes outliers and missing values, and performs data smoothing operations to form a sample data set suitable for model training;
[0173] Model training unit: Use the LSTM network optimized by the improved dung beetle optimization algorithm to train the photovoltaic panel transmittance prediction model; the model training unit includes:
[0174] The parameter initialization module initializes the dung beetle population according to the Logistic mapping and performs fitness calculations on the individuals in the population;
[0175] The behavior simulation module simulates the rolling, dancing, foraging, reproduction, and stealing behaviors of dung beetles to optimize the hyperparameters of the LSTM network;
[0176] Hyperparameter optimization module: Based on the results of the simulation behavior, the optimal parameters of the LSTM network are calculated, including the number of units, the initial value of the learning rate, and the L2 regularization strength;
[0177] Prediction model unit: An LSTM network that integrates a CNN layer and a self-attention mechanism to improve the model's ability to capture local features and the efficiency of processing time series features;
[0178] Prediction execution unit: receives the data set prepared by the data preprocessing unit, inputs it into the trained LSTM prediction model, and performs real-time prediction of transmittance;
[0179] Result analysis unit: analyzes the prediction results, including calculating the fitting coefficient, root mean square error and other indicators, and judges the dust accumulation degree of the light transmittance based on these indicators, and outputs the corresponding prompt signal;
[0180] System evaluation unit: conducts ablation experiments on the constructed prediction model, and compares and analyzes the prediction effects of different optimization designs through multiple evaluation indicators to verify the effectiveness of the model.
Claims
1. A LSTM photovoltaic panel dust accumulation prediction method based on IDBO optimization, characterized by: The following steps are involved: S1. Based on the photovoltaic panel transmittance data sample training, an LSTM photovoltaic panel transmittance prediction model optimized by the Improved DungBeetle Optimization (IDBO) algorithm is established to reflect the degree of dust accumulation through the transmittance. The process of establishing a photovoltaic panel transmittance prediction model includes the following operations: a. After obtaining the photovoltaic panel transmittance data samples as required, automatically preprocess them to form an experimental data sample data set, including a training data sample set and a test data sample set; b. Based on the LSTM photovoltaic panel transmittance prediction model optimized by the improved dung beetle optimization algorithm, the improved dung beetle optimization algorithm is used to calculate the optimal parameters of the LSTM network, including the number of units in the LSTM layer, the initial value of the learning rate, and the strength of the L2 regularization term; a CNN layer is added before the LSTM layer, and an attention module is added after it to extract and focus on local features that affect the output to adapt the photovoltaic panel transmittance prediction model; c. using the training data sample set in the experimental data sample data set to train the photovoltaic panel transmittance prediction model until the set training conditions are met, and using the test data sample set to perform testing; S2, obtaining the real-time transmittance of the photovoltaic panel to be predicted and the environmental factor data affecting the transmittance; S3, making the real-time detection data into a data set and inputting it into the LSTM photovoltaic panel transmittance prediction model optimized based on the improved dung beetle optimization algorithm for prediction; the real-time detection data includes photovoltaic panel transmittance, ambient temperature, humidity, wind speed, PM10 concentration and rainfall; S4. Analyze the fitting coefficient and root mean square error and other indicators obtained from the prediction results. If the fitting coefficient and root mean square error and other indicators meet the set requirements, output prompts based on the dust accumulation degree reflected by different transmittances.
2. According to claim 1, a LSTM photovoltaic panel dust accumulation degree prediction method based on IDBO optimization is characterized in that: When constructing the LSTM photovoltaic panel transmittance prediction model based on the improved dung beetle optimization algorithm in step b, the improved dung beetle optimization algorithm designs the rolling, dancing, foraging, breeding and stealing behaviors of dung beetles as modeling rules, and optimizes the model hyperparameters, wherein each dung beetle population is composed of four different dung beetles, including rolling dung beetles, breeding dung beetles, foraging dung beetles and stealing dung beetles, specifically including: a1. Initialize the parameters and use the Logistic mapping formula (1) to initialize the dung beetle population: x n+1 =r×x n ×(1-x n ) (1) Where r is the control parameter, usually between 3 and 4, x represents dung beetles, and n is the number of dung beetles; a2. Calculate the fitness value of each dung beetle, find out the current optimal fitness value and the worst fitness value, as well as the corresponding position; a3. Execute the rolling behavior of the golden sine strategy and update the position according to formula (2); x i (t+1)=x i (t)×|sinR1|+R2×sinR2×|C1×x i (t)-C2×x i (t+1)| (2) where x i (t+1) represents the updated position, x i (t) represents the position before the update, R1 and R2 are angles generated based on random numbers, and C1 and C2 are angles related to the golden section; When encountering an obstacle and being unable to move forward, the dancing behavior is simulated to regain the route and the position is updated according to formula (3); x i (t+1)=x i (t)+tanθx i (t)-x i (t-1)| (3) Among them, θ is the deflection angle belonging to [0-π]. If θ is 0, π, π / 2, the dung beetle does not update its position. i (t)-x i (t-1)| represents the difference between the position of the i-th dung beetle at the t-th iteration and its position at the t-1-th iteration; a4, execute the reproduction behavior and update the position according to formula (4); B i (t+1)=X * +b1×(B i (t)-Lb * )+b2×(B i (t)-Ub * ) (4) Among them, B i (t) represents the position information of the i-th brooding ball in the t-th iteration, b1 and b2 are both 1×D random variables, D represents the dimension of the optimization problem; X* represents the current optimal position, Lb* and Ub* represent the upper and lower bounds of the spawning area, respectively, and R = 1-t / T max , T max It is expressed as the maximum number of iterations, Lb and Ub represent the lower and upper bounds of the optimization problem respectively; a5, execute the foraging behavior of integrating the adaptive t-distribution strategy and update the position according to formula (6); x i (t+1)=bestXX+trnd(freen)×bestXX (6) Where bestXX is the current optimal solution, trnd is a function that generates random numbers that conform to the t distribution; t is the number of iterations, and M is the maximum number of iterations; a6. Perform the stealing behavior and update the position according to formula (8); x i (t+1)=X b +S×g×(|x i (t)-X*|+|x i (t)-X b |) (8) Among them, x i (t) represents the position of the i-th thief dung beetle in the t-th iteration, g is a 1×D random vector that follows a normal distribution, and S is a constant; a7, determine whether the end condition is met, if so, proceed to the next step, otherwise jump to a2; a8. The program ends and the optimal result is output.
3. According to claim 2, a LSTM photovoltaic panel dust accumulation degree prediction method based on IDBO optimization is characterized in that: In step b, when constructing the LSTM photovoltaic panel transmittance prediction model based on the improved dung beetle optimization algorithm, a CNN layer is added before the LSTM layer, and the CNN layer is used to capture local features to improve the model's expressiveness, operating efficiency, and robustness.
4. According to claim 3, a LSTM photovoltaic panel dust accumulation degree prediction method based on IDBO optimization is characterized in that: In step b, when constructing the LSTM photovoltaic panel transmittance prediction model based on the improved dung beetle optimization algorithm, an attention mechanism is added after the LSTM layer. Running the attention mechanism can process all parts of the input sequence in parallel. The model can capture information in different representation subspaces, which helps to improve different time series features and improve the computational efficiency and flexibility of the model.
5. According to claim 4, a LSTM photovoltaic panel dust accumulation degree prediction method based on IDBO optimization is characterized in that: In the step b, an ablation experiment is carried out on the LSTM photovoltaic panel transmittance prediction model constructed based on the improved dung beetle optimization algorithm, and the prediction effects of different optimization designs are compared and analyzed through multiple evaluation indicators; the evaluation indicators include: fitting coefficient, root mean square error, mean square error, mean absolute error and mean absolute percentage error.
6. The method for predicting dust accumulation degree of LSTM photovoltaic panels based on IDBO optimization according to claim 5 is characterized in that: In step a, multi-level preprocessing operations are performed on the acquired photovoltaic panel transmittance data and influencing factor data samples, including data cleaning, feature engineering, outlier and missing value processing, and data smoothing operations.
7. The LSTM photovoltaic panel dust accumulation prediction system based on IDBO optimization according to claim 6 is characterized in that: include: Data acquisition unit: responsible for collecting real-time transmittance data of photovoltaic panels and data on environmental factors that may affect transmittance; Data preprocessing unit: automatically cleans the collected data, performs feature engineering, processes outliers and missing values, and performs data smoothing operations to form a sample data set suitable for model training; Model training unit: Use the LSTM network optimized by the improved dung beetle optimization algorithm to train the photovoltaic panel transmittance prediction model; The model training unit includes: The parameter initialization module initializes the dung beetle population according to the Logistic mapping and performs fitness calculations on the individuals in the population; The behavior simulation module simulates the rolling, dancing, foraging, reproduction, and stealing behaviors of dung beetles to optimize the hyperparameters of the LSTM network; Hyperparameter optimization module: Based on the results of the simulation behavior, the optimal parameters of the LSTM network are calculated, including the number of units, the initial value of the learning rate, and the L2 regularization strength; Prediction model unit: An LSTM network that integrates a CNN layer and a self-attention mechanism to improve the model's ability to capture local features and the efficiency of processing time series features; Prediction execution unit: receives the data set prepared by the data preprocessing unit, inputs it into the trained LSTM prediction model, and performs real-time prediction of transmittance; Result analysis unit: analyzes the prediction results, including calculating the fitting coefficient, root mean square error and other indicators, and judges the dust accumulation degree of the light transmittance based on these indicators, and outputs the corresponding prompt signal; System evaluation unit: conducts ablation experiments on the constructed prediction model, and compares and analyzes the prediction effects of different optimization designs through multiple evaluation indicators to verify the effectiveness of the model.
Citation Information
Cited By
Visual detection system for dust deposition of photovoltaic panel based on deep learning and cloud monitoring platform
CN120125549A
Photovoltaic panel dusting visualization detection system based on deep learning and cloud monitoring platform
CN120125549B
Neural network photovoltaic ash deposition prediction method based on ship swing characteristics
CN121009296A
Neural network-based dust deposition prediction method for photovoltaic panels based on ship rolling characteristics
CN121009296B
