Accurate photovoltaic (PV) output power forecasting is essential for reliable power system operation, yet rapidly changing meteorological conditions often degrade forecasting accuracy. This study proposes an attention-enhanced bidirectional gated recurrent unit (BiGRU) optimized by an improved Marine Predators Algorithm (IMPA) for PV output power forecasting. Kernel Principal Component Analysis (KPCA) is first employed to extract compact nonlinear representations and suppress redundant features. Then, a dual multi-head self-attention mechanism is integrated before and after the BiGRU layer to strengthen temporal feature learning under fluctuating weather. Finally, the IMPA is designed to improve exploration–exploitation balance and automatically optimize key hyperparameters. Experiments under sunny, cloudy, and rainy conditions demonstrate that IMPA-Att-BiGRU reduces MAE and RMSE by 35.7–58.5% and 22.8–49.1% versus BiGRU, respectively, while increasing R2 by 2.2–4.1 percentage points. Against the best benchmark (LSTM), MAE and RMSE are further reduced by 38.1–49.5% and 33.8–52.4%. Moreover, in a cross-day rolling forecasting test with fivefold results, IMPA-Att-BiGRU achieves 62.4% MAE and 49.3% RMSE reductions over BiGRU, confirming robust performance under long-horizon error accumulation.
Liu et al. (2026) studied this question.