Machine Learning Shields Microgrid Relays From Four Classes of Cyber-Attack

Bioengineer.org

Source published: Site published:

Original article · فارسی

Protective relays act like guards for modern power grids. In microgrids, their job is especially important and delicate. Directional overcurrent relays, or DOCRs, decide when to open a circuit breaker by checking two things: how strong the fault current is and which direction it flows. They make these decisions using current and voltage measurements from instruments installed near the relay. Researchers who published their work in Results in Engineering say this reliance on local measurements creates a security risk that has not received enough attention. An attacker who changes these measurements or the relay's settings could trick it into opening a circuit even when the electrical system is working normally. To address this problem, the researchers developed a machine learning system based on a support vector machine (SVM). It checks each decision to open a circuit and stops the relay from acting when the incoming data looks artificially created rather than physically real.

Real electrical faults make up one class, while cyber-attacks that imitate faults make up the other. The study considers a wider range of threats than many earlier studies. Previous methods for differential protection and protection systems involving multiple devices often assume that local measurements, instrument transformer settings, and relay settings can be trusted. They mainly focus on attacks against signals sent over communication networks. The new study removes that assumption and examines four types of attacks that target different parts of the relay's measurement and decision process: false data injection attacks, which change measured current and voltage levels; time-synchronization attacks, which change the angle between operating and reference signals; transformation-ratio attacks, which change the effective current transformer ratio; and relay-setting attacks, which tamper with the current level needed to trigger the relay.

The researchers modeled each attack using limits that would make it effective against a real relay. For example, a false data injection attack must lower the measured phase voltage below 0.9 per unit and raise the current above the relay's pickup threshold, but keep it below the highest fault current the relay could experience. This makes the altered measurements satisfy the relay's own rules for opening a circuit. Time-synchronization attacks change the phase angles of current and voltage so that the directional protection unit mistakes a fault in the reverse direction for one in the forward direction, or the other way around. The paper gives an example in which an eight-millisecond shift changes the apparent phase angle from 38.8 degrees to 211.7 degrees. However, the shift needed depends on the particular relationship between voltage and current. Transformation-ratio attacks lower the current transformer ratio by a calculated amount, making normal load current appear high enough to trigger the relay. The changes are limited so that the transformer does not become saturated during normal loading and the relay can still respond to faults. Relay-setting attacks lower the pickup current, causing the relay to mistake ordinary load current for a fault.

To train the classifier, the team used DigSILENT and MATLAB to simulate a modified radial IEEE 33-bus microgrid. The system contained four synchronous distributed energy resources (DERs) and eleven DOCRs. The researchers focused their detailed analysis on relay R1, which protects the line between buses 2 and 3. If R1 opened the circuit by mistake, it would disconnect all four DERs from the main grid and isolate the entire microgrid. The training data included 660 different fault cases on line 2-3. These covered six fault locations, from 15 to 90 percent of the line's length; eleven fault resistance values, from one milliohm to fifty ohms; and ten fault types covering all combinations of single-line-to-ground, line-to-line, line-to-line-to-ground, and three-line-to-ground faults. The researchers also created 800 attack scenarios under normal operating conditions: 350 false data injection attacks, 350 time-synchronization attacks, 50 transformation-ratio attacks, and 50 relay-setting attacks.

For each event, the researchers extracted 24 features from measurements at the relay. These included the sizes and angles of positive-, negative-, and zero-sequence voltages and currents, along with the same measurements for all three phase voltages and currents. They ranked the features by importance using an algorithm called minimum-redundancy maximum-relevance. To help the classifier handle imperfect measurements, they added three levels of Gaussian noise: 10, 20, and 30 percent. They used both noisy and noise-free measurements during training. The final dataset contained 5,840 samples, each with 24 features. The researchers used 70 percent of the data for training and kept the remaining 30 percent for testing. They adjusted the model's settings using Bayesian optimization on the training data alone, with two-fold cross-validation. The best setup used a Gaussian kernel, a kernel scale of 563.807, a box constraint of 16.1794, and standardized data.

On the test data that the model had not seen before, the trained SVM achieved an overall accuracy of 99.4 percent. It performed well on both classes. For real faults, precision was 99.5 percent and recall was 99.1 percent. For attacks, precision was 99.3 percent and recall was 99.6 percent. The F1-scores were 0.993 for faults and 0.994 for attacks. Because the different attack types appeared in unequal numbers, the researchers also measured how well the model detected each type separately. In the test set, it detected single-phase false data injection, transformation-ratio, and relay-setting attacks with 100 percent accuracy. Detection rates were 99.44 percent for double-phase false data injection, 98.25 percent for three-phase false data injection, and 99.52 percent for time-synchronization attacks. These results suggest that the strong overall scores did not hide poor performance on less common attack types.

Speed is important for protective relays, and the results are promising, although the measurements need to be understood carefully. In MATLAB, the trained SVM took about nine microseconds to classify one set of features. However, this number measures only the classifier's prediction step. When measurement collection, sampling, feature extraction, memory access, and classification were all included, the total processing time was about six milliseconds. The authors say this falls within the usual operating range of digital protective relays and is shorter than an operating interval of 1.5 electrical cycles. Training the SVM took about 43 seconds, the shortest time among the classifiers tested. When the researchers compared it with random forest, Naive Bayes, decision tree, k-nearest neighbors, and neural network models using the same dataset, the SVM achieved accuracy, precision, recall, and F1-scores above 99.1 percent.

The team also compared its method with PCA-Isolation Forest (PCA-IF), an anomaly detection method used in recent approaches to making protection systems more resistant to cyber-attacks. The researchers retrained PCA-IF on the same dataset. Both methods achieved 100 percent classification accuracy on the cases considered. However, PCA-IF took about 1.6 times as long to train as the SVM and needed about 11.5 milliseconds to complete classification, compared with about six milliseconds for the SVM. The researchers also tested the SVM on 20 new fault and attack cases. These cases used combinations of parameters that had not appeared during model development, and the model was not retrained before testing. The results provided further evidence that the classifier could handle new fault types, locations, resistance values, and previously unseen levels of manipulation across all four attack categories.

The authors clearly explain the limits of their findings. All the results came from simulations using a single radial test system with synchronous DERs, and the detailed analysis focused on just one relay. The method must be tested independently before it can be considered reliable for other network designs, systems dominated by inverters, meshed microgrids, or different relay locations. The study assumed that current transformer (CT) saturation was negligible. The authors suggested a technique to reduce its effects but did not implement or test that technique. Therefore, the results do not prove that the method works when current transformers are saturated. The researchers also did not model harmonic distortion, measurement quantization, or other sensor imperfections. Communication packet losses and delays were outside the design of the system, and the threat model covered only attacks that cause false trips. It did not include attacks that occur at the same time as genuine faults or attacks designed specifically to fool machine learning models. The team did not perform hardware-in-the-loop tests, real-time digital simulations, or tests using commercial relays. As a result, the reported processing times come from simulations rather than real hardware. The authors say future work will test the method under a wider range of network conditions, with more relays and attack types, explicit modeling of CT saturation, and tests on embedded hardware to determine whether it can work in real time from start to finish.

Subject of Research: A cyber-attack detection system based on an SVM to protect microgrids using directional overcurrent relays.

Article Title: A machine learning framework for cyber-resilient directional overcurrent protection in microgrids

Article References: Sheta, A. N., Elgamal, M. M., Eladl, A. A., Bureš, V., & Sedhom, B. E. (2026). A machine learning framework for cyber-resilient directional overcurrent protection in microgrids. Results in Engineering, 32, Article 113735. https://doi.org/10.1016/j.rineng.2026.113735

Image Credits: AI Generated

DOI: 10.1016/j.rineng.2026.113735

Keywords: microgrids, directional overcurrent relays, cyber-attacks, machine learning, support vector machine, false data injection, time-synchronization attacks, CT transformation ratio, relay settings, IEEE 33-bus, protection coordination, simulation