This project was my submission as part of Harvard's Introduction to Artificial Intelligence with Python course.
With autonomous vehicles research taking great strides, one hurdle which still remains is computer vision. In order for AI to effectively autonomously pilot a vehicle, it first needs to understand its environment. While the scope of computer vision in AVs casts a wide net, one component of it is traffic sign recognition.
In this project we'll be utilizing the German Traffic Sign Recognition Benchmark (GTSRB) which is a collection of 39,209 labeled training images and 12,630 test images of 43 different traffic sign types with varying lighting conditions and backgrounds. To classify the GTSRB images, we'll be utilizing OpenCV, an optimized computer vision library, in conjunction with TensorFlow to create a convolution neural network.
Figure: Architecture of the finalized convolutional neural network. The final four layers of the network respectively are a flattened layer, dense layer, dense dropout layer, and a final dense layer with the 43 sign classifications.
The experimentation process for the traffic.py convolutional neural network consisted of iteratively adding and removing components and layers to see how they affect the accuracy and loss. Beginning first with a barebones neural network containing only an initial convolutional layer, a flatten layer, and a dense output layer.
The first experiment on the CNN was to test different values for the filters. It was found that the highest accuracy occured when there were multiple convolutional layers which had different values for filters. The CNN slightly improved with the addition of an average pooling layer (moreso than max pooling).
At this point, the accuracy had plateued at approximately 95% and was performing poorly on the test set. Adding an additional dense layer with a dropout before the output improved the performance on the test set; dropout layers on convolutional and output layers proved to be insignificant at best and fatal to the network at worst.
The final addition which made a significant improvement on the existing CNN was the addition of a second loop of convolutional and pooling layers. The second loop made the largest improvement on the total accuracy when it had convolutional layers with different filter values than the initial loop and a max pooling layer rather than an average pooling.
You can view the finalized code and dataset for this project on my Github at this link