In order to increase the accuracy of the model, we used a convolutional neural network to train on the data. A convolutional neural network (CNN) is a type of deep neural network that is used for analyzing visual imagery.
In our CNN, we used 16 layers – some of them were convolution layers, some were max pooling layers, and one was a softmax layer.
Using this CNN, we had an overall training accuracy of 78.70%, and a testing accuracy of 55.53%. This is higher than the accuracy of all of the classification algorithms we used previously.
The above image shows the convolutional neural network architecture.
The code shown above is the layers of the CNN that we used. We used 10 epochs and a batch size of 256.
The above image shows the testing accuracy after each epoch. In the end, the accuracy was 55.53%.
The table above contains the different activation functions that we used, and the accuracy of each one.
The above image is a Confusion Matrix showing the accuracy of the CNN.
The above image shows how the neural network classified images from the test set. The graph under each image shows how the network would have classified each image.
The CNN we have developed is able to classify new images that are not in the dataset as well. We used this trained model to develop a real time application on Day 4.