<?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 Kai Bundy on Medium]]></title>
        <description><![CDATA[Stories by Kai Bundy on Medium]]></description>
        <link>https://medium.com/@kaibundy?source=rss-704788b6a304------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*USuW5oXRHJ851QvNnOsotQ@2x.jpeg</url>
            <title>Stories by Kai Bundy on Medium</title>
            <link>https://medium.com/@kaibundy?source=rss-704788b6a304------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 19:36:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kaibundy/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[Predicting Memory Formation Using EEG]]></title>
            <link>https://medium.com/@kaibundy/predicting-memory-formation-using-eeg-c292ebaf602c?source=rss-704788b6a304------2</link>
            <guid isPermaLink="false">https://medium.com/p/c292ebaf602c</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[brain-computer-interface]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[research]]></category>
            <dc:creator><![CDATA[Kai Bundy]]></dc:creator>
            <pubDate>Fri, 09 Jan 2026 08:33:20 GMT</pubDate>
            <atom:updated>2026-01-09T08:33:20.154Z</atom:updated>
            <content:encoded><![CDATA[<h3>Can we tell if something will become a memory before it actually does?</h3><p>The majority of the time, we treat memory as something we only understand <strong>after an experience</strong>. We remember a moment, a concept, or a conversation, and only then do our brains decide that it mattered or not. If we forget it, people often assume it simply wasn’t important or maybe that we weren’t paying attention enough.</p><p>After extensive research, neuroscience can confidently say that memory does not begin at simple recall.</p><p>It begins earlier, during a hidden and often fleeting process known as <strong>encoding</strong>.</p><p>Encoding is the moment when the brain subtly decides whether an experience is worth storing. This decision happens quickly, often within the first few seconds of encountering new information, and it happens without our conscious awareness. Long before we know whether we will remember something later, the brain has already begun to commit, or reject, that memory.</p><p>This raises a question that feels almost uncomfortable at first:</p><p><strong>What if the brain reveals whether a memory is forming before we ever try to remember it?</strong></p><p>If that were true, memory would no longer be a mystery we only observe in hindsight. It would become a measurable process, something we could potentially detect, quantify, and even respond to in real time.</p><p>For my Replicate 2, I explored this exact idea by asking a simple but powerful question:</p><p><strong>Can EEG brain signals recorded during the moment of experience predict whether that moment will later be remembered?</strong></p><p>Rather than trying to decode <em>what</em> someone is thinking, this project focuses on <em>how strongly</em> the brain is engaging with an experience. My goal while making this wasn’t with the intention to mind read, but memory forecasting, which means to identify whether the neural conditions for memory formation are present as the experience unfolds.</p><p>This approach sits within a field of neuroscience known as <strong>subsequent memory prediction</strong>, in which researchers analyze brain activity at the time information is first encountered and attempt to predict future recall.<a href="https://www.cell.com/trends/cognitive-sciences/abstract/S1364-6613(00)01845-3?large_figure=true"> Years of research</a> suggest that memory success is not random, but reflected in subtle neural patterns related to attention, engagement, and cognitive processing.</p><p>What makes this problem especially challenging (and fascinating) is that these patterns are not obvious. Unlike motor actions or sensory responses, memory encoding signals are weak, noisy, and deeply internal. Detecting them requires really careful analysis, meaningful features, and probabilistic models rather than deterministic rules.</p><p>This Replicate is an attempt to bridge that gap, using real EEG data and machine learning to figure out whether the brain leaves behind detectable clues when a memory is being formed, even before we know it ourselves.</p><h3>The Data Set → Watching Movies While Wearing EEG</h3><p>To study memory formation, I used a publicly available dataset from OpenNeuro known as the <a href="https://openneuro.org/datasets/ds006142/versions/1.0.2"><strong>Essex EEG Movie Memory dataset</strong></a>. In this experiment, participants wore a <strong>64-channel EEG cap</strong> while watching hundreds of short movie clips drawn from a wide range of films and genres. The clips were designed to be naturalistic and engaging, like you just watched <a href="https://en.wikipedia.org/wiki/The_Twilight_Saga_(film_series)"><em>Twilight</em></a> and you got a flash to the past. Therefore, it was closer to real-world experiences than traditional lab stimuli like word lists or static images.</p><p>Crucially, EEG was recorded <strong>continuously while each clip was being watched</strong>, capturing the brain’s real-time electrical activity during the exact moment when memory encoding could occur. This provides access to neural signals that reflect attention, engagement, and early memory processing rather than signals associated with later recall.</p><p>After watching the clips, participants completed a memory test in which each clip was categorized into one of three outcomes:</p><ul><li><strong>Not recognized</strong> — the participant had no memory of seeing the clip</li><li><strong>Recognized</strong> — the clip felt familiar, but without vivid details</li><li><strong>Remembered vividly</strong> — the participant recalled the clip clearly, often with contextual detail</li></ul><p>These categories are important because they map onto well-established distinctions in cognitive neuroscience between <strong>familiarity</strong> and <strong>recollection</strong>, two different memory processes that rely on partially different neural mechanisms.</p><p>For my project, these responses served as <strong>ground-truth labels</strong>, meaning they provide an external reference for whether a memory was successfully formed. By aligning these labels with EEG activity recorded during the <em>initial viewing</em> of each clip, the dataset allows for a powerful type of analysis known as <strong>subsequent memory prediction</strong>: predicting future memory outcomes using brain activity measured at the time of experience.</p><p>This setup is rare and valuable because most memory datasets focus on brain activity during <em>recall</em>. In contrast, this dataset captures neural signals <strong>before a memory is known to exist</strong>, making it possible to study the earliest stages of memory formation. As a result, it provides a direct way to test whether the brain contains detectable signals that indicate, in real time, whether an experience will later be remembered or forgotten.</p><h3>Taking Raw Brainwaves and Turning Them Into Memory Signals</h3><p>Yes, EEG data is extremely rich, but it is also extremely messy. At every moment, the signal reflects thousands of overlapping neural processes: perception, attention, emotion, eye movements, and noise from muscle activity. Because of this, the first challenge was deciding <strong>when</strong> to look in the signal and <strong>how</strong> to represent it in a way that a machine learning model could interpret.</p><h3>Defining the Memory Encoding Window</h3><p>Memory encoding does not happen all at once. Research in cognitive neuroscience shows that the brain’s initial response to new information, especially within the first few seconds, plays a critical role in determining whether that information will later be remembered. Early neural activity reflects processes such as attention allocation, sensory integration, and <a href="https://pubmed.ncbi.nlm.nih.gov/38050089/#:~:text=Significance%20Statement%20The%20hippocampus%20is,;%20semantic%20memory;%20visual%20memory.">hippocampal–cortical</a> interaction, all of which contribute to successful encoding.</p><p><strong>Warning</strong>: it’s about to get technical but bare with me!</p><p>Based on this, I extracted a <strong>3-second window immediately after each movie clip began</strong>. This window captures the brain’s earliest response to the stimulus, before longer-term processes like rehearsal or reflection take place. By focusing on this short interval, the model is forced to rely on genuine encoding signals rather than later cognitive strategies.</p><p>Each encoding window contains:</p><ul><li><strong>64 EEG channels</strong>, distributed across the scalp</li><li>A <strong>sampling rate of 2048 Hz</strong>, meaning the signal is measured 2048 times per second</li><li>Over <strong>6,000 time points per channel</strong> within a single 3-second clip</li></ul><p>This results in a very high-dimensional representation of brain activity for every clip.</p><h3>Why Raw EEG Cannot Be Used Directly</h3><p>While raw EEG preserves all temporal detail, it is not directly suitable for machine learning. Feeding thousands of raw time points per channel into a classifier would not only be computationally (<em>in a way that uses or relates to computers</em>) inefficient, but also likely cause the model to learn noise rather than meaningful brain patterns.</p><p>Instead, EEG research typically transforms raw signals into <strong>frequency-based features</strong>, which summarize how much neural activity occurs within specific frequency bands. These frequency bands are not arbitrary; they correspond to well-studied cognitive functions and neural mechanisms.</p><h3>Transforming EEG Into Cognitive Frequency Features</h3><p>For each encoding window, I computed average power in three frequency bands that are strongly linked to memory and attention:</p><ul><li><strong>Theta (4–7 Hz)</strong><br> Theta activity is widely associated with memory encoding, especially in frontal and medial temporal regions. Increased theta power has been linked to successful formation of episodic memories and coordination between brain regions during learning.</li><li><strong>Alpha (8–12 Hz)</strong><br> Alpha rhythms are often interpreted as a marker of attention and inhibition. Lower alpha power is typically associated with increased engagement and information processing, while higher alpha can indicate disengagement or suppression of irrelevant input.</li><li><strong>Beta (13–30 Hz)</strong><br> Beta activity reflects active cognitive processing, alertness, and higher-order thinking. In the context of encoding, beta power can indicate sustained mental effort and integration of information.</li></ul><p>For each clip, I calculated the average power in these three bands <strong>for every EEG channel</strong>, resulting in a compact and interpretable feature set.</p><h3>Final Feature</h3><p>This process transformed each clip from raw brainwaves into a structured feature vector:</p><ul><li><strong>64 channels</strong></li><li><strong>3 frequency bands per channel</strong></li><li><strong>192 total features per clip</strong></li></ul><p>This representation dramatically reduces dimensionality while preserving the most cognitively meaningful aspects of the signal. Importantly, these features are grounded in decades of neuroscience research, making the model’s predictions interpretable rather than opaque.</p><p>By converting raw EEG into frequency-based features tied to memory and attention, the model learns patterns that reflect <strong>how strongly the brain is encoding information</strong>, rather than superficial noise in the signal.</p><h3>Training a Memory Prediction Model</h3><p>Once the EEG data was cleaned and transformed into frequency-based features, I framed the task as a <strong>binary classification problem</strong>:</p><ul><li><strong>1 = Remembered</strong></li><li><strong>0 = Not remembered</strong></li></ul><p>At the start of this project, I assumed that if I built the pipeline correctly, I should be able to push accuracy much higher. Coming from motor imagery and other BCI tasks, I subconsciously treated memory as something that should produce a strong, obvious neural signal.</p><p>That assumption turned out to be wrong.</p><h3>Choosing the Models</h3><p>To test whether memory encoding leaves a detectable neural signal, I trained and evaluated two machine-learning models commonly used in EEG and brain–computer interface research.</p><p><strong>Linear Discriminant Analysis (LDA)</strong><br> LDA is a simple classification method that looks for a straight-line boundary between two groups. In EEG research, it’s often used as a baseline because it’s easy to interpret and works well when signals are strong and consistent. If LDA performs above chance, it’s usually a good sign that the data contains meaningful structure rather than random noise.</p><p><strong>Support Vector Machines (SVM)</strong><br> SVMs are more flexible classifiers that focus on separating data points by maximizing the margin between classes. They are especially useful for high-dimensional data like EEG, where patterns are subtle and spread across many features. If a weak but consistent memory-encoding signal exists, an SVM is more likely to detect it.</p><p>Using both models allowed me to test not just how well memory could be predicted, but also what kind of signal was present — whether it was strong and obvious, or faint and distributed across the brain.</p><h3>A Shift in Expectations</h3><p>As I trained and evaluated the models, I noticed something important: accuracy plateaued much earlier than I expected. No matter how clean the pipeline was, the results never approached the kinds of numbers I had initially imagined.</p><p>At first, this felt like a limitation of the model.</p><p>Later, I realized it was a limitation of my assumption.</p><p>Memory encoding doesn’t work like motor commands or visual stimuli, where neural patterns are strong, localized, and repeatable. Memory formation is distributed, probabilistic, and deeply influenced by attention, emotion, context, and prior experience. Two moments can look nearly identical in EEG and still lead to very different memory outcomes.</p><p>Once I understood this, the results made more sense.</p><h3>Reframing Success</h3><p>The goal of this project was not to achieve near-perfect accuracy, but to answer a more fundamental question:</p><p><strong>Does memory encoding leave any detectable neural signature at all?</strong></p><p>The fact that both LDA and SVM performed above chance, and that the model achieved an AUC of 0.70 (70%), suggests that it does. Even modest accuracy gains are meaningful in this context because they reflect a real, measurable difference in brain state during encoding.</p><p>This realization changed how I evaluated the project. Instead of seeing the results as underwhelming, I began to see them as evidence of how complex and nuanced memory formation really is.</p><p>And that, in many ways, was the most valuable outcome of the Replicate.</p><p>We could stop here but no, let’s go <strong>deeper</strong>!</p><h3>Model Performance: Does the Brain Reveal Memory Early?</h3><h3>ROC Curve — Measuring Discrimination Ability</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*zCqAf9CqgX8eTf1geX1JAQ.png" /><figcaption>Figure 1. ROC Curve for memory prediction using EEG (AUC = 0.70).</figcaption></figure><p>At first glance, this graph can look intimidating, especially if you don’t have a background in brain–computer interfaces or machine learning. But conceptually, it answers a very intuitive question:</p><p><strong>How well can the model tell the difference between moments that will be remembered and moments that will be forgotten?</strong></p><h3>What an ROC Curve Actually Shows</h3><p>The model doesn’t just output “remembered” or “not remembered.”<br> It outputs a <strong>probability score, </strong>which is a<strong> </strong>measure of how confident it is that a moment is being encoded into memory.</p><p>The ROC curve shows what happens when we slide the decision threshold for that probability from very strict to very lenient.</p><ul><li><strong>X-axis (False Positive Rate):</strong><br> How often the model incorrectly predicts a memory when there isn’t one.</li><li><strong>Y-axis (True Positive Rate):</strong><br> How often the model correctly detects a memory when one <em>is</em> forming.</li></ul><p>Each point on the curve represents a different threshold for deciding what counts as “remembered.”</p><p>The dashed diagonal line represents <strong>random guessing</strong>.<br> Any curve that rises above this line means the model is doing better than chance.</p><h3>What Is Happening in This Image Specifically</h3><p>In this graph, the blue curve consistently stays above the diagonal line, especially as the true positive rate increases. This tells us that the model is not guessing randomly — it is systematically ranking remembered clips higher than forgotten ones.</p><p>The <strong>Area Under the Curve (AUC)</strong> summarizes this entire relationship with a single number.</p><h3>What AUC = 0.70 Really Means</h3><p>An AUC of <strong>0.70</strong> means the following:</p><blockquote><em>If you randomly select one clip that was later remembered and one that was later forgotten, the model will assign a higher “memory score” to the remembered clip about </em><strong><em>70% of the time</em></strong><em>.</em></blockquote><p>Had to put that one in the quote marker because this is IMPORTANT!</p><p>It doesn’t mean the model is perfect, and it doesn’t mean every memory can be predicted. Instead, it shows that <strong>the brain’s encoding state contains real, detectable information about future memory</strong>.</p><h3>Why This Matters for Memory (and Why Accuracy Isn’t Enough)</h3><p>Memory is not binary in the brain.<br> It’s probabilistic, distributed, and influenced by attention, emotion, context, and prior knowledge.</p><p>Accuracy alone forces the model to make a hard yes/no decision at a single threshold.<br> The ROC curve, on the other hand, evaluates the model across <em>all</em> thresholds, making it especially important for imbalanced and noisy cognitive data like EEG.</p><p>That’s why AUC is often preferred in memory research — it captures whether the model understands the <em>ranking</em> of memory strength, not just the final classification.</p><h3>How This Compares to Real Neuroscience Research</h3><p>In EEG-based memory encoding studies, AUC values typically fall between <strong>0.60 and 0.75</strong>. Memory signals are subtle, variable across individuals, and much harder to decode than motor commands or visual stimuli.</p><p>An AUC of <strong>0.70</strong> places this model well within the range reported by published studies, indicating that:</p><ul><li>Memory encoding leaves a real neural signature</li><li>That signature is detectable using non-invasive EEG</li><li>The model is learning something meaningful about brain state, not noise</li></ul><h3>Confusion Matrix — What It Is and What It Shows</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*FR6h7FFn8qVvSET8bxtT5Q.png" /><figcaption>Figure 2. Confusion Matrix for Memory Prediction</figcaption></figure><p>Looking at the matrix, the first thing that stands out is that the model does a much better job identifying clips that were <strong>not remembered</strong>. When the brain wasn’t really encoding a clip strongly, the model usually caught that. That actually makes a lot of sense. When someone is disengaged, distracted, or just not really processing what they’re seeing, the brain tends to show clearer and more consistent signals. Forgetting, in a weird way, is easier to spot.</p><p>Where the model struggles more is with <strong>remembered</strong> clips. A decent number of clips that were remembered later still get classified as “not remembered.” At first, that looks like a weakness, but it’s actually kind of the point. Successful memory encoding is subtle. Two clips can both be remembered, but for completely different reasons, and even within the same person, strong encoding doesn’t always look the same in the brain.</p><p>EEG is only measuring surface-level electrical activity, so it’s not picking up a clean “memory forming” signal. It’s picking up noisy, indirect patterns. Because of that, the neural signature for successful encoding is weaker and more variable than the signature for failed encoding.</p><p>This pattern isn’t unique to my model either. In memory research using EEG, it’s pretty common to see that <strong>failed encoding is easier to detect than successful encoding</strong>. Forgetting leaves a clearer footprint than remembering.</p><p>So instead of seeing the confusion matrix as disappointing, I see it as realistic. The model isn’t overconfident, and it isn’t pretending memory is something clean and binary. It’s reflecting what memory actually is: inconsistent, probabilistic, and different every time. And honestly, that makes the results more believable, not less.</p><h3>From Model Output to Human Understanding</h3><p>Up to this point, everything in the project lives in a very technical space: EEG signals, frequency bands, classifiers, accuracy scores. But at some point, I had to ask a more basic question: <strong>what does this actually mean for a human?</strong></p><p>Even though the model ultimately produces a binary prediction (remembered or not remembered) that’s not how it actually thinks internally. Under the hood, the model outputs a <strong>probability score</strong> for each clip. This score represents how strongly the brain’s activity during the encoding window matches patterns that are associated with later remembering.</p><p>In other words, the model isn’t saying “yes” or “no” right away. It’s saying something closer to:<br> <em>“Based on this brain activity, I’m this confident that a memory is forming.”</em></p><p>That probability is the same value used to generate the ROC curve. When the ROC curve slides the threshold left and right, it’s operating on these confidence scores. So the probability isn’t an extra feature or an interpretation layered on top — it’s already central to how the model is evaluated.</p><p>What I realized is that while probabilities make sense to models and metrics, they don’t make much sense to people.</p><h3>Turning a Probability Into Something Intuitive</h3><p>Instead of leaving this output as an abstract number, I translated it into a <strong>Memory Strength Meter</strong>, a simple interface that visualizes the model’s confidence in a way a person could actually understand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YJZGgsb0s4AEQdhzYhTqfA.png" /><figcaption>Image Generated By ChatGPT</figcaption></figure><p>The image above is a<strong> conceptual visualization</strong> of the model’s probability output, representing the estimated strength of memory encoding during a 3-second EEG window. The meter directly maps to the same confidence values used to generate the ROC curve and is intended as a human-readable translation of model output, not a new predictive algorithm.</p><p>The idea is straightforward:</p><ul><li><strong>Low</strong> → weak encoding signal</li><li><strong>Medium</strong> → moderate encoding signal</li><li><strong>High</strong> → strong encoding signal</li></ul><p>A probability of <strong>0.72</strong>, for example, doesn’t just mean “above threshold.” It means that the brain activity during that moment strongly resembles patterns that tend to become memories. On the meter, that shows up as a high bar and a “strong encoding” state.</p><p>Importantly, this meter isn’t claiming certainty. It’s not saying, <em>“This will definitely be remembered.”</em> It’s saying, <em>“Right now, the brain looks like it’s encoding effectively.”</em> That distinction matters, especially for something as unpredictable as memory.</p><h3>Why This Isn’t a New Algorithm</h3><p>The Memory Strength Meter isn’t doing any additional computation. It’s not smoothing results, changing thresholds, or adding intelligence on top of the model. It’s simply a <strong>direct visualization of the same probability values</strong> already used to evaluate performance.</p><p>In that sense, it’s closer to a translation than an extension.</p><p>The science stays exactly the same. What changes is the form the output takes.</p><h3>Why This Matters</h3><p>When people think about brain-computer interfaces, they usually imagine control: moving a cursor with your thoughts, typing without a keyboard, controlling a robotic arm. That work is important, but it’s only one narrow slice of what BCIs could become.</p><p>This project pushed me to think in a different direction. Instead of asking <em>“What can the brain control?”</em>, I started asking <em>“What can the brain reveal?”</em></p><p>The model I built doesn’t control anything. It doesn’t issue commands or move objects. What it does instead is try to answer a quieter question: <strong>is learning actually happening right now?</strong></p><p>That distinction matters. Most learning tools today are reactive. You find out something didn’t stick only after you forget it, bomb a quiz, or reread the same notes three times. A memory-aware system flips that timeline. Rather than responding <em>after</em> forgetting occurs, it could act <em>during</em> the moment of learning.</p><p>In principle, a system like this could:</p><ul><li>Detect when the brain is actively encoding information</li><li>Warn users when attention or encoding begins to drop</li><li>Support better study habits by encouraging breaks at the right time</li><li>Help explain why some moments “stick” while others quietly disappear</li></ul><p>This isn’t about guaranteeing memory or eliminating forgetting. It’s about giving feedback on an internal process we normally have no access to. And that alone changes how we think about learning.</p><h3>What I Learned</h3><p>One of the biggest takeaways from this Replicate is that <strong>memory encoding is real, but subtle</strong>. The brain does leave signatures when something is being encoded, but they aren’t clean or dramatic. They’re noisy, variable, and deeply human.</p><p>Working with EEG made that very clear. EEG is powerful because it captures brain activity in real time, but it’s also messy. There is no single “memory signal.” Everything is <strong>probabilistic</strong>. That’s why metrics like AUC ended up being more meaningful than raw accuracy. In imbalanced cognitive tasks like this one, understanding <em>how well a model separates states</em> matters more than how often it gets a binary label right.</p><p>Another important lesson was that building the model is only half the work. The other half is making the<strong> output interpretable</strong>. A probability score might be useful to a classifier or a graph, but it doesn’t mean much to a person. Translating that output into something like the <em>Memory Strength Meter</em> made me realize how easy it is for technically correct systems to become cognitively useless if no one can understand what they’re saying.</p><p>Most importantly, this project changed how I think about BCIs. They don’t need to control machines to be impactful. They can be tools for insight, helping us understand the invisible mental processes that shape how we learn, focus, and remember.</p><h3>Conclusion</h3><p>In this Replicate, I built a machine-learning pipeline that predicts whether a moment will become a memory using EEG data recorded during the moment of encoding. By extracting frequency-based features from a short encoding window and training classification models, I showed that memory formation is detectable in early brain activity, achieving an AUC of 0.70.</p><p>More than the number itself, what matters is what it represents: evidence that internal cognitive states like memory encoding can be inferred, imperfectly but meaningfully, from brain signals in real time.</p><p>This project is a small step toward cognitive-state-aware technology, systems that don’t just respond to what we do, but try to understand what our brain is actually doing underneath. And that opens up a very different future for brain-computer interfaces, one focused less on control and more on understanding.</p><p>If BCIs are going to matter in <strong>everyday life</strong>, I think this is where they start.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c292ebaf602c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Taught a Computer to Read the Human Mind — Using Only Code]]></title>
            <link>https://medium.com/@kaibundy/i-taught-a-computer-to-read-the-human-mind-using-only-code-c79c8a3d5d54?source=rss-704788b6a304------2</link>
            <guid isPermaLink="false">https://medium.com/p/c79c8a3d5d54</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[brain]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[the-knowledge-society]]></category>
            <dc:creator><![CDATA[Kai Bundy]]></dc:creator>
            <pubDate>Sat, 08 Nov 2025 08:59:15 GMT</pubDate>
            <atom:updated>2025-11-09T22:17:47.923Z</atom:updated>
            <content:encoded><![CDATA[<h3>I Taught a Computer to Read the Human Mind — Using Only Code</h3><p><em>Using open EEG data and Python, I rebuilt a Brain–Computer Interface — and saw how close we already are to thought-based computing</em></p><p><strong><em>Welcome.</em></strong></p><p>If you got this far, you might as well stay.</p><p>Imagine a world where your thoughts alone could move a cursor across a screen, send a message, or even help someone walk again.</p><p>No keyboard.</p><p>No voice commands.</p><p>No physical movement at all — just pure intention.</p><p>That’s the vision behind Brain–Computer Interfaces (BCIs), systems that translate the electrical activity of the human brain into computer-understandable signals.</p><p>This technology sits at one of the most fascinating intersections in science: where neuroscience meets machine learning, and biology merges with code.</p><p>BCIs are already being tested to help people with paralysis control robotic limbs, allow amputees to “feel” again through prosthetics, and restore communication to patients who have lost the ability to speak.</p><p>But beyond the medical miracles, BCIs hint at something even deeper: a future where human thought becomes a universal interface. Imagine being able to create art, write music, or design software directly through brain activity. Imagine storing a memory and replaying it later or even sharing it with someone else. It’s both thrilling and unsettling, because it blurs the boundary between mind and machine, raising questions about consciousness, identity, and what it truly means to be human.</p><p>For my first project in The Knowledge Society (TKS) called “<strong>Replicate 1</strong>,” I wanted to explore that boundary firsthand. The purpose of a Replicate project is to rebuild an existing technology from scratch to understand how it works at a fundamental level. Rather than inventing something new, I wanted to <em>recreate intelligence itself</em>: a system that can recognize thoughts.</p><p>So, I set out to build a software-only Brain–Computer Interface. No fancy lab, no electrodes on my head, just code and real brainwave data from open-source research.</p><p>I wanted to see if a simple machine-learning model could learn to recognize what someone is imagining, whether they were thinking about moving their hand or their foot.</p><p>What started as curiosity quickly turned into something more meaningful: a glimpse into where humans and machines don’t just work together, they <em>merge.</em></p><h3>What I Built</h3><p>Most people think that understanding the human brain requires a lab coat, a million-dollar EEG machine, and years of neuroscience training. I wanted to challenge that idea.</p><p>For this project, I decided to teach a computer to recognize thoughts using</p><p>Nothing.</p><p>But.</p><p><strong>Code.</strong></p><p>The goal wasn’t to build a mind-reading gadget or to control a robot arm. It was to explore whether a computer could identify what a person was imagining, purely from their brain’s electrical signals. Could a model tell the difference between someone thinking about moving their hand versus their foot?</p><p>That’s where I began, with a simple yet powerful question:</p><blockquote>Can a computer learn to understand intention?</blockquote><p>To find out, I built a <strong>software-only Brain–Computer Interface (BCI)</strong>: a system that decodes the brain’s activity using open-source data instead of physical sensors.</p><p>Here’s how it worked:</p><ul><li>I used<strong> real EEG data</strong> (electroencephalography) from the <a href="https://physionet.org/content/eegmmidb/1.0.0/?utm_source=chatgpt.com">PhysioNet Motor Imagery Dataset</a>, which contains recordings of people imagining specific movements while 64 electrodes captured the tiny electrical fluctuations across their scalp.</li><li>I then <strong>processed those signals through Python</strong> to clean, filter, and extract meaningful patterns from the raw voltage data — patterns that subtly change depending on what the person is imagining.</li><li>Finally, I trained a <strong>machine-learning model</strong> to recognize those differences and predict which mental action the person was performing which was either imagining moving their hand, or their foot.</li></ul><p>In essence, I recreated a simplified version of the technology that powers <strong>prosthetic control systems, neural spellers, and even Elon Musk’s Neuralink</strong>, but entirely through <strong>code</strong>.</p><p>And while it might sound like science fiction, it’s grounded in one simple principle:</p><p>your thoughts create measurable patterns.</p><h3>Breaking Down the System</h3><p>To make it more visual, imagine each part of the system as a stage in a conversation between your brain and the computer:</p><ol><li><strong>The Listener — EEG Data</strong></li></ol><p>This is where everything starts. When you imagine moving your hand, your motor cortex (the part of your brain responsible for voluntary movement) generates a small but distinct electrical signal. The PhysioNet dataset captures these signals from dozens of volunteers using 64 scalp electrodes.</p><p><strong>2. The Translator — Signal Processing</strong></p><p>Raw EEG data is noisy, full of muscle twitches, eye blinks, and background interference. I used a technique called <strong>band-pass filtering (7–30 Hz)</strong> to isolate the frequency range linked to motor activity. This range includes mu and beta rhythms which are the brain waves that fluctuate when you plan or imagine movement.</p><p><strong>3. The Decoder — Common Spatial Patterns (CSP)</strong></p><p>This was the heart of my BCI. CSP is a mathematical algorithm that finds where in the brain the biggest differences between two mental states occur.</p><p>It essentially “weights” each electrode based on how strongly it contributes to distinguishing one task from another. Almost like tuning a radio to focus on the clearest signal.</p><p><strong>4. The Classifier — Linear Discriminant Analysis (LDA)</strong></p><p>Once the features were extracted, I trained a machine-learning classifier (LDA) to separate “hand” versus “foot” imagery. The model learned to draw a boundary in feature space that best distinguished between the two classes.</p><p><strong>5. The Evaluator — Cross-Validation</strong></p><p>To make sure my model wasn’t just guessing, I used 5-fold cross-validation, meaning the data was split into five equal parts. The model trained on four and tested on the fifth, rotating through each. This gave me a reliable accuracy score and avoided overfitting.</p><h3>The Result</h3><p>When I first trained my model on all subjects combined, it only achieved <strong>53% accuracy</strong>, just 3% better than a random coin flip.</p><p>At first, I thought it had failed. But then I tested it on data from just <strong>one person’s brain</strong>. All of the sudden, the accuracy jumped to <strong>97.8%</strong>.</p><p>That moment changed everything.</p><p>It meant that the model <em>could</em> decode thoughts, but it had to learn the language of each individual brain.</p><p>Every person’s brain is wired slightly differently to the point that their neural signals, rhythms, and even levels of focus vary. So a universal “mind reader” didn’t work, but a personalized one did almost perfectly.</p><h3>Why It Matters</h3><p>This realization revealed a deeper truth about the future of BCIs:</p><p>They won’t just be technologies we use, they’ll be extensions of us.</p><p>A one-size-fits-all brain model doesn’t exist because your brain is unique.</p><p>What I built was more than an experiment in code but was a prototype of how personalized AI could one day communicate with the human mind itself.</p><p>And the most exciting part?</p><p>All of this was done without wearing a single EEG headset. No electrodes, no lab, no hardware. Just open data, a laptop, and a question:</p><blockquote>Can machines learn to understand us, not through words, but through thought?</blockquote><p>To keep this article readable, I’ve summarized the main steps here. But if you’d like to see the full code, mathematical details, and visual results, I’ve explained everything step-by-step in this <a href="https://docs.google.com/document/d/1128sTyZL5uzUUe4sDpQRQwhangjX7t5XBu3sInT0dI0/edit?usp=sharing">Google Doc</a> (including sub-tabs) which is a deep dive into every piece of the pipeline that made this BCI work.</p><h3>How I Built It</h3><p>Once I had the idea to teach a computer to recognize imagined movement, I knew this wouldn’t be about wiring sensors to my head or building a fancy robot arm.</p><p>It would be about taking the invisible (brainwaves) and making them visible to a machine.</p><p>So I opened a blank Google Colab notebook, ready to turn it into a neuroscience lab inside my browser.</p><p>No electrodes, no lab assistants</p><p>just me, a laptop, and Python.</p><h3>Step 1 — Setting Up the Environment</h3><p>I started by installing the scientific toolkit that would make my code capable of handling real EEG data:</p><blockquote>!pip install -q mne numpy scipy scikit-learn matplotlib</blockquote><p>Each library served a specific purpose:</p><ul><li><strong>MNE </strong>— a neuroscience library designed for EEG analysis</li><li><strong>NumPy and SciPy</strong> — for complex math and signal processing</li><li><strong>scikit-learn</strong> — for machine learning and classification</li><li><strong>matplotlib </strong>— for visualizing what the brain looks like in numbers</li></ul><p>With one command, my Colab notebook became a digital EEG workstation</p><p>the kind you’d normally find in a <strong>neuro lab</strong>.</p><h3>Step 2 — Loading the Brain Data</h3><p>I used the <strong>PhysioNet EEG Motor Movement/Imagery Dataset</strong>, a gold standard in BCI research. It contains real recordings from volunteers who sat quietly while imagining two actions:</p><ul><li><strong>Moving their hand</strong></li><li><strong>Moving their foot</strong></li></ul><p>Each trial lasted only a few seconds, but in that time, dozens of electrodes captured microvolt-level signals from across the scalp, thousands of data points per second.</p><p>When I first loaded the files, all I saw were long streams of raw numbers. They were chaotic, noisy, and seemingly meaningless.</p><p>But hidden in that chaos were patterns: faint neural signatures that change depending on what you’re imagining.</p><p>That’s what I wanted to find.</p><h3>Step 3 — Preprocessing the Signals</h3><p>Raw EEG data is messy.</p><p>It’s full of eye blinks, head twitches, electrical interference, and random background noise.</p><p>So before the computer could learn anything, I had to <strong>teach it to listen through the noise.</strong></p><p>Using MNE, I filtered the signal between <strong>7 and 30 Hz</strong>, isolating the brain’s <strong>mu</strong> and <strong>beta</strong> rhythms.</p><p>For the not so nerds, they are frequencies that are known to be involved in motor activity.</p><p>This filter acted like noise-canceling headphones for the brain: it removed unnecessary frequencies and amplified the ones related to intention.</p><p>Once filtered, the data started to look smoother, cleaner, and (most importantly) learnable.</p><h3>Step 4 — Segmenting the Brain into Thoughts</h3><p>The brain doesn’t think in one long continuous stream</p><p>it works in bursts.</p><p>Every time a person was told to imagine moving their hand or foot, that moment became an epoch (a small time window).</p><p>By cutting the data into these smaller chunks, I turned one massive recording into <strong>hundreds of labeled thought samples</strong>, each one tagged as either hand or foot.</p><p>Each epoch became a single training example:</p><blockquote>The computer’s version of “this is what thinking about a hand looks like.”</blockquote><h3>Step 5 — Extracting Features with CSP (Common Spatial Patterns)</h3><p>This was the moment where math met biology.</p><p>EEG signals come from many electrodes, but not all electrodes matter equally for a specific thought. Some record stronger signals from the motor cortex, others just pick up background noise.</p><p>To isolate the useful parts, I used <strong>Common Spatial Patterns (CSP)</strong> which is an algorithm that finds the spatial filters that best distinguish two classes of brain activity.</p><p>Think of CSP like shining a spotlight on the areas of the brain that change most between two thoughts.</p><p>For instance:</p><ul><li>When you imagine moving your <strong>hand</strong>, signals around the left and right motor cortices become stronger.</li><li>When you imagine moving your foot, activity shifts toward the centre of the scalp (near the <strong>Cz electrode</strong> region).</li></ul><p>CSP turns these spatial changes into numerical features that the computer can actually understand ultimately transforming the brain from an electrical organ into a data structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0I0vDo_ISXQ7c6ItcV65Ew.png" /><figcaption>Each scalp map represetns a spatial filter learned by the model. Blue and red areas show regions of the brain that most strongly distinguish imagined hand vs. foot movements — mainly around the sensorimoter cortex.</figcaption></figure><h3>Step 6 — Classifying Thoughts with LDA</h3><p>Now it was time to actually teach the computer to think.</p><p>Once the CSP features were extracted, I trained a <strong>Linear Discriminant Analysis (LDA)</strong> classifier which is a simple, elegant machine-learning algorithm that draws a mathematical line between two categories.</p><p>To the LDA model, every thought (hand or foot) became a point in a multidimensional space. Its goal was to find the best possible line that separates those points.</p><p>If the points were well-separated, the model could confidently say,</p><blockquote>“This new brainwave pattern looks more like a hand than a foot.”</blockquote><p>If not, it would guess.</p><p>Although, LDA is old-school…</p><p>It is the kind of algorithm you can actually visualize which made it perfect for a project like this. I didn’t need deep learning; I needed <em>understanding</em>.</p><p>If you want to explore the full code and run the experiment yourself, you can open my Google Colab notebook here:<br>👉<a href="https://colab.research.google.com/drive/1lIdpKC7hanw8TNTPpWhR9MRVeu8wURYr?usp=sharing"> <strong>BCI_Replicate_v3 — Full Notebook on Google Colab</strong></a></p><h3>Step 7 — Testing Through Cross-Validation</h3><p>To make sure the model wasn’t just memorizing patterns, I used <strong>5-fold cross-validation.</strong></p><p>This means I split the dataset into five equal parts, trained the model on four of them, and tested it on the fifth, repeating this process five times.</p><p>Every fold produced its own accuracy score, revealing how consistent the model was across different slices of data.</p><p>For group data (all five subjects combined), the accuracy hovered around <strong>53%</strong>, basically a statistical shrug.</p><p>But when I trained it on a single subject’s data, everything changed:</p><p>The accuracy shot up to <strong>97.8%</strong>, and the<strong> AUC score hit 1.000</strong> which means it could almost perfectly separate hand from foot imagery.</p><p>That’s when I knew I wasn’t just building a model, but was building a connection between code and cognition.</p><h3>Step 8 — Visualizing the Brain</h3><p>To understand what the model was “seeing,” I generated visualizations of the results:</p><ul><li><strong>Accuracy per Fold Graph</strong>: Showed how stable performance was across trials.</li><li><strong>ROC Curve</strong>: Measured the model’s discrimination power.</li><li><strong>Confusion Matrix</strong>: Displayed how many predictions were right or wrong.</li><li><strong>CSP Scalp Maps</strong>: Revealed which parts of the brain the model focused on most.</li></ul><p>These maps were extraordinary in the sense that they were glowing gradients of red and blue that looked like heat signatures of thought itself.</p><p>Each one was a fingerprint of cognition: a literal visualization of what it looks like when the brain imagines movement.</p><h3>Step 9 — Reflection: A Model that Learned to Listen</h3><p>At the end of it all, my model wasn’t just crunching numbers. It was interpreting patterns that represent intention, which is the most human form of signal there is.</p><p>When I saw the model’s predictions match the actual imagined movements, I realized something:</p><p>I had built a system that could listen to the brain, and it learned entirely through mathematics.</p><p>The experience was humbling, although not because the model worked perfectly, but because it worked at all.</p><p>Somewhere between the raw data and the final graph, code and consciousness started to overlap.</p><h3>What I Discovered</h3><p>When I first started this project, I thought success would mean building a model that worked. A system that could predict whether someone was imagining moving their hand or their foot. But as the graphs began to take shape, I realized that success looked very different.</p><p>Because this wasn’t just about accuracy.</p><p>It was about <em>understanding</em>.</p><h3>Every Brain Speaks Its Own Language</h3><p>When I trained the model across all five participants, the accuracy hovered just above 50%.</p><p>At first, it felt like failure.</p><p>How could a computer possibly decode thought if it could barely outperform a coin flip?</p><p>But when I trained it on one person (just a single subject) the accuracy exploded to 97.8%. The ROC curve became a perfect arc, the confusion matrix turned nearly solid blue, and the model’s confidence shot to the extremes of 0 and 1.</p><p>That’s when it hit me:</p><p><strong>Every brain is different.</strong></p><p>You may be thinking “duh, we all have different thoughts so we must have different brains.”</p><p>Well it’s not as simple as that.</p><p>The patterns that make up your imagination, which are the exact frequencies, spatial activations, and rhythms of your motor cortex, are as unique as your fingerprint.</p><p>Trying to build a universal brain model is like trying to write one translator for every language on Earth. It’s not impossible, but it’s deeply personal.</p><p>This changed how I saw the future of BCIs.</p><p>It’s not about creating one perfect model for everyone, it’s about creating adaptive systems that learn the unique language of you.</p><h3>Machines Don’t Just Process Data — They Learn to Listen</h3><p>The deeper I went, the more human the system began to feel.</p><p>Each plot, each probability curve, each scalp map weren’t just data.</p><p>They were glimpses of cognition itself.</p><p>When the model got something right, it wasn’t because it “guessed” correctly. It was because it had learned to listen, to recognize the subtle neural whisper of someone imagining a hand movement.</p><p>That realization felt almost poetic:</p><blockquote>A machine learned to understand the intention behind thought, not because it was told what to hear, but because it learned to listen.</blockquote><p>And in that moment, I started to see what Brain–Computer Interfaces really are:</p><p>not just tools to control machines, but mirrors that reflect how our minds communicate.</p><h3>From Curiosity to Connection</h3><p>I began this project out of curiosity, to see if I could rebuild something complex with nothing but code. But what I found was something far deeper.</p><p>I found proof that our thoughts can be translated.</p><p>That the invisible patterns in our brains can be captured, analyzed, and understood.</p><p>That <em>intention itself </em>can become data.</p><p>And when you think about that, it changes how you see technology.</p><p>Because the next frontier isn’t about making smarter machines, it’s about making more connected humans.</p><h3>The Bigger Picture</h3><p>These experiments showed me that decoding thought isn’t about breaking privacy or replacing people, but it’s about understanding people.</p><p>BCIs have the power to restore communication for those who’ve lost their voice, movement for those who’ve lost control, and independence for those who rely on others to interact with the world.</p><p>But they also raise profound questions:</p><p>What happens when our thoughts can be measured?</p><p>When machines don’t just follow commands, but interpret intentions?</p><p>Will we shape technology, or will technology begin to shape us?</p><p>These questions are what make this field so powerful, but at the same time</p><p><strong>so human</strong>.</p><h3>Visual Results + Reflection</h3><p>After hours of coding, cleaning data, and tweaking parameters, the most rewarding part was seeing actual thought, <strong>visualized</strong>.</p><p>Each graph below tells a small part of the same story: how a computer learned to listen to the human brain.</p><h3>1. CSP + LDA Accuracy per Fold (All Participants)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*9Ek-2wPjlzKDaN2jRYc-aA.png" /><figcaption>Group-Level Cross-Validation</figcaption></figure><p>When trained on data from five different participants, the model achieved an average accuracy of <strong>0.53</strong>, just slightly better than chance.</p><p>At first glance, it might seem unimpressive, but this result reveals something important: decoding thoughts isn’t one-size-fits-all.</p><p>Each brain has its own way of firing, and when those unique signatures overlap, even powerful algorithms struggle to generalize.</p><p>Yet this graph confirmed something crucial, in which the model was consistent. It wasn’t guessing wildly; it was detecting real, subtle patterns across human brains.</p><h3>2. Group-Level ROC Curve (Subjects 1–5)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*6J64UTNo20H_lCbPRW0hAQ.png" /><figcaption>Evaluating Generalizability</figcaption></figure><p>Here, the ROC curve tells a similar story. The diagonal orange line marks random guessing; the blue line hovers just above it with an AUC of 0.511, meaning the model slightly outperformed chance.</p><p>This isn’t failure, it’s realism. EEG data varies immensely from person to person, and this curve highlights why BCIs are often personalized systems.</p><p>The takeaway: general intelligence might be hard, but individual understanding is powerful.</p><h3>3. Cross-Validation Accuracy for Subject 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*L1kc1u0LkDcHtK9GMUc2KQ.png" /><figcaption>The Breakthrough Moment</figcaption></figure><p>This was the turning point.</p><p>When I focused the model on just <strong>one subject</strong>, accuracy jumped to <strong>97.8%</strong>.</p><p>Each dot represents a fold of the data, a different subset the model hadn’t seen before. The solid blue line shows accuracy per fold, and the dashed line marks the mean.</p><p>The lines almost overlap, which means near-perfect consistency.</p><p>The computer wasn’t just making predictions, it was reliably identifying which thought (hand vs. foot) belonged to which brainwave pattern.</p><h3>4. ROC Curve for Subject 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*dLx15_XOGunhceTK3jcXHw.png" /><figcaption>A Perfect Listener</figcaption></figure><p>This curve says everything.</p><p>An <strong>AUC of 1.000</strong> means flawless separation which is the model could distinguish between imagined hand and foot movements every single time.</p><p>In practical terms, this means that if this system were connected to a cursor or robotic limb, it would respond correctly to every intention.</p><p>A perfect conversation between mind and machine.</p><h3>5. Confusion Matrix (Subject 1)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*WJ1724B_D3hsWa6t9iRX_A.png" /><figcaption>Every Decision, Visualized</figcaption></figure><p>Each square represents the model’s choices: true “hand” vs. “foot” thoughts along the diagonal, mistakes off to the sides.</p><p>Almost the entire plot is dark blue on the diagonal which means nearly every prediction was correct.</p><p>Only one misclassification out of about 45 trials.</p><p>For a system made entirely of code, no electrodes on my head, and public data from the internet, this was a huge moment.</p><h3>6. Predicted Probability Histogram (P(feet))</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*Guv31cEN9WNuB5OLAS8GmQ.png" /><figcaption>How Confident the Model Was</figcaption></figure><p>This histogram shows the model’s confidence for each prediction.</p><p>The blue bars (hand imagery) cluster tightly near <strong>0</strong>, and the orange bars (foot imagery) near <strong>1</strong> which meant the classifier wasn’t guessing. It was certain.</p><p>A perfect BCI doesn’t just need accuracy; it needs confidence.</p><p>Here, the model wasn’t just right</p><p>It was sure it was right.</p><p><strong>7. CSP Spatial Filters (CSP0–CSP7)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0I0vDo_ISXQ7c6ItcV65Ew.png" /><figcaption>Where the Brain Speaks Loudest</figcaption></figure><p>Each circle above represents a “top-down” view of the scalp.</p><p>The red and blue regions show where brain activity differed most between hand and foot imagination centered around the <strong>sensorimotor cortex</strong>, the region that controls movement.</p><p>What’s fascinating is that the model found this pattern on its own.</p><p>Without being told anything about neuroscience, it focused on the same areas neuroscientists would.</p><p>That’s not just machine learning</p><p>that’s discovery.</p><h3>What These Visuals Mean</h3><p>Together, these figures tell a clear story:</p><ul><li>Across people, thought decoding is hard.</li><li>Within one person, it’s nearly perfect.</li><li>And the regions the model focused on align with real motor control areas of the brain.</li></ul><p>That’s the moment where science meets soul, where data starts to look like consciousness.</p><p>Seeing these results made me realize something bigger: we’re not teaching computers to think; we’re teaching them to <em>understand thinking</em>.</p><p>And that’s far more powerful.</p><h3>Conclusion — Where Thought Meets Code</h3><p>This project started as a challenge: could I rebuild a Brain–Computer Interface using nothing but open data and code?</p><p>But what I found was much more personal.</p><p>When I saw the model correctly recognize imagined movements (hand or foot) I realized I wasn’t just teaching a computer to read data.</p><p>I was teaching it to understand intention.</p><p>That’s what BCIs represent. They aren’t just about mind control or assistive technology.</p><p>They’re about connection in all aspects. Between humans and machines, between neurons and numbers, between what we think and what we can create.</p><p>And that connection forces a bigger question:</p><p>What happens when technology begins to understand not just what we do, but why we do it?</p><p>Because that’s where we’re headed,</p><p>A future where thought becomes an interface.</p><p>Where “typing” might mean thinking, and where emotion could influence how machines respond.</p><p>It’s beautiful and terrifying at the same time.</p><h3>What’s Next — The Future of Decoding Memory</h3><p>My next goal is to push this further:</p><p>Can we move from decoding movement to <strong>decoding memory</strong>?</p><p>Imagine a model that detects whether a memory is being formed, recalled, or forgotten. Not by reading behavior, but directly through brain signals.</p><p>That could change how we understand Alzheimer’s, learning, or even the idea of forgetting itself.</p><p>It’s ambitious, but that’s the point.</p><p>The more we explore these systems, the more we realize that consciousness isn’t just something we experience but something we can begin to map.</p><blockquote>“Progress is good, and the patient seems to have made a full recovery, with no ill effects that we are aware of. Patient is able to move a mouse around the screen by just thinking.”</blockquote><blockquote>— Elon Musk, on Neuralink’s first human trial</blockquote><p>That quote stuck with me.</p><p>Because what once sounded like science fiction is now science fact.</p><p>And projects like this, even small replicates, are glimpses into that reality.</p><h3>Final Reflection</h3><p>I didn’t need a neuroscience lab or a million-dollar grant.</p><p>I just needed curiosity, a dataset, and a notebook full of code.</p><p>And that’s what makes this field so exciting. Soon, we will have the ability to explore the human mind with nothing but open-source tools and imagination.</p><p>Every dataset holds a whisper of consciousness waiting to be decoded.</p><p>We’re living in a time where anyone can experiment with the edges of the brain itself.</p><p>And maybe that’s the most powerful part —</p><p>Not that machines can read our thoughts, but that <em>we can finally learn to read ourselves.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c79c8a3d5d54" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How BCIs Might Restore Lost Memories in Alzheimer’s Patients]]></title>
            <link>https://medium.com/@kaibundy/how-bcis-might-restore-lost-memories-in-alzheimers-patients-a274e5c17fe0?source=rss-704788b6a304------2</link>
            <guid isPermaLink="false">https://medium.com/p/a274e5c17fe0</guid>
            <category><![CDATA[alzheimers]]></category>
            <category><![CDATA[future-technology]]></category>
            <category><![CDATA[memories]]></category>
            <category><![CDATA[brain-computer-interface]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Kai Bundy]]></dc:creator>
            <pubDate>Thu, 09 Oct 2025 22:51:51 GMT</pubDate>
            <atom:updated>2025-10-09T22:51:51.150Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>From Brainwaves to Memories: How BCIs Could Help Alzheimer’s Patients Reconnect with Their Past</em></h4><p>Congratulations.</p><p><strong>If you’re reading this, you’re one step away from changing the world.</strong></p><p>Big claim, I know. But let’s sit with that for a moment.</p><p>Imagine waking up tomorrow and not recognizing the face of someone you love. Not because you’ve lost interest or because they’ve changed, but because your brain simply can’t hold on to who they are anymore.</p><p>That’s Alzheimer’s.</p><p>It’s not just a disease, but a <strong>thief</strong>. It sneaks into the brain and robs people of birthdays, stories, names, and even pieces of their personality. Everything that was once important to you begins to slip away as if it was never there. What begins as a misplaced wallet or a forgotten appointment becomes something far more devastating: a loved one becoming a stranger, a lifetime of memories dissolving into static.</p><p>According to the <strong>World Health Organization</strong>, more than <strong>57 million people</strong> worldwide are living with dementia — and <strong>around 60 to 70 percent</strong> of them have Alzheimer’s disease. Every <strong>three seconds</strong>, another case is diagnosed somewhere in the world. <a href="https://www.who.int/health-topics/dementia?utm_source=chatgpt.com#tab=tab_2"><em>Read article here.</em></a></p><p>And here’s the cruelest part — we can’t stop it.</p><p>Current treatments? They buy time. A few months here, a slowed decline there. But nothing on the market today can hand someone back their memories once they’re gone. Families sit by helplessly, watching their loved ones fade, and science has had to shrug and say: <em>this is the best we can do.</em></p><p><strong>But maybe not for long.</strong></p><p>Because there’s a technology quietly developing in labs and research hospitals that could change everything. A technology that sounds like something ripped from science fiction — but is very real.</p><p><strong>Think of it as a bridge between neurons and machines — a way for the brain to speak directly to computers.</strong> These are called <strong>Brain-Computer Interfaces (BCIs)</strong>, and they may become one of the most transformative tools in neuroscience.</p><p>If Alzheimer’s turns the mind into an orchestra out of sync, BCIs could become the conductor that brings it back into harmony. If memories are like fragile files without a save button, BCIs might one day act as the external drive that keeps them safe.</p><p>They won’t solve everything, and they won’t do it tomorrow — but they might finally offer us a way to fight back against the memory thief.</p><p>And that’s where our story begins.</p><h3>Stories That Show What’s Possible</h3><p>Behind every electrode, every headset, and every algorithm, there are people whose lives have been transformed by Brain-Computer Interfaces. Their stories remind us that this technology isn’t just about machines — it’s about restoring humanity.</p><p>Take <strong>Jan Scheuermann</strong>, paralyzed from the neck down after developing a degenerative disease. In 2012, she joined the <strong>BrainGate project</strong> at the University of Pittsburgh. Electrodes implanted in her motor cortex translated her brain activity into movement commands for a robotic arm. At first, she could only move it in simple directions. But over time, she gained remarkable control.</p><p>In one famous moment, she reached for a chocolate bar and fed herself — a small act for most of us, but for Jan, a moment of independence she thought she’d lost forever. Researchers described it as one of the first times thought was translated directly into action with such fluidity.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FWV0bJkk86pw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DWV0bJkk86pw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FWV0bJkk86pw%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/589c105fe78c44e2be9f1e223ce7ea27/href">https://medium.com/media/589c105fe78c44e2be9f1e223ce7ea27/href</a></iframe><p>Then there are the patients in <strong>Synchron’s clinical trials</strong>, using the company’s <strong>Stentrode</strong> device. Unlike traditional BCIs that require open-brain surgery, the Stentrode is implanted through blood vessels, reducing risk and recovery time. Once in place, it interfaces with motor signals and transmits them wirelessly. People living with <em>amyotrophic lateral sclerosis </em>(ALS), who had lost the ability to type or speak, were suddenly able to send emails, compose text messages, and even scroll social media — all with thought alone. In 2022, Synchron became the first company to implant its device in U.S. patients under FDA approval, marking a major step toward real-world accessibility. <a href="https://www.clinicaltrialsarena.com/news/synchron-bci-clinical-trial/?cf-view">Clinical Trials Arena, 2022</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*gRZGYXCQ18nAtP8sZqoUDA.jpeg" /><figcaption>Synchron’s “Stentrode” BCI implant records brain signals from a blood vessel and transmits them wirelessly, enabling patients to control devices like prosthetics or computers.</figcaption></figure><p>Or consider <strong>Nathan Copeland</strong>, who became quadriplegic after a car accident in 2004. With an implant from <strong>Blackrock Neurotech</strong>, Nathan not only controls a robotic arm with his thoughts, but also regains the <em>feeling</em> of touch. Through direct electrical stimulation of his sensory cortex, he described feeling pressure and texture in his fingers again. For the first time in over a decade, he touched fingers with someone and described the sensation as “natural.” This was more than a technical achievement — it showed that BCIs can restore not just motion, but connection.</p><p>If we can manipulate the <strong>sensory cortex</strong> to restore touch, then why couldn’t the same principle apply to the <em>feelings</em> tied to memory — nostalgia, joy, even comfort?</p><p>Think about it: a memory isn’t just information stored in the hippocampus. It’s multisensory. The smell of your grandmother’s cooking, the sound of a favourite song, the warmth of a hug — these aren’t “facts,” they’re feelings encoded through sensory circuits spread across the brain.</p><p>BCIs have already shown they can <strong>recreate touch</strong> in Nathan Copeland’s fingers by stimulating his sensory cortex. That opens a provocative possibility: could similar stimulation bring back the <em>emotional tones</em> of a memory? Imagine an Alzheimer’s patient seeing a family photo. A BCI might not only help them recognize the face but also reactivate the warm surge of nostalgia that used to accompany it.</p><p>This is where the frontier really blurs. We’re not just talking about <em>storing data</em> like a hard drive. We’re talking about restoring <em>lived experience</em> — the texture, the emotion, the humanity that makes a memory feel real.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FEZRidin6wZY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DEZRidin6wZY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FEZRidin6wZY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/76fc2f3cd070ff625208212f4680dc48/href">https://medium.com/media/76fc2f3cd070ff625208212f4680dc48/href</a></iframe><p>Other stories echo this theme, showing that BCIs are not just about movement or communication — they can also target the very circuits that make memory possible. One of the most ambitious efforts came from DARPA’s <strong>Restoring Active Memory (RAM)</strong> program, which set out to help U.S. veterans with traumatic brain injuries. Researchers implanted arrays of electrodes directly into the hippocampus, the brain’s key hub for encoding short-term memories into long-term storage. <a href="https://www.darpa.mil/research/programs/restoring-active-memory">Link to DARPA Article — RAM: Restoring Active Memory</a></p><p>The approach was <em>closed-loop</em>: the BCI monitored the patient’s brain activity in real time and delivered precisely timed electrical pulses at moments when memory encoding was most likely to occur. Think of it like a conductor stepping in at just the right beat to keep the orchestra in rhythm. The results were striking. In controlled trials, participants improved their memory recall by up to <strong>37%</strong> — a significant leap compared to baseline performance. (Source: Hampson et al., Journal of Neural Engineering, 2018 — <a href="https://iopscience.iop.org/article/10.1088/1741-2552/aaaed7">Read the study here</a>)</p><p>While these were not Alzheimer’s patients, the implications are hard to ignore. The hippocampus is one of the first regions devastated by Alzheimer’s pathology. If we can use stimulation to reinforce memory encoding in brains injured by trauma, why couldn’t similar techniques help compensate for the disrupted circuits in neurodegenerative disease?</p><p>It reframes the entire conversation. We’re no longer just asking how to slow Alzheimer’s down — we’re asking if it’s possible to rebuild what’s been lost. If BCIs can enhance memory in one damaged brain, they might one day restore fragments of identity in another.</p><p>Each story is a glimpse of what’s possible. BCIs aren’t distant science fiction — they are already functioning in clinical trials, giving people back fragments of what disease or injury has taken away.</p><p>For someone like Jan Scheuermann, that fragment was the ability to feed herself chocolate. For Nathan Copeland, it was the sensation of touch after more than a decade of absence. For Synchron’s ALS patients, it was the power to send a message to a loved one with nothing but thought. These may look like small victories from the outside, but for the individuals living them, they represent a return of independence, dignity, and humanity.</p><p>And this is where the story takes its most profound turn.</p><p>If BCIs can restore movement, sensation, and communication — abilities once considered permanently lost — then why not memory? The same electrodes that help decode a motor command can also listen to the rhythms of the hippocampus.</p><p>The same stimulation that creates the feeling of a hand being pressed can also reinforce a fragile neural connection tied to a cherished memory.</p><p>This is no longer just about helping people move a robotic arm or type an email. It’s about confronting one of the greatest medical and human challenges of our time: Alzheimer’s disease.</p><p>Because if technology can preserve the moments that define who we are, then BCIs don’t just promise better medical outcomes — they promise a way to hold onto identity itself.</p><h3>Why Current Treatments Aren’t Enough</h3><p>If BCIs represent the future, it’s worth asking: what about the present? What do we really have for Alzheimer’s — and why isn’t it enough?</p><p>The biology of Alzheimer’s is brutal.<br>It begins with <strong>amyloid-β plaques</strong> — sticky protein fragments that clump between neurons, cutting off communication. Inside the cells, <strong>tau tangles</strong> twist into knots that choke them from within. Over time, neurons die, the brain shrinks, and one of the first regions to suffer is the <strong>hippocampus</strong> — the brain’s memory hub.</p><p>As these structures break down, the brain’s natural “rhythms” — <strong>theta waves</strong> (which help encode memories) and <strong>gamma waves</strong> (which help integrate and recall them) — fall out of sync.<br>It’s like an orchestra trying to play without its conductor: the notes are there, but the music dissolves into noise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*RJrp4wghkvtEMFrB_3OROw.jpeg" /><figcaption><em>Healthy neurons (left) compared to Alzheimer’s-affected neurons (right).</em><br><em>Notice the buildup of amyloid-β plaques outside the cells and tau tangles inside. These changes disrupt communication and eventually cause neuron death, especially in the hippocampus.</em></figcaption></figure><p>So what’s on the market today?<br>A handful of drugs — <strong>Lecanemab</strong> and <strong>Donanemab</strong> — both designed to clear amyloid plaques. They’re given through IV infusions and can <strong>slow cognitive decline by about 27%</strong> in early-stage patients. Another line of therapy targets tau tangles, though most of those trials remain experimental.</p><p>On paper, these drugs sound promising. In reality, the improvements are modest — maybe a few extra months of clearer thinking. And the side effects are serious: <strong>brain swelling, microbleeds, and immune reactions</strong> that can be life-threatening.</p><p>These aren’t cures.<br>At best, they buy time.</p><p>Across decades of research, Alzheimer’s drugs have fallen into three categories:<br>• Removing toxic proteins<br>• Protecting neurons<br>• Attempting to restore function</p><p>And yet, despite billions invested, <strong>none have rebuilt a single lost memory network.</strong></p><p>That’s the cruel truth of Alzheimer’s care today: once memories are gone, they’re gone.<br>Families watch loved ones fade away, knowing the treatments can only delay — not reverse — the decline.</p><p>Doctors can’t press a reset button. Therapies that clear plaques or slow tangles don’t rebuild lost connections — they just try to stop more from breaking.</p><p>And that’s why <strong>the status quo sucks.</strong><br>Because for millions of people, “slowing decline” isn’t enough.</p><p>The question isn’t just <em>how do we delay the thief?</em></p><p>It’s <strong><em>how do we take back what’s already been stolen?</em></strong></p><h3>How BCIs Could Transform Memory Restoration</h3><p>If today’s drugs can only slow decline, then BCIs point to something far more radical: <strong>the chance to rebuild what’s already been lost.</strong></p><p>So how does this actually work?</p><p>At its core, a brain-computer interface is a <strong>translator</strong> — a bridge between the biological and the digital. It listens to the electrical whispers of neurons and converts those patterns into digital signals that machines can understand.</p><p>There are two main ways to capture those signals, and each carries its own tradeoff.</p><p><strong>Non-invasive devices</strong>, like EEG headsets, sit on the scalp and record the brain’s rhythms. They’re safe, easy to use, and already helping researchers track cognition — but their readings are fuzzy, like trying to pick out a single instrument in a stadium concert from the parking lot.</p><p><strong>Invasive BCIs</strong>, like the Utah Array or Neuralink’s ultra-thin threads, go directly into brain tissue. They hear every note with incredible precision, but at the cost of surgery, scarring, and questions about long-term safety.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*kcXMFZLa2CfbOblbLhB2fg.png" /><figcaption>Different types of BCIs: non-invasive methods like EEG and TMS record brain activity from outside the skull, while invasive methods such as ECoG and implanted electrodes capture signals directly from the brain for higher accuracy.</figcaption></figure><p>The remarkable part? <strong>Both are already producing results.</strong></p><p>In DARPA’s <em>Restoring Active Memory (RAM)</em> program, veterans with traumatic brain injuries received closed-loop hippocampal stimulation — their recall improved by up to <strong>35%</strong>, a leap no drug has ever achieved. Meanwhile, EEG-based systems have identified Alzheimer’s biomarkers with <strong>86% accuracy</strong>, often before symptoms appear.</p><p>In other words: BCIs might not just <strong>restore memory</strong>, but also <strong>detect its decline</strong> early enough to intervene.</p><p>And it’s not just research labs. Companies like <strong>Neuralink</strong> are pushing this into the public spotlight. After the company’s first successful human implant, Elon Musk announced:</p><blockquote><em>“Progress is good, and the patient seems to have made a full recovery, with no ill effects that we are aware of. Patient is able to move a mouse around the screen by just thinking.” — Elon Musk</em></blockquote><p>That’s not science fiction —<strong> that’s happening now.</strong></p><p>Put these threads together, and a new future begins to take shape:</p><ul><li><strong>EEG + AI</strong> detecting the earliest cracks in memory.</li><li><strong>Closed-loop implants</strong> reinforcing memory encoding in real time.</li><li><strong>Hippocampal stimulation</strong> resynchronizing disrupted neural “music.”</li></ul><p>Now, imagine feeding hippocampal activity into a machine learning model that learns the <strong>neural fingerprint of your memories</strong>. Later, when disease erodes those circuits, the model could help “replay” those same patterns back into the brain — not just sparking recognition, but reviving the <em>emotion</em> that comes with it.</p><p>If we can restore <strong>touch</strong> for someone paralyzed, why not the <strong>nostalgia of a song</strong>, or the <strong>warmth of recognizing a familiar face</strong>?</p><p>Of course, the road ahead isn’t simple.<br>Non-invasive devices still struggle with signal noise.<br>Implants risk scarring that dulls their precision over time.<br>Every brain is unique — meaning BCIs must be tuned like <strong>custom instruments</strong>, not off-the-shelf tools.</p><p>And then there’s the ethical frontier: if an AI can reconstruct your memories… who owns them? You? The doctor? The company building the device? What happens when memories can not only be restored — but rewritten?</p><p>Even with those challenges, the trajectory is clear.<br>Prosthetic limbs once began as wooden pegs. Today, they feel and move like part of the human body.</p><p>Memory prosthetics may start rough, but they will evolve — and one day, they may not just preserve data, but <strong>restore the essence of who we are.</strong></p><p>And maybe, when that happens, someone with Alzheimer’s will look into the eyes of a loved one — and instead of confusion, there will be recognition.</p><p>And a smile.</p><h3>Toward a Future Where We Remember</h3><p>Alzheimer’s is often called a thief — one that steals names, stories, and faces from the people we love. For decades, we’ve fought only to slow its progress, never to take back what it stole.</p><p>But brain-computer interfaces are changing that story. They remind us that memories aren’t gone — just hidden, waiting behind broken circuits for a way home.</p><p>Jan Scheuermann feeding herself again.<br>Nathan Copeland feeling the texture of touch.<br>Veterans in DARPA’s <em>Restoring Active Memory</em> program recalling with <strong>37% more clarity</strong>.</p><p>Each of them is living proof that restoration isn’t just possible — it’s already beginning.</p><p>As AI learns to decode the fingerprints of thought, the future of BCIs is shifting from restoring movement to restoring <em>meaning.</em> It’s not about delaying decline anymore — it’s about rebuilding what was lost, neuron by neuron, moment by moment.</p><p>And here’s what I believe:</p><p><strong>The first successful BCI memory restoration won’t revive decades-old memories — it will rebuild short-term, episodic ones.</strong><br>Moments like recognizing a face. Remembering a name. Feeling the warmth of a familiar place. These are the first sparks of identity that technology will help bring back.</p><p>And maybe one day, when someone living with Alzheimer’s looks into the eyes of the person they love, something will light up.<br>A flicker of recognition. A moment of connection. A return.</p><p>When that day comes, we’ll know we didn’t just treat memory loss — <strong>we engineered a way to remember again.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a274e5c17fe0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>