Ultra EEG
Timespan: August 2024
Published: 2024-12-26
Hi! This post is gonna describe the Ultrasound+EEG project I worked on as part of Brain Hack 2 hosted by Marley and Raffi
My first circuit board measured the electrical signals thrown off by muscles as they tense and flex, amplifying a small voltage on the surface of the bicep 10,000x so I could see it on the oscilloscope, a quantification of my body working as it had for many years. This marked the beginning of my exploration into biosignals and what we could communicate to a computer through our movements.
Later I moved to EEG because I thought it would be cool to think and have my computer pull up information for me. Brain signals are 10-100x smaller in magnitude than muscle signals, and coupling an electrode to the scalp through the hair was way harder than simply sticking 3M red dot electrodes onto the arm. I had a lot of trouble getting useful signal, so I went searching through the literature.
There's many ways to look into the brain without opening it. You can use light (fNIRS, optogenetics), voltages on the scalp (EEG), magnetic fields right outside the head (MEG), magnetic fields inside the brain (fMRI), or many more. But the trouble with all of these is that the brain cannot be touched. It's kinda like that guy who got his cylinder stuck in a M&Ms container but refused any unstucking methods that could damage it — how can you get better signal resolution out of a source that cannot be harmed or isolated or altered without fundamentally ruining the original point to all the sensing? Anyway, from all this I learned that the methods that could exactly see WHEN a cluster of neurons fired (EEG, MEG) were terrible at figuring out where that cluster was, whereas the approaches that were really slow to react (fNIRS, MRI) could tell you exactly where neurons were firing. What a crazy world!
I did read about a technique called lock-in amplification, which claimed to be able to pull nanovolt signals out of the noise floor, but it required the signal to be modulated by some reference signal. Since I couldn't figure out a way to modulate the brain signal inside my head, I tried instead to lock onto the stimulus frequency (a lamp flashing at 10Hz). This technique doesn't work so well at low frequencies, and the brain is not a reliable function generator anyway, so that didn't work. Shortly afterwards I gave up on EEG entirely.
After that project, EEG was completely and totally dead as far as I was concerned — I saw no way to get good signal non-invasively. But 2024 was a magical year. One day in August as I was about to leave San Francisco, a friend (Marley) mentioned a signal processing problem involving EEG they were scoping out, and would I like to come over and think about it together? And what they revealed to me had the potential to become EEG's salvation.
As mentioned before, EEG's resolution could be enhanced by modulating brain waves at a certain frequency, then using a lock-in amplifier to extract the signal. This works just like a car radio — every station is always broadcasting, but your radio decides what frequency to pick up on. The technique goes by many names (lock in amplification, heterodyning, synchronized detection), but basically it lets you pull signals deep, deep in the background noise — all you needed was a way to modulate biosignals.
What Marley and Raffi had found in the literature was an approach to modulate electrical biosignals by physically compressing the tissues the biosignals passed through using focused ultrasound energy. It's called the acousto-electric effect, or AE; by applying ~1MPa of pressure, tissues would typically change resistitivity by ~0.1%, allowing us to use the ultrasonic signal as the modulator for locking onto EEG waves. This wasn't even a theoretical technique — it had been done on the heart to image cardiac currents (In vivo acoustoelectric imaging for high-resolution visualization of cardiac electric spatiotemporal dynamics).
Not only did this give us a method for higher-resolution EEG, it also meant we could read a much denser resolution of EEG. Since ultrasound can be focused down to a tiny \(<1mm^3\)spot, if we stimulated just one section of the brain we would be able to decode the activity from just that part. Spatial resolution of focused ultrasound and the time resolution of EEG — I was hooked.
We did the math on a whiteboard. 0.1% change in resistivity on top of a ~10-100uV neural signal means we would be hunting for a 10-100nV signal hidden within the typically ~1-3 V raw amplified EEG signal. Totally possible with the lock-in! I moved my flight by a week and joined their quest.
Our hackers were situated in a beautiful house in Mill Valley, half an hour north of SF in a quaint old house with a painting of the OG homebuilder. We turned it into a lab as soon as we got there. The TV stand became the 3D printer table, the big dining table was claimed by team skull, and the living room table became the dominion of team AE.
Closets were filled with deionized water, and a huge pot was constantly being boiled and cooled in order to produce degased water, a required medium for the ultrasonic transducer to not blow up. Every day Amazon packages arrived, bottlenecks lifted, and the team would make progress until we could no more. It felt like a skunkworks. It was heavenly.
I think most "science" is pretty straightforward engineering. Get it working in ideal settings, then replace ideal components with non-ideal ones, one at a time.
First we tested all the equipment. Does the lock-in report a tiny attenuated signal when we divide the function gen output by a million? Does the ultrasonic transducer work, and does the ultrasonic mic pick it up?
Once all the components are working we started on the real thing. Here were our rough milestones:
We made it to step 4.
I didn't keep good notes on the process, and now it is several months after the hack. All I have remaining are the struggles that we overcame and the lessons we learned. In no intentional order:
I used to be extremely stubborn, wanting to be the one to choose a project that I decided was important. This year I've worked on three large projects (PoS, this, Open Quantum), each showing me that it was actually more important that I loved the people I worked with. If I love waking up and going in, then I could do anything. So even with that knowledge, I'm blessed that this project team contained only amazing people and still could've been a project I'd chosen myself.
External EEG seemed so impossible for many years, and now I have hope. That too is a magical thing.
And finally, working on this a) hard/nearly impossible problem with b) minimal resource constraints, c) a team of competent, fun people under a d) tight timeline has been a peak experience in my life. If you have a similar problem which fulfills at least a, c, and d and needs some help on the prototyping/research/EE/signals/ML/CV/problem solving/thinking/minimum viable solution side, I am your man and would love to join. Please reach out!