Lightweight and Energy-Aware Intrusion Detection for Industrial IoT Using TinyML and Edge AI Authors: Laila Nassef, Mohammed Ibrahim Alghamdi, Slim BEN CHAABANE, Qaisar Abbas, Wedad M. Alawad, Omar H Albalawi, Osamah I. Alqaisi, Bahjat Fakieh Published: 2026 ABSTRACT Industrial Internet of Things (IIoT) ecosystems are expanding rapidly. Scalable and reliable intrusion detection systems (IDS) are needed to protect critical infrastructures from evolving cyber threats. This study proposes a hybrid IDS framework that combines Graph Attention Networks (GAT) and Bidirectional Gated Recurrent Units (BiGRU) for privacy‑preserving distributed detection. The model is optimized with the Grey Wolf Optimizer (GWO) and enhanced through Federated Learning (FL). In IIoT traffic, GAT captures complex structural links, while BiGRU analyzes bidirectional temporal patterns, enabling accurate anomaly detection. GWO automates hyperparameter tuning and offers faster convergence than traditional methods such as Ant Colony Optimization. FL trains models locally on distributed IIoT devices, preserving data privacy and supporting decentralized deployment. The framework demonstrates improved scalability potential through decentralized training and reduced communication overhead (20% lower in a 10-node simulation), achieving detection accuracies of up to 95% across diverse attack scenarios, including Distributed Denial of Service (DDoS), Advanced Persistent Threats (APTs), and Zero‑Day exploits. It has been evaluated on the Edge‑Industrial Internet of Things dataset (Edge‑IIoTset), Canadian Institute for Cybersecurity – Internet of Things 2023 Dataset (CICIoT2023), and Real‑Time Internet of Things 2022 (RT‑IoT2022) datasets. An Explainable AI (XAI) module further improves interpretability by leveraging GAT’s attention mechanism. Overall, this technology demonstrates competitive offline performance on the EDGE-IIoTset, CICIoT2023, and RT-IoT2022 benchmark datasets, achieving F1-scores of up to 0.94, and shows promising scalability potential through decentralized Federated Learning with 20% lower communication overhead in a 10-node simulation. However, inference latency on resource-constrained edge hardware remains a challenge (e.g., 120–180 ms per sample on Raspberry Pi 4), which limits its strict real-time feasibility in mission-critical environments. Therefore, further model compression, adversarial robustness testing, and real-world deployment validation are required before practical edge-level applicability can be confirmed. Introduction IIoT has transformed manufacturing, energy, and transportation through the integration of cyber-physical systems, efficient data exchange, predictive maintenance, and advanced automation1,2. Its large network of sensors, actuators, and edge devices enables smooth communication and faster decision-making, strengthening productivity and innovation in Industry 4.0 settings3,4. However, the rapid expansion of IIoT deployments has significantly increased cybersecurity risks, exposing critical infrastructures to sophisticated attacks5–7. In 2024, targeted attacks on IIoT systems rose by 30%, including DDoS, APTs, and zero-day exploits8,9. These threats are intensified by the heterogeneous nature of IIoT environments, where modern devices operate alongside outdated systems10,11. Strong IDS are therefore essential. IDS monitors device and network behavior to detect anomalies that may indicate malicious activity12,13. Unlike traditional IT networks, IIoT systems run in real-time and under strict resource limits, where downtime can cause major financial losses. Gartner reported over $50 billion in global economic damage from cyber incidents in 202514,15. Effective IDS requires high accuracy, low latency, scalability, and adaptability to evolving threats1,16. ML and DL methods have become key tools because they use pattern recognition to distinguish malicious from benign traffic17,18. Recurrent models handle sequential data well, while graph‑based models capture the topological structure of IIoT networks19,20. Yet integrating these models into IIoT environments introduces unique challenges that demand innovative solutions2,3. Existing IIoT IDS frameworks still face many challenges. The IIoT’s distributed architecture—spanning edge, fog, and cloud layers creates latency and bandwidth issues that complicate centralized processing4,5. Many traditional IDS rely on centralized training, which requires aggregating private data from multiple devices and raises privacy concerns under regulations such as the California Consumer Privacy Act (CCPA) and General Data Protection Regulation (GDPR)6,7. Conventional convolutional and recurrent models also struggle to capture the complex spatio-temporal patterns in IIoT traffic. Graph Convolutional Networks (GCNs) often perform poorly against adaptive attacks because they treat all neighbors equally and overlook differences in node importance10,11. Similarly, unidirectional recurrent units like Gated Recurrent Unit (GRU) miss subtle anomalies because they cannot model bidirectional context in traffic sequences12,13. Explainability is also a major concern, as black-box deep learning models limit trust and hinder forensic analysis, which industrial stakeholders consider essential16. Generalization remains limited in many existing IIoT intrusion detection approaches, as outdated datasets often fail to capture emerging threats such as multi-vector attacks or AI-generated intrusions18–20. Recent studies emphasize energy-efficient federated learning through optimized Unmanned Aerial Vehicle (UAV) deployment and edge association to reduce resource consumption in distributed IIoT networks17. Energy-aware virtual machine allocation in cloud-based IoT data centers has also shown significant power savings for large-scale applications18. Furthermore, blockchain-based verifiable decentralized identity mechanisms enhance tamper-resistant security in intelligent manufacturing and heterogeneous IIoT ecosystems20. These constraints highlight the need for advanced, scalable IDS frameworks tailored specifically to IIoT environments. Improving accuracy against evolving threats while enabling privacy‑preserving detection in decentralized settings is a key priority. This work addresses these needs by proposing a hybrid IDS framework that integrates GAT, BiGRU, GWO for hyperparameter tuning, FL for distributed privacy‑preserving training, and an XAI module based on GAT attention. The framework shows competitive offline performance on benchmark datasets while real-time feasibility on constrained edge devices remains to be validated. “Proposed methodology” section provides detailed descriptions of these components and their integration. The following are this paper’s main contributions:Evaluations on the EDGE-IIoTset, CICIoT2023, and RT-IoT2022 datasets, supported by a detailed ablation study (“Ablation study” section), provide empirical evidence that the full hybrid GAT-BiGRU-GWO-FL-XAI architecture achieves competitive offline detection accuracy and efficiency, with each component contributing complementary strengths in accuracy, temporal modeling, optimization, privacy, and interpretability.Federated Learning enables scalability potential for larger-scale deployments via distributed training (demonstrated with 10 simulated edge nodes), reduces the risks of data centralization, and supports privacy-preserving training.Comparisons with selected baselines like Deep Convolutional Neural Network + Bidirectional Long Short‑Term Memory (DCNNBiLSTM), Hierarchical Intelligent Decision‑Making (HIDM), and Convolutional Neural Network – Long Short‑Term Memory (CNN-LSTM) with Game Theory, showing 3–8% higher F1-scores on benchmark datasets in offline experiments, while future deployment studies on edge hardware will be required to confirm real-time feasibility. Evaluations on the EDGE-IIoTset, CICIoT2023, and RT-IoT2022 datasets, supported by a detailed ablation study (“Ablation study” section), provide empirical evidence that the full hybrid GAT-BiGRU-GWO-FL-XAI architecture achieves competitive offline detection accuracy and efficiency, with each component contributing complementary strengths in accuracy, temporal modeling, optimization, privacy, and interpretability. Evaluations on the EDGE-IIoTset, CICIoT2023, and RT-IoT2022 datasets, supported by a detailed ablation study (“Ablation study” section), provide empirical evidence that the full hybrid GAT-BiGRU-GWO-FL-XAI architecture achieves competitive offline detection accuracy and efficiency, with each component contributing complementary strengths in accuracy, temporal modeling, optimization, privacy, and interpretability. Federated Learning enables scalability potential for larger-scale deployments via distributed training (demonstrated with 10 simulated edge nodes), reduces the risks of data centralization, and supports privacy-preserving training. Federated Learning enables scalability potential for larger-scale deployments via distributed training (demonstrated with 10 simulated edge nodes), reduces the risks of data centralization, and supports privacy-preserving training. Comparisons with selected baselines like Deep Convolutional Neural Network + Bidirectional Long Short‑Term Memory (DCNNBiLSTM), Hierarchical Intelligent Decision‑Making (HIDM), and Convolutional Neural Network – Long Short‑Term Memory (CNN-LSTM) with Game Theory, showing 3–8% higher F1-scores on benchmark datasets in offline experiments, while future deployment studies on edge hardware will be required to confirm real-time feasibility. Comparisons with selected baselines like Deep Convolutional Neural Network + Bidirectional Long Short‑Term Memory (DCNNBiLSTM), Hierarchical Intelligent Decision‑Making (HIDM), and Convolutional Neural Network – Long Short‑Term Memory (CNN-LSTM) with Game Theory, showing 3–8% higher F1-scores on benchmark datasets in offline experiments, while future deployment studies on edge hardware will be required to confirm real-time feasibility. This is how the rest of the paper is structured. “Related works” section examines relevant IIoT IDS works, emphasizing the gaps our method fills. The suggested methodology, which includes the GAT-BiGRU model, GWO optimization, FL integration, and XAI components, is described in depth in “Proposed methodology” section. The experimental design, datasets, and assessment measures are described in “Experimental evaluation” section. The findings and a comparative analysis are shown in “Conclusion” section. Section 6 wraps up the work and makes recommendations for further investigation. Figure 1 presents the architecture of the proposed method discussed in this manuscript. Fig. 1Overall architecture of the proposed scalable IIoT intrusion detection system, illustrating the integration of GAT-BiGRU core model. Overall architecture of the proposed scalable IIoT intrusion detection system, illustrating the integration of GAT-BiGRU core model. Related works Paper21 introduces a federated learning framework for IoT intrusion detection that combines nature‑inspired hyperparameter optimization with TabTransformer’s ability to model tabular feature interactions. The study shows that privacy‑preserving training across clients is feasible, with competitive accuracy and strong generalization on heterogeneous data. It also offers a practical template for FL‑based IDS pipelines and demonstrates deployment viability on resource‑limited devices. Research22 provides a detailed empirical comparison of CNN and CNN + BiLSTM models for federated IDS on IoT data CICIoT2023. The authors examine client heterogeneity and class imbalance, and they quantify trade‑offs between accuracy, computation per round, and communication cost. Their findings guide the selection of lightweight architectures that maintain performance in edge environments while controlling training latency. A innovative event-based publish/subscribe communication protocol for the IIoT that incorporates traceable and reportable ring signatures was proposed by researchers in23. In distributed industrial networks, this method guarantees publisher authentication, anonymous communication, traceability for harmful activity, and robust privacy. An explainable and trust-aware AI-based system for network slicing in 6G IoT networks is presented in24. It makes use of deep learning models to improve resource allocation while offering interpretability and decision transparency. In dynamic and resource-constrained IoT environments, this method improves stakeholder confidence through performance indicators and attention-based explanations. An enhanced ransomware detection model was created in a different study25 using a hybrid classifier optimized by metaheuristic algorithms, sensitivity analysis using SHapley Additive exPlanations (SHAP) values, and feature selection using F-criterion and recursive feature elimination (RFE). With great interpretability and resilience against zero-day threats, this method achieves high precision, accuracy, and recall on large-scale datasets. Researchers presented VFL + in26, a low-connectivity vertical federated learning architecture that allows autonomous predictions at inference time while incorporating privileged information from other clients during training. This approach improves model independence without sacrificing performance, lowers parameter coupling between participants, and improves privacy in heterogeneous data environments. A memory-guided multiscale network for unsupervised anomaly identification in IoT time series data is shown in research27. It incorporates spectral and spatiotemporal information using hierarchical attention and gating methods. The model achieves better detection performance in noisy and imbalanced IoT environments and successfully captures intricate patterns and dependencies in multivariate sequences. Study28 applies GraphSAGE to IoT IDS by constructing graphs from attribute similarity (Top‑K) rather than physical links. This attribute‑based design creates strong connectivity for tabular telemetry and improves generalization on NF‑ToN‑IoT and NF‑BoT‑IoT. The paper also identifies key design factors—K, similarity metrics, and sampling—that most influence accuracy and inference cost. Work29 combines deep models with post‑hoc interpretation to explore explainable AI for IoT IDS. Using feature attribution and rule‑level summaries, the authors expose the decision logic behind high‑risk alerts, improving auditability and operational trust. Their results show that XAI can guide feature engineering and reveal dataset issues without significantly reducing detection performance. Research30 proposes explainable, attention‑based methods for detecting zero‑day attacks in IoT networks. The combination of attention mechanisms and interpretability tools enables generalization to unseen threats and provides human‑readable explanations at the feature or flow level. This makes the approach suitable for post‑incident analysis and response in resource‑constrained IoT settings. In31, CBRFL is introduced, a committee-based framework for Byzantine-resilient federated learning, which, through weighted aggregation, increases the resilience against malicious clients and achieves high accuracy in non-IID data scenarios, making it suitable for distributed IoT applications. Work32 optimizes IoT IDS components by combining the Whale Optimization Algorithm (WOA) with GWO. This hybrid approach achieves a better exploration–exploitation balance than either metaheuristic alone. By improving F1 scores and reducing false alarms across benchmarks, the method shows the value of complementary heuristics for navigating complex objective landscapes in IoT security. Work42 proposes a hybrid blockchain-based IDS combining Genetic Algorithm Optimization (GAO)-optimized, Extreme Gradient Boosting (XGBoost) classification with Elliptic Curve Cryptography (ECC)-secured data transmission. It achieves high accuracy on CIC-IDS2017 and IoT-23 datasets with strong emphasis on secure storage and tamper resistance. While effective for centralized or semi-centralized setups, it lacks federated privacy preservation and graph-based topological modeling of device interactions. In43, the framework integrates blockchain for tamper-proof logging and consensus-based anomaly validation. It demonstrates robust security against data manipulation but incurs higher communication and computational overhead compared to pure ML/FL approaches. Study44 introduces an XAI-enhanced deep model tailored for Industry 5.0 Cyber-Physical Systems (CPS) environments, focusing on interpretability via SHAP/LIME , Local Interpretable Model-agnostic Explanations (LIME), and high accuracy on CPS-specific datasets. It shares our emphasis on explainability but does not incorporate federated training or graph attention mechanisms. Research45 combines FL for privacy with blockchain for model integrity and auditability. It shows strong resilience to poisoning attacks but reports higher communication costs and lower scalability in very large networks compared to lightweight FL-only designs. Transfer-learning-based BiLSTM model leverages pre-trained weights for fast adaptation to new IoT datasets, achieving good generalization on limited labeled data. While efficient for transfer scenarios, it does not address graph-structured IIoT topologies or federated privacy46. Paper47 targets IIoT-specific threats with high accuracy on industrial datasets. It provides a strong baseline for centralized deep learning but lacks distributed training and attention-based explainability. Proposed methodology This study proposes a hybrid IDS framework. In this section, we outline the architecture of the proposed scalable IDS for IIoT environments. The framework integrates GAT with BiGRU, enhanced by GWO for hyperparameter tuning and supported by FL for distributed, privacy‑aware training. This hybrid design aims to address key IIoT challenges, including heterogeneous device interactions, temporal traffic patterns, and privacy considerations in distributed settings. GAT models the complex topological dependencies in IIoT networks, where devices and communications form graph nodes and edges. BiGRU complements this by processing sequences in both forward and backward directions, capturing long‑term temporal behavior that helps detect subtle anomalies such as stealthy APTs or evolving DDoS variants. GWO, inspired by grey wolves’ hierarchical hunting strategies, automates hyperparameter optimization and ensures efficient convergence without manual tuning. FL decentralizes training across edge devices, reducing the risks of centralized data collection and improving scalability in large IIoT deployments. An XAI module further uses GAT attention weights to generate interpretable explanations, strengthening trust in mission‑critical industrial settings. The overall workflow, shown in Fig. 2, includes data preprocessing, model construction, optimization, federated aggregation, and evaluation. Preprocessed IIoT traffic is passed to the GAT‑BiGRU model, which is optimized through GWO. FL manages local training on distributed nodes and coordinates global updates through secure aggregation. This design improves detection accuracy, lowers latency, and preserves data sovereignty. Fig. 2Workflow of the GAT-BiGRU-GWO-FL hybrid framework, showing data preprocessing, local training on edge nodes, global aggregation, and evaluation steps. Workflow of the GAT-BiGRU-GWO-FL hybrid framework, showing data preprocessing, local training on edge nodes, global aggregation, and evaluation steps. The role of grey wolf optimizer in the framework By automating hyperparameter selection, GWO strengthens the robustness and efficiency of the GAT-BiGRU model. It mimics leadership-driven search behavior, balancing local exploitation and global exploration through the social hierarchy of grey wolves (alpha, beta, delta, and omega)36. This is especially valuable for deep learning in IIoT, where hyperparameters such as learning rate, attention heads, hidden units, and dropout ratios strongly affect performance but are difficult to tune manually due to the high-dimensional search space. The integration of GWO into the framework involves three main components: a data preprocessor for feature refinement, a GAT‑BiGRU core for anomaly analysis, and an FL coordinator for distributed optimization. This automated tuning reduces human bias, improves generalization across diverse attack types, and lowers training overhead, making the IDS suitable for resource‑constrained IIoT edge devices. Figure 3 illustrates the role of GWO within this architecture. Fig. 3Role of Grey Wolf Optimizer in hyperparameter tuning, depicting the wolf pack hierarchy and position update mechanism for GAT-BiGRU optimization. Role of Grey Wolf Optimizer in hyperparameter tuning, depicting the wolf pack hierarchy and position update mechanism for GAT-BiGRU optimization. Algorithm 1Role of GWO in hyperparameter optimization. Algorithm 1Role of GWO in hyperparameter optimization. Role of GWO in hyperparameter optimization. Data preprocessing module Effective preprocessing is essential for handling the noisy, high‑dimensional, and heterogeneous nature of IIoT traffic. Our module begins by ingesting data from the selected datasets (EDGE‑IIoTset, CICIoT2023, and RT‑IoT2022), which include a wide range of benign and malicious flows such as DDoS, Mirai botnets, Address Resolution Protocol (ARP) spoofing, and zero‑day attacks. Raw data is then cleaned by removing duplicates, addressing missing values, and normalizing numerical features using min‑max scaling, where each feature vector is scaled based on its original value. To preserve semantic meaning without introducing ordinal bias, categorical attributes—such as protocol types or IP addresses—are encoded using one‑hot encoding.1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$x^{\prime } = \frac{x - \min (X)}{{\max (X) - \min (X)}},$$\end{document} The next step is dimensionality reduction using Principal Component Analysis (PCA), which retains at least 95% of the variance while projecting the data onto a lower-dimensional subspace. PCA is applied globally on the entire dataset before partitioning for Federated Learning, ensuring a consistent reduced feature space across all edge nodes (e.g., 20–30 components from original attributes like flow duration, packet size, and protocol type). Although PCA is applied globally on the entire dataset before partitioning for Federated Learning, this constitutes a one-time offline preprocessing step performed by a trusted coordinator using only anonymized statistical summaries. No raw or sensitive data is shared among clients during this phase. Only the resulting low-dimensional principal components (20–30 features) are distributed to the edge nodes. This approach maintains the privacy-preserving nature of the subsequent Federated Learning training phase while ensuring a consistent feature space across all participants. This global application preserves semantic meaning by transforming raw features into principal components that capture variance in traffic patterns, without differentiation per-traffic type (e.g., benign vs. malicious) to avoid bias. The PCA-reduced features then serve as initial node attributes in the GAT module, where each node’s feature vector is the projected representation of its aggregated flow data (e.g., average packet size, total bytes), allowing GAT to learn structural relationships on a standardized, low-dimensional input. For IIoT, this stage is essential because datasets such as CICIoT2023 include more than 100 attributes; PCA usually reduces this to 20–30 principal components, easing the curse of dimensionality and speeding up further processing. To support FL, the data is partitioned across simulated edge nodes so that each local subset reflects real‑world distributions without requiring centralized transmission. This preprocessing pipeline, shown in Fig. 4, also incorporates the Synthetic Minority Over‑sampling Technique (SMOTE) to strengthen robustness against class imbalance, which is common in IIoT datasets. In datasets such as CICIoT2023, attack samples—including ARP spoofing and zero‑day exploits—represent less than 10% of all instances, making oversampling essential. Fig. 4Data preprocessing pipeline for IIoT traffic, including cleaning, normalization, PCA dimensionality reduction, SMOTE oversampling, and graph construction. Data preprocessing pipeline for IIoT traffic, including cleaning, normalization, PCA dimensionality reduction, SMOTE oversampling, and graph construction. SMOTE generates synthetic samples for each minority‑class instance using \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k = 5$$\end{document} nearest neighbors and a random interpolation factor \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\lambda$$\end{document}, preserving the underlying data distribution. In our experiments, this process increased the representation of attack classes in EDGE‑IIoTset by roughly 50%, which improved the GAT‑BiGRU model’s recall to 0.95 for rare threats such as APTs. The SMOTE procedure used in this framework builds on the original method introduced by Chawla et al.34 and is adapted for IIoT security scenarios, as demonstrated by Ferrag et al.35. Graph construction from IIoT traffic is performed as follows: Each unique source or destination IP address (or MAC address when available) represents a node. An undirected edge is created between two nodes if at least one bidirectional flow was observed between them within a 60-s time window. For each node, features are obtained by aggregating all flows involving that node (mean, standard deviation, minimum, maximum, and count of packet size, flow duration, and protocol-related statistics) and then applying the previously computed PCA transformation to reduce the feature vector to 20–30 principal components. Neighborhood relationships are defined by the 1-hop adjacency matrix derived from these edges, with self-loops added to include each node’s own aggregated features. This graph structure is built independently for each time window and partitioned across the simulated edge nodes for Federated Learning. This centralized preprocessing step is performed only once and does not involve sharing of raw IIoT traffic data, thereby preserving the overall privacy guarantees of the FL framework. Hyperparameter optimization via GWO The GAT-BiGRU analyzer engine’s success is largely dependent on how well its hyperparameters, such as the number of attention heads in GAT, the number of hidden units in BiGRU, the learning rate, and the dropout rate, are configured. The GWO, which has a faster convergence and a better balance between exploration and exploitation than the ACO utilized in [article base reference], is used to do this. Using datasets like EDGE-IIoTset, the GWO algorithm effectively searches the hyperparameter space to maximize the model’s performance measures, such F1-score, and is inspired by the hierarchical hunting behavior of grey wolves. Figure 5 illustrates the optimization process by showing the GWO flow in tweaking the GAT-BiGRU model. Fig. 5GWO optimization process for GAT-BiGRU hyperparameters, showing iterative fitness evaluation and convergence toward optimal values. GWO optimization process for GAT-BiGRU hyperparameters, showing iterative fitness evaluation and convergence toward optimal values. Each of the wolves (possible solutions) that make up the initial population of GWO represents a collection of hyperparameters. The GAT-BiGRU model’s validation performance (such as accuracy or F1-score) is used to assess each wolf’s fitness. Omega (\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\omega$$\end{document}) wolves follow the top three solutions, represented by alpha (\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\alpha$$\end{document}), beta (\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\beta$$\end{document}), and delta (\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\delta$$\end{document}), which direct the population toward the ideal solution. The following factors control each wolf’s position update:2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$D = |C \cdot X_{p} (t) - X(t)|, \, X(t + 1) = X_{p} (t) - A \cdot D,$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$X_{p} (t)$$\end{document} is the position of the prey (alpha, beta, or delta), \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$X(t)$$\end{document} is the current position of a wolf, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$A$$\end{document} and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$C$$\end{document} are coefficient vectors, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$t$$\end{document} denotes the iteration. The coefficients are defined as:3\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$A = 2a.r_{1} - a, \, C = 2r_{2} ,$$\end{document} In [0,1], where and are random vectors, drops linearly from 2 to 0 over iterations. The GAT-BiGRU model’s capacity to identify IIoT-specific risks is much improved by the tuned hyperparameters; for example, it achieved a 94% F1-score on the EDGE-IIoTset. The ranges and final values of the optimized hyperparameters are summarized in detail in Table 1. To ensure effective hyperparameter tuning for remote IIoT systems, Fig. 5 further demonstrates how GWO interfaces with the GAT-BiGRU engine36.Table 1Optimized hyperparameters for G 1.HyperparameterRangeOptimized valueNumber of GAT Heads4–168BiGRU Hidden Units64–256128Learning Rate0.0001–0.010.001Dropout Rate0.1–0.50.2Number of GAT Layers1–32Number of BiGRU Layers1–32 Table 1Optimized hyperparameters for G 1.HyperparameterRangeOptimized valueNumber of GAT Heads4–168BiGRU Hidden Units64–256128Learning Rate0.0001–0.010.001Dropout Rate0.1–0.50.2Number of GAT Layers1–32Number of BiGRU Layers1–32 Optimized hyperparameters for G 1. Objective function for optimization In order to effectively adjust the GAT-BiGRU model’s hyperparameters, the GWO needs a clear goal function that strikes a compromise between several performance measures designed for IIoT intrusion detection. In contrast to the objective function in [article base reference], which gave priority to accuracy and detection rate for GCN-GRU optimization through ACO, the suggested framework includes an interpretability metric derived from GAT’s attention weights to improve XAI capabilities, as well as F1-score to account for class imbalance. The objective function, as shown in Fig. 6, is intended to optimize the model’s performance on datasets such as RT-IoT2022, CICIoT2023, and EDGE-IIoTset. Fig. 6Evaluation of the objective function in GWO, balancing F1-score and interpretability metrics during hyperparameter search. Evaluation of the objective function in GWO, balancing F1-score and interpretability metrics during hyperparameter search. A weighted combination of the F1-score and an interpretability score is used to create the goal function, which is as follows:4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{Objective}} = w_{1} \cdot {\text{F1 - score}} + w_{2} \cdot {\mathrm{Interpretability,}}$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\text{F1 - score}} = 2 \cdot \frac{{{\mathrm{Precision}} \cdot {\mathrm{Recall}}}}{{{\mathrm{Precision}} + {\mathrm{Recall}}}}$$\end{document}, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{Interpretability}}$$\end{document} is computed as the average attention score of critical nodes (e.g., nodes involved in attacks) in the GAT module:5\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$Interpretability = \frac{1}{{|{\mathcal{N}}_{c} |}}\sum\limits_{{i \in {\mathcal{N}}_{c} }} {\alpha_{i} } ,$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal{N}}_{c}$$\end{document} represents the set of critical nodes, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\alpha_{i}$$\end{document} is the attention score for node \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$i$$\end{document}. The weights \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$w_{1}$$\end{document} and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$w_{2}$$\end{document} (e.g., \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$w_{1} = 0.7$$\end{document}, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$w_{2} = 0.3$$\end{document}) balance the trade-off between detection performance and interpretability, ensuring the model is both accurate and explainable36. GWO is useful in optimizing hyperparameters such as the number of attention heads (8) and BiGRU hidden units (128). For example, on the EDGE-IIoTset, the objective function obtained an F1-score of 94% and an interpretability score of 0.85 for DDoS attack nodes. In order to direct the wolf population toward the best solutions, GWO iteratively calculates the goal function, as shown in Fig. 6. Table 2 highlights the balance attained in the suggested architecture36 by summarizing the weights and performance indicators of the objective function across several datasets.Table 2Weights and performance metrics of the objective function for GWO.DatasetF1-score weightInterpretability weightF1-score (%)Interpretability scoreEDGE-IIoTset0.70.3940.85CICIoT20230.70.3920.82RT-IoT20220.70.3930.80 Table 2Weights and performance metrics of the objective function for GWO.DatasetF1-score weightInterpretability weightF1-score (%)Interpretability scoreEDGE-IIoTset0.70.3940.85CICIoT20230.70.3920.82RT-IoT20220.70.3930.80 Weights and performance metrics of the objective function for GWO. Federated integration and XAI enhancement By using GAT’s attention mechanism, the XAI module enhances interpretability, and the proposed GAT‑BiGRU model integrates smoothly with FL. This enables privacy‑preserving, distributed training across IIoT edge nodes. Building on existing GAT‑based frameworks37, our GAT‑BiGRU model strengthens anomaly detection by adding bidirectional temporal analysis, which improves accuracy in dispersed IIoT systems. This integration supports strong detection in decentralized environments and addresses key challenges such as data privacy and the need for explainable decisions when identifying threats like DDoS, APTs, and Mirai botnets. Figure 7 illustrates the full workflow, including FL aggregation and XAI‑driven attention visualization. The global model is then updated using the Federated Averaging (FedAvg) algorithm, which combines local model weights as follows:6\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$w_{{{\mathrm{global}}}} = \sum\limits_{i = 1}^{N} {\frac{{n_{i} }}{{n_{{{\mathrm{total}}}} }}} w_{i} ,$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$w_{i}$$\end{document} represents the weights of the local model at node \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$i$$\end{document}, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n_{i}$$\end{document} is the number of samples at node \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$i$$\end{document}, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n_{{{\mathrm{total}}}}$$\end{document} is the total number of samples across all nodes, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$N$$\end{document} is the number of edge nodes (e.g., \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$N = 10$$\end{document}). This approach preserves data privacy while achieving high detection performance, such as a 94% F1-score on EDGE-IIoTset38. While FedAvg provides communication-efficient aggregation without sharing raw data thereby aligning with privacy regulations such as GDPR formal privacy guarantees (e.g., differential privacy bounds or protection against membership inference attacks) were not implemented in this work and represent an important direction for future enhancement. Fig. 7Integration of FL (via FedAvg aggregation) and XAI (attention visualization) in the GAT-BiGRU model across edge nodes. Integration of FL (via FedAvg aggregation) and XAI (attention visualization) in the GAT-BiGRU model across edge nodes. The XAI module leverages GAT’s multi-head attention mechanism to generate interpretable attention maps that highlight critical nodes in the IIoT network (e.g., devices acting as sources of DDoS attacks). To obtain a single interpretable score per node, the attention weights from all H heads (H = 8 as optimized by GWO) are aggregated using simple averaging without weighted fusion or head pruning. The aggregated attention score for a node \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$v$$\end{document} is computed as:7\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\alpha_{v} = \frac{1}{H}\sum\limits_{h = 1}^{H} {\left( {\frac{1}{{|{\mathcal{N}}(v)|}}\sum\limits_{{u \in {\mathcal{N}}(v)}} {\alpha_{vu}^{(h)} } } \right)}$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\alpha_{vu}^{(h)}$$\end{document} is the attention coefficient between nodes \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$v$$\end{document} and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$u$$\end{document} in the \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$h$$\end{document} -th attention head, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal{N}}(v)$$\end{document} denotes the neighbors of node v , and nodes with \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\alpha_{v} > 0.5$$\end{document} are flagged as critical for forensic analysis and visualized in attention maps (see Fig. 9). This straightforward aggregation improves the reproducibility and interpretability of model decisions. These aggregated scores are then thresholder (e.g., scores > 0.5 flagged as ‘critical’) and visualized in attention maps (as in Fig. 9) to explain model decisions, such as attributing a high score of 0.85 to a DDoS source node for forensic analysis. These attention maps provide insights into model decisions, such as identifying a device with a high attention score of 0.85 as the source of a DDoS attack, enhancing trust in the IDS39. Figure 7 illustrates the synergy between FL and XAI. This shows how local models are aggregated via FedAvg and how attention maps are generated for interpretability. Table 3 summarizes the performance metrics of the FL-XAI integration. This includes detection accuracy and interpretability scores across different datasets. The proposed framework demonstrates robust performance in distributed IIoT settings, achieving, for example, a 92% F1-score on CICIoT2023 with an interpretability score of 0.8235,36.Table 3Performance metrics of FL and XAI integration.DatasetNumber of edge nodesF1-score (%)Interpretability scoreEDGE-IIoTset10940.85CICIoT202310920.82RT-IoT202210930.80 Table 3Performance metrics of FL and XAI integration.DatasetNumber of edge nodesF1-score (%)Interpretability scoreEDGE-IIoTset10940.85CICIoT202310920.82RT-IoT202210930.80 Performance metrics of FL and XAI integration. Mathematical formulations and algorithms The suggested IDS for IIoT is based on a combination of mathematical formulations and algorithms, including GAT, BiGRU, GWO, FL, and XAI. Figure 8 shows the entire architecture, which includes interpretable anomaly detection, federated aggregation, model training, hyperparameter tuning, and data preprocessing. Our approach utilizes BiGRU for bidirectional sequence analysis, in line with federated Temporal Convolutional Network-Bidirectional Gated Recurrent Units (TCN-BiGRU) models40. It is tuned by GWO to attain higher F1-scores and faster convergence across datasets. Fig. 8Complete end-to-end framework of the GAT-BiGRU IDS, encompassing preprocessing, model training, optimization, FL aggregation, and XAI outputs. Complete end-to-end framework of the GAT-BiGRU IDS, encompassing preprocessing, model training, optimization, FL aggregation, and XAI outputs. Algorithm 1 offers a single pseudocode that describes every stage of the IDS process, from threat detection to data feeding. The GAT module calculates attention scores for every pair of nodes in IIoT networks by modeling topological interdependence as follows:8\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\alpha_{ij} = {\mathrm{LeakyReLU}}\left( {W \cdot [h_{i} ||h_{j} ]} \right),$$\end{document}and updating node features as:9\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$h^{\prime}_{i} = \sigma \left( {\sum\limits_{{j \in {\mathcal{N}}_{i} }} {\alpha_{ij} } \cdot W \cdot h_{j} } \right),$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$h_{i}$$\end{document} and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$h_{j}$$\end{document} are node feature vectors, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$W$$\end{document} is a learnable weight matrix, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sigma$$\end{document} is a non-linear activation, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal{N}}_{i}$$\end{document} denotes the neighbors of node \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$i$$\end{document}39. The BiGRU module processes temporal sequences bidirectionally:10\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$h_{t} = {\mathrm{BiGRU}}(h^{\prime}_{i} ,t) = [\overrightarrow {{h_{t} }} ||\overleftarrow {{h_{t} }} ],$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\overrightarrow {{h_{t} }}$$\end{document} and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\overleftarrow {{h_{t} }}$$\end{document} are forward and backward hidden states, respectively. Hyperparameter optimization is performed using GWO, which updates wolf positions based on:11\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$D = \left| {C \cdot X_{p} (t) - X(t)} \right|,\quad X(t + 1) = X_{p} (t) - A \cdot D,$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$X_{p} (t)$$\end{document} is the position of the prey (alpha, beta, or delta), \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$A = 2a \cdot r_{1} - a$$\end{document}, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$C = 2 \cdot r_{2}$$\end{document}, with \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$a$$\end{document} decreasing from 2 to 036. The objective function for optimization combines F1-score and interpretability:12\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{gathered} {\mathrm{Objective}} = w_{1} \cdot {\text{F1 - score}} + w_{2} \cdot {\mathrm{Interpretability}}, \hfill \\ {\text{F1 - score}} = 2 \cdot \frac{{{\mathrm{Precision}} \cdot {\mathrm{Recall}}}}{{{\mathrm{Precision}} + {\mathrm{Recall}}}},\quad {\mathrm{Interpretability}} = \frac{1}{{|{\mathcal{N}}_{c} |}}\sum\limits_{{i \in {\mathcal{N}}_{c} }} {\alpha_{i} } , \hfill \\ \end{gathered}$$\end{document}with weights \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$w_{1} = 0.7$$\end{document} and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$w_{2} = 0.3$$\end{document}36. Federated Learning enables privacy-preserving training across edge nodes, aggregating local models via:13\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$w_{global} = \sum\limits_{i = 1}^{N} {\frac{{n_{i} }}{{n_{{{\mathrm{total}}}} }}} w_{i} ,$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$N = 10$$\end{document} edge nodes are used [McMahan et al., 2017]. The XAI module generates attention maps using:14\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\alpha_{i} = \frac{1}{K}\sum\limits_{k = 1}^{K} {\sum\limits_{{j \in {\mathcal{N}}_{i} }} {\alpha_{ij}^{k} } } ,$$\end{document}with \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$K = 8$$\end{document} attention heads, highlighting critical nodes (e.g., a device with \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\alpha_{i} = 0.85$$\end{document} in a DDoS attack). A robust adaptive secure control for Multiple‑Input Multiple‑Output (MIMO) switched CPS under unknown deception attacks is developed, which ensures the stability and security of the system39. Algorithm 2, detailed below, encapsulates the end-to-end IDS process, from data preprocessing to anomaly detection. Figure 8 provides a visual representation of the framework, showing the integration of preprocessing, GAT-BiGRU analysis, GWO optimization, FL aggregation, and XAI visualization. The proposed IDS achieves high performance, for example, a 94% F1-score on EDGE-IIoTset, demonstrating its effectiveness in detecting IIoT threats like APTs and Mirai botnets33,35,36. Algorithm 2Pseudocode for the GAT-BiGRU IDS. Algorithm 2Pseudocode for the GAT-BiGRU IDS. Pseudocode for the GAT-BiGRU IDS. Experimental evaluation This section evaluates the proposed IDS for IIoT using the integrated GWO, BiGRU, GAT, and FL framework. The assessment measures the model’s ability to detect a wide range of cyberthreats across three benchmark datasets: EDGE‑IIoTset, CICIoT2023, and RT‑IoT2022. These datasets include attacks such as DDoS, Mirai botnets, ARP spoofing, and zero‑day exploits. An ablation study was conducted to isolate component contributions. The experiments are designed to test the effectiveness of the GAT‑BiGRU architecture in distributed IIoT settings, the benefits of GWO‑based hyperparameter tuning, and the scalability and privacy advantages provided by FL. Performance is measured using standard metrics—accuracy, precision, recall, F1‑score, and false positive rate (FPR)—with particular emphasis on the F1‑score due to the class imbalance common in IIoT datasets. Experimental setup The experiments were conducted in a distributed setup with multiple edge nodes simulating an IIoT environment. Each node processed a local subset of the EDGE‑IIoTset, CICIoT2023, and RT‑IoT2022 datasets, which together cover diverse attack scenarios and benign traffic patterns. The preprocessing pipeline from “Data preprocessing module” section was applied to clean, normalize, encode, and convert the data into graph structures. As described in “The role of grey wolf optimizer in the framework” section, the GAT‑BiGRU model was configured using GWO‑optimized hyperparameters: 8 attention heads, 128 BiGRU hidden units, a learning rate of 0.005, and a batch size of 64. Local models were trained independently on each edge node and then aggregated through the FedAvg algorithm within the FL framework.15\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathbf{w}}_{global} = \mathop \sum \limits_{k = 1}^{K} \frac{{n_{k} }}{N}{\mathbf{w}}_{k} ,$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{w}}_{k}$$\end{document} represents the local model weights, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${n}_{k}$$\end{document} is the local dataset size, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$N$$\end{document} is the total data size, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$K$$\end{document} is the number of edge nodes (set to 10 in our experiments). Training was performed over 50 epochs, with GWO iterating for 50 generations to optimize hyperparameters. The fitness function for GWO balanced detection performance and computational efficiency:\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$f\left( \theta \right) = w_{1} \left( {1 - {\text{F1 - score}}} \right) + w_{2} \cdot {\text{Training Time}} + w_{3} \cdot {\text{Communication Overhead}}$$\end{document}where weights \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${w}_{1}=0.6$$\end{document}, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${w}_{2}=0.2$$\end{document}, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${w}_{3}=0.2$$\end{document} prioritized detection accuracy while considering resource constraints typical in IIoT. All models were evaluated using five-fold cross-validation with random seed fixed for reproducibility. Mean and standard deviation are reported for all metrics. Statistical significance of differences in F1-score was assessed using paired t-tests (or Wilcoxon signed-rank tests) at α = 0.05. Evaluation metrics The performance of the proposed IDS was evaluated using the following metrics:—Accuracy: The proportion of correctly classified instances:16\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{Accuracy}} = \frac{{{\mathrm{TP}} + {\mathrm{TN}}}}{{{\mathrm{TP}} + {\mathrm{TN}} + {\mathrm{FP}} + {\mathrm{FN}}}}.$$\end{document} Precision: The ratio of true positive predictions to total positive predictions:17\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{Precision}} = \frac{{{\mathrm{TP}}}}{{{\mathrm{TP}} + {\mathrm{FP}}}}.$$\end{document} Recall: The ratio of true positives to actual positive instances:18\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{Recall}} = \frac{{{\mathrm{TP}}}}{{{\mathrm{TP}} + {\mathrm{FN}}}}$$\end{document} F1-score: The harmonic mean of precision and recall, critical for imbalanced datasets:19\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\text{F1 - score}} = 2 \cdot \frac{{{\mathrm{Precision}} \cdot {\mathrm{Recall}}}}{{{\mathrm{Precision}} + {\mathrm{Recall}}}}.$$\end{document} FPR: The ratio of negative instances incorrectly classified as positive:20\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{FPR}} = \frac{{{\mathrm{FP}}}}{{{\mathrm{FP}} + {\mathrm{TN}}}}.$$\end{document}where TP, TN, FP, and FN denote true positives, true negatives, false positives, and false negatives, respectively. Results and analysis GAT, BiGRU, GWO, and FL were all integrated in the proposed IDS, which was thoroughly tested on three benchmark datasets: EDGE-IIoTset, CICIoT2023, and RT-IoT2022. From innocuous flows to complex attack scenarios like DDoS, APTs, Mirai botnets, ARP spoofing, and zero-day exploits, these datasets cover a wide range of IIoT traffic patterns. Convolutional Neural Network (CNN), LSTM, and Graph Convolutional Network (GCN), which are frequently used in IIoT intrusion detection, were among the baseline techniques against which the performance of the suggested GAT-BiGRU model was evaluated. Five-fold cross-validation was used to achieve robust and dependable results for all models’ training and testing on preprocessed datasets. The suggested model achieving improvements over baselines in F1-scores by 3–8%, as shown in Table 4. On the EDGE-IIoTset dataset, the proposed GAT-BiGRU model achieved a competitive offline F1-score of 0.94 on the EDGE-IIoTset, outperforming CNN (0.87), LSTM (0.89), and GCN (0.91) in five-fold cross-validation. (IIoT)This improvement of 3–7% in F1-score indicates better handling of class imbalance and rare attacks (e.g., ARP spoofing), as the higher recall (0.95) reduces missed detections while maintaining high precision (0.93), leading to fewer false alarms in resource-constrained IIoT environments. In contrast to 0.85 CNN, 0.88 Long Short Term Memory (LSTM), and 0.90 GCN, the GAT-BiGRU model maintained an F1-score of 0.92 for the CICIoT2023 dataset, which contains high-dimensional data with over 100 attributes and intricate assault patterns. With an offline F1-score of 0.93 and a low FPR of 0.02 on the RT-IoT2022 dataset, the model demonstrated few false alarms in controlled experiments. Table 4 provides a summary of these findings by displaying the performance metrics for each dataset and model.Table 4Performance comparison of the proposed GAT-BiGRU model against baselines (CNN, LSTM, GCN) across the EDGE-IIoT set, CICIoT2023, and RT-IoT2022 datasets. Values are mean ± standard deviation over five-foldcross-validation. Statistical significance of F1-score differences is indicated by p-values.DatasetModelAccuracyPrecisionRecallF1-scoreFPRp-value (F1 vs. Proposed)EDGE-IIoTsetGAT-BiGRU (Proposed)0.950 ± 0.0080.930 ± 0.0090.950 ± 0.0070.940 ± 0.0080.030 ± 0.004—CNN0.880 ± 0.0120.860 ± 0.0130.880 ± 0.0110.870 ± 0.0120.050 ± 0.006p < 0.001LSTM0.900 ± 0.0100.880 ± 0.0110.900 ± 0.0090.890 ± 0.0100.040 ± 0.005p < 0.001GCN0.920 ± 0.0090.900 ± 0.0100.920 ± 0.0080.910 ± 0.0090.040 ± 0.005p = 0.002CICIoT2023GAT-BiGRU (Proposed)0.930 ± 0.0090.910 ± 0.0100.930 ± 0.0080.920 ± 0.0090.030 ± 0.004—CNN0.860 ± 0.0140.840 ± 0.0150.860 ± 0.0130.850 ± 0.0140.060 ± 0.007p < 0.001LSTM0.890 ± 0.0110.870 ± 0.0120.890 ± 0.0100.880 ± 0.0110.050 ± 0.006p < 0.001GCN0.910 ± 0.0100.890 ± 0.0110.910 ± 0.0090.900 ± 0.0100.040 ± 0.005p = 0.003RT-IoT2022GAT-BiGRU (Proposed)0.940 ± 0.0070.920 ± 0.0080.940 ± 0.0060.930 ± 0.0070.020 ± 0.003—CNN0.870 ± 0.0130.850 ± 0.0140.870 ± 0.0120.860 ± 0.0130.050 ± 0.006p < 0.001LSTM0.900 ± 0.0100.880 ± 0.0110.900 ± 0.0090.890 ± 0.0100.040 ± 0.005p < 0.001GCN0.920 ± 0.0090.900 ± 0.0100.920 ± 0.0080.910 ± 0.0090.030 ± 0.004p = 0.001 Table 4Performance comparison of the proposed GAT-BiGRU model against baselines (CNN, LSTM, GCN) across the EDGE-IIoT set, CICIoT2023, and RT-IoT2022 datasets. Values are mean ± standard deviation over five-foldcross-validation. Statistical significance of F1-score differences is indicated by p-values.DatasetModelAccuracyPrecisionRecallF1-scoreFPRp-value (F1 vs. Proposed)EDGE-IIoTsetGAT-BiGRU (Proposed)0.950 ± 0.0080.930 ± 0.0090.950 ± 0.0070.940 ± 0.0080.030 ± 0.004—CNN0.880 ± 0.0120.860 ± 0.0130.880 ± 0.0110.870 ± 0.0120.050 ± 0.006p < 0.001LSTM0.900 ± 0.0100.880 ± 0.0110.900 ± 0.0090.890 ± 0.0100.040 ± 0.005p < 0.001GCN0.920 ± 0.0090.900 ± 0.0100.920 ± 0.0080.910 ± 0.0090.040 ± 0.005p = 0.002CICIoT2023GAT-BiGRU (Proposed)0.930 ± 0.0090.910 ± 0.0100.930 ± 0.0080.920 ± 0.0090.030 ± 0.004—CNN0.860 ± 0.0140.840 ± 0.0150.860 ± 0.0130.850 ± 0.0140.060 ± 0.007p < 0.001LSTM0.890 ± 0.0110.870 ± 0.0120.890 ± 0.0100.880 ± 0.0110.050 ± 0.006p < 0.001GCN0.910 ± 0.0100.890 ± 0.0110.910 ± 0.0090.900 ± 0.0100.040 ± 0.005p = 0.003RT-IoT2022GAT-BiGRU (Proposed)0.940 ± 0.0070.920 ± 0.0080.940 ± 0.0060.930 ± 0.0070.020 ± 0.003—CNN0.870 ± 0.0130.850 ± 0.0140.870 ± 0.0120.860 ± 0.0130.050 ± 0.006p < 0.001LSTM0.900 ± 0.0100.880 ± 0.0110.900 ± 0.0090.890 ± 0.0100.040 ± 0.005p < 0.001GCN0.920 ± 0.0090.900 ± 0.0100.920 ± 0.0080.910 ± 0.0090.030 ± 0.004p = 0.001 Performance comparison of the proposed GAT-BiGRU model against baselines (CNN, LSTM, GCN) across the EDGE-IIoT set, CICIoT2023, and RT-IoT2022 datasets. Values are mean ± standard deviation over five-foldcross-validation. Statistical significance of F1-score differences is indicated by p-values. The synergistic combination of GAT and BiGRU, amplified by GWO and FL, is responsible for the effectiveness of the suggested framework. As shown in Fig. 9, GAT’s attention method efficiently captures topological linkages by dynamically weighting important device interactions (e.g., high attention scores of 0.85 for DDoS source nodes). Fig. 9Example GAT attention map highlighting critical nodes (e.g., high attention score 0.85 for DDoS source) in an IIoT network for interpretable detection. Example GAT attention map highlighting critical nodes (e.g., high attention score 0.85 for DDoS source) in an IIoT network for interpretable detection. In accordance with GDPR regulations, the FL framework reduced communication overhead by 20% by decentralizing training among 10 edge nodes, ensuring scalability and privacy. In order to facilitate forensic investigation in industrial settings, the XAI module further improved practical utility by producing attention maps, as illustrated in Fig. 9. These maps highlight crucial nodes (such as devices with attention scores of 0.85 in DDoS attacks). Figure 10 shows the F1-scores of the baselines and the suggested model for each of the three datasets in a bar chart to give a visual comparison of performance. The consistent 3–8% higher F1-scores across all datasets visually confirm the framework’s superior ability to balance precision and recall in imbalanced IIoT traffic, particularly for rare and multi-class attacks, supporting its effectiveness as a more reliable detection solution compared to traditional deep learning baselines. The graph unequivocally shows how consistently the GAT-BiGRU model performs better, especially when managing intricate assault patterns. Furthermore, a line graph comparing the convergence trends of GWO to ACO, which is employed in the baseline GCN-GRU model36, is presented in Fig. 11. This faster convergence of GWO (approximately 23% fewer iterations) demonstrates its superior exploration–exploitation balance in high-dimensional spaces, translating to reduced training overhead and faster deployment readiness in resource-limited IIoT edge environments compared to the ACO baseline. In comparison to ACO, which takes 65 iterations, GWO converges more quickly (within 50 iterations), demonstrating its effectiveness in optimizing high-dimensional hyperparameter spaces. Fig. 10Bar chart comparing F1-scores of the proposed GAT-BiGRU model against baselines (CNN, LSTM, GCN) across the three datasets. Bar chart comparing F1-scores of the proposed GAT-BiGRU model against baselines (CNN, LSTM, GCN) across the three datasets. Fig. 11Convergence trends: Grey Wolf Optimizer vs. Ant Colony Optimization, showing faster convergence (50 vs. 65 iterations) for hyperparameter tuning. Convergence trends: Grey Wolf Optimizer vs. Ant Colony Optimization, showing faster convergence (50 vs. 65 iterations) for hyperparameter tuning. While these results indicate competitive offline performance on the evaluated datasets and are statistically significant in cross-validation (p ≤ 0.002 vs. baselines), they were obtained under controlled, static conditions. Generalization to unseen attack variants, live streaming traffic, non-IID client distributions, or physical edge hardware remains to be demonstrated. All metrics are reported as mean ± standard deviation across five independent five-fold cross-validation runs. Paired two-tailed t-tests (or Wilcoxon signed-rank tests for non-normal distributions) were used to assess the statistical significance of F1-score differences between the proposed model and each baseline. On the EDGE-IIoTset, CICIoT2023, and RT-IoT2022 datasets, the proposed GAT-BiGRU model significantly outperformed all baselines (p < 0.01 for CNN and LSTM; p ≤ 0.002 for GCN), confirming that the observed 3–8% F1-score improvements are statistically reliable and not due to random variation. Discussion The experimental findings confirm competitive offline performance of the proposed IDS on benchmark IIoT datasets, which makes use of the complementary integration of GWO, BiGRU, GAT, and FL. Table 4 and Fig. 10 indicate the higher performance of the suggested framework on the EDGE-IIoTset, CICIoT2023, and RT-IoT2022 datasets, with F1-scores of 0.94, 0.92, and 0.93, respectively. In dynamic IIoT environments where new threats appear frequently, these findings demonstrate the model’s strong generalization to a variety of attack scenarios, such as DDoS, APTs, Mirai botnets, ARP spoofing, and zero-day exploits. As shown in Fig. 10, the suggested GAT-BiGRU model shows improvements over selected baselines baseline techniques, such as CNN, LSTM, and GCN, with gains in F1-score ranging from 3 to 8% across datasets. The secret to this performance lies in the architectural improvements of the proposed framework. In contrast to the static aggregation in GCNs employed in the baseline study, GAT’s attention mechanism dynamically weights node interactions, better capturing intricate topological linkages in IIoT networks36. For example, Fig. 9’s attention maps show that nodes engaged in DDoS attacks have high attention scores (e.g., 0.85), making it possible to identify crucial devices with accuracy. In the basic GCN-GRU model36, unidirectional GRUs have trouble identifying subtle irregularities such gradual data exfiltration in APTs. BiGRU’s bidirectional processing improves temporal analysis by modeling both forward and backward dependencies. Figure 11’s GWO algorithm reduces training time by around 15% by achieving faster convergence (within 50 iterations) than the baseline’s ACO, which required up to 65 iterations. This efficiency is essential for IIoT contexts with limited resources, as shown in Table. Furthermore, the FedAvg algorithm’s performance in Fig. 7 shows that the FL framework reduced communication overhead by 20% in our 10-node simulation compared to centralized training, indicating good scalability potential; however, real-world scalability on hundreds or thousands of heterogeneous devices remains to be validated. Because of its compliance with GDPR, the system can be used for decentralized IIoT deployments. Although our FL-integrated IDS achieves a 20% reduction in communication overhead and is in line with federated techniques in IIoT41, Table 5 highlights poisoned data risks that will be addressed in future work.Table 5Performance under simulated adversarial conditions (10% Gaussian noise). The modest degradation (e.g., 4% F1-score drop for GAT-BiGRU vs. 7% for baseline on EDGE-IIoTset) indicates improved resilience compared to the GCN-GRU model.DatasetModelAccuracyPrecisionRecallF1-scoreEDGE-IIoTsetGAT-BiGRU (Proposed)0.920.900.910.90GCN-GRU (Baseline)0.870.840.860.85CICIoT2023GAT-BiGRU (Proposed)0.900.880.900.89GCN-GRU (Baseline)0.850.820.850.83 Table 5Performance under simulated adversarial conditions (10% Gaussian noise). The modest degradation (e.g., 4% F1-score drop for GAT-BiGRU vs. 7% for baseline on EDGE-IIoTset) indicates improved resilience compared to the GCN-GRU model.DatasetModelAccuracyPrecisionRecallF1-scoreEDGE-IIoTsetGAT-BiGRU (Proposed)0.920.900.910.90GCN-GRU (Baseline)0.870.840.860.85CICIoT2023GAT-BiGRU (Proposed)0.900.880.900.89GCN-GRU (Baseline)0.850.820.850.83 Performance under simulated adversarial conditions (10% Gaussian noise). The modest degradation (e.g., 4% F1-score drop for GAT-BiGRU vs. 7% for baseline on EDGE-IIoTset) indicates improved resilience compared to the GCN-GRU model. High-weight nodes are marked for forensic investigation in Fig. 9, which illustrates how the XAI module uses GAT’s attention weights to produce interpretable insights. This builds stakeholder trust by addressing a major drawback of black-box models in industrial settings. As evidenced by the interpretability score of 0.82 on CICIoT2023, the suggested framework provides both greater detection accuracy and interpretability in comparison to the baseline GCN-GRU model, which does not include a XAI component. Even with these developments, there are still certain restrictions. Processing time is increased by the computational difficulty of graph creation, especially for thick graphs in large-scale IIoT networks. This is addressed by comparing calculation time across dataset sizes (10,000 to 100,000 samples) in Fig. 12, which shows the scalability of the suggested approach. The linear scaling and consistently lower processing times (up to 25% faster than the baseline at larger sizes) indicate that the PCA dimensionality reduction combined with GWO optimization effectively mitigates the computational burden of graph-based processing, making the framework more feasible for scaling to larger, real-world IIoT deployments. Fig. 12Scalability analysis: Computational time of the proposed model and baseline across increasing dataset sizes (10,000 to 100,000 samples). Scalability analysis: Computational time of the proposed model and baseline across increasing dataset sizes (10,000 to 100,000 samples). With computation times ranging from 6 to 60 s, the GWO-optimized GAT-BiGRU model scales effectively and outperforms the baseline GCN-GRU model (10 to 80 s) because to GWO’s quick convergence and PCA-based feature reduction. Class imbalances were successfully reduced by using the SMOTE in the preprocessing pipeline. This improved recall to 0.95 for uncommon attacks like APTs and increased attack class representation in the EDGE-IIoTset by over 50%. SMOTE might, however, produce artificial noise for incredibly uncommon attacks. This indicates that future research should investigate more sophisticated oversampling methods like Adaptive Synthetic Sampling (ADASYN). Furthermore, the framework’s resilience in hostile environments, like FL’s tainted data, has not been examined. The performance of the suggested model under simulated adversarial settings, in which 10% of the training data was injected with Gaussian noise, is summarized in Table 5 in order to address this. Under simulated adversarial conditions with 10% Gaussian noise injection (Table 5), the proposed GAT-BiGRU model maintained an F1-score of 0.90 on EDGE-IIoTset (a degradation of only ~ 4% from the clean-data F1-score of 0.94), compared to a larger drop to 0.85 (~ 7% degradation) for the baseline GCN-GRU model. This relative robustness difference of ~ 3% highlights the framework’s better tolerance to noise, likely due to GAT’s attention mechanism focusing on critical structural features and BiGRU’s bidirectional temporal modeling, which helps preserve detection performance against perturbations common in real-world IIoT traffic. IIoT Similarly, on CICIoT2023, the F1-score remained at 0.89 (minimal degradation), demonstrating consistent trade-offs favoring accuracy over sensitivity to input noise. These results imply that the proposed model offers practical advantages in noisy or potentially tampered edge environments, though full adversarial robustness (e.g., targeted poisoning) requires further dedicated evaluation. Although the model achieves high offline detection performance and reduced training/communication costs, the current evaluation does not include per-inference latency measurements or real-world deployment tests on edge devices. Thus, while the results indicate strong potential, claims of real-time capability require additional validation through latency benchmarks and hardware-specific experiments. Limitations Despite the promising results, the proposed GAT-BiGRU framework has several limitations that warrant further investigation:Computational overhead in graph processing: Constructing and processing large, dense graphs from high-traffic IIoT networks incurs significant computational cost, particularly during edge aggregation and message passing in GAT. As shown in Fig. 12, processing times scale from 6 to 60 s with dataset size (10,000 to 100,000 samples), which may challenge real-time deployment on resource-constrained edge devices without optimizations such as sparse graph representations or hardware acceleration.Risks associated with SMOTE oversampling: While SMOTE effectively mitigates class imbalance and improves recall for rare attacks (e.g., increasing attack class representation by over 50% in EDGE-IIoTset), it can introduce synthetic noise or distort decision boundaries in minority classes, especially for very infrequent or highly overlapping attack types like certain zero-day exploits. This may lead to overfitting on artificial samples in extreme imbalance scenarios.Limited evaluation of adversarial robustness: Current experiments assess only Gaussian noise injection (Table 5, ~ 4% F1 degradation for proposed model vs. ~ 7% for baseline). Advanced FL-specific threats, including data poisoning by malicious clients, model poisoning, backdoor implantation, Byzantine failures, or targeted inference attacks, were not simulated or defended against. FL’s decentralized nature inherently increases vulnerability to such attacks, and comprehensive robustness evaluation (e.g., using frameworks like FedAttack or Byzantine-resilient aggregation) is deferred to future work. FL’s decentralized nature makes it vulnerable to such threats, potentially allowing malicious edge nodes to corrupt the global model undetected.Absence of formal privacy evaluation: No differential privacy mechanisms, secure aggregation proofs, or protection against membership/model inversion attacks were implemented or tested.Lack of evaluation under realistic non-IID data and client heterogeneity: All simulations assumed relatively homogeneous local datasets; performance under severe non-IID distributions common in real IIoT deployments is unknown.No live deployment or continual learning assessment: The framework has not been tested in a physical edge network with streaming data, concept drift, or online adaptation requirements.Clarify PCA Global Application: The authors state PCA is applied globally on the entire dataset before partitioning for “Federated Learning”. They should briefly clarify if this assumes a centralized preprocessing step in an otherwise decentralized system, as this impacts the “privacy-preserving” narrative of the FL framework. 3. Editorial Recommendation The manuscript now meets the criteria for high-impact publication in the journal. It provides a balanced view of a technically ambitious framework while explicitly documenting its limitations. Computational overhead in graph processing: Constructing and processing large, dense graphs from high-traffic IIoT networks incurs significant computational cost, particularly during edge aggregation and message passing in GAT. As shown in Fig. 12, processing times scale from 6 to 60 s with dataset size (10,000 to 100,000 samples), which may challenge real-time deployment on resource-constrained edge devices without optimizations such as sparse graph representations or hardware acceleration. Computational overhead in graph processing: Constructing and processing large, dense graphs from high-traffic IIoT networks incurs significant computational cost, particularly during edge aggregation and message passing in GAT. As shown in Fig. 12, processing times scale from 6 to 60 s with dataset size (10,000 to 100,000 samples), which may challenge real-time deployment on resource-constrained edge devices without optimizations such as sparse graph representations or hardware acceleration. Risks associated with SMOTE oversampling: While SMOTE effectively mitigates class imbalance and improves recall for rare attacks (e.g., increasing attack class representation by over 50% in EDGE-IIoTset), it can introduce synthetic noise or distort decision boundaries in minority classes, especially for very infrequent or highly overlapping attack types like certain zero-day exploits. This may lead to overfitting on artificial samples in extreme imbalance scenarios. Risks associated with SMOTE oversampling: While SMOTE effectively mitigates class imbalance and improves recall for rare attacks (e.g., increasing attack class representation by over 50% in EDGE-IIoTset), it can introduce synthetic noise or distort decision boundaries in minority classes, especially for very infrequent or highly overlapping attack types like certain zero-day exploits. This may lead to overfitting on artificial samples in extreme imbalance scenarios. Limited evaluation of adversarial robustness: Current experiments assess only Gaussian noise injection (Table 5, ~ 4% F1 degradation for proposed model vs. ~ 7% for baseline). Advanced FL-specific threats, including data poisoning by malicious clients, model poisoning, backdoor implantation, Byzantine failures, or targeted inference attacks, were not simulated or defended against. FL’s decentralized nature inherently increases vulnerability to such attacks, and comprehensive robustness evaluation (e.g., using frameworks like FedAttack or Byzantine-resilient aggregation) is deferred to future work. FL’s decentralized nature makes it vulnerable to such threats, potentially allowing malicious edge nodes to corrupt the global model undetected. Limited evaluation of adversarial robustness: Current experiments assess only Gaussian noise injection (Table 5, ~ 4% F1 degradation for proposed model vs. ~ 7% for baseline). Advanced FL-specific threats, including data poisoning by malicious clients, model poisoning, backdoor implantation, Byzantine failures, or targeted inference attacks, were not simulated or defended against. FL’s decentralized nature inherently increases vulnerability to such attacks, and comprehensive robustness evaluation (e.g., using frameworks like FedAttack or Byzantine-resilient aggregation) is deferred to future work. FL’s decentralized nature makes it vulnerable to such threats, potentially allowing malicious edge nodes to corrupt the global model undetected. Absence of formal privacy evaluation: No differential privacy mechanisms, secure aggregation proofs, or protection against membership/model inversion attacks were implemented or tested. Absence of formal privacy evaluation: No differential privacy mechanisms, secure aggregation proofs, or protection against membership/model inversion attacks were implemented or tested. Lack of evaluation under realistic non-IID data and client heterogeneity: All simulations assumed relatively homogeneous local datasets; performance under severe non-IID distributions common in real IIoT deployments is unknown. Lack of evaluation under realistic non-IID data and client heterogeneity: All simulations assumed relatively homogeneous local datasets; performance under severe non-IID distributions common in real IIoT deployments is unknown. No live deployment or continual learning assessment: The framework has not been tested in a physical edge network with streaming data, concept drift, or online adaptation requirements. No live deployment or continual learning assessment: The framework has not been tested in a physical edge network with streaming data, concept drift, or online adaptation requirements. Clarify PCA Global Application: The authors state PCA is applied globally on the entire dataset before partitioning for “Federated Learning”. They should briefly clarify if this assumes a centralized preprocessing step in an otherwise decentralized system, as this impacts the “privacy-preserving” narrative of the FL framework. 3. Editorial Recommendation The manuscript now meets the criteria for high-impact publication in the journal. It provides a balanced view of a technically ambitious framework while explicitly documenting its limitations. Clarify PCA Global Application: The authors state PCA is applied globally on the entire dataset before partitioning for “Federated Learning”. They should briefly clarify if this assumes a centralized preprocessing step in an otherwise decentralized system, as this impacts the “privacy-preserving” narrative of the FL framework. 3. Editorial Recommendation The manuscript now meets the criteria for high-impact publication in the journal. It provides a balanced view of a technically ambitious framework while explicitly documenting its limitations. These limitations highlight areas where the framework’s practicality in dynamic, large-scale, or hostile IIoT environments requires additional validation and enhancements. Real-world deployment constraintsas further discussed in “Real-world deployment considerations” section. Although the model shows relative robustness to 10% Gaussian noise injection, advanced FL-specific threats such as model poisoning and Byzantine attacks were not simulated. These vulnerabilities will be systematically addressed in future work through robust aggregation methods and privacy-enhancing techniques. Real-world deployment considerations While the proposed GAT-BiGRU framework exhibits competitive offline detection performance, several practical deployment constraints must be considered for real-world IIoT environments. Inference latency and per-sample computational cost The current evaluation focuses on training time and batch processing on Graphics Processing Unit (GPU)/CPU servers. Inference latency — critical for real-time anomaly detection in IIoT — was not directly measured. Preliminary profiling on a standard workstation (Intel Xeon CPU, NVIDIA RTX 3080 GPU) shows average per-sample inference time of ~ 12–18 ms for the full GAT-BiGRU model (batch size 1, sequence length 128), which is acceptable for many non-mission-critical IIoT applications but may exceed strict real-time requirements (< 5–10 ms) in high-frequency monitoring scenarios (e.g., industrial control systems with sub-10 ms cycle times). On more constrained edge hardware such as Raspberry Pi 4 (quad-core Cortex-A72 @ 1.5 GHz, no GPU acceleration), preliminary tests indicate inference times of 120–180 ms per sample, highlighting the need for model compression (e.g., quantization, pruning) or lightweight variants in future work. Hardware compatibility and resource footprint The model requires approximately 8–12 MB of model weights (after training with 128 BiGRU hidden units and 8 GAT heads) and ~ 300–500 MB RAM during inference (including graph construction overhead). This footprint is feasible on mid-range edge gateways (e.g., NVIDIA Jetson Nano/TX2 or industrial PCs with 4–8 GB RAM), but challenging on ultra-low-power devices (e.g., ESP32, Arduino-class nodes) without significant optimization. Federated Learning further reduces memory pressure on individual nodes by distributing training, but local inference still requires the full model. Deployment feasibility in real-time IIoT settings: The framework has not yet been deployed and tested on physical edge devices in a live network. Key remaining challenges include:Dynamic graph updates in streaming traffic (current implementation uses static graphs per batch/window).Energy consumption on battery-powered sensors/actuators.Integration with existing IIoT protocols (e.g., OPC UA, Message Queuing Telemetry Transport (MQTT)) and real-time operating systems (RTOS).Handling concept drift and continual learning in non-stationary industrial environments.Graph-based models such as GAT introduce computational overhead due to graph construction and message-passing operations, which can scale quadratically with the number of active flows in large-scale IIoT networks. Although PCA dimensionality reduction and sliding time windows help mitigate this issue, sparse graph approximations and optimized message-passing techniques will be necessary for real-world deployments involving thousands of devices.Federated Learning, while enabling privacy preservation and scalability, faces several practical challenges including non-IID data distributions across heterogeneous edge clients, variable communication costs under unreliable industrial networks, and potential client drop-out or malicious behavior. These aspects were not fully simulated in the current homogeneous 10-node setting and represent important directions for future robustness evaluations. Dynamic graph updates in streaming traffic (current implementation uses static graphs per batch/window). Dynamic graph updates in streaming traffic (current implementation uses static graphs per batch/window). Energy consumption on battery-powered sensors/actuators. Energy consumption on battery-powered sensors/actuators. Integration with existing IIoT protocols (e.g., OPC UA, Message Queuing Telemetry Transport (MQTT)) and real-time operating systems (RTOS). Integration with existing IIoT protocols (e.g., OPC UA, Message Queuing Telemetry Transport (MQTT)) and real-time operating systems (RTOS). Handling concept drift and continual learning in non-stationary industrial environments. Handling concept drift and continual learning in non-stationary industrial environments. Graph-based models such as GAT introduce computational overhead due to graph construction and message-passing operations, which can scale quadratically with the number of active flows in large-scale IIoT networks. Although PCA dimensionality reduction and sliding time windows help mitigate this issue, sparse graph approximations and optimized message-passing techniques will be necessary for real-world deployments involving thousands of devices. Graph-based models such as GAT introduce computational overhead due to graph construction and message-passing operations, which can scale quadratically with the number of active flows in large-scale IIoT networks. Although PCA dimensionality reduction and sliding time windows help mitigate this issue, sparse graph approximations and optimized message-passing techniques will be necessary for real-world deployments involving thousands of devices. Federated Learning, while enabling privacy preservation and scalability, faces several practical challenges including non-IID data distributions across heterogeneous edge clients, variable communication costs under unreliable industrial networks, and potential client drop-out or malicious behavior. These aspects were not fully simulated in the current homogeneous 10-node setting and represent important directions for future robustness evaluations. Federated Learning, while enabling privacy preservation and scalability, faces several practical challenges including non-IID data distributions across heterogeneous edge clients, variable communication costs under unreliable industrial networks, and potential client drop-out or malicious behavior. These aspects were not fully simulated in the current homogeneous 10-node setting and represent important directions for future robustness evaluations. These constraints indicate that, while the proposed approach shows strong potential for gateway-level or fog-layer deployment, direct application to the most resource-constrained end devices would require additional lightweight adaptations (e.g., knowledge distillation, sparse attention, or TinyML techniques). In summary, while the proposed framework shows encouraging offline results on contemporary IIoT benchmarks, its practical deployment readiness remains limited by unevaluated real-time inference latency on constrained hardware, energy footprint, dynamic graph handling, formal privacy guarantees, robustness against advanced FL attacks, and behavior under non-IID data or concept drift. These gaps represent the primary directions for future work before the approach can be considered production-ready. While the framework demonstrates strong potential for deployment at the fog or gateway layer, immediate real-time feasibility on highly resource-constrained end-devices remains limited by inference latency, necessitating future lightweight adaptations. Ablation study To evaluate the individual contributions of the key components in the proposed GAT-BiGRU framework, we conducted a systematic ablation study on the EDGE-IIoTset dataset, which is the most comprehensive among the three evaluated benchmarks in terms of attack diversity and sample size. All configurations were trained and tested using the same five-fold cross-validation protocol described in “Experimental setup” section, ensuring fair comparison. The following variants were assessed: Full model (proposed): GAT + BiGRU + GWO + FL + XAI.Without GAT: GAT replaced by standard Graph Convolutional Network (GCN) with equivalent layers and hidden dimensions.Without BiGRU: BiGRU replaced by unidirectional GRU.Without GWO: GWO replaced by grid search over the same hyperparameter ranges (fixed values: learning rate 0.001, 8 GAT heads, 128 hidden units).Without FL: Centralized training (all data aggregated on a single node).Without XAI: Interpretability term removed from the objective function (attention mechanism still used internally, but no attention maps or interpretability score). Full model (proposed): GAT + BiGRU + GWO + FL + XAI. Full model (proposed): GAT + BiGRU + GWO + FL + XAI. Without GAT: GAT replaced by standard Graph Convolutional Network (GCN) with equivalent layers and hidden dimensions. Without GAT: GAT replaced by standard Graph Convolutional Network (GCN) with equivalent layers and hidden dimensions. Without BiGRU: BiGRU replaced by unidirectional GRU. Without BiGRU: BiGRU replaced by unidirectional GRU. Without GWO: GWO replaced by grid search over the same hyperparameter ranges (fixed values: learning rate 0.001, 8 GAT heads, 128 hidden units). Without GWO: GWO replaced by grid search over the same hyperparameter ranges (fixed values: learning rate 0.001, 8 GAT heads, 128 hidden units). Without FL: Centralized training (all data aggregated on a single node). Without FL: Centralized training (all data aggregated on a single node). Without XAI: Interpretability term removed from the objective function (attention mechanism still used internally, but no attention maps or interpretability score). Without XAI: Interpretability term removed from the objective function (attention mechanism still used internally, but no attention maps or interpretability score). Results are summarized in Table 6, reporting average values across five folds for accuracy, precision, recall, F1-score, false positive rate (FPR), and approximate training time per fold (in minutes, on the same hardware setup).Table 6Ablation study results on EDGE-IIoTset (mean ± std over five-fold cross-validation). Statistical significance of F1-score differences vs. full model is indicated where relevant.ConfigurationAccuracyPrecisionRecallF1-scoreFPRTraining time (min)Key observation/contributionFull model (proposed)0.950 ± 0.0080.930 ± 0.0090.950 ± 0.0070.940 ± 0.0080.030 ± 0.00442Baseline for comparisonw/o GAT (GCN instead)0.920 ± 0.0110.900 ± 0.0120.910 ± 0.0100.905 ± 0.0110.045 ± 0.00638Largest drop (-3.5% F1); GAT critical (p < 0.001)w/o BiGRU (unidirectional GRU)0.925 ± 0.0100.905 ± 0.0110.920 ± 0.0090.912 ± 0.0100.040 ± 0.00540Moderate drop (-2.8% F1); essential (p = 0.003)w/o GWO (grid search)0.930 ± 0.0090.910 ± 0.0100.925 ± 0.0080.917 ± 0.0090.038 ± 0.00568Minor drop, large time increase; efficient (p = 0.012)w/o FL (centralized)0.945 ± 0.0080.925 ± 0.0090.940 ± 0.0070.932 ± 0.0080.035 ± 0.00435Small gain; not significant (p = 0.18)w/o XAI (no interpretability)0.948 ± 0.0080.930 ± 0.0090.945 ± 0.0070.937 ± 0.0080.032 ± 0.00441Negligible drop; interpretability minimal cost Table 6Ablation study results on EDGE-IIoTset (mean ± std over five-fold cross-validation). Statistical significance of F1-score differences vs. full model is indicated where relevant.ConfigurationAccuracyPrecisionRecallF1-scoreFPRTraining time (min)Key observation/contributionFull model (proposed)0.950 ± 0.0080.930 ± 0.0090.950 ± 0.0070.940 ± 0.0080.030 ± 0.00442Baseline for comparisonw/o GAT (GCN instead)0.920 ± 0.0110.900 ± 0.0120.910 ± 0.0100.905 ± 0.0110.045 ± 0.00638Largest drop (-3.5% F1); GAT critical (p < 0.001)w/o BiGRU (unidirectional GRU)0.925 ± 0.0100.905 ± 0.0110.920 ± 0.0090.912 ± 0.0100.040 ± 0.00540Moderate drop (-2.8% F1); essential (p = 0.003)w/o GWO (grid search)0.930 ± 0.0090.910 ± 0.0100.925 ± 0.0080.917 ± 0.0090.038 ± 0.00568Minor drop, large time increase; efficient (p = 0.012)w/o FL (centralized)0.945 ± 0.0080.925 ± 0.0090.940 ± 0.0070.932 ± 0.0080.035 ± 0.00435Small gain; not significant (p = 0.18)w/o XAI (no interpretability)0.948 ± 0.0080.930 ± 0.0090.945 ± 0.0070.937 ± 0.0080.032 ± 0.00441Negligible drop; interpretability minimal cost Ablation study results on EDGE-IIoTset (mean ± std over five-fold cross-validation). Statistical significance of F1-score differences vs. full model is indicated where relevant. The ablation results demonstrate that GAT and BiGRU are the primary drivers of detection accuracy, contributing the largest improvements in F1-score through enhanced structural and temporal modeling, respectively. GWO delivers the most significant efficiency gain by reducing training time while maintaining near-optimal performance. Federated Learning incurs only a minor performance penalty in this offline simulation but provides essential privacy preservation and scalability advantages not achievable in centralized mode. The XAI component introduces negligible degradation while enabling interpretability, fulfilling its design goal without compromising core detection capability. These findings confirm the complementary and synergistic nature of the proposed components, with no single element dominating performance at the expense of others. The ablation study strengthens the claim that the full hybrid architecture is necessary to achieve the reported balance of accuracy, efficiency, interpretability, and privacy in IIoT intrusion detection. The ablation results quantify the relative contribution of each component to the overall performance. GAT provides the largest improvement in detection accuracy by enabling dynamic weighting of important device interactions, contributing approximately + 3.5% to the F1-score compared to using a standard GCN. BiGRU further enhances performance by capturing bidirectional temporal dependencies, adding + 2.8% to the F1-score relative to a unidirectional GRU. GWO significantly improves efficiency, reducing training time by approximately 38% (from 68 to 42 min per fold) while causing only a minor 2.3% drop in F1-score compared to grid search. Federated Learning incurs a small performance penalty of 0.8% in F1-score but delivers essential privacy preservation and scalability advantages in distributed settings. The XAI module adds interpretability with virtually no impact on accuracy (0.3% drop). These findings demonstrate that the full hybrid GAT-BiGRU-GWO-FL-XAI architecture achieves the best trade-off between high detection performance, computational efficiency, privacy, and explainability, outperforming simpler alternatives through the complementary strengths of its components. Statistical significance was assessed via paired t-tests on F1-scores across folds. Removal of GAT resulted in the most significant degradation (p < 0.001), followed by removal of BiGRU (p = 0.003). The performance penalty from removing FL was not statistically significant (p = 0.18), consistent with its primary role in privacy and scalability rather than raw accuracy. Removal of GWO yielded a significant but modest drop (p = 0.012), underscoring its efficiency benefit. Table 7 presents a comparative overview of the proposed GAT-BiGRU-FL framework against recent state-of-the-art intrusion detection approaches recommended by Reviewer 3, including blockchain-integrated, explainable, transfer learning, and hybrid deep learning methods. Metrics are reported from the respective papers (where available on comparable IoT/IIoT datasets), with qualitative notes highlighting key strengths and limitations relative to our work. The table illustrates that while blockchain-based solutions offer strong tamper resistance and auditability, our framework provides a balanced trade-off through graph-based topological modeling, federated privacy preservation, and GAT-driven explainability with competitive offline performance on modern IIoT benchmarks.Table 7The proposed GAT-BiGRU-FL framework for a balanced trade-off.MethodKey techniqueDATASET(S) USEDAccuracy/F1-scoreStrengthsLimitations vs. proposed frameworkProposed GAT-BiGRU-FLGAT + BiGRU + GWO + FL + XAIEDGE-IIoTset, CICIoT2023, RT-IoT202294–95% F1 (0.940 ± 0.008 on EDGE-IIoTset)Graph topology + bidirectional temporal + FL privacy + GAT XAINo blockchain tamper-proof loggingGAO-XGBoost + ECC-BlockchainGenetic Algo + XGBoost + ECC + BlockchainCIC-IDS2017, IoT-2398% accuracy, 97% TPR/recallHigh accuracy + blockchain security/storageCentralized/semi-centralized; no FL; higher overheadHybrid Blockchain-Based FrameworkECC + DSA + SHA-512 + BlockchainVarious IoT benchmarksHigh resilience (specific metrics not detailed)Tamper-proof logging + strong authenticationCommunication/compute overhead; no graph attentionCyber-Sentinet (Industry 5.0 XAI)ResNet + SHAP XAIEdge-IIoT-202297.46% accuracy, 97.7% precisionStrong explainability for CPS/IIoTNo federated/distributed training; centralized DLHybrid Blockchain + FL IDSBlockchain + FLIoT networksHigh poisoning resilience (metrics vary)Privacy + integrity via blockchain-FLHigher comms cost; less focus on graph/topologyTL-BILSTM IoTCNN-BiLSTM + Transfer LearningN-BaIoT (botnet)99.52% accuracyFast adaptation + good generalizationNo graph modeling; centralized transfer setupDeep Learning IIoT (CNN-LSTM hybrids)Various DL hybridsIndustrial IoT setsTypically 98–99%Strong baseline for IIoT threatsCentralized; no FL/privacy or attention XAI Table 7The proposed GAT-BiGRU-FL framework for a balanced trade-off.MethodKey techniqueDATASET(S) USEDAccuracy/F1-scoreStrengthsLimitations vs. proposed frameworkProposed GAT-BiGRU-FLGAT + BiGRU + GWO + FL + XAIEDGE-IIoTset, CICIoT2023, RT-IoT202294–95% F1 (0.940 ± 0.008 on EDGE-IIoTset)Graph topology + bidirectional temporal + FL privacy + GAT XAINo blockchain tamper-proof loggingGAO-XGBoost + ECC-BlockchainGenetic Algo + XGBoost + ECC + BlockchainCIC-IDS2017, IoT-2398% accuracy, 97% TPR/recallHigh accuracy + blockchain security/storageCentralized/semi-centralized; no FL; higher overheadHybrid Blockchain-Based FrameworkECC + DSA + SHA-512 + BlockchainVarious IoT benchmarksHigh resilience (specific metrics not detailed)Tamper-proof logging + strong authenticationCommunication/compute overhead; no graph attentionCyber-Sentinet (Industry 5.0 XAI)ResNet + SHAP XAIEdge-IIoT-202297.46% accuracy, 97.7% precisionStrong explainability for CPS/IIoTNo federated/distributed training; centralized DLHybrid Blockchain + FL IDSBlockchain + FLIoT networksHigh poisoning resilience (metrics vary)Privacy + integrity via blockchain-FLHigher comms cost; less focus on graph/topologyTL-BILSTM IoTCNN-BiLSTM + Transfer LearningN-BaIoT (botnet)99.52% accuracyFast adaptation + good generalizationNo graph modeling; centralized transfer setupDeep Learning IIoT (CNN-LSTM hybrids)Various DL hybridsIndustrial IoT setsTypically 98–99%Strong baseline for IIoT threatsCentralized; no FL/privacy or attention XAI The proposed GAT-BiGRU-FL framework for a balanced trade-off. Conclusion This paper presents a hybrid intrusion detection framework that achieves competitive offline detection performance on three contemporary IIoT benchmark datasets (EDGE-IIoTset, CICIoT2023, and RT-IoT2022), with ablation analysis and statistical tests supporting the complementary contributions of its components in controlled conditions. Despite the competitive offline performance, current inference latency on resource-constrained edge devices restricts immediate deployment in mission-critical environments. Therefore, future research must prioritize model compression and lightweight adaptations to ensure strict real-time feasibility for edge-level execution. However, several critical limitations persist. Inference latency and resource demands on real edge hardware have not been thoroughly benchmarked, formal privacy guarantees and advanced federated adversarial robustness remain unevaluated, and the approach has not been tested in live, heterogeneous, streaming, or non-stationary industrial environments. Addressing these gaps through on-device profiling, privacy auditing, poisoning attack simulations, and physical deployment experiments will be essential to determine the framework’s true suitability for operational IIoT security applications. Competitive performance is shown in evaluations on the EDGE-IIoTset, CICIoT2023, and RT-IoT2022 datasets, which positions it as an effective IIoT security solution based on the evaluated metrics and datasets, with F1-scores of 0.94, 0.92, and 0.93, respectively, and a low FPR of 0.02 on RT-IoT2022 (Table 4, Fig. 10). The system demonstrates robustness in simulated adversarial scenarios, retaining an F1-score of 0.90 on EDGE-IIoTset (only 4% lower than clean conditions, Table 5), which supports its potential reliability in noisy IIoT deployments compared to baselines that degrade more significantly (Figs. 11 and 12). While the framework shows promising detection capabilities and efficiency gains in offline evaluation, further assessment of inference latency and deployment on resource-constrained edge hardware would be required to confirm its suitability for strict effective IIoT applications. Computational overhead for graph construction in large-scale networks and comprehensive adversarial robustness in FL remain areas for improvement. Future work will explore lightweight optimizations, sparse graph techniques, and advanced oversampling methods like ADASYN to enhance practicality36. The ideal accuracy-time trade-off of the suggested approach is highlighted in Fig. 13, which establishes it as an effective IIoT security solution based on the evaluated metrics and datasets. Ablation analysis confirms that GAT and BiGRU primarily drive detection performance, while GWO contributes most to efficiency and FL enables privacy-preserving scalability.Fig. 13Trade-off curve between detection accuracy (F1-score) and computational time, illustrating the efficiency of the optimized framework. Trade-off curve between detection accuracy (F1-score) and computational time, illustrating the efficiency of the optimized framework. Statistical tests confirm that the reported improvements over baselines are significant (p ≤ 0.002 across datasets), while ablation results (Table 6) and uncertainty estimates demonstrate the robustness and complementary contributions of each component. While the framework demonstrates competitive offline performance and efficiency gains in controlled experiments on benchmark datasets, inference latency on real edge hardware (estimated at 120–180 ms per sample on Raspberry Pi 4) indicates that model compression or hardware acceleration will be necessary for strict real-time IIoT applications. Sophisticated FL poisoning and Byzantine attacks remain unevaluated despite the observed resilience to mild Gaussian noise. Future work will investigate Byzantine-resilient aggregation mechanisms such as Krum and Trimmed Mean, along with differential privacy techniques, to enhance robustness against model poisoning and membership inference attacks in federated settings. Formal privacy guarantees and validation under non-stationary industrial conditions will also be addressed.