15 ETH Winner

The competition required entrants to produce a content piece (or other creative idea) around the following premise: We received 20 entries from freelancers around the world including Australia…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Using a Convolutional Neural Network to Identify Traffic Signs

When it comes to the industry of self driving cars, it is vital that there is a high accuracy and detection of the traffic signs. Recently, I have used Google Colab to write code in order to classify basic traffic signs that are seen on the road everyday by human drivers.

The data set used for the project was German Traffic Signs. Within the data set, there were 43 types of signs in the data. Each image in the dataset is 32 pixels x 32 pixels x 3 Channels (one each for RGB). The data set consisted of a total of 34799 training examples, 4410 validation examples, 12630 testing examples.

I started by importing the following at the beginning of the program:

In order to import the data which was different traffic signs:

In order to load the data, the following code was used:

Although, there is a significant imbalance across classes in the training set, as shown in the histogram below. Some classes have less than 200 images, while others have over 2000. This means that the model could be biased towards over-represented classes, especially when it is unsure in its predictions.

The following traffic signs are some of the training data that will be utilized to train the CNN to identify and sort different signs. This is a sample of the images from the dataset, with labels displayed above the row of corresponding images.

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

The main preprocessing technique I used was to grayscale the images. I used this approach since many signs had similar color patterns and hence, no real advantage would come from using color expect from some cases. The best way to classify the different traffic signs in this case would be to in the use of grey scale, as an image preformed in greyscale processing is one in which the value of each pixel is a single sample representing only an amount of light that is there. This creates a very accurate and intense information base. The colors disappear after a single layer. A sufficiently deep convnet would only be minimally affected in terms of computation time. Although, a convnet essentially learns its own grayscale maps anyways.

The following code: plt.imshow

Plots numpy arrays as images, the data in numpy array exported previously from german traffic signs. The code will render it and grab the plot object which will give an easy way to manipulate the plot from the prompt.

Images are then converted to greyscale

Through this, the images go through numerous layers, in order to be identified later for testing. The following image displays the layers within the CNN, so that it can identify the traffic signs.

The following code initializes the layers within the CNN.

graph displaying the accuracy of the convolutional neural network program

The accuracy of the CNN is 96.6%. This is incredible, being that most of the time, the program will accurately know and interpret what the traffic signs are when given.

Add a comment

Related posts:

Stand Up

They say words are just words. They say once you say something, you can never take it back. What do I say? I say “whatever doesn’t kill you makes you stronger.” A lot of people go through life…

Action over Perfection in 3 Step Formula

Are you someone who tends to get bogged down in the details, always striving for perfection before taking action? If so, you’re not alone, welcome to the club :) Many of us struggle with the fear of…

Understanding and Overcoming Pessimism

Pessimism is a state of mind where one views the world and its events as overwhelmingly negative. This negative outlook can often lead to feelings of despair, hopelessness, and sadness. In today’s…