<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Giselle Chan on Medium]]></title>
        <description><![CDATA[Stories by Giselle Chan on Medium]]></description>
        <link>https://medium.com/@cctgiselle?source=rss-b3013516f63e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*cHGJ6tFAi2128pxporsZYg.png</url>
            <title>Stories by Giselle Chan on Medium</title>
            <link>https://medium.com/@cctgiselle?source=rss-b3013516f63e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 21:42:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cctgiselle/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Build an Instantaneous Keyboard Controlled by Thought (BCIxML)‍]]></title>
            <link>https://medium.com/@cctgiselle/how-to-build-an-instantaneous-keyboard-controlled-by-thought-bcixml-94e8f7d196dd?source=rss-b3013516f63e------2</link>
            <guid isPermaLink="false">https://medium.com/p/94e8f7d196dd</guid>
            <category><![CDATA[neuroscience]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[paralysis]]></category>
            <category><![CDATA[brain-computer-interface]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Giselle Chan]]></dc:creator>
            <pubDate>Mon, 25 Dec 2023 13:03:16 GMT</pubDate>
            <atom:updated>2023-12-25T13:03:16.994Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Typing instantaneously with your mind</strong> seems like an idea from the fantastical world. It seems like the stuff of the future. It seems unattainable.</p><blockquote><strong><em>But.. what if I told you that we could do it right, here, right now?</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/0*CA_p3tiuf8lg5nOs.gif" /><figcaption>shocked? Scully from B99 is shocked too</figcaption></figure><p>More than <strong>5.4 million</strong> globally suffer from paralysis due to spinal cord injuries. Almost <strong>18.4 million</strong> grapple with speech impairments or disorders. They face severe communication obstacles — and are unable to make the most out of their lives due to this alone.</p><blockquote>If only we could allow them to communicate by mind.. perhaps even create an instantaneous keyboard that takes its input from your thoughts…</blockquote><p>Surprise! This is what I set out to do over the past month, through learning, struggling over, and combining numerous tutorials on brain-computer interface data extraction and machine learning.</p><p>I’ve collated it all — my journey, my learnings and my advice — in this tutorial for you. Sit back and watch tight!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Suk8K1Cgu9eV23334gwPCA.png" /><figcaption>snapshot from my live video demo + explanation — link below!</figcaption></figure><blockquote>NB: if you’re wondering how this works, our brain displays<strong> differing frequencies</strong> when thinking of <strong>different objects</strong> (different levels of concentration). If we can control, extract and manipulate this, we can code the program to have <strong>different outputs dependent of this.</strong></blockquote><h3>Links!</h3><p>Watch my live demo and explanation on <a href="https://www.youtube.com/watch?v=rgTSN3wEdDg">YouTube</a><br>Check out my code on <a href="https://github.com/ctgchan/BCIxML_BrainControlledKeyboard_ABCs">GitHub</a><br>Connect with me on <a href="https://www.linkedin.com/in/giselle-chan-bb5765260/">LinkedIn</a></p><h3>Table of Contents</h3><ol><li>Setting up the brainwave collection process (via Muse &amp; outlet)</li><li>Collecting your brainwave data</li><li>Training your machine learning model</li><li>Putting it all together — your instantaneous keyboard!</li><li>Review and next steps</li></ol><h3>What you’ll need</h3><ul><li><a href="https://choosemuse.com/products/muse-2">Muse 2 EEG headband</a></li><li>Muse data outlet to connect to computer (e.g., <a href="https://petal.tech/downloads">Petal Metrics</a>)</li><li>Code Editor on your computer (e.g., <a href="https://code.visualstudio.com/">VS Code</a>) &amp; Python installed</li></ul><h3><strong>Part 1: Setting up the brainwave collection process</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2P7VZKwe2uc3iMHVDOOfDA.png" /><figcaption>The Muse 2 EEG headband</figcaption></figure><p>Due to the nature of this project, we’ll be using an EEG (electroencephalogram) headband to detect our brainwave frequencies. The<a href="https://choosemuse.com/products/muse-2"> Muse 2 EEG </a>is a popular and reliable choice — with 7 electrodes all around and a very ergonomic fit.</p><h4><strong>1. Download outlet to extract brainwave information from Muse headband to computer</strong></h4><p>I used <a href="https://petal.tech/downloads">Petal Metrics</a> which is 100% free and reliable — it can be downloaded following the website instructions for MacOS, Windows, and Linux.</p><h4>2. Clone code that processes brainwave information into numbers / visuals</h4><p>This “magic code” by Alexandre Barachant can be found <a href="https://github.com/alexandrebarachant/muse-lsl">HERE</a> — it’s a lifesaver amongst Muse enthusiasts! Clone the repository by clicking on the coloured dropdown menu, and copying and pasting the link into your code editor (I stand by <a href="https://code.visualstudio.com/">Visual Studio Code</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VZCKSs3cX-LyMDEJtxCGsQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UM5rwSeBSTfSsSQ3VWrzfg.png" /></figure><p>In order for his code to run, you’ll have to download some python libraries: muselsl and pygatt. Open a new terminal and type in the following commands:</p><pre>#use &quot;pip&quot; not &quot;pip3&quot; if your python version is older than v3!<br>#to check, type python3 --version. if it doesn&#39;t work, your version is older.<br>pip3 install pygatt<br>#then..<br>pip3 install muselsl</pre><h4>3. Visualizing your brainwave data</h4><p>I had some trouble wrapping my head around what the Muse was collecting from my brain — so sought to visualize this somehow. Here’s how to do it:</p><p>Stream your Muse 2 EEG headband’s data by long-pressing the power button on the inner right headband ear until it lights up, and pressing “STREAM” in Petal Metrics.</p><p>Type in the following in your Python terminal:</p><pre>muselsl view</pre><p>You should see something like this — very useful whenever you want a visual representation of your brainwaves!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UWsKtwERWRVh1ABY.png" /></figure><h3>Part 2: Collecting your brainwave data</h3><p>Now we’re in business! Head to the “neurofeedback.py” file in your code editor, under the folder “examples”.</p><p>Note: if Python isn’t already installed in your VS Code, you may have to do so from the extensions sidebar.</p><p>There are more libraries for you to install..</p><pre>#again, use &quot;pip&quot; not &quot;pip3&quot; if your python version is older than v3!<br>#to check, type python3 --version. if it doesn&#39;t work, your version is older.<br>pip3 install numpy<br>pip3 install matplotlib<br>pip3 install utils<br>pip3 install scikit-learn <br>#scikit-learn was previously sklearn</pre><p>If you stream your Muse from Petal Metrics and run your code, you’ll notice a bunch of values outputted from terminal — these are your Alpha wave frequencies!</p><p>Our machine learning model will aim to <strong>distinguish</strong> between <strong>categories (what we’re thinking of)</strong> based off the frequencies of brainwaves. Therefore to train our model, we’ll be measuring two frequencies: <br>1) Alpha (relaxed state) &amp;<br>2) Beta (conscious thinking state).</p><p>Let’s collect our brainwave data for each — we’ll start with Alpha. Modify line 129 so we’re only printing the numerical values (making it easier to copy and paste later on):</p><pre>print(band_powers[Band.Alpha])<br>#original: print(&quot;Alpha: &quot;, band_powers[Band.Alpha])</pre><p>To make the process easier, I added a <strong>counter variable</strong> that terminates the program once it gives you 100 values. Think of it as a lever that shuts off your program once the required amount of data has been collected.</p><p>Inside the data collection code (from line 97), modify your code like so — explanations are in the form of comments:</p><pre>#NB: for clarity I&#39;ve deleted Barachant&#39;s comments + some code in this snippet<br>#modify your code wherever you see my comment!<br> &quot;&quot;&quot; 3. GET DATA &quot;&quot;&quot;<br>    print(&#39;Press Ctrl-C in the console to break the while loop.&#39;)<br>    try:<br>#initialize counter variable here (use this to track num. outputs)<br>      counter = 0<br>      while True:<br>            &quot;&quot;&quot; 3.1 ACQUIRE DATA (CODE HERE) &quot;&quot;&quot;<br>            &quot;&quot;&quot; 3.2 COMPUTE BAND POWERS (CODE HERE)&quot;&quot;&quot;<br>            print(band_powers[Band.Alpha])<br>#increment counter variable every time a value is outuptted<br>            counter += 1<br>#terminate program if 100 values outputted<br>            if counter&gt;100:<br>                exit()<br>      except KeyboardInterrupt:<br>            print(&#39;Closing!&#39;)</pre><p>Now we’re all set to collect data on our brainwave frequencies for each of our A, B, and C variables. I’ve chosen the images:<br><strong>1) Arithmetic for A<br>2) Bouncy ball for B<br>3) Chill pond for C</strong><br>But feel free to choose any 3 images to think of that you feel provides distinct frequencies or concentration levels!</p><p>All that’s left to do is to stream your Muse on Petal Metrics and run the Python file, imagining your chosen image until the program automatically stops. Select and paste your results into a spreadsheet — <a href="https://docs.google.com/spreadsheets/d/1uV-b86JMdjH6EVlBaXejpDPcrn4Ii8IBJZzfWUpepFk/edit?usp=sharing">HERE’s</a> the link to my Google Sheets— and repeat for each variable (image).</p><p>Let’s do the same for Beta. Modify your Alpha wave output line to take the Beta values instead:</p><pre>print(band_powers[Band.Beta])<br>#original: print(band_powers[Band.Alpha])</pre><p>And collect the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VjajBQ5gBBJDsX1d9pfm4Q.png" /><figcaption>the first few rows of my data set looked something like this..</figcaption></figure><p>You should have 100 Beta frequency values and 100 Alpha frequency values for each of the A, B, and C variables. The data collection process is complete!</p><p>Revert your neurofeedback.py file back to its original state (one way to do this is to overwrite your modifications by going back on Barachant’s github and pasting the contents back in. This will create a clean slate for part 4.</p><h3><strong>Part 3: Training your machine learning model</strong></h3><p>Now comes the magic — building the predictive model! I followed <a href="https://medium.com/mlearning-ai/machine-learning-project-with-linear-regression-algorithm-b433d770fefd">Tirendaz AI’s tutorial</a> (&amp; <a href="https://www.datacamp.com/tutorial/naive-bayes-scikit-learn">Datacamp’s tutorial</a>) to build my<strong> Naive Bayes classification</strong> model, but here’s a summary of what was relevant.</p><h4>1. Integrating your data</h4><p>First, we have to export our collected data as a csv (comma separated values) file. I did this from Google sheets here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hOdQbmTGc25HdT2WaaI0gQ.png" /><figcaption>in Google Sheets, File -&gt; Download -&gt; Comma Separated Values (.csv)</figcaption></figure><p>Drag this downloaded csv file back into your code editor — in the same directory as neurofeedback.py!</p><p>Back in our VS Code editor, open a new python file in the same directory. I named mine “ml.py”. This will ensure our integration is successful later on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*gG2isRHACXzwazo2pnwVNg.png" /></figure><p>Load these libraries:</p><pre>import pandas as pd<br>from sklearn.model_selection import train_test_split<br>from sklearn.svm import SVC<br>from sklearn.preprocessing import MinMaxScaler<br>from sklearn.metrics import accuracy_score</pre><p>Import our data:</p><pre>data = pd.read_csv(&quot;ABCML_Data.csv&quot;)</pre><p>Before progressing onto building the model, we can check that our chosen images do affect brainwave frequency by outputting the mean average of each independent variable in table format.</p><p>(This has been a lifesaver step for me as I’d had to re-choose my variables twice — because this step showed that the distinctions between their frequencies weren’t clear. )</p><pre>#sort by image as image is the independent variable<br>data[&#39;Image&#39;] = data[&#39;Image&#39;].astype(&#39;category&#39;)<br>#take the mean of each Alpha and Beta of each independent variable<br>image_data = data.groupby(&quot;Image&quot;).mean().round(2)<br>#print it out<br>print(image_data)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*chuSVFE4Bp6w1l2FCK7upA.png" /><figcaption>the data frequency table I got — it’s evident frequency is highest for bouncy and lowest for chill</figcaption></figure><h4>2. Coding the Naive Bayes classification model</h4><p>Our model will be split into a training and a predicting model. Let’s build the <strong>training</strong> model first (make sure the labels correspond to those you gave in your spreadsheet):</p><pre><br>def train_svmm_model():<br>    data = pd.read_csv(&quot;ABCML_Data.csv&quot;)<br><br>    # Assuming &#39;X&#39; contains your features (Beta and Alpha frequencies) <br>    # and &#39;y&#39; contains the categories<br>    X = data[[&#39;Beta&#39;, &#39;Alpha&#39;]].values<br>    y = data[&#39;Image&#39;].values<br><br>    # Splitting the data into training and validation sets (adjust test_size and random_state as needed)<br>    X_train, X_val, y_train, y_val = train_test_split(X, y, test_size=0.2, random_state=42)<br><br>    # Normalizing the features (scaling between 0 and 1)<br>    scaler = MinMaxScaler()<br>    X_train_normalized = scaler.fit_transform(X_train)<br>    X_val_normalized = scaler.transform(X_val)<br><br>    # Initializing SVM classifier (you can experiment with different kernels and parameters)<br>    svm_classifier = SVC(kernel=&#39;rbf&#39;, C=1.0, gamma=&#39;scale&#39;)  # Example with RBF kernel<br><br>    # Training the SVM model<br>    svm_classifier.fit(X_train_normalized, y_train)<br><br>    # Making predictions on the validation set<br>    predictions = svm_classifier.predict(X_val_normalized)<br><br>    # Calculating accuracy<br>    accuracy = accuracy_score(y_val, predictions)<br><br>    return svm_classifier, scaler</pre><p>Then, the <strong>predicting</strong> model, which is relatively straightforward:</p><pre>def predict_with_svmm_model(svm_classifier, scaler, X_new):<br>    # Normalize the new data using the same scaler used for training/validation data<br>    X_new_normalized = scaler.transform(X_new)<br><br>    # Making predictions on the new data<br>    new_predictions = svm_classifier.predict(X_new_normalized)<br>    return new_predictions<br>    # Displaying the predicted labels<br>    print(&quot;Predicted Labels for New Data:&quot;)<br>    for prediction in new_predictions:<br>        print(prediction)</pre><p>By calling on these functions after the definition, running the code on a small scale and checking the results in terminal, you can certify that this works:</p><pre>#testing if code works:<br>train_svmm_model() #training the model <br>predict_with_svmm_model(svm_classifier, scaler, [1, 1]) <br>#^^ testing the predictive model - replace 1, 1 with any {betaValue, alphaValue} you wish</pre><p>For me this returns “Arithmetic”, which I can deduce as correct as based off the frequency table it’s evident that “Arithmetic” values reside around 1.01 and 1.11 (closer to 1 than both “Bouncy” or “Chill”).</p><p><strong>Woohoo! All the components are done for this project, now to put it all together!</strong></p><h3><strong>Part 4: Putting it all together — your instantaneous keyboard!</strong></h3><p>Now to combine the two files… we’ll be doing this by integrating our machine learning file back into our master Muse brainwave collection file.</p><h4>1. Combining our two files (brainwave collection &amp; ML)</h4><p>In neurofeedback.py, <strong>import your definitions </strong>in the beginning:</p><pre>from ml import train_svmm_model, predict_with_svmm_model<br># where ml.py is my machine learning file name - modify accordingly</pre><p>We’ll <strong>integrate</strong> these definitions in towards the end of the program after the brainwave frequencies are collected and printed.</p><p>We’ll first have to <strong>train the model —</strong> so we’ll add a statement telling it only when it’s not trained, the training definition is called upon:</p><pre>#comment out the print frequency statement &quot;print(band_powers[Band.Alpha])&quot;<br>#line below:<br>if &#39;svmm_model&#39; not in globals():  <br>    svmm_model, scaler = train_svmm_model()</pre><p>Then every time your brainwaves are collected, you’ll need to call upon the prediction model.</p><pre>if &#39;svmm_model&#39; in globals():<br>    prediction = predict_with_svmm_model(svmm_model, scaler, features_for_model)<br>    print(prediction)</pre><p>You’ll notice one of the arguments we’re calling the predictive argument with is “features_for_model”, which will include the Beta and Alpha frequencies we’re using to predict. We need to <strong>define this </strong>with the collected frequencies from the Muse before calling on both functions:</p><p>(think of it as feeding the input into our predictive model, which will spit out the prediction as output!)</p><pre>#before both these if statements above:<br>features_for_model = [[betaWaves, alphaWaves]]<br><br>#NB: comment out any excess &quot;print lines&quot;</pre><h4>2. Increasing the accuracy: taking average prediction over range</h4><p>Our program now works — but it’s not very accurate.</p><p>That’s because the prediction is made off of <strong>only 1 set of inputted data — </strong>it’d be like you going into a test having only studied once. It’d be much better if we studied multiple times — i.e., if our model took the average prediction over a period of time..</p><p>To do this, first define a function that takes the average in the global scope in the very beginning:</p><pre>def most_frequent(List):<br>    tuple_list = [tuple(item) for item in List]<br>    return max(set(tuple_list), key=tuple_list.count)</pre><p>Then, we can use the list function to collate predictions every time. In the beginning of the “while True” loop, add:</p><pre>try:<br>    while True:<br>          guesses = [&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;,&quot;&quot;]<br>          #I want the program to take an average out of 5 predictions <br>          #(around 5 seconds), but change this value if you wish<br>          <br>#then, all the below code on collecting data and predicting needs to be put <br>#in a for loop<br>          for i in range(10): <br>              #rest of code</pre><p>And inside the loop, instead of printing the prediction out, we’ll add it to our list. At the end, we’ll print the most frequent prediction.</p><pre>#replace &quot;print(prediction)&quot; with this:<br>              guesses[i]=prediction<br><br>#at the end:<br>print(most_frequent(guesses))</pre><p><strong>Your code now should work perfectly, like an actual keyboard!</strong></p><p>There is one last thing to do though.. and that’s to shift the output back into letters A, B, and C instead of your images.</p><pre>#replace print(most_frequent(guesses)) with:<br>if most_frequent(guesses)==&quot;(&#39;Arithmeitic&#39;,)&quot;:<br>    print(&quot;A&quot;)<br>elif most_frequent(guesses)==&quot;(&#39;Bouncy&#39;,)&quot;:<br>    print(&quot;B&quot;)<br>elif most_frequent(guesses)==&quot;(&#39;Chill&#39;,)&quot;:<br>    print(&quot;C&quot;)<br>else:<br>    print(&quot;Error&quot;)</pre><p>Woohoo! That’s it — you’ve successfully coded your model of an instantaneous keyboard controlled by mind!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KL0hBg0YOzRZSSblo3yZ9g.png" /><figcaption>snapshot from my live video demo! (link at the end)</figcaption></figure><h3>Part 5: Review and next steps</h3><p>When I set out to do this project, I wanted to <strong>challenge myself </strong>— to delve into the realm of unknown and to combine two technologies (BCI and ML) that I was deeply interested in. To not just follow a tutorial, but to trial and error and combine every article or paper I came across — and <strong>build an awesome project that my childhood dreams were made of</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zKZGoUnnDV9cLOvtIptLlg.png" /><figcaption>here’s what happened every night before I figured everything out!</figcaption></figure><p>Needless to say, it was 100% worth it and my interest in brain-computer interfaces (and machine learning) has only grown stronger.</p><p>There were several <strong>caveats</strong> in the process — including having to learn how to <strong>master my emotions</strong> (e.g., thinking of a chill pond while angry returned unwanted frequencies and thus predictions), and issues with running Python as I had multiple unsynced Python libraries on my computer — as well as <strong>utilizing my programming background</strong> to successfully <strong>integrate</strong> the two parts of this project to create one that is <strong>one-of-a-kind.</strong></p><blockquote>I’ve just taken you behind the scenes of my project — an instantaneous keyboard controlled by mind, using brain computer interfaces and machine learning.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/0*OxOc_F98aoOSMZap.gif" /><figcaption>claps for brain computer interfaces!</figcaption></figure><p><strong>This project was merely a snapshot of what’s possible. </strong>If I were to delve deeper into this project, I’d do it with much more machine learning trials and data sets, and more specialized brainwave frequency detecting equipment — so that it would be possible to increase the number of classification groups and do this for the whole alphabet!</p><p>My main <strong>takeaway</strong> from this project, and hopefully yours too, is that brain-computer interfaces are 100% going to shape our future, particularly in the realm of communication of information — aiding those that are paralyzed and allowing us to do things we’ve always dreamed of doing — like typing by mind.</p><h3>Before we part ways.. !</h3><p>Watch my live demo and explanation on <a href="https://www.youtube.com/watch?v=rgTSN3wEdDg">YouTube</a><br>Check out my code on <a href="https://github.com/ctgchan/BCIxML_BrainControlledKeyboard_ABCs">GitHub</a><br>Connect with me on <a href="https://www.linkedin.com/in/giselle-chan-bb5765260/">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94e8f7d196dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Import and Export Information into the Brain ]]></title>
            <link>https://medium.com/@cctgiselle/how-to-import-and-export-information-into-the-brain-649d1397db77?source=rss-b3013516f63e------2</link>
            <guid isPermaLink="false">https://medium.com/p/649d1397db77</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[brain-computer-interface]]></category>
            <category><![CDATA[the-matrix]]></category>
            <category><![CDATA[information-technology]]></category>
            <dc:creator><![CDATA[Giselle Chan]]></dc:creator>
            <pubDate>Tue, 17 Oct 2023 21:30:20 GMT</pubDate>
            <atom:updated>2023-12-01T14:16:24.756Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Picture this:</strong></h3><p>You’re a spy trying to reclaim your team’s jewels, but the blueprints of your enemy’s castle can only be discovered after you set foot in the building together with your team (and they reach the files room).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_tAIcX4QbZjswyoF.jpg" /><figcaption>just like in The Matrix!</figcaption></figure><p>There’s no way you’ll be able to learn the entire blueprint in the 10 seconds before you’re forced to make a move, because the clock is ticking down every second, and every second, the chances of being discovered is growing!</p><p>In the zone? Okay, let me feed you a thesis:</p><blockquote><strong><em>Information can be uploaded (fed/imported — whatever you want to call it) into the brain.</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/0*pO3om8sraQvBEZto.gif" /><figcaption>shocked? don’t worry — Gina from B99 is also shocked!</figcaption></figure><p>(All these problems I’ve given you — they’ve all seemed to disappear, right? This is what dreams are made of!!)</p><p>But that’s a bold statement to start off of, so let’s delve into the science, technology, and proven experiments in this realm.</p><h4><strong>In this article, I will discuss…</strong></h4><p>You may know that brain-computer interfaces (BCIs) are capable of measuring brainwaves and electrical signals — and thus extracting your thoughts through machine learning, derivation, and precise predictive guesswork.</p><p>But as innovators, let’s <strong>reverse this logic. </strong>Instead of extracting information out of the brain, we could upload information into the brain. We could import knowledge by translating them, via our machine learning data, into electric signals, then feeding them into the brain through electrical stimulation - with the very machinery used to detect our signals.</p><p><strong>Theoretically, we would instantaneously understand new knowledge.</strong></p><p>In this article, I will go through…</p><ol><li>The background behind BCIs and how they measure brain waves</li><li>How information is interpreted from these brain waves</li><li><strong>How information could be uploaded to the brain </strong>(combining the two and reversing the logic)</li><li>The future of this industry</li></ol><h3><strong>What are BCIs?</strong></h3><p>Brain-computer interfaces (BCI) are systems that allow communication between the brain and various machines.</p><p>They work in <strong>three main steps</strong>: collecting brain signals, interpreting them and outputting the therefore desired commands to a connected machine.</p><p>They measure <strong>time and frequency domain</strong> to determine if an event is taking place (strength of waves, i.e., how synchronized or how many neurons fire in a similar pattern shows how strong the response is, and which groups of neurons are active shows roughly what the event could be)</p><p>There are <a href="https://nexusacademicpublishers.com/uploads/portals/Brain-Computer_Interface.pdf">three types of BCIs</a>: <strong>invasive</strong> (implanted into brain during surgery) for single or multi unit cells, <strong>semi-invasive </strong>(implanted on exposed surface of brain) for cerebral cortex, and <strong>non-invasive </strong>EEGs (electroencephalograms, placed on our scalp). This is what we’ll be focusing on today.</p><h4><strong>How do EEGs work?</strong></h4><p>Electrodes (small metal discs) are placed on the scalp to pickup the electrical current generated by the brain.</p><p>The electrodes detect tiny electrical charges that result from the activity of your brain cells. The charges are amplified and commonly appear as a graph on a computer screen.</p><h4><strong>What causes these tiny electrical charges?</strong></h4><p>When our brain undergoes action (e.g., when we think of moving our arm), our neurons communicate with each other. They do this by firing signals across synapses (the gap between neurons) — when firing, a neuron forms a dipole: if excitatory, a lower voltage at synapses and higher voltage at the axon of the next neuron; if inhibitory, a higher voltage at synapses and lower voltage at the axon.</p><p>The voltage shift is caused by ionic channels. For example, in excitatory transmissions, Na+ channels open along the dendrite of the first neuron, causing a flood of positive electrons to move down the axon, opening more sodium channels, and causing an electric charge to carry down the axon, discharging at the synapse, releasing neurotransmitters along with it.</p><p>These changes are minimiscial— and we can only detect them from the scalp when a GROUP of neurons fire together!</p><p>The recorded data is then sent to amplifiers, then to a computer or the cloud to process the data. The amplified signals, which resemble wavy lines, can be recorded on a computer, mobile device, or on a cloud database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wk4tWRE01PBhBHcqL9JbgQ.png" /><figcaption>an example of what these brain waves look like!</figcaption></figure><h3><strong>How can information be derived from these brainwaves?</strong></h3><h4><strong>1. Superficially — by frequency of waves</strong></h4><p>We can derive the level of consciousness or state of our brain by the frequency of brainwaves.</p><p>As explained, raw EEG waves are fluctuating electrical voltages in the brain. They can be distinguished by their differing frequencies. The definition of frequency refers to the speed of the electrical oscillations (Hertz — cycles/second).</p><p>(to put things into perspective, one voltage fluctuation measures at a millionth of a volt, and a typical lightbulb requires 110 volts to light up!</p><p>Back to frequencies, there are 5 main types of brain waves with distinct meanings.</p><ol><li><strong>Delta</strong> waves (slowest). Generated in deep <a href="https://www.goodtherapy.org/blog/psychpedia/meditation">meditation</a> and dreamless sleep.</li><li><strong>Theta</strong> waves. Generated in relaxation and vivid dreamy sleep — inner focus.</li><li><strong>Alpha</strong> waves. Generated during quiet, thoughtful times — resting.</li><li><strong>Beta</strong> waves. Most common and generated in waking state — alert and problem solving.</li><li><strong>Gamma</strong> waves (fastest). Generated in highest levels of consciousness.</li></ol><p>By correlating each brain wave frequency group to what it’s associated with, we can get a pretty clear idea of the state of our brain at any given time.</p><h4><strong>2. In depth — by machine learning &amp; spotting patterns in wave characteristics</strong></h4><p>But what if we want to go further than that? What if we want to know the specific thought or command our brain is executing at the time?</p><p><strong>Enter: machine learning.</strong></p><p>By trial tests where countless subjects wearing EEG headsets are ordered to think about a specific thought, scientists are able to track their brain waves (which are highly variable but with distinct characteristics) repeatedly until a pattern is to be found — between the brain activity and what they were ordered to think of.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*agZDTr32baIsoWBpWevekQ.png" /><figcaption>patterns could be noticed (correlation between activity and brain wave) from large data sets!</figcaption></figure><p>Brain activity is measured using 4 characteristics:</p><ol><li>Frequency domain — how frequent the brain wave oscillations are</li><li>Time domain — the brain activity in respect to time</li><li>Strength of wave — how synchronized neurons are / how many neurons fired together in similar pattern</li><li>Area of brain the activity came from</li></ol><p>From this, as you can imagine, a very very large database can be derived, where a clear correlation between brain activity and thought is shown.</p><p>Therefore, in experimental cases, using the collected brain activity, programs are able to compare it to all brain waves in the database and conclude with the most probable thought match.</p><p>Let’s look at some of this technology in action!</p><h4><a href="https://neuralink.com/blog/pager-plays-mindpong/"><strong>NeuraLink Monkey Pager plays Pong with his mind</strong></a></h4><p>You know you’ve spotted the right field to delve into when Elon Musk has his own money upon it too. His newest venture, NeuraLink, has grew in popularity as Musk drives the technology further than it’s ever been before.</p><p>One of the biggest accomplishments of NeuraLink was back in 2021. Pager, a monkey, could control a game of Pong with his mind!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yEQZetAu4ZN87dcguUnHNg.png" /><figcaption>Pager the monkey playing Pong!</figcaption></figure><p><strong>How does that work?</strong></p><p>NeuraLink scientists implanted 2,000 electrodes, each the width of 1/10 a human hair, onto Pager’s brain. Pager went through countless trials wearing the electrodes where he operated a joystick to play the game of Pong (his incentive to move the joystick rightly was a banana smoothie).</p><p>Links — which amplify and digitize the brain signals — were placed bilaterally, one in the left motor cortex (controls right side of body’s movements) and another in the right motor cortex (controls left side of body). The motor cortices were shown to be active when Pager was thinking about moving his hand to control the joystick.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*fLfrgLDLRTCQI1BpFC8jAQ.png" /><figcaption>this is where the mortor cortex is!</figcaption></figure><p>And then, with the brain wave data from the trials, in the words of NeuraLink,</p><blockquote>By modelling the relationship between different patterns of neural activity and intended movement directions, we can build a model via machine learning (i.e., “calibrate a decoder”) that can predict the direction and speed of an upcoming or intended movement given the brain wave.</blockquote><p>For instance, the neurons with upward preferred directions clearly increase their firing rates as the monkey moves his MindPong paddle upward, and the ones with downward preferred directions increase their firing rates as Pager moves his paddle downward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hmgatX1oPejkql39Qm7_8w.png" /><figcaption>neurons with upwards preferred directions in blue, downwards preferred directions in red</figcaption></figure><p>Thus by these data points and patterns observed, researchers can derive what Pager’s brain is trying to do based off the brain waves.</p><h4><a href="https://www.youtube.com/watch?v=rIbfNUA5pWk"><strong>Perri Karyal plays Elden Rings with her mind</strong></a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CpK_DNGUsL5AGnljF6YnZQ.png" /><figcaption>Elden Rings!</figcaption></figure><p>We saw what a monkey can do, but can a human top that? This is definitely a question for Perri Karyal!</p><p>Elden Rings is a trending role-playing game with a focus in combat and exploration, and Perri, an avid gamer and BCI-enthusiast, has mastered the art of controlling her character with her mind through EEG and machine learning.</p><p><strong>How does that work?</strong></p><p>Perri used a technique known as motor imagery — involving using machine learning to train software to recognize average brain wave activity she generated while imagining herself moving her body in different given repeatable patterns. These patterns were distinct and therefore its EEG signals could be translated into inputs every time she imagined something.</p><blockquote>I was visualizing pushing something forward in my head [to move my character forward]. The pattern of activity my brain happened to consistently make during that task is what the software learned to recognize.</blockquote><p>Perri said, describing this process.</p><p>As an example, here is Perri’s brain wave data (expressed visually) when she imagines herself pushing something forward (moving character forward). Brain signals are more frequent (brighter in the diagram) as she is focusing hard. They are also focused in her temporal lobes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/276/1*CnljVXEDOUkrDSVqgcSE6A.png" /><figcaption>brain signals when character moving forward</figcaption></figure><p>When Perri relaxes and imagines herself releasing the object (character shoots gun), her brain signals are less frequent (dimmer in diagram) and focused in her frontal lobes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*NuK9o0tUqTKLTe19SwMhYg.png" /><figcaption>brain signals when character shooting gun</figcaption></figure><p>As you can see these are two very distinct brain wave patterns from which the computer was able to compare to its database and derive the wanted character action.</p><h3><strong>How can information be uploaded to the brain?</strong></h3><p>This is the exciting bit.</p><p>This is what we’ve all been waiting for.</p><p>What if we could take all this information about how to extract information from the brain, and flip it around? What if we could upload information into the brain by reverse engineering the electrical signals of knowledge, and feeding them back into the brain?</p><p>Going too quick? Here is the theory behind how it would work:</p><p>Via the same process of machine learning, we could utilize information about relation between thought and brain wave pattern — and feed in the electrical signals (that correspond to information we want to upload) — as electrical stimulation through the same EEG electrodes. Then, in theory, our neuronal network would adapt and our brain would instantaneously understand this new piece of knowledge!</p><p>To put this into context, let’s explore some current developments in this field!</p><h4><a href="https://www.sciencealert.com/sorry-guys-scientists-haven-t-invented-a-matrix-style-device-that-instantly-uploads-data-to-your-brain"><strong>Newbie pilots become instant pros in California</strong></a></h4><p>This revelation started in the HRL Information and System Sciences Laboratory in California. Researchers hoped to take the electrical signals and state of brain of trained, experienced pilots whilst they were flying, and use that to modulate the brains of novice pilots who had never done this task before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8MzcaqmKV2fY-rq9bj0lmQ.png" /><figcaption>pilots x BCI</figcaption></figure><p><strong>How does that work?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zaR85fMuxb_rvUpZoj-Btw.png" /><figcaption>where the EEGs were set up on the pilots</figcaption></figure><p>Using EEG electrodes, researchers measured and extracted brain waves of the experienced pilots while doing their tasks. They then fed the exact information, using a head-cap with conductive gel and EEG electrodes to apply current and stimulation to the skin, into a group of novice pilots before they proceeded to do the same task, in hopes that the knowledge was transferred into their brains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8bMFqGi48ELVahxOE2Y8Sg.png" /><figcaption>the brainwaves captured form experienced pilots!</figcaption></figure><p>Guess what?</p><p>This group of pilots performed, on average, 33% better than the placebo group, who were novices going straight into the task! The effectiveness of this experiment was also proven qualitatively through the group’s higher levels of landing consistency as well as lower levels in skill variance than the placebo group.</p><p>This experiment proves that it is possible to feed information back into the brain via electrical stimulation, and that the brain does utilize its neuroplastic properties to welcome the new information — opening up a realm of possibilities for us!</p><h4><a href="https://www.nytimes.com/2013/03/01/science/new-research-suggests-two-rat-brains-can-be-linked.html#:~:text=In%20a%20First%2C%20Experiment%20Links%20Brains%20of%20Two%20Rats,-Share%20full%20article&amp;text=In%20an%20experiment%20that%20sounds,too%20%E2%80%94%20most%20of%20the%20time.">Duke University rats communciate to each other with their minds</a></h4><p>This groundbreaking experiment was completed all the way back in 2013, where researchers attempted to use brain to spine interfaces to communicate from rat to rat.</p><p><strong>How does that work?</strong></p><p>During this process two rats were separated and exposed to identical rooms, which consisted of a lever and an LED. They were required to complete a puzzle, which was to push the lever directly after a flash of light.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yK6VfdwuhxRRCxE3FbMF2A.png" /><figcaption>the experimental set-up! (encoder = first rat, decoder = second rat)</figcaption></figure><p>The researchers recorded the real-time activity of the first rat’s hippocampus as they went through the puzzle. Then, they directly inserted said brain wave activity into the next rat before they entered the room, in hopes that the first rat’s knowledge and brain state would be transcribed into the second.</p><p>Guess what?</p><p>From repeating this experiment, it was concluded that the second group of rats performed significantly better than the first group! The first group had a response latency of around 20.56 seconds, and the second group 13.59 seconds.</p><p>This experiment also proves the effectiveness of feeding information (or experiences!) into the brain via electrical stimulation.</p><p>What’s even cooler was that the researchers were able to create a functional neural link as an extension to this experiment! One of the researchers summarized:</p><blockquote>The behavior of the decoders [second group of rats] after receiving this novel information resulted in the first rat getting a feedback signal which influenced its brain activity.</blockquote><blockquote>[The first rat could get the feedback signal because] We were able to create artificial sensations using electrical stimulation of the spinal cord in the first rat.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*mUWJyeyL63liYhTuGuh8NQ.png" /><figcaption>experiments on animals like rats are what’s advancing our BCI field today!</figcaption></figure><p>This very much foreshadows the future of BCIs: not only importing and exporting information to and from the brain, but also bi-directional information transfer communication systems! (more on this later)</p><h3><strong>Reaching a plateau…</strong></h3><p>You might be wondering, with a technology so exciting and with so many possibilities, why BCIs aren’t more of a hot topic these days!</p><p>That’s because the development of information transfer into the brain has reached a plateau — after 2020, when Duke University’s brain-to-spine interface rat communication experiment was published in Scientific Reports.</p><h4><strong>Why might that be? </strong>These are some of my thoughts…</h4><blockquote><em>1. We </em><strong><em>do not yet know enough</em></strong><em> about</em><strong><em> extracting information</em></strong><em> from the brain.</em></blockquote><p>To progress further in this field (uploading information), we need to further advance in the basic foundation from which this technology is derived from. At the moment, even the best information extraction strategies from the brain are 70–80% accurate at best, and they can be classified with “educational guesses” based off machine learning. Therefore each piece of information is not specific (i.e., our conclusion is the best guess based off our database and current knowledge, not necessarily the exact right one).<strong> How are we supposed to import information when the methods of extraction aren’t perfected yet?</strong></p><p>That leads us to the second point…</p><blockquote><strong><em>2. Extraction</em></strong><em> is </em><strong><em>action-based. Importing </em></strong><em>needs it to be</em><strong><em> knowledge/information-based.</em></strong></blockquote><p>Have you noticed something from all the case studies listed? Both scenarios where we’re extracting information from the brain has the “thought” being an action — whether it be Pager the monkey moving the joystick in a particular direction, or Perri thinking of moving her character forwards or shooting a gun. But where we’re trying to upload information into the brain, what we need to feed in is not the an action we’re thinking of doing, like in extractions (that would be pointless). We want actual knowledge and information to be fed in.</p><p>That’s why both scenarios we’ve delved deeper into, they’ve simply taken the brainwaves from one subject and fed it into another. <strong>We do not yet know how to convert the knowledge/information we want to feed in into electrical signals or brain waves.</strong></p><p>And to know how to do so, we would need an infinitesimally large database to convert between thought and brain wave. It’s easy to do so for a small selection of actions, but to scale that to, for instance, the combination of possible English words, or knowledge of everything in the world, that’s going to take A LOT more work.</p><h4><strong>So what? Why does this technology matter?</strong></h4><p>Need I say more?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/0*r55TqGvtBrq4tt9B.gif" /><figcaption>round of applause — hahah!!</figcaption></figure><p>With technology to upload information to our brain at will, we as humans would have <strong>unlimited knowledge and communicational power </strong>within our reach.</p><p>We would be able to<strong> instantaneously understand </strong>or experience any knowledge.</p><p>We would also be able to <strong>effectively communicate </strong>with others or computers by absorbing the information directly into our brain.</p><blockquote><strong>Our brains would become supercomputers. We would become superhumans.</strong></blockquote><h3><strong>To conclude…</strong></h3><p>As we break out of the bottleneck stage in this industry of BCI information uploading, there is going to be a lot of competition to advance this technology. (We can almost count on Elon Musk and his legacy being involved in it too!)</p><p>This is the stuff our future of made of, the concepts sci-fi movies rely on all the time. And it’s up to us to pave the way to this future.</p><h4><strong>Nexts steps: some of my thoughts</strong></h4><p>There is still some accuracy and reliability work to be done in terms of uploading information into the brain. As seen from our case studies, the impact of transmitting brain waves to the second group of test subjects is noticeable, but not huge.</p><blockquote><em>I wonder if </em><strong><em>feeding in</em></strong><em> the information </em><strong><em>multiple times</em></strong><em> by electrically stimulation would cause the brain to welcome it more — and have a bigger impact on the brain’s neurons via neuroplasticity?</em></blockquote><p>EEG brain data is just the beginning. EEG is not as accurate nor as efficient as (semi-) invasive techniques.</p><blockquote><em>As this technology progresses it’s almost certain that there will be a </em><strong><em>transfer onto more invasive techniques</em></strong><em> in brain information uploading.</em></blockquote><p>Some hugely exciting possibilities that come with this technology include <a href="https://www.frontiersin.org/articles/10.3389/fnins.2016.00563/full"><strong>bi-directional information transfer</strong></a>, where when we perfected feeding information into the brain, we are able to communicate with computers or other humans back and forth seamlessly! There will be a decrease in need for spoken or written language following this though, which might be a cause of controversy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/0*wIh5UkgGPUIgK3pq.gif" /><figcaption>say woohoo with the B99 crew!</figcaption></figure><h4><strong>Our takeaways from today:</strong></h4><p>We can can flip the very foundation BCIs are set upon (extracting information from brain) to achieve sci-fi level and further push humanity’s productivity (uploading information to brain).</p><p>Examples of current information uploading experiments include California pilots and Duke University’s rats.</p><p>The idea of feeding information into our brain is still in its infancy now — but is almost certain to bloom once we break out of the shell.</p><p>Along with the industry leaders, we’ll do all we can to progress this technology, as it holds the power to change our entire future!</p><h3><strong>References</strong></h3><p>Boi, Fabio, et al. “A Bidirectional Brain-Machine Interface Featuring a Neuromorphic Hardware Decoder.” <em>Frontiers</em>, Frontiers, 22 Nov. 2016, <a href="http://www.frontiersin.org/articles/10.3389/fnins.2016.00563/full.">www.frontiersin.org/articles/10.3389/fnins.2016.00563/full.</a></p><p>Crew, Bec. “Scientists Claim They’ve Invented a Matrix-Style Device That Instantly Uploads Skills to Your Brain.” <em>ScienceAlert</em>, 2 Mar. 2016, <a href="http://www.sciencealert.com/sorry-guys-scientists-haven-t-invented-a-matrix-style-device-that-instantly-uploads-data-to-your-brain.">www.sciencealert.com/sorry-guys-scientists-haven-t-invented-a-matrix-style-device-that-instantly-uploads-data-to-your-brain.</a></p><p>“Electroencephalogram (EEG).” <em>Johns Hopkins Medicine</em>, 8 Aug. 2021, <a href="http://www.hopkinsmedicine.org/health/treatment-tests-and-therapies/electroencephalogram-eeg#:~:text=An%20EEG%20is%20a%20test,activity%20of%20your%20brain%20cells.">www.hopkinsmedicine.org/health/treatment-tests-and-therapies/electroencephalogram-eeg#:~:text=An%20EEG%20is%20a%20test,activity%20of%20your%20brain%20cells.</a></p><p>“How I Play Elden Ring with My Mind (EEG).” <em>YouTube</em>, YouTube, 1 Feb. 2023, <a href="http://www.youtube.com/watch?v=rIbfNUA5pWk.">www.youtube.com/watch?v=rIbfNUA5pWk.</a></p><p>Studio, Play. “Pager Plays Mindpong: Blog.” <em>Neuralink</em>, neuralink.com/blog/pager-plays-mindpong/. Accessed 23 Oct. 2023.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=649d1397db77" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>