Git Product home page Git Product logo

eeg-brain-computer-interface-to-play-pong's Introduction

EEG-based-Brain-Computer-Interface-to-play-Pong

The project is deprecated. Unfortunately I don't have access to the hardware anymore so I can't refactor. Sorry for everyone who was interested in the project.

Developed an Electroencephalography(EEG) Brain Computer Interface to play Pong using brain activity. The program allows to play Pong using brain activity. Furthermore, when the player hits the ball 2 times in a row they unlock a powerup. The powerup works only if the player reaches a high level of focus.

Requirements:

  • EEG Emotiv Epoc+ headset
  • PyGame
  • websockets
  • Colorama
  • Art

BCI system was developed using Python and Emotiv Cortex API to receive data from the EEG headset. Pong was developed using PyGame. The BCI uses mental commands to control the paddle movements (UP or DOWN). Mental commands are thoughts associated to a specific command. The Emotiv proprietary algorithm classifies the patterns in brain activity produced when the user is recreating the chosen thoughts. It is necessary to train the commands before using them. Mental commands are retrieved using the Emotiv Cortex API.

To measure brain waves I used the Emotiv Epoc+ headset. It has 14 electrodes

In addition I developed an asynchronous library called Cortex to communicate with the Cortex API. The library acts as a Python wrapper for all the available methods in the API and streams sensor data. It generates JSON requests and receives JSON responses through a socket. The library can be used by anyone who wants to develop a BCI in Python using Cortex API. Feel free to make changes to it.

How it works

  1. Headset measures brain waves (eletricity generated by neurons)
  2. Emotiv process and classifies the signals with proprietary algorithms
  3. Use Cortex library to request mental commands from Cortex API
  4. Use mental commands to move the paddle up or down
  5. Visual feedback.

I also developed Lain BCI which allows to connect the headset to the game, create session, load training profile and train commands.

Here is the training menu.

DEMO

eeg-brain-computer-interface-to-play-pong's People

Contributors

santiagolabs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

eeg-brain-computer-interface-to-play-pong's Issues

Game dont load at all!

Hello Author,
Thank you so much for creating the Cortex file, it helps a lot.

The issue I am facing is that after finishing all the steps in the LAIN menu, the game doesn't start at all. Any idea on how to resolve this? I am using the latest 3.8 python version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.