Skip to content

A7med01/CarND-Traffic-Sign-Classifier

Repository files navigation

Traffic Sign Recognition

Udacity - Self-Driving Car NanoDegree

Combined Image

Overview

In this project, I will use deep neural networks and convolutional neural networks to classify traffic signs. I will train and validate a model so it can classify traffic sign images using the German Traffic Sign Dataset.

The goals / steps of this project are the following:

  • Load the data set (see below for links to the project data set)
  • Explore, summarize and visualize the data set
  • Design, train and test a model architecture
  • Use the model to make predictions on new images
  • Analyze the softmax probabilities of the new images
  • Summarize the results with a written report

Dependencies

This project requires Python 3.5 and the following Python libraries installed:

Dataset

  1. Download the dataset. This is a pickled dataset in which we've already resized the images to 32x32.

Data Set Summary & Exploration

1. A basic summary of the data set.

I used the numpy library to calculate summary statistics of the traffic signs data set:

  • The size of training set is   34799   images
  • The size of the validation set is   4410   images
  • The size of test set is   12630   images
  • The shape of a traffic sign image is   (32, 32, 3)
  • The number of unique classes/labels in the data set is   43

2. An exploratory visualization of the dataset.

alt text

Design and Test a Model Architecture

1.Pre-processing

I normalized the image data and also divided by the standard deviation of each feature (pixel) value as well. Subtracting the mean centers the input to 0, and dividing by the standard deviation makes any scaled feature value the number of standard deviations away from the mean,so that all the inputs are at a comparable range.

2. My final model architecture :

My final model consisted of the following layers:

Layer Description
Input 32x32x3 RGB image
Convolution 5x5 1x1 stride, outputs 28x28x6
RELU Activation Function
Max pooling 2x2 stride, outputs 14x14x6
Convolution 5x5 1x1 stride, outputs 10x10x16
RELU Activation Function
Max pooling 2x2 stride, outputs 5x5x16
Flatten output 400
Fully connected output 120
RELU Activation Function
Dropout 50%
Fully connected output 84
RELU Activation Function
Dropout 50%
Fully connected output 43

3. Training the model :

To train the model, I used an Adam Optimizer , batch size of 128 , number of epochs is 45 and a learning rate of 0.0008

4. Training Results :

My final model results were:

  • training set accuracy of   0.999
  • validation set accuracy of   0.965
  • test set accuracy of   0.951

Test a Model on New Images

1. An eight German traffic signs found on the web :

alt text

Here are the results of the prediction: alt text

Image Prediction
Turn left ahead Turn left ahead
Speed limit (70km/h) Speed limit (70km/h)
Priority road Priority road
Slippery road Slippery road
Speed limit (50km/h) Speed limit (60km/h)
General caution General caution
Double curve children crossing
Bumpy road no entry

3. The top 5 softmax probabilities for each image :

alt text alt text alt text alt text