## 3 A-ECMS Based on Driving Pattern Recognition
### The Adaptation of the Equivalent Factor
#### 3.3.2 Driving Pattern Recognition Based on LVQ  
An LVQ neural network model was constructed in the Matlab/Simulink environment, which consisted of an input layer, a competition layer, and an output layer. The neural network was trained under supervision and the competition layer weights were adjusted according to the learning results. In this study, the LVQ1 algorithm was used, and the training process was as follows:  
Step 1: Initialize the competition layer weights \(w_{ij}\) and the learning rate \(\eta\) (\(\eta>0\)).  
Step 2: Send the input vector \(X=\left(x_{1},x_{2}\cdots x_{R}\right)^{T}\) into the input layer and calculate the Euclidean distance of the input vector and the competition layer neurons.  
Step 3: Select the closest compitition layer neuron (e.g., \(d_{m}\)), then mark the correspnding linear output layer neuron connected as \(C_{m}\).  
Step 4: If the category of the output layer neuron is consistent with that of the input layer, the competition layer weights are updated according to Equation (21); otherwise, they are updated according to Equation (22):  
\[w_{ij,new} =w_{ij,old}+\eta(x-w_{ij,old}) \tag{21}\] \[w_{ij,new} =w_{ij,old}-\eta(x-w_{ij,old}). \tag{22}\]  
Eleven feature parameters were used as input neurons, including (1) average speed \(v_{m}\), (2) maximum speed \(v_{\max}\), (3) maximum acceleration \(a_{\max}\), (4) average acceleration \(a_{\min}\), (5) maximum deceleration \(d_{\max}\), (6) average deceleration \(d_{m}\), (7) idle time ratio \(r_{\mathit{i}\mathit{i}\mathit{i}\mathit{e}}\), (8) acceleration time ratio \(r_{\mathit{acc}}\), (9) deceleration time ratio \(r_{b}\), (10) constant speed time ratio \(r_{c}\), and (11) idle times \(f_{\mathit{i}\mathit{i}\mathit{e}}\). The competition layer was defined as 20 neurons, and 4 output neurons represented 4 driving patterns. The training result is shown in Figure 3. The learning rate was 0.001. After 42 iterations, the mean squared error was reduced to less than 0.05.  
Figure 3: Training process of the learning vector quantization (LVQ) neural network.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**CYC1 Urban** & **CYC2 Suburban A** & **CYC3 Suburban B** & **CYC4 Highway** \\ \hline Manhattan & UDDS & US06 & WVUNTER \\ NYCC & FTP & CSHVR & HWFET \\ LA92 & WVUBUS & US06 WHY \\ \hline \hline \end{tabular}
\end{table}
Table 3: Classification of the standard driving cycles.  
In order to verify the on-line DPR algorithm, a random combination of standard driving cycles was used, as shown in Figure 4. Since the driving cycle is not known a priori, in this paper, we assumed that the driving cycle did not change frequently. Thus, feature vectors extracted from 120 s of historical data were used to predict the driving pattern for the next 10 s. It is worth noting that the length of the recognition cycle has a great influence on the recognition accuracy. A long cycle will lead to poor accuracy, while a short cycle will increase the computational burden and may also result in frequent switching of the driving mode [16]. Due to the lack of historical data in the first 120 s at the beginning of the driving cycle, a default pattern of urban driving was used. As shown in Figure 5, the algorithm successfully recognized most of the driving patterns. However, at some points when transtioning from one driving pattern to another and the vehicle speed dramatically changed, the recognition accuracy decreased, mainly because the feature vectors were relatively close and the algorithm was sensitive to changes in speed and acceleration.