This is the source code for an online Human-Agent Interaction (HAI) system, controlling directions (left or right) of Unity games using online EEG signals from the Emotiv EPOC+ headset
Hardware equipments required:
- A Windows computer/laptop installed with Unity (The reading of EEG raw data from the headset is only supported by the Windows OS)
- An Emotiv Epoc+ Headset
Software environment:
The project supports Python3. The recommended version is Python 3.6.11.
Anaconda is recommended for managing the environment.
-
Download the project folder.
The EEG folder contains some libraries needed for this project.
The gumpy folder is another library we use for the EEG signal pre-processing (modified from gumpy).
The data folder contains the training IM dataset from BCI Competition IV-2a.
The three files starting with "CNN_" are the files for the pretrained classification model.
-
Navigate to the gumpy folder. Execute
pip install .
to install the gumpy library. -
The project also requires the kapre library. Install by executing
pip install kapre==0.1.3
-
Put on the Emotiv Epoc+ headset, make sure it's turned on and connected to the Windows computer/laptop. Make sure the contact quality is good. Open a Unity game on Windows, such as the Karting game.
-
Execute the EEG_Control_CNN.py
python EEG_Control_CNN.py
to control the Unity game using real-time EEG signals from the headset. By default, it's using the pretrained classification model.If you want to train your own model using the training dataset, you can modify here by changing the "load" parameter to
load = False