Optimized cross-attention GRU-transformer network with sooty tern algorithm for accurate solar power forecasting
摘要
Accurate forecasting of solar Photovoltaic (PV) power remains challenging due to data uncertainty, environmental fluctuations, and missing sensor values. To address these issues, this study introduces, an integrated deep learning and optimization framework designed for real-time PV power prediction. The approach begins with a rigorous data preprocessing pipeline that incorporates a hybrid imputation strategy combining Simple Imputer for categorical gaps and K-Nearest Neighbors (KNN) imputer for numerical inconsistencies. Exploratory Data Analysis (EDA) and time-series decomposition further enhance the temporal interpretability of the dataset, while engineered feature transformations provide more informative inputs. The proposed hybrid STO-CrossEchoTransGRUNet model fuses the strengths of an Echo State Network (ESN) for global temporal encoding, a cross-attention transformer (CATL) for modelling multi-feature interactions and a Bidirectional GRU for capturing long-term bidirectional dependencies. To further boost performance, hyperparameters are optimized using Sooty Tern Optimization (STO) with a Levy flight–based spiral foraging mechanism. Benchmarking against traditional machine learning models and contemporary deep learning architectures demonstrates the superior accuracy, robustness and computational efficiency of the proposed method. Experimental evaluation validates significant improvements, achieving aRoot Mean Square Error (RMSE) of 0.015, Mean Absolute Error (MAE) of 0.005, Median Absolute Error (MedAE) of 0.002, R² of 0.995 and consistently stable performance across varying environmental conditions. These results highlight STO-CrossEchoTransGRUNet as a highly reliable and scalable solution for real-time solar PV forecasting.