Abstract
With the growing complexity of cyberattacks targeting critical infrastructures such as water treatment networks, there is a pressing need for robust anomaly detection strategies that account for both system vulnerabilities and evolving attack patterns. Traditional methods—statistical, density-based, and graph-based models—struggle with distribution shifts and class imbalance in multivariate time series, often leading to high false positive rates. To address these challenges, we propose CGAD, a Causal Graph-based Anomaly Detection framework designed for reliable cyberattack detection in public infrastructure systems. CGAD follows a two-phase supervised framework: causal profiling and anomaly scoring. First, it learns causal invariant graph structures representing the system's behavior under "Normal" and "Attack" states using Dynamic Bayesian Networks. Second, it employs structural divergence to detect anomalies via causal graph comparison by evaluating topological deviations in causal graphs over time. By leveraging causal structures, CGAD achieves superior adaptability and accuracy in non-stationary and imbalanced time series environments compared to conventional machine learning approaches. Our framework achieves substantial gains in F1 and ROC-AUC scores over best-performing baselines across four industrial datasets, demonstrating robust detection of delayed and structurally complex anomalies.
Introduction: The Challenge of Securing CPS
Critical public infrastructures—like water treatment plants and power grids—are increasingly targeted by sophisticated cyberattacks. Detecting these anomalies is notoriously difficult due to three primary factors:
- Class Imbalance: Malicious activity is extremely rare compared to months of normal operation, making it hard for models to learn the "Attack" signature.
- Volatile Data: Sensor readings fluctuate due to legitimate operational changes (distribution shifts), leading traditional models to trigger high rates of false positives.
- Complex Dependencies: Attacks often manifest as delayed or subtle changes in how one part of a system influences another, rather than just a single sensor hitting an out-of-bounds value.
Traditional methods often fail because they focus on raw data points or simple correlations rather than the underlying physical and logic-driven "cause-and-effect" mechanisms of the system. Researchers have developed CGAD, a framework that detects cyberattacks by monitoring changes in the "causal DNA" of sensor data.
Methodology: The CGAD Framework
The authors propose CGAD (Causal Graph-based Anomaly Detection), which operates in two distinct phases as shown in the workflow above:
1. Causal Profiling
Using an algorithm called DYNOTEARS, the system learns two reference Directed Acyclic Graphs (DAGs). One represents the "Normal" state (how sensors influence each other during standard operation), and the other represents the "Attack" state. Unlike static graphs, these capture both intra-slice (instantaneous) and inter-slice (time-lagged) dependencies, providing a comprehensive profile of system behavior.
2. Anomaly Scoring
During live monitoring, the system segments incoming streaming data and infers a new causal graph for that specific time window. It then calculates the Structural Hamming Distance (SHD)—a metric that counts edge additions, deletions, or reversals—between the new graph and the two reference profiles. If the new graph's topology aligns more closely with the "Attack" profile than the "Normal" one, an alert is triggered.
Experimental Evaluation
The framework was evaluated on four prominent industrial benchmarks: SWaT (Secure Water Treatment), WADI (Water Distribution), Tennessee Eastman (TE), and SMD (Server Machine Dataset). These datasets provide a rigorous testing ground for detecting anomalies in high-dimensional sensor environments.
As illustrated in the performance distributions above, CGAD consistently outperformed traditional baselines (like Isolation Forests and OC-SVM) and even complex deep learning models (like CNN-LSTMs):
- Superior Accuracy: On the WADI dataset, CGAD achieved an F1-score of 0.8913, significantly outperforming the next best baseline (SMV-CGAD at 0.6679).
- High Precision: The model demonstrated a marked reduction in false positives, a critical requirement for industrial monitoring where "crying wolf" can lead to costly downtime.
- Generalization: The model proved capable of detecting "unseen" attack types because many different attacks result in similar structural disruptions to the system's underlying causal flow.
Discussion: Why Causality Matters
The core insight of this work is that Causality > Correlation. While correlations can be spurious or change with environmental factors, the causal physics of a system (e.g., a water pump influencing a tank level) are invariant. By focusing on these stable structures, CGAD achieves:
- Structural Divergence as a Signal: An attack doesn't just change a value; it changes the topology of the system's logic. Measuring the distance between graph structures (SHD) allows the model to ignore "noise" that doesn't affect the underlying causal links.
- Robustness to Drift: Because the model learns the mechanism of the system rather than just the values, it is significantly more resilient to non-stationary environments where sensor baselines might shift naturally over time.
Conclusion and Future Work
While CGAD offers a new blueprint for securing cyber-physical systems, challenges remain for real-world deployment. Learning a new causal graph for every time segment during inference is computationally intensive compared to simple point-level checks. Additionally, causal discovery algorithms require high-quality data to build accurate initial profiles.
Future research will explore continual causal learning, where the model incrementally updates its "Normal" profile in response to legitimate system upgrades or feedback, ensuring the security system evolves alongside the infrastructure it protects.
Summary updated