For this project, we were supposed to generate our own data running the Udacity Car Simulator. However, we also were given a set of data in case we needed. I used the given data set as I was not able to generate a large enough set to train the model.
From the given data set, I made a copy of the original CSV log file and randomly deleted about 70% of the registered images with steering angle of zero. The purpose was to smooth the original dataset distribution show Original Data Histogram below. In effort to augment the quantity of images, I create new images by flipping or mirroring those images with steering angle value different to zero, and adjusted the steering angle for these images accordantly. A new dataset distribution can be appreciated in Processed Data Histogram below. Twenty percent of this data was randomly selected a side for testing purpose.

To improve the outcome of the training, the model normalizes and crop the images, as illustrate in the figure below.
I started this project using a LetNet5 model build in Keras. After several changes to the LeNet5 model and unable to accomplish the objective, I shift to the proposed “end-to-end” model used by NVIDIA. Still, I added two Dropout layers no included in the original NVIDIA model and modify the number of hidden layers, the new model shown in the table below. This new model was run using Adam optimization for 4 epochs with batch size set to 32 and Generator that fed the data to it in a more memory-efficient way.
<style> </style>|
Layer (type) |
Output Shape |
Param # |
Connected to |
|
cropping2d_1 (Cropping2D) |
(None, 65, 318, 3) |
0 |
cropping2d_input_1[0][0] |
|
lambda_1 (Lambda) |
(None, 65, 318, 3) |
0 |
cropping2d_1[0][0] |
|
convolution2d_1 (Convolution2D) |
(None, 31, 157, 24) |
1824 |
lambda_1[0][0] |
|
convolution2d_2 (Convolution2D) |
(None, 14, 77, 36) |
21636 |
convolution2d_1[0][0] |
|
convolution2d_3 (Convolution2D) |
(None, 5, 37, 48) |
43248 |
convolution2d_2[0][0] |
|
convolution2d_4 (Convolution2D) |
(None, 3, 35, 64) |
27712 |
convolution2d_3[0][0] |
|
convolution2d_5 (Convolution2D) |
(None, 1, 33, 64) |
36928 |
convolution2d_4[0][0] |
|
flatten_1 (Flatten) |
(None, 2112) |
0 |
convolution2d_5[0][0] |
|
dense_1 (Dense) |
(None, 1300) |
2746900 |
flatten_1[0][0] |
|
dropout_1 (Dropout) |
(None, 1300) |
0 |
dense_1[0][0] |
|
dense_2 (Dense) |
(None, 160) |
208160 |
dropout_1[0][0] |
|
dropout_2 (Dropout) |
(None, 160) |
0 |
dense_2[0][0] |
|
dense_3 (Dense) |
(None, 50) |
8050 |
dropout_2[0][0] |
|
dense_4 (Dense) |
(None, 1) |
51 |
dense_3[0][0] |
