*2.1.1 The preprocessing stage*

In order to prepare the deep neural network to learn relevant features from speed-limit images, additional processing is required: first of all, we expand the training images, then, we normalize the augmented images, and finally, we filter them with a median filter.

*Advanced Driving Assistance System for an Electric Vehicle Based on Deep Learning DOI: http://dx.doi.org/10.5772/intechopen.98870*

• Data normalization:

In this step, we normalized the gray scale images in order to reduce poor lighting variations observed in the database. Let *Im i*ð Þ , *j* denotes the grayscale value of pixel ð Þ *i*, *j* , *Me* and *Std* denote the estimated mean and standard deviation of *Im*, respectively, and *Nor i*ð Þ , *j* denotes the normalized grayscale value of pixel ð Þ *i*, *j* . The normalized image is defined using Eq. (1):

$$Norm(i, j) = \frac{(Im - Me) \* Constant\_1}{Std + Constant\_2} \tag{1}$$

*Constant*<sup>1</sup> and *Constant*<sup>2</sup> are two constants set experimentally to 50 and 100 respectively. **Figure 5** shows the images obtained by 1. Finally, a median filter is applied to the normalized input image to obtain an enhanced speed sign image.

• Data augmentation: Deep neural networks require a huge learning database to perform the speed limit recognition task. However, most publicly available databases suffer from lack of data. Increasing these databases is, therefore, a crucial step for an accurate sign recognition. Moreover, an augmentation on the training data makes the proposed model more robust to geometric changes. **Figure 6** shows a sample speed limit image with different augmentation techniques applied to it: vertical flipping, rotation with small angles <sup>∈</sup> �8<sup>∘</sup> , 8<sup>∘</sup> ½ � and horizontal translation of 1 unit to both sides right and left.

**Figure 5.**

*Data normalization: a. Original images. b. After Grayscale transformation, c. After normalization by Eq. (1) and d. after median filtering.*

**Figure 6.** *Some of the transformations used for data augmentation.*

### *2.1.2 The deep learning stage*

In this chapter, in order to extract features and organize speed signs in categories, a Convolutional Neural Network was therefore used. The architecture of the proposed CNN, which has three convolution layers, and one output layer, is presented in **Figure 7**. The first, third and fifth layers are convolution layers with 8, 16 and 32 kernels, respectively, with a size of 5*x*5. The activation function in the CNN is a rectified linear unit (Relu) function. Sub-sampling is presented in the second, fourth and sixth layers. We used also a max pooling layer with a kernel size of 2*x*2 and a step size of 2. We flatted the sub-sampling to a 1152-dimensional vector and directly connected the output layer with a soft-max activation function.
