Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2017 Jul 24.
Published in final edited form as: Proc IEEE Int Symp Biomed Imaging. 2015 Jul 23;2015:351–354. doi: 10.1109/ISBI.2015.7163885

TOPOLOGICAL EPILEPSY SEIZURE DETECTION IN ELECTROENCEPHALOGRAPHIC SIGNALS

Yuan Wang *, Hernando Ombao , Moo K Chung *
PMCID: PMC5523055  NIHMSID: NIHMS868642  PMID: 28748026

Abstract

We propose a seizure detection method for electroencephalographic (EEG) epilepsy data based on a novel multi-scale topological technique called persistent homology (PH). Among several PH descriptors, persistence landscape (PL) possesses many desirable properties for rigorous statistical inference. By building PLs on EEG epilepsy signals smoothed by a weighted Fourier series (WFS) expansion, we compared the before and during phases of a seizure attack in a patient diagnosed with left temporal epilepsy and successfully identified site T3 as the origin of the seizure attack.

Index Terms: EEG, epilepsy, persistence landscape, persistent homology

1. INTRODUCTION

Epilepsy is a neurological problem that can negatively affect the brain’s visual, audial and motor functions [1]. Researchers are pursuing all possible avenues to gain a better understanding of the disease. EEG, an important imaging modality for understanding the function and dysfunction of the human brain, is a popular tool for studying epileptic seizures because of its non-invasive procedure and high temporal resolution. It indirectly records neuronal activity by capturing signals recorded by electrodes on the scalp. Many statistical methods have been developed over the past decades to study the patterns of these nonlinear electrical signals [2]. This paper aims to push the boundaries by exploring the topological detection of epileptic seizure based on multichannel EEG signals.

The PH technique reveals the topological structures of space X through a dynamic ranking of multi-scale features in the observed sample [3]. When PH is applied to functional data, the basic building blocks are the sub-level sets of functions. By changing the threshold values, we create a dynamic sequence of nested sub-level sets called a Morse filtration. As the threshold (called the filtration value) increases, the sublevel sets change from multiple isolated components into connected clusters. Since the ground truth of X is unknown in scientific experiments, we seek a compact PH descriptor that ranks topological features by their lifetime in the filtration. A collection of bars known as barcode serves exactly to such purpose. As a new PH descriptor, PL builds landscape-like structures on barcode that possess desirable statistical properties [4].

Our main contribution is the first ever application of the topological descriptor PL to the seizure detection problem in EEG and building the related signal analysis pipeline.

2. METHOD

Weighted Fourier series

For noisy functional measurements, it is necessary to smooth out high frequency noise in the function. We will use the WFS expansion, which is equivalent to the diffusion wavelet transform [5], to filter out noise in an EEG signal. Consider isotropic diffusion in an interval [−T, T] ∈ ℝ:

{g(x,σ)σ=-2gx2g(x,σ),σ0,x[-T,T],g(x,0)=f(x), (1)

where the observed functional measurement f is treated as the initial condition. By imposing the additional periodic boundary conditions

g(-T,σ)=g(T,σ),gx(-T,σ)=gx(T,σ),

we obtain WFS

a0+j=1ke-j2π2T2σ[ajcos(jπxT)+bjsin(jπxT)], (2)

which gives the unique solution of (1) when k = ∞. The Fourier coefficients are given by

aj=1T-TTf(x)cos(jπxT)dx,bj=1T-TTf(x)sin(jπxT)dx.

The diffusion time or scale σ modulates the smoothness of the estimation.

Morse filtration

We apply PH to a smoothed 1D function g. Define the sub-level set of g thresholded at λ as

Xλ={x:g(x)λ}.

By varying λ, we create a dynamic sequence of nested subsets called a Morse filtration:

Xλ1Xλ2Xλ2forλ1λ2λ3.

As the filtration value λ increases, the sub-level set change from multiple isolated components into connected clusters. These topological changes can be tabulated by the barcode [3]. A βi-barcode is a set of bars with their endpoints representing birth and death times of i-th-dimensional holes in the filtration. A long bar in a barcode indicates a persistent feature in X in the face of growth, whereas short intervals in a barcode correspond to transient signals, noise or inadequate sampling. Figure 1 shows an example of β0-barcode construction on a one-dimensional Morse function with unique local minima a < b < c and maxima d < e < f. As the filtration value γ increases from −∞ to ∞, new connected components are born consecutively in the sublevel sets Xg(a), Xg(b) and Xg(c), and are merged in the sublevel sets Xg(d), Xg(e) and Xg(f) according to the Elder Rule: older components live on at a merging junction [3]. The birth and death times of components are paired in as bars in a β0 barcode.

Fig. 1.

Fig. 1

Top left: barcode construction on a one-dimensional Morse function g as the filtration value increases. Bottom left: barcode and its bump function (3). Right: the PL traces all layers of outlines of the bump function.

Persistence landscape

Statistical inferences are difficult to perform on barcodes. PL is a new PH descriptor that possesses many desirable statistical properties such as a Central Limit Theorem, on which it is easier to build test statistics [4]. Given an interval (a, b) on the barcode with ab, we can define the piecewise linear bump function h(a,b): ℝ → ℝ by

h(a,b)(t)=max(min(t-a,b-t),0). (3)

The geometric representation of the bump function (3) is a right-angled isosceles triangle with height equal to half of the base of the corresponding interval in the barcode. The PL of {(ai,bi)}i=1N is the set of functions defined by

νk(t)=k-thlargestvalueof{f(ai,bi)(t)}i=1N, (4)

with νk(t) = 0 for k > N. Geometrically, the PL {νk}k=1,2,3 traces the k-th outermost outline of these crossover triangles. The landscape assumes zero value elsewhere. Figure 1 illustrates PL for the underlying Morse function.

For each subsampled EEG signal, we construct PL. Then, for n PLs, { νk1,,νkn}, we compute the average persistence landscape, ν¯(k,t)=1ni=1nνki(t). Then we compare two average PLs ν̄1 and ν̄2 by the l2-distance

d2=(k=1Nν¯1(k,t)-ν¯2(k,t)2dt)1/2,

which is then discretely approximated by a trapezoidal Riemann sum with the partition intervals Δtj = tj+1tj, j = 1, …, m−1, being identical across the two sets of landscapes ν̄1 and ν̄2.

Subsampling and Permutation test

In a single-trial context, for statistical inference, we subsample a smoothed EEG signal independently before and during seizure. Given a smoothed univariate signal, ten subsamples are created by pooling functional values at the every sth time points starting at s for the sth subsample (s = 1, …, 10). The subsampling scheme is shown in Figure 2. This gives two groups of 10 samples each. Then we compute d2 distance between the before and during seizure. Since the distribution for d2 is unknown, we utilize a permutation test and obtain its empirical distribution for statistical inference.

Fig. 2.

Fig. 2

Subsampling scheme: for each channel, smoothed functional values at every tenth time points starting at t = s make up the sth subsample, s = 1, …, 10.

3. SIMULATIONS

In each simulation, two blocks of signals were generated. In Study 1, two blocks were almost identical, whereas in Study 2, the second block showed significant frequency variations. In each simulation, we rejected the null hypothesis that the population mean PLs for the two phases were identical if the p-value was small.

Study 1

We simulated 100 epochs of two blocks of EEGs in the form Epoch = Baseline + Noise. In the first block, the baseline signal was generated by smoothing the AR(1) model y(t) = −0.9y(t−1)+ε(t), where t = 1, …, 100, μ1(0) = 0, and the innovation process was Gaussian ε ~ N(0, 0.12), with a robust LOESS procedure [6]. In the second block, the baseline signal was 0.8 times the baseline signal in the first block. In each simulation, independent Gaussian noise N(0, 0.52) was added at every time point of first block of the baseline signal, whereas the second block was assigned independent noise N(0, 12). Time was scaled down by a factor of 10.

Study 2

In each of the 100 simulations, we simulated two consecutive blocks of signals μ1 and μ2 by autoregressive models (AR) inducing different frequencies. The first half of the signal μ1 was generated by the AR(1) model: μ1(t) = 0.9μ1(t−1)+ε(t); the second block of the signal μ2 was generated by the AR(1) model: μ2(t) = −0.9μ2(t − 1) + ε(t), where t = 1, …, 100, μ1(0) = 0, and the innovation process was Gaussian ε ~ N(0, 0.12). Time was scaled down by a factor of 10. This resulted in high frequency variations in the second block.

Results

Figure 3 shows one representative simulation result and p-values for 100 simulations in each study. In Study 1 (left), there were three cases where the p-value was smaller than the 0.01 threshold, and so 3% false positives were detected at the threshold. In Study 2 (right), there were 97 cases where the p-values were smaller than 0.01, so the proposed method had 97% power in detecting frequency variation in the signal.

Fig. 3.

Fig. 3

Simulated EEG signal in one simulation (innate) and p-values for 100 simulations.

4. APPLICATION

In the current study, EEG data was retrieved by the Department of Neurology at the University of Michigan from a single female subject already diagnosed with epilepsy on the left temporal lobe. Figure 4 shows a montage of the eight channels at which the EEG signals were sampled at a rate of 100 Hz with a total number of 32,680 time points. For this particular episode, the seizure initiates at the left temporal site (T3 channel) approximately halfway through the recording. We applied the topological detection method to the EEG data to identify the seizure origin.

Fig. 4.

Fig. 4

Left: EEG channels in accordance with the international 10–20 system; T=temporal, P=parietal, C=central; odd (even) numbers indicate the left (right) hemisphere. Middle: EEG recording with a sampling rate of 100Hz over 163.4s; time 0 indicates the start of the seizure attack. Right: WFS denoising with degree k = 85 and bandwidth σ = 0.01. All amplitude units are in μV.

Denoising, barcode and PL

The effect of denoising by WFS with k = 85 and σ = 0.01 is shown in Figure 4. Since there are two free parameters k and σ in the WFS representation, we performed additional analyses on the different combinations of parameters to see how sensitive the changing parameters are on the final outcome. Due to space limitation, only the combinations of degrees k = 75, 85, 95 and bandwidth σ = 0.01 are shown but other combinations produce similar results. Barcodes and their corresponding PLs calculated for signals smoothed at k = 85 and σ = 0.01 are shown in Figures 5(a) (before seizure) and 5(b) (during seizure) for the channels C4 and T3. We can see that T3 has more dominant landscape features than C4.

Fig. 5.

Fig. 5

Examples of observed barcodes (side) for one subsample and average persistence landscapes (middle) over all subsamples with smoothing parameters k = 85 and σ = 0.01 before and during seizure; each subsample produces one barcode, an average persistence landscape is the average bump function corresponding to barcodes across all subsamples.

Seizure origin detection

Table 1 shows the p-values for the observed d2 distance between average PLs to be greater than the shuffled distance based on 2000 permutations. The method consistently identified site T3 as the most significant at a 1% significance level with Bonferroni correction. Neurologists can use this topological descriptors to guide them to examining further those regions that show the strongest significant changes during the seizure episode.

Table 1.

Summary of p-values for combinations of k = 75, 85, 95 and σ = 0.01 at 2000 permutations.

k = 75 k = 85 k = 95
σ = 0.01 C3 0.132 0.136 0.088
C4 0.098 0.108 0.118
Cz 0.346 0.324 0.122
P3 0.140 0.338 0.106
P4 0.108 0.018 0.104
T3 0.001 0.001 0.001
T4 0.118 0.022 0.024
T5 0.102 0.112 0.121

5. DISCUSSION

Previous analysis on the same epilepsy data only showed the evolution of the spectral power and coherence during the seizure episode but was not abel to identify seizure location [2]. Here we demonstrated the potential utility of our proposed procedure for seizure localization. As part of our future study, we shall consider the option of a parametric test for distances between average PLs, and explore the use of PH in comparing network difference in phases of a seizure attack.

Acknowledgments

The research was funded by NIH grant UL1-TR000427 and the Vilas Associate Award from University of Wisconsin-Madison.

References

  • 1.Fried I. Auras and experiential responses arising in the temporal lobe. The Journal of Neuropsychiatry and Clinical Neurosciences. 1997 Jan;9(3):420–8. doi: 10.1176/jnp.9.3.420. [DOI] [PubMed] [Google Scholar]
  • 2.Ombao H, von Sachs R, Guo W. SLEX analysis of multivariate nonstationary time series. Journal of the American Statistical Association. 2005 Jun;100(470):519–531. [Google Scholar]
  • 3.Edelsbrunner H, Harer J. Computational Topology. American Mathematical Society; Jan, 2010. [Google Scholar]
  • 4.Bubenik P. Statistical topology using persistence landscapes. 2013 Jul; arXiv 1207.6437. [Google Scholar]
  • 5.Chung MK, Schaefer SM, van Reekum CM, Peschke-Schmitz L, Sutterer MJ, Davidson RJ. A unified kernel regression for diffusion wavelets on manifolds detects aging-related changes in the amygdala and hippocampus. 17th International Conference on Medical Image Computing and Computer Assisted Intervention (MICCAI); 2014. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Cleveland William S. Robust locally weighted regression and smoothing scatterplots. Journal of the American Statistical Association. 1979;74(368):829–836. [Google Scholar]

RESOURCES