Coder Social home page Coder Social logo

trafficsign-p2's Introduction

Project: Build a Traffic Sign Recognition Program

Udacity - Self-Driving Car NanoDegree


The purpose of this project is to create a classifier for traffic signs. The model is trained and validated with the German Traffic Sign Dataset. The dataset contained 39,920 32x32 color images split amongst a training, validation, and test set. The dataset was not evenly distributed as shown in the histogram below. Histogram

Augmentation

Four types of data augmentation were performed.

  1. Rotation to adjust for seeing signs at angles. Additional steps to augment data not performed here would be to warp images.

    Rotation

  2. Histogram equalization to increase contrast

    Histogram Equalization

  3. Contrast limited histogram equalization to increase contrast with a larger kernel size

    CLAHE

Preprocessing

Images were converted to grayscale and normalized

  • Performed on training, validation and test data.
  • Grayscale images to reduce the number of parameters.
  • Sermanet Lecun 2011 found color didn't improve accuracy a lot. Prior models run with color agreed with this.
  • Data is normalized by subtracting the mean image and normalizing following common best practices in order to keep our features in a consistent range. This will reduce the likelihood of our gradients getting out of control through vanishing gradient / saturating neurons in the network

Model Architecture

The model is based on VGG. It achieves an accuracy of 95% on the validation set. VGG Like Architecture

Train, Validate and Test the Model

An accuracy of 95% was achieved on the validation set (model 6)

Accuracies

More models were trained with fewer epochs to test ensemble learning. One model didn't achieve the 93% accuracy after 500 epochs.

  1. Learning rate set to 1e-4. The learning rate of Adam decays over time and adjusts based on the gradient of the variables with momentum.
  2. Adam Optimizer adjusts the learning rate using the Adam algorithm This optimizer is derived from Adagrad an adaptive learning algorithm. The algorithm monotonically reduces its learning rate over time. RMSProp improved on this by using a moving average of gradients to reduce the aggressiveness of Adagrad. Adam improved on RMSProp by adding momentum. The default momentum and decay rate are used from tensorflow.
  3. A batch size of 64 is a function of using a large VGG-like architecture and having an older GPU. The first LeNet-like architecture had a batch size of 512.
  4. Dropout parameter of 0.5 is used as a default because it works Srivastava et al 2014 supposedly because it maximizes the regularization value of the dropout layer.
  5. Based on VGGNet
  6. The number of epochs was set to 1000 originally. This is because it was a large number at which point it seemed like the loss had reached a plateau. When training multiple networks 500 was used because it took a long time and graphs of validation accuracy of the prior run had plateued around then.

Files

Traffic_Sign_Classifier.ipynb contains the entirety of the project. This includes data exploration, augmentation, and preprocessing as well as model training, testing, and explanations.

All images placed in examples folder. CSV contain validation accuracy for each model.

trafficsign-p2's People

Contributors

sketchc89 avatar andrewpaster avatar domluna avatar awbrown90 avatar brok-bucholtz avatar dsilver829 avatar davidawad avatar mvirgo avatar swwelch avatar antorsae avatar ryan-keenan avatar

Stargazers

harbin9er avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.