pip install python-osc
pip install pygame
pip install pygame-menu
pip install tensorflow
OSC Stream Target IP
: here you should add your computer’s local IP-address, on Win10 you can run ipconfig
in a command prompt to find it, often starts with 192.168.x.xOSC Stream Port
: set to 5000
left
, right
, and background
brain “noise”Collect OSC-data.py
with your favourite IDE or with any text editor
Background
will have index 0, Left
index 1, and Right
index 2.
Collect OSC-data.py
from your favourite IDE or from the command prompt with python "Collect OSC-data.py"
Background
for 3 seconds. During this time you should just relax, try to avoid blinking or moving your limbs.Left
for 3 seconds. During this time you should try or imagine you are moving your left hand. I’ve found it working better if I actually don’t move the hand, or even tension any muscles. It might help to put an object a few centimeters (= an inch or two) in front of your hand, simulating it is just out of reach, and you are unsuccessfully able to reach it.Right
event.Data acquisition
and click the icon labeled Upload existing data
Create an impulse
and fill in the Time series data
as shown in the picture. While the length of the samples are in fact 3000 ms (= 3 seconds), I’ve found that using 30 ms (as in 30 lines for each sample) works at least as good.Raw data
and let all axes be checkmarked. You can later try to find which axes do not impact much or at all for your model and uncheck them, but then you also need to modify the line expected_samples = 30
in Mind Reader.py
accordingly. This is explained more detailed in the code itself.Classification (Keras)
, in this tutorial you will have 3 output features: Background
, Left
and Right
. In the screenshot below also Blink
is used, but you are recommended to add that one later if you need it. The Mind Reader app actually uses the blink detection feature included in the Muse-device as it removes a complexity layer.Save impulse
and Raw data
on the left hand menu
Save parameters
which will take you to the second tab.Generate features
NN Classifier
from the left hand menuNumber of training cycles
to 200. This is another parameter to tweak, the higher this number is, the longer time the training will take, but also the better the network will perform, at least until it can’t improve anymore.Start training
Model testing
in the menuClassify all
Dashboard
from the left hand menuDownload block output
and click on the icon next to NN Classifier model TensorFlow Lite (float32)
ei-[ your project name ]-nn-classifier-tensorflow-lite-float32-model.lite
. Although you can rename it if you really want to, why not save your brain cells to more important stuff :smirk:Mind Reader.py
with your favourite IDE or a text file editor like Notepad
initiate_tf
and locate the line with lite_file = "ei-.......lite"
=
with your own file name, remember the double quotes " "
and .lite
at the endpython "Mind Reader.py"
.lite
-files trained by the author. You can try the app using one of them, without the need to record own EEG-data, but you should be very surprised if they give good results as brains tend to be different…0nn Image Description
where nn
is a running number between 00
and 99
, and Image Description
is the text you want to be visible under the image.Mind Reader app
EDGE
and see what happens :smiley:ESC
Left
with a confidence level of 65 %, the EEG-data recorded for the classification would be stored and imported into Edge Impulse to retrain the ML-model. By repeating this a few times, the resulting ML-model is expected to provide higher accuracy.