Rock-Paper-Scissor Game Using ML - FinalBlog

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

11/4/2020 Rock-Paper-Scissor game using ML

This site was designed with the .com website builder. Create your website today. Start Now

All Posts Log in / Sign up

18IT012 BHOOMIBEN BHATT Oct 5 2 min read

Rock-Paper-Scissor game using ML


Updated: a minute ago

Introduction
Machine Learning is the ability of machine to learn and improve from their past experience or
data, without being explicitly programmed. Machine learning is so popular. Because we are
having rich data-sources to build models that solves problems in high dimensional space.
System can learn from data, identify patterns and make decision with minimal human
intervention.
Machine learning works with large amounts of data. It is useful for small amounts of data too.
Deep learning on the other hand works efficiently if the amount of data increases rapidly.
Deep learning algorithms are designed to heavily depend on high-end machines unlike the
traditional machine learning algorithms. Deep learning algorithms perform a number of matrix
multiplication operations, which require a large amount of hardware support. SqueezeNet is
the name of a deep neural network for computer vision.

I have use OpenCV to capture user’s move through the webcam. OpenCV is a cross-platform
library, with the help of OpenCV we can develop real-time computer vision (understand a 3D
scene from its 2D image) application. I have used CNN because CNN takes input as a 2D
array and works directly on the images rather than focusing on feature extraction and I have
used keras and tensorflow for building neural network. TensorFlow is an open source machine
learning framework. It is used for implementing machine learning and deep learning
applications. TensorFlow is designed in Python programming language. TensorFlow is the most
famous symbolic math library used for creating neural networks and deep learning models.
TensorFlow is very flexible and the primary benefit is distributed computing. Keras is compact,
easy to learn, high-level Python library run on top of TensorFlow framework. It is made with
focus of understanding deep learning techniques, such as creating layers for neural networks
maintaining the concepts of shapes and mathematical details.

https://bhooomyy.wixsite.com/rockpaperscissor/post/rock-paper-scissor-game-using-ml 1/3
11/4/2020 Rock-Paper-Scissor game using ML

This site was designed with the .com website builder. Create your website today. Start Now

Rock-Paper-Scissor is a ML (Machine
Learning) based game, AI uses laptop’s
webcam to recognize that what move you
have made from them and classify into one
of these categories: Rock, Paper or Scissor.
Here the core engine of game is Image
classifier. So, to make the classifiers I have
used a pretrained Convolutional Neural
Network called SqueezeNet and retrain its
output layer to accommodate into three
new categories. and after that using
Tensorflow and Keras I have trained my
model and after training I have perform
some preliminary test.

Working Process
There are four simple steps to follow.
1) Collecting Images
2) Select and Design Neural Network &Training
3) preliminary Test
4) play game with AI

So, First step is to collect image dataset (Rock, Paper, Scissor, None) using
python gather_images.py rock 200
Gather Images for each gesture (rock, paper and scissors and None)

You can capture as many images as you wanted to because it is good practice to take
variations in dataset. and store it into a particular folder.

Now, Next step is to train model using


python train.py

I have used squeezeNet


neural network which is
pretrained neural network,
we just have to retrain its
output layer to accommodate
into three new categories i.e.
rock, paper, scissor.

Third step is to perform some test using


python test.py <path of selected image>

And after that Final step is play game with AI using


python play.py
https://bhooomyy.wixsite.com/rockpaperscissor/post/rock-paper-scissor-game-using-ml 2/3
11/4/2020 Rock-Paper-Scissor game using ML

This site was designed with the .com website builder. Create your website today. Start Now

Demo

0:00 / 3:16

GitHub Link
https://github.com/bhooomyy01/Rock-Paper-Scissor-Game

1 view 1

Log in to leave a comment.

https://bhooomyy.wixsite.com/rockpaperscissor/post/rock-paper-scissor-game-using-ml 3/3

You might also like