Skip to content

Latest commit

 

History

History
113 lines (69 loc) · 5.77 KB

File metadata and controls

113 lines (69 loc) · 5.77 KB

Behavioral Cloning

Writeup Template

You can use this file as a template for your writeup if you want to submit it as a markdown file, but feel free to use some other method and submit a pdf if you prefer.


Behavioral Cloning Project

The goals / steps of this project are the following:

  • Use the simulator to collect data of good driving behavior
  • Build, a convolution neural network in Keras that predicts steering angles from images
  • Train and validate the model with a training and validation set
  • Test that the model successfully drives around track one without leaving the road
  • Summarize the results with a written report

Rubric Points

Here I will consider the rubric points individually and describe how I addressed each point in my implementation.


Files Submitted & Code Quality

1. Submission includes all required files and can be used to run the simulator in autonomous mode

My project includes the following files:

  • model.py containing the script to create and train the model
  • drive.py for driving the car in autonomous mode
  • model.h5 containing a trained convolution neural network
  • writeup.md summarizing the results
  • run1.mp4 showcasing the final driving result

2. Submission includes functional code

Using the Udacity provided simulator and my drive.py file, the car can be driven autonomously around the track by executing

python drive.py model.h5

3. Submission code is usable and readable

The model.py file contains the code for training and saving the convolution neural network. The file shows the pipeline I used for training and validating the model, and it contains comments to explain how the code works.

Model Architecture and Training Strategy

1. An appropriate model architecture has been employed

My model consists of a convolution neural network with 3x3 filter sizes and depths between 32 and 128 (model.py lines 70-85)

The model includes ELU layers to introduce nonlinearity, and the data is normalized in the model using a Keras lambda layer (code line 71). The model is a replication of nVidia's research model linked in the lessons with some minor changes to fully connected layers.

2. Attempts to reduce overfitting in the model

The model contains dropout layers in order to reduce overfitting. I chose to add dropout layers between the FC layers because dropout usually prevents overfitting on training data. The model was trained and validated on different data sets to ensure that the model was not overfitting. The model was tested by running it through the simulator and ensuring that the vehicle could stay on the track.

3. Model parameter tuning

The model used an adam optimizer, so the learning rate was not tuned manually (model.py line 87).

4. Appropriate training data

I was facing technical issues working with Udacity's simulator so I had to use the training data provided by Udacity to train my model.

Model Architecture and Training Strategy

1. Solution Design Approach

The overall strategy for deriving a model architecture was to make sure the car drives well throughout the route and is able to recoved to center if it veers too much on one side.

My first step was to use a convolution neural network model similar to the one in nVidia's research paper. I thought this model might be appropriate because it has been proven to work well.

In order to gauge how well the model was working, I split my image and steering angle data into a training and validation set. I found that my first model had a low mean squared error on the training set but a high mean squared error on the validation set. This implied that the model was overfitting.

To combat the overfitting, I modified the model by adding dropout layers between the fully connected layers.

The driving improved in autonomous but the model was biased to the left turns in the training track. So, I augmented the training data by horizontally flipping the images and inverting the steering angles effectively training the car on the opposite route.

At the end of the process, the vehicle is able to drive autonomously around the track without leaving the road.

2. Final Model Architecture

The final model architecture (model.py lines 70-85) consisted of a convolution neural network with the following layers and layer sizes:

Here is a visualization of the architecture (taken from nVidia's paper since this model is just a replication of the same model)

alt text

3. Creation of the Training Set & Training Process

I used dataset provided by Udacity to train my model since I was facing technical issues with the simulator which could not be solved. The data provided was good enough to train the model to navigate the track.

To augment the data set, I also flipped images and angles thinking that this would help avoid left turn bias that the model adapts to in the training track.

After the collection process, I then preprocessed this data by normalizing the image data to a range between -0.5 to 0.5

I finally randomly shuffled the data set and put 20% of the data into a validation set.

I used this training data for training the model. The validation set helped determine if the model was over or under fitting. The ideal number of epochs was 5. I used an adam optimizer so that manually training the learning rate wasn't necessary.