BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation ,...

47
BCS547 Neural Decoding

Transcript of BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation ,...

Page 1: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

BCS547

Neural Decoding

Page 2: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Nature of the problem

In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you say about given A?

Bayesian approach: recover P(|A) (the posterior distribution)

Estimation theory: come up with a single value estimate from A

Page 3: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Population Code

Tuning Curves Pattern of activity (A)

Page 4: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Estimation theory

Page 5: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

-100 0 1000

20

40

60

80

100

Preferred retinal location

A2

Decoder

Trial 2

2 Encoder

-100 0 1000

20

40

60

80

100

Preferred retinal location

A1

Decoder

Trial 1

1 Encoder

Decoder

Trial 200

200 Encoder-100 0 100

0

20

40

60

80

100

Preferred retinal location

A200

`

Page 6: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Estimation theory

If 2 is as small as possible, the estimate is said to be efficientˆ |

If E[] , the estimate is said to be unbiasedˆ|

is a random variable. To determine the quality of this estimate we can compute its mean, E[ ], and its variance,

2.

ˆ| ˆ |

Page 7: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Estimation theory

• A common measure of decoding performance is the mean square error between the estimate and the true value

• This error can be decomposed as:

2ˆMSE |E

22ˆ|

2 2ˆ|

ˆMSE |E

bias

Page 8: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Efficient Estimators

The smallest achievable variance for an unbiased estimator is known as the Cramer-Rao bound, CR

2.

An efficient estimator is such that

In general :

2 2ˆ CR|

2 2ˆ CR|

Page 9: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Fisher information is defined as:

and it is equal to:

where P(A| ) is the distribution of the neuronal noise.

Fisher Information

2

1

CR

I

2

2

ln |PI E

A

Page 10: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Fisher Information

2

2

1 1

1

''

1

22 ' ''''

221

22 ' '

22

ln P |

P | P |!

ln P | ln ln !

ln P |

ln P |

ln P |

i ik fn n

ii i

i i i

n

i i i ii

ni i

ii i

ni i i

ii ii

i i i i

i

I E

f ea k

k

k f f k

k ff

f

kf k ff

ff

f f f fE

f

A

A

A

A

A

A

'''

1

2'

1

n

ii i

ni

i i

ff

fI

f

Page 11: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Fisher Information

• For one neuron with Poisson noise

• For n independent neurons :

The more neurons, the better! Small variance is good!

Large slope is good!

2f

fi

i i

I

2

2f

fi

ii

I d

Page 12: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Fisher Information and Tuning Curves

• Fisher information is maximum where the slope is maximum

• This is consistent with adaptation experiments

Page 13: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Fisher Information

• In 1D, Fisher information decreases with the width of the tuning curves

• In 2D, Fisher information does not depend on the width of the tuning curve

• In 3D and above, Fisher information increases with the width of the tuning curves.

• ATTENTION: this is true for independent gaussian noise.

Page 14: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Ideal observer

The discrimination threshold of an ideal observer, , is proportional to the variance of the Cramer-Rao Bound.

In other words, an efficient estimator is an ideal observer.

CR

Page 15: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

• An ideal observer is an observer that can recover all the Fisher information in the activity (easy link between Fisher information and behavioral performance)

• If all distributions are gaussian, Fisher information is the same as Shannon information.

Page 16: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Estimation theory

Examples of decoders

Page 17: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Voting Methods

Optimal Linear Estimator

ˆ i ii

x w a

Page 18: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Voting Methods

Optimal Linear Estimator

1ˆ ,T

i ii

x w a C C AA AXW A W

Page 19: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Voting Methods

Optimal Linear Estimator

Center of Mass

ˆi i

i

ii

a xx

a

1ˆ ,T

i ii

x w a C C AA AXW A W

Page 20: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Center of Mass/Population Vector

• The center of mass is optimal (unbiased and efficient) iff: The tuning curves are gaussian with a zero baseline, uniformly distributed and the noise follows a Poisson distribution

• In general, the center of mass has a large bias and a large variance

Page 21: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Voting Methods

Optimal Linear Estimator

Center of Mass

Population Vector

ˆi i

i

ii

a

a

ˆ

ˆ ˆ( )

i ii

a

angle

P P

P

1ˆ ,T

i ii

x w a C C AA AXW A W

Page 22: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Population Vector

aiPi

P

Page 23: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Population Vector

11 112 21

1 ?

ˆ mi i

i mm

ap p

ap p

a

C C

P

AA AP P

P P W A

W W

Typically, Population vector is not the optimal linear estimator.

Page 24: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Population Vector

• Population vector is optimal iff: The tuning curves are cosine, uniformly distributed and the noise follows a normal distribution with fixed variance

• In most cases, the population vector is biased and has a large variance

• The variance of the population vector estimate does not reflect Fisher information

Page 25: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Population Vector

Population vector

Fisher Information

Population vector should NEVER be used to estimateinformation content!!!!

Page 26: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Population Vector

Page 27: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Maximum Likelihood

Page 28: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Maximum Likelihood

The estimate is the value of that maximizes the likelihood P(A|). Therefore, we seek such that:

ˆ arg max |

arg max log |

P

P

A

A

Page 29: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Maximum Likelihood

If the noise is gaussian and independent

Therefore

and the estimate is given by:

2

2ˆ arg min

2i i

i

a f

2

2| exp

2i i

i

a fP

A

2

2log |

2i i

i

a fP

A

Distance measure:Template matching

Page 30: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Maximum Likelihood

Page 31: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Gradient descent for ML

• To minimize the likelihood function with respect to , one can use a gradient descent technique in which is updated according to :

1t t t

t

L

Page 32: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Gaussian noise with variance proportional to the mean

If the noise is gaussian with variance proportional to the mean, the distance being minimized changes to:

2

ˆ arg min2

i i

i i

a f

f

Data point with small variance are weighted more heavily

Page 33: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Poisson noise

If the noise is Poisson then

And :

ii

f

i

a

i

ii

a

ef

aPP

ii

i

!

)|(|

A

!|

i

fai

a

efi

aPii

Page 34: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

ML and template matching

Maximum likelihood is a template matching procedure BUT the metric used is not always the Euclidean distance, it depends on the noise distribution.

Page 35: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Bayesian approach

We want to recover P(|A). Using Bayes theorem, we have:

likelihood of

posterior distribution over prior distribution over A

prior distribution over

||

P PP

P

AA

A

Page 36: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Bayesian approach

What is the likelihood of P()It is the distribution of the noise… It is the same distribution we used for maximum likelihood.

Page 37: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Bayesian approach

• The prior P() correspond to any knowledge we may have about before we get to see any activity.

• Ex: Zhang et al.

Page 38: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Bayesian approach

Once we have P(), we can proceed in two different ways. We can keep this distribution for Bayesian inferences (as we would do in a Bayesian network) or we can make a decision about . For instance, we can estimate as being the value that maximizes P(). This is known as the maximum a posteriori estimate (MAP). For flat prior, ML and MAP are equivalent.

Page 39: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Using the prior: Zhang et al

• For a time varying variable, one can use the distribution over the previous estimate as a prior for the next one.

Prior

Nasty but independent of Xt+1

1 11

1 1

| , || ,

|

| |

|

t t t t tt t t

t t

t t t t

t t

P PP

P

P P

P

A X X X XX A X

A X

A X X X

A X

Page 40: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Bayesian approach

Limitations: the Bayesian approach and ML require a lot of data…

Alternative: estimate P(|A) directly using a nonlinear estimate.

Page 41: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Bayesian approach:logistic regression

Example: Decoding finger movements in M1. On each trial, we observe 100 cells and we want to know which one of the 5 fingers is being moved.

1 2 3 100

1 2 3 4 5

…100 input units

5 categories

P(F5|A)

A

1

0

Page 42: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Bayesian approach:multinomial distributions

Example: Decoding finger movements in M1. Each finger can take 3 mutually exclusive states: no movement, flexion, extension.

Probability of no movementProbability of flexionProbability of extension

Activity of the N M1 neurons

W

Digit 1 Wrist

Softmax

Digit 2 Digit 3 Digit 4 Digit 5

Page 43: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Decoding time varying signals

s(t)

(t)

s t t k t

s k

Page 44: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Decoding time varying signals

0

ˆ

exps

s t t k t

s k

Q ik

Q

Page 45: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Decoding time varying signals

1

1

ˆt

t n

ii

n

ii

s t t k t

k t d

k t t d

k t t

Page 46: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.

Decoding time varying signals

s(t)

(t)

Page 47: BCS547 Neural Decoding. Nature of the problem In response to a stimulus with unknown orientation , you observe a pattern of activity A. What can you.