DOI: 10.3390/electronics15132788 ISSN: 2079-9292

LLM-Augmented Ensemble Reasoning for Adversarial-Aware Power Quality Monitoring in Smart Grids

Mubarak Alanazi

Deep learning models for power quality (PQ) disturbance classification remain critically vulnerable to adversarial perturbations, with classification performance degrading severely under white-box attacks. Existing defenses address individual models in isolation and provide no mechanism for operators to assess whether the system is under attack or which classifier remains trustworthy. This paper proposes a two-stage framework that combines adversarial training with large language model (LLM) reasoning to improve both robustness and interpretability. In the first stage, four architecturally diverse classifiers, including a proposed Multi-Scale Temporal Attention Network (MSTAN), are evaluated under four adversarial attacks (FGSM, PGD, C&W, and UAP), and their failure patterns are recorded as structured vulnerability fingerprints. The ensemble is then retrained via adversarial training on mixed clean and perturbed signals. In the second stage, an LLM analyzes the ensemble predictions alongside the fingerprint knowledge base to perform attack detection, fingerprint-guided meta-classification, and operator-facing threat report generation. On a 17-class, 255,000-signal synthetic benchmark, adversarial training recovers FGSM and PGD accuracy from below 25% to the 53–78% range, with MSTAN achieving the highest post-training robustness (78.26% under FGSM, 65.41% under PGD). The LLM reasoning layer provides an additional 3.5–6.2 percentage point improvement over majority voting by selecting the most reliable ensemble member based on the inferred attack condition, and detects adversarial attacks with 87.6% overall accuracy. To our knowledge, this is the first integration of LLM-based ensemble reasoning into the PQ adversarial robustness pipeline and the first application of the C&W optimization attack to power quality signals.

More from our Archive