Preprint
Article

Predictive AI Models for Energy Efficiency in Hybrid and Electric Vehicles: Analysis for Enna, Sicily

Altmetrics

Downloads

121

Views

64

Comments

0

A peer-reviewed article of this preprint also exists.

This version is not peer-reviewed

Submitted:

23 July 2024

Posted:

25 July 2024

You are already at the latest version

Alerts
Abstract
Developments in artificial intelligence techniques allow for an improvement in sustainable mobility strategies with particular reference to energy consumption estimates of electric vehicles (EVs). This research proposes a vehicle energy model developed on the basis of Deep Neural Network (DNN) technology. The study also explores the potential application of the model developed for the movement data of new vehicles in the province of Enna, Sicily, Italy. which is characterized by numerous attractors and the increasing number of hybrid and electric cars circulating. The energy model for electric vehicles shows high accuracy and versatility, requiring vehicle velocity and acceleration as input data to predict energy consumption. The research article also provides recommendations for the energy modeling of electric vehicles and outlines additional steps for model development. The implemented methodological approach and its results can be used by transport decision makers to plan new transport policies in Italian cities aimed at optimizing vehicle charging infrastructure. They can also help vehicle users accurately estimate energy consumption, generate maps, and identify locations with the highest energy consumption.
Keywords: 
Subject: Engineering  -   Transportation Science and Technology

1. Introduction

In recent years, the global automotive industry has undergone a profound transformation driven by increasing concerns about climate change and the need to reduce dependence on fossil fuels [1,2]. This shift toward sustainability has propelled electric vehicles (EVs) to the forefront of transportation innovation. Unlike traditional vehicles with internal combustion engines, which contribute significantly to greenhouse gas emissions and air pollution, electric vehicles offer a cleaner and more environmentally friendly mode of transportation [3,4]. The adoption of EVs represents a crucial step towards achieving global climate goals by eliminating emissions from internal combustion engines and reducing the overall carbon footprint [5,6]. This transition is not merely a technological substitution, but symbolizes a broader social commitment to promote sustainable practices and ensure a cleaner and healthier future for generations to come [7,8].
Italy, renowned for its rich automotive heritage and engineering achievements, is at the forefront of the electric vehicle revolution. Taking advantage of a deeply rooted legacy in automotive innovation, from iconic sports cars to cutting-edge urban mobility solutions, Italy has unique opportunities to lead the adoption and advancement of electric vehicle technologies [9]. The country’s commitment to environmental conservation further underscores its readiness to embrace sustainable transportation alternatives. Italy’s largest automotive companies are currently rolling out a full range of vehicles utilizing 100% electric propulsion [10,11]. The growing demand for electric vehicles in Italy leads to the need to accurately understand and predict energy consumption patterns [12].
This is a topic not only related to innovative research purposes, but is a basis for improving actions, strategies, and the choice of investments for energy and related management. In fact, a careful predictive analysis of the energy needs of EVs allows for better strategic planning related, for example, to the implementation of charging stations, to integrating renewable energy sources into the network and to reducing the overall environmental impact of transport systems. [13]. Developing predictive models of energy consumption also enables a better understanding of the operation of the vehicle for ordinary users, as these models should be accessible and user-friendly [14].
The issue of modeling energy consumption for hybrid and electric vehicles (EVs) is a complex issue that is gaining prominence in the context of global efforts to reduce greenhouse gas emissions and increase energy efficiency. Hybrid vehicles, which combine internal combustion and electric engines, as well as electric vehicles powered solely by electricity, require precise models to forecast energy consumption that account for various factors such as driving style, road conditions, and weather variability.
Artificial intelligence (AI), including machine learning and deep neural networks, play a crucial role in the advancement of these models [15,16]. AI enables the analysis of vast amounts of vehicle generated data, allowing the identification of consumption patterns and anomalies [17,18]. For example, machine learning models can predict fuel consumption and emissions in hybrid vehicles based on historical data and current operating conditions [19]. Similarly, for electric vehicles, AI can help optimize battery management and route planning, minimize energy consumption, and maximize vehicle range [20].
Modeling energy consumption and emissions using AI not only supports the development of more efficient and environmentally friendly vehicles, but also allows better management of the energy grid. Precise forecasts of electric vehicle energy demand can help grid operators in load balance, integration of renewable sources, and avoiding overloads. As a result, AI techniques contribute to the sustainable development of the transportation sector, while supporting the goals of environmental protection and energy efficiency.
Currently, efforts are underway to develop various models for electric vehicles (EVs), focusing on energy consumption during driving and optimizing charging infrastructure [21,22]. An example of this is [23]. This article presents a novel approach to modeling electric vehicles that integrates battery dynamics with vehicle dynamics and considers aerodynamic drag. The integrated battery electric vehicle (IBEV) model is titrated and analyses demonstrate its superior energy efficiency compared to simplified models that neglect aerodynamic drag. To illustrate the utility of the proposed model, controllers were designed using linear quadratic integrator (LQI) regulators.
Another example is [24], which underscores the importance of optimal resource utilization in microgrids, examining systems with photovoltaic generators (PV), electric vehicles (EV), electrical loads, and energy storage systems. Bidirectional power flow from the prosumers to the grid provides flexibility to manage excess energy generated or stored by the prosumers. Markov chain modeling was used to predict EV availability based on historical user travel data, incorporating PV power uncertainty.
Additionally, there is a growing body of work using artificial intelligence methods to model emissions and energy in vehicles. An example is [25], which introduces a methodology to measure and create a computational model of CO2 emissions using artificial intelligence techniques for vehicles equipped with stop and start technology. This method relies on data from velocity, acceleration, and road gradient to predict CO2 emissions. An analysis of three machine learning techniques revealed that gradient boosting achieved the best prediction results.
This article presents the development of a methodology for modeling energy consumption in electric vehicles (EVs). The methodology focuses on creating an accurate model for predicting energy consumption that is tailored to driving conditions within the city of Enna, Italy. This model was developed using deep neural networks (DNN). The primary goal was to create a highly versatile model that could be used effectively by anyone. Therefore, only fundamental vehicle motion parameters, such as velocity and acceleration, were selected as explanatory variables. The input of these parameters allows the model to generate energy consumption results for electric vehicles in kWh. These outcomes can facilitate better planning of charging infrastructure, optimizing charging schedules, and identifying locations with the highest energy consumption and potential for recovery.
In this way, vehicle users can plan more cost-effective charging sessions, such as when energy prices are lower, e.g., from photovoltaic panels. The model’s results can also estimate the precise cost of driving an EV in relation to energy prices. The article also explores the potential application of this model through a case study of driving conditions in Enna, Italy. On the basis of the motion data obtained for this area, sample energy consumption results for EVs were generated.
The novelty of this methodology lies in its reliance on just two input data points, which can be obtained from GPS data or traffic microsimulation models. This broadens the potential applications of the model for analyzing microregional traffic patterns.
The topics and models discussed are crucial in shaping strategies for the development of energy and transportation in countries. Predictive models serve several critical functions. Primarily, they are essential for strategically locating the EV charging infrastructure to ensure availability and reliability in different parts of the country. They enable energy service providers to efficiently manage electric power demand, supporting grid stability and resilience in the midst of a growing number of electric vehicles on the roads.
Furthermore, these models are essential for policy makers and urban planners, helping them make informed decisions about investments in charging infrastructure, the development of public transportation, and the integration of renewable energy sources into the power grid. In the context of evolving energy and mobility landscapes, accurate forecasting of the energy consumption of electric vehicles is crucial to ensuring sustainable development, efficient resource management, and minimizing the environmental impact of transportation.

2. Methods

The general study workflow is described by two main steps, shown in Figure 1.
The first step involves developing a predictive model for EV energy consumption based on real-world data collected during road tests. These tests were carried out under conditions typical of the Enna region in Sicily, Italy, characterized by a relatively warm year-round climate with an average ambient temperature of 20.4°C during the test sessions. The road tests lasted 200 minutes, using a Hatchback vehicle classified in segment B. Before the tests, the battery state of charge (SOC) was 80.1%, decreasing to 66.9% at the end of the test. The vehicle is equipped with a single electric motor that generates a total power of 125 kW and weighs 1390 kg. Its lithium-ion battery comprises 8 modules (96 cells connected in series) with a nominal capacity of 60 Ah. The vehicle has rear wheel drive (RWD).
Data related to vehicle motion parameters and energy were recorded using a power analyzer at a frequency of 1 Hz. For model input, vehicle motion data such as velocity and acceleration were selected. This choice of explanatory variables ensures that the developed energy model can be universally applied to new road data, easily available through GPS tracking, or simulated vehicle motion data generated from software packages such as Simulink, Vissim, or SUMO. The variables used as response variables in the model are battery voltage and battery current, converted to energy units in kWh.
The collected data were subjected to an initial exploratory data analysis (EDA) to understand their distribution and potential patterns. Subsequently, the data were transformed, reformatted, and split into training sets. The training sets comprised 80% for training and 20% for testing purposes. The deep neural network (DNN) was chosen as the learning technique for the model. DNN, also known as a deep neural network, is an advanced machine learning technique that mimics the structure of neurons in the human brain [26,27]. It consists of multiple layers of neurons, including hidden layers that process input data and transform them into predictions or classifications [28]. Each layer of neurons in a DNN is connected to every subsequent layer, allowing the network to recognize and extract complex patterns from the data [29]. The process of building a DNN model begins with determining the number of layers and neurons in each layer, followed by initializing random weights and biases that are gradually adjusted during the learning process [30]. The backpropagation algorithm plays a crucial role in optimizing the network parameters by minimizing the loss function based on comparisons between predictions and actual training data. The code used to create the model is presented in the following as Algorithm 1.
Algorithm 1. Fragment of the DNN model code used to create the energy model of electric vehicles.
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout
from tensorflow.keras.callbacks import EarlyStopping

# Model creation DNN
model = Sequential([
       Dense(64, input_dim=2, activation=‘relu’),
       Dropout(0.2),
       Dense(32, activation=‘relu’),
       Dropout(0.2),
       Dense(16, activation=‘relu’),
       Dense(1)
])

# Model compilation
model.compile(optimizer=‘adam’, loss=‘mean_squared_error’)

# Early stopping
early_stopping = EarlyStopping(monitor=‘val_loss’, patience=10, restore_best_weights=True)

# Model training
history = model.fit(X_train_scaled, y_train, validation_split=0.2, epochs=100, batch_size=32, callbacks=[early_stopping])
During the training of the DNN model, regularization techniques, such as dropout, were also applied to prevent overfitting. The first Dense layer contains 64 neurons, takes input data of dimension 2, and uses the ReLU activation function, allowing for effective modeling of non-linear relationships in the data. A dropout layer with a dropout rate of 0.2 was added after the first layer to randomly exclude neurons during training, helping to reduce model overfitting. The next two Dense layers have 32 and 16 neurons, respectively, also using the ReLU activation function, and the final layer has a single output neuron, making the model suitable for regression tasks.
The model was compiled using the Adam optimizer and the mean_squared_error loss function, which minimizes the mean squared error between the predicted and actual values. To prevent the model from overfitting the training data, early stopping was implemented. The EarlyStopping callback monitors the loss value on the validation set (val_loss), restoring the best weights of the model obtained during training if the loss value does not improve for 10 consecutive epochs.
The model training process with fit is performed on the training data X_train_scaled and y_train, with 20% of the data split for validation (validation_split=0.2). The model is trained for 100 epochs with a batch size of 32. Using early stopping and monitoring the validation metric helps optimize the model, improving its ability to generalize to new data, and reducing prediction errors.
The model was created in Python within the Google Colab environment. Google Colab is a platform to create and run Jupyter notebooks in a web browser, providing free access to a virtual machine with computational resources, including CPUs and GPUs [31,32]. This is particularly useful for working with large datasets and machine learning algorithms [33].
Next, to demonstrate the potential application of the energy model developed for electric vehicles, a new drive was recorded around the city of Enna and Piazza Armerina. The Enna and Piazza Armerina area, located in central Sicily, Italy, plays a significant role in regional transport. It features a well-developed road network that is crucial for local and regional mobility. The monitored transport infrastructure includes national main roads and local routes, enabling efficient travel by both private cars and public transport. Additionally, the region is important for tourism, influencing the development of the transport infrastructure and the demand for tailored transportation services for visitors. The route taken is shown in Figure 2.
The new journey undertaken is approximately 32 km long, with an average velocity of around 24 km/h. The route includes segments typical of urban, suburban, and high-speed expressway traffic. The testing of different traffic characteristics was crucial because electric vehicles exhibit a high energy recovery in urban areas, whereas energy consumption increases in places with high speeds and low regenerative braking, such as on roads. This choice of test route for the developed model is justified and should demonstrate the versatility of EV energy prediction for the developed model. Vehicle GPS data was recorded using a mobile GPS logger application. On the basis of this recording, a gpx file was generated, which can be used to produce new energy consumption results for the vehicle and to prepare an energy consumption map (the gpx file also contains vehicle movement coordinates). An application was prepared for easy extraction of vehicle traffic data from the gpx file, and its source code is presented in Algorithm 2.
Algorithm 2. Application code to convert the gpx file format to csv to collect input data for further energy analysis.
import xml.etree.ElementTree as ET
import csv

def convert_gpx_to_csv(input_file, output_file):
    tree = ET.parse(input_file)
    root = tree.getroot()

    # Define the namespaces
    ns = {
        ‘default’: ‘http://www.topografix.com/GPX/1/0’
    }

    # Prepare the CSV file
    with open(output_file, ‘w’, newline=‘‘) as csvfile:
        fieldnames = [‘lat’, ‘lon’, ‘speed’]
        writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
        writer.writeheader()

        # Iterate over all track points
        for trkpt in root.findall(‘.//default:trkpt’, ns):
            lat = trkpt.get(‘lat’)
            lon = trkpt.get(‘lon’)
            speed_elem = trkpt.find(‘default:speed’, ns)
            speed = speed_elem.text if speed_elem is not None else ‘N/A’

            writer.writerow({
                ‘lat’: lat,
                ‘lon’: lon,
                ‘speed’: speed
            })

# Example usage
convert_gpx_to_csv(input_file=“name of the file.gpx”, output_file=“output.csv”)
The code presented is a function that converts a GPX file to a CSV file, enabling the extraction of location and speed data stored in XML format. Initially, the necessary libraries are imported: xml.etree. ElementTree for XML parsing and csv for handling CSV data. The function convert_gpx_to_csv(input_file, output_file) starts by parsing the GPX file, reading the root of the XML tree, and defining the namespace to identify XML elements using their tags. Subsequently, a CSV file is prepared for data storage, specifying column headers, and initializing a csv.DictWriter object. Each track point (trkpt) in the GPX file is processed in a loop, collecting geographic data of latitude (lat), longitude (lon), and velocity. If velocity data are not available, it is assigned N/A. Finally, the data is written to the CSV file.

3. Results

In this chapter, the individual processes for obtaining results for the final acquisition of an EV energy model, which can be used for energy analysis under Italian conditions, will be presented.
First, exploratory data analysis (EDA) was performed to preliminarily verify and analyze the data. Subsequently, an electric vehicle energy model based on the deep neural network (DNN) technique was implemented in Python. This model was validated using metrics such as R2, RMSE, MAE, MSE, MAPE, and by analyzing graphs such as actual vs. predicted energy. Subsequently, energy analysis was performed for a new series of vehicle movement data on a route from Piazza Armerina to Enna in Italy. The entire process is summarized with recommendations for modeling such EV energy models.

3.1. Exploratory Data Analysis

Exploratory data analysis (EDA) plays a crucial role in understanding the usage patterns, energy consumption, and performance of electric vehicles (EVs) [34,35]. EDA enables the identification and visualization of key variables such as vehicle velocity, acceleration, and energy consumption. When these data are analyzed, significant dependencies and correlations that impact the energy efficiency of electric vehicles can be uncovered. For example, analyzing speed and acceleration under different road conditions and their influence on energy consumption allows for the optimization of driving strategies and energy management. Geographic visualizations, such as vehicle route heat maps, can reveal areas with high energy consumption, highlighting the need for improved charging infrastructure in those locations. Additionally, EDA aids in detecting anomalies, such as unexpected increases in energy consumption, which may signal technical problems or improper vehicle usage. The distribution graphs for the variables analyzed are presented in Figure 3.
Based on Figure 3, we can observe histograms showing the frequency distribution of velocity, acceleration, and energy for the aggregated data ranges. The highest frequency of velocity data is observed in the first range, starting from 0 km/h and around 40 km/h. Similarly, the highest frequency of acceleration also resides around 0 km/h. The distribution of EV energy shows a wide spectrum of analysis, covering both consumed and regenerated energy.
In the next step of EDA, a correlation matrix was generated for the explanatory variables and the dependent variable. A correlation matrix is a statistical tool used to understand the relationships between different variables in a data set [36]. Measure the strength and direction of the linear relationship between two variables. The results are shown in Figure 4.
Based on Figure 4, it can be observed that the dependent variable, which is energy, shows a strong correlation with the acceleration variable, making it the main factor influencing the precision of our model. The velocity variable also has some impact on energy consumption, but its correlation is significantly weaker compared to acceleration.
During the analysis of data related to energy consumption by EVs, proper data preparation for modeling is crucial. This process involves dividing the data into training and testing sets and scaling features, which is an essential step in ensuring the accuracy and efficiency of the model.
In this analysis, the data was divided into a feature matrix (X) containing vehicle velocity and acceleration variables (Velocity (km/h) and Acceleration (m/s²)), and a target variable (y) representing energy consumption (Energy (kWh)). Subsequently, the data was split into training and testing sets using the train_test_split function from the scikit-learn library, where 80% of the data was allocated to the training set and 20% to the test set. This approach allows for evaluating the model’s performance on data that was not used for training, thereby increasing the reliability of the results. The code snippet that shows the execution of this step is presented in Algorithm 3.
Algorithm 3. Codesnippet on splitting the input data set to create an EV energy model.
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler

# Breakdown of data into features (X) and target variable (y)
X = data[[‘Velocity (km/h)’, ‘Acceleration (m/s2)’]]
y = data[‘Energy (kWh)’]

# Division into training and test sets
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
Feature scaling is another crucial step that normalizes data to have a mean of 0 and a standard deviation of 1. This helps machine learning models trained on these data perform better and faster. The scaling process was conducted using StandardScaler, where the fit_transform function was applied to the training set and transformed to the test set to ensure consistency in scaling (Algorithm 4).
Algorithm 4. Codesnippet on feature scaling.
# Feature scaling
scaler = StandardScaler()
X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test)

3.2. Energy Modeling – Validation

The implementation and validation of a mathematical model for EVs consumption has been defined. The description of the technique and the model itself was previously presented in Algorithm 1. The article showcased a deep neural network (DNN) built using the TensorFlow library, comprising Dense and Dropout layers, designed to predict the energy consumption of electric vehicles. The model was compiled with the ‘adam’ optimizer and ‘mean_squared_error’ loss function, then trained using early stopping to prevent overfitting. The training process involved splitting the data into training and validation sets and tuning hyperparameters over 100 epochs with a batch size of 32.
Subsequently, the model was evaluated in the test set using loss functions, followed by generating predictions for this data set. For a thorough analysis of prediction results, various validation metrics were computed, such as Mean Absolute Error (MAE), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Mean Absolute Percentage Error (MAPE), and Coefficient of Determination (R²). Furthermore, the prediction results were visualized using a scatter plot of actual vs. predicted energy consumption values, allowing an assessment of model accuracy. The distribution of prediction errors was illustrated with a histogram, which facilitated the identification of potential deviations.
Evaluation of the deep neural network (DNN) model to predict the energy consumption of electric vehicles (EVs) demonstrated high precision. The mean absolute error (MAE) was 0.0008, indicating a minimal deviation of the predicted values from the actual values. The mean square error (MSE) achieved a value of 0.000002, suggesting a very small difference between the predictions and the actual values. The root mean square error (RMSE) was 0.0014, confirming the high accuracy of the model. The mean absolute percentage error (MAPE) was 1.24%, indicating small percentage differences between the predicted and actual energy consumption values. The coefficient of determination (R2) reached 0.91, indicating a very strong fit of the model to the test data and a high effectiveness in explaining the variability of the energy consumption of electric vehicles. These results clearly demonstrate that the proposed DNN model is highly precise and efficient in predicting energy consumption, making it a valuable tool for the analysis and optimization of the energy use of electric vehicles.
The results for the scatter plot of actual vs. predicted data and the distribution of prediction errors are shown in Figure 5.
The actual vs. predicted plot is a crucial tool for visually assessing the performance of a predictive model. The horizontal axis of the plot shows the actual values of the target variable (in this case, energy consumption in kWh), while the vertical axis shows the values predicted by the model. Ideally, the points on the plot should align along a straight line with a 45-degree angle, indicating perfect model fit; each predicted value matches exactly the actual value. Based on Figure 5, there is a notable clustering of points around the perfect prediction line, indicating the high accuracy of the energy model. The trend of the points resembles a straight line.
The distribution of prediction errors plot, also visible in Figure 5, is used to analyze the distribution of prediction errors made by the model. Focuses on the difference between actual and predicted values, allowing for an assessment of prediction accuracy and error distribution. The distribution of errors also indicates a well-developed model, since most errors are centered around 0, indicating that the model tends to overestimate and underestimate to a similar extent. The histogram itself resembles a normal distribution curve, indicating that most errors are small, with only a few larger errors.

3.3. Using the Model for New Input Data - Case Study of Enna

Next, to potentially demonstrate the utility of the energy model for driving conditions in the Enna area of Italy, a new journey was recorded. Subsequently, these data were used to generate new energy data for an electric vehicle. The velocity profile for the recorded journey is shown in Figure 6.
The new route included passages through sections with varying speed characteristics, as evident from the speed profile obtained. The objective of the trip was to cover urban areas characterized by lower speeds and frequent start-stop operations, as well as suburban and highway sections where the vehicle travels at higher speeds with fewer braking operations, resulting in increased energy consumption. Obtaining such a speed profile should allow testing of the model’s prediction accuracy across different road conditions and speed ranges.
The velocity achieved on the analyzed route was visualized using the recorded geographic coordinates of the vehicle in the form of a point map (Figure 7).
The earlier discussion is corroborated by Figure 7, where distinctly lower speeds are observed during passages through city centers, acceleration in suburban areas, and higher speeds on highways. This distribution of speeds provides good input data for further analysis and validation of the developed EV energy model.
The input speed data recorded at the 1Hz frequency were also converted into vehicle acceleration data, forming a comprehensive data set to generate energy results for the analyzed route. The complete energy map generated from the developed model is presented in Figure 8.
Based on Figure 8, we can observe the route with marked points that indicate energy consumption. This map was created to reflect different driving characteristics, including urban traffic and highways. On the basis of the developed map, we can identify areas where the EV experiences increased energy consumption and where regenerative braking occurs. Certain sections of this route have been zoomed in and presented in detail. For example, Area 1 in Figure 8 covers the driving area on Piazza Armerina, where we can observe rapid accelerations (such as from traffic lights) and braking due to dense traffic and pedestrian crossings, resulting in energy recovery through regenerative braking.
For Area 2 in Figure 8, we observe moments of high energy consumption due to frequent acceleration events at higher speeds. Similarly, for Area 4, we see urban driving where energy consumption is relatively low because the vehicle operates in a city environment in Enna.
Based on the generated EV energy results, the developed model also allows the generation of a cumulative energy plot (Figure 9). From this graph we can observe periods of increases in dynamic energy consumption. The vehicle consumed approximately 4 kWh of energy throughout the segment of the route.

3.4. Recommendations for Modeling EV Energy

Based on the methodology developed for measuring electric vehicle energy, processing road data, and developing and using an electric vehicle energy model, several suggestions can be made for its preparation.
  • It is important to collect road data for different road conditions and prevailing speeds, especially for urban and nonurban parts, where higher driving speeds occur,
  • The DNN technique makes it possible to obtain very good validation indications both in terms of vehicle acceleration, where there is high energy consumption, and in moments of recuperative braking, where energy is recovered for vehicle batteries, and
  • For the creation of universal models, it is necessary to reduce the input data for their creation as much as possible, for the movement of the vehicle it is best to be limited to the speed and acceleration of the vehicle, possibly taking into account the gradient of the terrain; such parameters are sufficient for the creation of predictive models of the energy of EVs and allows one to achieve good accurate models with high validation rates,
  • It is also important for the generation of new results to have GPS post arrival coordinates, which will allow the subsequent use of these coordinates for map generation, which can be very useful, for example, for transport decision-makers, or even for ordinary road users.

4. Discussion

In this study, a deep neural network (DNN) model was developed to predict energy consumption in electric vehicles (EVs). The model was built using the TensorFlow library, employing Dense and Dropout layers to mitigate overfitting. After rigorous training and validation, the model demonstrated high precision and effectiveness in forecasting energy consumption under diverse driving conditions.
The validation phase yielded excellent results. MAE = 0.0008, MSE = 0.000002, RMSE = 0.0014, MAPE = 1.24%, R² = 0.91, confirming the high precision of the model in predicting energy consumption in electric vehicles. Subsequently, to explore the applicability of the model in new driving scenarios, a case study was conducted in the city of Enna, Italy. Using data from this journey, a new dataset on energy consumption was generated. The route encompassed urban areas characterized by frequent start-stop operations, as well as suburban/highway sections where the vehicle traveled at higher speeds with fewer braking events.
Visual analysis of the speed profile along the route (Figure 7) provided crucial information to verify the model in different driving scenarios. Furthermore, using geographical coordinates, energy consumption patterns were mapped (Figure 8). This visualization revealed variations in energy usage across different segments of the road, which was pivotal for further refinement and validation of our EV energy prediction model.
Detailed analysis of speed profiles and acceleration data, recorded at 1Hz frequency, facilitated comprehensive energy calculations for the entire journey. The generated energy map highlighted areas of lower energy consumption, such as city centers with frequent accelerations, and higher consumption in suburbs characterized by sustained high speeds. It also pinpointed locations where regenerative braking effectively recovered energy, crucial for optimizing the performance and range of EVs.
The topic of modeling energy consumption in EVs spans a wide spectrum of studies, many of which employ artificial intelligence algorithms to predict various factors that influence the operation of electric vehicles. For example, one of these studies [37] analyzed the utilization of retired electric vehicle batteries (REVB) in a hybrid PV-hydrogen-REVB energy system. The research presented a REVB model based on lithium battery capacity degradation, energy management strategy, and a multicriteria optimization model that encompasses energy loss minimization, system costs, and potential energy losses. Simulation results showed that ignoring REVB capacity degradation decreases system reliability, while applying the NSGA-II algorithm yielded superior optimization results.
Another example relevant to the modeling of battery parameters in electric vehicles is [38]. This article discusses the fundamentals of EV charging technology and battery modeling within this context, focusing on steady-state and dynamic modeling methods. The results highlighted the impact of fast charging on the efficiency of the energy cycle under both steady-state and dynamic conditions.
Another notable study addressed the modeling of energy consumption related to the operation of electric vehicle (EV) air conditioning systems in warm climate [x]. The researchers developed a model to assess the impact of air conditioning on energy consumption in electric vehicles during two trips on a summer day: morning and afternoon. The results indicated a 2% increase in total energy consumption in the morning and a 10% increase in the afternoon due to air conditioning.
In a different approach, [39] focused on optimizing and predicting energy consumption in electric and hybrid vehicles using Markov chains. A key aspect of their research was developing a multiagent system (MAS) for real-time intelligent energy management from fuel cell (FC) and supercapacitor (SC) sources. They conducted simulations with online predictions, analyzed system responses for optimized power, and compared the results with other methods to determine the most effective energy management principles in hybrid electric vehicles (HEVs).
Furthermore, a study that included AI methods applied to charging infrastructure for EVs [40] introduced a novel approach to designing optimal energy systems for buildings. This work integrated machine learning models to predict EV charging demand, combining these data with building energy requirements simulated in EnergyPlus. Genetic algorithms and PROBID methods were then used to optimize total annual cost (TAC) and energy self-sufficiency indicators. The findings demonstrated that the demand for charging electric vehicles significantly impacts energy system design, particularly for smaller buildings, and offers insight into the development of future zero-emission building and transportation systems.
Another related work [41] analyzed and modeled the “Vehicle-to-Anything” (V2A), exploring scenarios where electric vehicles serve as energy sources for electrical grids, buildings, or other vehicles. The researchers developed a universal mathematical model adaptable to various V2A applications in different locations, transforming the optimization problem into a nonlinear integer programming (INLP) format and proposing a solution method. Simulations confirmed the effectiveness of their approach, with results indicating substantial potential for cost reduction in energy consumption, achieving a 4.37% reduction in household energy expenses through the discharge of EV.
Similarly, focused on modeling energy consumption under climate and traffic conditions in Poland, [42] developed predictive models for EV energy consumption using neural networks. They created separate predictive models for winter and summer conditions based on real driving cycles. The validation indicators for summer conditions showed an R² of 86% and an MSE of 1.4, while for winter conditions, these were 89% and 2.8, respectively. Other examples of works that similarly describe the modeling methodology but related to alternative fuels and their emissions are works [43,44,45].
This review of the literature and previous research in modeling vehicle operating parameters underscores the significant need for such methodologies. Discussions of related works illustrate the breadth of research in this field, but none have addressed the specific approach presented in this study. The methodology developed here is innovative and scalable for application in other regions of Italy and other types of electric vehicle.
The developed deep neural network (DNN) model serves as a significant tool for predicting energy consumption in electric vehicles under various driving conditions. Recommendations for future research emphasize the importance of collecting data during drives in various road conditions, focusing on velocity profiles and acceleration patterns. Simplifying the input parameters for velocity, acceleration, and terrain gradient ensures efficient model development and high prediction accuracy. Additionally, the use of GPS coordinates improves the utility of energy maps for transportation stakeholders and communities.
This work contributes to sustainable transport development by providing robust methodologies for energy modeling in electric vehicles, essential for informed decision-making and infrastructure planning.

5. Conclusions

The development and validation of the deep neural network (DNN) model to predict energy consumption in EVs under various driving conditions yielded several significant results. The model demonstrated high precision and effectiveness, as evidenced by low prediction errors and a high coefficient of determination (R²). The key results of the study include a mean absolute error (MAE) of 0.0008 and a mean squared error (MSE) of 0.000002, indicating a minimal deviation of the predicted values from the actual values. The root mean squared error (RMSE) was 0.0014, which confirms the accuracy of the model in predicting EV energy consumption. The mean absolute percentage error (MAPE) was 1.24%, further highlighting the small differences between the predicted and actual energy consumption values.
A case study conducted in Enna, Italy, demonstrated the practical applicability of the developed model. Analysis of energy consumption differences across different road types and during various driving operations (start-stop, accelerations, regenerative braking) provided valuable insight for further model refinement and optimization of EV efficiency. The limitations of the study include the need to collect more data from various road conditions and integrate additional factors such as weather conditions and vehicle load, which can affect energy consumption. In addition, future research could focus on developing models that account for dynamic changes in driver behavior and electric vehicle technologies.
Development trends include further enhancement of predictive models to increase accuracy and adaptability to different driving scenarios. Advanced machine learning techniques such as recurrent neural networks and time-series modeling could also contribute to more precise forecasts of energy consumption in electric vehicles.

Author Contributions

Conceptualization, M.M. and T.C.; methodology, M.M.; software, M.M.; validation, T.C. and M.M.; formal analysis, T.C.; investigation, M.M.; resources, T.C. and M.M.; data curation, M.M.; writing—original draft preparation, M.M. and T.C.; writing—review and editing, M.M. and T.C.; visualization, M.M.; supervision, T.C. All authors have read and agreed to the published version of the manuscript

Funding

Please add: This research received no external funding

Data Availability Statement

Data can be made available to those interested

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Barbieri, N. (2016). Fuel prices and the invention crowding out effect: Releasing the automotive industry from its dependence on fossil fuel. Technological Forecasting and Social Change, 111, 222-234.
  2. Olabi, A. G., Wilberforce, T., & Abdelkareem, M. A. (2021). Fuel cell application in the automotive industry and future perspective. Energy, 214, 118955.
  3. Mądziel, M. Future Cities Carbon Emission Models: Hybrid Vehicle Emission Modelling for Low-Emission Zones. Energies 2023, 16, 6928. [CrossRef]
  4. Coignard, J., Saxena, S., Greenblatt, J., & Wang, D. (2018). Clean vehicles as an enabler for a clean electricity grid. Environmental Research Letters, 13(5), 054031.
  5. Mądziel, M.; Campisi, T. Investigation of Vehicular Pollutant Emissions at 4-Arm Intersections for the Improvement of Integrated Actions in the Sustainable Urban Mobility Plans (SUMPs). Sustainability 2023, 15, 1860. [CrossRef]
  6. Fang, T., Vairin, C., von Jouanne, A., Agamloh, E., & Yokochi, A. (2024). Review of Fuel-Cell Electric Vehicles. Energies, 17(9), 2160.
  7. Sumitkumar, R., & Al-Sumaiti, A. S. (2024). Shared autonomous electric vehicle: Towards social economy of energy and mobility from power-transportation nexus perspective. Renewable and Sustainable Energy Reviews, 197, 114381.
  8. Zhong, Z., Zeng, Y., Zhao, X., & Zhang, S. (2024). The social benefits resulting from electric vehicle smart charging balancing economy and decarbonization. Transport Policy, 147, 113-124.
  9. Ala, G., Di Filippo, G., Viola, F., Giglia, G., Imburgia, A., Romano, P., ... & Miceli, R. (2020). Different scenarios of electric mobility: Current situation and possible future developments of fuel cell vehicles in Italy. Sustainability, 12(2), 564.
  10. Torta, G., Ciacci, L., Vassura, I., & Passarini, F. (2024). Exploring mass and economic potentials of rare earth elements recycling from electric vehicles at end-of-life. Mineral Economics, 1-15.
  11. Martini, D., Aimar, M., Borghetti, F., Longo, M., & Foiadelli, F. (2024). Innovative Energy Approach for Design and Sizing of Electric Vehicle Charging Infrastructure. Infrastructures, 9(1), 15.
  12. Marchetti, D. J., & Parigi, G. (2000). Energy consumption, survey data and the prediction of industrial production in Italy: A comparison and combination of different models. Journal of Forecasting, 19(5), 419-440.
  13. Yuan, H., Ma, M., Zhou, N., Xie, H., Ma, Z., Xiang, X., & Ma, X. (2024). Battery electric vehicle charging in China: Energy demand and emissions trends in the 2020s. Applied Energy, 365, 123153.
  14. Alhanouti, M., & Gauterin, F. (2024). A Generic Model for Accurate Energy Estimation of Electric Vehicles. Energies, 17(2), 434.
  15. Hamdan, A., Ibekwe, K. I., Ilojianya, V. I., Sonko, S., & Etukudoh, E. A. (2024). AI in renewable energy: A review of predictive maintenance and energy optimization. International Journal of Science and Research Archive, 11(1), 718-729.
  16. Bouquet, P., Jackson, I., Nick, M., & Kaboli, A. (2024). AI-based forecasting for optimised solar energy management and smart grid efficiency. International Journal of Production Research, 62(13), 4623-4644.
  17. Mądziel, M. Liquified Petroleum Gas-Fuelled Vehicle CO2 Emission Modelling Based on Portable Emission Measurement System, On-Board Diagnostics Data, and Gradient-Boosting Machine Learning. Energies 2023, 16, 2754. [CrossRef]
  18. Meng, Y., & Noman, H. (2022). Predicting co2 emission footprint using ai through machine learning. Atmosphere, 13(11), 1871.
  19. Khan, M. R., Haider, Z. M., Malik, F. H., Almasoudi, F. M., Alatawi, K. S. S., & Bhutta, M. S. (2024). A comprehensive review of microgrid energy management strategies considering electric vehicles, energy storage systems, and AI techniques. Processes, 12(2), 270.
  20. Hu, J., Lin, Y., Li, J., Hou, Z., Chu, L., Zhao, D., ... & Zhang, Y. (2024). Performance analysis of AI-based energy management in electric vehicles: A case study on classic reinforcement learning. Energy Conversion and Management, 300, 117964.
  21. Xiao, Y., Zhang, Y., Kaku, I., Kang, R., & Pan, X. (2021). Electric vehicle routing problem: A systematic review and a new comprehensive model with nonlinear energy recharging and consumption. Renewable and Sustainable Energy Reviews, 151, 111567.
  22. Ibrahim, A., & Jiang, F. (2021). The electric vehicle energy management: An overview of the energy system and related modeling and simulation. Renewable and Sustainable Energy Reviews, 144, 111049.
  23. Ristiana, R., Rohman, A. S., Machbub, C., Purwadi, A., & Rijanto, E. (2019). A new approach of EV modeling and its control applications to reduce energy consumption. IEEE Access, 7, 141209-141225.
  24. Singh, S. P., Padmanaban, S., Leonowicz, Z., & Holm-Nielsen, J. B. (2021). Prosumer energy management for optimal utilization of bid fulfillment with EV uncertainty modeling. IEEE Transactions on Industry Applications, 58(1), 599-611.
  25. Mądziel, M. (2024). Instantaneous CO2 emission modelling for a Euro 6 start-stop vehicle based on portable emission measurement system data and artificial intelligence methods. Environmental Science and Pollution Research, 31(5), 6944-6959.
  26. Li, H., Li, X., Fan, Q., He, Q., Wang, X., & Leung, V. C. (2024). Distributed DNN inference with fine-grained model partitioning in mobile edge computing networks. IEEE Transactions on Mobile Computing.
  27. Noh, J. H., & Lee, J. H. (2024). Development of a DNN model using calibrated simulation for the optimal control of HVAC systems. Energy and Buildings, 114516.
  28. Ravindran, R., Santora, M. J., & Jamali, M. M. (2020). Multi-object detection and tracking, based on DNN, for autonomous vehicles: A review. IEEE Sensors Journal, 21(5), 5668-5677.
  29. Munawar, S., Ali, Z., Waqas, M., Tu, S., Hassan, S. A., & Abbas, G. (2022). Cooperative computational offloading in mobile edge computing for vehicles: A model-based dnn approach. IEEE Transactions on Vehicular Technology, 72(3), 3376-3391.
  30. Sung, J., & Han, S. J. (2024). Use of edge resources for DNN model maintenance in 5G IoT networks. Cluster Computing, 1-13.
  31. Ferreira, R., Canesche, M., Jamieson, P., Neto, O. P. V., & Nacif, J. A. (2024). Examples and tutorials on using Google Colab and Gradio to create online interactive student-learning modules. Computer Applications in Engineering Education, e22729.
  32. Edwards, K., Scalisi, C., DeMars-Smith, J., & Lee, K. (2024, March). Google Colab for Teaching CS and ML. In Proceedings of the 55th ACM Technical Symposium on Computer Science Education V. 2 (pp. 1925-1925).
  33. Ray, S., Alshouiliy, K., & Agrawal, D. P. (2020). Dimensionality reduction for human activity recognition using google colab. Information, 12(1), 6.
  34. Mishra, D. P., Kumar, P., Rai, P., Kumar, A., & Salkuti, S. R. (2024). Exploratory data analysis for electric vehicle driving range prediction: insights and evaluation. International Journal of Applied, 13(2), 474-482.
  35. Dörre, E., Klein, T., & von Bonin, M. (2024). Finding Attractive Electric-Vehicle-Charging Locations with Photovoltaic System Integration. World Electric Vehicle Journal, 15(3), 97.
  36. Golui, S., Mahapatra, B. S., & Mahapatra, G. S. (2024). A new correlation-based measure on Fermatean fuzzy applied on multi-criteria decision making for electric vehicle selection. Expert systems with applications, 237, 121605.
  37. Huang, Z., Xie, Z., Zhang, C., Chan, S. H., Milewski, J., Xie, Y., ... & Hu, X. (2019). Modeling and multi-objective optimization of a stand-alone PV-hydrogen-retired EV battery hybrid energy system. Energy conversion and management, 181, 80-92.
  38. Bauer, P., Stembridge, N., Doppler, J., & Kumar, P. (2010, September). Battery modeling and fast charging of EV. In Proceedings of 14th International Power Electronics and Motion Control Conference EPE-PEMC 2010 (pp. S11-39). IEEE.
  39. El Amrani, R., Yahyaouy, A., & Tairi, H. (2020, June). Modeling and simulation of an evolutionary approach based on MAS strategy: For intelligent energy management in EV. In 2020 International Conference on Intelligent Systems and Computer Vision (ISCV) (pp. 1-8). IEEE.
  40. Park, M., Wang, Z., Li, L., & Wang, X. (2023). Multi-objective building energy system optimization considering EV infrastructure. Applied Energy, 332, 120504.
  41. Mao, T., Zhang, X., & Zhou, B. (2018). Modeling and solving method for supporting ‘vehicle-to-anything’EV charging mode. Applied Sciences, 8(7), 1048.
  42. Mądziel, M. Energy Modeling for Electric Vehicles Based on Real Driving Cycles: An Artificial Intelligence Approach for Microscale Analyses. Energies 2024, 17, 1148. [CrossRef]
  43. Mądziel, M. Modelling CO2 Emissions from Vehicles Fuelled with Compressed Natural Gas Based on On-Road and Chassis Dynamometer Tests. Energies 2024, 17, 1850. [CrossRef]
  44. Mądziel, M. Quantifying Emissions in Vehicles Equipped with Energy-Saving Start–Stop Technology: THC and NOx Modeling Insights. Energies 2024, 17, 2815.
  45. Chen, J., Dobbie, G., Koh, Y. S., Somervell, E., & Olivares, G. (2018, April). Vehicle emission prediction using remote sensing data and machine learning techniques. In Proceedings of the 33rd Annual ACM Symposium on Applied Computing (pp. 444-451).
Figure 1. General scheme of the work.
Figure 1. General scheme of the work.
Preprints 113073 g001
Figure 2. Drive from Piazza Armerina to Enna for energy prediction from the model made (route marked in yellow). Authors’ elaboration based on real road data.
Figure 2. Drive from Piazza Armerina to Enna for energy prediction from the model made (route marked in yellow). Authors’ elaboration based on real road data.
Preprints 113073 g002
Figure 3. Histogram of the data for the variables of speed, acceleration, and energy of the monitored EV.
Figure 3. Histogram of the data for the variables of speed, acceleration, and energy of the monitored EV.
Preprints 113073 g003
Figure 4. Correlation matrix for the variables studied of velocity, acceleration, and energy of the EV.
Figure 4. Correlation matrix for the variables studied of velocity, acceleration, and energy of the EV.
Preprints 113073 g004
Figure 5. Graph of actual versus predicted and distribution of prediction errors for the explained variable of EV vehicle energy.
Figure 5. Graph of actual versus predicted and distribution of prediction errors for the explained variable of EV vehicle energy.
Preprints 113073 g005
Figure 6. Velocity over time graph, input data for EV vehicle energy generation.
Figure 6. Velocity over time graph, input data for EV vehicle energy generation.
Preprints 113073 g006
Figure 7. Velocity graph presented in the background of the route studied in the form of a point cloud. Authors’ elaboration based on real road data.
Figure 7. Velocity graph presented in the background of the route studied in the form of a point cloud. Authors’ elaboration based on real road data.
Preprints 113073 g007
Figure 8. EV vehicle energy map for the studied route with marked areas: 1,4 - excerpts for the urban part; 2,4 - excerpts for the non-urban and high-speed vehicle traffic. Authors’ elaboration based on real road data.
Figure 8. EV vehicle energy map for the studied route with marked areas: 1,4 - excerpts for the urban part; 2,4 - excerpts for the non-urban and high-speed vehicle traffic. Authors’ elaboration based on real road data.
Preprints 113073 g008
Figure 9. Graph of cumulative energy for a road section traveled.
Figure 9. Graph of cumulative energy for a road section traveled.
Preprints 113073 g009
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

© 2024 MDPI (Basel, Switzerland) unless otherwise stated