Reflecting On My First Brain-Computer Interface: 4 Mistakes I Made

..and how I solved them during my second project

--

One year ago, I finished my first BCI project. The results were bad. At that time, I could not imagine that one year later I would have built a good performing BCI project to play a game in real-time. But I did.

In the last six months, I did a research internship building a brain-computer interface (BCI) to play a game real-time. During this time, I still encountered a lot of problems, hick-ups, and disappointing results. However, I ended up solving the problems, and having satisfactory results!

Now, reflecting on my first project, I like to share 4 mistakes I made back then, and how I solved them this year. Let’s see which!

Playing a real-time dodge game using a BCI. This seemed impossible after my first project. But with my second project, I made it work. Image by author.

1. Location Is Everything

For both of my projects, I tried to decode motor imagery (MI), the mental task of imagining moving a certain part of your body without actually moving it. I tried to distinguish left arm MI, right arm MI, and relaxing.

For my first project, I used the Muse 2 headset. Little did I know, that by choosing the Muse 2, I made it nearly impossible to decode any kind of MI, even before I wrote any code! The area for motor control lays around the middle of the center part of the brain, in the area called the motor cortex.

The electrodes of the Muse 2 were not placed above the motor cortex… Thus, these electrodes would not capture much information of brain activity during motor imagery. During my second project, I used the g.tec Unicorn device. As visible in the figure below, the Unicorn does have 3 electrodes in the area of the motor cortex. I wrote in more detail about choosing an EEG device for your project here.

The electrode placement of Muse 2 (left) and g.tec Unicorn (right). The red highlighted area contains electrodes placed above the motor cortex. Image by author, inspired by [3].

2. Experiment Setup Is Important

During my first project, I quickly wanted to see if my approach worked. So, I asked some flat mates to participate in my research. I put them in a chair, placed the Muse 2 on their head, started data collection and basically just shouted whenever I wanted them to perform a kind of motor imagery.

As I found out during my second project, experiment setup is very important to avoid noise or distraction of the subject. We carefully designed an experiment protocol to minimize both, which you can read about here.

3. “Traditional” Feature Engineering & Machine Learning Does Not Work For EEG

Before working on my first project, I just learned about machine learning for time-series data. How one can pre-process this data, and extract features such as standard deviation, range, mean, and other features, to then feed to a machine learning model.

Naturally, I applied these just-learned techniques to my BCI project. Little did I know that for EEG data, a whole specialized field exists, where pre-processing, outlier detection, feature engineering, and machine learning models are developed specifically for EEG data.

4. Brains Are Unique. And Difficult.

When training my machine learning model one year ago, I assumed I could throw the data of all my flat mates on one big pile, train a general model, and then just apply this model to whatever person who showed up in my room.

Later, I learned, and realized, that the brain is not that simple. Each brain is unique, and produces different signals. Even day-to-day variability of the same subject can disrupt your model.

Care is needed when trying to build a general model. To find out how I eventually build an approach for a generalized deep learning model using deep transfer learning, read more here.

Conclusion

With this post, I hope that beginning BCI-enthusiasts will not make the same mistakes I did during my first project. To wrap up, think about the following things when working on your first project:

  1. Take electrode placement into account when deciding which EEG device to use for your project.
  2. Think about your experiment setup: when people are distracted, fatigued, or don’t follow your instructions, you won’t be happy with your data!
  3. Machine learning for EEG data is a specialized field. Read upon the literature, and don’t assume that EEG data is just another type of time-series: it’s more complex than that!
  4. Brain signals will be unique for each subject, and a general model may not work. Working with human data is difficult, but that’s where the fun is!

Good luck in your BCI journey!

--

--

Tim de Boer
A Beginner’s Guide to Brain-Computer Interfaces

Master graduate AI @VU Amsterdam. Currently learning and writing about building brain-computer interfaces. Support me: https://timdb877.medium.com/membership