Skip to content

christos-kouros/Rock_Paper_Scissors--Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Rock_Paper_Scissors--Game

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:

  1. LR (Logistic Regression)
  2. CNN (Convolutional Neural Network)

At the end, we will compare the results of these two models

Dataset

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.

Implementation:

Data preperation

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].

Models

Two different models were created:

  • LR
  • CNN

Random Agent

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.

Goal

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

Results

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.

First example

Model Wins Losses Draws Wallet
CNN 427 90 32 337
LR 283 152 114 131

cnn bar 1 lr bar 1

cnn line 1 bar line 1

Second example

Model Wins Losses Draws Wallet
CNN 426 88 35 338
LR 263 150 136 113

cnn bar 2 lr bar 2

cnn line 2 lr line 2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published