console.log(brain)

Armagan Amcalar

Amsterdam JSNation

June 1st, 2018

Who am I?

Armagan Amcalar
Head of Software Engineering @ unu GmbH
Founder @ Lonca Works

     dashersw            dashersw

AUTHORED ON GITHUB

what is

the ultimate hack?

dashersw

The Summit 2013 - Picture by Dan Taylor / Heisenberg Media - www.heisenbergmedia.com

I think we are about 8 to 10 years away from this being usable by people with no disability

dashersw

Facebook VP of Engineering Regina Dugan F8 - Picture by Anthony Quintano

dashersw

dashersw

dashersw

dashersw

A PRIMER: The world's first EEG recording

... in 1924, from experiments by Hans Berger

dashersw

How it looks now

dashersw

Actually...

 

Let me show you.

dashersw

How does this black magic work?

100 billion neurons

Chemical reactions of K & Na exchange produce potential difference > "action potential"

Up to 256 electrodes for non-invasive methods

Thousands of electrodes for invasive operations

 

 

... and we still don't know how it exactly works.

dashersw

P300 — oddball paradigm

First published by E. Donchin and L.A. Farwell in 1988

2.3 letters / min

 

Based on randomly flashing letters in a matrix

Rare positive, common negative flashes pique interest

Action potentials fire 300ms after stimulation

 

dashersw

Separate Black from red

dashersw

WHERE DO I START?

Available on GitHub: https://github.com/dashersw/wits

dashersw

BRAIN-MONITOR

Available on GitHub: https://github.com/dashersw/brain-monitor

dashersw

 

 

Open-source P300 speller

that still needs some help!

brain-bits

Available on GitHub: https://github.com/dashersw/brain-bits

dashersw

Tech stack

JavaScript all the way up

Native C add-ons for the headset

Node.js for processing

Electron as the wrapper

Vue.js for front-end

brain.js for neural networks

Custom BLDA in JS as another classifier

 

...and, MATLAB as the server for eig function.

dashersw

Formatting the data for Machine Learning

  1. Get raw electrode data
  2. Group by each second to get epochs
  3. Filter each epoc between 1-12Hz
  4. Winsorize data
  5. Zero-mean normalization
  6. Decimate by 8
  7. Apply machine learning
    1. Use brain.js for neural networks
    2. Use a custom algorithm for BLDA

dashersw

Conclusion

 

JavaScript is powerful enough to read and parse not only JSON APIs,

but also your brain’s API.

thank you!

Let's keep in touch!

Armagan Amcalar

armagan@amcalar.com
   dashersw
   dashersw

console.log(brain)

By Armağan Amcalar

console.log(brain)

What is the ultimate hack of our lives? What is the one thing that we strive to learn the most about? What is the thing that will truly unlock our potential? This talk is a demonstration of an open-source Brain-Computer Interface that is completely developed with JavaScript, from the ground up, using neural networks and signal processing. Armagan hits the stage with a wireless EEG headset, shows how to read signals from the brain in JavaScript using native C++ Node.js modules over USB, and the implementation in Electron. We go into the detail of how this is possible with current JavaScript technologies, Node.js, Electron and Vue. A little bit of signal processing, a little bit of neural networks, and a demo of code and action follows. The beginners will be in awe when they see what they can do with JavaScript, the advanced users will learn a new field of application. The goal is to underline that JavaScript is not only for websites but is actually the coolest thing ever.

  • 2,590