Jump to content

Welcome to FutureTimeline.forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!

No... it's not EEG (and other observations about the physics of BCIs)

  • Please log in to reply
5 replies to this topic




  • Members
  • PipPipPipPipPipPipPipPip
  • 1,960 posts

I decided to make a thread about the physics of BCIs, where I will join together a lot of information about EEG, MEG, FMRI, FNIRS, OCT, and other brain scanning modalities.  I am not an expert on this; but I work in an adjacent field, and am closer to being an expert than most people on this forum.  I thought I would begin with a leisurely stroll through EEG, and in particular discuss its limitations.  Some of this will be necessarily technical, but I will keep it at an "undergraduate level". In the post after that, I will write about FMRI, which is a fascinating technology, if you've never studied it.

Alright... now before I get to a technical intro on EEG, let me mention an amusing anecdote:


Several years ago, one often heard the apocryphal tale of the "invisible ships" manned by European explorers that first explored the "New World":


When Captain Cook/Columbus/Magellan (depending on the version of the story you're hearing) arrived at the coast of Australia/Cuba/South America, the native people completely ignored them, presumably because huge ships were so alien to their experience that "... their highly filtered perceptions couldn't register what was happening, and they literally failed to 'see' the ships." (Quoting here from JZ Knight's What the Bleep Do We Know?)

Myth it turns out to be; but there is something very similar that seems to be going on with BCIs -- and in this case, it isn't a myth! The story goes as follows: any time you mention a new BCI device that isn't EEG, people instantly criticize EEG, thinking that you are hyping EEG. If you try to repeat to them that you're not talking about EEG, they will criticize EEG some more. They might even add a little snark, angry that you don't get how bad EEG is. It might go something like this:

You: This new BCI is amazing! And it uses Magnetoencephalography (MEG), which is better than ordinary EEG.

Them: EEG engineer here. I got my master's degree in brain-scanning technology at the University of Berlin (or wherever). I can tell you that EEG is a really weak / poor brain-scanning technology. We spent months trying to map user motion intention to control a car in VR. You have no idea how difficult it is!

You: Ermmm... But the BCI I'm talking about isn't EEG. It's something much better. It's a MEG scanner.

Them: Look, I've worked with EEG for 10 years. And you better believe it's nowhere near to fantasy stories you see on the Futurology Reddit.

And so you leave, unable to penetrate. The person only has one category of non-invasive, wearable BCI in mind; and so immediately pigeonholes anything new into being EEG.

In my next post, I will write about the limitations of EEG...




  • Members
  • PipPipPipPipPipPipPipPip
  • 1,960 posts

This is a little note about something you may find interesting:  assuming you can sample the brain using 129 low-noise (but not zero-noise) channels, you can recover pretty much all the electric potential signal that is recoverable on the surface of the skull -- adding more channels will not give you anything more.  
The idea here is related (though you don't actually need to invoke it, since we are working with discrete spectra) to the Shannon-Nyquist Sampling Theorem:
The way Shannon stated it:


If a function x(t) contains no frequencies higher than B hertz, it is completely determined by giving its ordinates at a series of points spaced 1/2B seconds apart.

Let's back up a little bit first and talk about:
Fourier Spectra
If you have a signal x(t) -- where, here, t represents time; so, you stick in a time-value t into some function x, and you will get a signal x(t) at time t -- you can break that signal down into a weighted average (a "superposition") of more elementary sine waves -- just like how you can break down light into primary colors.  Here is a little educational video showing what the approximation looks like for a square-wave, as you add more and more sine waves and higher and higher frequency together to approximate it:
In that example, the spectra is "discrete".  The sines used have period 2 Pi / k, for some positive integer k.  
If you were to use a non-periodic function on the whole real line (the square-wave is, in contrast, periodic over the whole line), you could use a continuous spectra to represent it.  This is slightly tricky to talk about, and involves the use of the Fourier Transform and Fourier Inversion integrals; but we don't really need it for what we'll talk about, so I'll not bother.
The next thing I want to talk about is:
What are you actually measuring at each electrode on the scalp?  As I said, you are measuring electric potentials, which are voltages... single numbers.  They aren't "vectors".  
That word "potential" gets used a lot in physics.  For example, you can talk about the "gravitational potential field" for our solar system.  At each point in the solar system, it will return a number, not a vector.   If you look at all points that have the same potential (choose one particular potential to work with), you get what is called a "potential isosurface".  And then if you take the normal vector at each point, you get a "gradient field"; and using that, you can calculate a "force field", which is a vector field of the force vectors at each point.  But that's not necessary for what we want to talk about...
Returning to Shannon's statement of the theorem:

If a function x(t) contains no frequencies higher than B hertz, it is completely determined by giving its ordinates at a series of points spaced 1/2B seconds apart.

Being "completely determined" here implies you don't gain anything by sampling the signal more densely -- that is, if you can sample the signal at 
t = 0 seconds, 1/2B seconds, 2/2B seconds, 3/2B seconds, etc.
then you can completely determine the signal x(t) at all the other time points -- e.g. at time t = 1/3B seconds or Pi = 3.141592 seconds, even.  
And signals with no high-frequency components -- or extremely weak high-frequency components -- are common.  "Low-pass filters" produce these for you (often, high-frequency information contributes heavily to "noise"; hence giving a reason to screen it out):


A low-pass filter (LPF) is a filter that passes signals with a frequency lower than a selected cutoff frequency and attenuates signals with frequencies higher than the cutoff frequency.

And according to this paper, the human skull acts kind of like a low-pass filter:
But it's not a filter in time; it's a filter in space:  the electric potential on the surface of the skull doesn't have much high-spatial-frequency information.  In other words, if you try to expand this signal into its spherical harmonics components (a spherical analog of the sine waves you see in Fourier series expansions)
you will find that the signal is extremely attenuated on high frequencies by the skull.  See figure 4 from that paper above:
The attenuation is so extreme, in fact, that you can recover most all the relevant spherical harmonics coefficients in the series expansion of the electric potential on the skull, by measuring it at just 129 sites.  Thus, increasing the number of channels to 150, 200, 400, etc. shouldn't buy you much additional information -- just like how in Shannon's original work you don't need to sample a signal x(t) any more densely than at equally-spaced times 1/2B apart.
Of course the skull doesn't completely screen out high frequencies.  Couldn't we just measure those components very, very precisely, and pick out the high-spatial-frequency information?
Keep in mind, also, that there is noise in the signal that you receive from the skull; and if this noise is larger than the degree to which the signal is attenuated at a certain frequency, then you are basically s.o.l. (=**** out of luck) when it comes to extracting that higher frequency information.  
As you can see from those diagrams listed above, the attenuation at higher frequencies is so extreme that you'd have to have an extremely accurate EEG device to measure it.  Hence, the reason people say "129 channels is about as good as you can do!"
Discrete versus continuous
You might notice something interesting with the "spherical harmonics" I listed above:  they are discrete in number (can be parameterized by an integer; but are continuous functions), just like the sine waves of period 2 Pi / k that I mentioned in the beginning of this post.  But there's nothing "periodic" here.  Why aren't we using "continuous spectra"?  
Well... it turns out that a sphere is a closed and bounded set, so is like a closed interval, such as [0,1]; and all the action of periodic functions is happening in a closed interval like that -- it just gets repeated over and over.  So, periodic functions and functions on spheres are kind of analogous, and you should expect discrete spectra is the right thing to use.

It's really just linear algebra

I've made a big fuss about Shannon-Nyquist; but, actually, if we are working with band-limited, discrete spectra, it just boils down to a linear algebra problem: you want to write the signal as a linear combination of a finite number of spherical harmonics. If there are n such coefficients (and n such spherical harmonics functions), then sampling at n points will give you a system of n equations in n unknowns with which to use to find those coefficients. And adding an extra point, giving you n+1 equations in n unknowns doesn't help you any, unless there is some linear dependency in those first n equations. That's kind of like what Shannon-Nyquist is saying.




  • Members
  • PipPipPipPipPipPipPip
  • 1,087 posts

I think it is some what expected, though a bit disappointing when people reject new things based off old thing. Everyone has their own bias. Ironically, someone who is an expert in say EEG is probably more likely to compare it to EEG because that is where their knowledge lies. Someone who has no knowledge what so ever about what these technologies are, are probably more likely to look at them objectively. There is some downside to that, since people who know absolutely nothing about something is also likely to just believe anything they are told as well. Which is good if they have a credible source giving them information but not so good if the source isn't so good.




  • Members
  • PipPipPipPipPip
  • 294 posts

So bias is the mind's skull , extremely attenuating frequencies , needing a different signal to bypass it ?




  • Members
  • PipPipPipPip
  • 187 posts

I think it is some what expected, though a bit disappointing when people reject new things based off old thing. Everyone has their own bias. Ironically, someone who is an expert in say EEG is probably more likely to compare it to EEG because that is where their knowledge lies. Someone who has no knowledge what so ever about what these technologies are, are probably more likely to look at them objectively. There is some downside to that, since people who know absolutely nothing about something is also likely to just believe anything they are told as well. Which is good if they have a credible source giving them information but not so good if the source isn't so good.

That's why conspiracy theorists grow in numbers. They find bad sources of information and believe them.




  • Members
  • PipPipPipPipPipPipPipPip
  • 1,960 posts

Alright. Here is a post on the physics of FMRI. There's a lot about it that I don't yet understand fully; but I understand enough to write an introductory post to get people started, which is what this is:

First, here are a few resources: a Khan Academy piece:


A better description:

https://casemed.case.../MRI Basics.htm

A nice YouTube video:

The best source is this one, though it, too, is incomplete:


Another good source:


The basic idea is: you use a powerful magnet to project a static magnetic field into the body. Protons in water and other molecules align themselves with this magnetic field; and based on how quickly they align or un-align or change their collective magnetic properties, you can determine the relative concentrations of certain molecules in regions of the brain.

Now lets look a little more deeply. The first thing I want to talk about is the concept of spin:

The spin of protons

Spinning charges give rise to a magnetic field; and since protons are charged and spin, they are magnetic. Well... that's not quite right, since electrons and protons don't "spin" or "rotate"; but it's true that they are magnetic. They do, however, have an observable quantity called spin, which is referred to as "intrinsic angular momentum"; it's an irreducible property of certain particles, like charge or mass.

Let's look a little more closely. If you were to measure the spin of a proton along some axis, what would you expect to find, if it behaved like angular momentum? You'd expect that it would take on a continuum of possible values. However, it turns out that spin is quantized, and in the case of protons, it is assigned the values +1/2 and -1/2 (let's not worry about units or anything like that for this discussion), and cannot be anything in-between!

Now, how would that discrete / quantized nature of spin be reflected in experiments? Consider this: suppose you send a stream of electrons towards a gap separated by two bar magnets, where one has its north pole facing the gap, and the other has its south pole facing the gap. Each electron will get deflected towards one or other of the two magnets, being magnetic. If you try to measure the "spin" or strength of this deflection along the axis between the two magnets, you will see that the degree to which it is deflected up when it moves up, and the degree to which it is deflected down when it moves down, is always the same; and that fits with what I said about spin being quantized. See the second image in this piece:

http://electron6.phy...dule 3/spin.htm

But what if you rotate the magnets, to measure the spin along different axes? Then, you will still see spin +1/2 and -1/2 for those axes, just like the other one!

Let's say, moreover, that you knew that the population of electrons all had spin axis the same as the axis from the north-to-south poles in the two magnets (from one magnet to the other, through the gap); and let's say that 50% of those electrons were spin +1/2 and 50% were spin -1/2, along that axis. Then, when you measure their spin using deflection, you will get 50% deflected up and 50% deflected down.  Let's say we had a bunch of electrons, all with spin +1/2 for that axis and direction.  And, now, if you change the axis for the magnets, but keep the spin axes of the electrons the same, what you will discover is that when you measure the spin along the new axis, the probability of getting +1/2 versus -1/2 will no longer be 100% for +1/2 -- it'll be something else. See @holographer's answer here:


Now, you might think: if we measure the spin along one axis, and find that it's +1/2, doesn't that tell us what the spin should be along any other axis (except ones 90-degrees away)? The answer is "no". Each time you make a measurement, you change the spin properties of the particle. To explain this requires getting into some quantum mechanics, which would make this post too long; however, see the last couple paragraphs of this post I listed above:

http://electron6.phy...dule 3/spin.htm

The basic idea is this: "observables" in quantum physics, like momentum, position, spin, and other things, have an associated "operator" (in the finite-dimensional case it's just a matrix) that acts on a "Hilbert Space" (a type of vector space equipped with an inner-product; the vector space is used for representing the superposition of states of a quantum system). So... spin -- and more specifically, spin along an axis -- has an associated operator or matrix; and this matrix is going to have eigenvectors, which we call "eigenstates".

When you make the measurement, what you do is you put the system into one of those eigenstates; and this occurs with a certain probability. So, for example, if |+> and |-> (ket notation) are eigenstates representing spin-up and spin-down along a particular axis, and if the particle is in the superposition

a |+> + b |->

(Think of it like a weighting of the states |+> and |->, except that the a and b here can be complex numbers.)

then when you make the measurement, you'll find that the system gets locked into one or other of the pure states |+> and |-> with probabilities |a|^2 and |b|^2, respectively, where a and b are complex numbers satisfying

|a|^2 + |b|^2 = 1.

And, now, if you measure that particle's spin again, from a different axis this time, you'll start by writing it as a mixture of spin-up and spin-down states for that axis; and then when you make the measurement, it collapses into a pure state again. So, maybe you'll write it as:

c |+> + d |->

But, here, if the new axis is close to the being the same as the old axis, then you'll get that the |c|^2 and |d|^2 will each be close to 0 or 1; the further away the new axis is, the closer to being a 1/2 each of |c|^2 and |d|^2 will become.

What do the magnetic fields in an MRI machine look like?

The magnetic field lines are static, and run roughly parallel from head-to-toe or toe-to-head. I had a good image of this to show you, but seem to have lost the link. One reason you might want it to be roughly static is that if the magnetic field varies, it will induce a current in the body, which could be dangerous (depending on the rate of variation and the strength of the field). This is basically Faraday's Law, as described by the 3rd of Maxwell's Equations:


These static magnetic field lines impart a torque to the protons in atoms in the brain and body of the person being scanned, especially the protons in water. This causes the spin axes of those protons to align with the magnetic field -- but, again, all you'd be able to actually see changing is the probability of detecting spin-up or spin-down along different axes in a population of protons; you wouldn't see individual protons slowly orient themselves to the field.

Actually, the alignment isn't perfect. They will precess like a spinning gyroscope around the field lines, and precess at a tighter angle, the stronger the field applied:


The rate of precession for hydrogen nuclei (proton) can be determined by the Larmor equation:


Furthermore, protons in different atoms can precess in phase or out-of-phase. The former leads to net magnetization in the XY plane (Z is the head-toe axis). See discussion in this video:

Also, some nuclei, in some molecules, take longer than others to orient themselves to the static magnetic field; and precess at different rates, depending on the electrical and magnetic properties of the molecule they are contained in.

Application of an RF pulse, T1 and T2

RF pulses are applied to the aligned protons, and this disrupts their orientation briefly, after which they begin to realign with the field. There are two times associated to this process: T1 and T2:

https://casemed.case.../MRI Basics.htm

Tissue can be characterized by two different relaxation times – T1 and T2. T1 (longitudinal relaxation time) is the time constant which determines the rate at which excited protons return to equilibrium. It is a measure of the time taken for spinning protons to realign with the external magnetic field. T2 (transverse relaxation time) is the time constant which determines the rate at which excited protons reach equilibrium or go out of phase with each other. It is a measure of the time taken for spinning protons to lose phase coherence among the nuclei spinning perpendicular to the main field.


Note that not all materials are like protons, which are "paramagnetic" and align with the magnetic field. Some are "diamagnetic", and align perpendicular to it.

Also, remember, the spin is a quantum phenomenon, and so spin axes are not actually "rotating" back to some initial configuration in the way we might think.

How is this measured? How intense are the RF pulses?

Now, as we said, the protons or nuclei can be in a spin-up or spin-down state. One of these will be lower-energy compared to the other, relative to the direction of the magnetic field; if the field lines point "up" and the spin is "up", then that is lower energy than if the field lines are "up" and the spin is "down".

If the RF pulse (in the form of photons) is of just the right frequency (energy) -- basically equal to the energy difference between the spin-up and spin-down states -- it can be absorbed by the proton, causing it to flip its spin-state from a lower-energy (say, spin-up) to a higher-energy one (spin-down). The higher-energy state isn't stable, and the proton will eventually flip back to the original spin state (spin-up). When it does this, it will emit a photon in a direction roughly perpendicular to the direction of the static magnetic field, and this can be measured. The energy of this released photon is, again, equal to the difference in the energy between the states. One can think of it as the original photon energy that initially flipped the spin state as being "re-emitted", even though it's a different photon.

The half-life time it takes for the proton to "re-emit" that photon is the time T1 mentioned above. Following a "90 degree" RF pulse, some of the protons will spin in-phase (not merely precessing by the same angle), leading to XY / transverse magnetization; and this relaxation time (go out of phase) is what is taken up by T2 measurements. In this case, the relaxation can occur due to the protons spinning at slightly different Larmor frequencies, as they don't all feel the same magnetic field. See:


Also see:


The change in the XY magnetization as the protons return to their out-of-phase state will induce a current of "echo" in the "receiver coils" in the machine.

See this for more discussion about T1 and T2, magnetization in different planes and axes (XY and Z), and spin-flips:


I suppose I should also mention TE and TR, which are "echo time" and "repeat time". TE is basically the time between then an RF pulse is applied and when a echo from the brain is received back in the coils in the machine. And TR is the time for a complete RF pulse, echo, and remaining time to reach baseline before another round of RF pulses are applied -- and possibly even move where the RF pulse is applied to image a different "slice". TE is usually on the order of a few tens of milliseconds, and TR is usually around 1.5 seconds.

What about the BOLD signal?

The BOLD signal measures Blood Oxygenation and Deoxygenation, and is correlated with neural activity. I'll just quote from that last link:

Magnetic fields are altered by the presence of any substance to some extent. Many materials exhibit pronounced polarization in a magnetic field. The degree of this effect is referred to as the "magnetic moment" or "magnetic susceptibility". Spatial and temporal variation in local concentrations of deoxygenated hemoglobin (blood cells not carrying oxygen or Hb) to oxygenated hemoglobin (blood cells carrying oxygen or HbO2) result in corresponding changes in magnetic susceptibility, which in turn cause the local T2* values to fluctuate. Oxygenated hemoglobin are diamagnetic (i.e., tend to take a position at right angles to the lines of magnetic force, and are repelled by either pole of the magnet), while deoxygenated hemoglobin is paramagnetic (i.e., takes a position parallel and proportional to the intensity of the magnetizing field). Thus, MRI is able to detect a small difference (a signal of the order of 3%) between the two types of hemoglobin. This is called a blood-oxygen level dependent, or "BOLD" signal. Researchers are currently exploring the precise relationship between neural activity and the BOLD signal.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users