simonbogh / CarND-Behavioral-Cloning-P3

Training a self-driving car with behavioral cloning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Behavioral Cloning Project for Self-Driving Cars

Self-Driving Car Engineer Nanodegree Program


Project Details

This repository contains the project files for the Behavioral Cloning Project in the Udacity Self-Driving Car Engineer Nanodegree.

In this project, a Convolutional Neural Network (CNN) is designed and trained in order to control a car in simulation. The goal is to record data from a human driver and use the data to train a CNN, which can control the car in a feasible way, hence cloning driving behavior.

The trained neural network is considered successful when it is able to drive the car one full round the track in the given Unity simulation environment.

Different models are trained, validated and tested using Keras and TensorFlow as backend. The models output a steering angle to the self-driving car in the simulation.

In the simulator the car is manually steered around a track for data collection. The image data and steering angles are used for training a neural network and then use this model to drive the car autonomously around the track.

image


Implementation Details

A detailed report about the implementation can be found in REPORT.md

Below you will find a summary of the essential details about the repository, files, installation and required dependencies. The project contains various files essential to the training and validation of the Convolutional Neural Network:

  • model.py: script used to create and train the model
  • drive.py: script to drive the car with the trained model
  • cnn_models.py: contains CNN architectures for Nvidia and Lenet
  • models/model_nvidia_final.h5: trained Keras model based on the Nvidia self-driving car CNN architecture
  • models/model_lenet.h5: trained Keras model based on the Lenet CNN architecture
  • video.mp4: video of the car driving autonomously around the track for one full round
  • Additional videos

Simulation Details

This project involves the Term 1 Simulator, which can be downloaded here. The simulator provides measurement data from a three forward facing cameras outputting RGB images of 320x160 px, as well as the steering angle and velocity of the car.


Installation and Setup

Dependencies

The following dependencies are required in order to run the training.

  • TensorFlow
  • Keras
  • Additional Python packages
    • eventlet Flask h5py imageio Keras matplotlib numpy pandas scikit-image scikit-learn scipy seaborn tornado

Installing additional dependencies

$ pip install eventlet Flask h5py imageio Keras matplotlib numpy pandas scikit-image scikit-learn scipy seaborn tornado pydot graphviz

Singularity image

A Singularity defintion file is provided: singularity/singularity.def

The Singularity image was used for training the model on an Nvidia DGX-2.


Known Issues

Simulator in macOS Catalina

If you get and error when launching the simulator for macOS Catalina, you may have to chance permission for the simulatior. In a terminal run the following command in the folder where your simulator is located.

$ chmod a+x term1_sim.app/Contents/MacOS/*

Author

Simon Bøgh