Cloud Migration Service Providers

  • BIG Data & Analytics
  • CLOUD
  • Data Center
  • IOT
  • Machine Learning & AI
  • SECURITY
  • Server
  • BlockChain
  • Virtualization
You are here: Home / Machine Learning & AI / TensorFlow lends a hand to build a rock-paper-scissors machineTensorFlow lends a hand to build a rock-paper-scissors machineDeveloper Advocate

TensorFlow lends a hand to build a rock-paper-scissors machineTensorFlow lends a hand to build a rock-paper-scissors machineDeveloper Advocate

October 27, 2017 by cbn Leave a Comment

Editor’s note: It’s hard to think of a more “analog” game than rock-paper-scissors. But this summer, one Googler decided to use TensorFlow, Google’s open source machine learning system, to build a machine that could play rock-paper-scissors. For more technical details and source code, see the original post on the Google Cloud Big Data and Machine Learning Blog.

This summer, my 12-year-old son and I were looking for a science project to do together. He’s interested in CS and has studied programming with Scratch, so we knew we wanted to do something involving coding. After exploring several ideas, we decided to build a rock-paper-scissors machine that detects a hand gesture, then selects the appropriate pose to respond: rock, paper, or scissors.

Rock-paper-scissors machine built with TensorFlow

But our rock-paper-scissors machine had a secret ingredient: TensorFlow, which in this case runs a very simple ML algorithm that detects your hand posture through an Arduino micro controller connected to the glove.

To build the machine’s hardware, we usedlittleBits—kid-friendly kits that include a wide variety of components like LEDs, motors, switches, sensors, and controllers—to attach three bend sensors to a plastic glove. When you bend your fingers while wearing the glove, the sensors output an electric signal. To read the signals from the bend sensors and control the machine’s dial, we used anArduino andServo module.

hardware components of rock paper scissors
The hardware components of the rock-paper-scissors machine

After putting together the hardware component, we wrote the code to read data from the sensors. The Arduino module takes the input signal voltage it receives from the glove, then converts those signals to a series of three numbers.

probability of rock paper scissors
Estimated probability distribution of rock (red), paper (green) and scissors (blue), as determined by TensorFlow and our linear model

The next step was to determine which combination of three numbers represents rock, paper or scissors. We wanted to do it in a way that could be flexible over time—for example if we wanted to capture more than three hand positions with many more sensors. So we created a linear model—a simple algebraic formula that many of you might have learned in high school or college—and used machine learning in TensorFlow to solve the formula based on the given sensor data and the expected results (rock, paper or scissors). What’s cool about this is that it’s like automated programming—we specify the input and output, and the computer generates the most important transformation in the middle.

Finally, we put it all together. Once we determine the hand’s posture, the Servo controls the machine hand to win the game. (Of course, if you were feeling competitive, you could always program the machine to let YOU win every time… but we would never do that. ?)

kaz's son drawing
My son drawing the sign for the machine hand

Rock-paper-scissors probably isn’t what comes to mind when you think about ML, but this project demonstrates how ML can be useful for all kinds of programmers, regardless of the task—reducing human coding work and speeding up calculations. In this case, it also provided some family fun!

This summer, one Googler and his son decided to build a machine that could play rock-paper-scissors. The twist? They used machine learning to do it.

Share on FacebookShare on TwitterShare on LinkedinShare on Pinterest

Filed Under: Machine Learning & AI

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • March 2016
  • October 2014

Recent Posts

  • Top 5 Crypto Gainers Of This Week; Buy The Dip?
  • NTT, Palo Alto partner for managed SASE with AIOps
  • NTT, Palo Alto partner for managed SASE with AIOps
  • Explain Splinterlands: Is Splinterlands An NFT game?
  • Enterprises turn to single-vendor SASE for ease of manageability

Recent Comments

  • Purefit Keto Reviews on Are PDUs Your Best Platform for DCIM Instrumentation?
  • https://gemcr.org/ on 10 Things You Should Know About Deep Learning

Categories

  • BIG Data & Analytics
  • BlockChain
  • CLOUD
  • Data Center
  • IOT
  • Machine Learning & AI
  • SECURITY
  • Server
  • Uncategorized
  • Virtualization

Categories

  • BIG Data & Analytics (2,137)
  • BlockChain (464)
  • CLOUD (3,170)
  • Data Center (643)
  • IOT (2,252)
  • Machine Learning & AI (88)
  • SECURITY (1,549)
  • Server (3)
  • Uncategorized (2,011)
  • Virtualization (331)

Subscribe Our Newsletter

 Subscribing I accept the privacy rules of this site

Copyright © 2023 · News Pro Theme on Genesis Framework · WordPress · Log in