A wavelet-approximate entropy method for epileptic activity detection from EEG and its sub-bands

Epilepsy is a common brain disorder that about 1% of world's population suffers from this disorder. EEG signal is summation of brain electrical activities and has a lot of information about brain states and also used in several epilepsy detection methods. In this study, a wavelet-approximate entropy method is applied for epilepsy detection from EEG signal. First wavelet analysis is applied for decomposing the EEG signal to delta, theta, alpha, beta and gamma subands. Then approximate entropy that is a chaotic measure and can be used in estimation complexity of time series applied to EEG and its sub-bands. We used this method for separating 5 group EEG signals (healthy with opened eye, healthy with closed eye, interictal in none focal zone, interictal in focal zone and seizure onset signals). For evaluating separation ability of this method we used t-student statistical analysis. For all pair of groups we have 99.99% separation probability in at least 2 bands of these 6 bands (EEG and its 5 sub-bands). In comparing some groups we have over 99.98% for EEG and all its sub-bands.


INTRODUCTION
Epilepsy is a common and important brain disorder and about 1% of world population suffers from this disorder.So diagnosis of epileptic activity in brain can be useful for these patients.As we know, abnormal neuronal firing in the brain is the reason of epileptic activities or seizure onsets.And these activities are evident in Electroencephalogram (EEG) signal.EEG is summation of neuronal electrical Activities and widely used in diagnosis epileptic disorders and seizure onsets.Three different states (healthy, interictal and ictal) obvious in monitoring EEG signal for diagnosis epileptic activities.Brain activity in the ictal, interictal and healthy states are significantly different.Since 1970s EEG signal used for automatic diagnosis of epileptic activities in brain.Till now several methods used for this purpose, since the first days of automatic seizure detection, representations based on Fourier transform and parametric methods have been applied [1].
Through the complex and chaotic behavior of brain activity chaos related parameters are useful to identifying epilepsy.Entropies, fractal dimensions, Lyapunov exponents are main complexity parameters.Also artificial neural network based methods and wavelet based methods used to diagnosis epilepsy.Also time-frequency methods used for feature extraction from EEG signal.Alexandros T. Tzallas has been used t-f analysis to determine the EEG segments, which contains epileptic seizures and extraction feature from power spectral density (PSD) [2].It seems that using Discrete Wavelet Transform (DWT) is better than the Fourier and Fast Fourier Transform since by wavelet transform we have better time-frequency localization, multi-rate filtering, and scale-space analysis [3].
Hiram Firpi presented a methodology to capture one or more deterministic dynamic components of EEG signal Using Genetically Programmed Artificial Features [4].
Because of chaotic behavior of EEG signal chaos related parameter are useful to epilepsy detection [5].Some research used correlation dimension and lyapanov exponent on feature extraction [6,7].In the latter research wavelet applied for preprocessing and decomposition of EEG to its sub-band and it has been shown that calculating the parameter for EEG and its sub-band is useful in epilepsy detection and other same application [8,9].Among lots of parameters which have been used as features, entropies have important role.Entropy is a measure of system complexity and there are several types of entropies that appropriate for our approach.Al-though there is different definition for entropy and the way to calculate it but all kind of entropies show system randomness and regularity.
Some researches based on sample and spectral entropy [10] have been done in application of automatic seizure detection.Also Shannon entropy [11,12] and Permutation entropy [13] have been used as suitable features in the case of non-stationary time series.However all of these kinds of entropies are so useful and applicable. in the other hand, approximate entropy is the most usable parameter in this field [14][15][16].In the last decade of century 20, STEVEN M. PINCUS introduces approximate entropy as an efficient measure of systems complexity [17].Till now this parameter used in several EEG based applications [18,19].In some researches just approximate entropy have been calculated for EEG [20] and some methods have been used approximate entropy with another parameter for increasing accuracy [21].In this study, a wavelet-approximate entropy method is used for epilepsy detection.We used EEG standard subbands that are suitable in analysis and conclusion.

EEG Dataset
The dataset contains 500 single channel EEG segments in five different sets (100 single channel EEG segments for each O, Z, F, N, and S sets).Sets O and Z are in healthy state with eyes open and closed, respectively.This two sets of segments (O, Z) captured by external surface electrodes.Sets F and N are in interictal state obtained from epileptic zone and hippocampus zone of brain, respectively.Set S refer to ictal state.These three sets of segments (F, N and S) attained by intracranial electrode.
The duration of each segment is 23.6 sec and sampled by 173.61 Hz, so each segment contains 4096 samples.All these EEG segments are recorded with the same 128-channel amplifier that converts by 12 A/D convertor with bit rate of 12, and then were sampled on 173.61 Hz [22].

Wavelet Decomposition
The time-frequency representation based on Fourier analysis suffers from a significant problem because the spectral election is based on a sinusoidal representation that has an infinite extent in the basis function.Wavelet analysis idea was developed because of this defect of time-frequency analysis.A wavelet is a "short wave", which has its energy concentrated in time to give a tool for the analysis of transient, non-stationary, or timevarying phenomena [8].Several works applied the Wavelet Transform to the study of EEGs.Wavelet analysis can represent EEG sub bands as a weighted sum of shifted and scaled versions of the original wavelet, without any loss of information and energy.
For this goal four levels discrete wavelet transform (DWT) with third-order Daubechies (db3) wavelet function have been used.Since our dataset is in range 0-60 Hz, coefficients D1, D2, D3, D4 and A4 corresponding to 30-60 Hz, 15-30 Hz, 8-15 Hz, 4-8 Hz and 0-4 Hz respectively that are almost standard physiological sub-bands.Now we can calculate Approximate Entropy for each sub-band in the next level.

Approximate Entropy
Approximate entropy (ApEn) is a quantification measure which gives us lots of information about complexity and regularity of time series data.
For a given N point time series data Choose m points subsequences of EEG signal as below: Then define the distance between X(i) and X(j), d[X(i), X(j)], as the maximum absolute difference between them as below: And define RCO as:

RCO r std  
That STD is the standard deviation of sequence, and r can be varying between 0 and 1.Then we define  as below:     Then we can define as below For fixed m and r, ApEn value of sequence is: We used the EEG and its sub-bands extracted from the wavelet decomposition as inputs for ApEn algorithm.We calculate ApEn value for each sub-band with r = 0.15.For calculating ApEn value for each segment we used 0.5 second sub-segments of each segment and averaged the calculated values over length of each segment.
Although it's not necessary to average ApEn value calculated for sub-segments over each segment but it can be useful and reduce noise and artifacts effects on ApEn value for each segment.We performed this procedure for all 100 segments in each group and finally we have 100 ApEn value for each group (1 ApEn value for each segment in group).The mean and standard deviation of ApEn value for each group has been shown in  and Table 2.
The ApEn value has been calculated for EEG as we see in Figure 4 although has different mean for all 5 group and we can see this difference in Figure 4.As we see in Figure 5 without any analysis clearly it has different value for most segments of healthy with eyes close and interictal in nonfocal zone and ictal segments.But ApEn values for healthy segments and interictal in focal zone have overlap with other groups in original EEG segments.

T-student Analytical Analysis
Statistical tests allow us to make statements with a degree of precision, but cannot actually prove or disprove anything.A significant result at the 95% probability level tells us that our data are good enough to support a conclusion with 95% confidence (but there is a 1 in 20 chance of being wrong).In biological work we accept this level of significance as being reasonable.T-test is a statistical analysis for estimate the probability of segregate between two groups of data.

T -test uses the mean and variance of each group to calculate segregation probability (p-value). For this goal we must first calculate t-score and degree of freedom (df).
For calculating t-score we need first to calculate that is variance of the difference between the two means.
X and 2 X are mean of group 1 and group 2 respectively.And degree of freedom is calculated as:  After calculating score and we can extract p-value from p-value table of t-test analysis.

t df
In this work ApEn value computed for each segment and its sub-bands used to compare same sub-band of each group with other group.

Summary of method
 Step 1: wavelet decomposition of EEG signal to achieve standard physiological sub-bands  Step 2: calculating Approximate Entropy (ApEn) value for EEG and its sub-bands  Step 3: statistical analysis with t test for investigate the potential of separation between groups with extracted features with Approximate Entropy (ApEn) for EEG and its sub-bands.

RESULTS
Means and variances of ApEn values have been calculated for these 5 groups are shown in Table 1 and 2

.
With these parameters we calculate t-score and degree of freedom for all EEG data and their sub-bands.With these values we tabulate P-values of two sided t-test and the results shown as Table 3.
The confidence interval for most groups are so good and as we see in Table 3 most of parameters extracted  for these 5 groups show considerable difference between these groups.We compared all pairs of groups but distinguishment between states shows that different epileptic state (healthy, interictal and ictal) was more important in our approach.But the parameters extracted by this method can separate even groups in same state (such Z and O or F and S) as well as other groups.For example we can find out our signal is interictal and it is from focal or nonfocal zone.
For Z and O except the gamma sub-bands we have very noticeable separation (all of the sub-bands over 99.95% except gamma).
For Z and F all of the sub-bands can separate these groups with over 99.99% and the EEG signal also has a good separation rate (99.8%).All of the sub-bands and the EEG signal have 99.99% separation rate for Z and F. for Z and S we have the same results and separation rate for EEG gamma, alpha, beta and theta sub-bands are over 99.99% and for delta sub-band separation rate is 99.89%.We have excellent separation between O and F in EEG, gamma and alpha sub-bands over 99.99% and for other sub-bands the separation probability are respectively 99.34% for beta, 99.59% for delta and 99.39% for beta sub-band.With comparing the value for groups O and N EEG signal hasn't good result in separation these groups (90.51%) but gamma, alpha and theta sub-bands have separation rate over 99.99%.distinguishment for this pair of group in beta sub-band is 54.99% and for delta sub-band is 89.08%.
Comparing O with S shows up to 99.99% separation probability for EEG, gamma, beta, delta and theta subbands and 99.98% for alpha subband.
For groups F and N the EEG signal has separation with over 99.99% probability and 99.98% for gamma sub-band.For alpha sub-band we can't tabulate P-value since both of the t-score and degree of freedom were zero.Beta and theta sub-bands don't show good separation rate (41.17% and 0.269%) but delta sub-band has 99.57% probability for separation rate.
For comparing interictal and ictal states (F and S, and N and S) EEG signal and alpha, beta and theta sub-bands have separation probability over 99.99% for both pairs F, S and N, S. As we see in table 3 separation probability between F and S for gamma sub-band is 96.47% and 86.29% for delta sub-band.
Separation rate for pair N, S in gamma sub-band isn't good not at all (1.84%) but for alpha sub-band is suitable (99.13%).

DISCUSSION
Some other studies have been done in feature extraction for epilepsy detection.But most of them just have used for separate 3 groups of these 5 groups and have ignored the other ones [3,23].The extracted parameters in this study can separate all of these 5 groups.Considering just 3 groups of these 5 groups shows significant difference (see Figure 5).In comparison ApEn with CD and LLE [3] we can see two major improvements.
1) We calculate separation rates for all 10 pairs with all of 5 groups but in [3] and some other studies just 3 groups have been considered.
2) ApEn values can separate most sub-bands of each pair but as we see in Table 4.In some sub-bands correlation dimension or largest lyapanov exponent don't show significant difference.And in other sub-bands these values just can separate 2 or 3 pair of groups.

Conclusion
In this study, the Approximate Entropy combined with wavelet analysis used to extract the features for epilepsy detection.In order to automatic detection of epileptic activity in EEG signals we have 3 different states (healthy, interictal and ictal) and significant results are obtained.The value of ApEn can be used to distinguish the different EEG state.According to ApEn analysis features of EEG and their sub-bands show acceptable performances in our approach.Our extracted feature can be useful and applicable for automatic detection of brain diseases such as epilepsy.The approaches of using ApEn combined with wavelet analysis suggest new idea and method for detecting the features of epileptic activities in EEG signal.
This method also can be used for other non-stationary signals and other approach.Because the speed of this method is high enough, we can use this method for real-time non-stationary signals.

Figure 1 .
Figure 1.First EEG segments of 5 groups Z, O, F, N and S.

Figure 2 .
Figure 2. Decomposition of EEG sequence with five level discrete wavelet transform and extract five phisiological subbands.

Figure 3 .
Figure 3. Wavelet coefficient for a segment of EEG signal decomposed by 4 levels DWT.

Figure 4 .
Figure 4. ApEn value for all 100 segments of EEG data for each group (O-healthy with eyes open, Z-healthy with eyes close, F-interictal in focal zone, N-interictal in nonfocal zone and S-ictal).

Figure 5 .
Figure 5. ApEn value for all 100 segments of EEG data for 3 different states (O-healthy with eyes open, N-interictal in nonfocal zone and S-ictal).

Figure 6 .
Figure 6.Block diagram of overall method.

Table 1 .
Mean of ApEn value for each group of EEG segments and their sub-bands.

Table 2 .
Standard deviation of ApEn value for each group of EEG segments and their sub-bands.

Table 3 .
Assuming the null hypothesis for each pair of groups and their sub-bands.

Table 4 .
Comparison significance of ApEn and CD and LLE.