Rock, Paper, Neural Net

You might think the game of Rock Paper Scissors is just the random chance, but that’s not true. There is a strategy for Rock Paper Scissors, multiple ones in fact, and the best human players can consistently beat any Joe Schmoe off the street. But what about computers? [Paul] answered that question with a tiny little keychain dongle that can beat you at Rock Paper Scissors.

This is a neural network, and you need to train a neural network, so where did [Paul] get all that data? roshambo.me offers thousands of paper rock scissor games, and trained the network on more than 85,000 human games, along with about 10,000 simulated games. Rock Paper Scissors isn’t a complicated game at all, and the entire neural network is stored on an ATtiny1614 microcontroller. The calculations are done as floats, even. That’s how non-computationally intensive this project is.

Building a neural network is one thing, but putting it in a handy keychain enclosure is something else. This handsome device fits on a PCB just larger than a 2032 coin cell battery and is enclosed in a 3D printed case. The buttons are 3D printed as well, with some clever application of fiber optic as light pipes for the LEDs. The end result is something that is slightly better than random chance at Rock Paper Scissors and shows off some matrix programming skills. Check out the video below.

6 thoughts on “Rock, Paper, Neural Net

  1. The original description quite correctly calls this “slightly better than random”, which is definitely correct. I wish hackaday would have also reported neutrally, instead of the “consistently beat” hyperbole. That’s only true if you yourself are not choosing randomly, and also only if you play enough many games that the very slight advantage translates to a consistent difference in points.

    1. The “consistently beat” is about the best HUMAN players against a random passerby on the street. And YES, they CAN consistently beat an opponent like that because the best human players indeed aren’t throwing random. They’ve learned all kinds of techniques from reading body language to subtle language cues to outright trash talking to throw of their opponent.

      The thing is that none of those things works on a neural net inside a keychain toy, meaning there is a good chance this little thing would do slightly better than random against even the best human players too.

Leave a Reply to alfcoderCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.