Hi, we're back and launching into population coding.
Of course in general, many neurons participate in the making our decisions.
And so we'll now consider some decoding algorithms, that allow for the influences
of many neurons, in interpreting the stimulus.
We're going to start with a simple and elegant example, the cricket cercal
system. Crickets are very sensitive to air
movements, and these signals help them to escape moving predators or fly swatters.
They're able to sense these motions, due to two antenna-like structures, called
the cerci, here on the back of the abdomen.
These are covered with fine hairs. If you look at them in close up, you'll
see these tiny fine hairs that cover their entire, cover their entire length.
The cercus in this case, was about one centimeter in length.
So the wind velocity is transduced into an electrical signal, by the movements of
these hairs. Their innovated at their base, by neurons
that are able to sense their mechanical forces, caused by their motion.
So the question is, how do these neurons as a group communicate wind velocity to
the animal, to aid in its escape? Here at the top, we're showing the firing
rate response cause for different neurons.
What's rather lovely, is that in among this group of neurons there are only four
types of these tuning curves. Neurons have peak responses in one of
four cardinal directions, and these happen to be those be those at 45 degrees
to the animal, left and right, front and back.
These curves like the ones we saw in the previous week's lecture in the motor
system, are approximately shaped like cosines, so that these neurons respond
proportionally to the cosine of the angle, between their preferred direction
and the direction of the wind, S. Notice that for simplicity, we simply
normalizing away the [UNKNOWN] response by its maximum.
Now, a way to interpret a cosine response like this, is that the neuron's firing
rate is proportional to the projection of the wind velocity.
So, here's the true wind velocity, onto a vector defined by the preferred direction
of the neuron. So here is the projection of the wind
velocity in that, in the direction C. If we want to compute this projection, we
can use the fact that the cosine of S equals r, over the length of v.
Now, because we're only dealing with the direction of the wind and not of it's
strength, this is simply one, and so now our response, is just cosine of s.
So we can write, we can rewrite this response in terms of, this dot product,
this projection of the wind velocity, onto the preferred direction of neuron A.
Now we can take the responses of all the neurons, and compute something called the
population vector. Each neuron adds in a component in its
preferred direction, with a weight given by its firing rate, which approximates
the projection of the wind direction, onto that preferred direction.
Now, comparing the estimate that we get from this population, population vector,
we can see that there's a small, although systematic error in that estimate, of the
entire 360 degree range of wind directions.
Note that here, the number of basis factors used to define the wind velocity
is four, since this system seems to encode in two dimensions.
It seems like we have what's called, an over complete basis.
In principle we only need two basis vectors, to represent velocity in two
dimensions. So can you think of a reason why there
might be four vectors? This method can also be applied to motor
neurons in cortex. And in fact, this is still one of the
leading methods for trying to decode motor cortical activity in order to
control a brain computer interface, like a cursor on a screen or a robotic arm.
Each response, each neuron's response is parameterized in terms of a tuning curve,
like this one that we have already seen. So, around some, some baseline firing
rate, r0, this is the form of a cosine. So here's that spike train data
represented a bit differently. Now every time the r moves in a certain
direction, that direction is plotted here for each neuron, with the length of the
vector given by the firing rate on that trial.
So once again, we're going to interpret the firing rate as the cosine of the
angle between the arm movement and the neurons preferred direction.
And once again, we can compute a population vector by weighting each
neuron's preferred direction, CA, individual for every neuron, by its
firing rate. So if we have enough neurons in our
population, this average, this vector, this population vector average is going
to converge and be parallel to the direction of arm movement.
So, this is a neat technique, but you've probably got the sense that it's rather
specific to this kind of response. What do we do with tuning curves, they're
not cosine so they're not well interpreted as the projection onto a
population vector? What if some neurons are better tuned
than others? What about noise?
Some neurons are more noisy than others. And we'd like to be able to weight the
contributions from those different, from those different neurons appropriately.
So, given the limitations of the population vector approach, we try to try
something a little bit more general. We've seen Bayes' law a few times now and
you'll be getting the correct sense that it's a very useful concept.
So here we're going to use it for some definitions.
So to remind you, here's the basic breakdown.
The probability of a stimulus given a response, of course, can be written in
this, in this alternate form. So now, we've seen this conditional
distribution, probability of response given stimulus,very often, and we've,
we've called that the likelihood function and worked with that the last few
examples. P of s is the prior distribution, as
we've also discussed. And the probability of r, it's just
called the marginal distribution, and that's really just a normalization
constant. So the probability of response, we can
write as an integral over all the stimuli, probability of response, given
the stimuli, times the probability of the stimulus.
So here on the top you see an example of that term, that's in the integral, for
one particular stimulus. And we're just going to average that over
all the stimuli. And so that gives us this globalization
we require. And finally we have the a posteriori
distribution. The distribution you get once you
incorporate all these factors, that the conditional distribution and the prior.
So the two distributions that we'll focus on are first the likelihood.
That's the one we've already worked with, in signal detection theory.
And second is the a posteriori distribution.
Now we can define two important general decoding strategies which utilize these
two distributions. The first is Maximum Likelihood up here,
we first mentioned in the context of fitting coding models, we saw again in
the decoding of two alternatives and now we're going to use a slightly more driven
way. Your maximum likelihood, when searches
for the special stimulus value, s star, that maximizes the likelihood in our
alternative choice. That's how we mapped any value of the
response onto a stimulus. We chose the stimulus value that had the
larger likelihood. Alternitavely, we can look for a stimulus
that maximizes the upper posteriori distribution.
That's called maximum a posteriori, or MAP.
In general, these are going to differ because the role, because of the role of
the prior. That's what makes the two sides differ.
That means that in maximizing the a posteriori distribution, we're biasing
our choice to what we know about the stimulus and events.
We'll see an example of this later. So the plan for today is to work through
a classic example of the applications of these techniques to a somewhat idealized,
yet reasonable version of a population code.
Let's imagine that we have a population of neurons that encode some particular
stimulus parameter S. That's the orientation of an edge.
Let's also take our inspiration from b1 responses, and assume that the form of
the response function is Gaussian. So let's say neuron one has a response
that looks like this. There's a function of S, it has some
preferred, preferred dir, orientation. So this, let's call this neuron one.
So that has a, a preferred response at stimulus one and some firing curve F1 of
S. And now imagine that we have many other
neurons that have centres or orientations that are, that are along this line.
And they all have their own Gaussian response functions.
So we're going to make two particular assumptions, one is that each neuron
fires independently. That is, even though they're driven by a
common input. And some that have overlapping receptive
fields will then necessarily fire at similar times.
There's variability in their responses that's independent and private to each
neuron. We'll also need an explicit model for
that variability and that's going to give us an opportunity to make good use of
what we learned last week about the Poisson Distribution.
So here, here this is drawn more nicely, here's our stimilus axis, so it's a
function of stimulus. Here's the response curve, f a of s for
neuron a. And then as one scrolls along different
neurons indexed by a, you see that that's going to span the whole, the whole
possible range of s. And that we're going to define these
tuning curves to be Gaussian. We're also going to assume that these
receptor fields span the range of s uniformly.
That is to say, no matter what value of s we take, there's always plenty of neurons
that are encoding that region of stimulus space.
And so what that's going to correspond to is that if we choose some, some value of
s, and we look at the responses about population of neurons, there's a number
of neurons that are going to be responding to that value.
In this case, here, here, here, here, here, and here.
If we add up the responses of all of those neurons to, to that stimulus, we're
going to get some overall firing rate. And that firing rate is constant,
independent of s. So, we're going to express that as you
know, the sum of all the neurons in the population, take their average firing
rate as a function of s, and that doesn't depend on s, so that we get the same
average firing rate no matter what our stimulus value is.
So, here's the response of 11 such neurons, each of which as a different
preferred orientation. This is being driven by some stimulus.
The referring rate of each neuron is plotted against that neuron's preferred
orientation. The neuron in the middle responds
maximally when driven with a, a value of the stimulus s equals, sa equals 0.
While the neuron with a preferred orientation, say, of minus 5, is not
driven at all. Now, you see that, for this simulated
data. There is, like in real data, a lot of
variability. If we did many trials of the presentation
of this stimulus, and we plotted the same data, the average of all of the responses
would lie among this dotted line. But there would be a standard deviation
around the average, some error bars on this, is given by, do you remember?
So what would it be for a, for a poisson firing neuron.
So here's the expression for the probability of seen case fights in a
chunk of time, of lengths T and let's do a quick review of what we learned last
time about, about Poisson firing. Spikes are produced randomly and
independently in each time band with a probability given by the instantaneous
rate. And so what that implies is Is that if we
have some length of time t we walk through, at least the steps of how one
comes about calculating the probability of K spikes occurring in that, in that
length of time T. Now let's see how we apply this
expression in the particular case that we have set up.
So let's start the figuring out each individual neuron's response.
Let's say that neuron a has response ra to a given stimulus, to stimulus S.
So we'd like to write down the probability of that response for this
particular neuron for neuron labeled by A to that input stimulus.
So what is that probability? Now, we're going to use this Poisson
model. Let's see how we substitute the times in
this Poisson model for times that, that we've developed here in our example.
So now we want the probability given time t of k spikes.
So, k spikes because we have a, we have firing rate, are a for our given neuron.
So, r a probability of ra is going to be equal to.
Now, this parameter r is the mean firing rate, so what's the mean firing rate of
our neuron that's given by its response curve, and that was, we called that fa of
s,s. And now in this case, we're giving it,
we're giving the neuron stimulus s, and so now our mean response is going to be
given by that tuning curve value, fa of s times t, now k again is the number of
spikes, ra, that we actually observed, times t.
Now exponential minus and now again we need this parameter r.
That's a tuning curve value. Gives us the average response, T divided
by, ra. Now, how do we right down the full
distribution for all of the neurons at the same time.
So, we're going to represent by vector r. The vector of responses to all, of all
the different neurons rn. So, what is the probibility of all those
responses. Because we said they're independent,
that's just going to be the product of all of the individual probabilities.
Probability of ra equals 1 to n. All right, so when we condition that on
the stimulus, there's a probability r given a stimulus.
In a product again over all the neurons. So now if we write in the explicit
expressions for the individual neurons we get a complete expression for our
population response that's of this form. So, now that we have our expression for
the total stochastic response, let's calculate the maximum likelihood solution
to do that. It's useful, as we've done before, to
work with a log likelihood, rather than the likelihood directly, especially when
we look at this form of this equation. So let's take the log.
So log, probability of r given s is going to be equal to so now taking the log of
that product is going to give us a sum. Over r a t comes down from the exponent
times the log f a s T. Now this is going to come out from under
the exponential, fa s of t minus log of ra with t factorial.
Sum of that overall neurons. So now we need to take, now we need to
find the s, value of s for which that's maximized.
So how does one do that in general, if one has some function like this, f as a
functoin of s? And we're looking for the s prime, which
is that, which takes, for which s takes its maximum value.
And what we do is take the derivative of f, with respect to s, and set that equal
to 0. And then solve this equation for S.
So now I would call this the calculate the derivative of, of this equation,
before we do that we should notice that there are a couple of terms here that are
not going to, not going to survive. So, this guy doesn't depend on s, so the
derivative with respect to s is going to go away.
We should also notice this time. So, what do we have here, we have the
sum, over f a s times t over all the neurons.
A equals 1 to n. Now, if you recall we required that this
be a constant. This was a condition that we on our
tuning curves that we had good coverage of the parameter, parameter s across the
entire range so that the total firing rate for the leverage firing rate which
is given by this term doesn't depend on s.
And so now, when we take the derivative with respect to s, that term's going to
go away. So, what do we have left?
We now have T times sum over a, equals 1 to N.
Ra, now the log of some function of s, take its derivative with respect to s,
we're going to get the derivative of that function, f prime times T over the
function itself. So now we're going to get T sum over a ra
f, prime of s, over f of s. And now we will set that to 0 and solve
that for the value of s, that solves that equation.
So now, here's the expression that we'd like to, we'd like to solve for, for s
star. So, how do we do that?
So, f as a function of s is equal to some prefactor A e to the minus 1 over 2 sigma
squared, s minus Sa that central value, and now f prime of s equal to A.
And now we bring down this factor. There's, there's a squared that cancels
with the half. There's a minus sign that cancels with
this minus sign so we get s minus Sa over sigma squared.
Multiply the same thing we had before 1 over 2 sigma squared S minus Sa squared.
And so now this equation is quite simple, so we have a equals 1 to N ra.
What do we have left? The f prime and the f are going to cancel
out these exponential factors in the A. And so all we're left with is S minus Sa
over sigma squared equals 0. So now one can solve that for s equals s
star, and we're going to find the following solution.
So s star is equal to ra times sa divided by sigma a squared.
And that's divided by the total sum of the firing rates, where each is again
normalized by its variance. Now if all the signals are the same,
these factors cancel above and below. And we get back an expression which
should look very familiar. Its very similar to the population
vector. So what do we gain by all this procedure?
Well, we made a lot of assumptions to make that work out so nicely, and the
Gaussian distribution is one in which that came out so cleanly.
If we go back, this one step, we see something that we would have hoped for.
That each neuron's contribution is weighted by the inverse of it's variance.
That is if a neuron has a sharply peaked tuning curve.
If it's very informative about the stimulus parameter, it's variance will be
small and it's contribution will be large.
So this method takes care of weighting the various neuronal opinions according
to their reliability and their informativeness.
So, now let's calculate the maximum a posteriori solution.
So, now we have to maximize, not the log of the of the likelihood, but the log of
the a posteriori solution with respect to s.
So, we can write that down. We can use Bayes law to just write that
in terms of the likelihood. And in terms of the prior and also in
terms of, of the marginal distribution. And now let's just consider those terms
that that will depend on s. So, as before, we can throw away or, or
leave out for now, any terms that, that don't depend on s, that only depend on r.
So, that gets rid of this term. So now here's our log, of the, of the,
likelihood that we wrote down before. And, the log of the prior.
And we also have gotten rid of that term that was a sum over, over the fine rates,
because we're again assuming that to be constant.
And won't depend on the stimulus so it will dissappear in the derivative.
So now taking the derivative of seven to 0, throwing away the sum equals constant,
we get a new expression that we now need to solve for, s prime.
And you'll see that all we've done is add to that the, the this expression that
depends on, on the prior probability. Using again the Gaussianity of the tuning
curves, you can write down that, that solution.
I'll leave that, I'll leave that as an exercise for you.
And so what you find is that we have these original terms that we got from
the, the likelihood, but now they're shifted.
We now get a solution for s, for s star. That's shifted by the prior.
So, what prior have we assumed here? We've taken a Gaussian prior, where the
mean is less prior. And it has some standard deviation, sigma
prior. And now, the effect of such a prior, is
to add on this additional tone that's going to, that's going to bias our
estimate of s star, and now you can see that as one changes the standard
deviation, the width of this prior. So, let's take the case that sigma
squared is very small, so that we have a prior that is very peaked around s prior.
So that means that this term, this additional term is going to get very
large and now s prior is going to have a stronger effect in biasing s star.
Whereas if the prior is very broad equivalent to saying we don't have very
strong information about exactly, exactly what value s takes on in general, then
this time it's going to be weak. And in the limit of, of a constant prior,
where sigma squared goes to infinity, this time would disappear altogether, and
we'll get back to the maximum likelihood solution.
So what are the limitations of these approaches?
One is that it stays within the confines of the description in terms of tuning
curve and mean firing rate. So, it doesn't really incorporate rapid
time variations. It also doesn't take into account
correlations in the population. What was very important to have been able
to write down a full distribution of responses given the stimulus, is it we're
able to assume that neurons respond independently.
The question of correlations in the neural code is, as we've just seen,
really fundamental to how we go about deciphering the firing rates, the firing
responses of many neurons. And this is a major part of the agenda of
neuroscience for the next decade, including with methods such as I'm
showing here, with calcium imaging. Or we can, we can record from many, many
neurons simultaneously. So it's not surprising that understanding
correlations both experimentally and theoretically is a major current area of,
of investigation. My friend, and University of Washington
colleague, Eric Shae-Brown, will be joining us as a guest lecturer in the
course, to talk about this issue in more depth.
So we're going to stop here, for this session and come back to finish this
lecture with a discussion of, of reconstruction.
How one recreates estimates of time varying conflict stimuli from neural
activity.