Skip to content

Tanu-Shree-31/Traffic-Signs-Classification

Repository files navigation

Traffic-Signs-Classification

Traffic Sign Classification is employed to detect and classify traffic signs to inform and warn a driver beforehand to avoid violation of rules. There are certain disadvantages of the existing systems, used for classification, like incorrect predictions, hardware cost and maintenance, which are to a great extent resolved by the proposed system. The proposed approach implements a traffic signs classification algorithm employing a convolutional neural network.

View my deployed Model on Streamlit using Streamlit Sharing

Click here to see the deplyed model: Streamlit App

Snapshot of the result:

image image

The purpose of this project is to train and test an implementation of the Convolutional Neural Network for a classification task. The model will be used in an application, where the user can upload a photo of a traffic sign and get the prediction of its class.

DATASET

The dataset was taken from The German Traffic Sign Recognition Benchmark (GTSRB) and was presented first-time at the single-image classification challenge at the International Joint Conference on Neural Networks (IJCNN) 2011. It was created from about 10 hours of video recorded while driving on different roads in Germany during the daytime. The Data consists of about 40.000 real colorful photos of traffic signs.

BUILDING THE MODEL

image

Initially, the CNN model architecture is built. The following steps are followed :

  1. Sequentially add the layers in the order: two convolutional layers, one pooling layer, dropout layer, again two convolutional layers, one pooling layer, dropout layer, flattening layer, dense layer, again a dropout layer and finally the dense layer.

  2. In the convolutional layer, number of filters is specified. It performs the convolution operation on the original image and generates a feature map.

  3. The ReLU performs the maximum function to convert the negative values to zero without changing the positive ones and generate a rectified feature map.

  4. The Pooling layer takes the rectified feature map and performs a down-sampling operation (like Max Pooling or average pooling) and thus reduces the dimensionality of the image.

  5. The flattening layer is used to convert the input feature map to a 1-dimensional array.

  6. The dropout layer is used to avoid over fitting by setting some of the input neurons to 0 during the training process. The dense layer, on the other hand, feeds all the outputs from the preceding layer to all its neurons and perform the matrix- vector multiplication (the row vector of the output from the preceding layer should be equal to the column vector of the dense layer), to generate a m-dimensional vector.

  7. After addition of the layers, the model is to be compiled (final step in the creation of model to define the loss function and apply optimization techniques) and assign the loss function as “categorical_crossentropy” and use the “Adam optimizer”. The reason for specifying this loss function is that the proposed system is a multiclass classification problem, where multiple classes are considered but one image belongs to exactly one class.

  8. Next, the model is trained using the training dataset, by passing the pre-processed images from the training dataset.

  9. Finally, the predictions on the test data are done using the trained model and the traffic sign name along with the class Id is shown as an output.

image image

LIBRARIES USED

RESULT:

image

Epochs: 20 Therefore, Obtained an accuracy of 94.86% on the testing data.

##FUTURE SCOPE: Can be used to detect the traffic signals in live and the environmental constraints including lighting, shadow , distance (sign is quite far), air pollution, weather conditions in addition to motion blur, and vehicle vibration which are common in any real time system may affect the detection and thus the classification. Hence, there is a need for further research and advancements to deal with these issues. Also, there are certain traffic signs that may not be predicted accurately. For this, augmentation and one hot encoding techniques can be used. Augmentation involves shifting of the image, zoom in and rotate the images (if required).

Connect with me! 🌐

Known on internet as Tanushree Shetty

Email Me 📧

PS: Please do not forget to drop a star if you like it !!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published