Enhancement of energy consumption estimation for electric vehicles by using machine learning

,

INTRODUCTION Global warming, an international treaty to reduce greenhouse gas emissions has emerged: it is the Kyoto protocol. The commitments made are binding on the different signatory countries. One of the key commitments is to reduce emissions of these gases by at least 5% from the 1990 level for 2012. Faced with this problem, the European Union has adopted '3x20' objectives by 2020: i) Increase to 20% the share of renewable energies, ii) Reducing CO2 emissions by 20% compared to 1990, and iii) Increase energy efficiency by 20%.
In order to achieve these objectives, various stakeholders are working to propose different solutions for the transport of people, among other things. In this way, as we know that drivers waste several minutes in finding a parking place, the authors of [1] were interested in proposing a model of car parking assistance system using camera networks in order to reduce the ecological footprint. Other work aims to improve traffic flow while reducing the impact on the environment by removal toll plazas [2][3][4]. These work gave rise to the pre-standard [5]. For the case of electric vehicles, the authors of [6,7] have proposed an intelligent navigation systembased optimization of the energy consumption. Authors have used a proprioceptive and exteroceptive sensors in order to propose to drivers the optimal path based energy consumption. It is a mathematical modelling of the Ì ISSN: 2252-8938 vehicle's behaviour and the discharge of the battery. The personal behaviors of driver and their impacts were not considered in terms of energy consumption. However, we know the behavior of battery discharge depends on many parameters. The same vehicle equipped with the same type of battery may behave completely different depending on where the vehicle travels (countries with snow, cold or hot weather), whether the vehicle sleeps outside or inside a garage, type of driving and the use of the vehicle's accessories (listening to the radio, turning on the heating or air conditioner, and recharge mode (fast or slow). All these parameters are difficult to model. Today, we know that drivers complain that estimated charge battery presented in the dashboard of electric vehicle are mostly time inaccurate. In the literature, many studies have been proposed for the prediction of range to improve the efficient use of electric vehicles (EVs) and in which they take into account single factor that influence EV range. In [8], a interesting presentation and study of the different issues and challenges for EVs range prediction have been introduced. The analysis was carried out by the study of the impact of different factors which has a significant correlation with the range estimation. The study takes into account three major classes of significant factors: The vehicle design, the driver, and the environment. Significant parameters were identified like constant parameters (vehicle type, transmission, mass, weight, battery type, charging station, and road.) and variable parameters (battery state of charge and battery state of health [9], driver behavior [10], traffic flow [11], and external environment factors [12,13]). The proposal introduced in [8] concludes that the EV's range prediction is currently, and in most cases, based on state of charge estimation of the battery pack (54%). The ambient temperature (25%), driver behavior (10%), and route (6%) comes after but still significant too. In [14], another approach which studied the impact of the driver in the EVs consumption is to use data-driven for driver's behavior modelling. Authors present a good way to increase the acceptance of driver assistance systems by adapting them to both needs and behavior of the driver. For this, the authors use vehicle data combined to probabilistic affiliation of the driver (anxious, and aggressive.). An anticipatory energy saving assistant (ANESA) [14] was developed for giving driving hints/instruction for reducing energy consumption specifically in tight curves. This is done through a probabilistic map including possible destinations in which both of state of charge (SoC) parameter and EV's energy consumption were considered as random variables. This approach uses an inverse reinforcement learning method from [15]. In [15], the authors present an innovative approache which combined several kinds of parameters (EV parameters, road conditions, traffic, weather, and historical driver behavior.) to determine the range autonomy with high accuracy. The estimation of the EV range is based on data mining with regression model. Today, models which combine multiple factors in a single model present more and more efficient results. Different approaches are taken into account the topology of the road as an impact factor to reduce the energy consumption. One way to combine different factors is to assign them to a discrete segment of road like Google Maps [8]. In [16], the road network is considered as a graph in which each segment includes different factors that influence the EV's consumption like traffic, air temperature, and climbing of descending angle. In [17], the authors have extended the algorithm in order to handle negative cycle costs which are caused by the energy recuperation. The algorithm produced for each road segment a cost function which is equal to the amount of energy necessary to carry out the segment road. The graph representation presents high efficient even it does not take into account the driver behavior [16,18]. In [19], new model-based approach for predicting remaining driving range (RDR) was developed in which we can find a combination between both particle filter and Markov chains. The RDR prediction is represented as a probability distribution approximated by a set of weighted particles. The model takes into account only some parameters like battery model, electric powertrain, and vehicle dynamics. The development was validated through simulation including different driving situations. The proposed approach has as an objective to make contribution for generating reliable information regarding the RDR that could improve the quality of EV's driving assistance systems [8,19]. A lot of scientist and engineers give more and more attention to state of function (SoF) estimation technology of power lithium ion batteries. In [20], a fuzzy c-mean clustering algorithm was developed in order to estimate the SoF of the EV's power lithium-ion battery. The fuzzy estimation is improved by the fuzzy c-mean algorithm taking into account at least three parameters as input (Battery state of charge, battery state of health, and charge-discharge rate). The authors conclude that experimental results demonstrate the advantage of the estimation model presented with the average error of estimation which approximate 8.69%. In [21], a torque management strategy for pure electric vehicle based on fuzzy control is presented. The approach is based on an electric vehicle model-based AVL cruise. The authors has validated the approache and simulation results shows that fuzzy control torque management strategy improves the car's energy consumption.
We can note that one of the major fears of drivers is to break down due to the lack of energy before Int J Artif Intell ISSN: 2252-8938 Ì 217 reaching their destination. However, as explained in the previous paragraph, many factors can influence the energy consumption of an electric vehicle. Existing models are impersonal. In this work, we are interested in energy optimization for electric vehicles using machine learning. The aim is to give priority to personal data in order to check whether the electric vehicle has enough energy to reach its destination before proposing the shortest route in terms of energy consumption.

THE PROPOSED METHOD
Existing models were based on both shared real-time data like traffic and mathematical model for energy consumption in order to calculate the optimal path. However, we know in the reality one of the big challenges is to estimate the energy consumption. It is very important to take into account the battery state-ofhealth and the particularities of each electric vehicle model. Furthermore, we know some journeys are regular, in particular home-to-work journeys.
In our approach, we will propose to consider historical data in order to predict the energy consumption of the journey. For that, we propose to use a machine learning and especially k-NN algorithm [22] which is a lazy learning. As input, we use the data composed of: − IDDriver: It is a random number used in order to identify the driver. In order to respect the general data protection regulation (GDPR), this number is not associate with the real identity of the driver. − Departure place: Corresponds to the current position of the vehicle. − Destination place: It is the destination of the journey. − Date: It is the date of the journey. We know the date can influence directly the traffic. In fact, the day before the holidays, the traffic is generally crowd. When the driver want the optimize the consumption energy of his trip, he need to define his destination in mobile application. The latter will estimate the energy consumption by applying our proposed algorithm. The aim is, in first step, predict the energy consumption of the journey, and, in the second step, propose the optimal path in terms of energy consumption by using A * algorithm.

Mathematical notation
We represent the map by a directed graph G(V, E) where E represent the edges ,i.e., the routes in the map and V represent the vertices i.e. the intersection between edges. We assume that for each edge an energy consumption E c : E → R is given. That represent the weight of each edge.
A N (A(x, y)) represents the set of the neighbours of the point A. N (A(x, y) (A, B) represents the set of paths from N (A(x, y)) to N (B(x, y)) taken by the driver . N driver (A, B) and v ∈ N driver (B)}. The predict of energy consumption of the journey notedÊ c (A, B)

Proposed algorithm of estimation energy consumption
The proposed algorithm illustrated in Figure 1 is based on k-NN algorithm. The aim is to estimate the consumption energy by calculating the average of the values of k nearest neighbours. If we do not have enough data, we use our mathematical model proposed in [6,7].  N (B(x, y))) the closest point from A and B, respectively, and known in training observations − We target all neighbor points from point A in the zone which is delimited by one square see Figure 2.
The coordinates of upper left corner are (x A − 50m, y A − 50m) and the coordinates of the down right corner are (x A + 50m, x A + 50m). We do the same job for the point B.
(a) Fetch the data of the current driver by its ID for the last month (b) If the number of fetched data is less than k, fetch the data of all drivers (c) Calculate the distance between the B destination point and fetched points in the target zone by using the Manhattan distance: D m (x, y) = k i=1 |x i − y i |. (d) Sort the calculated distance by ascending order (e) Select the smallest k-values ,i.e., k-points − If the number of fetched data is less than k, return the estimated value calculated by our mathematical model presented in [6,7], else return the predicted energy consumptionÊ c of the journey which is equal to: where, E c (A i , B i ) is the function which fetch the energy consumption of i th -journey from point A i to point B i . This value is fetched from training observations, and k is the number of selected neighbor points. α i represents the weight of the i th -journey where k i=1 α i = 1 We assign the greater weight for the closer neighbors of the journey A-B than the neighbors which are further away.

Proposed algorithm of shortest path in terms of consumption energy
In order to propose the optimal path on terms of energy consumption, we were inspired by the A* algorithm. The used cost function in (2) is composed of two terms. The first term t(n) which represents the real cost value to reach node n. The second term h(n) represents the estimation of energy consumption calculated by our proposed algorithm.
Our shortest path algorithm (SPA) will also maintain two lists, same with A * algorithm, openlist and closelist. Nodes in openlist are nodes which are going to be visited and nodes in closelist are nodes which have been visited. The whole process is detailed as: − Add the departure point into the openlist; − Repeat the following process: (a) Traverse the openlist to find the node u with the smallest estimated value (b) Delete u from openlist and add to the closelist (c) Traverse the connected nodes v. If v is in the closelist, ignore it. If v is not in the openlist, add it to the openlist (add a pointer to the node from). If v is in openlist, check whether the estimation value is smaller than the previous one. If so, update the value. − If node u is the destination node, break the loop. If openlist is empty, break the loop. In this case, it means that the destination node is unreachable from the departure node. We are about to use the heuristic estimation function of the energy consumption model in which the h(n) value is the energy consumption between the departure node and the destination node and the value of Ì ISSN: 2252-8938 t(n) is the energy already consumed from the departure node to the current node. This is also a kind of the best-first algorithm which select always the greedy strategy in each step.

RESULTS AND DISCUSSION
In order to evaluate our proposed model, we use the simulator simulation of urban mobility (SUMO) [23]. We choose to simulate the traffic around our laboratory. We can see in the Figure 3 the map used for our simulation. In the Figure 4, we illustrate the coordinates of departure and destination points. The default model of electric vehicle energy consumption [24], provided by SUMO, is used. The weather is not considered in our simulation because this parameter is not implemented in SUMO. In this simulation, the departure and the destination point are taken totally randomly. The used training data set are composed of 12000 journeys which represent 70% of data. In each entry of the training data set, we have several parameters, including vehicle id, coordinate of the departure and destination point, departure time, traffic situation indicator, vehicle type, total trip distance, energy consumption and duration of the trip. We call the process from the vehicle start at the departure point until the vehicle stops at the destination as a trip.
The first step is to generate the training data. First of all, in the part of simulating the traffic flow, we use the RandomTrips script provided by SUMO, and the generated vehicle behavior conforms to the Poisson distribution. We estimate that as a possible traffic flow situation. Then we add EV in the traffic. The departure and destination positions are randomly distributed. The vehicle mass, the maximum battery capacity, the maximum power, the front surface area, the air drag coefficient, the radial drag coefficient, the rolling resistance coefficient, recuperation and drive efficiency and other parameters remains the same. A given time slot, a certain number of EV are added to the traffic. Here, we assume that the number of newly added EVs is relatively small compared to the original traffic flow in the map.
During the simulation of EV driving, we need to record the three parameters of the travel distance, duration of the trip and vehicle's energy consumption until the vehicle reaches the destination point. At the same time, we also have the other 6 parameters: vehicle id, coordinate of the departure and destination point, departure time, traffic situation indicator, vehicle type. We define the waiting time: if the speed of the EV in the current time step is less than 0.1 m/s, then the vehicle is considered as in the waiting state. The waiting time is calculated from the last time when the EV speed is greater than 0.1 m/s until the next time when the vehicle's speed is greater than 0.1 m/s. The second step is to use our proposed algorithm (based on k-NN) of estimation consumption energy.

Int J Artif Intell
ISSN: 2252-8938 Ì 221 We use the sklearn library [25] in order to implement our algorithm. The core process has been described before. We just need to provide the input parameters which are the coordinates of departure and destination point, departure time which is usually the current time, traffic situation indicator and the vehicle type which is mostly the electric car in our case. Then, we can obtain the estimated value of the energy consumptionÊc. By changing the value of K, we can achieve different estimation results with different accuracy. In Figure 5, we present the explained variance of the test data by picking different k-value from 1 to 10 to find that the best choice of the k-value is 5 which is equal to 0.964529. The closer the value is to 1, the more accurate the model is. Also, we can see in Figure 6 the root mean square error in function of k-values.
We can see the distribution of test data in Figure 7. Each point in the curve represents one journey. The x-value represent the real energy consumption (obtained by simulation) and the y-value represents the estimated energy consumption obtained by our proposed algorithm.  The third step is to apply the proposed algorithm of estimation energy consumption (with k-value determined by the previous step) to the algorithm of shortest path. We just need to modify the heuristic function part. Usually, the Euclidean distance between the departure point and the destination point for the heuristic estimation function is used. In order to take into account the energy consumption model, we replace the heuristic estimation function with calculating the energy consumption between the departure point and the destination point. It should be noted that the value of t(n) in the cost function will also changed to the energy already consumed.
To find the best value of k in the proposed algorithm of energy consumption estimation, we have randomly selected the departure and destination points as the test data for simulation. At the same time, we use our proposed algorithm to estimate the test data in order to calculate the accuracy of the estimation results. By changing the value of K, we can achieve different estimation results with different accuracy. In Figure 5, we present the result of the test data by picking different k value from 1 to 10 to find that the best choice of the k-value is 5.

CONCLUSION
In the literature, many studies and approaches have been presented to estimate and optimise the EV energy-consumption. Some of them consider only a single factor that influence EV energy consumption, while on the other hand they consider all factors which could be significant in the EV energy consumption. Offering the most accurate estimation of energy consumption is a major point if we want to convince more consumers to switch to EV. Several factors impact this consumption and are difficult to model. In this paper, we have provided a solution based on lazy learning approach in order to obtain the best estimation of energy consumption and to propose the optimal path to reach a destination. The obtained results achieved using simulation tools are very promising. As a future direction, firstly, we plan to carry out full-scale tests in order to verify the relevance of the obtained results. Secondly, we should improve the quality of the model developed by investigating artificial intelligence-based solutions and particularly deep learning. To do so, we have designed a deep learning vision model under hybrid datasets (publicly available datasets combined with our own datasets acquired in real traffic conditions) for smart and secure mobility. We will integrate and adapt them to build and train a model for energy consumption in order to have a full platform in which both security and energy-consumption optimisation will be considered as a two main factors in the future EV. Therefore, within the same deep learning architecture, we propose to incorporate the relationship between all parameters related to environment, driver behaviour, and vehicle model.