Our model’s architecture is founded on a hybrid design that synergistically combines Graph Convolutional Networks (GCNs) for spatial analysis with Long Short-Term Memory (LSTM) networks for temporal analysis. This approach is motivated by the dual nature of CI data, which possesses both spatial structure (the static and dynamic relationships between devices) and temporal structure (the evolution of device states over time). For each time step , the system’s state is captured as a graph, , where nodes represent entities like sensors and IP addresses, and edges signify interactions between them. The GCN layers process each graph snapshot to extract high-level spatial features, learning the complex patterns of inter-device relationships. The output is a compact vector embedding for the entire graph at time . This sequence of graph embeddings is then fed into the LSTM layers, which excel at identifying temporal patterns and dependencies across the sequence. This dual process allows the model to learn not just what a system’s state is, but how it is evolving, enabling a more nuanced and accurate detection of sophisticated, multi-stage attacks.
The GCN component is responsible for learning relational features from each graph snapshot. While other advanced architectures, such as Graph Attention Networks (GATs), employ dynamic attention mechanisms to prioritize neighbor interactions, a GCN was explicitly selected for this framework due to the static physical topology of the SWAT testbed. In industrial control systems with fixed sensor-actuator configurations, the unweighted, symmetric message-passing mechanism of a GCN captures permanent spatial dependencies more efficiently, avoiding the computational overhead and overfitting risks associated with GATs in rigid physical environments. This structural advantage allows our model to scale into multiclass tactic classification, outperforming the operational utility of recent binary GAT baselines (e.g., [
32]). The GCN operates through this iterative message-passing mechanism, where each node aggregates information from its neighbors. This process is formally defined as follows. For each node
, its initial feature vector at layer
is given as
. During each layer
, GCN performs the following update to compute new node features:
where:
After applying multiple GCN layers, global mean pooling is used to summarize the graph-level information: , where is the pooled feature vector representing the entire graph at time .
After processing the entire sequence, we extract the hidden state from the last time step and pass it through a fully connected layer for the final prediction: , where:
A significant challenge in training the architecture was the inherent class imbalance within the SWAT dataset, where normal operational traffic heavily outweighs anomalous traffic, and certain attack tactics (such as T0831) are underrepresented. To mitigate this during the training phase, we implemented a class-weighted Cross-Entropy loss function. By assigning higher penalty weights to misclassifications of minority attack classes, the gradient updates are prevented from being disproportionately dominated by the ‘No_Attack’ class, encouraging the network to better learn the subtle feature representations of less frequent cyber-physical manipulations.
To optimize the model and guarantee reproducibility, we conducted a comprehensive hyperparameter search using Bayesian Optimization with the Tree-structured Parzen Estimator (TPE) sampler. A summary of the explored ranges and optimal selected values is presented in
Table 5. Based on this optimization, the final deployed architecture consists of a single GCN layer (123 hidden units) utilizing a Leaky ReLU activation (negative slope = 0.1055) and a dropout rate of 0.2475, followed by a single-layer LSTM (69 hidden units). The model was trained using the Adam optimizer (learning rate =
) and a class-weighted Cross-Entropy loss function over a chronological 80/20 train-test split, ensuring the reported performance reflects genuine generalization to unseen temporal sequences rather than training-set memorization. An analysis of architectural complexity established strict operational bounds. Reducing the hidden representations below minimum thresholds degraded the macro F1-score by failing to capture multi-stage attack nuances. Conversely, increasing the depth beyond a single GCN or LSTM layer yielded diminishing returns; deeper GCNs induced over-smoothing—rendering distinct physical sensor nodes mathematically indistinguishable—while deeper LSTMs merely inflated computational latency without corresponding accuracy gains. To validate the robustness of this minimal-complexity configuration, a sensitivity analysis demonstrated that variations within ±15% of the optimal learning rate resulted in a marginal macro F1-score variance of less than 0.02. Similarly, scaling the LSTM hidden dimension between 64 and 128 units-maintained baseline accuracy above 98.5%, confirming a robust optimal region. To ensure absolute independent reproducibility, the complete Python implementation and trained network weights are publicly archived via the provided Zenodo repository.”
5.1. Experimental Results
The machine learning procedures were carried out on a server equipped with an Intel Xeon Silver 4310 CPU @ 2.10 GHz, running Ubuntu 22.04.3 LTS. The system utilized NVIDIA-SMI 525.147.05 with Driver Version 525.147.05 and CUDA Version 12.0 for GPU acceleration. Deep neural network models were implemented using Torch 1.13.1, with hyperparameter optimization performed via Optuna 3.2.0, in conjunction with Python 3.10.12.
The evaluation of the proposed model was conducted using a variety of metrics, assessed both at the per-class level and globally to provide a comprehensive understanding of model performance. Specifically, precision, recall, and F1-score were computed for each class to determine the model’s effectiveness in detecting different attack types and normal activities. This per-class evaluation is crucial for understanding the model’s sensitivity and specificity across diverse, often imbalanced, classes—particularly important for critical infrastructure security where specific attack scenarios may be rare but highly impactful. Additionally, overall accuracy, weighted F1, and macro F1-score were computed to provide a global perspective on model performance. The weighted F1-scores accounts for the frequency of each class, providing insights into the model’s general effectiveness even when certain classes are underrepresented. In contrast, the macro F1-score treats all classes equally, highlighting the model’s balanced capability to handle various attack types. The combination of these metrics ensures a detailed and robust evaluation, emphasizing the model’s reliability in distinguishing between multiple types of anomalous and normal behaviors.
The evaluation results of the model demonstrate strong overall performance in detecting various types of network activities, achieving an accuracy of 99.04%. The per-class precision shows a high ability to correctly identify positive instances for most classes. Specifically, for the ‘No_Attack’ class, the model achieved a precision of 1.00, indicating perfect precision in identifying benign activities. The model’s high precision for the ‘No_Attack’ class is partially attributed to the CTI-derived authorization features, which provided a strong signal for distinguishing legitimate from unauthorized network traffic. However, for the ‘T0831’ technique (Manipulation of Control), the precision drops to 0.532, which suggests potential challenges in correctly identifying this attack type, likely due to class imbalance. Moreover, this lower precision on the T0831 class suggests that some normal operational changes to valves or actuators may share features with manipulative attacks, presenting a challenge for the model. The precision for ‘T0879’ (Damage to Property) and ‘T0836’ (Modify Parameter) techniques are 0.939 and 0.992, respectively, indicating robust detection of these attack types, while ‘T0881’ (Service Stop) achieved 0.998.
The recall scores indicate that the model effectively detects true positive cases across most classes, with ‘No_Attack’, ‘T0836’, and ‘T0881’ all achieving recall values close to 1.0, suggesting nearly perfect detection rates. However, ‘T0879’ achieved a recall of 0.982, and ‘T0881’ showed a lower recall at 0.867, suggesting that the model may occasionally miss instances of these attacks. As illustrated in
Table 6.
A per-class comparison with the models cited in
Table 7 is not feasible, as those works frame the problem as binary classification (‘Normal’ vs. ‘Anomaly’) and thus do not report performance against specific attack types. This limitation in existing literature highlights a significant contribution of our methodology. By performing multiclass classification mapped to MITRE ATT&CK tactics, we provide a more granular and operationally relevant evaluation, demonstrating the model’s effectiveness in distinguishing the nature of different threats, not just their presence.
The F1-score, which balances precision and recall, highlights consistent performance across most classes. For ‘No_Attack’, the F1-score is 0.999, reflecting the model’s ability to accurately classify normal activities. Our experimental results provide strong support for the claim that GNNs reduce false positives. As shown in
Table 6, the model achieved a precision of 1.0000 for the ‘No_Attack’ class. This is a critical finding, as it indicates that zero instances of normal activity were misclassified as an attack during testing. For the attack classes, ‘T0831’ achieved an F1-score of 0.691, indicating the need for improvement in distinguishing this attack type, whereas ‘T0879’, ‘T0836’, and ‘T0881’ all have F1-scores above 0.92, showcasing the model’s robustness in classifying these attack types.
While the overall accuracy of 99.04% and the weighted F1-score of 0.9915 reflect highly accurate general classification, these globally weighted metrics are inherently influenced by the overwhelming volume of benign operational traffic. Although the Area Under the Receiver Operating Characteristic Curve (AUC-ROC) is frequently utilized to offset such class imbalance, it can yield overly optimistic assessments in extreme scenarios; the massive number of true negatives (the ‘No_Attack’ class) artificially depresses the false positive rate. Consequently, this study deliberately bypasses AUC-ROC to evaluate discriminative robustness using the stricter Macro F1-score (0.9151) and class-specific F1 metrics. By computing the harmonic mean of precision and recall independently for each class and unweighting the average, the Macro F1-score strictly prevents the majority class from masking minority performance, providing a highly rigorous, transparent, and penalizing assessment of the model’s true capability to detect rare cyber-physical manipulations. This high performance is directly attributable to the model’s architecture, where the GCN layers effectively model the complex spatial relationships between ICS components and the LSTM layers capture the temporal evolution of attack sequences, enabling a nuanced distinction between benign and malicious patterns. These results indicate that the model is highly suitable for detecting both normal and anomalous behaviors in critical infrastructure.
To demonstrate the model’s practical detection capability, we analyze its response to Attack No. 3 from the SWAT dataset. In this scenario, an adversary manipulates the sensor readings for ‘LIT-101’, causing the value to increase by a constant 1 mm every second. This manipulation is intended to deceive the control system, potentially leading to a tank underflow and physical damage to pump P-101. As shown in
Figure 5, this attack creates a distinct and unnatural linear trend (in red) that stands out from the normal operational fluctuations (in blue).
Our GCN-LSTM model successfully identifies this attack. The GCN layers process the graph at each time step and detect a significant deviation in the feature values associated with the LIT-101 node. Crucially, the model also processes the features of neighboring nodes—such as the status of inflow valve MV-101 and pump P-101—and recognizes that their states do not correlate with the rapidly rising water level. The LSTM layers then identify this sustained, uncorrelated increase as a malicious temporal pattern, distinct from normal fluctuations. This spatio-temporal analysis leads to a confident classification of the activity as T0836 (Modify Parameter), providing the operator with specific, actionable insight into the nature of the attack.
In comparison to prior works, as illustrated in
Table 7, our GCN-LSTM model demonstrates superior performance across several key metrics, highlighting its effectiveness in anomaly detection within critical infrastructure environments. Specifically, our model achieved an accuracy of 99.04%, surpassing the best accuracy reported by previous models, such as [
23] with 96.86%, demonstrating a significantly higher capability to correctly classify network traffic and physical device data. Our recall score of 96.69% highlights the model’s robustness in detecting true positive cases, a substantial improvement over studies like [
22] (59.09%) and [
24] (84.85%). This high recall is particularly crucial for critical infrastructure, where missing an attack could have severe consequences. Furthermore, our model achieved a precision of 89.23%, reflecting its effectiveness in minimizing false positives. While our model’s precision is competitive, the work in [
22] reports an exceptionally high precision of 99.86%, though as noted above, it suffers from a significantly lower recall. Our model achieves a more balanced performance, which is vital for operational efficiency. Additionally, the F1-score of our model (91.51%) indicates a balanced performance between precision and recall, outperforming studies like [
34] with an F1-score of just 0.82. Moreover, unlike most previous studies, which relied solely on physical device data, our model incorporates both network traffic and physical device data, providing a more comprehensive view of potential threats and leading to more accurate anomaly detection. This integrated approach, combined with the capability to perform multiclassification of anomalies aligned with MITRE ATT&CK techniques, makes our model not only highly accurate but also contextually aware, thus offering a more adaptive and effective solution for protecting critical infrastructure.
Furthermore, to systematically isolate the contributions of both the external feature enrichment and the internal architectural modules, a comprehensive multi-step ablation study was conducted. First, to assess reliance on the engineered CTI authorization features (is_src_authorized, is_dst_authorized, is_port_authorized), a baseline model trained strictly on raw physical and network features yielded an accuracy of 95.28% and a macro F1-score of 0.8645. Second, to evaluate the structural components, the spatial and temporal modules were independently ablated. A GCN-only architecture (omitting the LSTM layers) achieved a macro F1-score of 0.8420, demonstrating a degraded ability to track prolonged, multi-stage attack sequences. Conversely, an LSTM-only configuration (omitting the GCN layers) resulted in a macro F1-score of 0.8115, struggling to map simultaneous topological deviations across the ICS testbed. These stepwise deltas mathematically confirm that while CTI enrichment is vital for minimizing false positives, the synergistic spatio-temporal fusion of the GCN and LSTM layers is the indispensable core driver of the model’s peak 0.9151 macro F1-score.