Brain Powered: Introduction - ManuJackPel/Brain-Powered-2022-2023 GitHub Wiki
This manual is created for the students participating in the Brain Powered BCI (Brain-Computer Interface) course. It provides a guide to the software, packages, and code snippets essential for the project's successful completion. Due to the fast-paced evolution in software libraries and better code implementations, this manual is expected to undergo frequent updates. We encourage future students to maintain the relevance of this manual by updating it with newer and more effective methods.
Using This Manual
In the course, students are tasked with designing a simple BCI setup, which includes developing a pipeline to transform brain measurements into commands and writing the code to achieve this. The manual, however, focuses more on code implementation rather than specific algorithms. Although specific pipelines will be used for illustration, we recommend documenting the project in a research report.
There are a plethora of online resources available including papers and tutorials illustrating potential BCI pipelines. These links will be provided under the 'Additional Resources' section of the manual. Majority of the project code will be written in Python. Due to the rapid update cycle of Python libraries, some details in this manual may become deprecated over time. Nonetheless, we still recommend using the code snippets provided in this manual, with a caution to refer to the source code to implement contemporary adaptations.
One significant aspect of this project is its uniqueness from most of the courses you may have previously encountered. It involves continuing a system built by previous students, and with the variety of applications running in parallel on specialized hardware, complex debugging issues are expected to arise. Although we have tried to document many of these issues, some may have been missed. Whenever a particularly challenging bug arises, we recommend reaching out to previous course participants for advice and potential solutions.
For this purpose, the contact information of previous students and contributors to this guide are provided. You may reach out to:4
- Brandon Chin-A-Lien at [email protected]
- David Glotzbach at [email protected]
- Manu Pel at [email protected].
The BCI Pipeline: Many Devices and Many Processess
Brain-Computer Interfacing (BCI) is a complex domain that often involves multiple processes running in parallel across different devices. Each script in this setup serves a unique purpose.
Traditionally, you may be used to running a single process on a single device to accomplish a task. However, in BCI, the scenario is quite different and more complex. Let's walk through the scripts that will always be present in this context:
- A process which generates electrophysiological data based on the the EEG setup.
- A script dedicated to reading the EEG data. This data is saved to a buffer, ready to be sent to Python for further processing.
- A second script that takes the live data, analyses the signal, and classifies it. This step determines to which class the incoming signal belongs.
- After classification, the class prediction is then sent to a third script, which is responsible for controlling the device in question - in our case, a drone.
These scripts can be run on separate computers or consolidated on a single machine, depending on your setup. Besides these core processes, other processes might be running which aren't essential for the BCI task but can be useful. These may include a process for visualizing the EEG signal in real-time as it's being recorded and another process to store the data for later analysis. Given this, you can expect to work with between 1 and 3 computers and between 3 and 5 processes, all performing different actions.
Important questions to keep in mind what software tools should be used for each process. Each process can be implemented using a variety of libraries, which each library having specific pros and cons. Additionally, one should consider how these different processes communicate with each other is critical. The smooth flow of data and instructions between processes, whether they are on the same machine or distributed across multiple computers, is fundamental to the system's overall functioning and performance and performance. Here too a variety of protocols can be used. Lastly, it is important to consider how errors in one process can influence others and how to mitigate such impacts.