Skip to content

Real-time Air Hockey Robot controlled by a Convolutional Neural Network.

License

Notifications You must be signed in to change notification settings

arakhmati/deep-learning-air-hockey-robot

Repository files navigation

Deep Learning Air Hockey Robot

Real-time air hockey robot controlled by a convolutional neural network.

Main Components

  1. Air Hockey Game Simulator is implemented using Pygame library and is used to generate images that are as close as possible to the frames that will be captured by an Android phone during an actual game. The simulator has real-life physics and serves two main purposes:
    1. Produce frames labeled with the action of programmed AI in order to pretrain convolutional layers of the neural network.
    2. Act as an environment for a Reinforcement Learning Agent.
  2. gym-air-hockey is an OpenAI Gym Environment Wrapper around Air Hockey Game Simulator. It is used to determine the rewards, as well as process actions and observations.
  3. Perception is an Android Application that is used to control the robot during the game. It captures and processes the frames, infers the prediction of the CNN and sends it to Arduino via BluetoothLE.
  4. This repository contains scripts used to generate labeled frames, pretrain CNN using supervised learning, further train CNN using reinforcement learning, convert keras model to caffe2 using keras-to-caffe2 converter, visualize CNN filters and layer activations using unveiler and etc.

Training Neural Network

alt text

System Overview

alt text

Screenshot of Frames Generated Using Air Hockey Game Simulator

alt text

Screenshot of Frames Captured Using Perception

alt text

Prerequisites

Python3
Android Studio
keras-to-caffe2

Optional:

unveiler

Download and Install

git clone --recursive https://github.com/arakhmat/deep-learning-air-hockey-robot
cd deep-learning-air-hockey-robot
cd air-hockey; pip install -e .; cd ..;
cd gym-air-hockey; pip install -e .; cd ..;