Abstract
Cyber-physical systems (CPS), which integrate algorithmic control with physical processes, often consist of physically distributed components communicating over a network. A malfunctioning or compromised component in such a CPS can lead to costly consequences, especially in the context of public infrastructure. In this short paper, we argue for the importance of constructing invariants (or models) of the physical behaviour exhibited by CPS, motivated by their applications to the control, monitoring, and attestation of components. To achieve this despite the inherent complexity of CPS, we propose a new technique for learning invariants that combines machine learning with ideas from mutation testing. We present a preliminary study on a water treatment system that suggests the efficacy of this approach, propose strategies for establishing confidence in the correctness of invariants, then summarise some research questions and the steps we are taking to investigate them.
Introduction
Cyber-Physical Systems (CPS), such as power grids, water treatment plants, and transportation networks, are critical to modern infrastructure. These systems are defined by the tight integration of "cyber" elements (software and controllers) and "physical" processes (pumps, tanks, and chemical reactions). Ensuring the security and reliability of CPS is notoriously difficult because a failure in the software can lead to catastrophic physical outcomes.
To detect cyber-attacks or system failures, engineers often rely on invariants: mathematical conditions that must remain true during normal operation (e.g., "if Pump A is active, the water level in Tank B must increase"). Traditionally, these invariants are derived manually using Ordinary Differential Equations (ODEs) and deep domain expertise. However, manual models are time-consuming to build and often fail to account for the "real-world" noise and discrepancies present in actual hardware. This paper proposes a novel method to automate the discovery of these invariants using machine learning (ML) and software mutation testing.
Methodology: Mutation-Based Invariant Learning
The primary challenge in using ML for CPS security is the lack of "negative" data. While data from normal operations is abundant, data representing attacks or failures is rare and dangerous to generate on live equipment. To overcome this, the authors introduce a workflow that leverages Mutation Testing—a software engineering technique—as a form of data augmentation.
The Workflow
- Positive Data Collection: Sensor data is collected from the system during normal, uncompromised operation.
- Negative Data Generation: To simulate faulty behavior without risking physical hardware, the researchers use a high-fidelity simulator. They apply "mutations" to the Programmable Logic Controller (PLC) code—small, random syntactic changes such as swapping a
>for a<or changing a mathematical operator. These mutations create "broken" versions of the controller that produce realistic faulty sensor traces. - Training: A Support Vector Machine (SVM) is trained to distinguish between the "normal" sensor traces and the "mutated" (faulty) traces.
- Invariant Extraction: The resulting SVM model serves as a mathematical boundary. If real-time sensor data falls outside this boundary, the system triggers an alarm.
- Verification: To ensure the learned invariants are robust and not merely overfitting to noise, the authors propose using Statistical Model Checking (SMC) and Symbolic Execution to mathematically verify the model's correctness.
Experimental Evaluation: The SWaT Testbed
The researchers evaluated their approach using the Secure Water Treatment (SWaT) testbed, a scaled-down but fully operational water treatment plant. Due to the risks of running mutated code on physical hardware, the study utilized a high-fidelity Python-based simulator that mirrors the plant's actual PLC logic.
From an initial set of 20 generated mutants, the authors filtered for those that produced observable changes in system behavior, resulting in 6 distinct mutants used for training. The SVM classifiers were tasked with identifying the deviations caused by these mutations.
Key Results
The preliminary results on the SWaT simulator demonstrated the high potential of this approach:
- High Classification Accuracy: SVM classifiers trained on individual mutants achieved an average accuracy of 99%.
- Generalization: A single "combined" classifier trained to detect any of the six mutations maintained an impressive accuracy of 98.41%.
- Concrete Invariants: Beyond simple classification, the authors successfully extracted linear equations from the SVM. For example, they derived a relationship between water tank levels at a specific time and the levels 250ms later, providing a human-readable physical invariant.
Discussion and Future Work
This research introduces the concept of Physical Attestation: instead of verifying the integrity of the code itself (which is complex and often bypassed by sophisticated attacks), we verify the physical results of that code. If the physics of the system deviates from the learned invariant, the underlying code or sensor data must be compromised.
As a preliminary study, several areas for future research remain:
- Automation: The current mutation and screening process is manual; the authors aim to automate the identification of "useful" mutations.
- Hardware Validation: Future work will involve collecting data from the physical SWaT hardware, necessitating safety protocols to prevent damage during data collection.
- Verification Implementation: While the paper proposes Statistical Model Checking and Symbolic Execution for verification, the full implementation and evaluation of these methods are ongoing.
- Handling Rare Events: Ensuring the model does not produce false positives during rare but legitimate operational modes remains a critical challenge.
Conclusion
By bridging software mutation testing and machine learning, this approach provides a lightweight, automated path toward securing complex Cyber-Physical Systems. It moves away from the limitations of manual physics modeling and toward a data-driven understanding of system integrity.
Summary updated