Study Epileptic EEG Signals Based on Phase Transition Ideas

. Objective: Signals are disorganized during epileptic seizures, and analysis of epileptic EEG signals is difficult and complex.The purpose is to study the epileptic EEG signal and the space-time evolution of brain electrical activity based on phase transition ideas. Methods: electrode arrays was inplantied to the dog’s brain,and installing a telemetry device on the dog.Then acquired the signal at 400Hz by 16 channels.The data is divided into interictal and preictal. Firstly, classify the data with the classifier, observe the classification effect, select the best segment range.Then we use the phase transition idea and correlation to analysis the interictal and preictal data. Results: The correlation coefficient of signal channels is increasing with the passage of time. SVM classifier can be used to achieve the best classification of the signal, the AUC can be as high as 0.93 or more.When there are many channels connected, the signal will fluctuate abnormally. Conclusion: When the connectivity condition continues, the signal continues to be abnormal, imminent epilepsy. The final results is that the correct rate is 80.00%.The method proposed in this paper can be used to analyze the signal of dog 1, the correct rate is very high,and the overall correct rate is Combinating the phase change and epilepsy EEG to study the epileptic EEG signal from a new perspective has a certain reference value for the prediction of epilepsy. channels increases with time. The correlation coefficient of the No. 3 data of Dog1's preictal signal showed an increasing trend after dividing the data for 10 minutes at 30 s intervals.


Introduction
Brain electrical activity is potential variation with spontaneity and rhythmicity,which is produced by the cerebral cortex and generated electric signal was accompanied by activity of neural.As early as the 19th century, Caton,the British physiologist,found spontaneous brain electrical activity.Hans Berger, the famous psychiatrist, clearly recorded brain electrical activity from human scalp surface successfully for the first time in the early 1970s [1] .Elements of frequency of Electroencephalogram(EEG) signal are abundant, and there is a close relationship between the different frequency components and the physiological activities of brain,so EEG signal is characterized by frequency domain,which compared to other electrophysiological signals.analysis of EEG signal also is a powerful tool for researchers as they study the human's physiological state and different functions, mechanism works of brain and diagnose the brain diseases.
Epilepsy is a intermittent disease with brain dysfunction caused by various etiologies,which is mainly present as sudden onset of brain neurons by the abnormal discharge,leading patients to abruptly lose consciousness and attack generalized convulsions.there are about 50 million patients with epilepsy worldwide,and the number is increasing at the rate of two million a year [2] .Almost half of patients have suffered from epilepsy since they were children or adolescents [3] ,they not only suffer tremendous physical pain,but bear extraordinary stress of moral and mental aspects [4][5] .Occurrence of epilepsy often accompanied by obvious brain electrical changes,so characteristics of epileptic activities can be studied by analyzing EEG signal.There are so many different methods to research epilepsy at present,for example time domain analysis,frequency -domain analysis,nonlinear dynamic analysis and so on [6][7] .The disparate ways of predicting epileptic have been Proposed Via study of epileptic EEG signal,which used appropriate methods to realize,such as pertinence [8][9] ,phase synchronization and classifier [10] .
Phase transition [11] and critical phenomena [12] both are one of the advanced research fields of physics, chemistry and biology [13][14] . The former is widely used in Physics, chemistry, biology, construction and other domains [15][16][17][18] ."The transition period" of phase transition is very similar to the state that before the onset of the illness,so theory of phase transition can be applied to research of epileptic EEG signal.In this study,the combination would be putted into practice,and the characteristics of the temporal-spatial evolution of epilepsy activities would be researched.
This study is devoted to integrating theory of phase transition into analysis of epileptic EEG signal, a new algorithm was raised,which could not only be a pretty good description of mechanism of the space-time evolution of epileptic EEG signal,but also predict occurrence of epilepsy to some extent.

(1) Data
In this article,the dataset that used derives from the epileptic seizure prediction contest of a public website called Kaggle [19] . The signal is acquired by the model in Figure1.

Figure 1 Data acquisition model
The database includes the intracranial EEG recordings of 5 epileptic dogs .All of recording duration is 678 hours,which divides all into 10-minutes epochs,and all operations carried out by seasoned expert.there are two kinds of EEG signals in this paper are defined as follow: "before seizure",pre-ictal for short, which means the seizure approaching in near future; "between seizures",being abbreviated it as inter-ictal, which means the appearance of a seizure for a certain time period in future is not anticipated. There are 50 hours of pre-ictal epochs(50 seizure) in the dataset,which including 44 dogs and 6 patients.

(2)Methods
This paper introduces the phase transition theory to study the temporal and spatial evolution of epileptic EEG signals.In the material phase-transition process, there will be "turbulence" phenomenon, such as the process of ice into the water, the water density will be "volatile" and it continue to change.It's a lot of volatility.A local area will be a water, one will be ice, constantly changing.With the turbulent process continuing, until most of the region is frozen into a sheet, it is considered that the region has completed the phase transition process.Epilepsy EEG also has this feature,therefore, this paper will assume that before the onset of seizures will appear a "wave".Some channels or part of the brain region produce abnormal fluctuations of the signal, the signal continues to spread.More and more channels are abnormal ,until most of the channel have abnormal fluctuations, and compared with the previous signal is significantly different,epilepsy is about to happen.The thinking process show in Figure2.

Figure 2 Phase transition method diagram
The existing data (total length is ten minutes) is divided into different time period samples.The correlation coefficient that is calculated between two channels are used as the eigenvalue of the classification to classify data.Selecting the best standard of segmentation according to the results of the classification evaluation.Further integration with the theory of phase transition, in order to study the evolution of epileptic EEG characteristics in-depth.Each data segment is divided into equal length segments, according to equation (1) [20] to calculate the correlation coefficient r xy between each two channels in a certain time.
In the above formula, x and y are arbitrary two channels, n is the sampling number of channel x and y in a certain time, x and y is the average value for channels.Since the correlation coefficient is about of the multi-channel, so the number of the correlation coefficient can be calculated between the two channels is M.
Through the above two formulas, M correlation coefficients between channels can be calculated, and the mean value is taken as the feature input of the classifier.The final goal of this study is to effectively distinguish the interictal and preictal data, so as to provide an effective method for forecasting. According to this feature, the three classifiers KNN, SVM and NB are used.The results are shown in the following From the Table 1, the best result of classification is SVM classification, which is based on the data for the dog. Since it's value of AUC can be up to 0.9432 during every 30 seconds. And the results of other classifiers are significantly worse than SVM.
According to the above results, the study will be performed when the dog's epilepsy data are segmented with 30s as the standard. And with the segmentation criterion, each segment of data is divided into equal length segments. The correlation coefficient r xy between each two channels in the period is calculated. And the correlation coefficient matrices of interictal, preictal and ictal were calculated. As shown in Figure3 below.In Figure3,it shows the r xy between 16 channels,and the colourbar on the right side represents the value of the correlation coefficient. In accordance with a 30-second period, the data length is divided into 20 segments. Figure 4 shows the trend of correlation coefficients for each channel over a 10-minute period. Figure 4 The trend of correlation coefficient between one channel and other channels Note: In Figure 4, the abscissa is the 20 minute segments numbered with 10s of data for 30 minutes, and the ordinate is the correlation coefficient. When the EEG signal fluctuates, the correlation coefficient of some channels increases with time. The correlation coefficient of the No. 3 data of Dog1's preictal signal showed an increasing trend after dividing the data for 10 minutes at 30 s intervals.
It is proposed to define a few keywords.The operators "0", "1", in the Boolean network are introduced."1" means that when the correlation coefficient satisfies the threshold value, it is assumed that epilepsy may occur after this moment, and this state is defined as "1".And vice versa, when the correlation coefficient is match with the threshold value, it is defined as "0".The z-score is the result of normalization by mean and standard deviation. Used to quantify abnormal fluctuations in the signal at a particular point in time.
r j is the correlation coefficient in a certain period of time (dog 30s), μ r is the average of the correlation coefficient in the total length of time (10min), and r σ is the standard deviation of the correlation coefficient in this period.

Results
The raw data for each segment is 10 minutes and the 10 minutes are separated into 30s segments.Based on the segmented results, the correlation coefficient, standard deviation, and z-score were calculated over time.Selecting the signal which "fluctuates" larger , based on the comparison results of the z -score , we select the data that | z -score | ≥ 2 as wave data.When | z-score | ≥ 2, it is assumed that the two channels are in the connected state at that time, ie, so,it's "1".In Figure5, the number of connected channels increases gradually, and the connected area increases from single-wire state to diffusion in a period of time.In Figure6, the signal returns to calm after a fluctuation, then appear abnormal fluctuations from time to time.This is repeated until the connected pattern continues to appear.Epilepsy is about to attack.In the interictal, there is no abnormal fluctuation signal.  Figure 4.7 show the results of the phase change study of epileptic EEG. It shows the preictal data of Dog2 . ABCEDF is the connection pattern of the channel in the time period of 0-30s, 210s-240s, 780s-810s, 1050s-1080s, 1410s-1440s, 2220s-2250s respectively. In the figure, the blue line represents the channel with Z-score greater than 2, and the yellow line represents the channel with Z-score greater than 3. When the channels are connected, the lines are covered with red to make them clear.

Figure 6 EEG abnormal fluctuations
The correlation coefficient, the mean value and the standard deviation between the two channels are obtained for each segmented time period.When the difference of correlation coefficient between one channel and any other channels is larger than the standard deviation, it is considered that the two channels are in state "1".When the number of channels in state " 1" is greater than half of the total number of channels, this time is defined and the channels are connecting.An hour before the onset of epilepsy was observed, the number of connected channels increased and the area of interconnection became larger.

Conclusion and Discussion
Using the classifier to classify epileptic EEG data, found that the SVM classification is better than that of several other kinds of classifier.The AUC was greater than 0.93 in the optimal segment time.In [21], the authors also use the classifier to classify and them use the threshold correlation coefficient.In this paper,we study the EEG signal based on phase change , considering in the threshold there will be a delay, so we choose the frequency domain correlation coefficient. This paper adopts frequency correlation coefficient, also can achieve good classification effect.In [4], the authors used a variety of data for classifier training. This method is not feasible because there is no published large epilepsy EEG database, and the results obtained by using multiple data will be more complicated.The fluctuation between epileptic seizures coincided with the phase transition theory, and the phase transition theory was used to study the evolution of epileptic EEG.It was found that the channel correlation coefficient showed an increasing trend in the time, from the interictal to preictal.In space, the preictal EEG signal channel connect gradually between and they continue to spread, and there appear intermittent abnormal fluctuations.It is predicted that epilepsy will occur when the channel is connected into a sheet and continues to occur.In this paper, we mainly study the evolution of EEG before before epileptic seizures by analysis the data within one hour.Signal changes show a certain regularity.We use the above method to verify one by one.There are 40 hours data and the results are shown in Table 2 It is a novel method to integrate the phase change idea into the EEG signal, which can solve the critical problem of the EEG signal and achieve the prediction effect well.With the increase of time, the association between each channel gradually expanded, showing a connected state. It can be seen from Table 2 that this method has better analysis results for some data, such as Dog1, because it only has 4 hours of data.While the correct rate of the dog4 and dog5 is not very satisfactory,but they both meet the characteristics of this study .The overall accuracy rate is 80.00%.Maybe it's not high for epilepsy prediction,but it's an innovative method of studying epilepsy signals.