Machine-Learning-Based Digital Twins for Transient Vehicle Cycles and Their Potential for Predicting Fuel Consumption

: Transient car emission tests generate huge amount of test data, but their results are usually evaluated only using their “accumulated” cycle values according to the homologation limits. In this work, two machine learning models were developed and applied to a truck RDE test and two light-duty vehicle chassis emission tests. Different from the conventional approach, the engine parameters and fuel consumption were acquired from the Engine Control Unit, not from the test measurement equipment. Instantaneous engine values were used as input in machine-learning-based digital twins. This novel approach allows for much less costly vehicle tests and optimizations. The paper’s novel approach and developed digital twins model were able to predict both instantaneous and accumulated fuel consumption with good accuracy, and also for tests cycles different to the one used to train the model.


Introduction
To reduce vehicle emissions and fuel consumption, manufacturers invest enormous resources for developing different strategies and methodologies to increase the efficiency of vehicles. Some strategies do not require substantial hardware modification, such as the introduction of low viscosity/friction engine oils [1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17]. Fuel savings with improved oil formulations in the order of 1 to 3% [8,9,11] are evaluated by specific test protocols such as the API sequence VI-A, Mercedes Benz M111 and ECE-15 cycle for truck chassis [11]. For these, costly hardware and test programs are needed since the impact of oil formulation and other engine components on fuel consumption is of same magnitude of experimental measurement deviations in fuel consumption.
Computer and/or empirical models are usually used to predict individual contributions prior to more expensive engine and vehicle tests; see for example [11,[13][14][15][16]. During engine development, numerical models are used for optimizing fuel consumption (as well as other parameters). Such models can be divided into two main categories: • Physical-based models: the system physics is described with mathematical equations. Extensive know-how and a theoretical background are usually required to obtain reliable and useful models. A trade-off between CPU consumption and model details is frequently found. These models can range from a detailed subsystem of the engine using 3D CFD to study an accurate solution that then is extrapolated to the whole engine [18,19] to a 1D/0D model offering a lower computational cost, but also lower details of the problem's physics for reducing fuel consumption [11,16,17,20,21]. • Empirical data models: Such models are data driven, not physics based. Test data are used to create an abstract mapping of the system and to select the variables to be studied. A crescent field of investigation involves the use of Artificial Intelligence (AI).
• Empirical data models: Such models are data driven, not physics ba are used to create an abstract mapping of the system and to selec to be studied. A crescent field of investigation involves the use of A ligence (AI). AI uses computer codes to perform cognitive function ceiving, reasoning, learning, and problem solving. It is used in, fo botics and autonomous vehicles, computer vision, language, virtu machine learning. AI machine learning involves the use of AI to very large data sets. Machine-learning algorithms detect patterns a to make predictions and recommendations by processing data an In this way, a machine learning model can be considered a digita physical model that has been designed to accurately reflect an artif cal system, wherein sensors are placed to acquire a variety of data tem performance (see Figure 1). Transient vehicle tests generate a huge amount of data, making th subject for analysis using machine learning tools. In an author's previo [22], data from fuel consumption transient vehicle tests carried out a National lab were analyzed using both semi-empirical and machine lea to predict the influence of lower viscosity oils on fuel consumption. learning model was "trained" using only the cold test phase results, a to predict with good accuracy the fuel consumption in the hot phase cy oil temperature is higher and consequently the oil viscosity is lower.
Various types of machine learning algorithms exist, such as superv vised, semi-supervised, and reinforcement learning algorithms. The these and the tools they use are abundant and constantly updated. A re can be found in [23]. Machine learning models have been used to predi consumption. For instance, Hien [24] made use of a multilinear regres predict the CO2 emissions and fuel consumption of a light duty vehicle. predicted the fuel consumption of a heavy-duty engine using a Random obtaining an error of 0.04% between the prediction and measurement Transient vehicle tests generate a huge amount of data, making them a potential subject for analysis using machine learning tools. In an author's previous publication [22], data from fuel consumption transient vehicle tests carried out at the Argonne National lab were analyzed using both semi-empirical and machine learning models to predict the influence of lower viscosity oils on fuel consumption. The machine learning model was "trained" using only the cold test phase results, and it was able to predict with good accuracy the fuel consumption in the hot phase cycle, when the oil temperature is higher and consequently the oil viscosity is lower.
Various types of machine learning algorithms exist, such as supervised, unsupervised, semi-supervised, and reinforcement learning algorithms. The literature on these and the tools they use are abundant and constantly updated. A recent overview can be found in [23]. Machine learning models have been used to predict vehicle fuel consumption. For instance, Hien [24] made use of a multilinear regression model to predict the CO 2 emissions and fuel consumption of a light duty vehicle. Katreddi [25] predicted the fuel consumption of a heavy-duty engine using a Random Forest model, obtaining an error of 0.04% between the prediction and measurements. Gong et al. [26] trained a Random Forest model with 200 trees and obtained an R 2 of 0.86 and an error equal to 0.15%.
Although more complex and CPU intensive, Artificial Neural Network (ANN) models tend to have better performance than other models. An ANN provides different configurations to train and improve model predictions. The variables that perform the neural network are the input data, the hidden layers, and the neurons per layer. He [27] used seven control parameters for the optimization of diesel engine emissions. The developed ANN predicted the cylinder temperature, cylinder wall heat transfer, cylinder pressure, NOx and soot emissions. Cruz-Peragon [28] used a combination of angular speed measurements and an ANN for combustion fault diagnosis. Ziolkowski [29] used an ANN with 12 input variables to predict the fuel consumption of passenger cars, obtaining an R 2 equal to 0.98. Perrota [30] trained an ANN with 12 input variables to predict the fuel consumption of trucks, obtaining an R 2 equal to 0.85. Du [31] trained 5 ANN for predicting fuel consumption with 8 input variables. Parlak [32] predicted the brake specific fuel consumption and exhaust temperature of a diesel engine, obtaining a maximum error equal to 0.02%.
Most of the mentioned references trained and tested the models using the same test data, with usually 75% of the data used for model training, and the other 25% used for assessing ("testing" in AI jargon) the model fitness. In the current work, two machine learning model types, the Random Forest and Artificial Neural Network types, were trained to predict instantaneous fuel consumption using just part or given emission tests, e.g., the FTP75 cold start. A machine learning digital twin was created and then used to predict instantaneous fuel consumption for different transient emission tests not used during the model development. The models were optimized regarding their input variables and number of trees or neurons per layer. The model accuracy was evaluated using different engine parameters and sub-data sets. The risk of trusting "only" the statistical values, such as the model's R 2 value and the error between the model and reality, is discussed.

Vehicle Characteristics
ECU or OBD data from three vehicles were used to investigate the use of AI models in transient tests (see Table 1).  Figure 4 shows the mandatory vehicle speed profile for each cycle, and Table 2 shows the main cycle characteristics.  For the SUV and light truck, data from 4 emission tests from the ANL laborator were used: FTP75 cold and hot start, Highway cycle and US06 cycles. Figure 4 show mandatory vehicle speed profile for each cycle, and Table 2 shows the main cycle ch teristics.  To comply with the mandatory speed profile, different vehicles will demand different engine rpm/torque combinations. Figures 5 and 6 show the engine usage maps for the SUV and the light truck during the different transient cycles. For the light truck, engine load is referenced as the quantity of air in the cylinder. The nominal displacement volume is represented by 100%, while values higher than 100% indicate boosting. Notice that although the FTP75 cold and hot start cycles had the same vehicle speed profile, they demanded a different engine usage. Notice also that the Highway cycle and especially the US06 cycle demanded higher rpms and loads from the engine.  To comply with the mandatory speed profile, different vehicles will deman ent engine rpm/torque combinations. Figures 5 and 6 show the engine usage ma SUV and the light truck during the different transient cycles. For the light truc load is referenced as the quantity of air in the cylinder. The nominal displacemen is represented by 100%, while values higher than 100% indicate boosting. Notic hough the FTP75 cold and hot start cycles had the same vehicle speed profile, manded a different engine usage. Notice also that the Highway cycle and espe US06 cycle demanded higher rpms and loads from the engine.

Machine Learning Models
All modern vehicles have an ECU (or OBD) reading and controlling engine parameters. Using a simple datalogger, detailed and instantaneous readings can be carried out in real time at a much lower cost than engine or car dynamometer tests. Figure 7 shows a scheme of using ECU reading and machine learning models to predict, e.g., instantaneous fuel consumption for different cycles, engine calibrations and even oils with different viscosities by imposing a different oil temperature to match the oil viscosity to be studied (see example in [16]). ent engine rpm/torque combinations. Figures 5 and 6 show the engine usage maps for the SUV and the light truck during the different transient cycles. For the light truck, engine load is referenced as the quantity of air in the cylinder. The nominal displacement volume is represented by 100%, while values higher than 100% indicate boosting. Notice that although the FTP75 cold and hot start cycles had the same vehicle speed profile, they demanded a different engine usage. Notice also that the Highway cycle and especially the US06 cycle demanded higher rpms and loads from the engine.

Machine Learning Models
All modern vehicles have an ECU (or OBD) reading and controlling engine parameters. Using a simple datalogger, detailed and instantaneous readings can be carried out in real time at a much lower cost than engine or car dynamometer tests. Figure 7 shows a scheme of using ECU reading and machine learning models to predict, e.g., instantaneous fuel consumption for different cycles, engine calibrations and even oils with different viscosities by imposing a different oil temperature to match the oil viscosity to be studied (see example in [16]). In transient tests, it is common for more than one hundred variables to be read. These variables are obtained from external vehicle instrumentation and from the engine control unit (ECU). Most of the variables are not related to vehicle fuel consumption and can lead to a machine learning model receiving poor training. The following variables were chosen, a priori, for most of investigations ahead: vehicle speed and acceleration, engine rpm, torque, and oil temperature.
ters. Using a simple datalogger, detailed and instantaneous readings can be carried out in real time at a much lower cost than engine or car dynamometer tests. Figure 7 shows a scheme of using ECU reading and machine learning models to predict, e.g., instantaneous fuel consumption for different cycles, engine calibrations and even oils with different viscosities by imposing a different oil temperature to match the oil viscosity to be studied (see example in [16]). In transient tests, it is common for more than one hundred variables to be read. These variables are obtained from external vehicle instrumentation and from the engine control unit (ECU). Most of the variables are not related to vehicle fuel consumption and can lead to a machine learning model receiving poor training. The following variables were chosen, a priori, for most of investigations ahead: vehicle speed and acceleration, engine rpm, torque, and oil temperature.
Two different supervised machine learning models were used to predict the instantaneous fuel consumption during the cycles. As usual for machine learning, the two models were only trained with a random subset of 75% of data. For the car and light truck, model was trained and validated with the FTP 75 Cold phase, and then Two different supervised machine learning models were used to predict the instantaneous fuel consumption during the cycles. As usual for machine learning, the two models were only trained with a random subset of 75% of data. For the car and light truck, model was trained and validated with the FTP 75 Cold phase, and then the model was used to predict instantaneous fuel consumption for the other three transient cycles.

•
Random Forest: The Random Forest method uses bootstrapping to create subsets of the original dataset containing a random portion of all the elements. The method involves a combination of multiple tree predictors (see Figure 8) that aggregates the results, casting the most popular outcome and thus reducing variation compared to normal decision trees. To find the threshold that best separates the data, random subsets of features are used. Many trees will be trained in a weaker way and each of them will produce a different prediction. However, these weaker predictions tend to cancel out each other, and the stronger predictions tend to dominate. For regression tasks, the mean or average prediction of the individual trees is used [34].
Vehicles 2023, 5, FOR PEER REVIEW the model was used to predict instantaneous fuel consumption for the other thre transient cycles.
• Random Forest: The Random Forest method uses bootstrapping to create subset of the original dataset containing a random portion of all the elements. Th method involves a combination of multiple tree predictors (see Figure 8) that ag gregates the results, casting the most popular outcome and thus reducing varia tion compared to normal decision trees. To find the threshold that best separate the data, random subsets of features are used. Many trees will be trained in weaker way and each of them will produce a different prediction. However, thes weaker predictions tend to cancel out each other, and the stronger prediction tend to dominate. For regression tasks, the mean or average prediction of the in dividual trees is used [34]. • Artificial Neural Network: An ANN is a group of interconnected artificial neu rons interacting with one another in a concerted manner, loosely reproducing th interaction of neurons in a biological brain (see Figure 9). Each artificial neuron has several inputs and produces a single output which can be sent to multipl other neurons, meaning it exhibits a high degree of connectivity, which is als called multilayer perceptrons. In this work, multilayer perceptrons with 3 hidden layers and up to 20 neurons per layer were trained to predict the instantaneou • Artificial Neural Network: An ANN is a group of interconnected artificial neurons interacting with one another in a concerted manner, loosely reproducing the interaction of neurons in a biological brain (see Figure 9). Each artificial neuron has several inputs and produces a single output which can be sent to multiple other neurons, meaning it exhibits a high degree of connectivity, which is also called multilayer perceptrons. In this work, multilayer perceptrons with 3 hidden layers and up to 20 neurons per layer were trained to predict the instantaneous fuel consumption of a given vehicle during the vehicle test cycle. Hidden layer selection has been used by other authors to predict fuel consumption in light-duty vehicles [35][36][37][38][39][40]. In the present study, the backpropagation (BP) method was used to train the neural network. This is common practice of fine-tuning the weights of a neural net based on the error rate obtained in previous epoch (iteration). Proper tuning of the weights ensures lower error rates, making the model reliable by increasing its generalization.
Vehicles 2023, 5, FOR PEER REVIEW 8 Figure 9. Artificial Neural Network model scheme. To evaluate the models' fitness, three differen indicators were considered.
• R 2 : R-squared value is used to measure the goodness of fit or best-fit line. The higher R 2 , the better the regression model, as most of the variation in actual values from the mean value is explained by the regression model. (1) Accumulated error in the cycle (∆%): in the cases discussed in this work, ∆% is the percentage difference between the model prediction for fuel consumption and the actual fuel consumption. Figure 10 shows the Pearson correlation values for the OBD variables obtained during the RDE test. As expected, engine torque was the variable with the highest influence on the fuel rate. The ECU oil temperature was read in the main oil gallery Notice that truck acceleration, calculated from the truck speed, had the second highest influence on the fuel rate.  • R 2 : R-squared value is used to measure the goodness of fit or best-fit line. The higher R 2 , the better the regression model, as most of the variation in actual values from the mean value is explained by the regression model.

Truck RDE
Accumulated error in the cycle (∆%): in the cases discussed in this work, ∆% is the percentage difference between the model prediction for fuel consumption and the actual fuel consumption. Figure 10 shows the Pearson correlation values for the OBD variables obtained during the RDE test. As expected, engine torque was the variable with the highest influence on the fuel rate. The ECU oil temperature was read in the main oil gallery. Notice that truck acceleration, calculated from the truck speed, had the second highest influence on the fuel rate.  Figure 10 shows the Pearson correlation values for the OBD variables obtained during the RDE test. As expected, engine torque was the variable with the highest influence on the fuel rate. The ECU oil temperature was read in the main oil gallery. Notice that truck acceleration, calculated from the truck speed, had the second highest influence on the fuel rate. Three data sets, 0-3000 s, 0-4000 s and the complete RDE test, were used to investigate the developed Random Forest model's ability to predict fuel consumption. Figures 11 and 12  Three data sets, 0-3000 s, 0-4000 s and the complete RDE test, were used to investigate the developed Random Forest model's ability to predict fuel consumption. Figures 11 and 12 show the results when 75% of the complete RDE test was used for training. The error for the accumulated fuel consumption during the test, ∆%, was only −0.69%.

Truck RDE
Vehicles 2023, 5, FOR PEER REVIEW 9 training. The error for the accumulated fuel consumption during the test, ∆%, was only −0.69%.   Figure 13 illustrates the impact of the datasets used for model training/validation. When using only the 0-3000 s, and when the truck had not yet reached the highway, the model's performance was relatively poor. Even though the model was able to predict the instantaneous fuel rate trends and the R 2 was 0.86, the error, ∆%, was 7.6% for the accumulated fuel during the cycle. When using 0-4000 s, which included one of the four periods of the highway journey, the R 2 was almost unchanged, but the ∆% was reduced to 4.2. When using the complete RDE test (i.e., always 75% random data of the test) to train the model, the R 2 reached 0.95 and the ∆% was only 0.03. Figure 11. Instantaneous fuel rate during the RDE test.
Vehicles 2023, 5, FOR PEER REVIEW 9 training. The error for the accumulated fuel consumption during the test, ∆%, was only −0.69%.   Figure 13 illustrates the impact of the datasets used for model training/validation. When using only the 0-3000 s, and when the truck had not yet reached the highway, the model's performance was relatively poor. Even though the model was able to predict the instantaneous fuel rate trends and the R 2 was 0.86, the error, ∆%, was 7.6% for the accumulated fuel during the cycle. When using 0-4000 s, which included one of the four periods of the highway journey, the R 2 was almost unchanged, but the ∆% was reduced to 4.2. When using the complete RDE test (i.e., always 75% random data of the test) to train the model, the R 2 reached 0.95 and the ∆% was only 0.03.  Figure 13 illustrates the impact of the datasets used for model training/validation. When using only the 0-3000 s, and when the truck had not yet reached the highway, the model's performance was relatively poor. Even though the model was able to predict the instantaneous fuel rate trends and the R 2 was 0.86, the error, ∆%, was 7.6% for the accumulated fuel during the cycle. When using 0-4000 s, which included one of the four periods of the highway journey, the R 2 was almost unchanged, but the ∆% was reduced to 4.2. When using the complete RDE test (i.e., always 75% random data of the test) to train the model, the R 2 reached 0.95 and the ∆% was only 0.03.  • For only the truck speed, the model's performance was, of course, very poor. The R 2 was 0.06 but the accumulated cycle error for the fuel consumption, ∆%, was only +1.3%. One should be careful when analyzing the model's performance. The total error was (almost by chance) very low, but the model very poorly repre sented the actual truck, as indicated by Figure 14a. • When including the truck acceleration, calculated from the OBD truck speed, the model's performance increased significantly. The R 2 remained low, but the spiky fuel rate was reproduced relatively well by the model. See Figure 14b.

•
For only the truck speed, the model's performance was, of course, very poor. The R 2 was 0.06 but the accumulated cycle error for the fuel consumption, ∆%, was only +1.3%. One should be careful when analyzing the model's performance. The total error was (almost by chance) very low, but the model very poorly represented the actual truck, as indicated by Figure 14a. • When including the truck acceleration, calculated from the OBD truck speed, the model's performance increased significantly. The R 2 remained low, but the spiky fuel rate was reproduced relatively well by the model. See Figure 14b.

SUV
In the ANL database, both instantaneous dynamometer measurements and ECU readings are available. The measured fuel consumption and ECU fuel rate correlated quite well, as expected. Figure 15 compares the dynamometer equipment measurements with the ECU readings after bringing the latter to the same unit. For the original 0.1 s time acquisition, there were some deviations between the ECU readings and dynamometer measurements. Such deviations almost disappeared when the values were averaged to a 1.0 s data rate.

SUV
In the ANL database, both instantaneous dynamometer measurements and E readings are available. The measured fuel consumption and ECU fuel rate correlated q well, as expected. Figure 15 compares the dynamometer equipment measurements w the ECU readings after bringing the latter to the same unit. For the original 0.1 s t acquisition, there were some deviations between the ECU readings and dynamom measurements. Such deviations almost disappeared when the values were averaged 1.0 s data rate.  To demonstrate the model's ability when using only ECU data, the ECU variables listed in Figure 16 were analyzed. The oil temperature was externally measured by a sensor installed in the oil dipstick. The variables selected to train the model were as follows: • From the external vehicle instrumentation: The fuel consumption with the mass flow meter (target variable), engine coolant temperature and engine oil temperature.

•
From the Engine Control Unit (ECU): the engine torque, vehicle speed, engine speed, intake air pressure, air flow, spark advance, throttle, EGR percentage and lambda.
These variables were selected as, a priori, they were considered to potentially have a large impact on engine fuel consumption. However, as mentioned earlier, some variables may be more or less influential depending on the cycle characteristics. Figure 17 shows the correlation factors for the instantaneous fuel consumption. Figure  18 shows the interdependency of the different parameters. Some important comments can be made here, which serve to both illustrate which engine parameters were more  To demonstrate the model's ability when using only ECU data, the ECU variables listed in Figure 16 were analyzed. The oil temperature was externally measured by a sensor installed in the oil dipstick. To demonstrate the model's ability when using only ECU data, the ECU variables listed in Figure 16 were analyzed. The oil temperature was externally measured by a sensor installed in the oil dipstick. The variables selected to train the model were as follows: • From the external vehicle instrumentation: The fuel consumption with the mass flow meter (target variable), engine coolant temperature and engine oil temperature.

•
From the Engine Control Unit (ECU): the engine torque, vehicle speed, engine speed, intake air pressure, air flow, spark advance, throttle, EGR percentage and lambda.
These variables were selected as, a priori, they were considered to potentially have a large impact on engine fuel consumption. However, as mentioned earlier, some variables may be more or less influential depending on the cycle characteristics. Figure 17 shows the correlation factors for the instantaneous fuel consumption. Figure  18 shows the interdependency of the different parameters. Some important comments can be made here, which serve to both illustrate which engine parameters were more influential in each cycle as well as highlight the machine learning models' development:  The variables selected to train the model were as follows: • From the external vehicle instrumentation: The fuel consumption with the mass flow meter (target variable), engine coolant temperature and engine oil temperature. • From the Engine Control Unit (ECU): the engine torque, vehicle speed, engine speed, intake air pressure, air flow, spark advance, throttle, EGR percentage and lambda.
These variables were selected as, a priori, they were considered to potentially have a large impact on engine fuel consumption. However, as mentioned earlier, some variables may be more or less influential depending on the cycle characteristics. Figure 17 shows the correlation factors for the instantaneous fuel consumption. Figure 18 shows the interdependency of the different parameters. Some important comments can be made here, which serve to both illustrate which engine parameters were more influential in each cycle as well as highlight the machine learning models' development: - The air flow, air pressure and engine torque were obviously the major influences on the instantaneous fuel consumption.
Vehicles 2023, 5 595 -Some correlated parameters, such as the engine air pressure and air flow, were probably able to be omitted, with only engine torque needing to be used instead. -While the oil temperature had a relatively high influence in the FTP75 cold and hot start cycles, its influence was negligible in the highway and US06 cycles, in which the engine was already hot and the engine loading was much more severe. - The fuel injection, read from the ECU, obviously correlated well with the measured fuel consumption. As mentioned earlier, this creates the opportunity to use only the vehicle ECU data (or the truck/bus OBD data) instead of much more expensive dynamometer or specific measurement equipment. This will be explored further in Section 3.4.

−
The fuel injection, read from the ECU, obviously correlated well with th ured fuel consumption. As mentioned earlier, this creates the opportunit only the vehicle ECU data (or the truck/bus OBD data) instead of muc expensive dynamometer or specific measurement equipment. This wil plored further in Section 3.4.   Table 3 shows the fitness of the two machine learning models during their training and the overall cycle in which they were trained (FTP75 Cold start) after model optimization. The Random Forest model recorded a higher R 2 value but also a higher MSE. Most of the values fitted well with the measurements but with a little higher deviation than the trained set. Table 4 shows the fuel consumption predictions for each cycle and for the two machine learning models.
In the training cycle (FTP75 cold start), the Random Forest model was the best fitting model for estimating the instantaneous fuel consumption. However, it recorded worse predictions for the other considered cycles, obtaining, for instance, an error of almost 8% for the US06 cycle. The reasons for this behavior include the fact that there were different engine operating points in each test cycle. The Random Forest model is less flexible when the values used are not those used for training. While the HWY operating points were in the same engine map region of the cycle used for model training (FTP75), during the more aggressive US06 cycle, the engine reached higher power than that covered in the model training (see Figure 6).

Light Truck
The results for the light truck presented similar trends to those for the SUV, but the model errors were higher. Table 5 shows the model predictions and actual measurements for the four cycles.

Light Truck
The results for the light truck presented similar trends to those for the SUV, but the model errors were higher. Table 5 shows the model predictions and actual measurements for the four cycles.   Figure 21 shows the ANN model results when it was trained with the ECU fuel rate data and, as earlier, when it used the FTP 75 cold start data. The model was then used to predict the instantaneous fuel rates for the other three cycles. The R 2 values were 0.99, 0.96 and 0.96 for the cold start, hot start, and highway cycles, respectively. All of these R 2 values were higher than those obtained when using the dynamometer fuel consumption measurements. Only the US06 showed a lower R 2 value of 0.84, which was still very similar to the R 2 value of 0.85 obtained when using the dynamometer fuel consumption measurements.
predict the instantaneous fuel rates for the other three cycles. The R 2 values were 0.99, 0.96 and 0.96 for the cold start, hot start, and highway cycles, respectively. All of these R 2 values were higher than those obtained when using the dynamometer fuel consumption measurements. Only the US06 showed a lower R 2 value of 0.84, which was still very similar to the R 2 value of 0.85 obtained when using the dynamometer fuel consumption measurements.

Discussion
In this study, the machine learning models used were able, with reasonable accuracy, to predict instantaneous fuel consumption during different vehicle cycles. The engine map of the training data needed to cover the ones used for prediction. For example, using the US06 cycle as the training data for the other three cycles significantly decreased the model accuracy. For the SUV, the R 2 drastically reduced from 0.89 to 0.20 and from 0.88 to 0.56 for the FTP75 cold and hot start cycles, respectively.
Transient cycles produce a huge amount of measurement data. Fuel consumption, as well as other performance criteria, is affected differently by various engine parameters, such as oil temperature, EGR%, spark timing, etc. A simple plot of the correlation factors, as shown in Figures 10 and 16-18, can indicate the parameters that are more influential in the different cycles and regarding the optimization goals.
Some of the predictions carried out measured several parameters (the engine lambda, EGR%, etc.). Information on these parameters was available in the measured data. In more

Discussion
In this study, the machine learning models used were able, with reasonable accuracy, to predict instantaneous fuel consumption during different vehicle cycles. The engine map of the training data needed to cover the ones used for prediction. For example, using the US06 cycle as the training data for the other three cycles significantly decreased the model accuracy. For the SUV, the R 2 drastically reduced from 0.89 to 0.20 and from 0.88 to 0.56 for the FTP75 cold and hot start cycles, respectively.
Transient cycles produce a huge amount of measurement data. Fuel consumption, as well as other performance criteria, is affected differently by various engine parameters, such as oil temperature, EGR%, spark timing, etc. A simple plot of the correlation factors, as shown in Figures 10 and 16, Figures 17 and 18, can indicate the parameters that are more influential in the different cycles and regarding the optimization goals.
Some of the predictions carried out measured several parameters (the engine lambda, EGR%, etc.). Information on these parameters was available in the measured data. In more realistic cases, fewer instantaneous parameters would probably be available. Regardless, the proposed AI method can be used to carry out much cheaper studies, especially those using transient cycles with huge amounts of data, as demonstrated in Sections 3.1 and 3.4.
Further, the number of trees and neurons in the Random Forest and ANN digital twins methods, respectively, was optimized. This optimization was applied in addition to the intrinsic model training, in which each tree or neuron was "optimized". For the Random Forest method, the intrinsic optimization process occurs in each tree after it receives a subset of the training data. In each node, the dataset is divided in two and a threshold value is obtained by minimizing the sum of squared residuals. The process of creating nodes continues until a "leaf node" is reached and a prediction value is obtained; this can occur for different reasons, but the simplest is because the minimum number of observations has been hit. For the ANN method, the optimization process uses gradient descent via backpropagation to define the value for each weight, wi, bias and activation transfer to achieve the "best" model performance. See Figure 22 for more details. a subset of the training data. In each node, the dataset is divided in two and a threshold value is obtained by minimizing the sum of squared residuals. The process of creating nodes continues until a "leaf node" is reached and a prediction value is obtained; this can occur for different reasons, but the simplest is because the minimum number of observations has been hit. For the ANN method, the optimization process uses gradient descent via backpropagation to define the value for each weight, wi, bias and activation transfer to achieve the "best" model performance. See Figure 22 for more details. Figure 22. Scheme of the calculation carried out in each machine leaning "node" (tree or neuron).

Optimizing Number of Trees in Random Forest
Theoretically, the number of decision trees in a Random Forest model can range from one up to infinity. The higher the number of decision trees, the higher the precision of the model. However, a high number of decision trees can cause high CPU consumption, so in this study, the model was optimized. The model was trained using 1 to 1000 decision trees. After this, the R 2 coefficient and MSE training and validation values were used to select the optimum number of trees. It was found that for the studied cases, 50 trees already produced a good prediction. See Figure 23 for more details.

Optimizing Number of Trees in Random Forest
Theoretically, the number of decision trees in a Random Forest model can range from one up to infinity. The higher the number of decision trees, the higher the precision of the model. However, a high number of decision trees can cause high CPU consumption, so in this study, the model was optimized. The model was trained using 1 to 1000 decision trees. After this, the R 2 coefficient and MSE training and validation values were used to select the optimum number of trees. It was found that for the studied cases, 50 trees already produced a good prediction. See Figure 23 for more details. to achieve the "best" model performance. See Figure 22 for more details.

Optimizing Number of Trees in Random Forest
Theoretically, the number of decision trees in a Random Forest model can one up to infinity. The higher the number of decision trees, the higher the pre model. However, a high number of decision trees can cause high CPU consum this study, the model was optimized. The model was trained using 1 to 1000 de After this, the R 2 coefficient and MSE training and validation values were us the optimum number of trees. It was found that for the studied cases, 50 tr produced a good prediction. See Figure 23 for more details. After the training and validation with the FTP75 cold cycle was carried out, the number of trees with a good balance between the prediction error and CPU time was found to be 62 and 41 for the SUV and light truck, respectively. Using a higher number of trees did not increase the fit of the model and increased the CPU time. Table 6 shows the model indicators.

Optimizing Number of Neurons in the ANN Model
Three hidden layers were chosen for predicting the fuel consumption during each vehicle test cycle. Each hidden layer had a maximum of 20 neurons. The criterion to select the number of neurons per hidden layer was that the maximum difference between the measured and predicted fuel consumption in the cycle should be 1.5%. A total of 15 combinations accomplished that criterion. With those combinations, the neural network selected was that which had the lowest average absolute error in predicting the fuel consumption. See Table 7. For the SUV, the combination that fitted best with the criterion selected was the ANN with one, two and seven for the first, second and third neurons, respectively. See Table 6 for more details. For the light truck, the same approach led to a best combination with 5, 18 and 14 neurons, with an average absolute error of 1.2% obtained.

Future Work
The developed digital twins methods can be used to carry out much less costly vehicle tests and optimizations. As an example, the authors are currently using this method to predict fuel consumption and CO 2 emissions. See Figure 24 for more details.

Future Work
The developed digital twins methods can be used to carry out much less costly vehicle tests and optimizations. As an example, the authors are currently using this method to predict fuel consumption and CO2 emissions. See Figure 24 for more details.

•
Modern vehicles have a myriad of sensors that are read in real time by the ECU/OBD. With the use of a datalogger, such data can be easily read and used by AI models, allowing for much cheaper tests and simulations.

•
In this work, two machine learning models were trained and used to predict the fuel consumption of three vehicles during different transient cycles.

•
The machine learning models were able to predict the instantaneous fuel consumption during transient emission cycles without needing to be programmed specifically for this problem.

•
The variables chosen as input for training the models were key to achieving better model performance.

•
The Artificial Neural Network model showed a better fit in predicting the fuel consumption for the four emission tests, being in all cases under the 2% error. However, compared with the simpler Random Forest model, the improvement in its model fitness came at a considerable expense regarding the CPU time. This amounted to a few minutes versus several hours for the Random Forest and ANN models, respectively.

Conclusions
• Modern vehicles have a myriad of sensors that are read in real time by the ECU/OBD. With the use of a datalogger, such data can be easily read and used by AI models, allowing for much cheaper tests and simulations.

•
In this work, two machine learning models were trained and used to predict the fuel consumption of three vehicles during different transient cycles.

•
The machine learning models were able to predict the instantaneous fuel consumption during transient emission cycles without needing to be programmed specifically for this problem.

•
The variables chosen as input for training the models were key to achieving better model performance.

•
The Artificial Neural Network model showed a better fit in predicting the fuel consumption for the four emission tests, being in all cases under the 2% error. However, compared with the simpler Random Forest model, the improvement in its model fitness came at a considerable expense regarding the CPU time. This amounted to a few minutes versus several hours for the Random Forest and ANN models, respectively.