The goal of the project is to construct an intelligent agent that will learn to play the game Rock-Paper-Scissors. More specifically, the agent will observe an image corresponding to 0: Rock, 1: Scissors, or 2: Paper and choose the corresponding symbol that beats it.
Two different models have been created to achieve this:
- LR (Logistic Regression)
- CNN (Convolutional Neural Network)
At the end, we will compare the results of these two models
The dataset that was used to train and test our models can be found here: https://www.kaggle.com/datasets/drgfreeman/rockpaperscissors. It contains approximately 2,100 images of hand gestures representing 'Rock,' 'Paper,' and 'Scissors.' We split our dataset into 75% for training and 25% for testing.
The images were initially too large, containing unnecessary information. Therefore, the images were resized to 30x30 pixels. After that, they were converted to black and white, reducing the total pixel count by one-third. Lastly, the images were normalized to the range [0, 1].
Two different models were created:
- LR
- CNN
The random agent always plays first. A random image is selected from the test set. The following transformations are applied to the image:
- Vertical flip with a 50% chance
- Horizontal flip with a 50% chance
- Noise with a standard deviation of 0.05.
Our goal is to maximize our profit. If we win the round, we get 1€ back, but if we lose the round, we lose 1€ as well. In case of a draw, nothing happens
Here are some results of our implementation. We compare the with the same dataset each time. The CNN was more accurant with its predictions making it the more favcorable one.
Model | Wins | Losses | Draws | Wallet |
---|---|---|---|---|
CNN | 427 | 90 | 32 | 337 |
LR | 283 | 152 | 114 | 131 |
Model | Wins | Losses | Draws | Wallet |
---|---|---|---|---|
CNN | 426 | 88 | 35 | 338 |
LR | 263 | 150 | 136 | 113 |