# Improved Traffic Sign Detection and Recognition Algorithm for Intelligent Vehicles
## 3 Improved LeNet-5 CNN Model
### Improved LeNet-5 Network Model
#### 3.2.2 Improved LeNet-5 Network Model  
The LeNet-5 network model has been considerably improved due to the shortcomings of the classic model in traffic sign recognition. Figure 6 shows the improved LeNet-5 network model structure. Figure 6: The improved LeNet-5 network model structure. The improvement of LeNet-5 network model includes the following five aspects. (1) The Gabor kernel is used as the initial convolutional kernel between the input layer and the first convolutional layer. In the actual road scenes, the change of light, the damage of traffic signs, and the obstruction of obstacles will affect the quality of the training image. Nonetheless, Gabor wavelet can solve such problems commendably. The Gabor wavelet is insensitive to changes in light; therefore, it has good adaptability to light. Furthermore, it has superior scale and direction selection characteristics that are sensitive to the edges of the training image. The two-dimensional Gabor filter is a band-pass filter whose impulse response function is as follows:  
\[g(x,y,f,\theta)=\frac{1}{2\pi\sigma_{x}\sigma_{y}}\exp(-\frac{k_{1}^{2}}{2 \sigma_{x}^{2}}-\frac{k_{2}^{2}}{2\sigma_{y}^{2}})\exp\Bigl{(}i(f_{x}x+f_{y}y )\Bigr{)} \tag{1}\]  
\[k_{1}=x\cos\theta+y\sin\theta,k_{2}=-x\sin\theta+y\cos\theta \tag{2}\]  
where \(f\) is the center frequency of the bandwidth; \(\theta\) is the spatial direction whose value ranges \([0,\pi]\); \(\sigma_{x}\) and \(\sigma_{y}\) are the standard deviations in the \(x\) and \(y\) directions, respectively; \(f_{x}=f\cdot\cos\theta\) and \(f_{y}=f\cdot\sin\theta\) are both frequencies in space. When \(\sigma_{x}=\sigma_{y}\), the Equation (1) can be converted to:  
\[g(x,y,f,\theta)=\frac{1}{2\pi\sigma^{2}}\exp(-\frac{x^{2}+y^{2}}{2\sigma^{2}} )\exp\Bigl{(}i(f_{x}x+f_{y}y)\Bigr{)} \tag{3}\]  
Given that Gabor filters vary in different scales and directions, the mean value of Gabor kernels in different directions at the same scale is taken as the initial convolutional kernel in this paper. (2) After each pooling layer, the BN is added for data normalization. In the deep learning network model, as the number of training increases, the hidden layer gradient near the output layer expands and the parameter updating accelerates. Meanwhile, the hidden layer gradient near the input layer shows the opposite; that is, presenting a state of random distribution called gradient dispersion, while BN data normalization can effectively solve this problem. The BN data normalization is as follows:  
Input: Mini-batch input \(x:B=\{x_{1},\dots,m\}\). Output: Normalized network response \(\left\{y_{i}=BN_{\gamma,\beta}(x_{i})\right\}\). 1. The mean of training batch data: \[\mu_{B}=\frac{1}{m}\sum_{i=1}^{m}x_{i}\] (4)
2. The variance of training batch data: \[\sigma_{B}^{2}=\frac{1}{m}\sum_{i=1}^{m}(x_{i}-\mu)^{2}\] (5)
3. Normalization: \[\hat{x}_{i}=\frac{x_{i}-\mu_{B}}{\sqrt{\sigma_{B}^{2}+\varepsilon}}\] (6) where \The BN data normalization results in the output mean of 0 and the variance of 1. These results are beneficial to the non-linear expression of the model and provides consistent output distribution with the real data distribution. The application of deep network models is not only appropriate but also has good effects in shallow network models. (3) The ReLU function is selected as the activation function. Compared with the traditional Sigmoid and Tanh functions, the ReLU function is simple in calculation but effectively solves the gradient disappearance and explosion problem of the two functions. By making a part of the neuron output to 0, the network can be sparse, which helps reduce computational complexity and accelerate network convergence. Therefore, this function performs well in deep network training. (4) The Adam method is chosen as the optimizer algorithm. This method is an extended first-order optimization algorithm based on the stochastic gradient descent method, which can dynamically adjust the learning rate of related parameters by using the moment estimation of the gradient.