Rock Paper Scissors CNN

For one of my first year assignments, I used a rock, paper, scissors image dataset and created mutiple CNN learners to explore different methods of improving the accuracy of the predictions. This was done in a Jupyter notebook using google colab for the training. This was also paired with SciKit-image.

The following libraries were used:

  • Numpy
  • Pandas
  • OS
  • Fast.ai
  • SciKit-Image
  • Random

The test, train and validation sets were already seperated into 2 duplicate folders. One was used for the original training to gauge a baseline and then another to add augmented images for further training. Initially, the predictions were not accurate on the unmodified dataset. The model was confusing scissors for hands. I tried finding the optimum learning rate which proved to be inaffective when predicting on the validation set. The first learner produced inconsistent graphs when training. After trying larger image sizes, the model seemed to improve slightly but not enough. I then tried Image Augmentation with SciKit-Image. I created 2 functions, One to randomly rotate an image, and the other to iterate over a given Directory of images and return new copies of the images with random rotations. This took Approximately 8 mins to run and generated 2157 images, doubling the starting total. Using this expanded set improved the accuracy of the predictions significantly, which also used a larger resnet size of 50 instead of 32, which guessed only 3 wrong out of the 33 in the validation set. Which resulted in an accuracy of 90.91%.

View Notebook