# Study on Path Planning Method for Imitating the Lane-Changing Operation of Excellent Drivers
## 4 Path Planning Method Based on Excellent Driver Lane-Changing Model
### GA-BP Neural Networks  
BP neural network is a multi-unit feed forward neural network, which can be trained by error back propagation. The error of the actual output value and the desired output value of the network is minimized by adjusting the weights and thresholds based on the gradient descent method. There are three units in the BP neural network: input layers, output layers and hidden layers. In the training process, there are two stages of forward and back propagation. In the stage of forward propagation, the input information is transmitted from the input layer through the hidden layer to the output layer. The state of each layer only affects the next layer state of neurons. The back propagation is introduced  
Figure 5: The framework of the path planning method for imitating the lane-changing operation of excellent drivers.  
in the case the error is larger than the threshold. The weights of each layer of neurons are modified to minimize the error.  
Genetic algorithm is a global optimization random search algorithm. It can get the individual with high adaptation degree by simulating the phenomena of selection, crossover and mutation in the genetic process. To solve the problem that BP neural network algorithm is easy to fall into local optimal solutions, the GA is used to optimize the initial weights and thresholds of BP neural network. The population of GA is generated based on the weights and thresholds of BP neural network. With going through the selection, crossover and mutation process, the optimal individuals are selected as the initial weights and thresholds of BP neural network. With GA, the convergence speed of the BP neural network can be improved significantly and the possibility of falling into local optimal solutions can be reduced. Figure 6 shows the GA-BP neural network algorithm flow chart. The specific algorithm is as follows:  
(1) Initialization of the population  
The initial population of scale \(P\), \(X=(X_{1}\), \(X_{2}\),..., \(X_{p})^{T}\), is randomly generated. The individual code, \(X_{i}=(x_{1}\), \(x_{2}\),..., \(x_{s})\), utilizes the real number coding method. The length coding is as follows:  
\[s=n\times m+m\times l+m+l \tag{10}\]  
where \(m\) is hidden layer nodes, \(n\) is input layer nodes and \(l\) is output layer nodes.  
(2) Determination of the fitness function  
In the GA-BP model, the use of a fitness function \(F\) is based on the error of the output layer. The function \(F\) is defined as:  
\[F_{i}=k\cdot\sum\limits_{j=1}^{l}{(o_{j}-y_{j})^{2}}\quad(i=1,2,3,\cdots,p) \tag{11}\]  
where \(y_{j}\) is the expected output. \(o_{j}\) is the actual output based on the weights and thresholds generated in Step 1. \(k\) is compensation factor.  
(3) Selection operation  
This paper uses the roulette method to select the operator. The probability of each individual is calculated as follows  
\[f_{i}=1/F_{i} \tag{12}\]  
\[p_{i}=\frac{f_{i}}{\sum\limits_{j=1}^{p}{f_{j}}} \tag{13}\]  
(4) Crossover operation  
The crossover operation between the chromosome \(k\) and the chromosome \(l\) in the gene \(j\) is as follows  
\[\left\{{\begin{array}{*{20}{c}}{x_{kj}=x_{kj}\cdot(1-b)+x_{lj}\cdot b}\\ {x_{lj}=x_{lj}\cdot(1-b)+x_{kj}\cdot b}\\ \end{array}}\right. \tag{14}\]  
where \(b\) is a random number in [0, 1].  
(5) Mutation operation  
The mutation operation of the chromosome \(i\) in the gene \(j\) is as follows  
\[x_{ij}=\left\{{\begin{array}{*{20}{c}}{x_{ij}+(x_{ij}-x_{\max})\cdot f(g)} &{r>0.5}\\ {x_{ij}+(x_{\min}-x_{ij})\cdot f(g)}&{r\leq 0.5}\\ \end{array}}\right. \tag{15}\]\[f(g)=r_{2}\times(1-\frac{g}{G_{\max}}) \tag{16}\]  
where \(x_{\min}\) and \(x_{\max}\) are the minimum and maximum values of the \(x_{ij}\), respectively. \(r\) is a random number in [0, 1]. \(r_{2}\) is a random number. \(g\) represents the current number of iterations and \(G_{\max}\) is the maximum number of evolutions.