Introduction

As energy consumption continues to rise, traditional thermal power plants are increasingly unable to meet the growing demand, necessitating the integration of small-scale distributed generation systems at the consumer level to maintain the supply-demand balance. The Internet of Energy (IoE) plays a crucial role in enabling interaction between the energy market and consumers within the existing power grid. Alongside decentralized energy sources, end-user devices—known as prosumers—such as smart meters, smart appliances, smart inverters, and controllable loads, can now participate in the energy market (EM) through advanced information and communication technologies (ICT). The Virtual Power Plant provides a key framework for integrating renewable energy sources and end users into the energy market. As a software-based power plant, the VPP allows participants to connect in two ways: through an internet gateway, facilitating seamless communication and coordination1. The Virtual Power Plant enhances the monitoring and management of RES, enabling the efficient use of inverter-based generation capabilities. A central control system oversees the operation of all units within the VPP, processing crucial information such as bid quantities, bid prices, weather forecasts, and grid data. However, this complexity makes the system highly susceptible to cyber-attacks. The VPP’s ICT infrastructure is intricate, and its interoperability introduces several challenges, including resource allocation across different sources, secure communication, power scheduling, and overall system control. These issues must be addressed to ensure the system’s security and reliability2. The basic operation of a Virtual Power Plant and its potential vulnerabilities to cyber-attacks are illustrated in Fig. 1. The VPP can include a combination of conventional thermal power stations and small-scale renewable energy sources.

The system measures power flow data, while control signals are generated by the power control center (PCC) to manage the power system’s operations. To ensure the secure and reliable operation of the energy market, various standard protocols and architectural frameworks have been developed. Different communication architectures necessary for the VPP’s operation have been analyzed to address these security concerns3, it has been found that architectures based on the Common Information Model (CIM) and IEC 61,850 can effectively meet the communication requirements of VPP systems. However, the communication layer remains highly vulnerable to cyber-attacks. In addition to power system data, VPPs also handle sensitive system data, which attackers may exploit by targeting vulnerabilities within the infrastructure. Some types of attacks may go undetected in the early stages, highlighting the need for further research and advanced detection techniques. This study focuses on False Data Injection Attacks (FDIA), a prominent network-based attack targeting VPP systems. FDIA manipulates critical operational data, such as: altering energy market bids to generate financial losses or disrupt market operations and falsifying energy production or consumption data to mislead market participants or destabilize the grid. To address these risks, an unsupervised Autoencoder deep learning approach is proposed for detecting False Data Injection Attacks in VPP systems. AEs are particularly effective for anomaly detection because they learn intricate patterns from normal operational data and can recognize subtle deviations that may indicate cyber-attacks. By compressing input data into a lower-dimensional representation and then reconstructing it, the AE minimizes reconstruction error for normal data. However, when malicious data is introduced, the reconstruction error increases, signaling potential anomalies. This unsupervised approach eliminates the need for labeled attack data, making it highly suitable for dynamic and evolving VPP environments where attack patterns are constantly changing. The proposed AE model enhances the cyber security of VPPs by providing an automated, scalable, and adaptive detection mechanism that can identify attacks in real time, thereby ensuring the reliability and security of energy management systems.

Related work

To address security concerns, researchers have proposed various strategies for detecting cyber intrusions and conducted impact analyses in the context of the smart grid and energy market. Paper4 highlights the security challenges in smart grids, emphasizing the importance of the confidentiality, integrity, and availability (CIA) triad as the primary objectives. A concise overview of common cyber-attacks, including DoS, spoofing, malware injection, and replay attacks, along with potential solutions, is provided in5] and [6. These attacks disrupt system objectives and interoperability. Paper7 discusses emulator-based cyber-physical analysis, showcasing the modeling and emulation of both communication and power systems.

The architecture, applications, impacts, and solutions for detecting cyber-physical security threats in the smart grid are examined in8] and [9. Specifically8, describes the deployment of the cyber-physical test-bed, which integrates industrial SCADA hardware and software with modeling and emulation techniques to establish a robust cyber infrastructure for the electric grid. Paper9 introduces a tool for detecting physical-layer cyber-attacks on the grid, employing an intrusion detection system (IDS) to identify and protect against known threats, such as Trojans, targeting the power grid. For any power system, when a malicious command is detected in real time, the operator can act fast to defend the whole system against these activity, averting cascading failures and ultimately blackouts.

Fig. 1
figure 1

Possible cyber attack in communication channel of VPP.

The integration of electric vehicles into the smart grid’s cyber-physical system raises additional security and privacy concerns, as explored in10, which proposes a blockchain-based and software defined networking (SDN) detection technique to mitigate cyber threats in EV-connected smart grids. The aim of this work is to provide Protection of privacy and energy security to smart grid. Paper11 provides a brief review of IoT layers in VPP infrastructure, highlighting trending cyber-attacks and vulnerabilities. VPPs, being critical communication infrastructure, are particularly susceptible to attacks, as discussed in12] and [13. The National Electric Sector Cybersecurity Organization Resource (NESCOR) has identified various risks in the energy market, particularly for VPPs, as detailed in14. NESCOR has also outlined Critical Infrastructure Protection (CIP) standards, threat samples, evaluation methods, and safety criteria to ensure the secure and reliable supply of electrical energy to consumers. A framework for identifying the typical operating region of a VPP for cyber-secure operation is detailed in15. This work introduces cyber security analytics to define standard operating systems, using the typical operating region as a validation mechanism to detect malicious set-point requests in the network’s cyber layer. A denial-of-service (DoS) attack scenario involving a PV plant integrated into the power system is proposed in16, focusing on tie-line control actions as a primary attack point. This work employs a cellular convolution neural network for real-time detection of cyber-attacks. Attackers can also target power flow control from distributed generators during aggregation in the energy market, with the risk of jamming attacks in these operations discussed in17. An IDS based on Bayesian network graph for a power system is proposed in18. The process for building such a Bayesian network and determining the temporal-state changeover trends for various system scenarios is demonstrated in this research. These patterns are employed by the IDS as guidelines for categorizing comprehensible system situations and identifying intrusions that seek to compromise the security framework.

Paper19 explores how a DoS attack can penetrate the communication architecture of a VPP. It identifies the VPP’s voltage support and introduces a vulnerability index to quantify the impact of DoS attacks on demand response (DR) aggregation within the EM. Author in20 has proposed supervised, semi-supervised and online algorithms for detection of FDIA in smart grid and investigated the algorithms with various IEEE test systems and suggested attack detection framework, machine learning algorithms outperform attack detection approaches that use state vector estimation techniques in detecting attacks. Several forms of Support Vector Machines (SVM) and Naïve Bayes approaches have been tested for masquerade detection in the smart grid environment in21. A recent study22, presented Artificial neural network (ANN) based methods for controlling and monitoring of very common attack on VPP, the poisoning attack.

For VPP systems, FDIA detection and alarming system is proposed in23. A distributed economic scheduling of VPP units that takes security vulnerabilities into account is presented in this paper. FDIA considered as very potential cyber-attack in electricity market24. The concept of FDIA in power system introduce with the development of smart grid25 and the researchers are being attracted to work and find the novel solution for detection and mitigation of FDIA in smart grids26,27,28,29,30,31. In this study27, the authors mathematically define false data injection attacks with incomplete information from both the attacker’s and the grid operator’s perspectives. Additionally, they propose a novel vulnerability measure to compare and rank different power grid topologies based on their susceptibility to such attacks. An optimized clustering algorithm is introduced in28, considering the power system’s topology to classify potentially vulnerable nodes into different groups. Building on this, a state forecasting method is proposed to predict system states and detect FDIA. To evaluate the effectiveness and performance of the proposed approach, simulations are conducted on the IEEE 39-bus and IEEE 118-bus systems. Author in29 integrated k-means + + algorithm with expectation maximization algorithm and able to locate FDIA with probability of 95% for IEEE-5 bus and IEEE-14 bus smart grid systems. Drawing inspiration from federated learning, the study30 proposes an FDIA detection method based on secure federated deep learning, integrating Transformer, federated learning, and the Paillier cryptosystem. The study31, proposes an algorithm which combines CNN with sparrow search algorithm for localization of FDIA in smart grid and achieved high accuracy of 99.85% in localization with reduced false alarm only 0.03%. Another recent work32, explores cyber-attack identification using AI-based models namely decision trees and k-nearest neighbor (KNN), by estimating the state vector of the electricity network. Simulations are conducted using data extracted from the IEEE 5-bus network to evaluate the effectiveness of the proposed algorithm. False data attack vectors are injected into accurate measurements, and 2,000 measurement samples are collected—half representing healthy data and the other half manipulated data. After labeling the data accordingly, the proposed algorithms are applied to detect and classify attacks. A comparative analysis of the proposed algorithms against conventional methods reveals significantly improved accuracy. A comprehensive review on FDIA in smart grid system is presented in33 with detailed classification, challenges and its counterparts.

Paper34 presents analytics using a stacked autoencoder method to secure the transactive energy system. Two distinct rules for component outage and network-based attack detection have been proposed in this work. The suggested methodology detected 96.9% of attacks and 79% of component outages. The significance of IEC 61,850 in power system operations and the role of artificial intelligence in intrusion detection are thoroughly discussed in35] and [36. In35, the focus is on securing the smart grid’s communication layer (IEC 62351), where AI is employed to detect intrusions by analyzing the sampled values messages of IEC 61,850. This study achieved a high accuracy of 94.69% in minimal time using Extremely Randomized Trees (XRT) when the power system experienced both False Data Injection Attacks and faults. On the other hand36, explores the use of IEC 61,850’s Generic Object-Oriented Substation Event (GOOSE) signals to develop an intrusion detection system based on various machine learning techniques. Among the proposed methods, the Random Forest (RF) algorithm demonstrated the highest accuracy, achieving 95.19%, making it the most effective technique for identifying cyber threats in power systems. A critical review on the anomaly detection for various safety-critical systems has been presented in37. This study provide details about unsupervised ML method namely, Autoencoder and its uses in anomaly detection has been discussed.

In38, a cyber-secured economic dispatch model is proposed, addressing both colluding and non-colluding cyber-attacks. Malicious set-points can be created by attackers manipulating VPP cyber-layer settings. A more recent study39 offers a comprehensive review of potential cyber threats in the energy market, including cyber terrorism. This work emphasizes the critical need for thorough analysis in the energy sector, where control and command operations occur within interconnected environments, and highlight the challenges of monitoring, managing, and mitigating cyber security threats.

This literature review highlights various studies on detecting cyber-attacks in energy markets and smart grids. However, only a limited number of studies focus on VPP systems, which require further analysis to address different cyber-attack scenarios and detection methodologies to enhance cyber security in VPP environments. To tackle this gap, this work proposes an unsupervised Autoencoder machine learning (ML) strategy for detecting FDIA, which is mainly a network-based attack in the VPP environment.

Contribution

The following are main contribution of this work:

  1. i.

    To perform and detect FDIA in VPP systems, a 9-bus and IEEE-39 bus system model is proposed. This model includes four conventional power plant units, a solar photovoltaic (PV) system, energy storage devices, and controllable loads. The integration of these components enables a realistic representation of a VPP, capturing its complexity and operational dynamics. This framework facilitates the identification and evaluation of potential cyber-attack scenarios and their impact on the system.

  2. ii.

    An unsupervised Autoencoder machine learning method is proposed to detect cyber-attacks. This approach leverages the Autoencoder’s ability to learn data patterns, enabling effective identification of anomalies and potential threats without requiring labeled datasets, making it well-suited for enhancing cyber security in complex and dynamic environments.

  3. iii.

    This research aims to generate attack scenarios resembling normal operating data, including unit outages and electricity price manipulation, to analyze attack detection and assess their impact on the system’s normal operation. To validate the proposed model, the base system with integrated Virtual Power Plant units is utilized. This framework enables a comprehensive examination of both attack detection capabilities and their implications for normal operations, ensuring the robustness and reliability of the system in managing cyber security challenges.

To analyze FDIA in VPP, two key datasets are utilized: electricity price and output power from generating units. Specifically, the grid power output and PV system output are considered, with all data categorized into three groups: normal data, generating unit outages, and cyber-attack data. The remainder of the paper is organized as follows: Section “Security threats in VPP” presents a summary of security threats in VPP systems. Section “Methodology” provides a detailed explanation of the AE strategy. Section “Case ananlysis” investigates the proposed technique using a 9-bus VPP system, including a comprehensive discussion, followed by the conclusion of the work in Section “Conclusions”.

Security threats in VPP

The proposed VPP system includes Conventional Power Plants (CPP), photovoltaic systems, energy storage systems, and controllable loads, all of which participate in the energy market. Ensuring cyber security in the EM is a significant challenge due to its vast scale and complexity, encompassing financial transactions, energy supply-demand dynamics, and other critical issues. The primary business objectives of an EM are secure interaction among components, secure monitoring and control, and Distributed Energy Resources operations40. Achieving these objectives requires fundamental cyber security measures, including maintaining the system’s safety, reliability, and resilience.

A typical IoT-based energy market system consists of three layers: the perception layer, network layer, and application layer. These layers communicate via a highly secure system, but the devices within them are vulnerable to security breaches. In VPP systems, these layers include devices such as sensors, SCADA, and Remote Terminal Units (RTUs) in the perception layer; communication and control devices in the networking layer; and smart meters, smart appliances, and Renewable Energy Systems in the application layer. The application layer also facilitates bidding prices and quantities, which are critical for EM operations, necessitating robust security measures41. Security threats in VPP systems may involve bid manipulation, market attacks, and changes to bid prices or Local Marginal Prices (LMP), or even attacks on substations. For instance, in December 2015, a cyber-attack on Ukraine’s power grid affected 30 substations. This was the first successful attack on a power grid, executed through spear-phishing emails that compromised the existing SCADA system42. Based on these insights, the potential attacks on VPP utilities can be categorized as follows:

Attack based on the purpose: The purpose of a cyber-attack may be to gain unauthorized access, slow down, or even crash the system. Access attacks, such as Man-in-the-Middle (MITM) attacks, target data interception and manipulation; while attacks aimed at slowing the system, such as Denial-of-Service (DoS) attacks, render the system inaccessible by overwhelming it with excessive requests. In19, the impact of DoS attacks on voltage support is analysed. Such attacks can disrupt the energy market by altering bid prices or quantities, flooding the system with high-volume data, and preventing VPP units from participating in bids. In severe cases, these disruptions can lead to system outages. MITM attacks occur when a hacker intercepts and manipulates communication between the load and the market server, positioning themselves between Distributed Energy Resources and the energy market. In this scenario, DER participants unknowingly interact with the attacker instead of the actual control server. This can result in energy theft and, in extreme cases, cause blackouts in affected regions.

Attack based on the devices: Anomaly injection or malware attacks can target the central control of the energy market (EM), leading to the destruction or leakage of sensitive information. Intrusions may also focus on physically tampering with grid equipment, protective devices, or prosumers, such as smart appliances. The cyber-attack in Ukraine serves as an example of malware injection at a substation. Common types of malware attacks include viruses, worms, ransomware, botnets, and keyloggers, among others. These attacks can compromise system integrity, steal data, or disrupt operations, posing significant risks to the security of the energy infrastructure.

Attack based on the network: The operation of a Virtual Power Plant heavily relies on its information and communication technology (ICT) infrastructure. Attacks targeting the application, transport, and network layers, as well as multi-layered attacks, can prevent servers from detecting and transmitting critical information across the network. As a result, attackers may manipulate vital energy market data, such as bid quantities or bid prices from prosumers, and alter the settings of smart appliances, including temperature, frequency, and voltage. These attacks aim to illegally modify or distort data within the VPP. False Data Injection Attacks (FDIA) is most popular attack in the network based type26,40,41. False Data Injection Attacks target the network, attempting to corrupt readings from power grid sensors and phasor measurement units, thereby misdirecting the operation and control centers. Such attacks can cause unavailability of information for VPP units, preventing their participation in the market, or they may alter the Local Marginal Price of electricity, ultimately impacting electricity pricing. FDIA can be classifying in two categories depending on where the false data is being injected namely: (i) False energy data injection and, (ii) false communication link-state data injection. Furthermore, both supply and demand nodes are susceptible to injecting fake energy data; hence both nodes must be taken into account for security reasons. In order to create a false data state, an intruder can also target the communication channels utilized for data and energy transmission. This could result in higher transmission costs and an imbalance in the energy market’s power flow.

The impact on the energy market and other VPP operations will vary depending on the severity of the cyber-attack. Therefore, it is crucial to analyze these impacts and develop detection and mitigation strategies to ensure a secure and safe energy market. Among the various cyber threats, network-based attacks specially, FDIAs are attracting significant attention due to their potential to affect not only the energy market but also finance, governance, and other critical areas and so, in this work False data injection attack has been chosen for the analysis. (Fig. 2).

Fig. 2
figure 2

Possible Cyber-attack in VPP Systems.

Methodology

Detecting the malware intrusion in VPP environment is very challenging issue as the component of the VPP and its participation in energy market is uncertain. ML techniques may be the ideal solution for this. Paper43 uses Naïve Bayes algorithm and J48 bagging tree model for investigating the economic risks due to cyber-attack in VPP system. Also, the effects of cyber threats and for providing the economic dispatch model of VPP has been proposed by neighborhood-watch based resilient energy management system44. AE and Convolution Autoencoder (CAE) based anomaly detection technique have been presented in45 for widely used NSL-DDL dataset. Also author shown the comparison between different methodologies for anomaly detection and the proposed techniques gives the better accuracy. The false positive rate and accuracy rate for AE in this study is 4.09% and 95.85%. In46, author proposes an AE technique for network based anomaly detection for cloud networks with CIDDS-001 dataset, where the reconstruction error is considered as anomaly metric. As highlighted in46, the proposed Autoencoder (AE)-based method achieved an impressive 100% accuracy with a 0% false positive rate, making it an intriguing prospect for researchers. In studies47] and [48, AE approaches were applied to solar power forecasting and time-series forecasting, respectively, demonstrating their versatility in predictive analytics. The use of AE models for anomaly detection is not confined to power systems or computing applications; they have also been successfully implemented in the transportation sector49 and manufacturing processes50. In49, two distinct AE-based models were developed to assess risks associated with the increasing autonomy of vehicles. Similarly, in50, AE techniques were explored to address defect recognition challenges without requiring defect samples for training. Among various supervised and unsupervised machine learning (ML) techniques, AEs are increasingly being recognized as a preferred choice for cyber intrusion detection and time-series analysis. Their effectiveness stems from their ability to capture complex patterns in data and identify anomalies with high precision. Autoencoders, as a type of neural network, offer several advantages over traditional ML methods, making them a valuable tool in diverse fields. The key benefits of using AEs for anomaly detection can be summarized as follows:

  • Dimensionality Reduction: AEs excel at reducing high-dimensional data to a lower-dimensional latent space while preserving critical information. This makes them ideal for processing complex datasets with many features, which is often the case in cyber security and time series data.

  • Handling High-Dimensional and Imbalanced Data: AEs are well-suited for datasets that are high-dimensional and contain class imbalances, such as datasets with rare events or anomalies. They can effectively identify patterns in the majority class while highlighting deviations that indicate anomalies.

  • Feature Extraction: AEs automatically learn and extract meaningful features from raw data during training, eliminating the need for manual feature engineering. This ability enhances their effectiveness in identifying complex, hidden patterns associated with anomalies.

  • Noise Reduction: AEs have the capability to denoise data, making them valuable for processing noisy datasets. By learning a compressed representation of the data, AEs can reconstruct clean versions of the input, aiding in more accurate anomaly detection.

  • Ease of Understanding and Application: Despite their neural network foundation, AEs are relatively straightforward to understand and implement. Their architecture and functionality can be easily adapted for a wide range of anomaly detection applications.

  • Scalability: AEs are highly scalable, making them suitable for large-scale datasets commonly encountered in cyber security and time series analysis. Their ability to process large volumes of data efficiently is a key advantage for modern applications.

These attributes make Autoencoders a powerful and versatile tool in the realm of anomaly detection and analysis, particularly in domains like cyber security and time series forecasting, where detecting subtle anomalies is critical.

AE is an unsupervised deep learning method, consisting of three layers- encoder (input layer), multiple hidden layer and decoder (output layer), shown in Fig. 3. The function of encoder is to map the input data into hidden layer (AE layer) with lower dimension from the input dimension. Finally, decoder maps the hidden layer and reconstructs the original data with the same dimension as of input layer. So the training process in AE has two phases encoding and layer z can be represented as: decoding. For input data x, the hidden layer h and reconstructed output z can be represented as given in Eqs. (1) and (2):

$$h{\text{ }} = {\text{ }}\sigma \left( {{W_1}x{\text{ }} + {\text{ }}{b_1}} \right)\;$$
(1)
$$z{\text{ }} = {\text{ }}\sigma \left( {{W_2}x{\text{ }} + {\text{ }}{b_2}} \right)$$
(2)

Where, σ is activation function and W1, W2, b1, and b2, weight matrix and bias vectors for encoder and decoder respectively. In this work rectifier linear unit (ReLU), activation function has been used and is given by Eq. (3) for all layers except output layer,

$$\sigma \left( x \right){\text{ }} = {\text{ }}{x^ + }max\left( {0,x} \right)$$
(3)

There is the need of preventing from overfitting during training process and this can be achieved by randomly activation of each node based on Bernoulli distribution with probability p. then the output of any layer i + 1 will be given by Eq. (4),

$${x_{i + 1}} = {\text{ }}\sigma \left( {{W_i}\left( {{r_i}*{\text{ }}{x_i}} \right){\text{ }} + {\text{ }}{b_i}} \right)$$
(4)

Where, ri is the sampled value from Bernoulli distribution. The loss function is defined for reducing the reconstruction error between x and z.

Input dataset of AE is categorized into training, validation, and field deployment for various purposes. AE learnt connection weights based on training and validation data. During the training the hyperparameters are tuned including stopping points. After tuning the model, data is put into the AE to estimate its performance. To detect anomalies, only normal data is used for training and validation. The trained model is then evaluated on both normal and anomalous events.

To account for varying signal magnitudes, three groups of data are normalized using z-score normalization, i.e., the mean and standard deviation from training data. The z-score normalization is given by Eqs. (5),

$$\:\stackrel{\sim}{x}=\:\frac{x-{\stackrel{-}{x}}_{\text{m}\text{e}\text{a}\text{n}}}{{s}_{deviation}}$$
(5)

Where, \(\:\stackrel{\sim}{x}\) is the normalized value of x, \(\:{\stackrel{-}{x}}_{\text{m}\text{e}\text{a}\text{n}}\) and \(\:{s}_{deviation}\:\)are mean and standard deviation of the training data. During training, loss function should be minimized. To determine the optimal collection of hyperparameters, many models are trained and tested on a validation dataset. There is tuning of threshold for anomaly detection rules to ensure that the fraction of validation data with a reconstruction error below the threshold is met. AE model have low dimensional hidden layer with small reconstruction error. The attacks or anomalies are detected as per threshold set during the validation process. The reconstruction error, r is defined as the difference between the reconstructed output vector z and the input vector x and is given as,

$$\:r=\:\parallel x-z \parallel$$
(6)

The aim of the AE is to reduce the value of r. The overall process the proposed model has been depicted in Fig. 4.

Fig. 3
figure 3

The Autoencoder architecture.

Hyperparameter tuning

Hyperparameter tuning in an AE involves adjusting various model parameters to optimize performance. One effective way to guide this tuning process is by monitoring the reconstruction error, which measures how well AE can reproduce its input data.

Step for Hyperparameter Tuning with Reconstruction Error.

  1. 1.

    Define the Reconstruction Error: The reconstruction error is typically calculated using: Mean Squared Error (MSE), Mean Absolute Error (MAE) and Binary Cross-Entropy (BCE).

  2. 2.

    Select Hyperparameters to Tune: Key hyperparameters in an autoencoder include: Number of neurons, Learning Rate, Number of Layers & Neurons, Activation Functions, Dropout Rate, Batch Size, Epochs.

  3. 3.

    Train the Autoencoder: Train the model using training data and monitor the validation loss (reconstruction error on validation data).

  4. 4.

    Monitor Reconstruction Error: Track the error for both training and validation datasets. A high validation error may indicate: Overfitting (if training error is low but validation error is high) and Underfitting (if both training and validation errors are high).

  5. 5.

    Tune Hyperparameters Based on Reconstruction Error: check the reconstruction error whether this is too high or overfits the model or the training is going too slow. In these cases the number of neurons, number of layer and leraning rate play an effective role so these needs to keep updated according to the condition arises.

  6. 6.

    Use Grid Search or Bayesian Optimization or Random search to test the combinations of hyperparamerts.

  7. 7.

    Evaluate the Best Model: And the final step is to test the model on unseen data to confirm its generalization ability and Compare models based on reconstruction error distribution or anomaly detection performance (if used for anomaly detection).

The hyperparameters taken for this work has been summarized in Table 1.

Table 1 Hyperparameter for Ae model.

Evaluation metrics

In time series data analysis, two types of errors are typically assessed to evaluate detection accuracy and performance: scale-dependent errors and percentage errors48,51. Scale-dependent errors are measured on the same scale as the data, which limits their usefulness for comparing series with different scales. In this study, two well-known scale-dependent error metrics are used: mean absolute error (MAE), and root mean square error (RMSE) are given by Eqs. (7) and (8) respectively,

$$\:MAE=\:\frac{1}{n}\sum\:_{i=1}^{n}\left|{z}_{i}-\:\widehat{{z}_{i}}\right|$$
(7)
$$\:RMSE=\sqrt{\frac{1}{n}\sum\:_{i=1}^{n}{\left({z}_{i}-\:\widehat{{z}_{i}}\right)}^{2}}$$
(8)

Where, \(\:{z}_{i}\) is the actual data and \(\:\widehat{{z}_{i}}\) is the reconstructed output data from AE model. For higher accuracy of proposed system model, MAE, RMSE and MAPE should be lower.

Fig. 4
figure 4

Flowchart of proposed model.

Case ananlysis

Data generation

The VPP system used for validating the proposed methodology is illustrated in Figs. 5 and 6. The system under consideration is a 9-bus distribution network and modified IEEE-39 bus system integrated with various Renewable Energy Sources. It is modelled and simulated in MATLAB Simulink to generate time-series data, which is subsequently utilized for FDIA detection using an Autoencoder. The simulated VPP system comprises the following components: Four conventional generating units, solar photovoltaic (PV) system, Energy storage system (ESS), Variable loads and constant load. In 9 bus system one unit of solar PV module with ESS system has been integrated at bus 7 and 5 respectively (Fig. 5). The modified IEEE-39 bus system has 9 units of CPP units, two solar PV modules, one ESS and two variable loads, which are connected at bus 38, 17, 9, 18 and 21 respectively (Fig. 6).

The output variables of the system include the power output from the grid, PV power, state of charge (SOC) of the ESS, load demand, and electricity price. Among these output variables, PV power and grid power are selected as bid quantities for participation in the energy market. The cyber-attack scenarios are designed around these bid quantities and the electricity price for consumers. Data collection for the VPP system was carried out over a period of 1000 days under three different operational scenarios: (i) Normal Operation (700 days): The system operates under standard conditions without any faults or attacks, (ii) Component Outage (200 days): During this period, one of the conventional generating units is assumed to be faulty and out for maintenance, and (iii) Manipulation on Electricity Price, 100 days. For these days, the electricity price is altered within a range of (0–30). The impact of these cyber-attacks is analysed in terms of changes in bid quantity data, outages of generating sources, and variations in electricity prices. These variations directly influence the system’s reliability and performance, highlighting the importance of robust detection mechanisms. The input data and system parameters used in this study are summarized in Table 2. This comprehensive dataset serves as a crucial foundation for analyzing the impact of cyber-attacks and validating the proposed FDIA detection methodology using AE. By encompassing a wide range of scenarios, it enables a thorough assessment of the model’s effectiveness under diverse operational conditions. In this study, component outages are not treated separately from attack conditions; instead, they are collectively considered as part of the overall attack criteria. However, future research can focus on distinguishing FDIA from generator outages more precisely, allowing for a more granular analysis. This distinction could enhance the model’s accuracy in identifying specific threats and improving grid resilience. Additionally, incorporating real-time data and expanding the dataset to include more diverse attack vectors and outage scenarios may further optimize detection capabilities. Future work could also explore hybrid approaches, combining AE with other deep learning techniques to achieve higher accuracy and robustness in detecting cyber-physical threats in power systems.

Fig. 5
figure 5

Modified 9-bus System structure.

Fig. 6
figure 6

Modified IEEE-39 bus System structure.

Table 2 Input data for Ae model.

Simulation, and results

The data generated from the MATLAB Simulink model has been utilized to validate the performance of the proposed AE model for anomaly detection in the VPP system. The methodology involves training the AE model with 700 days of normal operation data, validating it with 200 days of data representing a component outage scenario, and testing it with 100 days of attacked data to assess its real-world performance for field deployment. The AE model is trained exclusively on normal operating condition data. During this process, the model learns the hidden representations inherent in the typical system behavior, such as patterns and relationships between variables. The AE’s primary objective is to reconstruct the input data as accurately as possible. When properly trained, the AE generates output that closely matches the input for normal operation data. The reconstruction error, which is the difference between the input and output, is used to identify anomalies. If the reconstruction error exceeds a predefined threshold, it indicates a deviation from normal behavior, flagging the presence of an anomaly. This approach ensures that the AE model effectively distinguishes between normal and anomalous conditions.

The training phase includes the following key parameters: Number of epochs: 120 (an epoch refers to one complete pass of the training dataset through the model), Iterations per cycle: 7 and Maximum number of iterations: 840 (total iterations conducted during training). During the training phase, the AE model effectively captures prominent features within the input data by focusing on areas with frequent signal peaks and distinct patterns. This capability enables the model to comprehensively learn the system’s operational behaviour and accurately replicate it during the reconstruction phase. The reconstruction error, measured using key evaluation metrics namely: Mean Absolute Error (MAE) and Root Mean Square Error (RMSE), serves as the primary performance indicator of the AE model.

MAE quantifies the average of the absolute differences between the predicted and actual values. A lower MAE value signifies improved performance in reconstructing normal operational signals. The baseline MAE is recorded at 13.60 and 13.1044 for 9 bus and IEEE 39 bus respectively. RMSE, on the other hand, measures the square root of the mean squared differences between predicted and actual values. As RMSE is more sensitive to larger errors, it provides a stricter evaluation of reconstruction performance. The baseline RMSE for the model stands at 0.6041 and 0.6719 for 9 bus and IEEE 39 bus respectively. These evaluation metrics are applied to both representative samples of normal operational data and new anomalous data samples. Figures 7 and 8 illustrate the MAE and RMSE values for representative samples (normal samples) and new samples (anomalous samples) 9 bus system and so Figs. 9 and 10 is for IEEE 39 bus system which effectively showcasing the model’s capability in distinguishing anomalies by comparing reconstructed outputs against the original inputs.

Fig. 7
figure 7

MAE and RMSE for Representative samples for 9-Bus System.

Fig. 8
figure 8

MAE and RMSE for New samples for 9-Bus System.

Fig. 9
figure 9

MAE and RMSE for Representative samples for IEEE-39 Bus System.

Fig. 10
figure 10

MAE and RMSE for New samples for IEEE-39 Bus System.

The signal reconstruction process represents the final stage of the AE model, where the model attempts to reconstruct the input signal from anomalous data. This stage is critical in assessing the model’s capability to differentiate between normal and anomalous data. The effectiveness of the AE model in reconstructing signals is demonstrated in Figs. 11 and 12 for a 9-bus system and in Fig. 13 for the IEEE 39-bus system. Figure 11 illustrates the comparison between the original and reconstructed signals for sequence 11, focusing on a dataset with small variations. In contrast, Fig. 12 presents sequence 14, highlighting large-scale data variations. Similarly, Fig. 13 showcases the original and reconstructed signals for sequence 3 within the proposed IEEE 39-bus system. These figures collectively indicate that the AE model can accurately reconstruct normal signals while identifying deviations when anomalies, such as FDIAs, are present. The primary objective of this study is to detect FDIA attacks using the AE model, where the reconstructed signal serves as an indicator of system integrity. By analyzing the differences between the original and reconstructed signals, the AE model can effectively identify and isolate anomalies, thereby enhancing the security and reliability of the power system.

The effectiveness of the model in detecting anomalies induced by FDIA is demonstrated in Figs. 14 and 15 for the 9-bus system and Fig. 16 for the IEEE 39-bus system. In these figures, anomalous data points are highlighted in red, showcasing deviations in critical system parameters such as conventional grid power output, solar PV power generation, and electricity prices within the VPP market. Figure 14 presents the anomaly detection results for small-scale datasets, while Fig. 15 offers insights into the detection of large-scale anomalies. In both cases, the red line distinctly marks anomalies, ensuring a clear differentiation between normal operational data and compromised data points. This visual distinction highlights the model’s capability to effectively identify and isolate anomalies, reinforcing its reliability in safeguarding power system operations against FDIA threats.

Fig. 11
figure 11

Sequence 11 showing the original and reconstructed signal for small data.

Fig. 12
figure 12

Sequence 14 showing the original and reconstructed signal for large data.

Fig. 13
figure 13

Sequence 3 showing the original and reconstructed signal for modified IEEE-39 bus System.

Fig. 14
figure 14

Anomaly detection for small data for 9-bus system.

Fig. 15
figure 15

Anomaly detection for large data for 9-bus system.

Fig. 16
figure 16

Anomaly detection for modified IEEE-39 Bus system.

Performance and discussion

The training and validation loss trends for the AE model are provided in Figs. 17, 18, 19, 20, 21 and 22. Figures 17 and 18 illustrates the RMSE progression during training and validation process for 9 bus and IEEE 39 bus system respectively, where initially, the RMSE is relatively high approx. 1.10, signifying notable discrepancies between the input and reconstructed data. However, as training progresses and iterations increase, the RMSE steadily declines and reaches to minimum value of approx. 0.4371, indicating the model’s ability to learn and adapt to normal operational conditions effectively. MAE during training and validation process has been presented in Figs. 19 and 20 for 9 bus and IEEE 39 bus system respectively. The starting value of MAE for 9-bus system is 0.7809 and after completion of training the value reduces to 0.2965, whereas for IEEE-39 bus system MAE started at 159.45, a very high value but gradually decreases to 10.06, which shows that the model can learn and adopt the system conditions. Figures 21 and 22 displays the loss during the training and validation phase for 9 bus and IEEE 39 bus system respectively, further supporting the model’s robustness. The value started from 1.2050 and rested at 0.2148 for 9-bus system and so for IEEE-39 bus the values are 1.2343 to 0.1853. The gradual reduction in validation loss confirms that the AE model consistently performs well, even under slightly abnormal conditions such as component outages. The loss function in this proposed model is Mean Square Error (MSE). Overall, the findings presented in this study highlight the AE model’s effectiveness in anomaly detection by analysing reconstruction error. The clear distinction between normal and anomalous data, as reflected in the MAE and RMSE metrics, validates the model’s precision. Moreover, the model’s capability to handle both small-scale and large-scale datasets underscores its potential for real-world applications within VPP systems. The AE model’s ability to accurately detect cyber-attacks on critical system parameters ensures the secure and reliable operation of VPPs. All these performance metric of this work during training and validation process of both proposed system is given in Table 3.

Fig. 17
figure 17

RSME during Training and Validation process 9-bus system.

Fig. 18
figure 18

RSME during Training and Validation process modified IEEE 39-bus system.

Fig. 19
figure 19

Loss during Training and Validation process for 9-bus system.

Fig. 20
figure 20

Loss during Training and Validation process for modified IEEE 39-bus system.

Fig. 21
figure 21

MAE for Training and Validation process for for 9-bus system.

Fig. 22
figure 22

MAE for Training and Validation process for modified IEEE 39-bus system.

Table 3 Comparision of loss, Rmse and Mae (this work).

The Table 3 shows the trends for loss, RMSE and MAE for proposed model during validation process. For both the 9-bus and IEEE 39-bus systems, the loss consistently decreases over iterations. Also RMSE and MAE show steady declines, indicating improved reconstruction accuracy. The most significant improvements occur in the first 300–400 iterations, after which the changes become more gradual. The IEEE 39-bus system shows a dramatic drop in MAE, suggesting that the model effectively learns to reconstruct signals despite the system’s complexity. The final values indicate the model has converged well, with only marginal improvements after 700 iterations. The graphical visualization for this comparison is given in Fig. 23.

The Table 4 presents a performance comparison of different machine learning models based on MAE and RMSE across various studies and datasets. From the table this can be concluded that traditional ML models such as Random Forest, MLP, and CNN from52 exhibit relatively low MAE and RMSE values, with the CNN-LSTM hybrid model achieving the best performance (MAE: 0.38, RMSE: 2.40). Study53 evaluates different regression models using the Subflow Bwd Byts feature. Linear Regression and SMOreg show competitive performance with low RMSE, whereas LSTM exhibits significantly higher errors (MAE: 31.99, RMSE: 35.04), indicating poor performance in this context. This work evaluates an unsupervised AE model on two different VPP system datasets (9-bus and IEEE 39-bus). The MAE values (13.65 and 13.10, respectively) are higher than other models, but the RMSE values (0.6041 and 0.6719) are among the lowest, suggesting that while absolute errors are higher, the overall model stability and consistency may be better. This work can be further extended for optimizing the value of MAE with some hybrid models.

Fig. 23
figure 23

Performance comparison for 9-bus and IEEE-39 bus system (a, b, c)

Table 4 Performance comparison with diffeernet algorithm.

Autoencoders are neural networks trained to reconstruct input data. They learn a compressed representation of normal system behavior, making them well-suited for anomaly detection. The algorithm learns complex patterns in high-dimensional data, can generalize well to unseen attack patterns and effective for nonlinear relationships in power systems. On the other hand AE requires a large amount of normal training data, sensitive to hyperparameter tuning and computationally expensive compared to simpler methods. Some of the traditional methods like State Estimation-Based Residual Analysis, Principal component Analysis (PCA), clustering based methods are also being proposed for anomaly detection. The basic comparison is given in Table 5.

Table 5 Comparison with traditional/relevant methods.

Therefore, Autoencoder-based methods show promise for FDIA detection, especially in nonlinear systems whereas Residual analysis remains effective but can be bypassed. PCA and clustering work well for structured data but struggle with stealthy attacks, and anomaly detection models (e.g., Isolation Forest, One-Class SVM) require careful tuning.

Impacts of cyber attacks

Cyber-attacks on VPP can have far-reaching consequences, affecting the reliability, security, and efficiency of energy systems. The affects can be in the form of financial losses, system reliability and stability, energy market disruption, impacts on consumer and prosumers, operations disruptions, energy security risks and may have long term impacts such as reduced in system efficiency and blackout. FDIA can manipulate bid prices and energy quantities, leading to unfair advantages or losses in energy markets, which comes under the scope of this work. There will be revenue loss as consequences of alterations in energy pricing or generation data can cause losses for VPP operators, prosumers, and energy traders.

In this work, FDIA particularly in the form of anomalies in VPP system has been analyzed for two critical aspects: (1) PV power and grid power, which are the bid quantities submitted by the generating sources, and (2) electricity price fluctuations. Cyber attackers can target the system with the aim of disrupting its reliability by significantly altering bid values to a level far beyond the defined bidding range. Such manipulations can result in major deviations in the LMP of the energy market, leading to a cascade of effects on the overall market performance. Alternatively, if the attackers’ primary goal is financial gain within the energy market, the variation in bid values will likely remain within the allowable limits of the bidding range. By subtly manipulating electricity prices within a narrow range of $14/kWh to $16/kWh, as shown in Figs. 24 and Table 6 a, attackers can achieve financial gains while remaining undetected by traditional monitoring systems. Although the average deviation from the actual electricity price is just 0.48%, such minor fluctuations can cumulatively lead to significant financial impacts over time. Moreover, generator outage data for similarly small variations, illustrated in Fig. 25 and sample data is provided in Table 6b, and demonstrate how even minimal disruptions can have cascading effects on market operations and grid stability. These findings highlight the need for advanced anomaly detection systems and proactive measures to mitigate the risks associated with such stealthy attacks, which, if left unaddressed, can erode market integrity and consumer trust. In the presented scenario, one of the generator units is non-operational, and the power generation from the remaining three units is fixed at 44 kW for a very short time interval, which deviates from the system’s normal operating conditions. As illustrated in the figure, only a single sample data point is shown, with the deviation in power generation kept within 4% of the original output. Even small fluctuations in power output can create ripple effects across the system, influencing load demand patterns, electricity pricing, and overall power supply dynamics. These variations can introduce operational challenges, such as frequency and voltage instability, which may impose additional tariffs on consumers or lead to revenue losses for service providers. Strengthening cyber security frameworks can help safeguard critical energy infrastructure against sophisticated cyber threats and maintain consumer trust in VPP operations.

Root cause analysis of cyber-attacks is critical for the smooth and reliable operation of the energy market. Identifying the source of disruptions allows operators to implement the appropriate corrective measures. However, if the issue is identified as a cyber-attack, immediate action is required to prevent it from impacting the overall performance of the system. One effective measure to counter cyber intrusions is the implementation of packet filtering mechanisms. These can block unauthorized access by filtering network packets associated with specific IP addresses in the system, thereby mitigating potential cyber threats. Such solutions are crucial for maintaining system integrity. Any cyber-attack targeting prosumers demands special attention and more detailed analysis. Prosumers are essential to the bidirectional flow of energy and information, making them particularly vulnerable and critical in ensuring the stability of the VPP system.

While this work focuses on FDIA affecting the VPP system as a whole, it does not specifically analyses cyber intrusions targeting individual consumers or prosumers. This represents an important area for future research. Exploring the implications of cyber-attacks on prosumers and their role in VPP systems will enhance the understanding of vulnerabilities and inform the development of more comprehensive cyber security strategies. Detecting cyber intrusions in the VPP system remains a crucial challenge for ensuring safe, secure, and dependable operations. It is essential to maintain the CIA triad—Confidentiality, Integrity, and Availability—to secure the energy market against cyber threats and ensure the resilience of modern power systems. By successfully reconstructing normal data and identifying anomalies with minimal error, the proposed AE model proves to be a robust tool for detecting cyber intrusions in VPP systems. This approach highlights the importance of leveraging advanced ML techniques to enhance the security and resilience of modern power systems.

Fig. 24
figure 24

False data injection attack on Electricity price within the limits.

Table 6 Sample data for false data in a) electricity price and b) generator outage
Fig. 25
figure 25

Sample for one generator outage for small range.

Limitation and future work

The proposed model has certain shortcomings that point to potential directions for future research, notwithstanding the advancements and successes of this study. For instance, the model works well on some datasets but have trouble with time-series data that has a lot of noise. Furthermore, it lacks flexibility in how it handles time slice durations. Although the performance of the model is evaluated by MAE and RMSE, this can be further extended to a complete set of evaluation metrics with binary variable as: recall, precision, confusion matrix, F1-score and accuracy. The limitation and future work of this study can be highlighted as:

  • Feature extraction: The feature from the attack scenario and component outage has been considered to attack condition. So the algorithm can be further exploited for extracting these system features.

  • Evaluation metric: A logistic regression classification can be used for time series evaluation and can extend the performance metric with accuracy, precision and F1-score for helping to assess its predictive effectiveness.

  • Hybrid ML models: This work can be further extended to increase the model effectiveness, accuracy and to reduce the errors by integrated with other ML model like CNN or LSTM. By adopting a hybrid approach, the strengths of traditional machine learning models and deep learning architectures can be leveraged to enhance predictive performance and minimize errors in time series classification tasks.

Conclusions

In this work, an unsupervised Autoencoder machine learning approach has been presented to detect network-based cyber-attacks in the VPP system. The VPP system was developed and simulated in MATLAB, and the proposed detection model was implemented and investigated within the same environment. This approach focuses on detecting FDIA, particularly the alteration of bid quantities and electricity prices, which are critical to the operation and reliability of the VPP system. Two cases have been taken namely, 9 bus system and IEEE-39 bus system. The output power of the Solar Photovoltaic system and conventional grid power are taken as the bidding quantities of the VPP system. These quantities represent the energy supply offered to the market, making them key targets for potential cyber-attacks. The AE model successfully detected various attack scenarios, including: manipulation of bidding quantities grid power and PV power and false data injection in electricity prices in the energy market. The model employs a low-dimensional hidden layer in the AE architecture, where the decoder reconstructs the output layer from the encoded representations, preserving critical information while reducing complexity. The AE model demonstrates its capability to detect anomalies in time-series data, which is essential for identifying patterns and trends in dynamic systems like VPPs. The developed AE model is versatile and can be extended to handle various anomalies, ensuring scalability for more complex VPP systems. The detection model reliably identified cyber-attacks with high accuracy and low reconstruction error. The model’s performance metrics, Mean Absolute Error and Root Mean Square Error, confirmed its robustness in detecting anomalies while maintaining computational efficiency. There are opportunities for further development such as; the current methodology can be applied to larger, more complex VPP systems with additional components such as multiple energy storage units, wind turbines, and dynamic load conditions. In addition to anomaly detection, future research can focus on root-cause analysis to identify the source of cyber-attacks, enabling quicker mitigation and recovery. Future research and development in this area can significantly contribute to building more effective, reliable, and cyber-secure energy markets.