A photovoltaic power generation prediction method based on an improved long short-term memory neural network

By combining the escape bird search algorithm with the optimization of the hyperparameter selection of the long short-term memory neural network, the problems of insufficient accuracy and timeliness in photovoltaic power generation prediction are solved, and higher accuracy and better real-time photovoltaic power generation prediction are achieved.

CN116451826BActive Publication Date: 2026-04-10NORTHWESTERN POLYTECHNICAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-20
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

In existing photovoltaic power generation prediction models, the manual selection of hyperparameters in LSTM neural networks results in low accuracy and poor timeliness, failing to meet the power generation prediction needs of photovoltaic systems.

Method used

The Escape Bird Search (EBS) algorithm is used to optimize the hyperparameter selection of the Long Short-Term Memory Neural Network (LSTM). The EBS algorithm automatically searches for the optimal hyperparameters and combines them with the LSTM model to predict photovoltaic power generation, thereby improving the accuracy and real-time performance of the model.

Benefits of technology

The optimized OLSTM model significantly improves the accuracy and timeliness of photovoltaic power generation forecasts. Its prediction performance is significantly better than that of the traditional LSTM model under both multiple input data and single input data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116451826B_ABST
    Figure CN116451826B_ABST
Patent Text Reader

Abstract

The application relates to a photovoltaic power generation prediction method based on an improved long short-term memory neural network, an EBS optimization algorithm proposed by Mohsen Shahrouzi is applied, an OLSTM model is further proposed after original learning data and an LSTM layer are used to provide an LSTM neural network super parameter, and the OLSTM model can obtain an optimization result with higher prediction precision and real-time performance than a traditional model. The LSTM neural network is composed of m hidden layers with m*n units and one dense layer, the EBS algorithm can be used to complete selection of high-precision super parameters, the OLSTM model is used to input super parameters X Gbest , normalized data is trained through an LSTM training function and a prediction function in an MATLAB toolbox, power is predicted again, and finally, a prediction value is obtained. Compared with a traditional LSTM model, the OLSTM combining the EBS optimization and the LSTM neural network can replace super parameters found by manual calculation through automatic search of a set of optimal super parameters, so that the precision is significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of photovoltaic power generation prediction method, and relates to a photovoltaic power generation prediction method based on an improved long short-term memory neural network, and relates to an optimization algorithm for solving the problem of artificial super parameter selection in the improved long short-term memory neural network. BACKGROUND

[0002] In traditional prediction models, mathematical and physical models based on historical data are often used, and some actual conditions are usually ignored in the construction. In order to solve such a problem, new prediction methods are proposed by solving the regression problem of time series prediction. In actual engineering application, a nonlinear autoregressive recurrent neural network algorithm is realized to predict short-term photovoltaic output power with the aid of meteorological data. A two-stage recurrent neural network can also be used to predict solar irradiance and cloud cover, and further predict the output. Although the above methods can provide a relatively good prediction result, the artificial neural network with a shallow configuration will be limited by insufficient storage capacity, and problems such as memory decay and gradient disappearance caused thereby will lead to an unsatisfactory prediction result. The deep learning method (DL) has been introduced into the prediction problem since its development due to its great data processing capacity and nonlinear fitting capacity. The convolutional neural network (CNN) has been used to predict the photovoltaic power generation based on sky images, and the method of resampling and data expansion is used to balance the number of sky images under various atmospheric conditions, thereby improving the prediction accuracy. The long short-term memory (LSTM) neural network in the DL has very good prediction ability in different confidence percentages. Although the above models have considered the influence factors such as photovoltaic site selection, weather conditions and data feature extraction, the artificial super parameter selection in the LSTM prediction model brings the disadvantages of low accuracy and poor timeliness. Considering the accuracy and convenience of the EBS optimization algorithm, the LSTM model combined with the EBS algorithm is used for super parameter selection and data prediction. The results show that the prediction accuracy and timeliness are obviously better than those of the traditional LSTM model.

[0003] The escape bird algorithm is an optimization search strategy developed from mathematics inspired by the behavior of birds hunting prey outdoors, which is different from other meta-heuristic algorithms. First, from the practical point of view, the EBS algorithm is a parameter-free meta-heuristic algorithm for global optimization, which is simple to use and powerful. At the same time, although the artificial selection of super parameters used in the traditional LSTM algorithm can meet the needs of some scenes, the accuracy is low, and for the prediction of photovoltaic system power generation, the LSTM neural network still has room for improvement. SUMMARY

[0004] TECHNICAL PROBLEM TO BE SOLVED

[0005] In order to avoid the prior art, the present application proposes a photovoltaic power generation prediction method based on an improved long short-term memory neural network, which modifies the LSTM neural network algorithm. By combining the advantages of the EBS algorithm, that is, considering the influence of the initial weight, the performance of the algorithm is improved, and the EBS neural network algorithm obtains better dynamic performance in the application of the PV system. The selection of the hyperparameters is adjusted by using EBS to improve the accuracy of the LSTM neural network algorithm.

[0006] Technical scheme

[0007] A photovoltaic power generation prediction method based on an improved long short-term memory neural network, characterized by the following steps:

[0008] Step 1: normalize the collected data:

[0009]

[0010] Wherein: y m (m=1, 2, 3) represents the original data, y1 is the power; y2 is the solar irradiance; y3 is the ambient temperature; and y m,max , y m,min correspond to the maximum and minimum values of each parameter; (n=1, 2, 3) corresponds to the original parameter y m (m=1, 2, 3) normalized data, is the normalized power, and -1<y n <1;

[0011] The processed data is divided into two groups, one group of 80% of the total data set is selected as the training set, and the prediction model is obtained by the neural network; the other group uses the remaining 20% data as the test set;

[0012] Step 2: In the EBS algorithm, initialize the hyperparameters X i of the LSTM by the following formula max :

[0013]

[0014] Where, X i ∈[N,D], [N,D] is used to measure the size of the given hyperparameter matrix, N represents the number of given hyperparameters, D represents the dimension, that is, the number of parameters, T max represents the maximum number of iterations to provide the termination condition of the loop; Lb i represents the lower boundary value of the hyperparameter, ub i represents the upper boundary value of the hyperparameter, and R is a random vector;

[0015] Step 3: Evaluate the power values ​​under all hyperparameters and save the optimal hyperparameters to X. Gbest This forms the hyperparameter matrix;

[0016] The optimal hyperparameter X Gbest The hyperparameters corresponding to the minimum mean square error (MSE) are:

[0017]

[0018] Where: P p (i) is the predicted power value. The actual power value is represented by i, where i indicates the power value at which point and n is the total number of power values.

[0019] Step 4: Randomly select a pair of hyperparameters from the hyperparameter matrix, defining them as AB and EB. The mean square error (MSE) of AB is less than that of EB. The influence factor of AB is CR, and the influence factor of EB is ER.

[0020]

[0021] CR = 1 - ER

[0022] Among them, MP EB The mean squared error (MSE) of EB, MP AB This represents the mean square error (MSE) of AB.

[0023] The size of the hyperparameters is represented by the following formulas:

[0024] MP i =b i *||V i || β

[0025]

[0026] Where: ||V i || is the Euclidean distance, corresponding to the aforementioned matrix orientation, b i It is achieved through the maximum and minimum fit values ​​C of the hyperparameters. max C min and initial value C i The calculation shows that ε is a minimum constant that avoids the denominator being zero;

[0027] Step 5: Update the hyperparameters using the following formula, and evaluate them using the mean squared error (MSE) from Step 3, comparing it with the original X. Gbest If a comparison is made, Compare X Gbest If the error is smaller, then... Assign to X Gbest Similarly, if Compare X Gbest If the error is smaller, then... Assign to X Gbest ;

[0028]

[0029]

[0030] Where r1 and r2 are random numbers between 0 and 1, X AB ,X EB Let X be the initial values ​​of two hyperparameters, updated in opposite directions. Gbest It is the optimal hyperparameter, Opp(X) AB ) represents X AB The reverse vector of ;

[0031] Step 6: Return to step 4 for iterative calculation. After reaching the maximum number of iterations, obtain the hyperparameter X. Gbest Input the data into the LSTM neural network and normalize the data. The power is then predicted by training and predicting the LSTM using the MATLAB toolbox, ultimately yielding the predicted value P. p .

[0032] The predicted value P p The evaluation is: the predicted value P p Output and The predictive performance is evaluated by comparing the mean squared error (MSE), standard deviation (RMSE), mean absolute error (MAE), and correlation coefficient (R).

[0033] The mean square error of the assessment

[0034] The standard deviation

[0035] The mean absolute error

[0036] The correlation coefficient

[0037] Beneficial effects

[0038] This invention proposes a photovoltaic (PV) power generation prediction method based on an improved Long Short-Term Memory (LSTM) neural network. While the neural network already considers factors such as PV site selection, weather conditions, and data feature extraction when predicting PV system power generation, the accuracy of the prediction model configuration is still insufficient due to manually selected hyperparameters. However, by applying the EBS optimization algorithm proposed by Mohsen Shahrouzi, and providing the original learning data and hyperparameters of an LSTM neural network composed of LSTM layers, an OLSTM model is further proposed, resulting in optimized results with higher prediction accuracy and real-time performance than traditional models. The LSTM neural network consists of m*n units in m hidden layers and one dense layer. Choosing the specific numbers m and n is the hyperparameter selection problem, which can be achieved using the EBS algorithm with high precision. The OLSTM model is used as the input hyperparameter X. Gbest and normalized data The power is then trained using the LSTM training and prediction functions in the MATLAB toolbox, and the predicted value is finally obtained.

[0039] The specific contributions of this work are as follows:

[0040] (1) Based on the LSTM neural network algorithm, which has been applied to the prediction of photovoltaic power generation, an optimization algorithm OLSTM is proposed to enhance the accuracy of power generation prediction in PV system.

[0041] (2) Taking into account both single-input prediction and multiple-input prediction, the prediction results of OLSTM for photovoltaic power generation are compared and analyzed with those of LSTM, and the performance differences between the two models are shown by visualization.

[0042] (3) Use performance indicators of optimization design problems, including mean absolute error (MAE), root mean square error (RMSE), and correlation coefficient (R), to improve the accuracy and comprehensiveness of performance evaluation.

[0043] Compared to traditional LSTM models, OLSTM, which combines EBS optimization with LSTM neural networks, can automatically search for an optimal set of hyperparameters instead of manually calculated hyperparameters, thus significantly improving accuracy. Attached Figure Description

[0044] Figure 1 Flowchart of the EBS-optimized LSTM neural network method in this paper.

[0045] Figure 2 Comparison of OLSTM and LSTM predictions with actual power generation based on single input data with varying numbers of generating units.

[0046] Figure 3 Comparison of R-values ​​between OLSTM and LSTM models for single-input variable time series data of different lengths. Detailed Implementation

[0047] The present invention will now be further described in conjunction with the embodiments and accompanying drawings:

[0048] Although neural networks are used to predict PV system power generation, influencing factors such as photovoltaic site selection, weather conditions, and data feature extraction are already considered, the accuracy of the prediction model configuration is still insufficient due to manually selected hyperparameters. However, by applying the EBS optimization algorithm proposed by Mohsen Shahrouzi, and providing the original learning data and the hyperparameters of an LSTM neural network composed of LSTM layers, an OLSTM model is further proposed, resulting in optimized results with higher prediction accuracy and real-time performance than traditional models. An LSTM neural network consists of m*n units in m hidden layers and 1 dense layer. Choosing the specific numbers m and n is the hyperparameter selection problem, which can be achieved using the EBS algorithm with high precision. The method flow is as follows: Figure 1 As shown, the specific steps are as follows:

[0049] (1) The collected data is normalized using Equation (1) to mitigate the adverse effects of data fluctuations. The processed data is then divided into two groups. One group uses 80% of the total dataset for training, and a prediction model is obtained through a neural network. The other group uses the remaining 20% ​​of the data for testing.

[0050]

[0051] Among them, y m (m=1,2,3) represents the original data (y1 is power; y2 is solar irradiance; y3 is ambient temperature), while y m,max y m,min For each parameter, the maximum and minimum values ​​are... (n = 1, 2, 3) corresponds to the original parameter y m (m=1,2,3) Normalized data (where, (where the power is normalized), and -1 <y n <1.

[0052] (2) In the EBS algorithm, the hyperparameters X of the LSTM are initialized by the following formula. i Given the required initial parameters N, D, T max .

[0053]

[0054] Among them, X i ∈[N,D], where [N,D] measures the size of a given hyperparameter matrix, where N represents the number of hyperparameters, D represents the dimension (i.e., the number of parameters), and T... max The maximum number of iterations indicates the termination condition of the loop. Lb i ub represents the lower bound value of the hyperparameter. i Let R represent the upper boundary value of the hyperparameter, where R is a random vector.

[0055] (3) Evaluate the power values ​​under all hyperparameters and save the optimal hyperparameters to X. Gbest That is, the hyperparameter corresponding to the minimum mean square error (MSE) is the optimal hyperparameter X. Gbest .

[0056]

[0057] Among them, P p (i) is the predicted power value. The actual power value is represented by i, which indicates the power level, and n is the total number of power values.

[0058] (4) Randomly select a pair of hyperparameters AB and EB from the hyperparameter matrix, where AB represents the better one. The influence factor for selecting the optimal value is CR, and the corresponding influence factor ER can be expressed as follows: Equation (4a) and Equation (4b):

[0059]

[0060] CR = 1 - ER (4b)

[0061] Among them, MP EB and MP AB This represents the performance difference between EB and AB. This is determined by two factors: the environmental factors of the hyperparameters, i.e., their matrix orientation, and the geometric factors, i.e., the size of the hyperparameters, which are expressed by the following formulas:

[0062] MP i =b i *||V i || β (4c)

[0063]

[0064] Where, ||V i || is the Euclidean distance, corresponding to the aforementioned matrix orientation, b i It is achieved through the maximum and minimum fit values ​​C of the hyperparameters. max C min and initial value C iThe calculation shows that ε is the smallest constant that avoids a denominator of zero.

[0065] (5) Update the hyperparameters using the following formula, and evaluate them using Equation (3), comparing them with the original X. Gbest If a comparison is made, Compare X Gbest If the error is smaller, then... Assign to X Gbest Similarly, if Compare X Gbest If the error is smaller, then... Assign to X Gbest .

[0066]

[0067]

[0068] Where r1 and r2 are random numbers between 0 and 1, X AB ,X EB Let X be the initial values ​​of two hyperparameters, updated in opposite directions. Gbest It is the optimal hyperparameter, Opp(X) AB ) represents X AB The reverse vector of ,.

[0069] (6) After the optimization conditions are met, input the hyperparameter X. Gbest and normalized data The power is then predicted by training and predicting the LSTM using the MATLAB toolbox, ultimately yielding the predicted value P. p And the predicted value P p Output and Comparisons were made. Predictive performance was evaluated using the mean squared error (MSE), standard deviation (RMSE), mean absolute error (MAE), and correlation coefficient (R).

[0070]

[0071]

[0072]

[0073]

[0074] In the implementation example:

[0075] (1) Results analysis of single input data

[0076] Depend on Figure 2It is evident that the EBS optimization algorithm allows LSTM to achieve higher prediction accuracy with a simple structure and an acceptable timeframe. To address the visualization issue, the predicted and actual values ​​are magnified. The magnified image shows that the blue line representing OLSTM is closer to the actual result. Table 1 also shows that the OLSTM prediction model outperforms the traditional LSTM model in various metrics, exhibiting lower MSE, RMSE, and MAE, and a higher correlation coefficient R.

[0077] Table 1 Comparison of power generation prediction between OLSTM and LSTM models based on a single input variable

[0078]

[0079] (2) Results analysis of multiple input data

[0080] Because it considers not only hyperparameter optimization and data sequence length, but also many other relevant factors, the OLSTM neural network achieves a better fit. Due to the large amount of prediction data, the prediction results and evaluation metrics within the last 14 hours are presented as follows: Figure 3 As shown in Table 2:

[0081] Figure 3 The purple line represents the expected value, the nearest blue line is the prediction result of the OLSTM model, and the other lines are the prediction results of the LSTM model. The fitting curve results show that, in time series data of different lengths based on multiple input data, the OLSTM prediction results are significantly better than the traditional LSTM model.

[0082] Table 2 Comparison of power generation prediction based on OLSTM and LSTM models with multiple input variables

[0083] Prediction model MSE RMSE Reduction (%) MAE Reduction (%) R Increase (%) OLSTM 60 0.0078 0.0884 --- 0.0522 --- 0.9904 --- LSTM 50 0.0090 0.0949 13.33 0.0563 7.28 0.9891 0.13 LSTM 70 0.0088 0.0937 11.36 0.0542 3.69 0.9893 0.11 LSTM 80 0.0092 0.0958 15.22 0.0564 7.45 0.9891 0.13 LSTM 40 0.0087 0.0933 10.34 0.0546 4.40 0.9896 0.08

[0084] The evaluation metrics in Table 2 show the changes in MSE, RMSE, MAE, and R of the OLSTM model. The results show that the average metrics decreased from 0.0090, 0.0088, 0.0092, and 0.0087 to 0.0078, with the most significant decrease being 15.22%. The average MAE decreased from 0.0563, 0.0542, 0.0564, and 0.0546 to 0.0522, with the most significant decrease being 7.5%, while the average R only showed a relatively slight improvement. The LSTM model with optimized hyperparameters and numerical values ​​(60) regarding the length of the time series data has higher prediction accuracy and better prediction performance than the standard LSTM model.

[0085] To address the shortcomings of traditional LSTM neural network models, which suffer from low accuracy and poor timeliness due to extensive manual experimentation in selecting hyperparameters, a photovoltaic power generation prediction model based on the escape bird search algorithm and an optimized long short-term memory algorithm is proposed. Simulation results using historical hourly power generation and synchronous data from Perth, Australia, demonstrate that the prediction accuracy of the OLSTM neural network is improved compared to the LSTM prediction model. This significantly enhances the real-time performance and accuracy requirements of LSTM system control. Furthermore, the EBS optimization algorithm can also be used to handle practical optimization problems in the renewable energy field, exhibiting powerful global optimization capabilities.

Claims

1. A photovoltaic power generation prediction method based on an improved long short-term memory neural network, characterized in that... The steps are as follows: Step 1: Normalize the collected data: in: , For power, Solar irradiance, For ambient temperature; and , The maximum and minimum values ​​of each parameter; Corresponding original parameters n=1,2,3 The normalized power is, and ; The processed data was divided into two groups. One group, consisting of 80% of the total dataset, was selected as the training set, and a prediction model was obtained through a neural network. The other group, consisting of the remaining 20% ​​of the data, was used as the test set. Step 2: In the EBS algorithm, initialize the hyperparameters of the LSTM using the following formula. Given the required initial parameters N and D, : in, , Used to measure the size of a given hyperparameter matrix, where N represents the number of given hyperparameters and D represents the dimension, i.e., the number of parameters. The maximum number of iterations indicates the termination condition of the loop; This represents the lower boundary value of the hyperparameter. Represents the upper boundary value of the hyperparameter, where R is a random vector; Step 3: Evaluate the power values ​​under all hyperparameters and save the optimal hyperparameters to [location missing]. This forms the hyperparameter matrix; The optimal hyperparameters The hyperparameters corresponding to the minimum mean square error (MSE) are: in: It is a predicted power value. The actual power value is represented by i, where i indicates the power value at which point and n is the total number of power values. Step 4: Randomly select a pair of hyperparameters from the hyperparameter matrix, defining them as AB and EB. The mean square error (MSE) of AB is less than that of EB. The influence factor of AB is CR, and the influence factor of EB is ER. in, The mean squared error (MSE) of EB. This represents the mean square error (MSE) of AB. The size of the hyperparameters is represented by the following formulas: in: It is the Euclidean distance, corresponding to the matrix orientation. It is achieved through the maximum and minimum fit values ​​of hyperparameters. and initial value Calculated, It is the smallest constant that avoids a denominator of zero; Step 5: Update the hyperparameters using the following formula, and evaluate them using the mean squared error (MSE) from Step 3, comparing it with the original... If a comparison is made, Compare , If the error is smaller, then... Assigned Similarly, if Compare , If the error is smaller, then... Assigned ; in, , A random number between 0 and 1. These are the initial values ​​for the two hyperparameters, and the updates are in opposite directions. It is the optimal hyperparameter. express The reverse vector; Step 6: Return to step 4 for iterative calculation. After reaching the maximum number of iterations, obtain the hyperparameters. Input the data into the LSTM neural network and normalize the data. The power is then trained using the LSTM training and prediction functions provided in the MATLAB toolbox, and the predicted value is finally obtained. .

2. The photovoltaic power generation prediction method based on an improved long short-term memory neural network according to claim 1, characterized in that: The predicted value The assessment is: to predict the value Output and The predictive performance is evaluated by comparing the mean squared error (MSE), standard deviation (RMSE), mean absolute error (MAE), and correlation coefficient (R).

3. The photovoltaic power generation prediction method based on an improved long short-term memory neural network according to claim 2, characterized in that: The mean square error of the assessment .

4. The photovoltaic power generation prediction method based on an improved long short-term memory neural network according to claim 2, characterized in that: The standard deviation .

5. The photovoltaic power generation prediction method based on an improved long short-term memory neural network according to claim 2, characterized in that: The mean absolute error .

6. The photovoltaic power generation prediction method based on an improved long short-term memory neural network according to claim 2, characterized in that: The correlation coefficient .