Information
# Self-Driving Cars Explained
### Overview
This is the code for [this](https://youtu.be/yt015gM-ync) video on Youtube by Siraj Raval. You can find the simulator [here](https://github.com/udacity/self-driving-car-sim).
The objective of this project is to clone human driving behavior using a Deep Neural Network. In order to achieve this, we are going to use a simple Car Simulator. During the training phase, we navigate our car inside the simulator using the keyboard. While we navigating the car the simulator records training images and respective steering angles. Then we use those recorded data to train our neural network. Trained model was tested on two tracks, namely training track and validation track. Following two animations show the performance of our final model in both training and validation tracks.
Training | Validation
------------|---------------
 | 
### Dependencies
This project requires **Python 3.5** and the following Python libraries installed:
- [Keras](https://keras.io/)
- [NumPy](http://www.numpy.org/)
- [SciPy](https://www.scipy.org/)
- [TensorFlow](http://tensorflow.org)
- [Pandas](http://pandas.pydata.org/)
- [OpenCV](http://opencv.org/)
- [Matplotlib](http://matplotlib.org/) (Optional)
- [Jupyter](http://jupyter.org/) (Optional)
Run this command at the terminal prompt to install [OpenCV](http://opencv.org/). Useful for image processing:
- \`conda install -c https://conda.anaconda.org/menpo opencv3\`
### How to Run the Model
This repository comes with trained model which you can directly test using the following command.
- \`python drive.py model.json\`
## Implementation
### Data Capturing
During the training, the simulator captures data with a frequency of 10hz. Also, at a given time step it recorded three images taken from left, center, and right cameras. The following figure shows an example I have collected during the training time.
Left| Center | Right
----|--------|-------
 |  | 
Collected data are processed before feeding into the deep neural network and those preprocessing steps are described in the latter part of this file.
### Dataset Statistics
The dataset consists of 24108 images (8036 images per camera angle). The training track contains a lot of shallow turns and straight road segments. Hence, the majority of the recorded steering angles are zeros. Therefore, preprocessing images and respective steering angles are necessary in order to generalize the training model for unseen tracks such as our validation track.
Next, we are going explain our data processing pipeline.
### Data Processing Pipeline
The following figure shows our data preprocessing pipeline.