Brain Computer Interface

Facebook is making solutions to talk from the brain – so do I

2017-04-23 Brain Computer Interface, DSP2017 No comments

During F8 Facebook Developers Conference 2017, Facebook revealed its plans for the nearest years.
Among different stuff, keynote from the day 2 was especially interesting for me. Speakers talked about connectivity projects increasing access to the Internet across the globe, different methods of human-computer interaction, virtual reality, and last, but not least Brain-Computer Interface.

It’s super-interesting for me, because 4 years ago I wrote Master Thesis about Brain-Computer Interface for Mobile Devices at my university & published a few short articles about Brain-Computer Interface on this blog. You can also download my EEG Analyzer Android app from Google Play Store. I also wrote another app called EEG Controller for communicating with the external world with brain and optionally with eye blinks. It wasn’t published. Maybe I’ll enhance and publish it in the future or I’ll create a better app for the similar thing. Of course, my apps are much simpler & less advanced than the Facebook plans, but still, both of them are aiming to solve similar problems.

Facebook is planning to hire 60 engineers and PhDs to develop new Brain-Computer Interface. If I understood them correctly, they’re planning to create non-invasive hardware & software, which will be as much accurate as invasive hardware. In simple words it means, they’re not going to create implants for the brain, but some kind of wearable device, which will have the same (or better) accuracy as the brain implants, which exists today. Definitely, it’s not an easy task. If you are skeptical about such brain technologies, I can tell you that technology available today is far away from “reading the mind or thoughts”. It rather analyzes & interprets brain waves and signals. It allows to determine, if we are concentrated, relaxed, sleepy, tired, etc. With more precise tools, we can simply gather more data and information, which will hopefully allow developing tools, which are capable of “typing with the brain”. Nowadays, consumer wearable electroencephalographs like NeuroSky MindWave or Muse allows to read rather “binary” data like: you’re concentrated or not & you’re relaxed or not. In addition, they can give you such results in percentage value. It can be used for developing simple communication apps, which can allow people to communicate with just a brain, but using them may be not so convenient, slow or inefficient. Despite these disadvantages, for people with diseases like LIS, it may be the only hope for communicating with the world.

I’m keeping fingers crossed for the Facebook BCI project! Moreover, I’m planning to extend my own work and create more complex BCI solutions in the future. Right now, I had these ideas only in my head. I’m also not going to compete with Facebook because I don’t have knowledge or resources (at least not yet) to develop my own BCI hardware. Not to mention about 60 engineers, which are far smarter & more experienced than me. I have an idea about using hardware, which already exists on the market and to write better software for using it because a lot of solutions available now are quite poor in my opinion. It may leverage the potential of BCI in daily usage and make technologies like EEG more available & affordable for the people who need it for research or medical solutions. Having in mind the fact that Facebook is putting a lot of serious effort in BCI technology, I’m becoming more convinced that this technology may the future and the way to go.

Interpreting data in *.csv files generated by EEG Analyzer

2015-01-06 Analysis, Brain Computer Interface 4 comments

Introduction

Sometimes people send me e-mails concerning EEG Analyzer app. Usually they are not sure how to interpret or analyze results generated by the app and uploaded to Dropbox server. My app is quite “raw” and simple, because it is additional project created during writing my Master Thesis, which helped me to perform some experiments and analysis of EEG data. That’s why I didn’t focused on generating reports from gathered data. I focused only on reading and gathering data from MindWave Mobile device. In this article I’ll show you how to interpret data generated by EEG Analyzer and draw simple plots showing change of attention level, meditation level and blink strength.

Step #1 – download and install LibreOffice Calc

LibreOffice Calc is free software similar to MS Office. Currently, I’m using Linux, so I’ve chosen this tool, but if you are using MS Windows, you can perform similar operations in MS Office and MS Excel.

Step #2 – gather EEG and eye blinking data

Download EEG Analyzer app to your mobile device, connect it with MindWave, go to the settings and enable “Save EEG and eye blinking data” option. After that, go back to the main screen. Wait for some time and let the app record your EEG data. Next, go to the Settings screen again. You should see that “Number of the signals saved on the device” is greater than zero, so your data was recorded. Click button “Export data to Dropbox”. After that, you should see a message informing you that data was exported successfully.

Step #3 – access gathered and uploaded data

Go to your Dropbox directory on your disk or Dropbox website. Next, go to the “EEG_Analyzer” directory. You should see files containing your exported signals in that directory. Names of the files should look like that: egg_analyzer_data_20140830_183410.csv. First section with the numbers represents date. 20140830 means 30th of August 2014. Second section represents time. 183410 means 18:34, 10 sec. (6:34 PM, 10 sec.)
When you open this file in a text editor, you should see something like in table below.

See raw *.csv file here.

Values on the top describes contents of the columns. _id is id of the record in SQLite database table on the device, type represents type of the signal (4 – attention, 5 – meditation, 22 – blink strength), level represents attention level (from 0 to 100), meditation level (from 0 to 100) or blink strength (I don’t know maximum value, but it’s always positive integer value), milliseconds represents Unix Timestamp in milliseconds. We can extract date and time in many ways. E.g. using website currentmillis.com or by writing our own script, software or formula in spreadsheet software like LibreOffice or MS Excel.

Step #4 – open exported file in LibreOffice Calc and draw plots

Below, you can follow the steps, which allow you to analyze EEG data and generate plots presenting change of attention level, meditation level and blink strength in time. I am using Polish version of the Ubuntu and LibreOffice, but you can find the same options in your language in the same places.

Step #4.1 – open *.csv file with LibreOffice Calc

eeg_librecalc_tut_01

Step #4.2 – import data

eeg_librecalc_tut_02

Step #4.3 – display data

When you confirm importing of the data, you should see data in LibreOffice Calc.

eeg_librecalc_tut_03

Step #4.4 – add data auto-filter

Mark “type” column and from menu choose “Data” » “Filter” » “Auto”.

eeg_librecalc_tut_04

Step #4.5 – apply filter

After adding filter, you should see little arrow in the “type” column. When you click on the arrow you can filter all signals representing attention by choosing type = 4 and “unchecking” other types.

eeg_librecalc_tut_05

When you click “OK”, you should see only “attention” signals.

eeg_librecalc_tut_06

Step #4.6 – draw the chart

Choose option “Insert” » “Object” » “Chart (Plot)”

eeg_librecalc_tut_07

Or click on the icon:

eeg_librecalc_tut_08

Define initial plot parameters:

eeg_librecalc_tut_09

Click “Next” to see “Range of data”. Don’t do anything and click “Next” again. Click “Add” below “Data series” field.

eeg_librecalc_tut_10

Click “choose data range for Y values” and mark values in the “level” column.

eeg_librecalc_tut_11

Afterwards, you can click “Next” and adjust Chart parameters.

eeg_librecalc_tut_12

Click “Finish” and your chart is ready.

eeg_librecalc_tut_13

You can draw plots of change of meditation level and eye blink strength in time in the same way by filtering other signals.
I hope this tutorial is useful for you and clears up doubts connected with data generated by EEG Analyzer. In addition it shows simple way of generating plot of the attention level change in time what can be useful for displaying EEG data in a graphical way.

EEG Analyzer – Android app

2014-09-01 Android, Brain Computer Interface, Master Thesis 28 comments

I recently published my side project connected with BCI and EEG technology in Google Play Store.

unnamed

EEG Analyzer reads electrical activity of the brain with EEG technology and blink strength with EMG sensor from NeuroSky MindWave Mobile device connected via Bluetooth to Android device. In order to use this application, you need to have NeuroSky MindWave Mobile device, which can be ordered from http://neurosky.com/ website. Direct link to the mentioned product: http://store.neurosky.com/products/brainwave-starter-kit
Application has the following features:

  • Reading attention level
  • Reading meditation level
  • Reading blink strength
  • Reading brain waves
  • Reading raw signal
  • Drawing plots of attention level change in time
  • Drawing plots of meditation level change in time
  • Saving attention level, meditation level and blink strength change history
  • Exporting saved signal to Dropbox servers in *.csv format
  • Possibility to turn on voice feedback informing about high attention or meditation level

Application is available in English and Polish language version.

google_play_en_generic_rgb_wo_60

Update

EEG Analyzer was featured on official NeuroSky Store at: http://store.neurosky.com/products/eeg-analyzer.

Brain-Computer Interface for mobile devices – Master Thesis presentation

2014-07-08 Android, Brain Computer Interface, Master Thesis 1 comment

Recently, I graduated from my university. Below, you can browse my Master Thesis presentation about Brain-Computer Interface for mobile devices. If you are interested in writing mobile Android applications communicating with NeuroSky MindWave Mobile device, you can check my EEG Reader project on GitHub, which can be treated as a basis for more advanced projects. During writing my Master Thesis, I created two another projects using similar concepts. Mentioned code may be a little bit outdated comparing to the newest Android trends, but feel free to fork and upgrade it.

Update: You can read a publication based on my Master Thesis in the Journal Of Medical Informatics & Technologies Vol. 24/2015, ISSN 1642-6037:
Brain-Computer Interface for Mobile Devices

Brain Computer Interface for mobile devices – introduction

2013-06-05 Android, Brain Computer Interface, Master Thesis, Mobile No comments

Currently, I work on my Final Project and Master Thesis at Silesian University of Technology in Gliwice, Poland (original University name in Polish: Politechnika Śląska). I’ve decided to choose unconventional topic, which will allow me to use the knowlegde I already have, extend it and learn something new. Topic of my thesis is: Brain Computer Interface for mobile devices. BCI is a topic, which is not completely discovered nowadays. EEG and BCI have their origins in 1924, but up to now, they don’t have so many real life applications. We can find only some experiments and simple games. Recently, companies, engineers and scientists started to focus on brain waves, so this topic is worth investigation and it may be the future of modern computing.

In my project, I am going to use BCI for controlling mobile devices with Android OS. In my opinion, connecting brain to the smartphone can have really interesting outcome. Below, you can browse my presentation, which I have shown on my Final Project Seminar today.