Load Forecasting Method Based on PSO-LSTM

Research Article
Open access

Load Forecasting Method Based on PSO-LSTM

Zhaotong Chen 1*
  • 1 College of Electronic Information and Automation, Tianjin University of Science and Technology    
  • *corresponding author 1735606289@qq.com
ACE Vol.149
ISSN (Print): 2755-273X
ISSN (Online): 2755-2721
ISBN (Print): 978-1-80590-061-0
ISBN (Online): 978-1-80590-062-7

Abstract

Load forecasting plays a crucial role in fields such as energy management and power system planning. Accurate forecasting can effectively reduce energy costs and enhance the stability and reliability of power systems. Traditional forecasting methods struggle to balance forecasting accuracy and efficiency when dealing with complex and variable load data. Although the Long Short-Term Memory network (LSTM) can address the long-term dependency problem in time series and shows certain advantages in load forecasting, the setting of its initial parameters has a significant impact on the forecasting results, and it is prone to getting trapped in local optima. The Particle Swarm Optimization algorithm (PSO), based on swarm intelligence, has powerful global search capabilities and fast convergence. This paper proposes a load forecasting method based on PSO-LSTM, which uses PSO to optimize the parameters of LSTM, thereby enhancing the generalization ability and forecasting accuracy of the model. Through case-based analysis and comparison, it can be seen that compared with traditional forecasting methods, this method effectively improves the accuracy of load forecasting and provides strong support for the efficient and stable operation of power systems.

Keywords:

Load Forecasting, PSO, LSTM, Artificial Intelligence

Chen,Z. (2025). Load Forecasting Method Based on PSO-LSTM. Applied and Computational Engineering,149,7-11.
Export citation

1. Introduction

With the rapid development and continuous expansion of smart grids, load forecasting plays an extremely important role in the operation of power systems. Efficient and accurate load forecasting helps to ensure the dynamic balance between power supply and demand in power systems. It also enables power departments to rationally formulate production and dispatch plans, thereby effectively reducing the operating costs of power grids [1].

Currently, load forecasting methods can be divided into traditional physical methods and traditional statistical methods. Reference [2] used the exponential smoothing method to predict the annual load of a region. Reference [3] applied the grey system theory method to achieve multi-factor electricity load forecasting. Reference [4] utilized the regression model method to forecast the daily maximum load of a region. Reference [5] employed the time-series method to predict the daily load of a power sales company.

Although traditional load forecasting methods are still effective in most cases, with the development and update of society, power systems are becoming more complex and large-scale. Therefore, the factors to be considered in power load forecasting are becoming more complex and diverse. Climate conditions, social conditions, political conditions, and economic conditions all need to be comprehensively considered in power load forecasting. Power system load forecasting methods based on artificial intelligence algorithms can not only overcome various disadvantages of traditional manual forecasting but also possess certain automation and intelligence characteristics, reducing the burden on technicians of power load forecasting systems [6].

This paper proposes a load forecasting method based on PSO-LSTM. First, pre-processing operations such as normalization are performed on the original load data. Second, the PSO algorithm is used to find the optimal parameters of the LSTM model. Finally, through case-based analysis and comparison, it can be seen that compared with traditional forecasting methods, this method has significant advantages in indicators such as RMSE, MAE, and R2, effectively improving the accuracy of load forecasting.

2. LSTM Forecasting Method Based on PSO

The memory structure of LSTM enables it to effectively process time - series information in load data and reflect the potential relationships between load data at different time points. When using LSTM for load forecasting, the problems lie in the pre - processing of load data and the determination of hyperparameters. For the load forecasting method proposed in this paper, which combines PSO and LSTM, the specific process is as follows:

1. First, clarify the input and output variables of the model. The input variables need to comprehensively consider various influencing factors, and the output variables are precisely set according to the forecasting target. Then, pre-process the input and output data sets respectively, and perform normalization on the data. Finally, divide it into a training set, a validation set, and a test set in a certain proportion.

2. Construct an LSTM network, including an input layer, a hidden layer, and an output layer. Determine hyperparameters such as the number of time steps in the input layer, the dimension of the input layer, the number of hidden layers, the number of hidden units, and the dimension of the output-layer variables. Randomly initialize parameters such as the weights and biases of the LSTM model.

3. Optimize the LSTM model using the PSO algorithm. Determine the optimization objects and goals, initialize the particle swarm, where each particle represents a set of LSTM model hyperparameter combinations, and then perform iterative optimization.

4. Conduct model training and prediction. Input the multi - feature combination set and the training set into the optimized LSTM model, and train the optimized LSTM model based on the optimal hyperparameter combination. Input the multi-feature combination set into the trained and optimized LSTM model to obtain the predicted hourly power load data.

5. Compare the predicted hourly power load data with the data in the test set, and calculate evaluation indicators such as the root-mean-square error.

During data pre-processing, collect historical hourly power load data and corresponding meteorological data in the target area, such as hourly solar radiation intensity and temperature. Use methods such as box plots to identify outliers in the historical hourly power load data. For outliers, the average value of the data at the previous and subsequent moments can be taken for re-assignment. Normalize the processed historical hourly power load data, mapping the data to the interval [0, 1]. The normalization formula is:

\( {x_{norm}}=\frac{{x_{i}} - {x_{min}}}{{x_{max}} {- x_{min}}} \)

where \( {x_{norm}} \) represents the result after normalization processing, \( {x_{i}} \) represents the power load data at the i-th moment, \( {x_{max}} \) represents the maximum value of the hourly power load data, and \( {x_{min}} \) represents the minimum value of the hourly power load data. Then, divide the results of the normalization processing into a training set and a test set in a certain proportion (such as 8:2). Extract the time-feature data of normal historical hourly power load data, such as historical hourly power load data on working days, weekends, and public holidays, and combine it with meteorological data to construct a multi-feature combination set.

To construct an LSTM model, first determine the network structure. Build an LSTM network, including an input layer, a hidden layer, and an output layer. Determine hyperparameters such as the number of time steps in the input layer, the dimension of the input layer, the number of hidden layers, the number of hidden units, and the dimension of the output-layer variables. Randomly initialize parameters such as the weights and biases of the LSTM model.

When using the PSO algorithm to optimize the LSTM model, first determine the number of hidden units in the LSTM model, the batch size, the initial learning rate, and the time step as the optimization objects, and use the negative of the coefficient of determination calculated based on the prediction results as the optimization goal. Set parameters such as the size of the particle swarm, the inertia weight, the cognitive learning factor, and the social learning factor. Each particle represents a set of LSTM model hyperparameter combinations. Construct a new LSTM model according to the hyperparameter combination represented by each particle, and use the training set for training and prediction. Calculate the corresponding coefficient of determination as the fitness value of the particle. Then update the particle positions and velocities. Determine the global best particle position gBest and the historical best particle position pBest through the negative coefficient of determination, and update the velocities v and positions x of ordinary particles and local-optimal particles according to the following formulas:

\( v_{ \begin{array}{c} id \\ \end{array} }^{k+1}=ωv_{id}^{k}+{c_{1}}{r_{1}}(pBest_{id}^{k}-x_{id}^{k})+{c_{2}}{r_{2}}(gBest_{d}^{k}-x_{id}^{k}) \)

\( x_{id}^{k+1}=x_{id}^{k}+v_{id}^{k+1} \)

where k represents the iteration number, i represents the particle number, d represents the dimension, and \( {r_{1}} \) and \( {r_{2}} \) are random numbers between [0, 1]. Repeat the above steps until the coefficient of determination reaches the best score or the maximum number of iterations is reached, and obtain the optimal hyperparameter combination.

Input the multi-feature combination set and the training set into the optimized LSTM model, and train the optimized LSTM model based on the optimal hyperparameter combination. During the training process, the backpropagation algorithm can be used to adjust the parameters of the model to minimize the loss function, such as the mean-square error and the mean-absolute error. Input the multi-feature combination set into the trained and optimized LSTM model to obtain the predicted hourly power load data. Then compare the predicted hourly power load data with the data in the test set, and calculate evaluation indicators such as the root-mean-square error, the mean-absolute error, and the coefficient of determination. The formula for the root-mean-square error is:

\( RMSE=\sqrt[]{\frac{1}{m}\sum _{i=1}^{m}{({y_{i}}-\hat{{y_{i}}})^{2}}} \)

where \( RMSE \) represents the root-mean-square error, \( m \) is the number of hourly power load data, \( {y_{i}} \) represents the actual value of the i-th data in the test set, and \( \hat{{y_{i}}} \) represents the value of the i-th predicted hourly power load data.

The formula for the mean-absolute error is:

\( MAE=\frac{1}{m}\sum _{i=1}^{m}|{y_{i}}-\hat{{y_{i}}}| \)

The formula for the coefficient of determination is:

\( {R^{2}}=\frac{\sum _{i=1}^{m}({y_{i}}-\bar{y})(\hat{{y_{i}}}-\bar{\hat{y}})}{\sqrt[]{\sum _{i=1}^{m}{({y_{i}}-\hat{y})^{2}}\sum _{i=1}^{m}{(\hat{{y_{i}}}-\bar{\hat{y}})^{2}}}} \)

where \( \bar{y} \) represents the average value of the actual values, and \( \bar{\hat{y}} \) represents the average value of the predicted values.

3. Case-Based Analysis

In this study, there are a total of 1120 data points, covering load information in different seasons, working days, and holidays, which has good representativeness.

In the pre-processing stage, first, normalize the data, mapping all data to the interval [0, 1] to accelerate model convergence. Subsequently, training samples are constructed through the sliding-window technique. Each sample contains 10 historical load data and their corresponding load values at the next 2 moments. The data set is divided into a training set and a test set in a 70%:30% ratio. The training set contains 784 samples, which are used for model training and parameter learning; the test set contains 336 samples, which are used to evaluate the generalization ability of the model.

In this experiment, the LSTM network is set to 2 layers, with 80 neurons in the first layer and 128 neurons in the second layer. The Adam optimizer is used, and the learning rate is set to 0.0059222.

The root-mean-square error (RMSE), mean-absolute error (MAE), and coefficient of determination (R2) are selected as the prediction performance evaluation indicators. To verify the superiority of the PSO-LSTM method, it is compared with the traditional LSTM. The experimental results are shown in the following table:

Table 1: Comparison of Indexes in Predictive Calculation Example Analysis

Method

RMSE

MAE

R2

PSO-LSTM

3040.233

2073.1171

0.71447

LSTM

3994.1971

2821.9931

0.50717

It can be seen from the data in the table that PSO-LSTM outperforms the traditional LSTM method in all indicators. The RMSE and MAE are lower, and the R2 is higher, indicating that its prediction accuracy is higher. This verifies the effectiveness and superiority of this method.

4. Conclusion

This paper proposes a load forecasting method based on PSO-LSTM. This method first performs pre-processing operations such as normalization on the original load data to improve data quality and eliminate interference caused by differences in dimensions. Then, the pre-processed data is input into the Long Short-Term Memory network (LSTM) model improved by the Particle Swarm Optimization algorithm (PSO) for training. The PSO algorithm can effectively find the optimal parameters of the LSTM model and avoid the model from getting trapped in local optima. Finally, it is verified through a series of practical test cases. The case-based analysis and comparison show that compared with the traditional LSTM model and other common forecasting methods, this method has significant advantages in indicators such as RMSE, MAE, and R2, effectively reducing the prediction error. It achieves more accurate and reliable power load forecasting, providing strong technical support for the planning, dispatching, and operation management of power systems, and has good application prospects and practical value.


References

[1]. Wang C, Li Y X, Wang S X, et al. Short - term power load forecasting based on ICEEMDAN decomposition and reconstruction and BiLSTM-KELM [J]. Science Technology and Engineering, 2024, 24(32):13836 - 13843.

[2]. Li X L, Li Z P, Liu J Z. Research on medium - and long - term load forecasting in a certain region based on time - series analysis [J]. Modern Industrial Economy and Informationization, 2024, 14(07):282 - 283+287.

[3]. Fan R Y, Gao Z, Cao H M. Multi - factor prediction model for power monitoring data based on grey theory [J]. Chinese Journal of Electron Devices, 2022, 45(02):427 - 431.

[4]. Wang Y, Li J, Zhang J. Short - term load forecasting method based on the Stacking regression model considering meteorological factors [J]. Electrical Engineering Technology, 2024(17):67 - 70.

[5]. Xu J. Research on a multi - variable short - term load forecasting model optimized by a time - series clustering algorithm [J]. Energy Science and Technology, 2024, 22(02):20 - 23.

[6]. Yang L, Luo X H, Han K. Review of research on power system load forecasting based on artificial intelligence algorithms [J]. Electrical Engineering Technology, 2024(12):57 - 60.


Cite this article

Chen,Z. (2025). Load Forecasting Method Based on PSO-LSTM. Applied and Computational Engineering,149,7-11.

Data availability

The datasets used and/or analyzed during the current study will be available from the authors upon reasonable request.

Disclaimer/Publisher's Note

The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of EWA Publishing and/or the editor(s). EWA Publishing and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

About volume

Volume title: Proceedings of CONF-MSS 2025 Symposium: Automation and Smart Technologies in Petroleum Engineering

ISBN:978-1-80590-061-0(Print) / 978-1-80590-062-7(Online)
Editor:Mian Umer Shafiq
Conference website: https://2025.confmss.org
Conference date: 21 March 2025
Series: Applied and Computational Engineering
Volume number: Vol.149
ISSN:2755-2721(Print) / 2755-273X(Online)

© 2024 by the author(s). Licensee EWA Publishing, Oxford, UK. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license. Authors who publish this series agree to the following terms:
1. Authors retain copyright and grant the series right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this series.
2. Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the series's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this series.
3. Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See Open access policy for details).

References

[1]. Wang C, Li Y X, Wang S X, et al. Short - term power load forecasting based on ICEEMDAN decomposition and reconstruction and BiLSTM-KELM [J]. Science Technology and Engineering, 2024, 24(32):13836 - 13843.

[2]. Li X L, Li Z P, Liu J Z. Research on medium - and long - term load forecasting in a certain region based on time - series analysis [J]. Modern Industrial Economy and Informationization, 2024, 14(07):282 - 283+287.

[3]. Fan R Y, Gao Z, Cao H M. Multi - factor prediction model for power monitoring data based on grey theory [J]. Chinese Journal of Electron Devices, 2022, 45(02):427 - 431.

[4]. Wang Y, Li J, Zhang J. Short - term load forecasting method based on the Stacking regression model considering meteorological factors [J]. Electrical Engineering Technology, 2024(17):67 - 70.

[5]. Xu J. Research on a multi - variable short - term load forecasting model optimized by a time - series clustering algorithm [J]. Energy Science and Technology, 2024, 22(02):20 - 23.

[6]. Yang L, Luo X H, Han K. Review of research on power system load forecasting based on artificial intelligence algorithms [J]. Electrical Engineering Technology, 2024(12):57 - 60.