Michael J. Black - CS295-7 2005 Brown University
Topics in Brain Computer Interfaces Topics in Brain Computer Interfaces CS295 CS295-
- 7
Topics in Brain Computer Interfaces Topics in Brain Computer - - PowerPoint PPT Presentation
Topics in Brain Computer Interfaces Topics in Brain Computer Interfaces CS295- -7 7 CS295 Professor: M ICHAEL B LACK TA: F RANK W OOD Spring 2005 Kalman Filtering Michael J. Black - CS295-7 2005 Brown University v v = + z H x noise
Michael J. Black - CS295-7 2005 Brown University
Michael J. Black - CS295-7 2005 Brown University
Full covariance Q matrix models correlations between cells. H models how firing rates relate to full kinematic model (position, velocity, and acceleration).
Michael J. Black - CS295-7 2005 Brown University
normalization constant (independent of mouth) Prior (a priori – before the evidence) Likelihood (evidence)
Posterior a posteriori probability (after the evidence)
Michael J. Black - CS295-7 2005 Brown University
Michael J. Black - CS295-7 2005 Brown University
most samples have low probability – wasted computation How finely to discretize High dimensional space – discretization impractical We could sample at regular intervals
Michael J. Black - CS295-7 2005 Brown University
Weighted samples
weighted samples
= N i i t t n t t
1 ) ( ) (
) ( ) (
i i
Michael J. Black - CS295-7 2005 Brown University
Given a weighted sample set
sample N 1 1 Cumulative distribution of weights
) ( ) (
i i
Michael J. Black - CS295-7 2005 Brown University
1 1 1 1
− − − −
t t t t t t t t t
Michael J. Black - CS295-7 2005 Brown University
Isard & Blake ‘96 Posterior
1 1 − − t t
Michael J. Black - CS295-7 2005 Brown University
Isard & Blake ‘96 Posterior
1 1 − − t t
sample sample
Michael J. Black - CS295-7 2005 Brown University
Isard & Blake ‘96 Temporal dynamics sample sample
1 − t t
Posterior
1 1 − − t t
sample sample
Michael J. Black - CS295-7 2005 Brown University
Isard & Blake ‘96 Temporal dynamics sample sample Likelihood
t t
Posterior sample sample
1 − t t
1 1 − − t t
Michael J. Black - CS295-7 2005 Brown University
Isard & Blake ‘96 Temporal dynamics sample sample Posterior Likelihood normalize normalize
t t
Posterior sample sample
t t
1 − t t
1 1 − − t t
Michael J. Black - CS295-7 2005 Brown University
% generate cumulative distribution for posterior at t-1 …. % generate a vector of uniform random numbers. % if a the number is greater than refreshRate then
% generate a vector of uniform random numbers % use these to search the cumulative probability % find the indices of the corresponding particles % for each of these particles, predict the new state (eg. Add Gaussian noise!) % for each of these new states compute the log likelihood
% else generate a particle at random and compute its log likelihood. % find the maximum log likelihood and subtract it from all the other log likelihoods % construct the posterior at time t by exponentiating all the log likelihoods and normalizing so they sum to 1.
Michael J. Black - CS295-7 2005 Brown University
Michael J. Black - CS295-7 2005 Brown University
k k k k
d c k ×
k k
c c k ×
Michael J. Black - CS295-7 2005 Brown University
)) ( ) ( 2 1 exp( )) det( ) 2 (( 1 ) (
1 2 / 1 k k k k T k k k k c k k
p x H z Q x H z Q x z − − − =
−
π
k k k k
Michael J. Black - CS295-7 2005 Brown University
k k k k
−1
. , 3 2 M , k L =
d d k ×
k k
d d k ×
Michael J. Black - CS295-7 2005 Brown University
1 k k k k
)) ( ) ( 2 1 exp( )) det( ) 2 (( 1 ) (
1 1 1 2 / 1 1 k k k k T k k k k d k k
p x A x W x A x W x x − − − =
+ − + +
π
Michael J. Black - CS295-7 2005 Brown University
L , 2 , 1
) , (
=
∈
k k k
N Q q
1 k k k k
−
L , 3 , 2
) , (
=
∈
k k k
N W w
k k k k
Michael J. Black - CS295-7 2005 Brown University
1 1 1 1
− − − −
t t t t t t t t t
1 1 2 1 1 3 2 1 2 1 1 1 3 3 3 3 2 1 2 2 2 1 1 1
− − − − −
Michael J. Black - CS295-7 2005 Brown University
1 1 1 1
− − − −
t t t t t t t t t
T
Michael J. Black - CS295-7 2005 Brown University
1 1 1 1
− − − −
t t t t t t t t t
1 W
t
1 1 − − t t
1 1
− − T t t t
− − t t t
Michael J. Black - CS295-7 2005 Brown University
1 1 1 1
− − − −
t t t t t t t t t
− − t t t
− − − − −
1 1 t t t T t t t t T t t
Michael J. Black - CS295-7 2005 Brown University
1 1 t t t t t T t t t t T t t t t
− − − − −
1 1 1 1 1 1 1 1 1 1
− − − − − − − − − − − − − − − −
T t t t T t t t t t T t t T t t
Michael J. Black - CS295-7 2005 Brown University
1 1 1 1 1 1 1 1
− − − − − − − − − − − −
T t t t T t t T t t
1 1 1 1 1
− − − − − − − −
T T t t T t t t t t t t
Some algebra.
Michael J. Black - CS295-7 2005 Brown University
t t T t T t t T t
− − − − − − − − − − 1 1 1 1 1
1 1 1 1 − − − − −
T T t t
Michael J. Black - CS295-7 2005 Brown University
1 1
and ˆ
estimate Initial
t- t
P x −
Prior estimate Error covariance Posterior estimate Kalman gain Error covariance
1
− − = t t
1 −
= Q H P K
T t t
− − − − − −
+ − =
t T t T t t t
HP H HP Q H P P P
1 1
) (
− −
t t t t t
T t t
− − 1
Michael J. Black - CS295-7 2005 Brown University
hidden states and measurements.)
M M
k k k k
Michael J. Black - CS295-7 2005 Brown University
= = −
M k k k M k k k M M M M M
1 2 1 1
k
1 − k
1 + k
k k k k
w x A x + =
−1 1 − k
k
1 + k
k k k k
q x H z + =
Michael J. Black - CS295-7 2005 Brown University
) , ( max arg
, , , M M Q H W A
p Z X
, )] ( ) ( ) [log(det ) ( log ) (
2 1 1 1
= − − −
− − + = − =
M k k k T k k M
p f Ax x W Ax x W X W A, α
where
= −
− − + = − =
M k k k T k k M M
p g
1 1
)]. ( ) ( ) [log(det ) ( log ) ( Hx z Q Hx z Q X Z Q H, β
) ( max arg ) ( max arg
, , M M Q H M W A
p p X Z X = ) ( min arg ) ( min arg
, ,
Q H, W A, g f
Q H W A
=
Michael J. Black - CS295-7 2005 Brown University
= = − = = = − = − = − − = − M k T k k M k T k k M k T k k M k T k k M k T k k M k T k k M k T k k M k T k k
1 1 1 1 1 2 1 2 1 2 1 1 2 1
Michael J. Black - CS295-7 2005 Brown University
Estimated/decoded position (reconstruction) Actual hand position
69 cells with 1.5 minutes of training data
Michael J. Black - CS295-7 2005 Brown University
Population vector 8.66 Linear regression method 2.55 Kalman filter 2.18
Continuous 2D hand motion (off-line reconstruction):
CorrCoeff
As number of cells increases:
Michael J. Black - CS295-7 2005 Brown University
k k j k
−
42 2 1
4 , 3 , 2 , 1 , = j
k k k
Michael J. Black - CS295-7 2005 Brown University
2
Michael J. Black - CS295-7 2005 Brown University
true reconstructed
Michael J. Black - CS295-7 2005 Brown University
= =
C i t i t i i i C i t t i t t
1 2 , 2 1 ,
Michael J. Black - CS295-7 2005 Brown University
Kalman filter Linear regression CC RMSE (cm) CC RMSE (cm) 23 (0.79, 0.82) 3.61 (0.70, 0.72) 4.35 30 (0.88, 0.79) 3.26 (0.85, 0.72) 3.49 36 (0.75, 0.74) 4.36 (0.77, 0.64) 4.38 26 (0.71, 0.76) 4.48 (0.71, 0.74) 4.39 69 (0.88, 0.89) 3.11 (0.72, 0.78) 5.30 69 (0.86, 0.88) 3.26 (0.71, 0.80) 3.99 # of cells Kalman filter CC = 0.81±0.06, RMSE = 3.7±0.6 (cm) Linear regression CC = 0.74±0.05, RMSE = 4.3±0.6 (cm)
Michael J. Black - CS295-7 2005 Brown University
True Reconstructed
5 10 15 20 25 30 5 10 15 20 25 30
x-position
5 10 15 20 25 30 5 10 15 20 25 30
y-position
time (second) time (second)
Michael J. Black - CS295-7 2005 Brown University
Kalman filter decoder. Only 18 cells. Directly exploits the generative encoding model. Neural control
cursor in real time. Brain substitutes for hand.
Target Visual feedback
Michael J. Black - CS295-7 2005 Brown University
Kalman filter Linear regression time targets rate time targets rate 17 60sec 38 38/min 30 105sec 55 31/min 58sec 24 25/min 36 57sec 28 29/min 42sec 15 21/min 69 45sec 28 37/min 60sec 22 22/min # of cells
50% improvement
Michael J. Black - CS295-7 2005 Brown University