Smart meters are being rapidly deployed in household operations with an estimatedmillion smart meters to be operational in the United States alone, by the end of . Smart meters, with bidirectional communication capability and back-end data management system, make up the advanced metering infrastructure (AMI). The AMI primarily facilitates the demand-side response (DSR) by enabling the active participation of residential consumers. In addition, AMI data is one of the important sources of real-time monitoring data in the smart distribution grid. This has paved the way for AMI data analytics and has galvanized a wide range of related applications, such as energy metering, load forecasting, load analysis, load management, electricity theft detection, and power systems monitoring . AMI data has also been used to estimate distribution system topologies for enhancing the resiliency of the grid .
The recent advances in machine learning (ML) have taken data analytics to the next level, proving to be extremely efficient for modeling complex non-linear interactions. Particularly, the deep architectures of the neural networks in conjunction with enhanced computing capabilities have been successful in solving highly non-linear sequential time-series modeling tasks, such as speech recognition . The AMI data being essentially sequential time-series has the potential to harness the advancement in ML to develop new applications for AMI data analytics.
I-a User privacy issues in the AMI
The smart meter data can reveal certain personal attributes about the consumers, which might be unacceptable from a consumer privacy standpoint. For instance, the individual loads and their schedule of operations can be obtained by decomposing the smart meter data . In , the authors show that a customer’s lifestyle can be categorized by analyzing their household smart meter data. It can reveal sensitive personal information about a customer, such as availability at home, certain habits, social traits, economic status, etc. Therefore, user privacy is a significant concern that needs to be addressed in AMI data analytics applications.
Most of the privacy preservation techniques in the literature concentrate on the aggregation of the raw smart meter data on local aggregators in an attempt to dilute the identity of the individual customers . The major limitation of this approach is that the aggregator can be compromised to get access to raw data. Moreover, aggregated data can still possess significant pointers, which can be exploited to estimate individual customer behavior. Another approach to preserve privacy is to provide confidentiality of data in transit, yet the distribution system operator (DSO) via the aggregators, receives the raw data sensed by the smart meter. Therefore, privacy is an issue if the DSO either wants to use the data for analytics applications or wants to share it with any third-party providers. In the worst case, even data confidentiality is an issue if the aggregator or the DSO are compromised as they contain the raw data in unencrypted form.
In this paper, we argue that the ML-based applications in the AMI can take the advantage of the black-box nature of ML models to inherently preserve privacy and overcome these limitations. The AMI data analytics applications are generally deployed at the DSO and process the data reported by a group of smart meters. We suggest that the local ML applications can be deployed for each consumer either on a home energy management system (HEMS) device, as a software application on the smart meter, or on an associated embedded device. Considering the progress in Graphical Processing Units (GPUs) and neuromorphic computing, the deployment of ML applications on embedded devices is a reasonable assumption. The ML model weights or parameters are shared with the aggregators (or DSO) alleviating the need to share the raw user consumption data. We treat the smart meters as distributed clients hosting efficient local ML applications whose performances can be enhanced by amalgamating the model parameters of all the smart meters in a cluster composed of consumers in a small geographic area, without any violations in user privacy.
The key contributions of this paper are as follows: 1) A generalized privacy-preserving AMI federated ML (AMI-FML) framework for AMI data analytics–the framework is general and can be used as the structural basis for distributed/federated ML applications in the smart grid. 2) Strategies to improve communication efficiency and additionally reinforce privacy by minimizing unintended memorization of ML models. 3) A proof-of-concept implementation of the framework using a long short-term memory (LSTM) recurrent neural network for STLF. User privacy is better preserved with our AMI-FML framework as we share only the gradient information of the individual smart meter ML models instead of the raw data. Results show the effectiveness and improvement in accuracy due to the use of the federated learning approach.
The rest of this paper is organized as follows. Section II describes the proposed AMI-FML framework. Section III presents the proposed AMI-FML application use case for STLF along with brief background on STLF. The data description, evaluation criteria, and the framework evaluation with a summary of results and associated discussion are described in Section IV. Finally, Section V presents the concluding remarks.
Ii AMI-FML Framework
The smart meters in AMI are deployed at the distribution systems level, for each household or small industrial consumers. They measure the consumption of a customer at a specified interval ( minutes, half-hourly, or hourly). We assume that the smart meters are connected to the communication network, capable of receiving pricing information or direct load control commands, and can exchange information with HEMS, which enables optimization of energy usage and demand response. The ML applications can either be installed in the smart meter module, HEMS, or a separate module attached with the smart meter.
One of the prominent applications of ML-based AMI data analytics will be to improve the efficiency of the smart distribution grid by keeping an eye on the changing energy markets. The smart meters anchored with HEMS, as illustrated in Fig. 1, can help provide better service to the prosumers. Third-party service providers can offer value-added energy services for the HEMS, leveraging smart meter data analytics 
. They could provide commercial energy management solutions in near real-time that can manage loads and distributed generation to reduce energy bills. The third-party demand response (DR) services could rely on ML to achieve demand response in coordination with the DR program of the grid operator. ML-based anomaly detection schemes have been very useful in many systems. They can be deployed as smart meter applications to identify anomalous consumption patterns, detect electricity theft, identify power quality disturbances, and monitor equipment health. The smart meters in a particular geographic region form a cluster and are connected to an aggregator or data center maintained by the DSO. In the case of a third-party ML application, the aggregator can also be hosted on a server connected to the communication network. Essentially, the federated learning algorithm runs at the aggregator and creates a global ML model by the fusion of local ML models in a cluster. After achieving sufficient generalization of the ML models to minimize errors, the trained ML models are deployed on the smart meters at the edge. The fusion of the ML model parameters is carried out at a fixed interval determined by the application requirements. We present a brief overview of the smart meter communication infrastructure in the following section, followed by the details of the FML.
Ii-a Smart Meter Communication Infrastructure
The smart meter communication infrastructure illustrated in Fig. 2, is mainly built over three types of architectures . First, the smart meters are directly connected to the data concentrator or aggregator via the mobile network (GPRS, CDMA, LTE, 5G), and the responsibilities for data communications are handled by the mobile operator. Second, the smart meters are connected to the data concentrator through Power Line Communications (PLC) or Broadband over Power Lines (BPL) technologies. Third, there can be a gateway to which the smart meters are connected and the gateway can dynamically choose the communication media among cellular, WiFi hot-spots, and PLC/BPL network. The gateway acts as an interface between the data concentrators and the smart meters. The data concentrators are connected to the substation via BPL, WiMAX, or Ethernet.
The ML applications at the consumer side can use any of the communication infrastructures to exchange information with the central aggregators. In the near future, the data communications in the smart meter may happen over the public or non-dedicated communication networks, such as the internet. This will further allow the third-party service providers to directly interact with the consumers, through the internet.
Ii-B Federated machine learning
The canonical federated ML (FML) deals with building a global statistical model from the data gathered by a group of remote local devices (smart meters) deployed at the edge. The global ML model is created at the aggregator (or DSO) by the fusion of all the local ML model parameters corresponding to each smart meter. The aggregator and the smart meters exchange model parameters through intermediate updates communicated periodically.
The local ML model weights (
) are updated through gradient descent. The number of epochs for learning is fixed so that sufficient generalization is achieved with the inclusion of new training data. After a fixed time step the learned weight for all the smart meters is sent to the central server or the aggregator, which hosts the global model. Instead of sending the actual weight values to the aggregator, we send the difference in the weight values as the weights update (also referred to as model update). The model update sent by thesmart meter to the aggregator is expressed as:
Here, represents the global ML model weights at the time .
The aggregator or the centralized server receives the weight updates from all the individual smart meters in a set , at any instant of time . These weights are then combined according to the federated averaging algorithm  to create a global model that encapsulates information abstracted by the local models.
For the experiments in this paper, we use the FedAvg  algorithm to aggregate the local models, where the parameters are averaged element-wise with weights proportional to the sizes of local datasets. However, the algorithm for model fusion can be chosen based on the application at hand. Typically, the goal of this federated averaging algorithm is to minimize the following objective function:
is the local objective function or the loss function of the local ML model, forsmart meter at time . specifies the relative contribution of each local model corresponding to a smart meter. For experiments in this paper, as the training data sizes for each local model are assumed to be the same, the value of is set as . Here, is the total number of smart meters connected to an aggregator.
We perform the federated averaging according to Eqn. (3), which is essentially the element-wise mean of the model parameters of all the local models.
The global model parameters are updated as:
Ii-C Communication efficiency
The number of parameters required for the acceptable generalization of an ML model depends on the complexity of the data and the nature of the application. A well generalized deep neural network may have thousands of parameters that may burden the communication channel. The transfer of difference in parameter values results in sharing of a small set of the parameters that have been updated. In addition to this, there are two umbrella approaches, structured update and sketched update for reducing communication overhead and additionally strengthen privacy . We discuss these approaches here.
Ii-C1 Structured Update
To reduce the cost of sending to the aggregator, we tested a structured update approach. In this approach, the update is restricted to have a predefined structure. We created a sparse matrix of the same dimension as , called the random mask. We created separate random masks for each smart meter independently in every round of federated learning. The sparsity of the random mask is proportional to the number of zeros in the corresponding matrix. In our experiments, we randomly selected a fraction of the elements in the sparse matrix to be zero. The gradient parameter matrix is then multiplied element-wise with the random mask, to result in a sparse version of , referred to as . Here, represents element-wise multiplication operation. Each smart meter, now sends to the server instead of .
Ii-C2 Sketched Update
This is an encoding technique to compress the size of the model parameter vectors. Sub-sampling is one of the easiest ways to achieve this, however, it comes with a cost similar to random masking. A more efficient approach is to use probabilistic quantization, where the parameters/weights are distributed into encoded buckets. All the data in a bucket consolidate their values to that of the value associated with the bucket, with an associated probability.
A one-bit adaptive quantization of a matrix is expressed as:
Ii-D Privacy in the FML framework
The ML model gradient parameters () provide a sparse and encoded representation of the raw smart meter data and thwart the possibility of deriving the input time-series (raw smart meter data) from just model parameters. This inherent feature of FML introduces definitive user privacy —the gradient parameters cannot be inverted to generate the raw data. However, the unintentional memorization of ML models could be a concern . A small amount of unintended memorization in ML models may occur when the models are either over-trained or not regularized. This means that the gradient parameters could be used to infer either some salient features of the raw data or a partial reconstruction of the input data may be possible, which can undermine privacy.
In the case of the smart meters, the hidden states of the ML model may be exploited to probe for unique consumption patterns. This is alleviated by either randomly dropping some gradient parameters or approximating their values. We perform these inherently to enhance the communication efficiency (for both random mask and adaptive quantization). This increases the robustness of the AMI-FML against intended or unintended memorization and the privacy is additionally reinforced. The global ML model essentially consumes the latent features or information that are exclusively relevant for the application at hand, instead of the raw smart meter data. Therefore, this framework can be used as a foundation to develop a range of other FML applications without compromising user privacy utilizing the proposed AMI-FML framework.
Iii FML application for STLF
In this section, we discuss the proposed AMI-FML framework in the context of a use case: ML application for improving STLF while preserving privacy. First, we present a brief overview of the STLF in III-A. In Section III-B, we briefly present the concepts of LSTM-RNN for STLF.
Iii-a Short-Term Load Forecasting (STLF)
Both short-term and long-term load forecasting are critical for power distribution utilities. The STLF for individual consumers plays a more important role in future grid planning and operation . This enables short-term energy price forecasts which are of particular interest to power portfolio managers. The term short-term covers from a few minutes up to a few days ahead. The accuracy of the STLF impacts the efficiency of the DR mechanisms relying on direct load control (DLC) or locational marginal pricing (LMP). LMP is a driver and determines distribution congestion pricing (DCP) in the day-ahead energy market . The patterns of the time-series corresponding to the load consumption at individual household levels and feeder levels are generally distinctive, with the former being a lot more volatile than the latter.
The intrinsic uncertainties associated with STLF come from external factors, such as weather conditions, variable generation from household DERs, and unexpected changes in the demand. For instance, the outside temperature has a profound effect on the heating and cooling system loads. The amount of sunshine and wind speed affects the amount of distributed generation pumped into the grid. The charging pattern of the electric vehicles and the battery storage further introduce volatility in load consumption.
The load consumption patterns are a result of the complex nonlinear interactions among several factors including the ones stated above. It is essential to model these interactions with sufficient faithfulness to predict future consumption, which is extremely challenging. This complexity has increased with the rapid rise in the number of grid-connected DERs. Several solutions to address this have been proposed, incorporating advances in signal processing and time series forecasting. Autoregressive Integrated Moving Average (ARIMA) type models have been quite successful in modeling non-linear time-varying processes such as STLF . However, most of these statistical models cannot encapsulate the long-term dependencies and have a natural tendency to settle towards the mean values of the past series data.
Iii-B LSTM-RNN for load forecasting
In our problem, the local devices are the smart meters hosting applications with local ML models comprising of the LSTM-RNNs. The goal of our ML application is to accurately forecast future energy consumption. Essentially, this is a sequential time series modeling challenge, and RNNs are the ideal candidate for this task. The recurrent connections among neurons in an RNN preserve the hidden state transitions associated with the temporal variations. However, the RNNs are difficult to train and suffer from the problem of either exploding gradient (where the weight updates become excessively large numbers) or vanishing gradients (where the weight updates become insignificantly small numbers), hindering the learning process. Another key limitation of the basic RNNs is their inability to preserve the learned information for longer periods with the increase in time lag.
The LSTM is a variant of RNN, that alleviates these limitations, paving the way for efficiently modeling sequential data. It has demonstrated quite remarkable short-term load forecasting performance for individual customers . The key elements in an LSTM cell are the memory cell and the gate units (forget, input, output)  as depicted in Fig. 3. The memory cell is responsible for preserving information regarding the temporal state of the neural network and consequently the temporal patterns of the time-series. The gates consist of multiplicative units that control the flow of information, and decide what and how much information should be preserved.
Let represents the input to LSTM cell and represents the internal state of the LSTM cell, at a time index . The forget gate
in the LSTM has a sigmoidal activation function (), and is responsible to determine what information is irrelevant and should be erased from the memory parameter . The input gate adds new information to the estimated memory state . Terms and are derived from the input by processing it through a sigmoidal and a activation function, respectively. The input gate also adds the sharing parameter vector to . The output gate determines the new hidden state from the memory state parameter , previous hidden state , and the input by utilizing sigmoid and functions.
The set of equations governing the forward pass of the LSTM network can be expressed as :
Here, , , , , and are vectors comprising of the sigmoid activation outputs of the forget gate, the input gate, activation output of the input gate, cell state, and the sigmoid activation output of the output gate respectively.
, are matrices consisting of input gate weights where is the number of features (one value for each electricity load data point measured by the smart meter) and is the number of hidden units in the LSTM cell. , are the forget and output gate weight matrices, respectively. are the recurrent weights. Similarly, are peephole weights and are the bias parameters. The cumulative parameter set of an LSTM network corresponding to the smart meter at any time index consists of all the weights and bias values for that smart meter, which is represented as a multidimensional data frame .
In Fig. 4, we show a general LSTM network architecture and its unrolled representation. The smart meter data for a given smart-meter is sequentially fed into the LSTM network in the form of an input vector corresponding to a time instant . Here, is the number of previous time steps (electricity load data points) we want to use to predict the electricity load of the next time step. Since the LSTM cells contain sigmoid and activation functions which are sensitive to the scale of the data, we normalized our data in the range . After feeding input to the LSTM network, it creates an output of shape . As we used hidden units for each of our LSTM cells, we have . This implies, in the output for each time step there will be hidden features. In the end, we took hidden features from the last time step of the LSTM output and passed it through a linear layer to get the final output which is the predicted energy consumption at the time .
Iv Evaluation and Results
We evaluated the proposed AMI-FNL framework on the ML based STLF use-case (discussed in Section III). The dataset for the experiments and the performance metrics are described in Sections IV-A and IV-B. We describe the experimental setups and associated results in Sections IV-C-IV-E.
Iv-a AMI Data Description
We used the dataset released by Smart Metering Electricity Customer Behaviour Trials (CBTs) initiated by Commission for Energy Regulation (CER) in Ireland, for the experiments in this paper. From this dataset, we selected a subset of smart meters which were deployed for residential consumers. The selected dataset consists of electricity load consumed by the consumers from July , to December , ( days), each comprising of data points, with a sampling interval of minutes. We did pre-processing of the raw data to ensure that the bad data (smart meter readings for the days with missing measurements) were removed. In our experiments, we have used the first days of data ( data points) for training and the last days of data ( data points) for testing.
We divided the selected dataset into clusters with smart meters in each cluster. In real-world applications, number of smart meters in a geographic area connected to an aggregater could form a cluster. In case of third party applications, contingent on the internet, clusters can be carefully formed based on geographical or electrical proximity. The number of smart meters in a cluster can be decided based on the efficiency of the communication infrastructure. For the STLF, as the reporting intervals of the smart meters are minutes, we consider a half-hourly forecasting horizon.
Iv-B Performance Metrics
We considered two well-established performance metrics  to assess the forecasting performance of the proposed method. Let, represents a point forecast (predicted consumption) at a time index , is the actual consumption, and the total number of point forecast in an experiment is , for an individual smart meter.
The performance metrics are defined as:
(a) Normalized Root Mean Square Error (NRMSE)
Here, and represent the maximum and minimum value of actual consumption .
(b) Mean Absolute error (MAE)
Iv-C STLF with local ML model
We did not perform any federated averaging in this experiment. The LSTM models were trained on the historical data (of days) corresponding to that specific consumer. We limited the number of training epochs of the LSTM-RNNs to in order to achieve acceptable generalization without over-fitting. After that, the trained models were deployed for forecasting. In this case, the LSTM models entirely rely on the available local data for training and learning. We computed the performance metric values for individual smart meters and averaged them across all the smart meters in a cluster. The overall (average) NRMSE, and MAE across the clusters were: , and
respectively. The small value of NRMSE and MAE indicates the efficacy of LSTM networks for STLF. The standard deviation being withinindicates relatively small variation in the forecasting performance when comparing across smart meters deployed in different regions. The superior forecasting performance of the LSTM can be attributed to its property that preserved very long-term information that relate the internal state transitions and is essential for accurate forecasting.
Iv-D STLF with FML model
In this case, we trained the LSTM models in a federated setting by sharing the model weights for each epoch (after traversing through all the time steps in an epoch). In the federated ML environment, the model updates are normally shared at specific intervals of time. The true advantage of federated ML to improve forecasting accuracy can be harnessed only when we continuously improve the performance of the global model and substitute it in place of the local models at specific intervals. This enables the trained forecasting model to be further trained to accommodate new patterns of consumption after getting deployed at the edge device.
We conducted two sets of experiments related to this. In the first, the local models were shared every minutes, which was the highest level of granularity that was achievable with our dataset. The average NRMSE and MAE averaged across all the clusters were found to be , and . All these error metrics are smaller compared to the case without federated ML. For all the clusters the average errors decreased or the forecasting performance improved with federated ML. The best-case performance improvements (decrease in error) were observed to be , and for NRMSE, and MAE. Although small, these improvements will enhance STLF and impact the transactive energy market.
Then, we conducted another set of experiments where we decreased the granularity to hours or daily. The motivation behind this is that the consumption patterns are more prominent when we observe the consumption for several days. In addition, many utilities give increased emphasis on the day ahead price forecasting to commit energy transactions. The average NRMSE and MAE with hourly federated model updates were observed to be and respectively. These errors are smaller compared to the case without federated ML, and even smaller compared to the federated ML case with half-hourly updates.
The superior performance of the daily model update compared to half-hourly updates can be explained by the functional working principle of the LSTM network. The LSTM learns unique features from the transition patterns embedded in the data, which requires the exploration of sequential data of sufficient length/duration. The inclusion of one point to the training sequence may not create adequate information to be abstracted in the LSTM. Whereas, the hours update may offer a range of motifs for the consumption patterns. This is because certain loads such as the dishwasher follow a daily routine, and are operational for a specific interval of time.
Iv-E Communication efficiency
In this experiment, we evaluated the techniques for improving communication efficiency. The forecasting performance of random mask based structured update and adaptive quantization based sketched updates are summarized in Table I. The performance reductions for random mask with , and even zeros are significant. However, for sketched update with -bit adaptive quantization, the performance is close to the original case with 24-hour federated ML updates. A comparison of NRMSE across the individual smart meter clusters with different bits of adaptive quantization is shown in Fig. 6. The -bit quantization emerges as the natural choice. The quantization, in addition to communication overhead reduction (-bit quantization results in compression compared to a byte float) also introduces ancillary privacy features .
We presented a generalized federated learning based paradigm for developing privacy-preserving ML applications (AMI-FML) in the smart grid. We demonstrated techniques to enhance communication efficiency and reinforce privacy in FML. We presented the proof-of-concept through a FML based STLF application supported by the AMI. We used LSTM networks to accurately forecast energy consumption based on the historical smart meter readings. It was demonstrated that the FML improves the forecasting accuracy of the individual smart meters compared to local ML models (without FML), and aids in more efficient HEMS while preserving user privacy. In addition to the facilitation of intelligent services by the grid operators, the proposed framework will specifically encourage third-party service providers to roll out value-added services for the benefit of consumers.
The future direction could be to bring into play the advances in federated ML concepts to improve the performance of smart meter based ML applications in the smart grid. It will be worthwhile to evaluate advanced federated averaging algorithms such as Agnostic Federated Learning, Probabilistic Federated Neural Matching, and matched averaging. Enhancing communication efficiency while embedding differential privacy without reduction in performance is another aspect of potential future work.
-  (2016) Advanced metering infrastructure and customer systems-results from the smart grid investment grant program. Technical report U.S. Department of Energy. External Links: Cited by: §I.
-  (2017-Fourthquarter) Smart meter data privacy: a survey. IEEE Communications Surveys Tutorials 19 (4), pp. 2820–2835. External Links: Cited by: §I-A.
-  (2018) The secret sharer: measuring unintended neural network memorization & extracting secrets. arXiv preprint arXiv:1802.08232. Cited by: §II-D.
-  (2016-05) Smart grids deployments within eu projects: the role of smart meters. In 2016 Smart Cities Symposium Prague (SCSP), Vol. , pp. 1–5. External Links: Cited by: §II-A.
-  (2014) Privacy aware learning. Journal of the ACM (JACM) 61 (6), pp. 1–57. Cited by: §II-D.
-  (2016) Deep learning. MIT Press. Note: http://www.deeplearningbook.org Cited by: §I.
-  (2017-10) LSTM: a search space odyssey. IEEE Transactions on Neural Networks and Learning Systems 28 (10), pp. 2222–2232. External Links: Cited by: §III-B, §III-B, §III-B.
-  (2014-05) Subgroup discovery in smart electricity meter data. IEEE Transactions on Industrial Informatics 10 (2), pp. 1327–1336. External Links: Cited by: §I-A.
-  (2016) Federated learning: strategies for improving communication efficiency. arXiv preprint arXiv:1610.05492. Cited by: §II-C, §IV-E.
-  (2019-01) Short-term residential load forecasting based on lstm recurrent neural network. IEEE Transactions on Smart Grid 10 (1), pp. 841–851. External Links: Cited by: §III-A, §III-B.
-  (2013) Energy disclosure, market behavior, and the building data ecosystem. Annals of the New York Academy of Sciences 1295 (1), pp. 34–43. External Links: Cited by: §II.
-  (2018-07) Lifestyle segmentation based on energy consumption data. IEEE Transactions on Smart Grid 9 (4), pp. 2409–2418. External Links: Cited by: §I-A.
-  (2014-11) Day-ahead congestion management in distribution systems through household demand response and distribution congestion prices. IEEE Transactions on Smart Grid 5 (6), pp. 2739–2747. External Links: Cited by: §III-A.
-  (2016) Short- and mid-term forecasting of baseload electricity prices in the u.k.: the impact of intra-day price relationships and market fundamentals. IEEE Transactions on Power Systems 31 (2), pp. 994–1005. Cited by: §III-A.
-  (2017) Federated learning: collaborative machine learning without centralized training data. Google Research Blog 3. Cited by: §II-B, §II-B.
-  (2015) Leveraging ami data for distribution system model calibration and situational awareness. IEEE Transactions on Smart Grid 6 (4), pp. 2050–2059. Cited by: §I.
-  (2019-05) Review of smart meter data analytics: applications, methodologies, and challenges. IEEE Transactions on Smart Grid 10 (3), pp. 3125–3148. External Links: Cited by: §I.
-  (2020) A novel method for hourly electricity demand forecasting. IEEE Transactions on Power Systems 35 (2), pp. 1351–1363. Cited by: §IV-B.