SG-StabNet: Smart Grid Stability prediction using Hybrid Transformer-BiGRU model with focal loss optimization
摘要
Smart grids (SGs) are pivotal to modern energy systems, requiring advanced solutions to ensure stability amid fluctuating loads and the integration of renewable resources. However, accurate stability prediction remains challenging due to imbalanced data and complex temporal dynamics. This paper proposes SG-StabNet, a novel deep learning model that combines a Transformer encoder for global dependencies and a Bi-directional Gated Recurrent Unit (BiGRU) for local temporal patterns, augmented by feature engineering and Focal Loss optimization to address class imbalance. While real-world SG faces diverse stability issues, this study focuses on two specific stability scenarios: transient stability in a Decentralized Smart Grid Control (DSGC) and a Microgrid (MG) under a false data injection (FDI) attack. Evaluated via fivefold cross-validation, SG-StabNet shows exceptional results, with 99.65% accuracy and 99.73% F1-Score on the DSGC dataset. On the highly unbalanced (95.8 / 4.2%), multi-scenario MG FDI simulation-based dataset shows exceptional results compared to other models, with 98.54% accuracy and 82.79% F1-Score. The model outperforms 36 benchmark models, including 19 classical and 17 recent literature approaches, demonstrating superior robustness. Furthermore, Explainable AI (XAI) techniques (SHAP and LIME) reveal critical features driving stability predictions, enhancing interpretability for real-world deployment. SG-StabNet’s hybrid architecture and optimization strategies offer a scalable solution for real-time grid monitoring, bridging the gap between high accuracy and actionable insights for grid management.