iconOpen Access

ARTICLE

FedGNN: Federated Graph Neural Networks for Privacy-Preserving Cyber-Resilient Energy Optimization in IoT-Based Smart Grids

Alanoud Al Mazroa1, Fahad Masood2, Bakri Hussain Awaji3, Mohammad Alhefdi4, Abeer Aljohani5, Jawad Ahmad6,*

1 Department of Information Systems, College of Computer and Information Sciences, Princess Nourah bint Abdulrahman University, Riyadh, Saudi Arabia
2 Department of Computer Science, CECOS University of IT and Emerging Sciences, Peshawar, Pakistan
3 Department of Computer Science, Collage of Computer Science and Information Systems, Najran University, Najran, Saudi Arabia
4 Computer Engineering Department, King Khalid University, Abha, Saudi Arabia
5 Department of Computer Science and Informatics, Applied College, Taibah University, Madinah, Saudi Arabia
6 Cybersecurity Center, Prince Mohammad Bin Fahd University, Alkhobar, Saudi Arabia

* Corresponding Author: Jawad Ahmad. Email: email

(This article belongs to the Special Issue: Emerging Technologies in Information Security: Modeling, Algorithms, and Applications)

Computer Modeling in Engineering & Sciences 2026, 147(2), 51 https://doi.org/10.32604/cmes.2026.080134

Abstract

The rapid integration of Internet of Things (IoT) devices and distributed energy resources into smart grids has improved monitoring, control, and energy efficiency. However, it also exposes the grid to cyberattacks and privacy risks, as increased connectivity and data exchange can significantly disrupt energy management and system stability. Studies focused on centralized cybersecurity mechanisms that lacked scalability and did not emphasize the inherent graph structure of power networks. This study proposes a privacy-preserving and cyber-resilient energy-optimization framework, FedGNN, for IoT-enabled smart grids that jointly integrates federated learning, graph neural network-based trust inference, and trust-aware energy dispatch. The framework dynamically learns node-level trust scores from multi-feature measurements, including load, voltage, frequency, renewable generation, and battery storage, and incorporates them into real-time energy optimization. Results demonstrate that the proposed approach improves system resilience up to 12%, mitigates the impact of compromised nodes, and maintains operational reliability, while preserving the privacy of distributed data. A comparative analysis with baseline methods shows the proposed framework’s superior performance in energy deviation, resilience, and trust-aware decision-making. The results highlight the potential of integrating AI-driven trust mechanisms with federated learning for secure and efficient energy management in future IoT-enabled smart grids.

Keywords

Cyber security; energy optimization; graph neural networks; IoT; smart grids

1  Introduction

Sensors and edge Internet of Things (IoT) devices play an important role in data collection, processing, and system control [1,2]. The interconnected nature of these devices creates multiple entry points, increasing the risk of significant cybersecurity exposures [3]. Rising energy demand and technological integration have increased the complexity of modern smart grids, necessitating advanced security strategies [4]. Cyberattacks can result in falsified data, measurement tampering, and even system failures [5,6].

Privacy-preserving energy prediction and control have been focused on using various machine learning (ML) techniques. Federated learning (FL) is a recent, innovative ML approach that performs predictive analysis in a privacy-preserving manner [7,8]. The main focus of FL is on data privacy and decentralized model training [9]. The model is trained by sharing only local model updates, without sharing device data with the central server. ML-based techniques are well-suited to identifying cyberattacks on energy devices, abnormal energy consumption, and malfunctioning devices. Given the nature of interconnected devices in IoT-based smart grids, it is appropriate to use a graph for the representation of devices’ spatial relationships [10]. Traditional ML models only handle data in text, image, and Euclidean forms. In an intricate non-Euclidean structure, it is difficult to effectively capture the spatial information. Graphical neural network (GNN) enhances the model’s ability using both node features and network structures. This GNN feature is highly recommended for anomaly detection in smart grids [11,12].

Most previous work either fails to integrate trust-aware mechanisms into energy optimization or relies on overly simplistic assumptions about attacks and grid dynamics. This work addresses energy distribution optimization in IoT-based smart grids under cyberattacks using FL and GNN FedGNN. The privacy of sensitive operational data has been maintained while addressing the simultaneous challenges of cyber threats and energy efficiency. The node-level trust scores are dynamically learned and incorporated into energy dispatch decisions. The effect of the compromised nodes is mitigated, and the privacy of distributed measurements is preserved. The proposed solution addresses scalability limitations, including single-point failures in large-scale, centralized smart grid networks. The main objectives of the proposed framework are as follows:

•   Integrated federated learning and graph neural networks for a privacy-preserved FedGNN framework

•   Metigate false data Attacks for a trust-adaptive aggregation mechanism.

•   Trust scores and dispatch decisions embedding for cyber resilient energy optimization.

The integration of FL, GNN, and trust-aware optimization into a single framework confirms the novelty of the proposed framework. Multiple features, including load, voltage, frequency, DER generation, and battery storage, have been considered in the system under multi-node cyberattacks. The practical, scalable solution developed in this work significantly enhances the resilience and security of IoT-enabled smart grids. This jointly coupled problem differs from the previous study by treating cyber resilience, privacy preservation, and energy optimization rather than as isolated objectives. The malicious IoT nodes are explicitly modeled to evolve cyber-physical attacks that dynamically adapt system-level decisions with energy optimization.

In this article, Section 2 presents the background study and discussion of the previous literature. In Section 3, the methodology has been discussed in the context of the proposed framework. Section 4 presents a detailed analysis and discussion of the experimental results. Conclusion and future work have been presented in Section 5.

2  Literature Review

Smart grid IoT systems require specialized security measures, such as encryption and intrusion detection, to ensure security. Protecting users, reducing risks, and establishing accountability are the key benefits of a comprehensive control structure. The technical and social goals are aligned through the standards and guidelines that serve as balancing layers [13]. Network attacks are addressed by numerous security solutions to improve the system’s overall performance. A central feature of network security is identifying and mitigating cyberattacks in IoT environments [14].

Komninos and Bekara surveyed the challenges posed by potential cyber-attacks in IoT-based smart environments [15,16]. The attacks were categorized into high, moderate, and low based on the severity of their adverse effects. Big Data and Machine Learning applications have been studied in IoT-integrated smart grids [17]. A next-generation method, Role-Based Access Control (RBAC), has been explored to limit unauthorized access and reduce risk [18]. Cross-domain security challenges in interconnected modern grids have been discussed, highlighting key security issues [19].

AI-driven security solutions have transformed into a powerful approach for providing reliable and scalable infrastructure. The resilience of evolving cyber threats has been improved for real-time detection and response [20]. Machine Learning, combined with blockchain, has enabled decentralized, secure threat-identification systems [21]. Security issues in cloud-based applications have grown significantly with the integration of AI and transfer learning. A privacy-preserving energy management model has been presented in a Peer-to-Peer (P2P) environment [22]. A fair energy allocation has been ensured based on the user’s described information. The proposed model manages energy using a quorum-based architecture for false data injection attacks. The results reveal that the model performed well under critical conditions.

Blockchain-based privacy-preserving approaches have been discussed for P2P Energy Trading in Smart Grids [23]. Ethereum smart contracts, MetaMask, and Ganache have been used for the model, enabling secure energy. The model achieved a 12.7% decrease in load compared to existing methods. Blockchain-based privacy-preserving has been discussed for a virtual power plant [24]. A power-flow algorithm combined with a security algorithm is used for real-time monitoring. The model demonstrated excellent efficiency with an average loss of 1.9524 W. Data Integrity Attacks (DIAs) have been identified as a means to address the security of the smart grid [25]. Artificial Neural Networks have been used to enhance detection accuracy with 10 hidden neurons. The model achieved a detection rate of up to 99.5%, resulting in a 21% increase in profit.

Several studies have been presented in recent years on energy and privacy preservation in IoT environments [26,27]. A Comparison of the proposed model with various approaches in smart grid environments is presented in Table 1. These studies employ centralized machine learning models with a primary focus on detecting False Data Attack (FDAs). This framework integrates trust-aware mitigation rather than only detecting FDIAs directly into the energy optimization loop. The proposed method operates in a distributed federated learning environment, where raw measurements remain local to IoT devices. The exploitation of spatial correlations is enabled using GNNs between nodes. The framework based on trust scores also dynamically adjusts node contributions during federated aggregation to improve robustness against coordinated FDIAs.

images

Studies include an AI-based framework for energy efficiency, IRS-enhanced low-carbon power Management using Deep Game Theory, federated anomaly detection using Bayesian game reinforcement learning, and IoT-UAV-inspired intelligent and energy-efficient resource management [28,29]. However, these studies present solutions for individual energy and security issues. A secure framework is necessary from an energy perspective for IoT-based smart homes.

3  Methodology

This work presents a threat-aware energy optimization framework for a smart grid environment. The major components of the methodology include IoT-based data collection for cyberattacks, AI-driven resilience modeling, and trust-aware energy optimization, as shown in Fig. 1. Sensors, smart meters, and distributed energy storage units have been utilized to establish a smart grid environment. Local electrical parameters, including load, voltage, and frequency, were continuously measured by each IoT device at a predefined sampling rate for data collection, in accordance with [30] and [31]. The dataset comprises several data types, including load demand, voltage, frequency, DER generation, battery storage, a cyber-attack indicator, a trust score, and a node ID. Each device maintains a local data-sharing-only model for updates. Cyber-resilience was evaluated by introducing false data injection, enabling the model to test robustness under varying attack intensities. Graph Neural Networks (GNNs) and Federated Learning (FL) approaches have been used to enable resilient energy optimization and preserve privacy. IoT devices and interconnections are modeled as a graph in a smart grid topology, where nodes represent devices and edges represent communication links. The system generates trust or resilience scores for each node as GNNs learn spatial and relational dependencies to identify compromised devices. Model performance is assessed using several metrics, including energy efficiency, deviation from optimal dispatch, and resilience against attacks.

images

Figure 1: Flow diagram of the proposed FedGNN framework.

3.1 IoT-Enabled Smart Grid Modeling

Let the smart environment is presented as a graph:

𝒢=(𝒩,)(1)

where 𝒩={1,2,...,N} is the set of nodes representing IoT devices and is the set of edges representing communication links. Each node i measures electrical parameters at time t:

xit=[PitVitfit]Rd,(2)

where Pit is the load, Vit is the voltage, and fit is the frequency. The global measurement matrix is:

Xt=[x1t,x2t,...,xNt]TRN×d.(3)

The net power injection in case of distributed energy resources (DERs) is:

Pinet,t=PitGit,(4)

where Git is the generation at node i. The cyber attacks are represented by a binary indicator ait:

ait={1,if node i is attacked at time t0,otherwise(5)

The observed corrupted measurement is:

x~it=xit+aitδit,(6)

where δit is the attack perturbation, which can be stochastic:

δit𝒰(Δi,Δi)orδit=εxit,(7)

with Δi presents maximum perturbation and ε as attack intensity. The global attack measurement matrix is:

X~t=[x~1t,x~2t,...,x~Nt]T.(8)

3.2 Trust Scoring Using GNN and FL

The proposed AI-based framework integrates Graph Neural Networks (GNNs) for estimating node trustworthiness and modeling spatial correlations, and Federated Learning (FL) for privacy-preserving model training. Each IoT node i collects measurements including load, voltage, frequency, DER generation, and storage:

hi(0)=x~it=[PitVitfitGitEit]T(9)

•   τ determines the minimum trust level required for a node’s model update to significantly influence global aggregation.

•   IfTi(t)<τ, the node’s contribution is down-weighted or excluded.

•   τ serves as a resilience control parameter balancing security and availability.

The GNN’s input includes node embeddings to capture both electrical parameters and local information.

3.3 GNN Message Passing and Aggregation

At each layer l, node i aggregates information from its neighbors:

mi(l)=j𝒩i1|𝒩i|hj(l)(10)

Spatial information from connected devices is incorporated to compute the average embedding of neighboring nodes,

hi(l+1)=σ(W(l)hi(l)+Wm(l)mi(l)+b(l))(11)

Learnable weights and a nonlinear activation function combine the node’s current state with neighbor information. The enhanced neighbor weighting is calculated using the attention mechanism as,

αij(l)=exp(LeakyReLU(aT[Whi(l)||Whj(l)]))k𝒩iexp(LeakyReLU(aT[Whi(l)||Whk(l)]))(12)

hi(l+1)=σ(j𝒩iαij(l)Whj(l))(13)

The model’s resilience is improved by assigning higher weights to more relevant neighbors.

3.4 Node-Level Trust Score

The final embedding is converted to a trust score after L layers,

Tit=sigmoid(woThi(L)+bo)(14)

The embeddings are mapped to [0,1] using the sigmoid function to quantify node reliability. High values indicate trustworthy nodes for energy optimization.

3.5 GNN Loss Functions

The prediction accuracy against ground-truth trust labels is measured using the supervised trust loss. It guides the model to correctly identify compromised nodes and is given as,

GNN=1|𝒩|i𝒩(sit,s^it)(15)

Penalized large trust is differentiated between neighboring nodes using neighbor-smoothness regularization as,

smooth=1||(i,j)(sitsjt)2(16)

This ensures spatial consistency and mitigates isolated false positives. The total GNN loss is calculated with combined prediction accuracy and smoothness regularization as,

total=GNN+βsmooth(17)

β is the hyperparameter that balances the two objectives.

3.6 FL Formulation

The local model update at node i is given as,

θit+1=θitηθitotali(θit)(18)

where each node updates its GNN parameters locally using gradient descent. This preserves privacy since raw measurements are not shared. The central server aggregates local updates weighted by the number of samples. The global aggregation is given as,

θt+1=i=1Nnij=1Nnjθit+1(19)

It produces a global model representing the entire network without sharing raw data. The trust-weighted aggregation assigns a higher weight to nodes with higher trust scores in the global model.

θt+1=i=1Nwiθit+1,wi=sitnij=1Nsjtnj(20)

This reduces the impact of compromised nodes on the learning process. The addition of Gaussian noise with gradient prevents inference of raw measurements and ensures privacy-preserving model updates. Mathematically,

θit+1=θitη(θitotali+𝒩(0,σ2I))(21)

The global trust score is further refined to update all nodes’ trust scores as,

Tit+1=fGNN(θt+1,x~it)(22)

3.7 Trust-Aware Energy Optimization

The energy optimization objective is presented as:

minPtJ=t=1T[C(Pt)+λi=1N(1sit)f(Pit)],(23)

where C(Pt) is operational cost, f(Pit) penalizes reliance on untrusted measurements, and λ balances efficiency and resilience. The Power limits

PiminPitPimax,i,t(24)

in terms of power balance, voltage limits, and line flow constraints are given as,

i=1NPinet,t=Dt,t(25)

ViminVitVimax,i,t(26)

|Pijt|Pijmax,(i,j),t(27)

Trust-Weighted Dispatch

The trust-weighted optimal dispatch is:

Piopt,t=argminPit(C(Pit)+λ(1sit)Pit)(28)

3.8 Performance Metrics

The energy efficiency loss is calculated in terms of performance metrics as,

η=CattackCno-attackCno-attack×100%(29)

The average trust score and optimization deviation are calculated as,

Savgt=1Ni=1Nsit(30)

ΔPt=||PbaselinetPoptimizedt||2||Pbaselinet||2(31)

The resilience under attack intensity α is given as,

R(α)=1Tt=1Ti𝒜αsit(32)

where 𝒜α is the set of attacked nodes.

The proposed FedGNN framework leverages three Algorithms 1–3, to collaboratively deliver a trust-aware, energy-efficient solution for the smart grid environment. The computational complexity analysis of the framework involves time and space complexity, as mentioned in Tables 2 and 3.

images

images

images

images

images

4  Analysis and Discussion

This section describes the analysis and discussion for the proposed FedGNN framework for secure energy optimization. A complete description of the devices, nodes, and communication setup is provided in the network setup section. The analysis has been done for various performance metrics such as energy efficiency loss η, average trust score Savg, optimization deviation ΔPt, resilience R(α), and reliability Relt to evaluate the effectiveness of the proposed model. The local GNN models are lightweight and can be deployed on edge devices with moderate computational capacity. The model parameters are transmitted only to reduce bandwidth usage. Advanced systems, including Advanced Metering Infrastructure (AMI) and SCADA, can be integrated into the proposed framework without increasing the structural requirements. The distributed microgrids and multi-location energy systems are also supported by the federated design. Training can be performed periodically, and dispatch decisions can be made suitable for real-time control.

4.1 Network and Communication Setup

The smart grid is modeled as a graph 𝒢=(𝒩,), where 𝒩 denotes the set of IoT nodes, and denotes the set of communication links. The network consists of N=100 nodes, including 60 load nodes, 30 DERs (solar and wind), and 10 battery storage nodes. Nodes are connected using a radial, meshed topology to reflect typical medium-voltage distribution networks. Tables 4 and 5 presents the detailed description of the network and simulation parameters along with the hyperparameter configuration. The GNN used for trust scoring comprises L=3 layers with ReLU activations, and the embedding dimension is set to dh=16. Federated learning is implemented using a global aggregation interval of 5 time steps, and local learning rate η=0.01. Table 6 shows the sensitivity analysis of the proposed FedGNN framework by varying key hyperparameters to evaluate its robustness. The learning rate and clipping ratio exhibited a noticeable mutual influence. The discount factor and GAE parameter were observed to remain stable across a range of values.

images

images

images

4.2 Results Analysis

Fig. 2 presents the average trust score over time for various attack intensities α. Results show that the increase in compromised nodes gradually reduces the overall trust level. The trust-aware mechanism can maintain a relatively stable trust score even under higher attack rates. It shows that the proposed model effectively handles malicious behavior in real-time smart-grid environments.

images

Figure 2: Average trust score over time for various attack intensities.

The energy deviation under various attack scenarios is shown in Fig. 3. The attack severity increases the deviation curve, highlighting the impact of false data. It is evident that the expected and actual energy dispatch differ due to greater attack penetration. It is also notable that adaptive mitigation strategies are necessary in real-time grid operation.

images

Figure 3: Energy deviation under different levels of attack scenarios.

Fig. 4 shows resilience for the trust-aware system over time for varying attack levels. The proposed trust-aware optimization has shown greater resilience even when more nodes are under attack. The Incorporation of trust scores into dispatch decisions is crucial for the system to perform better under adversarial conditions.

images

Figure 4: Resilience for the trust-aware over time for varying attack levels.

The comparison of resilience with and without trust mechanisms is shown in Fig. 5 for the worst-case attack scenario. The proposed trust-aware approach outperforms the no-trust case across all time steps. The system experiences noticeable degradation without trust consideration. The influence of compromised nodes has been mitigated by the trust-enabled framework, thereby improving overall robustness.

images

Figure 5: Comparison of resilience with and without trust mechanisms for α=0.3.

A comparative analysis of baseline approaches under severe attack conditions is shown in Fig. 6. The proposed method has been compared with the centralized machine learning method and federated learning without trust. The proposed approach exhibits the highest resilience. The integration of federated learning with trust-aware decision-making has a high impact and is more effective than centralized or trust-agnostic solutions.

images

Figure 6: Comparison of the baseline approaches with the proposed framework.

Fig. 7a illustrates the trust heatmap across all nodes for different time steps. Lower trust values have been observed in Nodes affected by cyberattacks than in healthy Nodes. It shows that the system dynamically detects malicious behavior by analyzing the spatial and temporal distributions of trust scores, further supporting the effectiveness of the GNN-based trust inference mechanism.

images

Figure 7: Trust and battery-equipped nodes heatmaps across all nodes for various time steps.

The battery state-of-charge (SOC) heatmap has been shown in Fig. 7b for battery-equipped nodes. The charging and discharging behaviors have been presented in terms of SOC variation under dynamic load and generation conditions. It is notable that battery operations remain stable under attack scenarios, thereby maintaining valuable grid resilience for the energy storage system.

Fig. 8 shows the trust-aware and non-trust optimization for different attack scenarios. The trust-aware strategy consistently yields high resilience value for all attack fractions. The proposed approach adapts effectively to real-time operations across different levels of cyber threats. Results reveal that the proposed approach establishes a closed-loop interaction, in which dynamically inferred trust scores directly influence real-time energy dispatch decisions.

images

Figure 8: Trust-aware and non-trust optimization for three types of attack level with α = 0.1, α = 0.2, and α = 0.3.

Fig. 9 shows the power utilization of the node-level Load and trust-aware dispatch for various time steps. It is worth mentioning that the proposed FedGNN consumes relatively less power than the original and attacked load. The attack load consumes more power due to the presence of false and malicious nodes. The comparison indicates that the proposed model performs better in a real-time smart grid environment, highlighting its effectiveness and compatibility.

images

Figure 9: Node-level load and trust-aware dispatch comparisons for various time steps.

The comparison of computational and communication costs is presented in Table 7 for the training rounds. High computational and communication overhead is incurred by centralized learning approaches. The proposed FedGNN framework reduces communication costs and improves scalability. The ablation study has been presented in Table 8 for a severe cyber-attack scenario. Limited resilience improvement has been observed in both the baseline and FL configurations, indicating that learning alone is insufficient for secure real-time operation. Resilience improves with the introduction of static trust, but higher trust variance results from the lack of topology-aware inference. The proposed framework achieves the highest resilience and lowest energy deviation.

images

images

A boxplot-based statistical analysis of system resilience for FedGNN-based and trust-unaware control under different attack rates (α=0.1,0.2,0.3) is shown in Fig. 10. The resilience distribution over time for a certain attack intensity is displayed in each pair of boxplots. The median resistance of the no-trust strategy deteriorates and exhibits greater variation as the attack proportion increases, indicating unstable system operation under adversary control. In contrast, the FedGNN-based method consistently produces narrower interquartile intervals and higher median resistance across all attack levels. These findings demonstrate that the suggested strategy not only improves average performance but also enhances robustness and stability against diverse, time-varying cyberattacks.

images

Figure 10: Statistical analysis of system resilience under different attack rates.

The relationship between the system’s resilience under high attack intensity (α=0.3) and the average trust score estimated by the FedGNN model is shown in Fig. 11. Each point represents a time step and captures the dynamic relationship between operational performance and trust assessment. Higher levels of trust are clearly and positively correlated with better resilience outcomes.

images

Figure 11: Comparison of system’s resilience under high attack intensity (α=0.3) and the average trust score.

The total system demand and the corresponding provided energy under a severe cyberattack scenario (α=0.3) are shown in Fig. 12. The provided power under no-trust optimization and the suggested FedGNN-based trust-aware control are depicted by the solid curves, whilst the dashed curve shows the overall baseline demand aggregated across all nodes. The provided energy closely matches the attacked demand in the absence of trust mechanisms, suggesting that compromised nodes still affect system-wide dispatch decisions. The FedGNN-based method, on the other hand, deliberately restricts energy distribution to low-trust nodes, thereby reducing the provided power profile.

images

Figure 12: Total system load vs. delivery.

Table 9 presents the impact of the hyperparameters on the learning performance of the proposed FedGNN model. The discount factor determines the relative importance of future rewards, the clipping range governs the stability of policy updates, and the learning rate controls the size of those updates. A moderate learning rate of 3×104 paired with a large discount factor (γ=0.99) yields the highest average resilience and the most consistent convergence behavior. To avoid oscillatory updates and delayed adaptation, a well-designed setup balances learning speed and stability. Reduced resilience and unstable convergence result from higher learning rates and broader clipping ranges, as aggressive updates cause the policy to respond to noisy reward signals during cyberattacks. These findings underscore the importance of fine-tuning PPO hyperparameters to achieve consistent, robust energy management performance under hostile smart grid conditions.

images

The cyber-resilience of the FedGNN framework is evaluated against trust-related criteria in Table 10. While the trust update rate β regulates how rapidly trust values adjust to observed node activity, the trust threshold establishes the minimal trust score necessary for a node to meaningfully contribute to energy dispatch choices. The findings show that the maximum average resilience, while maintaining a very low false isolation rate, is achieved with an intermediate trust threshold (τ=0.7) and a moderate update rate (β=0.1). System resilience is weakened when the trust threshold is set too low, as malicious nodes are not appropriately penalized. In contrast, overly rigid criteria or rapid trust updates increase the risk of incorrectly isolating benign nodes, thereby degrading overall energy delivery. These results demonstrate the need of adaptive trust modeling in federated smart grid optimization for striking a balance between security and operational effectiveness.

images

Table 11 presents a comparative analysis of the baseline methods under coordinated false-data attacks. The performance parameters, including federated, Graph-based, and trust-aware, have been included to evaluate the methods. The centralized GNN offered moderate resilience, was vulnerable to coordinated attacks, and had privacy limitations. FedAvg exhibited improved privacy, limited structural awareness, and instability under high attack ratios. The Trust-Unaware FL-GNN captured the topology but lacked malicious-node mitigation, and its performance degraded as α increased. The combined anomaly detection and dispatch separation offered no integrated optimization with slower mitigation response. The proposed FedGNN outclassed all the baseline methods with the highest resilience, lowest power imbalance, and stability under increasing attack ratios.

images

Table 12 shows the generalization capability of the proposed FedGNN framework for various attack types. The proposed framework supported all attack types. The mitigation mechanism clearly provides a brief description of all attack types.

images

5  Conclusion

This study presents FedGNN, an integrated Federated Learning (FL) and Graph Neural Networks (GNN) framework for IoT-based, cyber-resilient energy optimization in a smart grid environment. A three-layer architecture has been introduced, including IoT devices, AI components, and an optimization phase. IoT devices share model updates using FL and update the aggregation server. FL trains trust inference in a distributed manner to ensure scalability, while GNN captures inter-node dependencies. A trust-weighted representation has been produced, which serves as input to the energy optimization layer. The energy optimization component incorporates a resilience-aware objective function to balance trust scores and energy efficiency. The constraints include device operating limits, network capacity, and load-demand balance. The results clearly demonstrate the system resilience strategy for trust-aware optimization across different attack intensities up to 12%. Future work on FedGNN includes multi-location energy optimization with multimodal infrastructure.

Acknowledgement: The authors extend their appreciation to the deanship of research and graduate studies at King Khalid University for funding this work through a large research project under grant number (RGP2/603/45). The authors thank Princess Nourah bint Abdulrahman University, Riyadh, Saudi Arabia, for supporting this research through the Researchers Supporting Project number (PNURSP2026R510).

Funding Statement: This research work is supported by the Deanship of Research and Graduate Studies, King Khalid University, for funding this work through a large research project under grant number (RGP2/603/45). Princess Nourah bint Abdulrahman University, Riyadh, Saudi Arabia, through the Researchers Supporting Project number (PNURSP2026R510).

Author Contributions: Conceptualization: Alanoud Al Mazroa and Fahad Masood; Methodology: Alanoud Al Mazroa, Bakri Hussain Awaji, Fahad Masood; Software: Bakri Hussain Awaji and Jawad Ahmad; Validation: Mohammad Alhefdi and Abeer Aljohani; Formal analysis: Mohammad Alhefdi, Abeer Aljohani; Investigation; Abeer Aljohani and Jawad Ahmad; Resources: Alanoud Al Mazroa and Jawad Ahmad; Data curation: Fahad Masood and Jawad Ahmad; Writing—original draft preparation: Fahad Masood and Jawad Ahmad; Ceptualization: Alanoud Al Mazroa and Fahad Masood; Methodology: Alanoud Al Mazroa, Bakri Hussain Awaji and Jawad Ahmad; Writing—review and editing: Mohammad Alhefdi and Abeer Aljohani; Visualization, Mohammad Alhefdi and Abeer Aljohani; Supervision: Jawad Ahmad. All authors reviewed and approved the final version of the manuscript.

Availability of Data and Materials: All the data used in this study are mentioned in the article. Additional information may be provided upon request.

Ethics Approval: Not applicable.

Conflicts of Interest: The authors declare no conflicts of interest.

List of symbols and abbreviations

𝒢(𝒱,) IoT-based smart grid graph
𝒱 Set of nodes (IoT devices)
Set of edges (communication links)
N Number of IoT nodes
Xi(t) Real-time measurement of node i
Hi(t) Historical measurement of node i
δi(t) Measurement deviation of node i
Ti(t) Trust score of node i
τ Trust threshold
β Trust sensitivity parameter
Di Local dataset at node i
θ Global model parameters
θi(r) Local model parameters at round r
R Number of federated learning rounds
E Number of local training epochs
wi Aggregation weight of node i
F Feature dimension
Pi(t) Power demand at node i
P^i(t) Optimized power dispatch
Gi(t) Distributed energy generation
Ei(t) Energy storage (battery state)
ηch,ηdis Charging/discharging efficiency
Pimin,Pimax Power bounds of node i
α Attack fraction (ratio of compromised nodes)
ΔPi(t) Attack-induced perturbation
FDIA False Data Injection Attack
FL Federated Learning
GNN Graph Neural Network
FedGNN Proposed Federated GNN framework
DER Distributed Energy Resources
SOC State of Charge (battery)

References

1. Masood F, Khan MA, Alshehri MS, Ghaban W, Saeed F, Albarakati HM, et al. AI-based wireless sensor IoT networks for energy-efficient consumer electronics using stochastic optimization. IEEE Trans Consum Electron. 2024;70(4):6855–62. doi:10.1109/TCE.2024.3416035. [Google Scholar] [CrossRef]

2. Qays MO, Ahmad I, Abu-Siada A, Hossain ML, Yasmin F. Key communication technologies, applications, protocols and future guides for IoT-assisted smart grid systems: a review. Energy Rep. 2023;9(2020):2440–52. doi:10.1016/j.egyr.2023.01.085. [Google Scholar] [CrossRef]

3. Asiri F, Malwi WA, Masood F, Alshehri MS, Zhukabayeva T, Shah SA, et al. Privacy preserving federated anomaly detection in IoT edge computing using bayesian game reinforcement learning. Comput Mater Contin. 2025;84(2):3943. doi:10.32604/cmc.2025.066498. [Google Scholar] [CrossRef]

4. Liu M, Teng F, Zhang Z, Ge P, Sun M, Deng R, et al. Enhancing cyber-resiliency of der-based smart grid: a survey. IEEE Trans Smart Grid. 2024;15(5):4998–5030. doi:10.1109/TSG.2024.3373008. [Google Scholar] [CrossRef]

5. Zhang Z, Deng R, Yau DK, Cheng P, Chow MY. Security enhancement of power system state estimation with an effective and low-cost moving target defense. IEEE Trans Syst Man Cybern: Syst. 2022;53(5):3066–81. [Google Scholar]

6. Zhang Z, Liu M, Sun M, Deng R, Cheng P, Niyato D, et al. Vulnerability of machine learning approaches applied in IoT-based smart grid: a review. IEEE Internet Things J. 2024;11(11):18951–75. doi:10.1109/JIOT.2024.3349381. [Google Scholar] [CrossRef]

7. Gupta H, Agarwal P, Gupta K, Baliarsingh S, Vyas OP, Puliafito A. Fedgrid: a secure framework with federated learning for energy optimization in the smart grid. Energies. 2023;16(24):8097. doi:10.3390/en16248097. [Google Scholar] [CrossRef]

8. Zhang Z, Rath S, Xu J, Xiao T. Federated learning for smart grid: a survey on applications and potential vulnerabilities. ACM Trans Cyber-Phys Syst. 2026;10(1):1–26. doi:10.1145/3760788. [Google Scholar] [CrossRef]

9. Wen J, Zhang Z, Lan Y, Cui Z, Cai J, Zhang W. A survey on federated learning: challenges and applications. Int J Mach Learn Cybern. 2023;14(2):513–35. doi:10.1007/s13042-022-01647-y. [Google Scholar] [CrossRef]

10. Chen T, Zhang X, You M, Zheng G, Lambotharan S. A GNN-based supervised learning framework for resource allocation in wireless IoT networks. IEEE Internet Things J. 2021;9(3):1712–24. doi:10.1109/JIOT.2021.3091551. [Google Scholar] [CrossRef]

11. Qiu J, Zhang X, Wang T, Hou H, Wang S, Yang T. A GNN-based false data detection scheme for smart grids. Algorithms. 2025;18(3):166. doi:10.3390/a18030166. [Google Scholar] [CrossRef]

12. Dzafic D, Džafić I, Akagic A. Anomaly detection in smart grid time-series data using graph deviation networks. Eng Appl Artif Intell. 2026;165(2):113512. doi:10.1016/j.engappai.2025.113512. [Google Scholar] [CrossRef]

13. Abdullahi SM, Lazarova-Molnar S. On the adoption and deployment of secure and privacy-preserving IIoT in smart manufacturing: a comprehensive guide with recent advances. Int J Inf Secur. 2025;24(1):53. doi:10.1007/s10207-024-00951-8. [Google Scholar] [CrossRef]

14. Jing Q, Vasilakos AV, Wan J, Lu J, Qiu D. Security of the Internet of Things: perspectives and challenges. Wirel Netw. 2014;20(8):2481–501. doi:10.1007/s11276-014-0761-7. [Google Scholar] [CrossRef]

15. Komninos N, Philippou E, Pitsillides A. Survey in smart grid and smart home security: issues, challenges and countermeasures. IEEE Commun Surv Tutor. 2014;16(4):1933–54. doi:10.1109/COMST.2014.2320093. [Google Scholar] [CrossRef]

16. Bekara C. Security issues and challenges for the IoT-based smart grid. Procedia Comput Sci. 2014;34:532–7. doi:10.1016/j.procs.2014.07.064. [Google Scholar] [CrossRef]

17. Hossain E, Khan I, Un-Noor F, Sikander SS, Sunny MSH. Application of big data and machine learning in smart grid, and associated security concerns: a review. IEEE Access. 2019;7:13960–88. doi:10.1109/ACCESS.2019.2894819. [Google Scholar] [CrossRef]

18. Fragkos G, Johnson J, Tsiropoulou EE. Dynamic role-based access control policy for smart grid applications: an offline deep reinforcement learning approach. IEEE Trans Hum Mach Syst. 2020;52(4):761–73. doi:10.1109/THMS.2022.3163185. [Google Scholar] [CrossRef]

19. Gunduz MZ, Das R. Cyber-security on smart grid: threats and potential solutions. Comput Netw. 2020;169(11):107094. doi:10.1016/j.comnet.2019.107094; [Google Scholar] [CrossRef]

20. Rajaperumal TA, Columbus CC. Transforming the electrical grid: the role of AI in advancing smart, sustainable, and secure energy systems. Energy Inform. 2025;8(1):51. doi:10.1186/s42162-024-00461-w. [Google Scholar] [CrossRef]

21. Mollah MB, Zhao J, Niyato D, Lam KY, Zhang X, Ghias AM, et al. Blockchain for future smart grid: a comprehensive survey. IEEE Internet Things J. 2020;8(1):18–43. doi:10.1109/JIOT.2020.2993601. [Google Scholar] [CrossRef]

22. Amin W, Huang Q, Li J, Khan AA, Subramaniam U, Selvam S. A secure energy management model for Peer-to-Peer smart grids with user-centric constraints. Internet Things. 2025;33(9):101678. doi:10.1016/j.iot.2025.101678. [Google Scholar] [CrossRef]

23. Nazir I, Mushtaq N, Ishfaq H, Amin W, Maaliw RR, Shi X, et al. Blockchain enabled reserved pricing and privacy preserving model for peer-to-peer energy trading in smart grid. IEEE Trans Consum Electron. 2025;71(3):8716–26. doi:10.1109/TCE.2025.3596907. [Google Scholar] [CrossRef]

24. Kaif AD, Alam KS, Das SK, Chen G, Islam S, Muyeen SM. Blockchain-integrated cyber-physical smart meter design and implementation for secured energy trading in virtual power plants. IEEE Trans Autom Sci Eng. 2025;22:15083–93. doi:10.1109/TASE.2025.3566938. [Google Scholar] [CrossRef]

25. Aghajari HA, Niknam T, Sharifhosseini SM, Taabodi MH, Pourbehzadi M. Enhanced resilience in smart grids: a neural network-based detection of data integrity attacks using improved war strategy optimization. Elect Power Syst Res. 2025;239(3):111249. doi:10.1016/j.epsr.2024.111249. [Google Scholar] [CrossRef]

26. Gozuoglu A. IoT-enhanced battery management system for real-time SoC and SoH monitoring using STM32-based programmable electronic load. Internet Things. 2025;30:101509. doi:10.1016/j.iot.2025.101509. [Google Scholar] [CrossRef]

27. Kumar S, Ramaswamy KC, Mathiyalagan SR, Giri J, Kanan M. An efficient battery management system for electric vehicles using IoT & Blockchain. Results Eng. 2025;27(3):106284. doi:10.1016/j.rineng.2025.106284. [Google Scholar] [CrossRef]

28. Masood F, Ahmad J, Al Mazroa A, Alasbali N, Alazeb A, Alshehri MS. Multi IRS-aided low-carbon power management for green communication in 6G smart agriculture using deep game theory. Comput Intell. 2025;41(1):e70022. doi:10.1111/coin.70022. [Google Scholar] [CrossRef]

29. Alasbali N, Masood F, Alnazzawi N, Ghaban W, Alazeb A, Basurra S, et al. IoT-UAV enabled intelligent resource management in low-carbon smart agriculture using federated reinforcement learning. IEEE Trans Consum Electron. 2025;71(2):6933–41. doi:10.1109/TCE.2025.3572552. [Google Scholar] [CrossRef]

30. Arzamasov V. Electrical grid stability simulated data. UCI machine learning repository; 2018 [cited 2026 Mar 20]. Available from: 10.24432/C5PG66 [Google Scholar] [CrossRef]

31. Moustafa N. A new distributed architecture for evaluating AI-based security systems at the edge: network TON_IoT datasets. Sustain Cities Soc. 2021;72:102994. doi:10.1016/j.scs.2021.102994. [Google Scholar] [CrossRef]


Cite This Article

APA Style
Mazroa, A.A., Masood, F., Awaji, B.H., Alhefdi, M., Aljohani, A. et al. (2026). FedGNN: Federated Graph Neural Networks for Privacy-Preserving Cyber-Resilient Energy Optimization in IoT-Based Smart Grids. Computer Modeling in Engineering & Sciences, 147(2), 51. https://doi.org/10.32604/cmes.2026.080134
Vancouver Style
Mazroa AA, Masood F, Awaji BH, Alhefdi M, Aljohani A, Ahmad J. FedGNN: Federated Graph Neural Networks for Privacy-Preserving Cyber-Resilient Energy Optimization in IoT-Based Smart Grids. Comput Model Eng Sci. 2026;147(2):51. https://doi.org/10.32604/cmes.2026.080134
IEEE Style
A. A. Mazroa, F. Masood, B. H. Awaji, M. Alhefdi, A. Aljohani, and J. Ahmad, “FedGNN: Federated Graph Neural Networks for Privacy-Preserving Cyber-Resilient Energy Optimization in IoT-Based Smart Grids,” Comput. Model. Eng. Sci., vol. 147, no. 2, pp. 51, 2026. https://doi.org/10.32604/cmes.2026.080134


cc Copyright © 2026 The Author(s). Published by Tech Science Press.
This work is licensed under a Creative Commons Attribution 4.0 International License , which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
  • 245

    View

  • 67

    Download

  • 0

    Like

Share Link