Modeling and Detection of Future Cyber-Enabled DSM Data Attacks using Supervised Learning
Kostas Hatalis Parv Venkitasubramaniam Shalinee Kishore

































































Modeling and Detection of Future Cyber-Enabled DSM Data Attacks using Supervised Learning
    Kostas Hatalis, Student Member, IEEE,
        Parv Venkitasubramaniam, Member, IEEE,
        and Shalinee Kishore, Member, IEEE
        
K. Hatalis, P. Venkitasubramaniam and S. Kishore are with the Department
	of Electrical and Computer Engineering, Lehigh University, Bethlehem,
	PA, 18015, USA (e-mails: (kmh511,pav309,shk2)@lehigh.edu).


    December 30, 2023
==========================================================================================================================================================================================================================================================================================================================================================






Demand-side management (DSM) is a vital tool that can be used to ensure power system reliability and stability. In future smart grids, certain portions of a customers load usage could be under automatic control with a cyber-enabled DSM program which selectively schedules loads as a function of electricity prices to improve power balance and grid stability. In such a future, security of DSM cyberinfrastructure will be critical as advanced metering infrastructure, and communication systems are susceptible to hacking, cyber attacks. Such attacks, in the form of data injection, can manipulate customer load profiles and cause metering chaos and energy losses in the grid. These attacks are also exacerbated by the feedback mechanism between load management on the consumer side and dynamic price schemes by independent system operators. This work provides a novel methodology for modeling and simulating the nonlinear relationship between load management and real-time pricing. We then investigate the behavior of such feedback loop under intentional cyber attacks using our feedback model. We simulate and examine load-price data under different levels of DSM participation with three types of additive attacks: ramp, sudden, and point attacks. We applied change point and supervised learning methods for detection of DSM attacks. Results conclude that higher amounts of DSM participation can exacerbate attacks but also lead to better detection of such attacks, point attacks are the hardest to detect, and supervised learning methods produce results on par or better than sequential detectors.




Demand Side Management, Cyber-Physical Systems, Dynamic Pricing, Load Forecasting, Attack Modeling, Detection, Machine Learning






§ INTRODUCTION


Demand Side Management (DSM) is an essential component in smart grids for planning, monitoring, and modification of consumer load levels. Furthermore, future cyber-enabled DSM will allow smart grids even higher levels of automated decision-making capabilities to selectively schedule loads on local grids to improve power balance and grid stability. Such a cyber approach relies heavily on real-time, two-way communication capabilities between a central controller and various adaptable loads. Research into security and reliability of the cyberinfrastructure that enables DSM is therefore vital. The main concerns in ensuring DSM security and safety lay in the feedback mechanism of real-time electricity pricing and distributed DSM controllable loads. Particularly in residential grids, each load contributes only a small amount of power and its compromising might not cause a noticeable impact on the power grid. However, a carefully planned or even chaotic cyber attack might impact other loads not under attack or not under DSM control by taking advantage of the feedback mechanism of load management. 

Two-way communication capabilities of advanced metering infrastructure (AMI) enables a utility or independent system operator (ISO), in the retail power markets, to collect high-resolution energy usage from consumers and enable dynamic pricing to adapt to consumer demand <cit.>. Thus, AMIs provide an efficient way for ISOs to schedule prices and to then communicate those prices to consumers for automatic DSM control of certain portions of a load. AMIs can also provide practical ways for ISOs to set DSM goals such reducing peak or decreasing aggregate load levels through price influences. However, there are several vulnerabilities in AMIs that present noteworthy security issues since they are directly accessible by users <cit.>. Additionally, due to the large scale deployments of AMIs, ISOs encourage the utilization of marginally cheaper hardware which results in constrained computational resources to allow for robust security capacities, for example, intrusion monitoring. 

DSM programs utilize demand response, which is a specific tariff or program to motivate customers to respond to changes in price or availability of electricity over time by altering their regular electricity use habits. We take this a step further and look at future cyber-enabled DSM programs <cit.> that will be able to autonomously control household loads such as water heaters and HVAC units based on RTP. As part of the reliable implementation of this future cyber-DSM, it is crucial to be able to understand the dependency between dynamic pricing and automatic demand response as well as the risks. We hypothesize that Cyber-DSM programs can be particularly vulnerable to cyber attacks such as false pricing information or direct load manipulation, especially when the participation rate in DSM is high. 

Our work is thus motivated to study this vulnerability in DSM. We provide a mathematical formulation of the feedback between utilities and DSM systems, and then simulate, analyze, and test different detection methods for attacks on such feedback. This relationship between load and price is shown visually in Fig. <ref>. As prices go up, demand naturally responds by decreasing. However, if AMIs are hijacked, and false lower prices are reported to DSM systems, then there will be an inappropriate increase in demand. A similar effect happens if an attacker directly controls user loads. Then a higher load usage by the attacker may inadvertently lead to higher prices for the rest of the grid. We present a standard of how attackers can exploit such a dependency. We propose a mathematical framework of the feedback between price setting and DSM systems to study how attacks can be structured and how to detect them. The main contributions of our approach can be summarized as follows:


	
  * We formalizing the price to load relationship using an elastic demand model to achieve DSM goals.We simulate load and pricing data in a DSM system; in particular under a strategic conservation scheme as an example of a DSM goal.
	
  * We propose two modes of attacks on DSM systems: false pricing data injection and direct load manipulation. We prove their equivalence and highlight three types of attacks that could be undertaken by each mode. We then empirically show how a high use of DSM can exacerbate attacks.
	
  * We simulate these attacks and review sequential change-point and machine learning methods for detecting DSM attacks. In our main results, we demonstrate the impact of DSM on detection performance and identify what kind of detectors are effective for different attacks.


In section <ref> we provide a literature review on DSM, and important DSM strategies real-time pricing and load forecasting. In section <ref> we apply the block bootstrap technique for simulating the non-DSM load distribution of a micro-grid of N homes from template residential load time series. Dependency models for the feedback nature of load and prices are proposed in section <ref> where we showcase simulations of residential load and electricity prices when an automatic DSM program controls certain portions of consumer demand as a function of price. In section <ref> we present two modes of cyber attacks, direct load manipulation attacks and price data injection attacks that can have a significant influence on the feedback of load and price. We prove these two attacks are equivalent. We conclude in section <ref> with possible directions of future work.





§ BACKGROUND
 

There are multiple strategies to accomplish DSM like load forecasting and real-time pricing which are used for load management on in-home energy management systems. So before introducing our models on the relationship between price setting and demand response by cyber DSM systems, it is crucial to review foundational material on DSM. In this section, we provide a brief overview of DSM goals and approaches, real-time pricing, and load forecasting. We also review different pricing simulation schemes which will play a role in modeling RTP.



 §.§ Demand Side Management


DSM is an active and voluntary approach for reducing electricity use through activities or programs that promote electric energy efficiency, conservation, or more efficient management of electric energy loads <cit.>. Very often financial incentives and educational programs are used to modify consumer demand. More specifically, the main goals of DSM are peak clipping, valley filling, load shifting, strategic load growth, flexible load shaping, and strategic conservation. These goals are summarized in Fig. <ref>. In these goals, consumers are encouraged to use less energy during peak hours, or to move the time of energy use to off-peak times such as nighttime, or reduce overall consumption. Other applications for DSM is to aid grid operators in balancing intermittent generation from wind and solar farms due to their volatility nature which may not coincide with energy demand at different times of the day.

In our study, we focus on modeling and simulating the DSM goal of strategic conservation, due to its simplicity and essential use in the smart grid. This goal also makes it easier to study attacks on DSM by modeling strategic conservation as a general reduction in load. Attacks then could stand out more versus goals like flexible load shaping. More specifically, this DSM goal aims at reducing aggregate load demand through directed reduction of electricity consumption. The successful implementation of strategic conservation programs usually requires some combination of financial incentives to customers, the promotion of energy-efficient building standards, and appliance efficiency improvement. Strategic conservation also requires a more excellent knowledge on the part of the utility concerning customer behavior. We envision in the future that AMI and smart appliances in residential DSM programs will automatically control specific portions of consumer load as a function of real-time electricity prices to achieve the goal of strategic conservation.

Most DSM programs are formulated as an optimization problem as follows

    min_P_t∑_t=1^T (L_t - L_t')^2,


where P_t is RTP at time t, L_t is actual load, and L_t' is the target load level the ISO is interested in achieving via DSM. The aim is to choose a price P_t for each time step such that the actual load would reach as close as possible to the target level. In <cit.>, a DSM strategy was proposed based on heuristic optimization to shape the load curve close to the desired shape. A  heuristic-based evolutionary algorithm was used to solve the above minimization problem. A multi-agent game theoretical DSM approach is proposed in <cit.>. The authors use game theory and formulate an energy consumption scheduling game, where the players are the users, and their strategies are the daily schedules of their household appliances and loads. In <cit.>, the minimization problem is solved by utilizing a feedforward neural network to map the nonlinear relationship between price and load. Recently, the DSM problem is addressed in <cit.> as a multi-objective optimization problem that also seeks to balance other merit functions such as energy production cost, costumer’s preferences, and other constraints. 





 §.§ Load Forecasting
 

Load forecasting (LF) techniques are an essential component for RTP and other ISO operations by predicting future energy requirements of a system from previous data and weather conditions. It is recognized as the initial building block of utility planning efforts and ensures the balance between supply and demand of energy, LF thus plays a vital role in our DSM formulations. For a given system and requirements, LF provides predictions for specific periods. These periods are divided into short, medium, and long term forecasts. Short term LF is used to predict load on an hourly basis up to 1 week for daily operations and cost minimization. Medium-term LF typically predicts load on weekly, monthly, or yearly basis for efficient operational preparations. Long term LF is used to predict load up decades ahead to facilitate grid and generation expansion planning. In this work, we look at short term LF on the resolution of one hour up to a week.

LF models can be divided into two approaches <cit.>, the first being statistical based modeling and the second being machine learning. The statistical approach can be further broken down into regression and time series models. Multiple linear regression can be used with the weighted least squares estimation technique to form a relationship between different independent covariates that load depends on such as weather conditions. Regression models have been applied in LF in different works such as in <cit.>. Time series models are also prevalent to apply to LF. The most common model is the autoregressive moving average (ARMA) model and its variants that include components such as integration (I), fractional integration (FI), multivariate series (V), seasonality (S), exogenous (X) data, conditional heteroskedasticity (CH), and nonlinearity (N). For our formulation, we employ SARIMA for LF.

Hyperparameters of ARMA models can be solved using Box-Jenkins decomposition or grid search with an Akaike information criterion. Various studies have looked at all the different ARMA models for LF <cit.>. Other time series methods for LF include simple exponential smoothing <cit.> and the Holt-Winters seasonal method <cit.>. Time series analysis and regression analysis share many models and ideas, but they are theoretically different. Time series analysis first deals with time indexed stationary data and account for the autocorrelation between time events. In regression we assume there is no autocorrelation, and that all observations are independent and identically distributed. Furthermore, we also assume in regression the data is homeostatic and does not exhibit multicollinearity.

Most recently, machine learning methods have seen a huge spike in LF research. Machine learning models are data-driven, typically providing a nonlinear fit to input covariate data to predict load. Advantages of this approach include not needing preconditions for data such as stationarity (a requirement for most time series methods), excels at modeling nonlinear dependences, and can fit large data sets. Disadvantages for most machine learning models are that most hyperparameters are continuous (difficult to tune), they require extensive feature engineer, and may get stuck in local minimums. Models for LF include support vector machines <cit.>, feedforward neural networks <cit.>, recurrent neural networks <cit.>, random forests <cit.>, and ensemble learning <cit.>.       

In all the various LF approaches, benchmarks are required to compare the prediction performance of our models. The most common benchmarks are the naive persistence and seasonal methods. In the naive persistence method a prediction of the load for time t is equal to the value from the previous time step t-1 and in the seasonal persistence method a prediction of the load for time t is equal the same hourly value from the previous day t-24.



 §.§ Real Time Pricing


Every consumer of electricity is charged with a certain amount per kilowatt hour (kWh) of energy. Such a charge is done to cover the costs associated with the generation, transmission, and distribution of electricity. The two main types of costs are operational and fixed costs. During the 20th century, tariffs have been used to recover costs. Lately, clever pricing schemes have been developed to meet the requirements of modern power systems <cit.>, such as, real-time pricing (RTP) where consumers are charged with a price nearest to the real price of generation at a specific interval in time. RTP plays an integral part in time-based DSM programs that makes consumers choose the time of consumption of power as a response to prices <cit.>. Cyber-enabled DSM programs are an automated form of time-based DSM programs. 

There are two types of RTP schemes, hourly pricing and day ahead pricing. In the first type, the price of electricity is released on an hourly basis for the next hour. In day ahead pricing, prices are announced for the next 24 hours based on predicting the load demand and the cost of generation. RTP signals combined with DSM automation at the consumer level provides benefits to both consumers and utility. A properly designed RTP scheme increases the reliability of the grid, reduces associated costs with generation, and lowers electricity bills of consumers. Further review of RTP and other dynamic pricing schemes can be found in <cit.>.
























§ MICROGRID SIMULATION
  

Before modeling the load-price dependency of a DSM system, we need first to obtain some ground truth data of what load data from a residential micro-grid looks like without the presence of DSM, where we assume the elasticity of demand to price is very low. To do this, we use the power time series from several homes as templates for our grid and then generate artificial N household datasets. There are several ways to generate artificially residential load data, such as by using power grid simulators such as MATPOWER <cit.> or GridLAB-D <cit.>. Our object is to create a model free real-data driven alternative to grid simulators. We are able to generate unlimited but plausible univariate load data to serve as the base demand for sample households before the application of a DSM system. 



 §.§ Data Source


We use the UMass Smart* <cit.> dataset, 2017 release, for the simulation of micro-grid load time series. The Smart* project built a data collection infrastructure that records data from a variety of sensors deployed in real homes. Their infrastructure supports both pulling data by querying individual sensors and pushing data from sensors to a gateway server, which ran on their software tools. The 2017 Home dataset release is comprised of electrical power readings from seven homes from 2014 to 2016 at a minute resolution. It includes readings from individual appliance sensors as well as total power usage of each home. We chose to use these seven datasets as template homes in simulating the power usage of a micro-grid due to the breadth of the data collected. For DSM attack research, these datasets can help model an attacker compromising individual appliances. 

For each home the power consumption is given in kW for every minute. We convert this time series to kWh with a resolution of one hour which is common for smart meter readings and real time price modeling <cit.>. We do this by obtaining the average power consumption within an hour and multiplying it by the time period as such

    E_(kWh) = t_(hr)×1/60∑_i=1^60 P_(kW)^i




 §.§ Block Bootstrap Simulation
 

In the generation of new time series from sample data, several approaches can be applied depending on the statistical properties of the series. Data that is stationary can be modeled and generated using an ARMA process <cit.>. An ARMA model is fitted to the data, and then future data is sampled from the ARMA distribution. If there is no serial correlation, then the distribution of some sample data can be modeled using Markov Chain Monte Carlo <cit.>, and new data can be sampled from this estimated distribution. However, in the case that data exhibited autocorrelation and non-stationarity in the presence of a periodic seasonal pattern, then a natural choice is to use the block bootstrap method <cit.>.

Bootstrap is used in simulation statistics for estimating the distribution of a statistic such as mean or variance. This is particularly useful when there is no analytical form to estimate the density of our underlying statistics. A bootstrap analysis is conducted by using the Monte Carlo algorithms with replacement. Data is sampled with replacement until a new set is formed and then statistics are calculated from that new set. The process can be repeated to get a more precise estimate of the Bootstrap distribution and to form confidence intervals for those statistics. The block bootstrap is used when the data, or the errors in a model, are correlated. The block bootstrap attempts to replicate the serial correlation by resampling blocks of data instead of individual observations. This is why the block bootstrap is used primarily with correlated time series. In block bootstrap, blocks sampled can overlap or be non-overlapping. For load time series simulation we use block bootstrap with non-overlapping blocks to preserve the daily seasonal pattern of power consumption. The process of block bootstrap simulation of a new home power usage from a template home is shown in Fig. <ref>.





§ DEPENDENCY MODEL
 



 §.§ Modeling Elastic Demand


For analyzing the feedback dependency between load and price in a DSM setting it is first required to define a supply and demand relationship of electricity. To do so we utilize the well known measure in economics, the Price Elasticity of Demand (PED) <cit.> which can be given by

    ϵ_d = dL/dP·P/L.


PED shows the responsiveness of the Load (L) demanded of electricity to a change in its Price (P). An absolute value of PED = 1 shows unitary elasticity.  For instance, when  ϵ_d = -1 then a 1% change in the price will have a 1% change in the load demanded. As prices increase, load will decrease. When absolute PED falls between 0 and 1, this signifies that the demand for load is inelastic, while a value greater then 1 says that the demand is elastic. When   |ϵ_d| = 0 the demand is perfectly inelastic. A change in price has no affect on the load. While  ϵ_d = ∞ represents perfect elasticity. If ϵ_d is constant the whole demand curve then,

    1/L dL    = ϵ_d 1/P dP 
    ∫1/L dL    = ϵ_d ∫1/P dP 
    ln (L)    = ϵ_d ln (P) + c 
    
    e^ln (L)   =e^ϵ_d ln (P) + c
    
    L    = e^ϵ_d ln (P)· e^c
    
    L    = ( e^ln (P))^ϵ_d · e^c
    
    L    = P^ϵ_d· e^c
    substitute  a    = e^c
    ⇒ L    = a · P^ϵ_d


where a is a scaling constant. An example demand curve estimated from Eq. <ref> can be seen in Fig. <ref>. The figure also showcases the nonlinear relationship between load and price where as the price, the independent variable, increases the load demanded, the dependent variable, decreases. 





 §.§ Modeling Consumer DSM


In modeling the relationship between load and price under a DSM program, it is important to define the individual loads of each customer in determining aggregate load. For a customer who does not participate in a DSM program their load is determined by the stochastic demand process of users actions such as watching tv, using the AC, etc. Demand is impacted by multiple factors such as user preferences, weather, and time of day. In this process, electricity prices have a small influence on demand - individual customer demand is fairly inelastic to price. Following the derivation in Eq. <ref> we define the load usage of an individual customer i for time t as 

    ϕ_t,i = θ_t,i (P_t+P_c)^ϵ^d_t,i,


where P_t is the RTP for time t, P_c is constant of the retailer's market costs which does not vary with RTP, θ_t,i≥ 0 is a scaling factor representing the stochastic process that determines the user load, and ϵ^d_t,i is the elasticity coefficient for the individual customers sensitivity to price changes. It can vary over time but without DSM incentives most users have a fairly inelastic PED. 

For experimental purposes, in modeling individual user loads we set ϕ_t,i equal to simulated bootstrapped user load profiles defined in Section <ref>. We assume that prices, user preferences θ_t,i, and ϵ^d_t,i have been absorbed in the calculation of the simulated load series. Thus we use ϕ_t,i as a reference point to how much electricity  a user wants to consume without the influence of a DSM program. We model the task of the ISO as modifying ϕ_t,i to some desired load levels.

The goal of DSM is to motivate the consumer to use less energy typically during peak hours. A DSM program could have a number of goals all aimed at reducing load usage. These may be peak clipping where peak load is reduced, load shifting where times of higher load are reduced and times of low load are increased, and many more strategies. There are multiple ways a DSM program can achieve these goals such as financial incentives, education, and regulation. In this work we look at the near term future where in a home with a smart meter and smart appliances, users can participate in a DSM program that automatically adjusts the load of interconnected appliances (such as the water heater) as a function of price and a DSM elasticity term that determines how fast or slow a users load under DSM control. 

Realistically, only a certain portion κ_t,i∈ [0,1) of customer i's power usage will be under control of a cyber DSM program. There will always be some stochastic component of power usage such as using a microwave oven or electric hairdryer. An ISO can signal a users DSM program by setting prices where smart appliances adopt to price changes with certain elasticity. We do no model direct load control. If prices are set too high it will signal the DSM component of a users demand to start using less load. If prices are set low then it signals the DSM program to increase load usage. We model this DSM component as such 

    l_t,i = (κ_t,iϕ_t,i) P_t^ϵ^dsm_t,i + (1-κ_t,i) ϕ_t,i ,


where the first part (κ_t,iϕ_t,i) P_t^ϵ^dsm_t,i is the load level customer i allows the DSM program to determine as a function of price P_t and the DSM's elasticity to price ϵ^dsm_t,i. Price elasticity of DSM ϵ^dsm_t,i may very over time and customer and affects how much power usage should be affected by price. The second portion (1-κ_t,i) ϕ_t,i of a customers load is the stochastic component. The DSM portion parameter κ_t,i is defined as a function of time where users can add or remove house loads under DSM control over time.  The term κ_t,i can be modeled as a random variable (e.g. Uniform or Gaussian) or as a fixed constant for users. Once each individual customers load has been determined then total load (modified by a cyber-DSM program) for time t for N customers is calculated by 

    L_t = ∑_i=1^N l_t,i.


We also define the aggregate base load as 

    Φ_t = ∑_i=1^Nϕ_t,i,


which represents the total demand had there not been a DSM program for a time period t (ie κ_t,i=0, ∀_i).



 §.§ Modeling DSM Goals


The ISO has different DSM goals for reducing a customers load profile as mentioned before these goals can be to reduce peak load or increase load in periods of low demand. Two ways for a DSM program to control load are to make it a function of electricity prices or for an ISO to directly control a homes energy usage by programming its smart appliance. The effects of this feedback control approach can also be seen in Fig. <ref>. Given the privacy issues of having an ISO directly control a homes energy usage, we model the indirect approach of achieving DSM goals through setting electricity prices. 

We introduce an approach how an ISO can set RTP, on an hourly basis, as a function of aggregate load to achieve a desired load level L'_t. The approach takes as input a forecast Φ̂_t of the base aggregate load to calculate price P_t. This prediction can be defined as 

    Φ̂_t = f_pred( Φ_t-k:t-1, P_t-k:t-1, X ),


where inputs to the prediction model are past base load Φ and price P values from time t-k to t-1, and other predictor variables X such as time-of-day and weather information. Various types of prediction models can be used for f_pred such as neural networks as reviewed in section <ref>. We now define RTP based on the formulation in Eq. <ref> as such

    P_t    = ( L^*/Φ̂_t)^1/ϵ̂^dsm.


Where,

    Goal 1:  L^*   = L'_t
    Goal 2:  L^*   = L'_t +(L'_t-1-L_t-1)
    .


The component L^* adjusts the RTP based on two goals the ISO may have. The first goal is to adjust the price to push power usage directly to the target level L'_t with the assumption that there is near 100% DSM participation by all customers. The expectation is that if demand for time t is Φ̂_t, then a price point is set to push load usage to L'_t. Of course,if participation is less then 100%, which is more likely, then the target level L'_t will not be reached by P_t. So, to push the aggregate load, from all users, as close as possible to the target load level, with an unknown amount of participation, then a penalty would need to be added to P_t. We model this as Goal 2 where the idea is to affect the power usage of those under cyber-DSM control even more than goal 1 to compensate for users who are not participating in DSM. 

Some users will not be participating, or only have a small portion of their power usage under control by the cyber-DSM program. We model their remaining power usage as inelastic to RTP. Thus, to push aggregate load to a target level, taking into account some load usage is inelastic, we need to push RTP much higher or lower to have a bigger effect in pushing DSM controlled load closer to the target load. This is what Goal 2 attempts to do, with the component L^*= L'_t+(L'_t-1-L_t-1) taking the target load level for time t and adding the difference from the previous target load L'_t-1 and realized load L_t-1 as a penalty to adjust RTP to compensate for the difference. If L^* < 0 then we set L^* = 10 or to some arbitrary small target value. By subtracting the difference between the previous load and target level, we make up for users not participating in DSM by forcing DSM users a higher price to push their load even lower.

The term ϵ̂^dsm in Eq. <ref> is an estimate of the price elasticity of DSM of the whole grid; if individual user coefficients ϵ^dsm_t,i are unknown then ϵ̂^dsm can be estimated from observing past values of price and load under different levels of DSM control. Alternatively, the ISO can define ϵ^dsm for all household cyber DSM programs. The formulation in Eq. <ref> sets prices by comparing the adjusted target load for time t to the forecasted base demand Φ̂_t for the same time. This demand Φ̂_t would be the level if no load was under DSM influence, thus to influence and alter it, Φ_t needs to be estimated as accurate as possible.

In our approach, if the aggregate load is above the target load, RTP is set higher to decrease demand. If the aggregate load is lower than the target load, then the price is decreased to increase demand. Thus, as also can be observed, in Eq. <ref>, there is direct feedback between price and load Eq. <ref>. The block diagram in Fig. <ref>  also outlines this feedback that showcases the relationship between the utility and grid. Generation sets the target load based, on the price and supply of power, and the controller sets the price signal and the elasticity of demand coefficient for DSM systems.  The price is then fed into the grid into DSM systems which adjust load usage appropriately. The bold red lines in  Fig. <ref> highlight the feedback relationship between price and demand. The scope of work is in the mathematical modeling of the controller and DSM system relationship. With such a model we present in the next section how attackers can exploit it.












 §.§ Simulation Parameters and Assumptions


For experimental purposes, in modeling individual user loads we set ϕ_t,i equal to simulated bootstrapped user load profiles defined in Section <ref>. We assume that prices, user preferences θ_t,i, and ϵ^d_t,i have been absorbed in the calculation of the simulated load series. Thus we use ϕ_t,i as a reference point to how much electricity a user wants to consume without the influence of a DSM program. We model the task of the ISO as modifying ϕ_t,i to some desired load levels. Furthermore, we include the following assumptions in our modeling and simulation. We assume the ISO can define ϵ^dsm for each household and we set it as a constant for all customers and time. For additional simplicity, we model κ_i also invariant in time, but it may vary per customer. Lastly, through AMI, we assume ISO the can obtain an estimated reading of Φ_t-1 but not of individual user ϕ_t-1,i to preserve privacy. This way the ISO has a time series of estimated non-DSM load demand in order to provide predictions Φ̂_t.

For all case studies in the rest of our paper, we use the UMass Smart* dataset (2017 release) to bootstrap simulate residential load as described in Section <ref>. We simulate a micro-grid of N = 200 residential homes for a time period of T to obtain a phi distribution that defines a base load profile for each home i at each time t. We set the DSM demand elasticity for each user to ϵ^dsm = -1, ∀_i to allow the DSM component of customer load to be sensitive enough to price changes. For all case studies we set a simple flat target load of L_target = 200 kWh. We note, however, that with our pricing formulation in Eq. <ref> we can model any DSM goal from peak load reduction to flexible load shaping. These simulation parameters are summarized in Table <ref>. For forecasting Φ̂_t we use the naive persistence prediction method.

In Figures <ref> and <ref> we demonstrate a price-load feedback simulation for a period of T = 48 hrs under Goals 1 and 2 with parameters defined in Table <ref>. Under the Goal 1 scenario when κ_i = 0, ∀_i, shown in Fig. <ref>(a), we see that prices range from $0.01 to $0.03 per kWh. As expected with no DSM program to influence demand, the observed load is equal to the base load. The same is observed in Fig. <ref>(a) when the simulation is run with the Goal 2 RTP model. The only difference under this scenario is the price range which is exceptionally high ranging from $0.01 to $0.6 per kWh. This is expected in this scenario since the ISO is attempting to set prices to maximize the effect on DSM customers, which there are none, but this is unknown to the utility. With no DSM the mean observed load is 332 kWh.

Next, we rerun the simulation setting κ_i = 0.5, ∀_i. In the Goal 1 scenario in Fig. <ref>(b) we see that the base load was reduced with a mean observed load of 269 kWh. In Fig. <ref>(b) the same simulation is run with Goal 2. Here the mean observed load was further reduced to 246 kWh, but large price spikes occur at peak load times. Finally, we run simulations for κ_i = 0.99, ∀_i to study the effects of high penetration of DSM. In simulating both goals, shown in Figures <ref>(c) and <ref>(c), the mean observed load is reduced to 208 kWh, which is very close to the target load. However, in Goal 2 we see great resonating feedback affect occur when prices spike very high. RTP increases as a response to large values in observed load. Then when load decreases to low levels prices decrease cause load to spike more during the next time step. While under Goal 1 this is not observed. The higher prices set in Goal 2 would see a large cost to DSM participating customers. 

























































§ DSM ATTACK MODELS
 

An attacker can exploit the feedback between the customer and utility in determining RTP and load usage by cyber DSM programs by injecting false price or corrupted load data into the feedback loop. The attack exploitations we study here are different from the false data injection attacks studied in other smart grid papers. Most false data injection attack works <cit.> study the compromise in energy management systems to alter power state estimates by the utility operator. In our case, we study attacks that aim to alter a users load profile by exploiting cyber DSM vulnerabilities. 

For modeling attacks on a cyber DSM managed micro-grid we assume that the attacker compromises a subset of all the N customers, we denote this subset as 𝒜, for an attack period t ∈ T_a. We study two modes of attacks: false pricing data injection attacks in which a compromised user receives manipulated pricing information, and a direct load manipulation attack in which the appliances of the compromised customer are under the control of the attacker. When communication encryption is broken with an AMI, then a pricing data injection attack can occur. By hacking into a cyber DSM load controller, or directly hacking into smart appliances, then a direct load manipulation can occur by altering a users load profile. The two modes of attacks are outlined below.


	
  * False Pricing Data Injection: The attacker can manipulate prices P_t received by each compromised costumer i ∈𝒜, and the received price P_t^i can be different for various customers in order to achieve the attacker's desired effect:
	
    P_t,i^a = P_t,i + a_t,i^P, ∀_i ∈𝒜, t ∈ T_a

	This has the affect of compromising the demand response of a customer in the following way:
	
    l_t,i^a^P = (κ_i ϕ_t,i) (a_t,i^P)^ϵ^dsm + (1-κ_i) ϕ_t,i

	
  * Direct Load Manipulation: The attacker can manipulate the load of each compromised customer l_t,i, i ∈ D directly:
	
    l_t,i^a^L = l_t,i + a_t,i^L, ∀_i ∈𝒜, t ∈ T_a

	Under both attack modes, we would get a compromised aggregate load which may include one or both attacks occurring simultaneously
	
    L_t^a = ∑_i=1^N l_t,i^a^P + l_t,i^a^L.



These two modes of attack are equivalent as they both affect a customers load response as long a part of the load is under cyber DSM control that is sensitive to price changes.

Theorem 1. Given a set of customers 𝒜 compromised by the attacker, there always exist a direct load manipulation attack such that all customers behave the same as a pricing data injection attack and vice versa for κ_i > 0, ∀_i, t ∈ T_a.


	Setting both attacks to have the same load, then the attack load is set as follows
	
    a_t,i^L = (κ_i ϕ_t,i) (a_t,i^P)^ϵ^dsm + (1-κ_i) ϕ_t,i,

	and the equivalent attacked price is
	
    a_t,i^P = ( a_t,i^L-(1-κ_i) ϕ_t,i/κ_i ϕ_t,i)^1/ϵ^dsm

	If  κ_i = 0 then the two attack modes are not equivalent since a price attack will have no affect on customer load.


Since false pricing data injection and direct load manipulation attacks are equivalent, we focus only on direct load manipulation attack analysis. 

There are different goals an attacker can have to harm the power grid or exploit it. For example, an attacker can cause chaotic metering by messing the metering data transmission, efficiency loss of the energy provided by causing greater load volatility, or the energy system failure by overloading the power lines or devices. The focus of this work is efficiency loss by increasing user loads through direct load manipulation. In this scenario, we introduce three possible types of load attacks. A ramp attack, sudden attack, and point attack. These type of attacks are shown in Fig. <ref> wherein plot (a) an attacker gradually increases a users load over time. In plot (b) an attacker suddenly ramps up the power usage to a specified level, and in plot (c) we demonstrate a point attack where the attacker increases loads only for specific hours.







§ ATTACK DETECTION


Here we outline sequential and supervised learning-based methods for attack detection. The sequential detections methods are the one-sided cumulative sum (CUSUM) test <cit.> and windowed generalized likelihood ratio test (GLRT) <cit.>. Both these methods take as an input a residual time series that is the output of applying a SARIMA filter to load observations. If enough past observations of load data that is labeled as nominal or under attack are collected, then detection of attacks can be made by training supervised learning classifiers. Supervised learning algorithms have been broadly adopted to the smart grid literature for monitoring and detecting cyber attacks on power systems <cit.>. Here we employ several supervised learning methods for detecting attacks on cyber-DSM systems. It is unlikely that an ISO can collect high-quality attack data due to the lack of such attacks occurring. However, such data can be simulated. Using past load data we simulate direct load manipulation attacks by creating different types of attacks as shown in Fig. <ref>.



 §.§ Sequential Detection Methods


In sequential change point detection, a series does not have a fixed length. Instead, observations are received and processed sequentially over time. When an observation has been received, a decision is made about whether a change has occurred in the state based only on the observations which have been received so far or within a fixed past window size. If no change is detected, then the next observation in the sequence is processed. The sequential formulation allows sequences containing multiple change points to be easily handled. Sequential change point detection can be applied in the case of attack detection to identify if a load time series has been compromised. If an attack is flagged, then an ISO can take appropriate actions to prevent further damage to the grid.  

Under the Sequential Detection paradigm we collect observations an apply a whitening filter to produce a residual series with the assumption that it is white Gaussian noise. If an additive attack A_t > 0 is present for observation t, this will cause a definite shift in the mean of the residual series. This detection problem can thus be stated as deciding if a null hypothesis ℋ_0 is true, where the residual series has zero mean and known variance (invariant in time and estimated from a sample population), or if the alternative hypothesis ℋ_1 is true which states that the examined series has some mean not equal to zero thus being under attack. This can be modeled as a hypothesis test, and for the GLRT and CUSUM detectors this translates to 

    ℋ_0     : x_t 𝒩(0,σ^2), t = 1,...,N 
    ℋ_1     : x_t 𝒩(A_t,σ^2), A_t>0, t = 1,...,N


For the GLRT detector, to simplify implementation, we model the attack as if it were constant A>0 but unknown. To produce a residual series a SARIMA multi-step forecast for t = 1,...,N is made before the detection period. This forecast is conducted using a past window of training data that was not under attack. The forecast is made for time t to t+k. These predictions are then subtracted from the incoming observations to produce a residual time series which is then fed as input into the GLRT and CUSUM detectors. 

The generalized likelihood ratio with a threshold to decide ℋ_1 is defined as

    p(x;A,ℋ_1)/p(x;ℋ_0) = 1/√(2πσ^2)exp^-1/2σ^2∑_t=1^N(x_t - A)^2/1/√(2πσ^2)exp^-1/2σ^2∑_t=1^Nx_t^2H_0H_1≷γ


Taking the log of both sides simplifies the results to

    T(x) = 1/N∑_t=1^N x_tH_0H_1≷σ^2/NAlnγ + A/2 = γ'


The threshold is then found by

    P_FA = P(T(x)>γ';ℋ_0) = Q( γ'/√(σ^2 / N)) 
    ⇒γ' = √(σ^2/N) Q^-1(P_FA)


where N is the size of our window and σ is estimated from past training data used to produce the SARIMA forecasts.








A CUSUM test is a control chart, that is used to monitor the mean of a process based on samples taken from past data at specific time intervals. It is a class of non-linear stopping rules for structural changes. Given information of current and previous samples, a CUSUM test relies on the specification of a target value h and a known or reliable estimate of the standard deviation σ the process. The CUSUM test typically signals an out of control or anomalous process by an upward or downward drift of the cumulative sum until it crosses the target threshold. For attack detection, if the mean of the load series shifts above the target threshold, we then assume the grid is under attack. 

We define the CUSUM detector as follows. Taking the residual series x_t = y_t - E_t-1[y_t], again defined by a SARIMA forecast E_t-1[y_t], we define a one-sided CUSUM detector as

    g_t = max (0, g_t-1+x_t - k)


where k is called the reference value (sometimes also called drift) set priori to values such as 0, 0.5, or A/2 if the size of A is known in advance. When g_t = 0 then we define the change time as t_c = t, and when g_t > h > 0 we reset g_t = 0 and flag an alarm at time t_a = T. The alarm threshold is also set priori to some value based on the sample population standard deviation such as h = 2σ where σ is estimated from past training data used to produce the SARIMA forecasts.

 



 §.§ Supervised Learning Methods


Changepoint detection could alternatively be treated as a supervised learning binary classification problem. Under this scheme, all of the change point sequences, or in our case attacks, represent one class, and all of the nominal sequences represents a second class. Supervised learning methods are machine learning algorithms that learn a mapping from input data to a target class label. Given a set of samples 𝒳={𝐱_i}^N_i=1 and a set of labels 𝒴={y_i}^N_i=1, then the supervised learning detection problem is defined as a hypothesis function that captures the relationship between samples and labels f: 𝒳⟶𝒴. A sliding window moves through the data, considering each difference between two data points as a possible change point.

An advantage of treating attack detection as a supervised learning approach is a more straightforward training phase. However, a sufficient amount and diversity of training data need to be provided to represent all of the classes. To ensure enough training data, and to prevent class label imbalance, we simulate all attack data to train our algorithms. Machine learning methods have successfully been applied several times in data injection attacks in power systems <cit.>, so we analyze here their ability in detecting data attacks on cyber DSM systems. The binary classification problem for attack detection can be defined as

    y_i = {
    1,  if  A_i > 0
    
    0,  if  A_i = 0
    .


where y_i = 1 if the i-th observation is under attack, and  y_i = 0 if there is no attack. A variety of classifiers can be used for this learning problem. For detection of DSM attacks, we examine logistic regression (LR), random forests (RF), Gaussian Naive Bayes (GNB), gradient boosting classifier (GBC), and artificial neural network (ANN). We chose these classifiers because they are all very powerful and have widespread use in both industry and academia; model descriptions of these methods can be found in <cit.>.



 §.§ Performance Analysis


For the security of cyber DSM systems, the major concern is not just the detection of attacks, but also the detection of nominal data with high reliability. That is, we want a detection system that can predict not only with high accuracy but also with high precision and recall to avoid false alarms. Therefore, we measure the true positives (TP), the true negatives (TN), the false positives (FP), and the false negatives (FN). Definitions of these measures are visually shown in Fig. <ref>. We use these measures to calculate several main performance indicators of accuracy, precision, and recall.

We calculate accuracy as the ratio of correctly classified data points to total data points

    Accuracy = TP+TN/TP+TN+FP+FN


This measure provides the total classification success of the models. But alone, accuracy is not enough to get a full picture of performance. Precision is calculated as the ratio of true positive data points (attacks) to total points classified as attacks

    Precision = TP/TP+FP


On the other hand, recall, also known as the true positive rate (TPR), refers to the portion of attacks that were recognized correctly

    Recall = TP/TP+FN


Precision values give information about the prediction performance of the algorithms, whereas recall values measure  the degree of attack retrieval. For instance, a recall value equal to 1 signifies that none of the attacked measurements were misclassified as nominal.

We use one more final measure of total performance of our detectors, the receiver operating characteristics (ROC) curve. The ROC curve is an assessment that enables visual analysis of the trade-off between TPR and false positive rate (FPR). This can also be seen as the trade-off between the probability of detection and the probability of false alarm. FPR is defined as follows

    FPR = FP/FP+TN.


The ROC curve is constructed by plotting a two-dimensional graph with FPR on the x-axis and TPR on the y-axis at various threshold settings. A detection algorithm produces a (TPR, FPR) pair that corresponds to a single point in the ROC space. The best possible detection method would produce a point in the upper left corner, coordinate (0,1) of the ROC space. A random prediction would give a point along a diagonal line from (0,0) to (1,1). Points above this line are considered to have performance, while points below are considered with performance worse than guessing.
 


§ DETECTION EXPERIMENTS


For attack simulation and detection experiments we use all the same parameters from Table <ref> but we varied the levels of κ and attacks a_t. We simulate each of the three types of attacks as visualized in Fig. <ref>, each in the form of direct load manipulation attack, under DSM participation levels κ= 0.1 and 0.9. This creates a total of six experiment scenarios. For each scenario, we simulate 28 days of training data (672 observations) and 2 proceeding days of test data (48 observations), both at a resolution of 1 hr. All training data is created nominally with no attacks. In the test data sets, the first 24 hrs of the test data are not under attack. The last 24 hours of the test data we add one of the three type of attacks. For ramp attacks, for each time step we add an attack a_t = a_t-1 + 5 where the first 24 hours of the test set a_t=0...23 = 0. The sudden attacks are similar except the attack is an additive constant a_t = 150. The last type of attack, point attacks, are a_t=24 = 250, a_t=29 = 200, a_t=34 = 300, a_t=37 = 100, a_t=46 = 150, and a_t =0 everywhere else. 

For the sequential detectors, we use multi-step SARIMA forecasts to predict the next 48 hrs, and then use those forecasts to filter incoming test data for detection. Training was conducted on the training time series of 28 days of nominal data. SARIMA hyperparameters were chosen by examining lag one differenced autocorrelation function (ACF) and partial autocorrelation function (PACF) plots of the training data. These forecasts where then subtracted from the incoming test data to obtain a residual series that is input to the sequential detectors. The assumption for both detectors is that the residual series is Gaussian white noise, where the series has zero mean, and each observation is independent identically distributed from a Gaussian distribution. 

To ensure the residuals are white noise we apply the augmented Dickey-Fuller (ADF) test to check for stationarity, we examine the ACF/PACF plots to check for independence and run a Jarque-Bera test, and we examine a Q-Q plot to check if the residual series has a Gaussian probability distribution. We conduct these checks on all scenario training datasets, where we first train a SARIMA fit on them and then subtract that fit to produce the residual series. In all the training data sets, the residuals were proven to be stationary from the ADF test and independent from ACF/PACF plots. However, the Jarque-Bera test and Q-Q plots showed that the observations did not come from a Gaussian distribution. Example, ACF/PACF and Q-Q plots for κ = 0.1 are shown in Fig. <ref> and Fig. <ref>. Despite the residuals not being Gaussian, we still run the sequential detectors and examine their performance.

For training the supervised learning methods, for each of the six scenarios, we simulate more data to ensure proper class learning. We keep the test sets the same, but we extend each training set doubling its size. We keep the original training set, labeling it as nominal, and then make a copy of it. In the copy, we split it into three parts, each part we add one of the types of attacks at random levels. We label each observation of this set as under attack. We add the nominal and attacked training sets together to form a new training set with a total of 1,344 observations. With our training and test time series, we then create a set 𝒳 features and 𝒴 labels that could be fed into the supervised learning classifiers. Each training sample x_i ∈𝒳 is composed of 24 hours of lagged data, each hour is one feature, and each label y_i ∈𝒴 corresponds to a class 0 (not under attack) and class 1 (under attack). Together we get N = 1,298 pairs of (x_i,y_i) training samples.

We run our experiments on a computer with an Intel i7 6700 2.6 GHz, and 16 GB of RAM. Implementation of the simulations, experiments, and sequential detectors were done in Python 3.6. Implementation for SARIMA forecasts was done using the Python package Statsmodels <cit.>, the supervised learning methods and confusion evaluation metrics were implemented using the Scikit-Learn Python package <cit.>, and ROC curves were created using the Matplotlib Python package <cit.>. All classifiers used default hyperparameters from Scikit-Learn. We compiled all code and data used in our work, into a Python package titled LehighDSM which is publicly available on GitHub <cit.>.

Experimental results from the six scenarios are reported in Table <ref>, in the form of accuracy, recall, and precision metrics, and Fig. <ref> which showcases six ROC curves, one for each scenario. All performance measures in Table <ref>, were calculated using the best thresholds found in the ROC curves by searching for the shortest distance from each curve to the corner (0,1). As seen in Fig. <ref>(c,f) type 3 attacks, under any DSM level, had the lowest detection rates across thresholds with ANN being the worst performer. In Fig. <ref>(a,d) LR yielded the best performance with GNB, and again ANN being the worst. Type 2 attacks in Fig. <ref>(b,e) resulted in the best detection with CUSUM, LR, GNB and GBC having perfect performance. 

With the results from Table <ref>, we have the following conclusions; demonstrated findings imply that detection of attacks has a higher accuracy with higher levels of DSM participation. This occurs since higher DSM penetration results in more aggregated attacks. However, we note that an attacker, if having perfect knowledge of the grid could decrease their intensity and make detection more difficult. Furthermore, supervised learning classifiers performance on average was on par or better than sequential detection methods. LR detector had the highest accuracy for a lower level of DSM usage, while ANNs performed the worst in all scenarios. This highlights the power of linear detection methods over nonlinear. Point attacks resulted in the poorest detection with the CUSUM detector having the best performance. Type 2 attacks had higher recall and precision across all detectors for both levels of DSM. This is because a sudden attack shifts the mean of the data as a constant over time, which is more identifiable, yielding fewer false positives and more true positives.





§ CONCLUSION
 

In this work, we study the exploitation of the hypothetical premise of the feedback between future cyber-enabled DSM programs, on the consumer side, and dynamic RTP on the utility side. An attacker with exploitive economic or nefarious intentions, such as causing efficiency loss of energy provision, can take advantage of the dependency between dynamic pricing and DSM load control. The utility modifies prices in response to forecasted demand in order to push realized load up or down. This is done to achieve some target load level with the goal to reduce peak load or achieve some other DSM objective. On the user side, cyber DSM programs then autonomously respond to prices to adjust certain portions of a users load up or down with some given elasticity. 

We propose two modes of attacks, false price data injections, and direct load manipulation. Under a false price data injection, an attacker modifies the RTP that users receive to alter their demand. Through a direct load manipulation attack, an attacker hacks and alters a users load profile directly. In both these attacks, aggregate load from the grid is modified which then can alter future prices or demand. We showcase how these two modes of attacks are equivalent and introduce three ways an attack can occur. The first type is a ramp attack, the second is a sudden attack, and the third is a point attack. We simulate these type of attacks and review several methods to detect them. 

We simulate and examine load-price data under different levels of DSM participation with three types of additive attacks: ramp, sudden, and point attacks. We applied sequential change point and supervised learning methods for detection of DSM attacks. Results conclude that higher amounts of DSM participation can exacerbate attacks but also lead to better detection of such attacks, point attacks are the hardest to detect, and supervised learning methods produce results on par or better than sequential detectors. Due to the speculative nature of these type of attacks, we plan to look into many different issues for future work. New directions include expanding our model to incorporate day ahead pricing and DSM scheduling, adding models of cost and utility on for a customer and ISO, expanding our model taking into account grid topology, and modeling advanced attack goals such as system failure by power line overload.

elsarticle-num


