# Training a CNN on Rock-Paper-Scissors images using Keras and OpenCV

*My attempt at the Rock-Paper-Scissors classification problem.*

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1709743991924/aa469265-9473-4b75-b6c9-980f1ced64ac.png align="left")

## Project Demo

<iframe width="800" height="450" src="https://www.youtube.com/embed/mjglZWtWQCg?si=dNnfSfn36myYZfUK"></iframe>

## Project Repo

This project is available on my github:

[RockPaperScissorsCNN](https://github.com/alexdjulin/RockPaperScissorsCNN)

## Datasets

I used the following 3 datasets to train the CNN from scratch:

[DRGFREEMAN](https://www.kaggle.com/datasets/drgfreeman/rockpaperscissors) - Edited to remove the green screen, see *remove\_greenscreen* notebook  
[SANI KAMAL](https://www.kaggle.com/datasets/sanikamal/rock-paper-scissors-dataset) - Also available in tensorflow\_datasets, see *download\_dataset* notebook  
[ALEXDJULIN](https://www.kaggle.com/datasets/alexandredj/rock-paper-scissors-dataset) - I created this one myself

## Model

The latest version of my model is available here:  
[rps\_v01\_56ep\_0.9641acc\_0.1089loss.h5](https://www.kaggle.com/models/alexandredj/rockpaperscissorscnn)

## Additional Ressources

This model is inspired by the following tutorials and repos:  
[Python for Computer Vision with OpenCV and Deep Learning, by Jose Portilla](https://www.udemy.com/share/10143y3@ej9KzT_foe24Wk2_uXGAtEVenA9f0XWBnCTPnbixcYg1S9zeDuo0OOhYeRGyG5j-/)  
[rps-cv repo from drgfreeman](https://github.com/DrGFreeman/rps-cv)  
[Rock-Paper-Scissors Image Classification Using CNN from Farah Amalia](https://medium.com/geekculture/rock-paper-scissors-image-classification-using-cnn-eefe4569b415)
