Energy Demand Prediction
Energy Demand Prediction
ABSTRACT Today’s drivers of battery electric vehicles must deal with limited driving range in a sparse
charging infrastructure. An accurate prediction of energy demand and driving range is therefore important
and enables reliable routing and charge planning applications. Predictions of energy demand entail uncer-
tainty, which can be considered directly with the use of probabilistic prediction algorithms. Machine learning
algorithms are frequently applied in this context, but data used to train these algorithms are often distributed
over a fleet of connected vehicles. Federated learning can be applied in this setting, but predictive uncertainty
is typically not considered. We apply an extension of the federated averaging algorithm to learn probabilistic
neural networks and linear regression models in a communication-efficient and privacy-preserving manner.
We demonstrate the performance advantage of probabilistic prediction models over deterministic prediction
models using proper scoring rules. Furthermore, we show that federated learning can improve the standard,
driver-individual learning. Using probabilistic predictions, variable safety margins based on destination
attainability can be applied, leading to increased effective driving range and reduced travel time.
INDEX TERMS Electric vehicles, energy demand prediction, probabilistic predictions, range estimation.
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
VOLUME 2, 2021 151
THORGEIRSSON ET AL.: PROBABILISTIC PREDICTION OF ENERGY DEMAND AND DRIVING RANGE
predictive data are required for an accurate prediction. Few In the context of driving range, energy demand and BEV
researchers have addressed the issue of uncertainty of these routing, few articles have addressed predictive uncertainty.
predictions [5]. Probabilistic predictions compute probability Oliva et al. describe remaining driving range as a random
densities for the target variable, so that uncertainty is directly variable, where the remaining battery energy is estimated with
taken into account. The required predictive data come from an unscented Kalman filter and the driving profile is pre-
different sources in a distributed system, which comprises dicted with a Markov chain. With that, a probability density
a network of connected vehicles and backend infrastructure function for the remaining driving range is computed [21].
in the cloud. A prediction algorithm utilizing data from this Ondruska and Posner trained linear models to describe the
network must guarantee the privacy of the users and be able to mean and the variance of the energy consumption based on
function without excessive computation and communication road segment features. Thereby, two deterministic models are
overhead. To this end, we can apply federated learning (FL), used to calculate the parameters of a normal distribution for
which is a ML scheme where each end device learns from the prediction of energy consumption [22]. Scheubner et al.
local data. A centralized server creates a global model by used a multi-linear regression (MLR) model to compute a
aggregating the model weights received from the devices at stochastic velocity prediction, which is then used to predict
regular intervals [13]. The global model is then sent back to a probability distribution for the energy consumption using a
the devices where the learning continues. federated learning physical model and a sequential Monte Carlo simulation [5].
(FL) algorithms, such as federated averaging (FedAvg), are Furthermore, the uncertainty of EDPs has been considered in
typically applied when a large dataset is desired, but shar- BEV routing applications [23]–[26].
ing data between devices is not possible or too expensive. Data-driven predictions such as with ML algorithms benefit
Recently, an extension of FedAvg with predictive uncertainty from a rich training dataset [27]. A few articles have proposed
was presented, called FedAvg-Gaussian (FedAG). There, un- sharing data between vehicles and the cloud, so that a user
certainty is introduced in the aggregation step of the algorithm can benefit from the experience of other users, ultimately
by treating the set of local weights as a posterior distribution leading to more accurate predictions. Grubwinkler et al. pro-
for the weights of the global model [14]. posed an energetic road map created through crowd-sourcing
This paper presents the application of FedAvg and FedAG by collecting information on energy consumption of BEVs
to the prediction of the energy demand of a BEV on a planned while driving a road segment [28]. Tseng and Chau applied
route. We show an efficient way to learn probabilistic ML the concept of participatory sensing to gather crowd-sourced
models, evaluate and accentuate the advantages of proba- data for the prediction of vehicle energy demand [29]. Straub
bilistic EDPs and demonstrate their effect on battery utiliza- et al. presented another approach for creating an energetic
tion and travel time. The paper is organized as follows: An road map, by collecting crowd-sourced driving profiles where
overview of related work is given in Section II. In Section III, the gaps in data coverage were eliminated using ML meth-
the system architecture and available predictive data are pre- ods [30].
sented. The EDP algorithms and federated learning schemes By applying FedAG to the EDP problem, the advantages
are described in Section IV and the validation of the prediction of crowd-sourcing can be extended to probabilistic models
is shown in Section V. The benefit in safety margin and travel in an efficient and privacy preserving manner. Recent pub-
time is discussed in Section VI before the paper is concluded lications showed the application of FL in vehicle-to-vehicle
in Section VII. (V2V) communications [31], in autonomous driving [32], and
in traffic flow prediction [33]. To the best of our knowledge,
II. BACKGROUND AND RELATED WORK FL has not yet been applied in EDP for BEVs.
Current practice in energy demand prediction (EDP) is to use
information from the vehicle, such as driving speed, accelera- III. SYSTEM DESIGN AND DATA
tion, and historic energy consumption together with predictive The digital ecosystem in which the EDP operates is a dis-
information about the planned route from a traffic and routing tributed system of connected vehicles and backend infrastruc-
database (TRDB). TRDB information comprises static map tures in the cloud. In this distributed system, large amounts of
data, e.g., road slope, legal speed limit, and dynamic data data can be used to learn ML models, which typically have
such as live traffic. The prediction itself is typically performed high computational requirements. The central challenge is to
using mechanistic models based on physical principles [6], make use of information in the distributed system to enable ac-
[15]–[17]. In recent years, ML algorithms have been trained to curate and robust probabilistic predictions, while considering
find the relation between the available predictive information aspects such as privacy protection and lean communications.
and the resulting energy consumption [18]–[20]. The main In our previous work [34], we demonstrated the impor-
advantage of ML algorithms is that an exact modeling of tance of system architecture and module placement for the
the mathematical relation between a feature and the target performance and user experience of driving range prediction
variable is not necessary, or rather, the ML algorithm au- and charge planning software. By placing the prediction al-
tomatically creates this model. Additionally, hybrid models, gorithm parts intelligently across the vehicle and cloud, the
combining a mechanistic model and ML, can be applied [5], performance can be increased. Following that, the prediction
[7]. algorithm presented in this work can be implemented in an
FIG. 1. Schematic overview of the distributed system. B. MAP AND TRAFFIC DATA
To complement the driving data measured in the vehicles, map
and traffic data are acquired to match the driven routes. Using
the GPS traces from the measurement drives, the measured
data can be matched to a map. Using the IDs of the road seg-
ments that form the driven route, the TRDB can be queried to
obtain static map data as well as real-time traffic information.
The TRDB includes a list of properties such as road slope α,
street class , mean traffic speed u, road curvature κ, legal
speed limit vlim , segment length l etc. The TRDB does not
only report the mean traffic speed but also information on
FIG. 2. Powertrain model with input variables v, Fr and output variable Ec . its distribution, such as standard deviation σu and percentile
The red arrows indicate simulated component losses. values Pi (u) in steps of 5% [35]. A further aspect of traffic is
the traffic phase. The three-phase traffic theory divides traffic
efficient system architecture. The learning of the models is into free flow, synchronized flow, and wide moving jam [36]. A
method to classify the traffic phase directly in the vehicle was
performed in the vehicle, so that training data remains in
presented in [5]. Using this method, the estimated traffic phase
the vehicle. Thereby, the communication between the vehicle
and the cloud covers only the transfer of the model weights. is included in the dataset. Contrary to the measured driving
data, map and traffic have a much lower spatial resolution,
Furthermore, the predictions are computed in the cloud, so
that the transmission of predictive data from the cloud to the where a typical segment length is 200 m.
vehicle is reduced to the final predictions. In that way, the
C. VELOCITY PERCENTILE ESTIMATION
amount of data transferred between the vehicles and the cloud
is minimized. Fig. 1 shows an overview of the distributed An important factor in the energy consumption pattern is the
system. The ego vehicle and the vehicle fleet share their model driving speed. In this work, we rely on the velocity reported by
weights W in a central backend in the cloud, where a proba- the TRDB. As different drivers may exhibit different driving
bilistic neural network (NN) is built. When a destination D styles and cruise at different speeds in free flowing traffic,
is entered in the ego vehicle’s navigation system, the route we individualize the velocity predictions. To this end, we
and predictive information is queried in the TRDB and a observe to which percentile of the velocity distribution the
probabilistic EDP Ec is computed with a NN. driver belongs on a complete trip. By minimizing the squared
error between ego vehicle speed and percentile values of the
traffic speed distribution, the best matching percentile can be
A. MEASUREMENT DRIVES AND POWERTRAIN MODEL
found:
In this work, we use a dataset first presented in [5]. The dataset
includes 20 real world measurement drives performed by 10 ρd = argmin (v − Pi (u))2 , (1)
different drivers. All relevant data is logged in the vehicle i
with a sampling rate of 10 Hz. To generate unified driving where ρd is the percentile that best matches driver d, v is the
data from the pool of measurements with different vehicles, a speed of the ego vehicle, and Pi (u) is the i-th percentile of the
simulation model for the powertrain of an electric vehicle is traffic speed distribution u. As the traffic speed distribution
used. The simulation model calculates the power P and energy is very narrow in the case of a traffic jam, we only look at
Ec drawn from the battery based on velocity v and driving synchronized flow and free flow to determine the best fitting
resistance Fr . Fig. 2 shows a schematic overview of the power- percentile.
train model. Based on efficiency maps for components such as For each of the drives, (1) is used to find the best fitting per-
the gearbox (GB), electric motor (EM), and power electronics centile. Fig. 3 presents the results of the velocity prediction.
D. DESTINATION ATTAINABILITY
With a probabilistic EDP and a known available battery en-
ergy, the probability of reaching a destination, i.e., destina-
FIG. 8. Boxplots showing the distribution of the DS of the probabilistic
tion attainability p(a), can be calculated [5]. However, this is
EDP algorithms.
not possible with a deterministic EDP. The available battery
energy is a variable that cannot be measured directly, but is
energy consumption at each point in the drive. The measured estimated with some uncertainty [41]. The attainability can
energy consumption is shown in purple. Additionally, the pre- thus be calculated with
dicted traffic speed percentile value is shown in yellow and the c ) = p(E
b ≥ E b − E
c ≥ 0) ,
p(a) = p(E (11)
observed driving speed is shown in blue. In Fig. 3(a), driver
9 displayed a moderate inconsistency in driving speed (55th where E b is the estimated available battery energy. Addition-
and 70th percentiles). In Fig. 7, the velocity prediction fails ally, the amount of energy needed to achieve p(a) = 0.99
to predict high driving speed of up to more than 50 ms−1 can be calculated using the inverse of the normal cumulative
at around 80 km. Nevertheless, the measured driving speed distribution function :
deviates a little from the predicted velocity and the observed
c,p = μ + σ
E −1
(p) . (12)
energy consumption always lies within the confidence interval Ec Ec
of the prediction. With (12), the amount of energy to be charged in order to
reach a destination can be computed. An important feature
C. SHARPNESS of the prediction and attainability estimation is that the des-
The sharpness of a prediction is a measure for the concentra- tination is ultimately reached. To analyze this, we compute
tion of the predictive distribution. One way to measure sharp- the energy needed for p(a) = 0.99 with (12) for each drive,
ness of normally distributed predictions is the determinant b to this value and observe the
set the initial battery energy E
sharpness (DS) defined as attainability p(a) during the trip. Fig. 9 shows the progression
of the destination attainability over the course of all drives.
DS = det ( )1/2 d , (10)
In some drives, the attainability exhibits fluctuation, e.g., in
where is the covariance matrix of the predictive distri- drives 12 and 19, p(a) is significantly lower than 0.99 at times.
bution of dimension d × d. The EDP is univariate (d = 1) The gradient of a sharp prediction’s cumulative distribution is
and the DS therefore reduces to the standard deviation of proportionally large, so that a single maneuver, e.g., strong
the predictive distribution. Fig. 8 shows boxplots displaying acceleration during overtaking, can have a significant impact
the distribution of the determinant sharpness of the predic- on the attainability. However, the attainability converges to
tions on all drives for the three probabilistic algorithms. The 1 when the destination is approached and the destination is
NN computes significantly sharper predictive distributions reached in all drives. The linear models trained using FedAG
than the LRs in all drives. The clustering in FedAGC brings and FedAGC are also able to accurately estimate the attain-
a marginally significant benefit in sharpness compared to ability.
E. CALIBRATION
The value p(a) can also be called the confidence of the
attainability estimation and the observed ratio of drives in
which the destination is reached can be denoted as accuracy.
If the confidence always matches the accuracy, the prediction
is well calibrated [42]. A measure for the calibration of the
attainability decision is the difference in expectation between
confidence and accuracy FIG. 10. Reliability diagram for the destination attainability estimation
using the probabilistic EDP algorithms.
E P Y = Y |P̂ = p − p , (13)
where the accuracy term P (Y = Y |P̂ = p) is the probability
of the prediction Y being equal to observation Y given the for p < 0.5 but slightly over-confident for p > 0.5. Guo et al.
estimated confidence P̂ = p of the predictor. A perfect cali- discovered that modern NNs are often poorly calibrated [42].
bration, although impossible, is when the expected difference A poorly calibrated prediction can not only lead to a driver be-
is zero [43]. Using (12) and the observed energy consumption, ing stranded with an empty battery, but also to a significantly
the accuracy for different p-values can be computed. In our higher travel time if the prediction tends to be under-confident.
application, accuracy β is the empirical frequency of success- Nonetheless, all three probabilistic EDP algorithms exhibit a
ful trips given EDP Ec,p and confidence p sufficient calibration.
1 ( j)
β(p) = 1 Ec,p ≥ Ec( j) , (14) VI. SAFETY MARGIN AND TRAVEL TIME
ND
j A central task of the EDP is to enable certain decision making
where ND is the total number of drives. The expected cal- for attainability and charge planning. The requirement is to
ibration error (ECE) is defined as mean difference between predict the energy demand so that a destination can be reached
accuracy and confidence safely without an unnecessary large safety margin bE . A
safety margin is the proportion of battery energy reserved in
1 case of an inaccurate prediction. A robust EDP should thus
ECE = |β(pi ) − pi | , (15)
Np maximize the probability of attaining the destination while
i
minimizing the safety margin, which in turn maximizes the
where N p is the number of confidence levels p tested. The effective driving range of the vehicle. The user primarily ex-
maximum calibration error (MCE) is the maximum difference periences how far he can drive without charging and how fast
ECE = max |β(pi ) − pi | . (16) he can travel from A to B. Hence, the user experience is pos-
i itively influenced by an appropriate safety margin. The safety
Finally, the idealized root mean square calibration error (RM- margin is closely related to the sharpness of the prediction
SCE) is defined as and a sharp prediction leads to a smaller safety margin than a
less sharp prediction. In the following, we analyze the safety
1
RMSCE = |β(pi ) − pi |2 . (17) margins resulting from the EDPs and their impact on travel
Np time.
i
REFERENCES
[1] M. Eisel, I. Nastjuk, and L. Kolbe, “Understanding the influence of in-
vehicle information systems on range stress—Insights from an electric
vehicle field experiment,” Transp. Res. Part F: Traffic Psychol. Behav.,
vol. 43, pp. 199–211, 2016.
[2] T. Franke, I. Neumann, F. Bühler, P. Cocron, and J. Krems, “Experi-
encing range in an electric vehicle—Understanding psychological bar-
riers,” Appl. Psychol.: Int. Rev., vol. 61, no. 3, pp. 368–391, 2012.
[3] A. T. Thorgeirsson, S. Scheubner, S. Fünfgeld, and F. Gauterin, “An
investigation into key influence factors for the everyday usability of
electric vehicles,” IEEE Open J. Veh. Technol., vol. 1, pp. 348–361,
Oct. 2020.
[4] Y. Zhang, W. Wang, Y. Kobayashi, and K. Shirai, “Remaining driving
range estimation of electric vehicle,” in Proc. IEEE Int. Electric Veh.
FIG. 12. Proportional charging time reduction between probabilistic and
Conf., Greenville, SC, USA, 2012, pp. 1–7.
deterministic EDP algorithms.
[5] S. Scheubner, A. Thorgeirsson, M. Vaillant, and F. Gauterin, “A
stochastic range estimation algorithm for electric vehicles using traf-
fic phase classification,” IEEE Trans. Veh. Technol., vol. 68, no. 7,
pp. 6414–6428, Jul. 2019.
significantly sharper than those performed with LRs. Further- [6] F. Morlock, B. Rolle, M. Bauer, and O. Sawodny, “Forecasts of elec-
more, the variance of sharpness and bE is lower. This leads tric vehicle energy consumption based on characteristic speed profiles
to the somewhat smaller charging time reduction. Neverthe- and real-time traffic data,” IEEE Trans. Veh. Technol., vol. 69, no. 2,
pp. 1404–1418, Feb. 2020.
less, considering predictive uncertainty explicitly improves [7] L. Thibault, G. D. Nunzio, and A. Sciarretta, “A unified approach for
charging and travel time, especially in regions with sparse electric vehicles range maximization via eco-routing, eco-driving, and
charging infrastructure. energy consumption prediction,” IEEE Trans. Intell. Veh., vol. 3, no. 4,
pp. 463–475, Dec. 2018.
[8] Z. Yi and P. H. Bauer, “Optimal speed profiles for sustainable driving
VII. CONCLUSIONS AND FURTHER WORK of electric vehicles,” in Proc. IEEE Veh. Power Propulsion Conf., 2015,
pp. 1–6.
A network of connected BEVs and backend infrastructure in [9] Z. Yi and P. H. Bauer, “Energy aware driving: Optimal electric vehicle
the cloud constitute a distributed system with various sources speed profiles for sustainability in transportation,” IEEE Trans. Intell.
of information relevant for the energy demand prediction. Transp. Syst., vol. 20, no. 3, pp. 1137–1148, Mar. 2019.
[10] A. Fotouhi, N. Shateri, D. S. Laila, and D. J. Auger, “Electric vehicle
By applying federated learning and computing a probabilistic energy consumption estimation for a fleet management system,” Int. J.
prediction, the uncertainty of the distributed data is considered Sustain. Transp., vol. 15, no. 1, pp. 40–45, 2020.
in a communication efficient and privacy preserving manner. [11] Z. Yi and P. H. Bauer, “Optimization models for placement of an
energy-aware electric vehicle charging infrastructure,” Transp. Res. Part
With a multi-scale regression, the prediction models can be E: Logistics Transp. Rev., vol. 91, pp. 227–244, Jul. 2016.
trained using data measured in the vehicles while the pre- [12] S. Deepak, A. Amarnath, G. KrishnanU, and S. Kochuvila, “Survey
dictions are computed with data from TRDB directly in the on range prediction of electric vehicles,” in Proc. Innov. Power Adv.
Comput. Technol. (i-PACT), 2019, pp. 1–7.
cloud. The energy demand predictions are validated with real [13] B. McMahan, E. Moore, D. Ramage, and B. A. y Arcas,
driving data and the performance is measured with proper “Communication-efficient learning of deep networks from decentral-
scoring rules. The performance of the probabilistic predictions ized data,” in Proc. 20th Int. Conf. Artif. Intell. Statist., ser. Proceedings
of Machine Learning Research, A. Singh and J. Zhu, Eds., vol. 54. Fort
is superior to conventional deterministic predictions. Further- Lauderdale, FL, USA: PMLR, Apr. 20–22, 2017, pp. 1273–1282.
more, a non-linear model (NN) achieves higher performance [14] A. T. Thorgeirsson and F. Gauterin, “Probabilistic predictions with
in terms of CRPS and RMSE than a linear model (LR). A federated learning,” Entropy, vol. 23, no. 1, Dec. 2020, Art. no. 41.
[15] Z. Yi and P. H. Bauer, “Adaptive multiresolution energy consumption
probabilistic prediction allows the estimation of destination prediction for electric vehicles,” IEEE Trans. Veh. Technol., vol. 66,
attainability, i.e., the probability of reaching a destination us- no. 11, pp. 10515–10525, Nov. 2017.
ing the available battery energy. The calibration of this esti- [16] S. Grubwinkler, M. Kugler, and M. Lienkamp, “A system for cloud-
based deviation prediction of propulsion energy consumption for EVs,”
mation is sufficient and the error between accuracy and confi- in Proc. IEEE Int. Conf. Veh. Electron. Saf., 2013, pp. 99–104.
dence is low for all algorithms. A further advantage of an ac- [17] A. Jayakumar, F. Ingrosso, G. Rizzoni, J. Meyer, and J. Doering,
curate, probabilistic energy demand prediction is the variable “Crowd sourced energy estimation in connected vehicles,” in Proc.
IEEE Int. Electric Veh. Conf., Dec. 2014, pp. 1–8.
safety margin. This leads to a better utilization of the battery [18] S. Sun, J. Zhang, J. Bi, and Y. Wang, “A machine learning method for
energy and increases the effective driving range. Additionally, predicting driving range of battery electric vehicles,” J. Adv. Transp.,
this translates into a shorter travel and charging time on long vol. 2019, pp. 1–14, Jan. 2019.
[19] A. Fukushima, T. Yano, S. Imahara, H. Aisu, Y. Shimokawa, and Y.
distance trips. Our further work includes more research on Shibata, “Prediction of energy consumption for new electric vehicle
how global, federated models can be personalized for the par- models by machine learning,” IET Intell. Transport Syst., vol. 12, no. 9,
ticipating drivers. The analysis of system design, network us- pp. 1174–1180, 2018.
[20] C. D. Cauwer, W. Verbeke, T. Coosemans, S. Faid, and J. V. Mierlo,
age, and transmission time might prove an important area for “A data-driven method for energy consumption prediction and energy-
future research [44]. Moreover, an ever-expanding database efficient routing of electric vehicles in real-world conditions,” Energies,
of real driving data can be used to confirm the presented vol. 10, no. 5, May 2017, Art. no. 608.