0% found this document useful (0 votes)
21 views5 pages

Ieee Isgt2022

This paper presents a federated learning framework for predicting net electricity demand in transactive energy communities, addressing privacy concerns associated with data sharing among buildings. The proposed model allows buildings to collaborate on improving prediction accuracy while keeping their data confidential, leveraging centralized oversight from an aggregator. The approach was tested using data from multiple buildings at the University of Coimbra, demonstrating its potential for optimizing energy management in communities.

Uploaded by

Rodrigo Salles
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views5 pages

Ieee Isgt2022

This paper presents a federated learning framework for predicting net electricity demand in transactive energy communities, addressing privacy concerns associated with data sharing among buildings. The proposed model allows buildings to collaborate on improving prediction accuracy while keeping their data confidential, leveraging centralized oversight from an aggregator. The approach was tested using data from multiple buildings at the University of Coimbra, demonstrating its potential for optimizing energy management in communities.

Uploaded by

Rodrigo Salles
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Federated Learning Enabled Prediction of Energy

Consumption in Transactive Energy Communities


Nuno Mendes Pedro Moura Jérôme Mendes
ISR, Electrical and Computer Eng. ISR, Electrical and Computer Eng. ISR, Electrical and Computer Eng.
University of Coimbra University of Coimbra University of Coimbra
Coimbra, Portugal Coimbra, Portugal Coimbra, Portugal
[email protected] [email protected] [email protected]

Rodrigo Salles Javad Mohammadi


ISR, Electrical and Computer Eng. Cockrell School of Engineering
University of Coimbra University of Texas at Austin
Coimbra, Portugal Austin, USA
[email protected] [email protected]

Abstract—The prediction of the net electricity demand is of electrical vehicles (EV) have been integrated into build-
crucial to the management and optimization of transactive en- ings. The flexibility technologies can be used to ensure the
ergy communities. Such prediction usually relies on net-demand optimization of the self-consumption and costs at the building
information, but each building can have additional information,
such as separated generation and demand profiles, weather, and community levels [1]. However, to ensure such an
or occupancy data. Such information is not only relevant for objective, a traditional approach with the Distribution System
the net-demand prediction of each building, but also to other Operator (DSO) predicting the load at the substation level
buildings with the same type of use. However, buildings avoid and adapting the grid resources is not enough. Therefore, to
sharing such information due to privacy concerns. This paper ensure effective management of resources the prediction of
proposes a novel federated learning framework for predicting
building temporal net-demand in transactive energy communi- the net-demand in each individual building is essential [2].
ties. The proposed approach leverages centralized oversight of
a central agent (aggregator) to inform distributed collaboration These issues are more critical in future Transactive Energy
among each client (buildings), which are willing to collaborate (TE) systems that are defined as economic and control mech-
to improve their prediction accuracy. The proposed approach anisms for managing consumption and generation through en-
was tested using a dataset collected from several buildings
from a University campus (from the University of Coimbra
abling end-use energy trading [3]. TE systems enable scalable
in Portugal), predicting the electricity demand, and then using operation and optimization of heterogeneous producers and
the local generation data to evaluate the net-demand, in the consumers (as known as prosumers) assets in communities,
community of buildings. and to ensure such an objective the prediction of net-demand
Index Terms—Federated Learning, Distributed Computation, is critical. In a community of buildings, managed by an
Transactive Energy, Energy Consumption, Energy Community.
aggregator, the buildings’ interests are aligned, hence, they
are willing to collaborate to increase the prediction accuracy
I. I NTRODUCTION in order to achieve better resource management and energy
cost reduction.
A. Motivation
The increasing penetration of renewable generation has However, most buildings are not interested in sharing
been leading to new challenges in electrical grid management, their data with other buildings, since such data can reveal
due to the intermittency and variability of the generation sensitive commercial data such as the number of occupants
sources. In the context of buildings and communities, the use or strategies for participating in the TE market. To solve such
of solar photovoltaic (PV) generation is strongly increasing. an issue, this paper presents a novel federated learning (FL)
However, typically, the profiles of PV generation and the model for predicting the net demand of several buildings
demand in buildings can have a strong mismatch, and new in transactive energy communities. In FL, multiple entities
technologies are needed to ensure the required flexibility collaborate in solving a machine learning problem, under the
for the coordination between the available generation and coordination of an aggregator or in a peer-to-peer scheme,
demand. Flexibility options, such as battery energy storage being the raw data of each client locally stored and not ex-
and demand response, including the management of charging changed or transferred [4]. This paper proposes an approach
with the centralized oversight of a central agent (aggregator)
This research was supported by FCT through the project ML@GridEdge to inform distributed collaboration among each client agent
(UTAP-EXPL/CA/0065/2021) and by the ERDF and national funds through
the project EVAICharge (CENTRO-01-0247-FEDER-047196).
(buildings). With such an approach, clients maintain their
private information as confidential, but simultaneously con-
tributed not only to improving the prediction in their building,
978-1-6654-8032-1/22/$31.00 ©2022 IEEE but also in other buildings of the community.
B. Related Works private. The aggregator will then update the model weights to
Energy prediction models have a critical role in energy improve the prediction of all buildings in the community. The
policy and energy management in buildings. For demand implemented approach is based on a Horizontal Federated
prediction, the prevailing techniques used in large-scale build- Learning (HFL) model. Still, it introduces as a novelty the
ing applications, include white-box, black-box, and grey- use of a third party to provide information in common to all
box based methods [5]. Recently, the booming development buildings (e.g., weather data). While the proposed approach
of deep learning techniques brings more exactitude to the is presented in the context of net-demand prediction, it is
”black-box” approaches, bringing promising alternatives to envisioned that it can be extended to transactive energy
conventional data-driven approaches [6]. For instance, [7] communities’ coordination problems.
proposes deep learning-based techniques for day-ahead multi-
step load forecasting in commercial buildings. D. Paper Organization
However, with the integration of renewable generation in The remainder of the paper is structured as follows. The
buildings, load forecasting is not enough, being fundamental Federated Learning framework is presented in Section II.
to take into account the generation, by predicting the net- The data and scenarios are described in Section III, and the
load. The net-load is often predicted for communities of achieved results are presented in Section IV. Finally, the main
residential buildings and in [8] an Artificial Neural Network conclusions are highlighted in Section V.
based model was designed to predict short-term micro-scale
residential net-load profiles. The most accurate solutions II. F EDERATED L EARNING F RAMEWORK
are mainly found for the prediction of aggregated loads
This paper considers a TE environment that includes build-
at the substation level, predicting the load for the entire
ings, aggregators, DSO, and third-party data providers, as
community. However, for the management of communities
presented in Fig. 1. In this setup, the DSO oversees the power
using flexibility resources at the building level, the prediction
flow between each building and the grid and has access to all
of energy consumption at every building level is required.
buildings’ historical net-demand metering data. Each building
For instance, in [9] a hybrid convolutional neural net-
can sign up with one aggregator, and with the building’s
work with a long short-term memory autoencoder model
permission, the aggregator will get access to net-demand
was used for future energy prediction in residential and
metering of that building collected by the DSO. Additionally,
commercial buildings. However, such works are focused
each building may access additional information, such as
on individual buildings, without taking advantage of the
separated generation and demand profiles, sub-metering, and
collaborative opportunities between buildings with similar
occupancy data. Other relevant data in common for all build-
characteristics each one with private data resources that can
ings, such as weather data, can be obtained from third-party
be important to the other buildings. Therefore, such methods
data providers. Due to privacy concerns, the building does not
are only based on the net-metering data, therefore losing the
intend to share its data with the aggregator. However, such
differentiated impact on demand and on the generation or
information is relevant for the building owning the data and
they just assume that the individual generation and demand
other buildings. In fact, there is a high correlation between
data can be available without taking into account that most
the PV generation in buildings in the same community, and
buildings do not intend to publicly share such data. Such
the demand correlation between the same type of buildings
methods also do not take into account the availability of other
can also be high.
private information that can be available in some buildings
(e.g. weather, comfort, or occupancy data).
The use of private data in collaborative machine learning
problems on decentralized data where privacy is paramount
has been ensured using FL [4]. Such approaches have been
used primarily in mobile and edge device applications, but
the use of FL in power systems is limited. In [10] FL
is used to identify the socio-demographic characteristics of
electricity consumers, in [11] FL is used for the prediction
of energy demand in EV Networks, and in [12] a clustered
aggregation is implemented for the prediction of electricity
demand. However, FL has not yet been used to enhance the
prediction of net demand in communities of buildings.
C. Contribution
The main contribution of this work includes introducing a
federated learning framework to enhance the prediction accu-
racy of buildings’ net demand. The proposed solution lends
itself well to TE systems where buildings, aggregators, and
DSO are decision-making entities. It is assumed that DSO
shares the net-demand metering data with aggregators. The
clients will collaborate to fine-tune their models by executing
the training program using their data while keeping their data Fig. 1: Power and data flows in the community.
A separate prediction for generation and demand increases assurance is preserved by interactions between the partici-
the reliability of the net-demand prediction. In the same pants and the respective aggregators. The aggregator imple-
community in a given location, there is almost a perfect ments R rounds iteratively. For each round, K buildings are
correlation between the PV generation variation in the several selected from B, know as participants Br , where K < n(B).
buildings (the only factors affecting it can be slightly different This is done to require less computation capacity, and since
slops and orientation of panels or an eventual shading in some this selection is made randomly there is a high probability
buildings). In the case of demand, even considering the same that all buildings being selected for at least one round in
type of buildings, the correlation is not so high, since it is the global training. There is only one interaction where the
affected by factors with a different impact on the several averaging is not implemented, which is the first time that the
buildings, such as temperature, schedule of services and system initializes. In this specific case, random weights are
users. Considering directly the net-demand would attenuate sent to all participants. Fgt indicates if this situation occurs
such correlations. For instance, on a sunny day with high or not.
temperatures, the PV generation and demand will be high, The aggregator received from a third-party a dataset with
with the generation increase attenuating the demand increase, common features Dcf to the buildings, namely the dataset
but with a differentiated impact in different buildings. with the weather information. The objective of this approach
In order to integrate the proposed system into the setup is to reduce the number of entities connected to the final
present in Fig. 1, it is necessary a model that ensures global user, as well as the redundancy between users. In [13],
training with specific characteristics, namely: all the buildings HFL is introduced with all data allocated on the client’s
will have the same features, the structure of the model will system. However, in the implemented setup the weather data
be the same for all buildings, and it is necessary to have a co- will be sent from the aggregator, and when the aggregator
ordinator, the aggregator. To ensure such characteristics, this communicates the updated weights Wa to the participants,
approach is based on an HFL model [13] with a client-server the weather data Dcf is also sent.
architecture. FL is an edge collaborative machine learning In [14], the calculation of the updated weights is done
technique that allows the training of an algorithm that already considering the number of samples. Therefore, each partici-
has been trained in a certain device. In such a context, HFL pant influences the average depending on the ratio between
is a model that is used when the participants have the same their quantity of samples and the total number of samples in
features with different samples, to train an equal model. In all aggregated participants. There is then the assumption that
terms of learning, this will improve the models, since they the larger the dataset, the greater is their importance in this
will be trained in multiple different situations. calculation. However, in this work, all the participants have
The selected architecture fits on the global structure pre- the same ”importance” since the averaging is independent of
sented in Fig. 1, where the server will be the aggregator, who the number of samples. Line 6 of Algorithm 1 shows the
will be responsible for the system coordination. The clients selected function to implement the averaging of the weights.
will be the buildings B and each building has its own system
The next step is to execute local training (i.e., (2)) in
for training its personal predicting model. Additionally, a
parallel for all the participants. Each building b returns its
third party was added to the system, which will be responsible b
final weights Wr+1 , loss Lbr+1 , and validation loss Vr+1 b
for providing weather data. This approach intends to reduce b
associated with its local training. Wr gets the values of all
the number of entities connected to the buildings, increasing
weights received from all participants in each round, L and V
their protection. The proposed Federated Average Algorithm
concatenates all Lbr+1 and Vr+1
b
, respectively, for all rounds.
was adapted from [14], and the pseudocode associated with
At the end of the global train, these variables contain all
the aggregator is presented in Algorithm 1.
values of loss and validation loss from all participants in all
Algorithm 1 Aggregator Algorithm rounds.
• Input: K; R; Dcf .
Algorithm 2 Building Update Algorithm
1: for r = 1, 2, . . . , R do
2: Br = {b1 , b2 , . . . bk } ∈ B • Executed by: all buildings seleted, the participants Br ,
3: if Fgt then Algorithm 1.
4: Wa ← W0 • Input: Wa , Dcf .

5: else 1: Db ← Dcf Dpd
PBr b b
6: Wa ← K 1
b=1 Wr
b 2: Wr+1 ,Vr+1 ,Lbr+1 ← ParticipantUpdate(Wa , Db )
7: end if
8: for b = 1, 2, . . . , Br in parallel do
9: b
Wr+1 b
, Vr+1 , Lbr+1←BuildingUpdate(Wa , Dcf ) The diagram of the system associated with the buildings
10: Wrb ← Wr+1 b is presented in Fig. 2. This structure presents the flow of the
11: V ⌢ Vr+1
b proposed Federated Average Algorithm and represents the
12: L⌢ Lbr+1 algorithm for predicting the net-demand. Line 2 of Algorithm
13: end for 2, receives the weights (Wa ) and these are sent directly
14: end for to the Artificial Neural Network (ANN) model, which will
be responsible for predicting the demand. The ANN model
This architecture ensures global training by averaging the proposed is presented in Table 1, with a Long Short-Term
weights Wrb of the predicted model in each participant. This Memory (LSTM) architecture.
of Chemical Engineering), DECE (Department of Electrical
and Computer Engineering), DES (Department of Earth Sci-
ences), DIE (Department of Informatics Engineering), and
DME (Department of Mechanical Engineering).
The private dataset for all buildings needs to match in
terms of features. The common feature set includes: (i) each
building’s net-demand, and (ii) on-site PV generation data.
This information allows for calculating electricity demand.
However, since the buildings belong to a University, there is
a clear seasonality of activities and therefore other included
features were the academic calendar (classes, exams and va-
cations) and the days of the week (weekends and weekdays).
The buildings do not directly collect any weather data,
therefore requiring the participation of a third party to provide
such data. Additionally, due to the physical proximity of the
buildings, only one weather dataset is needed, as defined in
the previous section as Dcf . The ”Wunder Ground” website
served as a third-party temperature, humidity, and solar
radiation data provider.
The net-demand and PV generation data have a periodicity
of 15 min, and therefore one year corresponds to a total of
35040 samples per building. The academic calendar and days
of the week are categorical data. In order to convert this data
into numeric values, a process known as One Hot Encoding
[15] was implemented. This process consists of splitting the
categories associated with variables and each sample. Put
differently; correspondent sub-categories are identified with
Fig. 2: Structure implemented in the buildings. one while others are assigned zero. In the simulations, three
sub-categories were considered for the academic calendars:
TABLE I: Proposed LSTM architecture. classes, exams, and vacations. Weekends and weekdays are
Layer Type LSTM cells Activation Function
separated as well.
LSTM Input 64 Relu The proposed FL framework was validated by splitting the
LSTM Hidden 32 Relu dataset of each building into two parts: 74% dedicated to
Dropout(0.2) Hidden - -
LSTM Hidden 32 Relu
training (used to train the local models) and the rest to testing
Dropout(0.2) Hidden - - (utilized to test the obtained models after the global training).
Dense Output - - The months of January, August, and October were selected
for testing the models in different seasonal conditions. The
remaining months were allocated to the training dataset. The
The datasets of the common features (Dcf ) are concate- model uses 25% of the training dataset for validation in the
nated to the private dataset (Dpd ), which is represented local training.
in Fig. 2 as Dcf ⌢ Dpd , and in Algorithm 2 on line 1.
Both datasets are constituted by time series, and to proceed IV. R ESULTS
with the aggregation an algorithm that implements the time The following parameters are used to test the proposed
matching between both was employed. The resulting dataset structure: R = 60, K = 3, Nl = 2, Nci = 64, Nch =
is used to train the model, and the final loss Lbr+1 , validation 32, Bs = 32, E = 6, Nop = 96, and Nof = 1. It should
b b
loss Vr+1 , and weights Wr+1 returned by the model are sent be noted that instead of defining a learning rate value, the
back to the aggregator. In order to calculate the net-demand, Adam optimizer was used, which inherently uses an adaptive
a dataset DG with the predicted generation was used. learning rate method.
The parameters associated with the structure implementa- The local models start converging after round 33, imposed
tion were the number of hidden layers Nl , the number of by the stopping criteria of the global model. Table II presents
LSTM cells for the input layer Nci , number of LSTM cells the obtained results: the θ value is the number of rounds in
for the hidden layers Nch , number of batch size Bs , number which each building participated, Ltraining is the lower loss
of training cycles (epochs) E, number of past observations value, r is the corresponding round number of the global
Nop , and number of forecast observations Nof . training. Also, p is the number of local rounds before stopping
the global model at round r. The Root Mean Square Error
III. DATA AND S CENARIOS (RMSE) of the model corresponding to the round r over the
The used data belongs to the University campus. In par- test dataset was calculated.
ticular, six buildings from the University of Coimbra were As can be inferred from the results of Table II, the proposed
selected. This dataset is identified by the department IDs: FL setup is implemented between 13 and 21 local trains in
DCE (Department of Civil Engineering), DChE (Department each building. It can also be observed that the round with
TABLE II: Achieved score results. V. C ONCLUSIONS
Results on Training Results on Test This paper proposes a novel approach for predicting net-
Building ID θ
Ltraining p r RMSE (r)
DCE 14 0.06878 12 27 5.39172 demand in transactive energy communities based on Feder-
DChE 17 0.03807 15 27 4.19676 ated Learning. The developed structure allows the integration
DECE 17 0.02663 8 14 3.25616 of third-party data providers, coordination by an aggregator,
DES 13 0.03695 10 23 4.85933
DIE 21 0.03076 20 31 3.02867 and collaborative learning among the buildings without shar-
DME 17 0.04138 16 31 5.89367 ing private data. The results present a high level of accuracy
and adaptability to different situations, for example, seasonal
variations.
In future work, the objective is to (i) develop a local model
lower loss values occurs before the last local train. Taking the
to predict on-site generation, (ii) devise a model for the
building DChE as an example, Fig 3 presents the loss value as
aggregator to predict the weather accurately, and (iii) enhance
of the global training convergences throughout rounds. Mean
local information processing units to select the best models
Squared Error (MSE) was used as the evaluation metric to
for each global training.
obtain the discussed results. The loss graph showcases the
decrease throughout the rounds and demonstrates learning R EFERENCES
over the course of training. Overlapping this graph with the [1] P. Moura, U. Sriram, and J. Mohammadi, “Sharing mobile and sta-
green vertical lines depicts that the loss presents higher values tionary energy storage resources in transactive energy communities,”
when the Fevederated Average calculus is implemented. in 2021 IEEE Madrid PowerTech, 2021, pp. 1–6.
[2] W. Tushar, T. K. Saha, C. Yuen, D. Smith, and H. V. Poor, “Peer-to-
Fig. 4 presents the predicted and real values for the test peer trading in electricity networks: An overview,” IEEE Transactions
dataset for the building DChE, to show an example of the on Smart Grid, pp. 1–1, 2020.
[3] P. Siano, G. De Marco, A. Rolán, and V. Loia, “A survey and evaluation
net-demand prediction achieved by the model where the of the potentials of distributed ledger technology for peer-to-peer
lower loss value on the training was achieved. Comparing the transactive energy exchanges in local energy markets,” IEEE Systems
obtained results over different months reveals the adaptability Journal, vol. 13, no. 3, pp. 3454–3466, 2019.
[4] P. Kairouz and H. B. M. et al., “Advances and open problems in
of the proposed model with respect to the seasonal variations. federated learning,” Foundations and Trends® in Machine Learning,
vol. 14, no. 1–2, pp. 1–210, 2021.
[5] W. Stainsby, D. Zimmerle, and G. P. Duggan, “A method to estimate
residential pv generation from net-metered load data and system install
date,” Applied Energy, vol. 267, p. 114895, 2020.
[6] D. Mariano-Hernández, L. Hernández-Callejo, F. S. Garcı́a, O. Duque-
Perez, and A. L. Zorita-Lamadrid, “A review of energy consumption
forecasting in smart buildings: Methods, input variables, forecasting
horizon and metrics,” Applied Sciences, vol. 10, no. 23, 2020.
[7] M. Cai, M. Pipattanasomporn, and S. Rahman, “Day-ahead building-
level load forecasts using deep learning vs. traditional time-series
Fig. 3: MSE values obtained throughout the global training techniques,” Applied Energy, vol. 236, pp. 1078 – 1088, 2019.
[8] P. Kobylinski, M. Wierzbowski, and K. Piotrowski, “High-resolution
in the DChE building. net load forecasting for micro-neighbourhoods with high penetration of
renewable energy sources,” International Journal of Electrical Power
& Energy Systems, vol. 117, p. 105635, 2020.
[9] Z. A. Khan, T. Hussain, A. Ullah, S. Rho, M. Lee, and S. W. Baik,
“Towards efficient electricity forecasting in residential and commercial
buildings: A novel hybrid cnn with a lstm-ae based framework,”
Sensors, vol. 20, no. 5, 2020.
[10] Y. Wang, I. L. Bennani, X. Liu, M. Sun, and Y. Zhou, “Electricity
consumer characteristics identification: A federated learning approach,”
IEEE Transactions on Smart Grid, vol. 12, no. 4, pp. 3637–3647, 2021.
[11] Y. M. Saputra, D. T. Hoang, D. N. Nguyen, E. Dutkiewicz, M. D.
Mueck, and S. Srikanteswara, “Energy demand prediction with fed-
erated learning for electric vehicle networks,” in 2019 IEEE Global
Communications Conference (GLOBECOM). IEEE, 2019, pp. 1–6.
[12] Y. L. Tun, K. Thar, C. M. Thwal, and C. S. Hong, “Federated learning
based energy demand prediction with clustered aggregation,” in 2021
IEEE International Conference on Big Data and Smart Computing
(BigComp), 2021, pp. 164–167.
[13] Q. Yang, Y. Liu, Y. Cheng, Y. Kang, T. Chen, and H. Yu, Federated
Learning. Morgan & Claypool, 2019, vol. 13.
[14] H. B. McMahan, E. Moore, D. Ramage, S. Hampson, and B. A.
y Arcas, “Communication-efficient learning of deep networks from
decentralized data,” in AISTATS, 2017.
[15] I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning. MIT
Press, 2016, http://www.deeplearningbook.org.

Fig. 4: Net-demand in the building DChE in the global round


r = 27 (real values in blue and prediction in orange).

You might also like