A Machine-Learning-Based Framework for Detection and Recommendation in Response to Cyberattacks in Critical Energy Infrastructures
Abstract
1. Introduction
- The definition of a novel framework specifically designed to predict or detect cyberattacks in energy systems.
- The design of a response and adaptation module aligned with the MITRE framework, which provides appropriate countermeasures for detected or predicted attacks.
- The validation of the proposed solution through a forecasting-based detection approach applied to a real energy scenario.
2. Related Work
3. Ml-Based Attack Prediction, Response, Recommendation and Adaptation Framework
- Features storage: This sub-module generates the datasets used to train the machine learning models used by the attack detection sub-module.
- Attack detection: This sub-module detects abnormal behaviors in the system, based on ML algorithms, which may trigger a red flag warning about a potential attack.
- Attack response and adaptation: This sub-module defines the list of actions to be enforced by the framework when an attack is detected or predicted. The actions are defined in two different ways: first, a set of proactive actions is determined based on the type of predicted attack and the expected impact; second, the mitigation strategies that will be enforced when an attack is detected.
3.1. Features Storage
3.2. Attack Detection Component
- Network traffic data (unsupervised component input interface): Network traffic flows that are extracted from the monitored infrastructure. This traffic can be captured typically using tcpdump or Wireshark. Afterwards, it is transmitted to the attack detection module via Apache Kafka or MQTT.
- IoT measurements data (forecasting component input interface): Time series data that include the measurement value captured by an IoT device and the corresponding timestamp. The attack detection module can receive this time series data via Apache Kafka or MQTT.
3.3. Attack Response and Recommendation Component
4. Application Scenario: Energy Use Case
- Python v3.10.13 scripts using the Gurux.DLMS.Python library [21] to interact with smart meters via the DLMS protocol.
- An Apache Kafka server v3.7.2 to transmit information between relevant nodes.
- PostgreSQL and the local file system to store information.
- A combination of different Python libraries (TensorFlow, pandas, and others) to process them.
- Grafana to show a local dashboard of the system state.
4.1. Data Collection
4.2. Predictive Modeling
4.3. Processing and Anomaly Detection
4.4. Attack Response and Recommendation
5. Results and Evaluation
- fdi_zeroing: indicative of a forced zero value injection;
- fdi_switch_heartbeat: for the anomalous values identified as switch with heartbeat;
- fdi_switch_other_measurement: for the anomalous values identified as switch with other measurement.
6. Conclusions and Future Work
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Abbreviations
AMI | Advanced Metering Infrastructure |
CNN | Convolutional Neural Network |
DLMS/COSEM | Device Language Message Specification/
Companion Specification for Energy Metering |
DL | Deep learning |
DoS | denial-of-service |
GC-LSTM | Graph Convolutional Long Short-Term Memory |
GRU | Gated Recurrent Units |
IEEE | Institute of Electrical and Electronics Engineers |
FDI | False Data Injection |
IoT | Internet of Things |
IoT-E-CADS | IoT-enabled cyberattack detection system |
IP | Internet Protocol |
LSTM | Long Short-Term Memory |
MAE | Mean Absolute Error |
MAPE | Mean Absolute Percentage Error |
MSE | Mean Squared Error |
ML | Machine Learning |
MLP | Multilayer Perceptron |
PMUs | Phasor Measurement Units |
RNN | Recurrent Neural Networks |
VM | Virtual Machine |
References
- Gnoni, M.G.; Bragatto, P.A.; Milazzo, M.F.; Setola, R. Integrating IoT technologies for an intelligent safety management in the process industry. Procedia Manuf. 2020, 42, 511–515. [Google Scholar] [CrossRef]
- Gasparin, A.; Lukovic, S.; Alippi, C. Deep learning for time series forecasting: The electric load case. CAAI Trans. Intell. Technol. 2022, 7, 1–25. [Google Scholar] [CrossRef]
- Chriki, F.Z.; Simó, E.; Aguiló, F.; Garcia-Milà, I.; Masip, X. A deep learning framework for safety monitoring of a railway section. In Proceedings of the IEEE International Conference on Cyber Security and Resilience (CSR), London, UK, 24 September 2024; pp. 1–6. [Google Scholar]
- Khattak, A.; Bukhsh, R.; Aslam, S.; Yafoz, A.; Alghushairy, O.; Alsini, R. A hybrid deep learning-based model for detection of electricity losses using big data in power systems. Sustainability 2022, 14, 13627. [Google Scholar] [CrossRef]
- Ağin, A.; Demirören, A.; Usta, Ö.; Örencik, B. Using Deep Learning Algorithms for Cyberattack Detection in IEC 61850-Based Power Systems. In Proceedings of the 15th National Conference on Electrical and Electronics Engineering (ELECO), Bursa, Turkiye, 30 November 2024; pp. 1–6. [Google Scholar]
- Acharya, A.; Bhalja, B.R. Deep Learning-Based Detection and Mitigation Strategy for Cyber-Attacks on Advanced Metering Infrastructure. In Proceedings of the IEEE International Systems Conference (SysCon), Montreal, QC, Canada, 15 April 2024; pp. 1–7. [Google Scholar]
- Presekal, A.; Ştefanov, A.; Rajkumar, V.S.; Palensky, P. Attack graph model for cyber-physical power systems using hybrid deep learning. IEEE Trans. Smart Grid 2023, 14, 4007–4020. [Google Scholar] [CrossRef]
- Regev, Y.A.; Vassdal, H.; Halden, U.; Catak, F.O.; Cali, U. Hybrid AI-Based Anomaly Detection Model Using Phasor Measurement Unit Data. In Proceedings of the IEEE 1st Global Emerging Technology Blockchain Forum: Blockchain & Beyond (iGETblockchain), Irvine, CA, USA, 3 April 2023; pp. 1–6. [Google Scholar]
- Allen, A.; Singh, M.; Muljadi, E.; Santoso, S. PMU Data Event Detection: A User Guide for Power Engineers; No. NREL/TP-5D00-61664; National Renewable Energy Lab. (NREL): Golden, CO, USA, 2014. [Google Scholar]
- Zhao, J.; An, K.; Wang, X. Research on Fast Early Warning of False Data Injection Attack in CPS of Electric Power Communication Network. J. Cyber Secur. Mobil. 2024, 1, 1331–1356. [Google Scholar] [CrossRef]
- Zhu, Y.; Zhang, Y.; Zhang, C.; Zhang, B.; Wang, H.; Feng, S. Detection of false data injection in electric energy metering platforms using gradient lifting decision trees and MLP neural networks. Discov. Appl. Sci. 2025, 7, 42. [Google Scholar] [CrossRef]
- Naveeda, K.; Fathima, S.S. Real-time implementation of IoT-enabled cyberattack detection system in advanced metering infrastructure using machine learning technique. Electr. Eng. 2025, 107, 909–928. [Google Scholar] [CrossRef]
- Malhotra, P.; Vig, L.; Shroff, G.; Agarwal, P. Long Short Term Memory Networks for Anomaly Detection in Time Series. In Proceedings of the 23rd European Symposium on Artificial Neural Networks (ESANN), Bruges, Belgium, 23–25 April 2015; pp. 89–94. [Google Scholar]
- Liu, Y.; Ning, P.; Reiter, M.K. False Data Injection Attacks Against State Estimation in Electric Power Grids. ACM Trans. Inf. Syst. Secur. 2011, 14, 1–33. [Google Scholar] [CrossRef]
- Gaggero, G.B.; Girdinio, P.; Marchese, M. Artificial Intelligence and Physics-Based Anomaly Detection in the Smart Grid: A Survey. IEEE Access 2025, 13, 23597–23606. [Google Scholar] [CrossRef]
- Achaal, B.; Adda, M.; Berger, M.; Ibrahim, H.; Awde, A. Study of smart grid cyber-security, examining architectures, communication networks, cyber-attacks, countermeasure techniques, and challenges. Cybersecurity 2024, 7, 10. [Google Scholar] [CrossRef] [PubMed]
- Hasan, M.K.; Abdulkadir, R.A.; Islam, S.; Gadekallu, T.R.; Safie, N. A review on machine learning techniques for secured cyber-physical systems in smart grid networks. Energy Rep. 2024, 11, 1268–1290. [Google Scholar] [CrossRef]
- Al-Sada, B.; Sadighian, A.; Oligeri, G. MITRE ATT&CK: State of the art and way forward. ACM Comput. Surv. 2024, 57, 1–37. [Google Scholar] [CrossRef]
- PHOENI2X EU Project. Available online: https://phoeni2x.eu/ (accessed on 3 June 2025).
- Sari, A.; Lekidis, A.; Butun, I. Industrial networks and IIoT: Now and future trends. Ind. IoT Challenges, Des. Princ. Appl. Secur. 2020, 1, 3–55. [Google Scholar]
- Gurux DLMS Python Library. Available online: https://github.com/Gurux/Gurux.DLMS.Python (accessed on 3 June 2025).
- Tukey, J.W. Exploratory Data Analysis; Addison-Wesley: Reading, MA, USA, 1977; Volume 2, pp. 131–160. [Google Scholar]
Reference | Scenario | Attack | ML/DL Model | Performance |
---|---|---|---|---|
Khattak et al. [4] 2022 | Energy Smart meters | Anomalies | GRU CNN | ACC = 98.5% |
Abdulvehhab et al. [5] 2024 | Energy Real time Power systems | False data injection | RNN | ACC = 97.67% |
Acharya et al. [6] 2024 | Energy AMI Smart meters | DoS Threft Composite | LSTM | ACC = 98% |
Presekal et al. [7] 2023 | Energy Smart meters PMUs | DDoS | GC-LSTM | ACC = 96% |
Regev et al. [8] 2023 | Energy Smart meters PMUs | False data injection | Bi-LSTM CNN | p = 98.75% |
Zhao et al. [10] 2024 | Energy Smart grid | False data injection | LSTM | ACC = 98.9% |
Zhu et al. [11] 2025 | Energy Smart grid | False data injection | MLP | ACC = 99.97% |
Naaveda et al. [12] 2025 | Energy Smart grid | False data injection | Isolation Forest Decision Tree | ACC = 95% |
This paper 2025 | Energy AMI Smart meters | False data injection | LSTM Tukey’s fences | MAPE < 2% |
Attack Type | Tactic | Technique ID | Description | Recommended Actions |
---|---|---|---|---|
False Data Injection Attack (FDI) | Impact | T0832: Manipulation of View | The adversary tried to manipulate the information reported to the operator | Enable command validation Enforce data consistency checks Cross-check sensor values |
Evasion, Impair Process Control | T0859: Spoof Reporting Message | The adversary may spoof the messages in the control environment for evasion and impair the process | Filter network traffic Communication authenticity Network allowlist |
Feature | Description |
---|---|
Non-null measure name | Identifies the specific smart meter that generated the sample. |
Non-null timestamp | Identifies the moment when the sample was obtained. |
Nullable value | Stores the value of the received sample or NULL if the row only contains a forecast. |
Nullable prediction | Stores the value of the forecasted sample or NULL if the row only contains a received sample value because the ML model was not available when the prediction was attempted or there were not enough real data. |
Nullable error | Stores the difference between the real and forecasted value or NULL if we do not have real and predicted values. |
Nullable interior lower/upper barrier for the error | Stores the interior lower/upper barrier of the last 300 prediction errors or NULL if they are not available. |
Nullable exterior lower/upper barrier for the error | Stores the exterior lower/upper barrier of the last 300 prediction errors or NULL if they are not available. |
Nullable interior lower/upper barrier for the values | Stores the interior lower/upper barrier of the last 300 received values or NULL if they are not available. |
Nullable exterior lower/upper barrier for the values | Stores the exterior lower/upper barrier of the last 300 received values or NULL if they are not available. |
Nullable abnormality indicator | Stores if the sample is considered abnormal or NULL if the barriers are not available. |
Nullable evaluation name | Stores the evaluation text or NULL if the barriers are not available. The current evaluation names are the following:
|
Sensor | MAPE | Relative MAE (%) | MAE | MSE | Mean Value |
---|---|---|---|---|---|
488 | 0.00558777 | 0.558703 | 5.56263 | 5371.99 | 995.632 |
600 | 0.0054681 | 0.54681 | 5.44076 | 5363.8 | 995 |
2880 | 1.06633 × 10−5 | 0.00106889 | 8932.15 | 1.59092 × 1010 | 8.35647 × 108 |
3232 | 2.92522 × 10−6 | 0.000292803 | 619.473 | 1.29953 × 108 | 2.11567 × 108 |
6752 | 0.000137336 | 0.01402 | 9598.8 | 1.59281 × 1010 | 6.84653 × 107 |
6928 | 0.000126878 | 0.0129915 | 8930.77 | 1.6026 × 1010 | 6.87431 × 107 |
7584 | 3.2651 × 10−6 | 0.000326796 | 753.091 | 1.30425 × 108 | 2.30446 × 108 |
7936 | 3.70951 × 10−6 | 0.000371307 | 785.55 | 1.30116 × 108 | 2.11564 × 108 |
9696 | 1.06881 × 10−5 | 0.00107132 | 8953.2 | 1.59099 × 1010 | 8.35714 × 108 |
9872 | 9.50709 × 10−6 | 0.000952716 | 8971.82 | 1.6039 × 1010 | 9.4171 × 108 |
13208 | 5.426 × 10−6 | 0.000543573 | 6947.16 | 1.58929 × 1010 | 1.27805 × 109 |
25968 | 0.00585285 | 0.584236 | 23.0041 | 83,670.9 | 3937.46 |
26160 | 0.00584809 | 0.583691 | 23.1408 | 84,808.1 | 3964.57 |
36424 | 1.88515 × 10−6 | 0.000188615 | 2.73557 | 1762.72 | 1.45034 × 106 |
39664 | 0.00640789 | 0.639621 | 25.3568 | 84,897.2 | 3964.35 |
39952 | 0.00642258 | 0.64116 | 25.2437 | 83,658.3 | 3937.2 |
40096 | 0.00626838 | 0.624515 | 1.86933 | 415.68 | 299.325 |
40384 | 0.00838551 | 0.836875 | 1.90657 | 281.01 | 227.82 |
40672 | 0.0192327 | 1.92334 | 96.1544 | 251,542 | 4999.34 |
40816 | 0.00775649 | 0.772118 | 1.38456 | 172.79 | 179.32 |
40960 | 0.0112389 | 1.10891 | 0.174678 | 0.778605 | 15.7522 |
41968 | 0.00551772 | 0.551937 | 5.49425 | 5370.55 | 995.448 |
47728 | 0.00873329 | 0.870482 | 0.882871 | 56.7949 | 101.423 |
48016 | 0.00845793 | 0.84191 | 0.65132 | 25.7779 | 77.3622 |
48160 | 0.0189644 | 1.89204 | 1.14692 | 32.5701 | 60.6181 |
48448 | 0.00835013 | 0.830205 | 0.368314 | 10.6188 | 44.3643 |
49168 | 0.00776531 | 0.773908 | 1.39336 | 174.762 | 180.043 |
49704 | 0.00810847 | 0.807817 | 0.955992 | 78.5552 | 118.343 |
49992 | 0.0100255 | 1.00067 | 0.894381 | 40.476 | 89.3778 |
Category | Number | % |
---|---|---|
normal | 55 | 2.34 |
abnormal low value | 1081 | 45.96 |
abnormal high value | 1153 | 49.02 |
suspicious low value | 61 | 2.59 |
suspicious high value | 2 | 0.09 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Rabadan, R.; Hussain, A.; Simó, E.; Rodriguez, E.; Masip-Bruin, X. A Machine-Learning-Based Framework for Detection and Recommendation in Response to Cyberattacks in Critical Energy Infrastructures. Electronics 2025, 14, 2946. https://doi.org/10.3390/electronics14152946
Rabadan R, Hussain A, Simó E, Rodriguez E, Masip-Bruin X. A Machine-Learning-Based Framework for Detection and Recommendation in Response to Cyberattacks in Critical Energy Infrastructures. Electronics. 2025; 14(15):2946. https://doi.org/10.3390/electronics14152946
Chicago/Turabian StyleRabadan, Raul, Ayaz Hussain, Ester Simó, Eva Rodriguez, and Xavi Masip-Bruin. 2025. "A Machine-Learning-Based Framework for Detection and Recommendation in Response to Cyberattacks in Critical Energy Infrastructures" Electronics 14, no. 15: 2946. https://doi.org/10.3390/electronics14152946
APA StyleRabadan, R., Hussain, A., Simó, E., Rodriguez, E., & Masip-Bruin, X. (2025). A Machine-Learning-Based Framework for Detection and Recommendation in Response to Cyberattacks in Critical Energy Infrastructures. Electronics, 14(15), 2946. https://doi.org/10.3390/electronics14152946