Giter VIP home page Giter VIP logo

traffic-sign-classifier's Introduction

Traffic-Sign-Classifier

The German Traffic Sign Recognition Benchmark dataset on kaggle is a popular multi-class classification dataset on Kaggle. Traffic sign data was collected and is to be classified into 43 different classes. The data visualizations can be found in the visualization.py file. A small sample of the dataset is shown below. The dataset is diverse, including images which have low contrast, which even humans may find difficult to classify. Some images are shaky, and some are blurred.

Dataset Sample Images

The distribution of the classes was then plotted with matplotlib to get a feel for the dataset balance. However, the data is highly imbalanced with some classes having around 2000 samples, while others having only 200. That's almost an order of magnitude of difference. To balance the dataset, weighting or oversampling could have been done. In this model, the weights were used. To weight the data, the number of images in every class was calculated. The weight was the reciprocal of this value divided by the maximum number of images in a class.

Class Distribution

The deep learning model was built with TensorFlow and Keras. The training code is in the file training.py. The model alternates between a convolution layer and a pooling layer thrice before flattening and using a normal one layered feed forward network. All layers are ReLU activated. The feed forward connects to the output layer with a softmax activation. The model summary is shown below.

Model Summary

The images in the dataset were all of different sizes. They were preprocessed to a uniform size of . The output vectors were one-hot encoded. The loss function used was categorical crossentropy, and the model was compiled with the Adam optimizer. The model was finally trained for 20 epochs. The variation of train and validation accuracy and loss as the epochs pass is plotted below. The trained model was saved in a file.

Train Chart

Finally, the model is used in a simple GUI interface built with PyQt5. The image is to be loaded into the file, and the prediction is done automatically.

GUI interface

The next version of the project can probably include localisation of the sign in an entire image, with a bounding box highlighting the traffic sign.

traffic-sign-classifier's People

Contributors

sbalan7 avatar

Watchers

 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.