A Novel Spike-Wave Discharge Detection Framework Based on the Morphological Characteristics of Brain Electrical Activity Phase Space in an Animal Model

Background : Animal models of absence epilepsy are widely used in childhood absence epilepsy studies. Absence seizures appear in the brain’s electrical activity as a specific spike wave discharge (SWD) pattern. Reviewing long-term brain electrical activity is time-consuming and automatic methods are necessary. On the other hand, nonlinear techniques such as phase space are effective in brain electrical activity analysis. In this study, we present a novel SWD-detection framework based on the geometrical characteristics of the phase space. Methods: The method consists of the following steps: (1) Rat stereotaxic surgery and cortical electrode implantation, (2) Long-term brain electrical activity recording, (3) Phase space reconstruction, (4) Extracting geometrical features such as volume, occupied space, and curvature of brain signal trajectories, and (5) Detecting SDWs based on the thresholding method. We evaluated the approach with the accuracy of the SWDs detection method. Results: It has been demonstrated that the features change significantly in transition from a normal state to epileptic seizures. The proposed approach detected SWDs with 98% accuracy. Conclusion: The result supports that nonlinear approaches can identify the dynamics of brain electrical activity signals.

Int Clin Neurosci J. Vol 7 There are very few studies in the literature related to automated SWD detection in animal models. Andrade et al 8 proposed an offline SWDs detection framework based on the time-frequency analysis in the genetic model of absence epilepsy. The SWDs were detected using some features in certain frequency bands. Spontaneous seizures can be detected in the post-traumatic rat model of epilepsy. 9 In this study, continuous long-term video EEGs were recorded to detect epileptic activity. The proposed method searched power peaks and then marked the onset of seizures. Sitnikova and colleagues 10 used fast Fourier parameters and continuous Morlet wavelet transform to discriminate SWDs from sleep spindles in EEG signals from WAG/Rij model of epilepsy. They showed that EEG patterns of SWDs have different time-frequency parameters compared with sleep spindles. In Fanselow et al study, 11 an automatic SWDs detection framework was developed based on EEG signals derivate. The SWDs were detected when the signals value derivate exceeds the threshold value. Another study 12 introduced a method based on the amplitude values of EEG signals and the thresholding method. The method detected SWDs when EEG amplitude exceeded from absolute amplitude threshold. However, these studies are not based on the complex nature of the brain signal and cannot be used to identify the chaotic behaviors of the brain signal. According to the chaos and nonlinear dynamic theory, biomedical signals have complex behavior, and these methods are suitable for modeling them. There are several feature extraction techniques to identify the dynamic of chaotic signals. Fractal dimension, 13,14 correlation dimension, [15][16][17][18][19] entropy, [20][21][22][23][24] Lyapunov exponent, [25][26][27][28] and recurrence quantification analysis are common methods to analyze EEG signals.
However, these methods quantify the global characteristics of phase space and cannot identify the details of phase space. So, introducing the features which can detect the details of phase space are more effective. We proposed a novel method to detect SWDs based on the two-dimensional phase space's geometric features. 29 We showed that our proposed method had more outstanding results than previously published approaches. Application of the method in an animal research setting, however, has revealed some aspects that required further improvement. In particular, the method only introduced statistical features from two-dimensional phase space while EEG system has higher-order dimensions, and this reduction may lead to erroneous results. In addition, trajectory changes have dynamic behaviors, and we have to consider this issue in our method. In this study, we tackle this problem by presenting a novel method to track the changes in phase space trajectory. 30,31 We assumed that the SWDs have geometry in phase space as well as in the time domain and geometrical characteristics are helpful in predicting and detecting absence seizures. Among the novelties are: (1) Introducing morphological features in high dimensional phase space from EEG signals, (2) Improving the detection method by modifying thresholding method using a dynamical threshold, and (3) Using a benchmark oscillator-like Lorentz system to investigate the robustness of the proposed features. First, we introduce the subjects and procedure of surgery and electrode implantation. In the second step, we present the phase space reconstruction and feature extraction methods. Finally, we discuss our results and compare the performance of the proposed method with existing literature.

Ethical Consideration
This experimental study was done in the animal laboratory of Ferdowsi University, Mashhad, Iran. It was approved by the natural ethics committee (IR.NKUMS.REC.00.036) The animals were housed in pairs with free access to water and food. After surgery, they were housed individually. All procedures were done in accordance with the national guidelines for animal care and handling. Efforts were made to minimize the pain/distress experienced by the animals. Also, the least possible number of animals necessary to produce reliable data was used.

Subjects and surgery
All experiments were performed on 15 male WAG/Rij rats with at least 13 weeks of age (weight 300 ± 5 g). The rats were anesthetized with xylazine 11 mg/kg and ketamine 110 mg/kg. Next, the skull was fixed with a stereotax, and cotton and alcohol were used to prepare the surface of the skull. In addition, phenylephrine was used to prevent bleeding. In all animals, a twisted Bipolar electrode was implanted on the frontal cortex (1 mm above Bregma and 3 mm from Lambda) and the reference electrode was implanted on the parietal cortex. An extra screw was used to fix dental cement. All coordinates were determined according to the stereotaxic atlas of Paxinos and Watson. The rats were allowed recovery for a week.

Brain Electrical Activity Recording
After recovery, each animal was kept in the individual brain electrical activity record cage. Next, the brain electrical activity electrode was connected to the recording system. The signals were recorded by 1 kHz sampling rate and amplified with PowerLab (AD Instrumentation Co, Australia). The recording was performed continuously for 24 to 74 hours. Figure 1 shows the coordination of the recording electrode, electrode implantation, and a sample brain electrical activity recorded.

Phase Space Reconstruction
The phase space is one of the effective methods in journals.sbmu.ac.ir/Neuroscience http biomedical signal processing. In the biological system, we can only identify the dynamics of the system with these observations because we do not have access to the system equations and only have observations of the system such as brain electrical activity. Taken theory 32 explains that the phase space can be reconstructed with the time-delayed series of observations. According to this theory, if x(t) is a time series, the delayed phase-space vectors are estimated with the following equation: (1) Where τ is a time delay, and m is the embed dimension which can be calculated by the false nearest-neighbor 33 and the mutual information 34,35 algorithm, respectively.

Feature Extraction
In this part, we quantify the trajectory of the state variable based on the geometrical properties of phase space.

Enclosed Volume (EV)
The EV quantifies the surrounded space by the trajectory; we introduce features to demonstrate the geometrical characteristics of trajectory in the phase space.

Centroid
To calculate a centroid of a set of K points, the averages of their coordinates are calculated. The centroid in twodimension space was calculated using the following equations: Where K is the number of points in the phase space and the coordination of each point and C x and C y are the centroid components in Cartesian coordination.

Center of Gravity
Center of gravity is calculated as follows: Where n is the number of samples, x i and y i are the coordination of each point in the Cartesian coordination, G x and G y are the center of gravity components and A is the polygon signed area:

Occupied Space
Two quantifiers present occupied space according to the centroid and center of gravity: Where ( ) k  x is the trajectory vector, K is the number of samples, C and G present centroid and center of gravity, respectively. Two features characterize the variation of occupied space to the centroid (C) and center of gravity (G), respectively. These features are calculated as follows: (12) Where OCV and OGV characterize the variation of the convex hull in the attractor according to the centroid and center of gravity.

Curvature
Curvature represents the complex behavior of the trajectory. Curvature vector is calculated by the following formula:  (16) Where AK presents the curvature average of each trajectory sample and KV quantifies the overall changes in a trajectory. The value of AK increases when the attractor tends to complex shape. The variation of curvature is increased when the state of EEG signal was changed from normal to epileptic state.

Seizure Detection Algorithm
For detection of SWDs, a thresholding method for the features was applied. We developed the algorithm by applying an adaptive thresholding method, i.e., the parameters of thresholding were dynamically tuned by estimating the corresponding average values of the precursing indicators in a time window.

Data Analysis
We evaluated our method according to the two aspects: First, we evaluated the features to investigate their abilities to introduce a chaotic quantifier. The appropriate chaotic quantifiers must have two features. First, the chaotic quantifiers should not be sensitive to the changes in the initial condition of the chaotic system. Second, the quantifier is changed significantly by the variation of the chaotic system parameters. In this study, the conditions were evaluated by the Lorenz system 36 with the following equation: Where X, Y, and Z are the state variables, and σ, r, β are the parameters of the Lorenz system. To investigate the sensitivity of the initial point, we used t test. The attractor geometry of a chaotic system is related to the changes in the trajectory behavior of the system. So, a geometrical feature is sensitive to the changes in the dynamic trajectory. An appropriate quantifier is invariant to the changes of the initial point. On the other hand, efficient quantifiers significantly change by changing the system parameters. Second, we assessed the performance of the SWD detection system by the accuracy and time prediction according to the different thresholds. Figure 2 shows the boxplot of each feature for different journals.sbmu.ac.ir/Neuroscience http Lorenz system parameters (r) and 100-times iterations for random initial points. The results show that the distribution of the features of each condition is significantly separable from another parameter. We applied two-sample t test for each pair of parameters. Two-sample t test examines the null hypothesis that the population means related to two independent, random samples from an approximately normal distribution are equal. To use an unpaired t test, the population must have a normal distribution. To test the normality, the Jarque-Bera test was used. This test was applied to each distribution of the feature values for different Lorentz parameters. Jarque-Bera returns the P value that is larger than 0.05 if the feature has a normal distribution. The results indicate that most features had a normal distribution, and we can apply the two-sample t test. Figure 3 shows the results of the two-sample t test. The black box indicates that the P value of the t test for two pairs of the different parameter is less than 0.05 and the two distributions are significantly separable from each other. Almost all the boxes in the table for each quantifier are black and satisfy the hypothesis of two-test methods.

Result
In the next step, the time evolution in transition from pre-seizure state to epileptic seizure was investigated. The results showed that there were significant changes in the geometrical value. For instance, the time variations of four features with better statistical results were demonstrated in Figure 4. The results indicate that the value of the geometric features increased significantly in this transition, and the onset of SWDs is easily detected by  In the next step, the accuracy of SWDs detection and prediction time for different threshold values was calculated. Table 1 presents the maximum accuracy for each feature and prediction time in maximum accuracy.

Discussion and Conclusion
In this study, we proposed a strong method for offline prediction of SWDs. Table 2 comprises the result of previous SWDs detection studies on animal absence epilepsy and the proposed method.
This method can play an important role in detecting and predicting epileptic seizures. To apply suitable medication methods, a doctor needs to review EEG signals, which may take hours. In addition, to avoid the side effects of antiepileptic drugs designing a close-loop system is highly desired, and the real-time stimulation can be applied when a seizure occurs. Another application of an automatic detection system is designing a warning system to protect the patient from seizures during his life. The result shows that the accuracy of the proposed method is better than the previous approaches. This study focused on the genetic epilepsy model because it is the model of epilepsy and not the model of epileptic seizures such as acute chemical and electrical kindling. Because of the similar pharmacological and electrical characteristics in an animal model and human epilepsy, the results of these studies are more reliable and can be developed for clinical application.
The main focus of this study was extracting geometrical features from phase space. The effectiveness of the nonlinear approaches is demonstrated in several studies. [37][38][39] The results support this issue. The proposed algorithm is robust to the initial point changes and significant changes with the changes in system parameters and so the features can quantify the chaotic behavior. Similar to the studies on geometrical quantifiers, the geometrical feature was significantly changed in the transition from a normal state to epileptic seizures.
This article proposed a novel offline method. However, since few samples are needed to calculate the features, we can develop the method for online application. In addition, the threshold method is simple and fast with high accuracy, and we can use this method in online mode. Another limitation of this study is the low number of subjects. The excellent performance of this proposed algorithm opens new perspectives to develop automatic techniques in clinical settings. Future studies can focus on the other genetic model of absence epilepsy like GARES. Future studies can also search for a method that can be used in online applications.