We propose the Hybrid Spatio-Temporal Transformer with Multi-Branch CNN/RNN and Extreme-Event Head (HST–MB–CREH), a hybrid spatio-temporal deep learning architecture for joint short-term photovoltaic (PV) power forecasting and the detection of rare extreme events, to support the reliable operation of renewable-rich power systems. The model combines a spatio-temporal transformer encoder with three convolutional neural network (CNN) /recurrent neural network (RNN) branches (CNN → long short-term memory (LSTM), LSTM → gated recurrent unit (GRU), CNN → GRU) and a dense pathway for tabular meteorological and calendar features. A multitask output head simultaneously performs the regression of PV power and binary classification of extremes defined above the 95th percentile. We evaluate HST–MB–CREH on the publicly available Renewable Power Generation and Weather Conditions dataset with hourly resolutions from 2017 to 2022, using a 5-fold TimeSeriesSplit protocol to avoid temporal leakage and to cover multiple seasons. Compared with tree ensembles (RandomForest, XGBoost), recurrent baselines (Stacked GRU, LSTM), and advanced hybrid/transformer models (Hybrid Multi-Branch CNN–LSTM/GRU with Dense Path and Extreme-Event Head (HMB–CLED) and Spatio-Temporal Multitask Transformer with Extreme-Event Head (STM–EEH) ), the proposed architecture achieves the best overall trade-off between accuracy and rare-event sensitivity, with normalized performance of RMSEᵦ = 0. 2159 ± 0. 0167, MAEᵦ = 0. 1100 ± 0. 0085, mean absolute percentage error (MAPE) = 9. 17 ± 0. 45%, R2 = 0. 9534 ± 0. 0072, and AUCₑxt = 0. 9851 ± 0. 0051 across folds. Knowledge extraction is supported via attention-based analysis and permutation feature importance, which highlight the dominant role of global horizontal irradiance, diurnal harmonics, and solar geometry features. The results indicate that hybrid spatio-temporal multitask architectures can substantially improve both the forecast accuracy and robustness to extremes, making HST–MB–CREH a promising building block for intelligent decision-support tools in smart grids with a high share of PV generation.
Taganova et al. (Fri,) studied this question.