# Combining a Universal OBD-II Module with Deep Learning to Develop an Eco-Driving Analysis System
## 3 Materials and Methods
### Neural Network Algorithm  
#### 3.5.1 Data and Preprocessing  
The driving parameters are employed as the input parameters of the neural network. The present study performed data collection and system verification using three vehicles of different brands (Table 1). For the convenience of analysis, the three vehicles are referred to based on their brands, namely Mazda, Mitsubishi, and Toyota. The universal OBD-II module was used to collect nine driver-behavior driving parameters that influence fuel consumption, which are listed in Table 2.  
In particular, the parameter of instantaneous fuel consumption was obtained by calculating other relevant parameters using the fuel consumption equation proposed by [PERSON] [34], as presented in Equation (1):  
\[\text{FuelConsump}_{\text{inst}}=\text{RPMWeight}_{\text{avg}}*\text{EngineLoad}_ {\text{avg}}*2.3*\text{FuelFactor}*\text{t(s)}*\text{ED}/7545 \tag{1}\]  
The weight values for engine RPM are listed in Table 3. EngineLoad represents the OBD-II module's output engine load, whereas FuelFactor is calculated according to the measured fuel consumption (Table 1). The measurement process is detailed in the following paragraph. ED (c.c.) is the engine displacement of the vehicle, and t(s) is the duration of fuel consumption. The FuelFactor coefficient differs for each vehicle brand and model. This study employed a universal OBD-II device to obtain vehicle data. To accurately calculate fuel \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Brand** & **Module** & **Engine Displacement (c.c.)** & **Engine Torque** & **Fuel Factor** \\ \hline Mazda & Mazda 3 & 1999 & 21.7 kgm/4000 rpm & 0.87 \\ Mitsubishi & Lancer1.8 & 1798 & 17.9 kgm/4200 rpm & 1.17 \\ Toyota & Vios & 1496 & 14.3 kgm/4200 rpm & 1.48 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Experimental vehicle data. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter Name** & **Unit** & **Range of Parameter** \\ \hline Engine displacement & c.c. & 0–16,383.75 \\ Air flow rate & g/s & 0–655.35 \\ Engine coolant temperature & \({}^{\circ}\)C & –40–215 \\ Engine load & \({}^{\circ}\)o & –100 \\ Ignition timing & \({}^{\circ}\) & 0–655.35 \\ Engine rotations & rpm & 0–16,383.75 \\ Vehicle speed & km/h & 0–255 \\ Throttle position & \%o & 0–100 \\ Control module voltage & V & 0–65.535 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Input parameters of the neural network. \begin{table}
\begin{tabular}{c c} \hline \hline
**RPM Range** & **Weight** \\ \hline RPM \textless{} 1000 & 2 \\
1000 \(\leq\) RPM \textless{} 1500 & (RPM-1000)/500 + 2 \\
1500 \(\leq\) RPM \textless{} 2000 & (RPM-1500)/250 + 3 \\
2000 \(\leq\) RPM \textless{} 2300 & (RPM-2000)/100 + 5 \\
2300 \(\leq\) RPM \textless{} 2600 & (RPM-2300)/50 + 8 \\
2600 \(\leq\) RPM \textless{} 2900 & (RPM-2600)/25 + 14 \\
2900 \(\leq\) RPM \textless{} 3200 & (RPM-2900)/25 + 26 \\
3200 \(\leq\) RPM \textless{} 3500 & (RPM-3200)/20 + 38 \\
3500 \(\leq\) RPM & (RPM-3500)/20 + 53 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: RPM weights. consumption, the correct FuelFactor coefficient for each vehicle had to first be determined. Therefore, this study calculated the FuelFactor coefficient according to data on each vehicle when driven on nine sections of road, for a total travel distance of 209 km and duration of 5.11 h. FuelFactor generally reflects the fuel consumption proportion for a given distance and is written as L/100 km or gal/mi. Data preprocessing is generally performed through deep learning before neural network analysis. Specifically, data normalization is the most common preprocessing method. The input of different parameters, each with different metrics and units, in neural networks results in incompatibility between parameter values, which in turn influences the results. Therefore, normalizing data beforehand may increase the speed of model training. The present study scaled the parameter data to between 0 and 1 to prevent the generation of negative values.