ISAS_2024_SolarForecast_BiLSTM_Attn - submitted
ISAS_2024_SolarForecast_BiLSTM_Attn - submitted
Le Thi Tinh Minh1 , Ngo Tri Si2 , and Nguyen Thi Kim Truc3∗
1
Faculty of Electrical and Electronics Engineering, Ho Chi Minh University of
Technology (HCMUT), VNU-HCM, Ho Chi Minh City, Vietnam
2
Faculty of Information Technology, Ho Chi Minh University of Science, VNU-HCM,
Ho Chi Minh City, Vietnam
3
Faculty of Electrical Engineering, University of Science and Technology, UD, Da Nang
City, Vietnam
Abstract. Solar energy, as a pivotal renewable resource, holds the potential to ad-
dress global energy demands while mitigating the environmental impact of traditional
energy sources. Accurate forecasting of solar energy output is essential for efficient power
system management, ensuring grid stability, and facilitating informed decision-making
in energy markets. Recent research has highlighted the integration of attention mech-
anisms into Long Short-Term Memory (LSTM) models, demonstrating their superior
predictive capabilities in this domain. This study contributes to the field by exploring a
Bi-directional LSTM (Bi-LSTM) model augmented with an attention mechanism, incor-
porating three time-series features for enhanced solar energy forecasting. The proposed
predictive model is empirically compared to multi-variable time series models, revealing
the efficiencies of the Bi-LSTM. The results are extensively evaluated on real solar power
datasets in Vietnam and overseas.
Keywords— Renewable energy, photovoltaic power forecasting, solar power forecasting, long short-term
memory, Bi-LSTM model
1 Introduction
In recent years, the global energy industry has increasingly focused on reducing carbon emissions by transi-
tioning to renewable energy sources, driven by the need to mitigate the adverse effects of excessive emissions on
climate change and global warming. The surging demand for energy, coupled with diminishing non-renewable
sources like coal, natural gas, and petroleum, has prompted countries to adopt forward-looking energy policies.
For instance, in 2015, the USA and China committed to a full transition to renewable energy, while the European
Union has set ambitious targets for 30% renewable electricity by 2030 and 100% by 2050 [1].
Vietnam has also strategically shifted towards renewable energy development, with significant growth in wind
and solar sectors. The nation’s installed solar capacity has reached approximately 19,400 MWp, with rooftop
solar contributing nearly 9,300 MWp, constituting around 25% of the total capacity in the national grid. The
Draft Power Plan 8 projects a further increase, with an estimated 22,040 MW of solar capacity by 2030 and 63,640
MW by 2045 [2].
While solar energy is one of the most widely utilized renewable resources, its intermittent nature poses
challenges for grid integration. Accurate forecasting of solar irradiance and photovoltaic (PV) power output
is critical for improving power system management and ensuring grid stability. Traditional statistical models,
such as ARIMA and SARIMA, have been widely used for short-term power forecasting. However, these models
often struggle to capture the complex, nonlinear relationships between factors like weather patterns and power
generation, leading to reduced accuracy in forecasting renewable energy sources like solar and wind power [3, 4].
The advancement of machine learning has provided more effective tools for solar power forecasting. Techniques
such as artificial neural networks (ANNs), support vector machines (SVMs), and decision trees have demonstrated
improved accuracy by capturing the complex, nonlinear dynamics of power data [5]. However, the emergence of
deep learning models, particularly Long Short-Term Memory (LSTM) networks, has brought about significant
improvements in forecasting accuracy. LSTM models are well-suited for time-series data due to their ability to
capture long-term dependencies, making them a popular choice for renewable energy forecasting [6].
Despite their success, LSTM models still face limitations in capturing bidirectional dependencies in sequential
data. This has led to the development of Bi-directional LSTM (Bi-LSTM) models, which process information in
both forward and backward directions, improving their ability to understand complex temporal relationships. Fur-
thermore, the integration of attention mechanisms into LSTM models has been shown to enhance their predictive
performance by selectively focusing on the most relevant parts of the input sequence. The attention mechanism
enables the model to weigh the importance of different time steps, resulting in improved accuracy for solar power
forecasting tasks [7].
In this work, we introduce a Bi-LSTM model augmented with an attention mechanism (BiLSTM-Attn) to
address the limitations of traditional LSTM models. By leveraging the attention mechanism, our model dynami-
cally learns the significance of different time steps, enabling more accurate predictions of solar power output. We
compare the performance of the BiLSTM-Attn model against other recurrent models, including vanilla LSTM,
GRU, and standard Bi-LSTM models, using real-world solar power datasets from Vietnam and abroad. Our
results demonstrate that the BiLSTM-Attn model outperforms the other models in terms of predictive accuracy,
making it a valuable tool for solar energy forecasting.
The remainder of this paper is organized as follows: Section 2 describes the datasets used and outlines the
proposed BiLSTM-Attn model, including data preprocessing steps. Section 3 details the experimental setup,
model training, and provides a thorough analysis of the results. Finally, Section 4 presents the conclusion and
discusses future research directions.
2 Database
This paper utilizes two datasets:
• The first dataset (AT dataset) encompasses solar power generation data in Austria, collected at one-hour
intervals from January 1, 2015, to September 30, 2020, at various solar power plants across the country.
This data has been preprocessed.
• The second dataset (TNSPP dataset) pertains to solar power generation at the Trung Nam solar power
plant, located in Loi Hai and Bac Phong, Thuan Bac, Ninh Thuan, Vietnam. This dataset is collected at
1-minute intervals from January 1, 2020, to May 31, 2021. The data includes the total AC output power
of 45 inverters, each with a rated power of 4.45 MW, at the Trung Nam solar power plant. Additionally,
the dataset includes radiation measurements from 6 selected inverters, providing an average radiation value
each day. It is essential to note that, given the nature of solar power generation forecasting, only data from
5:30 am to 6:00 pm daily has been utilized in this paper.
of data from solar power and radiation sources as described in Section 3. Data preprocessing is then performed
to clean the dataset, ensuring the removal of anomalies or missing values.
Next, the model building phase involves selecting an appropriate forecasting model architecture. This model
is trained using historical data to understand patterns between input variables and the target output. The final
step involves evaluating the model’s performance in predicting solar power for the next time step, which helps
refine and improve forecasting accuracy.
x − xmin
y= (1)
xmax − xmin
where x, y, xmin , and xmax represent an instance value, its xmin − xmax normalized value, the dataset
minimum value, and the dataset maximum value, respectively.
(a) Before Removing Outliers (b) After Removing Outliers
Figure 2: Outliers in the the Trung Nam solar power plant TNSPP Dataset.
enables the model to selectively emphasize relevant information, thereby enhancing its interpretability and overall
performance in sequence prediction tasks.
Figure 3 illustrates our proposed architecture, which seamlessly integrates the strengths of BiLSTM networks
and attention mechanisms, alongside a depiction of the mechanism of a single BiLSTM neuron combined with
the attention mechanism.
Table 1: Compare the test errors of the models with the AT dataset.
In contrast, Figure 4b, with hourly-sampled AT data, shows a smoother and more stable power generation
pattern. The model accurately predicts power output, with nearly perfect alignment between predicted and actual
values. This suggests that the reduced noise and more regular patterns in hourly data make it easier for the model
to forecast. Hourly sampling is ideal for longer-term planning and forecasting, where daily or weekly trends are
the focus.
The model performs well across both datasets, with room for improvement in handling short-term fluctuations
in high-resolution data like the TNSPP dataset. For long-term forecasts, the model excels, as seen with the AT
dataset, highlighting the impact of data resolution on forecasting accuracy.
Comprehensive Evaluation on the Full Test Set
Table 2: Compare the test errors of the models with the TNSPP dataset.
Tables 1 and 2 present the test error metrics for different models applied to the AT and TNSPP datasets,
respectively. The BiLSTM-Attention (BiLSTM-Attn) model consistently shows superior performance across all
metrics, including MAE, MAPE, RMSE, and rRMSE. For the AT dataset, the BiLSTM with attention mechanism
achieves the lowest errors, with a MAE of 7.0, MAPE of 4.48%, RMSE of 16.47, and rRMSE of 8.62%. This
demonstrates its ability to capture complex temporal patterns more effectively compared to other models, such
as GRU, LSTM, and standard BiLSTM.
Similarly, in the TNSPP dataset, the BiLSTM-Attention model maintains its leading performance with the
lowest test errors such as MAE of 1433.51, MAPE of 1.34%, while LSTM-Attention model achieves the best
performance with RMSE of 3398.13, and rRMSE of 3.18%. This shows its adaptability and robustness across
different datasets, further highlighting its suitability for time series forecasting tasks. Models like GRU and LSTM
show competitive results, but consistently underperform in comparison to the BiLSTM-Attention, especially in
reducing error metrics across both datasets.
Future directions in forecasting research could focus on improving model accuracy by exploring more advanced
algorithms and techniques that can capture complex patterns and relationships in data. Incorporating additional
data sources, handling uncertainty, and developing more adaptable models that can generalize across different
forecasting tasks are also promising areas. Furthermore, enhancing the computational efficiency of forecasting
models for real-time applications and addressing challenges like data sparsity, missing values, and irregular time
intervals would broaden their use in various fields. Finally, improving interpretability and explainability of
forecasting models will be crucial for gaining insights and building trust in their predictions.
5 Conclusion
This study highlights the effectiveness of the BiLSTM-Attn model in solar power forecasting, demonstrating
how the attention mechanism significantly enhances prediction accuracy. By allowing the model to focus on the
most relevant temporal features, the attention mechanism enables BiLSTM-Attn to consistently outperform other
methods across various datasets, including both high-frequency and hourly-sampled data. The model’s strong
performance, reflected in its low error metrics such as MAE, MAPE, RMSE, and rRMSE, confirms its ability to
manage the complexities and variabilities inherent in solar power data, making it a robust solution for practical
renewable energy forecasting applications.
These results emphasize the model’s adaptability to diverse time series patterns, proving its value for both
short-term and long-term forecasting. Future research should focus on incorporating additional factors, such
as weather conditions and real-time data, to further improve accuracy. Enhancing the model’s computational
efficiency for real-time applications and addressing challenges like missing data and outlier detection will also be
essential for broader adoption in solar power management systems. By addressing these aspects, the BiLSTM-Attn
model can play a pivotal role in optimizing renewable energy forecasting and improving grid management.
Acknowledgement
We acknowledge Ho Chi Minh City University of Technology (HCMUT), VNU-HCM for supporting this study.
We also thank Mr Nguyen Duc Huy, Mr. Ngo Hoang Bach and Mr. Dang Tran Hoang for their contributions.
Additionally, we extend our sincere thanks to Mr. Nguyen Duc Huy, Mr. Ngo Hoang Bach, and Mr. Dang Tran
Hoang for their valuable contributions to this research.
References
[1] Utpal Kumar Das, Kok Soon Tey, Mehdi Seyedmahmoudian, Saad Mekhilef, Moh Yamani Idna Idris, Willem
Van Deventer, Bend Horan, and Alex Stojcevski. Forecasting of photovoltaic power generation and model
optimization: A review. Renewable and Sustainable Energy Reviews, 81:912–928, 2018.
[2] Tran Huynh Ngc and Le Thanh Nghi. Tich hop dien mat troi vao luoi dien - cac anh huong, nguy co va giai
phap khac phuc. PECC2, 2021.
[3] Yukta Mehta, Rui Xu, Benjamin Lim, Jane Wu, and Jerry Gao. A review for green energy machine learning
and ai services. Energies, 16(15):5718, 2023.
[4] Yuan-Kang Wu, Cheng-Liang Huang, Quoc-Thang Phan, and Yuan-Yao Li. Completed review of various
solar power forecasting techniques considering different viewpoints. Energies, 15(9):3320, 2022.
[5] Syed Altan Haider, Muhammad Sajid, Hassan Sajid, Emad Uddin, and Yasar Ayaz. Deep learning and
statistical methods for short-and long-term solar irradiance forecasting for islamabad. Renewable Energy,
198:51–60, 2022.
[6] Sheng-Xiang Lv and Lin Wang. Deep learning combined wind speed forecasting with hybrid time series
decomposition and multi-objective parameter optimization. Applied Energy, 311:118674, 2022.
[7] Elham M Al-Ali, Yassine Hajji, Yahia Said, Manel Hleili, Amal M Alanzi, Ali H Laatar, and Mohamed Atri.
Solar energy production forecasting based on a hybrid cnn-lstm-transformer model. Mathematics, 11(3):676,
2023.
[8] John W Graham. Missing data analysis: Making it work in the real world. Annual review of psychology,
60(1):549–576, 2009.
[9] Fiona M Shrive, Heather Stuart, Hude Quan, and William A Ghali. Dealing with missing data in a multi-
question depression scale: a comparison of imputation methods. BMC medical research methodology, 6:1–10,
2006.
[10] Garrett M Fitzmaurice, Nan M Laird, and James H Ware. Applied longitudinal analysis. John Wiley & Sons,
2012.
[11] T. Phan. So sanh mot so phuong phap xu ly du lieu thieu cho chuoi du lieu thoi gian 1 chieu. Tap Chi Khoa
hoc Nong Nghiep Viet Nam, 2020.
[12] Harshada C Mandhare and SR Idate. A comparative study of cluster based outlier detection, distance
based outlier detection and density based outlier detection techniques. In 2017 international conference on
intelligent computing and control systems (ICICCS), pages 931–935. IEEE, 2017.
[13] Cuc Dieu Tiet Dien Luc. Quyet dinh ban hanh quy trinh du bao cong suat, dien nang phat cua cac nguon
dien nang luong tai tao, 2024. Decision No. 07, signed date 14/3.