## 1. Introduction

In the last decade, there has been a trend of connecting the electric energy and transport systems through the appearance of electric vehicles (EV) and the need for their charging. Increased proliferation of EVs will require implementation of suitable load management procedures for electric grids in terms of applying optimal charging strategies to EV fleets, which would be facilitated by use of various Vehicle-to-Infrastructure (V2I) and Vehicle-to-Grid (V2G) communication methods [

1]. In order to provide optimal EV fleet charging management within smart grids, there is a necessity for accurate models aimed at predicting the energy demand of each individual EV in the fleet, including prediction of battery state of charge (SoC) at destination (e.g., at the charging station). Such energy demand models can be used to optimize routes and charging schedules in order to ultimately minimize fuel- and electricity consumption-related costs [

2,

3].

The energy demand can be predicted based on a precise EV powertrain model, where each sub-component is modeled separately [

4]. However, building of such models can be time consuming and thus impractical to use in the case of fleets where new vehicles are frequently added. Also, performing EV simulations within an optimization-based charging/routing management framework can be impractical from the standpoint of computational efficiency. Another possibility for modeling the EV energy demand relates to use of computationally efficient response surface-based method [

5], where the model parameterization can be conducted off-line based on precise EV model simulations over recorded or synthetic driving cycles, or GPS- and energy consumption-related data that are typically collected in delivery fleets [

6]. However, the drawbacks of this approach include: (i) complexity of the selection of significant driving cycle features to serve as inputs to the model [

7], (ii) selection of an appropriate regression model, and (iii) the inflexibility of transferring the knowledge gained for one vehicle to another one. Furthermore, some recent studies related to transport energy demand modeling involve artificial neural networks (NN) for long-term energy demand forecasting, and are performed on national level by considering various socio-economic and transport related indicators [

8,

9,

10,

11]. Other studies are either related to short-term predictions of EV energy consumption in real time [

12,

13], EV energy consumption on the individual segments of the road network [

2], or are based on a single parameter which accounts for the dependence of vehicle energy consumption on vehicle mass and driving cycle [

14].

The above drawbacks and limitations can be overcome by applying data-driven deep learning methods, which are usually implemented through using a NN architecture. The main advantage of these deep computational models is in their ability to learn features from given inputs automatically (i.e., no manual feature extraction is needed), and to transfer knowledge from the base task to other related tasks by means of transfer learning. Deep learning models are especially well-suited for image classification tasks (e.g., convolutional neural networks—CNNs), which use convolutions instead of general matrix multiplication, and possess the translation invariance property) [

15]. One of the most popular classification challenges is ImageNet Large Scale Visual Recognition Competition (ILVRSC), which involves the task of classifying images into one of 1000 categories, while offering a training dataset containing 1.2 million images. The most accurate models which have participated on the recent ILVRSC challenges are AlexNet, Oxford VGG model, GoogLeNet (Inception module) [

16], and Microsoft ResNet with a leading score of top-5 error rate (i.e., the target label is one of top five predictions) equal to 3.57% [

17].

Significant deep learning achievements have been reached in autonomous vehicle-related applications, whose key components are perception modules controlled by an underlying deep NN. These deep NN models take inputs from different sensors including cameras, light detection and ranging sensors, and infrared sensors and output the information necessary to maneuver a vehicle safely under given conditions [

18,

19]. Apart from perception applications in autonomous vehicles, NNs are also widely used in other different transport-related applications. For instance, in [

20], a deep NN is used for prediction of specific driver speed profiles, while in [

21,

22] NN-based models are used for prediction of traffic speed on specific road segments. A similar approach is proposed in [

23], where a NN-based model is used for on-line identification of road type and traffic congestion levels, with the purpose of improving the vehicle power management system. Furthermore, NNs can also be used for forecasting the number of electric vehicles (EVs) in the city or state [

24], or the number of passengers inside the vehicle [

25]. Deep NN model-based methods are used for EV charging management in [

26,

27]. In [

28,

29,

30] various NN architectures were developed and applied to estimate the actual EV battery SoC with high precision.

According to the best of the authors’ knowledge, EV energy demand modeling based on deep NNs and known driving cycle features as inputs has not been considered in the literature so far. To fill the gap, this paper proposes a novel data-driven approach of EV energy demand modeling based on deep neural networks. The approach is particularly suitable for cases when large driving cycle datasets are available, as in the case of vehicle fleets equipped with GPS/GPRS tracking equipment. A preprocessing method for transforming time- and distance-varying driving cycles into 1D or 2D static maps is proposed, in order to make them appropriate for use as inputs to neural networks. Several deep feedforward artificial neural network architectures including multilayer perceptrons (MLPs) and CNNs have been considered and analyzed along with three different model input formats (see an illustration in

Figure 1). Necessary driving energy demand data is generated through numerous simulations of an extended range electric vehicle (EREV) model over a wide set of driving cycles recorded for a delivery vehicle fleet. Two energy demand-related models are derived based on the generated data, in order to predict: (i) the battery SoC and fuel consumption at the end of driving cycle (i.e., at destination), and (ii) all-electric range (i.e., the distance that can be travelled in pure electric driving prior to a hybrid driving mode being engaged; AER). The derived models can be applied in different off-line energy demand studies (e.g., in energy planning), as well as in on-line energy consumption prediction and energy management strategies.

The main contributions of the paper include: (i) proposing the driving cycle preprocessing method that provides proper inputs to NNs and accounts for the initial battery SoC value, (ii) recommending the most appropriate combination of NN architecture and driving cycle input format, and (iii) conducting a comparative performance analysis of the proposed NN-based method and the traditional response surface modeling approach.

## 2. Driving Cycle Data Preprocessing

This section first briefly describes the process of driving cycle data collection based on GPS/GPRS tracking technology applied on a set of ten mid-size delivery trucks [

6]. A method for preprocessing of driving cycles is then elaborated, along with definition of several resulting formats of processed driving cycles aimed to be used as inputs to a feedforward NN.

#### 2.1. Delivery Vehicle Fleet Description and Driving Data Collection

The delivery vehicle fleet considered in this paper consists of a set of ten mid-size MAN-TGM 15.240 trucks. The driving missions of these trucks relate to delivery of goods from a main distribution center to sales centers. The truck loading capacity is 7460 kg and the empty vehicle mass is 7860 kg. The vehicle is propelled by a diesel engine with the maximum power of 176 kW. The vehicle maximum velocity equals 90 km/h.

Driving data have been collected by using the vehicle tracking equipment based on GPS and GPRS technology. The driving data were recorded continuously, i.e., 24 h a day, over a time period of three months (91 days). The data sampling time was set to 1 s. Apart from the GPS-related data, an additional set of data from the vehicle controller area network (CAN) bus were acquired (e.g., engine rotational speed and cumulative fuel consumption). The recorded GPS data include the following information: vehicle ID number, timestamps, vehicle velocity, vehicle position (longitude and latitude), and altitude. A total of 2286 driving cycles were extracted from the overall recorded dataset, where each driving cycle corresponds to a single driving mission determined by the time interval between vehicle departure from and its arrival back to the distribution center.

#### 2.2. Preprocessing of Driving Cycles to Serve as Neural Network Inputs

The longitudinal dynamics of vehicle is described by the following equations:

where

τ_{L} and

ω_{L} are the total wheel torque and angular velocity, respectively,

v_{v} is the vehicle velocity,

m_{v} is the vehicle mass,

r is the effective tire radius,

g is the gravitational acceleration,

α is the road slope,

R_{o} is the tire rolling coefficient,

ρ_{air} is the air density with the standard value of 1.225 kg/m

^{3},

C_{d} is the vehicle aerodynamic drag coefficient, and

A_{f} is a vehicle frontal cross-section area. The demanded energy on wheels can be calculated as:

where

T_{f} represents the driving cycle duration. By inspecting Equations (1)–(3), it can be concluded that the significant variables from the perspective of energy demand are: (i) vehicle velocity

v_{v}, (ii) vehicle acceleration

a = d

v_{v}/d

t, (iii) road slope

α, and (iv) vehicle mass

m_{v}. In this paper only vehicle velocity

v_{v} and acceleration d

v_{v}/d

t are taken into account when generating inputs to considered NNs.

Since driving cycles can be variable both in time and travelled distance, and the feedforward NNs are supposed to be fed by static inputs of constant dimensions, driving cycle preprocessing is needed. Because different NN architectures require different input formats (see

Figure 1 and

Section 4), three input types (IT) of NNs labeled as IT1, IT2, and IT3 are proposed (

Table 1). The input IT1 refers to 1D vector of counted velocity states in range of 0 to 90 km/h, with resolution of 0.5 km/h. The input IT2 refers to 2D matrix of counted transitions between the different velocity states, where velocity range is equal as in the case of IT1 input, but with the resolution of 1 km/h. Here, the information of vehicle acceleration is included indirectly through counting of transitions between discrete values of vehicle velocities. The input IT3 refers to 2D matrix of counted accelerations for each velocity state defined in IT1, where the acceleration range and resolution are equal to ±1.5 m/s

^{2} and 0.1 m/s

^{2}, respectively. In this case, the information on vehicle acceleration is directly included. It should be mentioned that regardless of input type, by counting the discrete values of vehicle velocities for the given fixed sampling time, the information on travelled distance is accounted for implicitly (note that this information highly impacts the energy demand [

4]).

Apart from the driving cycle-related velocity and acceleration information, the initial battery SoC value (

SoC_{init}) needs to be included in the NN input to be able to predict the energy demand (e.g., SoC at destination). Various methods have been considered within this study, such as appending the input vector/matrix by

SoC_{init}, multiplying each element of input matrix by

SoC_{init}, etc. A simple addition of initial SoC to the overall input matrix has been found to be the best approach in terms of NN prediction accuracy. Exceptionally, in the IT1 case the initial SoC value is appended to the input vector. The addition of vehicle initial SoC value for the cases of matrix input formats (IT2 and IT3) can be visualized as a magnification of grey intensity in the graphical representation of the matrix, as illustrated in

Figure 2 for the case of IT2 and initial SoC values ranging from 0.3 to 0.6. This figure shows that IT2 has very sparse structure (i.e., useful information just around diagonal positions), which affects the quality of recognition of sample features, while requiring long learning time of NN due to high dimension of input matrix. This difficulty is effectively overcome in the case of IT3, which is characterized by the reduced input dimensions (see

Table 1), far less sparse structure (see

Figure 3), and directly included acceleration information. The reduced input dimension makes the NN training process less time consuming due to a lower number of trainable parameters. For the sake of better visualization of addition of initial SoC to 2D inputs in the case of IT2 and IT3, the inputs are shown as contour plots in

Figure 4.

The procedure for generating inputs for NN-based energy demand models for the purpose of their training (i.e., parameterization) and testing is as follows: (i) splitting of overall driving cycle dataset into two distinctive groups, where 85% of data is used for training of NNs, while remaining 15% of data is employed for model testing, (ii) extracting of vehicle velocity and acceleration values from the driving cycle data; (iii) counting of the states including discrete values of vehicle velocity (and acceleration) and transitions between states and storing them into 1D or 2D static maps depending on the required NN input format (i.e., IT1, IT2 or IT3), and (iv) adding the initial SoC value SoC_{init} into the given input format.

## 6. Discussion

Energy demand modeling of an extended range electric vehicle (EREV) has been presented based on applying deep neural networks (NN). The models are aimed at predicting the EREV fuel consumption V_{f}, SoC-at-destination SoC_{end}, and all electric range (AER). Special emphasis was placed on proposing proper methods for preprocessing of driving cycles, in order to prepare them to serve as static 1D or 2D inputs to NNs, while conserving driving cycle features relevant to energy demand modeling. Three driving cycle input type formats have been proposed and analyzed: (i) IT1—1D vector which contains counted discrete vehicle velocity values, (ii) IT2—2D matrix which contains counted transitions between discrete vehicle velocity values/states (acceleration included indirectly), and (iii) IT3—2D matrix which contains counted states where each state represents one combination of discrete vehicle velocity and acceleration (acceleration included directly). Reliable options for including the initial SoC (i.e., the one at the beginning of driving cycle) into the NN input have been suggested (e.g., through adding the initial SoC to each element of 2D matrix in the case of IT2 and IT3). Also, two NN architectures have been considered and analyzed in different combinations with input types: (i) standard multi-layer perceptron (MLP); and (ii) convolutional neural network (CNN). The use of CNN architecture has been motivated by its effectiveness in image classification tasks (i.e., automatic feature extraction characteristics), where images are typically represented with 2D matrices, similarly as it is the case with driving cycles-related NN input herein (i.e., IT2 and IT3). The proposed NNs have been trained and examined based on different portions of large energy demand dataset obtained by simulating a delivery EREV model over a wide set of recorded driving cycles. The traditional response surface energy demand modeling approach has also been considered to quantify improvements which can be achieved by applying newly proposed NN methods.

The comparative analysis of the energy-related prediction results has shown that the CNN in combination with IT3 input (i.e., 2D matrix including velocity and acceleration information; CNN2), provides the best results in terms of the training and testing score (mean squared errors), as well as evaluation time (≈3.4 ms), while the MLP1 resulted in a significantly shorter training time (≈2.6 h vs. ≈7.6 h) due to the significantly lower input dimensions of IT1 when compared to IT3 (vector of dimension 182 vs. matrix of dimension 91 × 31). Furthermore, it is shown that most of the prediction errors (residuals) for both the fuel consumption ∆V_{f,rel} and the SoC-at-destination ∆SoC_{end,rel} in cases of MLP1 and CNN2 are located within the ±2% interval, which is significantly better when compared to the response surface model whose distributions of errors are far wider (i.e., most errors lays within the ±20% interval). The CNN-based model has been retrained for the purpose of prediction of vehicle AER. It is shown that the AER predictions are slightly less precise while compared to the energy-related prediction models (i.e., the majority of relative prediction errors ∆AER_{,rel} lays within the ±5%; or ±1 km in terms of absolute errors ∆AER_{,abs}), but this can still be considered quite accurate for this kind of prediction task.

## 7. Conclusions

It can be concluded that NN-based energy demand models are significantly more accurate than response surface models, because response surfaces only include the driving distance d as input, along with the initial SoC; while NNs, apart from the driving distance (contained implicitly within inputs), also include other significant driving cycle features contained within NN inputs through automatic feature extraction. When considering model prediction accuracy, it has been found that the CNN-based energy demand model in combination with IT3 input form is the most successful in this automatic feature extraction. Apart from the high prediction accuracy, NN-based models are shown to be very computationally efficient (e.g., 3.4 ms of evaluation time in the case of CNN and IT3), and can therefore be used in various applications which require real-time performance such as vehicle routing and charging management. In the latter case, the accurate prediction of SoC at destination represents a key input to advanced, predictive charging management strategies, which need to satisfy the required driving missions and minimize the charging energy cost. Future work can consider other vehicle and environment parameters (e.g., vehicle mass and road slope) as inputs to NN for more accurate predictions in general case.