<<

Brain's Circuit Connectivity and its Dynamics

Behnaam Aazhang J.S. Abercrombie Professor

Electrical and Computer Engineering Rice University Can Electrical Engineers Impact ?

Behnaam Aazhang J.S. Abercrombie Professor

Electrical and Computer Engineering Rice University acknowledgement

• Nitin Tandon, MD at UTHSC

• John Byrne, UTHSC

• Valentin Dragoi, UTHSC acknowledgement acknowledgement

NSF, UT System, and Texas Instruments a scientific curiosity

• how does work? a scientific curiosity

• how does human brain work?

• ancient Egypt and Greece

• Roman empire

• the seat of intelligence a scientific curiosity

• how does human brain work?

• ancient Egypt and Greece

• Roman empire

• the seat of intelligence

• 19th century

• 90s the “decade of the brain”

• 2013 “the brain initiative” quantum leap in understanding

doctrine quantum leap in understanding

• neuron doctrine

• brain is an electrical circuit quantum leap in understanding

• neuron doctrine

• brain is an electrical circuit quantum leap in understanding

• neuron doctrine

• brain is an electrical circuit

• probe using electrodes

• manipulate using electrical signals quantum leap in understanding

• neuron doctrine

• brain is an electrical circuit

• probe using electrodes

• manipulate using electrical signals

• problem: millions of ! the sheer size

• human

• 86 billion neurons the sheer size

• human

• 86 billion neurons the sheer size

• human

• 86 billion neurons

it is all about connections! the connections

• 86 billion neurons

• 10 micron diameter

• 100 trillion

• 100 Hz clock speed

• 1000s of chemical and genetic effectors the connections

• 86 billion neurons

• 10 micron diameter

• 100 trillion synapses

• 100 Hz clock speed

• 1000s of chemical and genetic effectors grand challenges

• …

• how neuronal circuit connectivity relates to behavior

• transition of neuronal circuits grand challenges

• …

• how neuronal circuit connectivity relates to behavior

• transition of neuronal circuits

• disease state to healthy state

• learning

• memory

• … our research focus

• understanding circuit’s connectivity and its dynamics

• epilepsy, parkinson, alzheimers, aphasia

• behavior, learning, memory

• network analysis

• large-scale recording

• network modulation

• closed-loop real-time signal processing

• experimental

• clinical this talk

• one set of information theoretic tools

• two applications

• impact of learning on feeding circuits in Aplysia

• seizure circuits in epileptic patients application 1

• micro level

• learning in feeding circuits in Aplysia

• study and manipulate individual neurons application 2

• micro level

• learning in feeding circuits in Aplysia

• study and manipulate individual neurons

• macro level

• seizure circuits in epileptic patients

• study and manipulate of populations of neurons application 1 learning

• Aplysia

• 20,000 neurons

• feeding neurons’ connectivity

• micro level study

• changes due to learning?

• anatomical connectivity

• functional connectivity! the experiment

• Aplysia buccal ganglion • learning circuit

• voltage sensitive dye the experiment

• Aplysia

• learning circuit

• voltage sensitive dye (VSD)

• spectral absorption of VSD changes with changes in voltage

L. Cohen, B. Salzberg (1978). "Optical Measurement of Membrane Potential". Reviews of Physiology, Biochemistry and Pharmacology. the experiment

• Aplysia buccal ganglion • learning circuit

• voltage sensitive dye learning

• Aplysia

• learning circuit

• buccal ganglion learning

• neurons’ spike learning

• does neuron 3 excite neuron 8? learning

• does neuron 3 excite neuron 8? learning

• did neuron 3 causally influence firing of neuron 8?

Neuron 3 …00011110000001001100001100000001100001…

Neuron 8 …00000111100000010111100001100000001111… learning

• did neuron 3 causally influence firing of neuron 8?

Neuron 3 …00011110000001001100001100000001100001…

Neuron 8 …00000111100000010111100001100000001111…

• causal relation

• a probabilistic measure

• data driven causality

• one time series forecasting another

• economics

• transportation

• …

N. Wiener (1956), C. Granger (1969), H. Marko (1973), J. Massey (1990), G. Kramer (1998), C. Quinn, T. Coleman, N. Kiyavash (2011) a little background

• directed information and causality

N N N n n 1 I(X Y )= I(X ; Y Y ) 1 ! 1 1 n| 1 n=1 X • directional with temporal information

N N X (X1,X2,...,XN ) Y (Y ,Y ,...,Y ) 1 ⌘ 1 ⌘ 1 2 N …00011110000001001100001100000001100001… …00000111100000010111100001100000 N N N n n 1 I(X Y )= I(X ; Y Y ) 1 ! 1 1 n| 1 a little background n=1 X

• mutual information of time series

N N N N n 1 I(X ; Y )= I(X ; Y Y ) 1 1 1 n| 1 n=1 X • no temporal and no causal information

N N X (X1,X2,...,XN ) Y (Y ,Y ,...,Y ) 1 ⌘ 1 ⌘ 1 2 N I(XN ; Y N )=H(Y N ) H(Y N XN ) 1 1 1 1 | 1 a little background

• directed information of time series

I(XN Y N )=H(Y N ) H(Y N XN ) 1 ! 1 1 1 || 1

• where N N N n 1 n H(Y X )= H(y Y ,X ) 1 || 1 n| 1 1 n=1 X I(XN ; Y N )=H(Y N ) H(Y N XN ) 1 1 1 1 | 1 a little background

• directed information of time series

I(XN Y N )=H(Y N ) H(Y N XN ) 1 ! 1 1 1 || 1

causal conditional entropy • where N N N n 1 n H(Y X )= H(y Y ,X ) 1 || 1 n| 1 1 n=1 X estimating directed information

• estimating entropy and causally conditioned entropy

N N N N N I(X1 Y1 )=H(Y1 ) H(Y1 X1 ) • model free ! || N N N n 1 n H(Y X )= H(y Y ,X ) 1 || 1 n| 1 1 n=1 • data driven—universal X

• tree based density estimation for discrete variables

• kernel density estimation for continuous variables back to learning

• causal relation …00011110000001001100001100000001100001…

• data driven …00000111100000010111100001100000001111…

• tree based density estimation

• directed information • causal relation …00011110000001001100001100000001100100? 1 0 • data driven 0 • tree based density estimation ? • directed information • causal relation …00011110000001001100001100000001100100? 1 0 • data driven 0 • tree based density estimation ? • directed information

...000111100000010 p H(X),H(X, Y ) I(X Y ) ! X,Y ! ! ! learning

• causal relation

• direction information learning

I(X X ) • causal relation 3 ! 8

• direction information learning

• causal relation

• direction information

• excitatory learning

• causal relation

• direction information

• excitatory

• inhibitory

• excitatory versus inhibitory

• slow versus fast causality Network Analysis

• Out- and in-degree

• Changes in distribution of degrees due to learning 24

A B 19 8 Indegree Outdegree 12 15 7 2 1 6 18 14 22 10 5 4

20 9 3

2 27 13 23 17 Numberconnections of 1 8 7 0 11 6 1 22 9 23 7 27 10 15 5 11 12 19 6 18 3 17 8 13 20 14 2 3 5 Neuron

Fig. 9. Patterns of connectivity of the preparation in Fig. 8. A: The inferred connectivity diagram. B: Indegrees and outdegrees of neurons. Neurons without any connections are not shown. This graph shows neurons that primarily receive connections (left) and those that send out connections (right).

457 IV. DISCUSSION

458 Our method of exploiting the context tree maximizing entropy estimator together with directed infor-

459 mation can infer functional connectivity in small realistic simulated neural networks. The CTM based

460 estimator has the advantage of low computational complexity, fast convergence, being non-parametric, as

461 well as being able to mitigate overfitting. We have shown that our implementation of CTM can identify

462 direct connections, eliminate indirect connections, reliably distinguish excitatory from inhibitory synaptic

463 actions and quantify the amount of information flow from one neuron to another (Fig. 5). Furthermore,

464 this inference technique based on DI is robust against signal nonlinearities, which linear methods such

465 as Granger Causality or estimates based on the generalized linear model might not be able to capture.

466 For example, it is able to detect connections with facilitation or depression (Fig. 6), which are common

467 throughout invertebrate and vertebrate nervous systems.

468 A sound CTM-DI theoretical framework requires the observed sequences to be stationary. We believe

469 this assumption is valid because in the VSD recordings, the BMPs are similar from one to the next and so

470 the underlying system appears to be stationary during the limited frame of the analysis. The context tree

471 method analyzes different contexts, which are patterns, independently. Therefore, it is not only able to

472 analyze tonic activity but also phasic activity. The result of the CTM-DI algorithm is the average strength

473 taken into account all the different spiking patterns in the recording window.

474 The CTM-DI based method has its own limitations. A challenge for the DI-CTM approach is a dynamics of the network

0.3 0.3

0.25 0.25 5 5 0.2 0.2

0.15 0.15 10 10 0.1 0.1

15 0.05 15 0.05

0 0

20 −0.05 20 −0.05

−0.1 −0.1 25 25 −0.15 −0.15

−0.2 −0.2 5 10 15 20 25 5 10 15 20 25 neuron index

Z. Cai, …, B. Aazhang, “Inferring Neuronal Network Functional Connectivity with Directed Information”, Journal of , 2017. application 2 application 2

• micro level

• learning in feeding circuits in Aplysia

• study and manipulate individual neurons

• macro level

• seizure circuits in epileptic patients

• study and manipulate of populations of neurons connectivity and epilepsy

• a macro level study

• million of neurons

• individual neuronal activities are less relevant epilepsy

• unprovoked and recurring seizures epilepsy

• unprovoked and recurring seizures

• seizure

• no standard definition

• abnormally hyper-excited neuronal activities epilepsy

• unprovoked and recurring seizures

• seizure

• no standard definition

• abnormally hyper-excited neuronal activities

• open questions on how seizures

• begin, spread, and end!! record, model, and prevent

• deep brain

• subdural

• trans-cranial record, model, and prevent

• deep brain

• subdural

• trans-cranial macro level recording

• electro-cortico-graphy (ECoG)

• 150 channels (electrodes)

• local field potentials

• population of neurons primary questions

• spatial relations

• spectral relation

• temporal relation

R. Malladi, …, B. Aazhang, “Identifying Seizure Onset Zone from the Causal …” IEEE Transactions on Special Issues in Signal Processing RPBT1

RAMY2 primary questions

RAH1 • spatial relations

Seizure • seizure onset zone Start Time

0 10 20 30 Time (s) in seizure onset zone (SOZ)? RPBT1

RAMY2 primary questions

RAH1 • spatial relations causally influencing? Seizure • seizure onset zone Start Time

0 10 20 30 Time (s) modeling of the recordings

• time series of length N—hours and hours of recordings

• d channels—154 channels

• causal relation among electrodes modeling of the recordings

• time series of length N—hours and hours of recordings

• d channels—154 channels

• causal relation among electrodes

• directed information

• model free—data driven

• kernel density estimation for continuous variables recall—a little background

• directed information and causality

N N N n n 1 I(X Y )= I(X ; Y Y ) 1 ! 1 1 n| 1 n=1 X • directional

N N X (X1,X2,...,XN ) Y (Y ,Y ,...,Y ) 1 ⌘ 1 ⌘ 1 2 N back to seizures

• causal relation among electrodes

• directed information

• model free—data driven

• kernel density estimation for continuous variables

RPBT1

RAMY2

RAH1 fX,Y H(X),H(X, Y ) I(X Y )

Seizure ! ! ! ! Start Time

0 10 20 30 Time (s) seizure onset zone

• causal influence—directed connectivity

• graphical model of electrode’s recordings

9

RAMY9 RAH2 RAH1 electrode RAMY1 RAMY8

RAH8 RAH7 RAH6 RAMY7 RAMY6

RPH6

RPH7 RAH5 RAH4 RAMY5 RAMY4

RPH5 RPH2 RPH1 RAH3 RAMY3 RAMY2 RPH3 RPH4 RPH8

(a) Causal connectivity between 25 electrodes in (b) Entropy estimates of all 127 ECoG channels (c) The strength of the strongest outgoing causal the epileptogenic zone from a 30 second win- recorded from patient P1. The solid line is the mean connection from each ECoG channel is plotted against dow that begins 20 seconds before the start of entropy of all channels. The dotted vertical black lines time. The seizure onset zone channels are in red and the seizure in patient P1. RAH - right anterior indicate the seizure start and end times. Change the the remaining are in green. The two solid lines are the hippocampus, RPH - right posterior hippocampus, estimation window to 30 sec from 60 sec. average maximum strength, one for each groups. RAMY - right amygdala. Change the figure. Fig. 7. Causal Connectivity Analysis of ECoG recordings during one seizure from patient P1.

‘strong’ connections. This threshold will determine the number group respectively. The rise in peak DI value during a seizure of directed edges connecting each node in the graph and is indicates that regions of the brain become more synchronized a parameter that can be optimized. We set it to 90% for during a seizure. The regions not in seizure onset zone show ease of dispalying the causal connectivity networks (rewrite the maximum increase. In addition, even the strongest causal this sentence). The results of our analysis from the patient connections from channels in SOZ are relatively weak com- P1 are plotted in Fig. 7. The estimated causal connectivity pared to the channels in non-SOZ regions, particularly at the amongst 25 electrodes (RAMY 1-9, RAH 1-8, RPH 1-8) in beginning of the seizures. This crucial observation forms the the epileptogenic zone of patient is plotted in Fig. 7a. The basis for the seizure onset zone (SOZ) identification algorithm network is inferred from a 30 second window that starts 20 presented in the next section. The same analysis is carried seconds before the clinical seizure onset time determined by out in the nine seizures from the remaining four patients. The the neurologist. The time window is shifted and the analysis two observations - significant increase in peak DI values in is repeated for different time-windows. We are interested in non-SOZ and the relatively low values for the peak DI from the changes in the entropy and causal connectivity strength at SOZ particularly at the beginning of the seizure, are broadly different recording electrodes with respect to the seizure start observed in all the remaining four patients. These observations and end times determined by the neurologist. Fig. 7b plots the imply that the seizures happen because the regions not in entropy estimates of all the channels versus time. The dotted SOZ become hyper-sycnhronous. This is in accordance with black lines are the seizure start and the end times. The solid our intuition that even during focal seizures, the seizure starts thick blue line is the mean entropy across all channels. It is from a small region (SOZ) and entraps the other regions clear from the figure that the entropy starts to rise during a of the brain in hypersynchronous activity. It is important to seizure and returns to the baseline immediately after the seizure note that this synchronous activity we are referring to is a ends. This is not surprising since the variance of the ECoG purely statistical measure and its relationship to the underlying signals is much higher during seizures than during non-seizure physiology of the brain is still an open problem [CITE]. activity, leading to higher entropy. However, the synchronous activity measured by neurologists is also derived from observing ECoG data and is not derived Next, we divide the set of 127 channels into two groups, the from the underlying physiology of the brain (rewrite the two first group consists of the channels in the seizure onset zone sentences in a better way). Therefore the inferences made from (SOZ). The second group consists of the remaining channels. our analysis are consistent with the scale at which neurologists SOZ is identified by the neurologist from visual analysis of make diagnosis. The analysis presented in this paper should be the ECoG recordings which the current clinical gold standard. further extended to understand and develop a unifying theory The SOZ of patient P1 consists of eight channels - RAH 1- of the mechanism of seizure generation and propagation. This 3, RPH 2-4 and RAMY 2, 3. The second group consists of is out of scope of this paper. We now use the observations made 119 channels. The dashed lines in Fig. 7c are the strengths from our analysis to develop a simple algorithm to identify of the strongest outward causal connection from each of the the seizure onset zone. (abrupt ending for this section. write 127 channels. The channels in SOZ are plotted in red and something more.) the non-SOZ channels are in green. The solid red and green lines in Fig. 7c are the average strength of the strongest outgoing causal connections from SOZ group and the non-SOZ seizure onset zone

• causal influence—directed connectivity

• graphical model of electrode’s recordings flow between • inward versus outward flow 9 population of neurons

RAMY9 RAH2 RAH1 RAMY1 RAMY8

RAH8 RAH7 RAH6 RAMY7 RAMY6

RPH6

RPH7 RAH5 RAH4 RAMY5 RAMY4

RPH5 RPH2 RPH1 RAH3 RAMY3 RAMY2 RPH3 RPH4 RPH8

(a) Causal connectivity between 25 electrodes in (b) Entropy estimates of all 127 ECoG channels (c) The strength of the strongest outgoing causal the epileptogenic zone from a 30 second win- recorded from patient P1. The solid line is the mean connection from each ECoG channel is plotted against dow that begins 20 seconds before the start of entropy of all channels. The dotted vertical black lines time. The seizure onset zone channels are in red and the seizure in patient P1. RAH - right anterior indicate the seizure start and end times. Change the the remaining are in green. The two solid lines are the hippocampus, RPH - right posterior hippocampus, estimation window to 30 sec from 60 sec. average maximum strength, one for each groups. RAMY - right amygdala. Change the figure. Fig. 7. Causal Connectivity Analysis of ECoG recordings during one seizure from patient P1.

‘strong’ connections. This threshold will determine the number group respectively. The rise in peak DI value during a seizure of directed edges connecting each node in the graph and is indicates that regions of the brain become more synchronized a parameter that can be optimized. We set it to 90% for during a seizure. The regions not in seizure onset zone show ease of dispalying the causal connectivity networks (rewrite the maximum increase. In addition, even the strongest causal this sentence). The results of our analysis from the patient connections from channels in SOZ are relatively weak com- P1 are plotted in Fig. 7. The estimated causal connectivity pared to the channels in non-SOZ regions, particularly at the amongst 25 electrodes (RAMY 1-9, RAH 1-8, RPH 1-8) in beginning of the seizures. This crucial observation forms the the epileptogenic zone of patient is plotted in Fig. 7a. The basis for the seizure onset zone (SOZ) identification algorithm network is inferred from a 30 second window that starts 20 presented in the next section. The same analysis is carried seconds before the clinical seizure onset time determined by out in the nine seizures from the remaining four patients. The the neurologist. The time window is shifted and the analysis two observations - significant increase in peak DI values in is repeated for different time-windows. We are interested in non-SOZ and the relatively low values for the peak DI from the changes in the entropy and causal connectivity strength at SOZ particularly at the beginning of the seizure, are broadly different recording electrodes with respect to the seizure start observed in all the remaining four patients. These observations and end times determined by the neurologist. Fig. 7b plots the imply that the seizures happen because the regions not in entropy estimates of all the channels versus time. The dotted SOZ become hyper-sycnhronous. This is in accordance with black lines are the seizure start and the end times. The solid our intuition that even during focal seizures, the seizure starts thick blue line is the mean entropy across all channels. It is from a small region (SOZ) and entraps the other regions clear from the figure that the entropy starts to rise during a of the brain in hypersynchronous activity. It is important to seizure and returns to the baseline immediately after the seizure note that this synchronous activity we are referring to is a ends. This is not surprising since the variance of the ECoG purely statistical measure and its relationship to the underlying signals is much higher during seizures than during non-seizure physiology of the brain is still an open problem [CITE]. activity, leading to higher entropy. However, the synchronous activity measured by neurologists is also derived from observing ECoG data and is not derived Next, we divide the set of 127 channels into two groups, the from the underlying physiology of the brain (rewrite the two first group consists of the channels in the seizure onset zone sentences in a better way). Therefore the inferences made from (SOZ). The second group consists of the remaining channels. our analysis are consistent with the scale at which neurologists SOZ is identified by the neurologist from visual analysis of make diagnosis. The analysis presented in this paper should be the ECoG recordings which the current clinical gold standard. further extended to understand and develop a unifying theory The SOZ of patient P1 consists of eight channels - RAH 1- of the mechanism of seizure generation and propagation. This 3, RPH 2-4 and RAMY 2, 3. The second group consists of is out of scope of this paper. We now use the observations made 119 channels. The dashed lines in Fig. 7c are the strengths from our analysis to develop a simple algorithm to identify of the strongest outward causal connection from each of the the seizure onset zone. (abrupt ending for this section. write 127 channels. The channels in SOZ are plotted in red and something more.) the non-SOZ channels are in green. The solid red and green lines in Fig. 7c are the average strength of the strongest outgoing causal connections from SOZ group and the non-SOZ Page 9 of 46 9

1 2 1 1 05 1 3 316 04 4 1 5 03 15 15 032 6 seizure onset zone 02 01 Channel Index 7 Channel Index 10 01 8 003 30 0 30 9 Channel Index 1 15 30 1 15 30 • causal influence—directed connectivityChannel Index Channel Index 10 20 (a) From model-based algorithm (b) From data-driven algorithm 11 12 30 Fig. 8. Causal connectivity between 30 high energy channels estimated from 241 251 261 271 ECoG data between 241s and 271s from the second seizure of P1. The channel 13 Time (s) indices with bluish rows and bluish columns (correspond todirected low DI estimates) 14 in Fig. 8a correspond to isolated nodes and are the estimatedinformation SOZ using 15 Fig. 7. A 30s snapshot of ECoG signals from the 30 high energy channels model-based algorithm. The corresponding channels in Fig. 8b have large net- 16 of P1. The seizure start time, represented by a vertical solid black line, is outflows of information and are the estimated SOZ from data-driven algorithm. identified by neurologist. Causal connectivity is estimated from this entire 17 30s window for this seizure record. DI. As a result, the SOZ nodes in the causal connectivity graph 18 For Revieware expected Only to have large net-outward flow of information. 19 and large ECoG amplitudes during seizures. The second stage The data-driven SOZ identification algorithm quantifies this 20 consisted of estimating the causal connectivity between every intuition to estimate SOZ. The net-outward flow () of causal 21 pair of M channels selected in the first stage to form a M ⇥ information from an electrode i is calculated using 22 M causal connectivity matrix. The causal connectivity was M 23 estimated from a shorter time-window around the seizure start 24 (i)= I(i j) I(j i) . (18) time, since we are interested in estimating the seizure onset { ! ! } 25 j=1,j=i electrodes. The following subsections describe the remaining X6 26 stages of the two proposed SOZ identification algorithms. If a patient had multiple seizures, the net outward flow of an 27 1) Model-based SOZ Identification Algorithm: In this ap- electrode is the average net outward flow of that electrode 28 proach, ECoG data is assumed to be derived from a MVAR across all seizures recorded in that patient. Then the normal- 29 ˜ process with Gaussian white noise. This is a very common ized net outward flow () of the electrode i is given by 30 assumption imposed to estimate causal connectivity between 31 ˜ (i) ECoG data [9], [13]. The MVAR model-based DI estimator is (i) = 100 . (19) 32 ⇥ (j) M 33 used to infer the causal connectivity between the selected j:(j)>0 high energy channels. The causal connectivity estimated using P 34 ˜ > 5% this approach only represents the linear causal interactions The electrodes with are considered to have significant 35 net outward flow of information in the causal connectivity 36 between the ECoG channels. However it is widely believed that seizures are highly non-linear phenomenon during which graph and are identified as the seizure onset electrodes for 37 that patient by the data-driven SOZ identification algorithm. 38 SOZ drives the rest of the network into a hypersynchronous 39 state [4], [8], [16]. As a result, we intuitively expect the seizure 40 onset electrodes in the causal connectivity graph to be isolated, C. Performance of Proposed SOZ Identification Algorithms 41 since model-based approach can only capture linear causal The energy detector selected the top M = 30 channels with 42 interactions. The proposed model-based algorithm therefore the largest energy computed from a 100s window comprising 43 identifies the nodes in the causal connectivity graph with of 50s of activity immediately before and after the seizure 44 zero degree (threshold was set to select only the strongest starts. The causal connectivity graph between these high 45 10% connections) as the estimated seizure onset zone. If a energy channels is then estimated using model-based and data- 46 patient had multiple seizures, the electrodes identified across driven DI estimators from a 30s window that begins 20s before 47 all seizures in that patient form the estimated seizure onset the seizure start time. We assumed that the current activity at 48 zone for that patient. an ECoG channel does not depend on more than 150ms of 49 2) Data-driven SOZ Identification Algorithm: In this al- past activity (150 samples at Fs =1KHz) at this channel 50 gorithm, no parametric model assumptions were imposed on and other channels. This corresponds to restricting the model 51 ECoG data. The causal connectivity between the M high order J, K search space to [1, 150] for the model-based DI 52 energy channels selected in the first stage was inferred using estimator. For the data-driven estimator J, K search space 53 the data-driven DI estimator. This estimator inferred both was [1, 4] because of its higher complexity, but we down- 54 linear and nonlinear causal interactions between channels. sampled the past activity by a factor of 50 (i.e. the past activity 55 Intuitively, activity at the SOZ electrodes drives the activity at of channel X can include xn,xn 50,xn 100,xn 150 ). The { } 56 the other electrodes into a hypersynchronous state via linear exact values of these parameters is not crucial as the algorithms 57 and nonlinear causal interactions [16]. We therefore expect the seem to be fairly robust to changes in these parameters. 58 SOZ electrodes to act as sources (with strong outgoing and Consider the second seizure record of patient P1. The 59 weak incoming causal connections) in the causal connectivity energy detector selected 30 high energy channels. Fig. 7 60 graph inferred around the seizure start time using data-driven shows the recordings from these channels in the 30s window Page 9 of 46 9

1 2 1 1 05 1 3 316 04 4 1 5 03 15 15 032 6 seizure onset zone 02 01 Channel Index 7 Channel Index 10 01 8 003 30 0 30 9 Channel Index 1 15 30 1 15 30 • causal influence—directed connectivityChannel Index Channel Index 10 20 (a) From model-based algorithm (b) From data-driven algorithm 11 12 30 Fig. 8. Causal connectivity between 30 high energy channels estimated from 241 251 • net261 outward271 flow = outwardECoG - datainward between 241s and 271s from the second seizure of P1. The channel 13 Time (s) indices with bluish rows and bluish columns (correspond todirected low DI estimates) 14 in Fig. 8a correspond to isolated nodes and are the estimatedinformation SOZ using 15 Fig. 7. A 30s snapshot of ECoG signals from the 30 high energy channels model-based algorithm. The corresponding channels in Fig. 8b have large net- 16 of P1. The seizure start time, represented by a vertical solid black line, is outflows of information and are the estimated SOZ from data-driven algorithm. identified by neurologist. Causal connectivity is estimated from this entire 17 30s window for this seizure record. DI. As a result, the SOZ nodes in the causal connectivity graph 18 For Revieware expected Only to have large net-outward flow of information. 19 and large ECoG amplitudes during seizures. The second stage The data-driven SOZ identification algorithm quantifies this 20 consisted of estimating the causal connectivity between every intuition to estimate SOZ. The net-outward flow () of causal 21 pair of M channels selected in the first stage to form a M ⇥ information from an electrode i is calculated using 22 M causal connectivity matrix. The causal connectivity was M 23 estimated from a shorter time-window around the seizure start 24 (i)= I(i j) I(j i) . (18) time, since we are interested in estimating the seizure onset { ! ! } 25 j=1,j=i electrodes. The following subsections describe the remaining X6 26 stages of the two proposed SOZ identification algorithms. If a patient had multiple seizures, the net outward flow of an 27 1) Model-based SOZ Identification Algorithm: In this ap- electrode is the average net outward flow of that electrode 28 proach, ECoG data is assumed to be derived from a MVAR across all seizures recorded in that patient. Then the normal- 29 ˜ process with Gaussian white noise. This is a very common ized net outward flow () of the electrode i is given by 30 assumption imposed to estimate causal connectivity between 31 ˜ (i) ECoG data [9], [13]. The MVAR model-based DI estimator is (i) = 100 . (19) 32 ⇥ (j) M 33 used to infer the causal connectivity between the selected j:(j)>0 high energy channels. The causal connectivity estimated using P 34 ˜ > 5% this approach only represents the linear causal interactions The electrodes with are considered to have significant 35 net outward flow of information in the causal connectivity 36 between the ECoG channels. However it is widely believed that seizures are highly non-linear phenomenon during which graph and are identified as the seizure onset electrodes for 37 that patient by the data-driven SOZ identification algorithm. 38 SOZ drives the rest of the network into a hypersynchronous 39 state [4], [8], [16]. As a result, we intuitively expect the seizure 40 onset electrodes in the causal connectivity graph to be isolated, C. Performance of Proposed SOZ Identification Algorithms 41 since model-based approach can only capture linear causal The energy detector selected the top M = 30 channels with 42 interactions. The proposed model-based algorithm therefore the largest energy computed from a 100s window comprising 43 identifies the nodes in the causal connectivity graph with of 50s of activity immediately before and after the seizure 44 zero degree (threshold was set to select only the strongest starts. The causal connectivity graph between these high 45 10% connections) as the estimated seizure onset zone. If a energy channels is then estimated using model-based and data- 46 patient had multiple seizures, the electrodes identified across driven DI estimators from a 30s window that begins 20s before 47 all seizures in that patient form the estimated seizure onset the seizure start time. We assumed that the current activity at 48 zone for that patient. an ECoG channel does not depend on more than 150ms of 49 2) Data-driven SOZ Identification Algorithm: In this al- past activity (150 samples at Fs =1KHz) at this channel 50 gorithm, no parametric model assumptions were imposed on and other channels. This corresponds to restricting the model 51 ECoG data. The causal connectivity between the M high order J, K search space to [1, 150] for the model-based DI 52 energy channels selected in the first stage was inferred using estimator. For the data-driven estimator J, K search space 53 the data-driven DI estimator. This estimator inferred both was [1, 4] because of its higher complexity, but we down- 54 linear and nonlinear causal interactions between channels. sampled the past activity by a factor of 50 (i.e. the past activity 55 Intuitively, activity at the SOZ electrodes drives the activity at of channel X can include xn,xn 50,xn 100,xn 150 ). The { } 56 the other electrodes into a hypersynchronous state via linear exact values of these parameters is not crucial as the algorithms 57 and nonlinear causal interactions [16]. We therefore expect the seem to be fairly robust to changes in these parameters. 58 SOZ electrodes to act as sources (with strong outgoing and Consider the second seizure record of patient P1. The 59 weak incoming causal connections) in the causal connectivity energy detector selected 30 high energy channels. Fig. 7 60 graph inferred around the seizure start time using data-driven shows the recordings from these channels in the 30s window seizure onset zone

• causal influence—directed connectivity

• net outward flow = outward - inward

nearly perfect match with the neurologist for all 12 seizures the main challenges

• spatial relations

• seizure onset zone

• spectral relation

• spectral bands of interest ↵, , , high

• coherence at different frequency bands a little background

• Mutual information (MI) measures dependencies among data sets

• MI in frequency a little background

• Mutual information (MI) measures dependencies among data sets

• MI in frequency ˜ ˜ MIX,Y (i, j)=I(dXi ; dYj )

• where 1 j2⇡ni ˜ Xn = e dXi Z0 n =1, 2,...,N and normalized frequency 0 s [0, 1] i 2 a little background

• Mutual information (MI) measures dependencies among data sets

• MI in frequency ˜ ˜ MIX,Y (i, j)=I(dXi ; dYj )

• where 1 j2⇡n ECoG i ˜ Xn = e dXi recordings Z0

n =1, 2,...,N and normalized frequency 0 s [0, 1] i 2 a little background

• Mutual information (MI) measures dependencies among data sets

• MI in frequency ˜ ˜ MIX,Y (i, j)=I(dXi ; dYj )

• where 1 spectral j2⇡ni ˜ representation Xn = e dXi Z0 n =1, 2,...,N and normalized frequency 0 s [0, 1] i 2 a little background

• coherence

• if X and Y were both Gaussian

MI ( , )=I(dX˜ ; dY˜ )= log[1 C ( )] X,Y i i i i X,Y i

linear X system Y

Brillinger, Guha, “Mutual information in the frequency domain” Journal of statistical planning and inference, 2007 a little background

• coherence

• if X and Y were both Gaussian

MI ( , )=I(dX˜ ; dY˜ )= log[1 C ( )] X,Y i i i i X,Y i

linear X Y system coherence at frequency i 6

6 0.7 1.1 0.36 t True Value True Value a KDMIF Kernel Density Based

Y 1 NNMIF Nearest Neighbor Based d n a

X 0.35 0.26 Bias

n 0.8

a little background e e KDMIF w t

e NNMIF b Mutual Information

I 0.6 2 3 4 0.16 M 0 10 10 10 • coherence 0 0.25 0.5 0 0.5 1 6 Number of Samples, Ns - (a) MI-in-frequency (b) Bias of the Estimators (c) Mutual Information Fig. 1. Comparing the performance of the kernel density based and nearest neighbor based estimators, KDMIF and NNMIF respectively, on simulated • if X and Y were both Gaussian generated from (15) using a two-tap lowpass filter. In Fig. 1a, the MI-in-frequency estimates obtained from KDMIF and NNMIF estimators along with the true value of MI-in-frequency are plotted against the normalized frequency for =0.5. Fig. 1b plots the bias (mean of the ratio of the estimate and the true value in the filter passband) against the number of data samples used for estimation for =0.5. Fig. 1c plots the MI estimate between X and Y obtained from kernel density and nearest neighbor algorithms along with the true value of MI for [0, 1]. ˜ ˜ 2 MIX,Y (i, i)=I(dXi ; dYi )= log[1 CX,Y (i)] driven estimation in (11) can be further simplified to against modulation index [5], [6], [8], a commonly used phase- amplitude coupling metric in neuroscience. Nf /2 1 i ˆI(X; Y )= MIXY (i; i) , where i = . (13) Nf Nf i=0 A. Comparing the KDMIF and NNMIF Estimators This result is obtainedP becausec linear models do not introduce X Y X cross-frequency dependencies and because negative frequencies Consider two stochastic processes and , where is a Y do not carry any extra information. Furthermore, the rela- white Gaussian process with standard deviation x and is linear obtained by X Ytionship between the MI and their MI-in-frequency for two processes related by (12) is stated in the following theorem. y[n]=h[n] x[n]+w[n], (15) system coherence at ⇤ Consider two discrete-time Gaussian stochastic Theorem 4.frequency i where W is a white Gaussian process with standard deviation processes X and Y related by of (12). The mutual information w that is independent of X and h[n] is a linear time-invariant between these processes, a scalar,2 is given by SX,Y () filter. We compared the performance of the kernel density 0.5 based and nearest neighbor based estimators by benchmarking | I(X; Y )= |MIXY (, ) d. (14) the estimates against the true value of MI-in-frequency and SX ()SY (0 ) R the mutual information between X and Y for the model in The proof of the above theorem is in the appendix. This (15). We used two different filers: a two-tap low pass filter, theorem means that MI between two Gaussian processes over h[n]=[, 1 ] , for [0, 1] and a 33-tap bandpass filter 2 the entire time can be obtained by integrating the contribution with passband in [0.15, 0.35] normalized frequency range. We from each frequency component. It is easy to see that the right observed that modulation index, a popular CFC metric, was hand side of (13) is just the Riemann sum of the integral on unable to correctly detect and quantify the strength of cross- the right hand side of (14), which converges to the true value frequency coupling for both these models. as Nf tends to infinity. This implies our estimator converges 1) Lowpass Filter: The samples of X and Y are generated to the true value for discrete-time Gaussian processes. from (15) with x = w =1and a lowpass filter with unit- Note that the MI estimation algorithm does not make any impulse response [, 1 ], for various values of [0, 1]. 2 parametric assumptions on the underlying model between The true value of MI-in-frequency at normalized frequency X and Y . The computation of MI via (11) can be greatly [0, 0.5] is obtained substituting the parameters of this 2 simplified by clustering the frequencies in ⇤x and ⇤y into model in (7) and is plotted in Fig. 1a for =0.5. In addition, groups without any significant dependencies across groups and the MI-in-frequency estimated by the KDMIF and NNMIF 4 using the chain rule of mutual information. In addition, if we algorithms from N = 64 10 data samples, with Nf = 4 ⇥ observe after the first step that significant MI-in-frequency 64,Ns = 10 is also plotted in Fig. 1a. It is seen that the estimates occur only at ( , ) , i 0,N 1 , then the MI i i 8 2 f estimates from both algorithms follow the true value closely, can be estimated using (13). ⇥ ⇤ without the knowledge of the underlying model. In addition, we evaluate the bias and the rate of convergence of both these ERFORMANCE VA L UAT I O N O N IMULATED ATA VI. P E S D algorithms as a function of Ns, with Nf = 64 in Fig. 1b. The performance of the data-driven MI-in-frequency and The bias is defined as the average value of the ratio of MI-in- mutual information estimators described in section IV and frequency estimate and its true value in the passband of the section V respectively is validated on simulated data. The lowpass filter. We observe that the NNMIF algorithm converges statistical significance of the estimates was assessed using faster and has lower bias than the KDMIF algorithm. We now the procedure described in section IV-C. In addition, we use both these algorithms to estimate the mutual information compare the performance of the MI-in-frequency estimators between X and Y for [0, 1]. The analytical expression for 2 linear X system Y a little background

• coherence

• if X and Y were both Gaussian

MI ( , )=I(dX˜ ; dY˜ )= log[1 C ( )] X,Y i i i i X,Y i • for linear Gaussian data MI ( , )=I(dX˜ ; dY˜ )=0 i = j X,Y i j i j 8 6 • coherence relates directly to mutual information in frequency back to data

• data, in time blocks, is transformed to the frequency domain

• dependencies in data cross frequency bands

• cross frequency coupling ↵, , , high ˜ ˜ MIX,Y (i, j)=I(dXi ; dYj )

RPBT1

RAMY2

RAH1 ˜ ˜ ˜ ˜ ˜ ˜ DFT X, Y fX,˜ Y˜ H(X,Y ) I(dX; dY ) Seizure ! ! ! Start Time

0 10 20 30 Time (s) back to data

• dependencies in data cross frequency bands

• averaged across SoZ electrodes and across patient’s data during ictal

• cross frequency coupling ↵, , , high MI estimator converges to the true value for Gaussian data 1 2.2

) and performs well on data from nonlinear models. The main z

H 5 novelty of our solution lies in utilizing frequency domain to 0 7 1

# estimate a time-domain metric and defining MI-in-frequency (

y 1.1 c 11 to detect and quantify statistical dependence in frequency. n

e 13

u Going forward, the performance of the proposed estimator q e r needs to analyzed for specific families of nonlinear rela- F 17 19 tionships in data. In addition, we also successfully applied 20 0 1 5 7 1113 171920 the MI-in-frequency metric to ECoG recordings to infer the Frequency (#10 Hz) cross-frequency coupling mechanisms underlying the epileptic Fig. 3. Cross-frequency coupling within a seizure onset electrode during activity. seizures. MI-in-frequency is estimated between all pairs of frequencies in 10, 20, , 200 Hz (excluding the line noise harmonics), to find the CFC REFERENCES { ··· } within each ECoG electrode in the seizure onset zone and the average of the [1] C. E. Shannon, “A mathematical theory of communication,” 1948. resulting CFC matrices across the eleven seizures considered is plotted. [2] T. M. Cover and J. A. Thomas, Elements of information theory. John section III and plot the estimates the MI for different values Wiley & Sons, 2012. [3] R. T. Canolty, E. Edwards, S. S. Dalal, M. Soltani, S. S. Nagarajan, of noise standard deviation w in Fig. 2b. Again, the MI H. E. Kirsch, M. S. Berger, N. M. Barbaro, and R. T. Knight, “High decreases with increasing noise power, as expected. These gamma power is phase-locked to theta oscillations in human neocortex,” two models demonstrate the performance and accuracy of our science, vol. 313, no. 5793, pp. 1626–1628, 2006. [4] J. Aru, J. Aru, V. Priesemann, M. Wibral, L. Lana, G. Pipa, W. Singer, estimators. and R. Vicente, “Untangling cross-frequency coupling in neuroscience,” Current opinion in neurobiology, vol. 31, pp. 51–61, 2015. V. C ROSS-FREQUENCY COUPLING IN EPILEPSY [5] Q. Wang, S. R. Kulkarni, and S. Verdu,´ “Universal estimation of Epilepsy is a common neurological disorder characterized information measures for analog sources,” Foundations and Trends in Communications and Information Theory, vol. 5, pp. 265–353, 2009. by repeated, unprovoked seizures. Developing more effective [6] M. S. Pinsker, “Information and information stability of random vari- treatments for epilepsy requires improving our understanding ables and processes,” 1960. of the seizure mechanisms and we used our MI-in-frequency [7] H. J. Larson and B. O. Shubert, Probabilistic models in engineering sciences. Wiley, 1979, vol. 2. metric to learn the cross-frequency coupling mechanisms dur- [8] H. Cramer´ and M. R. Leadbetter, Stationary and related stochastic ing seizures. ECoG data sampled at 1 KHZ was analyzed from processes: Sample function properties and their applications. Courier a total of eleven seizures recorded from four medial temporal Corporation, 2013. [9] D. R. Brillinger, “Second-order moments and mutual information in the lobe epilepsy patients. The clinical seizure start and end times analysis of time series,” Recent Advances in Statistical Methods, pp. as well as seizure onset zone was marked by the neurologist. 64–76, 2002. [10] R. Salvador, A. Martinez, E. Pomarol-Clotet, J. Gomar, F. Vila, S. Sarro, We set Nf = 100, implying spectral resolution of 10 Hz and A. Capdevila, and E. Bullmore, “A simple view of the brain through analyzed the data during preictal (spans three minutes before a frequency-specific functional connectivity measure,” Neuroimage, seizure start), ictal (during seizures) and postictal (spans three vol. 39, no. 1, pp. 279–289, 2008. minutes after seizure end time) periods. We estimated MI-in- [11] D. R. Brillinger and A. Guha, “Mutual information in the frequency domain,” Journal of statistical planning and inference, vol. 137, no. 3, frequency between various frequency components up to 200 pp. 1076–1084, 2007. Hz (excluding the line noise at 60 Hz and its harmonics) [12] D.-M. Arnold, H.-A. Loeliger, P. O. Vontobel, A. Kavcic, and W. Zeng, within each ECoG electrode during preictal, ictal and postictal “Simulation-based computation of information rates for channels with memory,” IEEE Transactions on Information Theory, vol. 52, no. 8, pp. periods. The resulting 17 17 CFC matrices from each SOZ ⇥ 3498–3508, 2006. electrode are averaged across the eleven seizures considered. [13] R. Malladi, “Inferring spectral and spatiotemporal dependencies from Due to the space constraints, we only plot the average CFC data and its application to epilepsy,” PhD dissertation, Rice University, Mar 2017. within a SOZ electrode during ictal period in Fig. 3. MI-in- [14] R. Malladi, D. Johnson, G. Kalamangalam, N. Tandon, and B. Aazhang, frequency along the principal diagonal in Fig. 3 is and “Measuring cross-frequency coupling using mutual information and its 1 is depicted using white color. More details, after considering application to epilepsy,” to be submitted to IEEE Transactions on Signal Processing, 2017. the multiple comparison problem, are provided in [13], [14]. [15] D. R. Brillinger, Time series: data analysis and theory. Siam, 2001, We observe from Fig. 3 that high-frequency oscillations are vol. 36. more synchronized during ictal period than low-frequency os- [16] D. W. Scott, Multivariate density estimation: theory, practice, and visualization. John Wiley & Sons, 2015. cillations. We also notice that high-frequency synchronization [17] A. Kraskov, H. Stogbauer,¨ and P. Grassberger, “Estimating mutual increases during ictal period, compared to preictal and postictal information,” Physical review E, vol. 69, no. 6, p. 066138, 2004. periods [13], [14]. These observations highlight the importance [18] R. Salvador, A. Martinez, E. Pomarol-Clotet, S. Sarro, J. Suckling, and E. Bullmore, “Frequency based mutual information measures between of high-frequency oscillations during seizures, which could clusters of brain regions in fMRI,” Neuroimage, vol. 35, 2007. potentially be targeted to disrupt the epileptic network and [19] R. Malladi, G. Kalamangalam, N. Tandon, and B. Aazhang, “Identifying treat epilepsy. seizure onset zone from the causal connectivity inferred using directed information,” IEEE Journal of Selected Topics in Signal Processing, VI. CONCLUSIONS vol. 10, no. 7, pp. 1267–1283, Oct 2016. In this paper, we developed a data-driven estimator for mutual information between dependent data. The proposed the main challenges

• spatial relations

• seizure onset zone

• spectral relation pre-ictal • coherence at different frequency bands

• temporal relations

• network changes before, during, and after seizure the main challenges

• spatial relations

• seizure onset zone

• spectral relation ictal

• coherence at different frequency bands

• temporal relations

• network changes before, during, and after seizure the main challenges

• spatial relations

• seizure onset zone

• spectral relation post-ictal

• coherence at different frequency bands

• temporal relations

• network changes before, during, and after seizure dynamics of coherence

• averaged across SoZ electrodes and across patient’s data

• neuronal oscillations become heavily synchronized

1 0.4 1 1 0.12 0.8 3 3 3 0 ) ) ) z z z 5 5 5 H H H 7 7 7 0 0 0 1 1 1 # # # ( ( ( 10 10 10 y y y 0.2 c c c 0.4 -0.36 n n n e e e u u u q q q 14 14 14 e e e r r r F F F 17 17 17 19 19 19 -0.72 20 20 20 0 0 1 3 5 7 10 14 171920 1 3 5 7 10 14 171920 1 3 5 7 10 14 171920 Frequency (#10 Hz) Frequency (#10 Hz) Frequency (#10 Hz) (a) Preictal (b) Ictal-preictal (c) Postictal-ictal Figure 3: Statistically significant estiamtes of MI in frequency over the frequencies 10, 20, , 200 Hz excluding 60, 180 Hz averaged over all SOZ channels from three medial temporal{ lobe··· epilepsy} patients with{ two seizures} each. Fig.3a plots the MI in frequency estimates during preictal period. Fig. 3b plots the difference in MI in frequency estimates between ictal and preictal periods, while Fig. 3c plots the difference between postictal and ictal periods respectively. As the brain transitions from preictal to ictal, neuronal oscillations in gamma and ripples become heavily sychronized and they weaken relatively with reemergence of relatively strong low-frequency synchronization during postictal stage.

303 the MI estimates are sometimes slightly negative potentially due to bias and we reset them to zero. 304 The statistically significant estimates are then averaged over all SOZ channels in all the six seizures 305 considered, resulting in three 18 18 matrices, one each for preictal, ictal and postictal periods. ⇥ th 306 Fig. 3a plots the averaged MI in frequency coupling matrix during preictal period. The (i, j) element 307 in the matrix in Fig. 3a is the averaged MI between the 10i and 10j Hz frequency components during 308 preictal period across all SOZ channels in the six seizures analyzed. The difference of the averaged 309 MI in frequency coupling matrix between ictal and preictal is plotted in Fig. 3b, while the difference 310 between postictal and ictal is plotted in Fig. 3c. The average MI in frequency coupling matrix 311 during ictal and postictal periods and the difference between postictal and preictal is depicted in 312 the supplementary material. It is clear from this figure that ripples have large values of MI in 313 frequency amongst them or are heavily synchronized during preictal stage, when compared with 314 low-frequency oscillations. The synchronization between all frequency pairs, particularly in gamma 315 and ripples, seems to increase during seizure when compared to just before seizure. And finally, the 316 synchronization in high frequency bands decreases and low frequencies become more synchronized 317 in postictal period compared to ictal period. These preliminary results highlight the role of gamma 318 and ripple high frequency oscillations (HFOs) during seizures. In addition, they also highlight the 319 dynamic reorganization of synchronization between neuronal oscillations during the course of a 320 seizure in SOZ channels. This analysis should be extended to learn the synchronization in frequency 321 at the remaining channels and also between pairs of channels. In addition, we need to classify whether 322 the excess synchronization during seizures is pathological or physiological by comparing the MI 323 in frequency coupling matrices during seizures with those during interictal periods as the baseline. 324 Analyzing the pathological oscillations occurring during seizures could improve our understanding 325 of epileptic seizures, and potentially lead to better treatments in the future.

326 7 Conclusions and Future Work

327 Motivated to understand frequency coupling in electrophysiological recordings from brain, we defined 328 mutual information in frequency between stochastic processes, that are not necessarily Gaussian and 329 estimated it using a model-free estimator. The performance of this proposed estimator is demonstrated 330 on linear and nonlinear models. We then applied the proposed estimator to infer the coupling between 331 neuronal oscillations before, during and after seizures. In summary, we developed a first of its kind 332 metric to detect statistical independence in frequency between neuronal oscillations. Going forward, 333 two exciting directions to pursue are improving on the fixed frequency resolution of the current 334 FFT-based estimator using wavelets and inferring the cross-frequency coupling across all channels 335 with interictal periods as baseline, to potentially discover hitherto unknown cross-frequency coupling 336 mechanisms coordinating the neuronal dynamics during seizures.

8 final thoughts

• grand challenges

• develop tools

• recording—imaging

• signal-data processing (probabilistic and data driven) final thoughts

• our focus

• develop tools

• information theoretic the maximum likelihood estimate of the probability that a electrodes novel event has occurred is computed from the classifier’s output and compared to a patient-specific probability threshold to produce a seizure prediction. The algorithm consists of an offline training process and an • learning seizure predictor online testing process, only the latter of which is implemented on the FPGA. The block diagram of the testing process is neurostimulator shown in figure 2. In this section, we will describe the key Fig. 1. Overview of our neurostimulation system. The intracranial electrodes components of both processes and outline the offline training are implanted directly on the brain. The implanted chip is external, perhaps behind the ear similar to a hearing aid and contains a custom computational process in the next four subsections. • epilepsy ASIC as well as the battery and all power components.

lation to the region of the brain where focal seizures originate. The system contains three stages: (1) reading neural data, • build systems to affect the circuit (2) processing the neural data and producing a prediction decision, and (3) applying neurostimulation upon positive prediction. Each of these stages are described below. The first stage of our system is to collect a series of Fig. 2. Block diagram of the online seizure prediction algorithm that processes iEEG data, sampled from electrodes in the seizure onset zone, to produce a • clinical trial neural data readings from a net of implanted electrodes. This temporal seizure prediction. net of implanted electrodes implements a system of energy harvesting and wireless data and power transmission [6]. These electrodes would then communicate wirelessly with a data Feature Extraction processing assembly, which will include an ASIC with a We begin with six channels of raw iEEG data sampled at programmable ARM core to host patient-specific parameters. 1000 Hz and apply a three second sliding window with two After receiving the readings from the electrodes, the ASIC seconds of window overlap. Let xl(k) be the voltage measured and ARM core assembly would then process that data by by intracranial electrode l at sample k in each window n, passing it through an algorithmic pipeline to produce a seizure where l = 1, 2, ..., L and k = 1, 2, ..., K. With each pair of prediction based on the current window of neural activity. windowed iEEG signals xi(k) and xj(k), with i, j where 2 L When the algorithm predicts an oncoming seizure, the data = {1, 2, ..., L } denotes the full set of electrodes and when L processing assembly will wirelessly transmit an encoded signal i = j, we compute the average cross-spectral density Pi,j(n) 6 to the implanted neurostimulator. This encoded signal will using Welch’s method [8]. We also compute the autospectrum drive the neurostimulator to apply a low-frequency signal in densities Pi,i(n) and Pj,j (n) of iEEG signals xi(k) and xj(k) the anticipated seizure onset zone in order to suppress the respectively using Welch’s method [8]. impending seizure. We then model the brain as a fully connected graph, Our work focused on solving the prediction problem representing electrodes as nodes and using the previously through a machine learning algorithm, and then transitioning computed Pi,i(n), Pj,j (n) and Pi,j(n) to weight the edges that algorithmic solution to be run on hardware. We moved with the magnitude squared of the coherence estimate (1). We toward the hardware solution with the end goal of fabricating represent this graph as an adjacency matrix C(n) where the an ASIC for the final system. The following sections outline (i, j) entry represents the coherence between electrode i and both our algorithmic approach of solving the prediction prob- electrode j as the following:

lem and the process we underwent to implement that algorithm 2 Pi,j(n) in hardware. Future iterations of the research project will Ci,j(n)= | | (1) focus on wireless communication with the net of implanted Pi,i(n)Pj,j (n) electrodes. The adjacency matrix C(n) is an L L symmetric matrix, ⇥ where L is the number of electrodes, and represents the III. SEIZURE PREDICTION ALGORITHM connectivity of the electrodes [7]. We normalize this matrix Our machine learning algorithm transforms iEEG data into into C˜(n) and compute the i element of its eigenvector a seizure prediction. We first extract graph-based coherence centrality EV C(n) with (2) for dimensionality reduction. features from six electrodes of iEEG data, recorded in the patient’s SOZ, using the method described in Burns [7]. To C˜i,j(n) EV Cj(n) EV C (n)= j · (2) select the SOZ electrodes, we utilized our lab’s previously de- i (n) veloped seizure localization algorithm [4] as well as clinician P input. We then compute the eigenvector centrality of the graph where (n) is the leading eigenvalue of C˜(n) [7]. By comput- and classify these features using a one-class support vector ing the EV C(n), we transform the feature representing our machine (SVM), which detects novelties in the signal. Finally, window from an L L matrix to an L 1 vector. ⇥ ⇥ the maximum likelihood estimate of the probability that a electrodes novel event has occurred is computed from the classifier’s output and compared to a patient-specific probability threshold to produce a seizure prediction. The algorithm consists of an offline training process and an seizure predictor online testing process, only the latter of which is implemented final thoughts on the FPGA. The block diagram of the testing process is neurostimulator shown in figure 2. In this section, we will describe the key Fig. 1. Overview of our neurostimulation system. The intracranial electrodes components of both processes and outline the offline training are implanted directly on the brain. The implanted chip is external, perhaps behind the ear similar to a hearing aid and contains a custom computational process in the next four subsections. ASIC as well as the battery and all power components. • our focus lation to the region of the brain where focal seizures originate. The system contains three stages: (1) reading neural data, (2) processing the neural data and producing a prediction • develop tools decision, and (3) applying neurostimulation upon positive prediction. Each of these stages are described below. The first stage of our system is to collect a series of Fig. 2. Block diagram of the online seizure prediction algorithm that processes iEEG data, sampled from electrodes in the seizure onset zone, to produce a neural data readings from a net of implanted electrodes. This temporal seizure prediction. net of implanted electrodes implements a system of energy • information theoretic harvesting and wireless data and power transmission [6]. These electrodes would then communicate wirelessly with a data Feature Extraction processing assembly, which will include an ASIC with a We begin with six channels of raw iEEG data sampled at programmable ARM core to host patient-specific parameters. 1000 Hz and apply a three second sliding window with two After receiving the readings from the electrodes, the ASIC seconds of window overlap. Let xl(k) be the voltage measured • learning and ARM core assembly would then process that data by by intracranial electrode l at sample k in each window n, passing it through an algorithmic pipeline to produce a seizure where l = 1, 2, ..., L and k = 1, 2, ..., K. With each pair of prediction based on the current window of neural activity. windowed iEEG signals xi(k) and xj(k), with i, j where 2 L When the algorithm predicts an oncoming seizure, the data = {1, 2, ..., L } denotes the full set of electrodes and when L processing assembly will wirelessly transmit an encoded signal i = j, we compute the average cross-spectral density Pi,j(n) • epilepsy 6 to the implanted neurostimulator. This encoded signal will using Welch’s method [8]. We also compute the autospectrum drive the neurostimulator to apply a low-frequency signal in densities Pi,i(n) and Pj,j (n) of iEEG signals xi(k) and xj(k) the anticipated seizure onset zone in order to suppress the respectively using Welch’s method [8]. impending seizure. We then model the brain as a fully connected graph, • build systems to affect the circuit Our work focused on solving the prediction problem representing electrodes as nodes and using the previously through a machine learning algorithm, and then transitioning computed Pi,i(n), Pj,j (n) and Pi,j(n) to weight the edges that algorithmic solution to be run on hardware. We moved with the magnitude squared of the coherence estimate (1). We toward the hardware solution with the end goal of fabricating represent this graph as an adjacency matrix C(n) where the an ASIC for the final system. The following sections outline (i, j) entry represents the coherence between electrode i and • clinical trial both our algorithmic approach of solving the prediction prob- electrode j as the following:

lem and the process we underwent to implement that algorithm 2 Pi,j(n) in hardware. Future iterations of the research project will Ci,j(n)= | | (1) focus on wireless communication with the net of implanted Pi,i(n)Pj,j (n) electrodes. The adjacency matrix C(n) is an L L symmetric matrix, ⇥ where L is the number of electrodes, and represents the III. SEIZURE PREDICTION ALGORITHM connectivity of the electrodes [7]. We normalize this matrix Our machine learning algorithm transforms iEEG data into into C˜(n) and compute the i element of its eigenvector a seizure prediction. We first extract graph-based coherence centrality EV C(n) with (2) for dimensionality reduction. features from six electrodes of iEEG data, recorded in the patient’s SOZ, using the method described in Burns [7]. To C˜i,j(n) EV Cj(n) EV C (n)= j · (2) select the SOZ electrodes, we utilized our lab’s previously de- i (n) veloped seizure localization algorithm [4] as well as clinician P input. We then compute the eigenvector centrality of the graph where (n) is the leading eigenvalue of C˜(n) [7]. By comput- and classify these features using a one-class support vector ing the EV C(n), we transform the feature representing our machine (SVM), which detects novelties in the signal. Finally, window from an L L matrix to an L 1 vector. ⇥ ⇥