Pattern Recognition in Epileptic EEG Signals via Dynamic Mode Decomposition

: In this paper, we propose a new method based on the dynamic mode decomposition (DMD) to find a distinctive contrast between the ictal and interictal patterns in epileptic electroencephalography (EEG) data. The features extracted from the method of DMD clearly capture the phase transition of a specific frequency among the channels corresponding to the ictal state and the channel corresponding to the interictal state, such as direct current shift (DC-shift or ictal slow shifts) and high-frequency oscillation (HFO). By performing classification tests with Electrocorticography (ECoG) recordings of one patient measured at different timings, it is shown that the captured phenomenon is the unique pattern that occurs in the ictal onset zone of the patient. We eventually explain how advantageously the DMD captures some specific characteristics to distinguish the ictal state and the interictal state. The method presented in this study allows simultaneous interpretation of changes in the channel correlation and particular information for activity related to an epileptic seizure so that it can be applied to identification and prediction of the ictal state and analysis of the mechanism on its dynamics.


Introduction
Epilepsy is a neurological condition in which patients suffer spontaneous seizures. The seizure is caused by disturbances in the electrical activity of the brain. As proposed in [1], an epileptic seizure is a transient occurrence of signs and/or symptoms due to abnormal, excessive, and synchronous neuronal activity in the brain. Correctly identifying the presence of epileptic activity, characterizing the spatio-temporal patterns of the corresponding brain activity, and predicting the occurrence of seizures are major challenges, and achieving this could significantly improve the quality of life for patients with epilepsy. Electroencephalogram (EEG) including electrocorticogram (ECoG) is the prime signal that has been widely used for the diagnosis of epilepsy (see, for example, [2]). It is an accurate tool for the identification of various types of abnormalities in the brain. An epileptic seizure is one of those complex abnormalities detected by EEG. A vast number of methods have been developed for automatic detection of seizures from EEG recordings (see [3][4][5]). Extracting features that best describe the behavior of EEGs is of great importance for automatic seizure detection systems' performance.
It is reported that the epileptic zone may be localized by the abnormal signal pattern of the highfrequency domain so-called persistent high-frequency oscillations (HFOs) [2,6,7]. However, using conventional transformation algorithms to extract features from the EEG signals does not guarantee a high accuracy being achieved [8,9]. Figure 1b,c exhibit the power spectrum of the signal from a specific channel in which DC shift and HFO occur right before the seizure, and for comparison, Figure 1d shows the magnitude of the DMD mode of the same signal. While the DMD mode can easily identify the singularity of the highfrequency domain, most of the methods based on the power spectrum have some difficulty in making intuitive judgments of the existence of the singularity because the measured energy is relatively small compared to the low frequency. In other words, in the analysis using the power spectrum, it is difficult to visually identify the HFO interval having a relatively small magnitude (or amplitude). However, the magnitude of the DMD mode allows you to visually identify specific frequency bands with abnormal phase transitions whether or not it is in the high frequency. The Kuramoto model, which explains the synchronization phenomena of the oscillation of coupled signals, analyzes brain connectivity and dynamics [11]. This synchronization phenomenon can be confirmed by comparing the phase difference of a specific frequency band between interacting signals. According to recent research, oscillation amplitudes do not reveal the coordination or communication of neuronal activity across brain regions. In contrast, the phase of an oscillation, which indicates the position of the signal within a given oscillation cycle, has been shown to be critical in the coordination of anatomically distributed processing [12]. Therefore, there has currently been an urgent need for a new analysis tool that can detect the phase transition of high-frequency bands for each condition appearing between the cerebral regions.
A newly developed method based on dynamic mode decomposition (DMD) has been proposed in recent years to extract features from EEG data [13,14]. The phase differences between channels corresponding to each frequency are approximated by the DMD as the form of 'modes' corresponding to the signals [15]. As shown in Figure 1, one of the main advantages of DMD is that these modes are provided in linearly independent normalized vectors so that patterns of the phase (i.e., imaginary of mode entries) and its magnitudes (i.e., absolute values of mode entries) in banded high frequencies can be clearly detected as patterns in low-frequency mode. Figure 2 shows that the 'mode' of DMD accurately detects two signals that differ in phase. Besides, since the signal of 'Channel 3' is not related to the phase difference, the magnitude of the mode corresponding to the frequency of the channel is calculated as zero. On the other hand, in FFT, the phase difference between these two channels cannot be confirmed. The first column in Figure 2 shows the phase angle of the DMD mode obtained from the computation of ℑ(log ), where is the DMD mode in Equation (11) and ℑ(⋅) is the imaginary part of a complex number (Note that where ℜ(⋅) is the real part of a complex number.). The second column (b) in Figure 2 displays the magnitude of the mode computed by | |. Since the complex eigenvalues calculated by DMD always consist of conjugate pairs, the phase angles are represented by negative and positive pairs with the same absolute value. The phase angle in the third column in Figure 2 for frequencies whose magnitude is zero is ignored because it is worthless. The absolute value of the phase angle over 7 Hz of the first signal is calculated to be approximately 2.8723 and that of the second signal is approximately 2.0723, so the phase transition from the original signal is exactly 0.8. It should be noted that the mode value of the individual signal is obtained by projecting into a function space that is generated depending on the data so that it may vary depending on how the data is generated. After all, the important value in DMD mode is not the absolute value, but the difference or change of the relative value of magnitude and angle corresponding to each channel and frequency. In this paper, we introduce a method of classification between the ictal and interictal states in the EEG signals from an individual epileptic patient and examine whether it is effective to recognize spatio-temporal patterns through DMD. In Section 2, we describe the structure of data and the DMD method to be applied and then explain the process of feature extraction for classification. In Section 3, we perform numerical computations and simulations to represent the results of the classification. In Section 4, we interpret the numerical results and discuss how useful the method presented in this study is, and how it differentiates in comparison with existing methods. Finally, in Section 5, we summarize the study and discuss further research topics.

Materials and Methods
In this work, ECoG data, a rare type of EEG data, was used. ECoG is an invasive method of measuring the electrical signals with electrodes that are implanted directly on the exposed surface of the brain while the normal EEG is a non-invasive method with electrodes that are placed on the surface of the scalp. The signal-to-noise ratio (SNR) of brain signals in ECoG is relatively high and the impact of artifacts caused by physical movements, electrical activities, and other electrical wearable is almost negligible in ECoG signal. Even in patients with the same type of disease, each of their ECoG data displays their inherent characteristics different from the others. Therefore, when statistically studying ECoG data, instead of using data from multiple patients as a control group, we used one individual patient's data measured at two or more different timings.
The ECoG recordings were sampled at intervals of 0.2 s, and they were segmented with a onesecond duration. Each segmented signal was decomposed by the DMD into a dynamic mode, and the columns of the mode were sorted in descending order of to their frequencies and then vectorized. Those vectorized columns were projected to the approximated left singular vector space, which comes from the subscribed learning process, and then the features were extracted. Finally, the extracted features were regarded as an input variable into a support vector machine (SVM) and then those were classified into ictal and interictal EEG signals. Figure 3 illustrates all the steps in the process described above. In what follows, details of the used ECoG dataset, dynamic mode decomposition, feature extraction, classification, and statistical assessment are described in order.

Dataset
The ECoG dataset of an epileptic patient was provided by Ikeda laboratory at Kyoto University. The recent works in Ikeda laboratory refer to [2,6,16,17] on high-frequency oscillations and other types of oscillations with prominent DC components, which is the so-called DC-shift, in EEG data. The dataset is composed of four distinct ECoG recordings measured through 49 channels; two recordings are in the awake state and the other two are in the sleep state. Each recording is composed of only two types of signals: An ictal signal and an interictal signal. Table 1 displays the detailed information of the four recordings and their settings, and Figure 4 illustrates how to sample the EEG data into signals to be used in this work. Since the sampling rate of the original data provided was very large as 2000 Hz, it was reduced to 250 Hz to match the rate used in most of the previous related studies. Table 1. Details of four epileptic ECoG recordings used in the dataset. The entire dataset was obtained from one patient. All of the recordings were resampled at 250 Hz (250 per second) and contain the spatial information of 49 channels for each snapshot. Each EEG signal corresponds to a matrix of onesecond duration snapshots combined in the column direction, and it was collected every 0.2 s.  . Sampling process for training data. A total of signals are presented above. Each EEG signal was obtained for one second of time lapse, and it consists of a total of 250 uniformly chosen snapshots from 2000 snapshots for each signal. Note that after the th EEG signal is obtained, the next EEG signal, the ( + 1)st EEG signal is then obtained with 0.2 s of waiting time. Therefore, the adjacent EEG signals have data in common for 0.8 s, equivalently, 200 snapshots.

Dynamic Mode Decomposition
Assume that data is collected from a dynamical system of ordinary differential equations: where ( ) ∈ ℝ is a vector representing the state of a dynamical system at time and (⋅) represent the dynamics. In general, it is impossible to construct an analytic solution to the nonlinear Equation (1), so numerical solutions are used to approximate the dynamics and predict the future states. The DMD procedure constructs the proxy, approximate locally linear dynamical system: with initial condition (0) and solution: where and are the eigenvectors and eigenvalues of the matrix , and the coefficients are the coordinates of (0) in the eigenvector basis.
The continuous dynamics in Equation (2) can be described by an analogous discrete-time system sampled every Δ in time, such as: where = exp( Δ ) and is the number of states. The solution to this system is simply expressed by: where and are the eigenvalues and eigenvectors of the discrete-time map , respectively, and is the coefficient of the initial condition = (0) in the eigenvector basis so that = . The final goal of the DMD algorithm is to produce a low-rank eigendecomposition (Equation (3)) of the matrix that optimally fits for = 0, 1, ⋯ , in a least-square sense so that: is minimized for = 0, 1, ⋯ , − 1. Let ∈ ℝ be a column vector containing measurements from channels at the time instant in streamlined EEG signals and compose a data matrix: which represents a segmented EEG signal. In order to minimize the approximation error (Equation (4)), we define two data matrices as follows: where is the data matrix constructed by the measurement vectors for consecutive time instances from the beginning, and is the data matrix temporally shifted by the time unit 1 from . Then, the locally linear approximation (Equation (2)) can be written by: ≈ , and the best-fit matrix is given by: where denotes the Moore-Penrose pseudoinverse of . The solution of Equation (6) minimizes the error: where ‖⋅‖ is the Frobenius norm given by: for ∈ ℝ × . Thus, the DMD of the pair ( , ) is the eigendecomposition of the matrix . Then, the modes and eigenvalues of the DMD correspond to the eigenvectors and eigenvalues of , respectively. In practice, if the state dimension is large, the matrix may be intractable to analyze directly. Instead, a low-rank approximation is implemented by the following algorithm, which is called the DMD algorithm [15,18]: (a) Compute the reduced and appropriately truncated SVD [19] of the data matrix in Equation (5): where the columns of ∈ ℝ × and ∈ ℝ × are orthonormal eigenvectors of and , respectively, the diagonal entries of ∈ ℝ × are the square roots of the non-negative eigenvalues of both and , and (< min{ , }) refers to the reduced rank of the approximated matrix given in Equation (7). The columns of are called the left singular vectors of .
(b) Define a low-rank approximation of in Equation (6): (c) Compute the eigendecomposition of in Equation (8): where the columns of ∈ ℂ × and the diagonal entries of ∈ ℂ × are the eigenvectors and the eigenvalues of , respectively.
(d) Since the eigenvalues in Equation (9) are also the eigenvalues of , the DMD mode (i.e., the eigenvector of ) corresponding to the DMD eigenvalue in Equation (9) is given by: where is the th column of in Equation (9).
Each snapshot is approximated by ≈ , and so, this algorithm allows us to express an approximation of the sample data as a composition of a coupled spatio-temporal model: where ∈ ℂ × consists of the columns of , and is a set of weights satisfying = . The phase of eigenvalues can be converted to frequency (Hz) by: where ℑ(⋅) is the imaginary part of a complex number.
indicates the frequency of oscillation in the mode , whose unit is in cycles per second. Since in Equation (11) corresponds to the initial value in Equation (5), the th entry of in Equation (11) is accordingly defined to be the spectral amplitude of the frequency in Equation (12). Since the size of the operator in Equation (6) is determined by the dimension of the vector in Equation (5), if the spatial resolution of a given signal is less than its temporal resolution then the standard DMD algorithm represented above may fail to extract full spectral information (for example, DMD gives only a scalar linear operator from one-dimension signals).
The spatial resolution for neurological signals is usually less than the temporal resolution. For example, we have 49 channels of electrodes sampling at 2000 Hz. Thus, the standard DMD algorithm must be modified to capture the dynamics of the neurological activity properly. The modification is adopted to augment the data matrix by stacking ℎ number of observation vectors to be given in Equation (15), such that the number of rows in becomes at least twice the number of columns. A recent experiment has shown that the number of rows in must be more than twice that of the columns to obtain adequate spectral information from brain signals [20]. Then, a scaled spectral amplitude for in Equation (11) is given by: where is the th entry of given in Equation (11). Meanwhile, the DMD mode power is defined by ‖ ‖ [14,20]. Figure 5 illustrates the variation in the spectral information and DMD modes corresponding to signals from different data regions of the EEG recordings, such as interictal in the sleep state, interictal in awake, ictal in sleep, and ictal in awake. The signals used in this work were obtained from 49 channels with one-second duration and they were resampled by a sampling rate of 250 Hz with 10 stacking numbers, and hence, the data matrix contains 240 columns and 490 rows (each original signal has 250 columns and 49 rows).
In Figure 5, we see that the amplitudes at high frequencies are relatively much smaller than the amplitudes at other frequencies, but the magnitude of the phase on some narrow-banded low or high frequencies at the channels 33, 38, and 47 in the DMD mode are more significantly larger than that of the others, except channel 41. The DMD mode is given in a complex number, and its magnitude displays the relative influence of all channels on the corresponding frequency in a normalized state. The DMD mode corresponding to the zero frequency indicates the overall shape or the tendency of signals. Inspecting the magnitude of the DMD mode identifies channels with significant phase transition at some special banded frequencies in the signal, such as the channels in which DC shift and HFO occur. Therefore, in order to focus on abnormal spatio-temporal phase patterns of high frequencies from ictal and interictal signals, we do not consider the amplitudes defined in Equation (13) to avoid a biased power spectrum information to low-frequency band.

Signal
Truncated DMD Mode Spectral Information  (13) for a segmented signal. The high-frequency pattern of the ictal signal appears more clearly than that of the interictal signal does.

Feature Extraction
Each DMD mode is reordered and vectorized for feature extraction. The left singular vectors are obtained by decomposing the matrix constructed with modes computed from training signal set. Then, the features are extracted by projecting the computed modes to the truncated left singular vector space, which is prepared in the previous states.
The feature to be used in the proposed method is a vectorized and reordered DMD mode. The dimension of the feature is reduced by a linear transformation mapped to the space of truncated right-singular vectors, which come from a row-wise stacked feature matrix of modes for training data. The detail of feature extraction is explained below. For the simplicity of notation without a loss of generality, we define two sets of EEG signals used in testing and learning processes from several regions of EEG recordings as follows: where and ( + 1) are the number of channels and that of snapshots within a fixed time duration (one second in this work), respectively. Note that and are the numbers of sample signals in the training and testing sets, respectively. The elements of each set are labeled into one of four cases: Ictal in awake state, ictal in sleep, interictal in awake, and interictal in sleep for classification.
∪ be a th data matrix of signal sets in Equation (14). Then, the augmented matrix for the decomposition is represented by: (see [13]). For each ( ) , we calculate ( ) ∈ ℂ × , ( ) , and ( ) given in Equations (11)-(13), respectively. In this work, to extract optimal features, the low-rank approximation size is fixed (in this paper, = 100). The discussion for choosing an optimal threshold on the singular values can be found in [21]. Then, the modes can be aligned by frequency into the form: where is a permutation of {1,2, … , }, satisfying: A pair of consecutive columns in each ( ) mostly consists of a complex conjugate except for ( ) and valid spatial information is contained in the first -rows. Thus, in order to reduce the computational cost in the featuring process without a loss of the information, one can extract submatrix by truncating the columns and the rows by: where [ , ] denotes a submatrix of indexed by sequences and , and : and : : implies the index sequences { , + 1, + 2, … , } and { , + , + 2 , … , + } , satisfying + ≤ ≤ + ( + 1) , respectively. Note that in this paper, the size of each is given by 49 × 50. It is remarkable that most of the entries of ( ) are close to zero (or almost sparse matrices) and can be clustered into small groups. Therefore, it is naturally assumed that the dynamics of signals in EEG recordings can be described by a few entries of the DMD mode and spectral information. This implies that it is possible to apply low-rank reduction schemes to the modes, such as singular value decomposition (or principal component analysis).
The truncated DMD mode in Equation (17) of every signal in the recordings is gathered to form libraries of DMD mode patterns and supposes that elements of these libraries are labeled into distinct states of regions. The construction of the libraries of DMD mode patterns is performed as follows: where: is a truncated DMD mode matrix in Equation (17) for the th signal in ∪ in Equation (14), and ( ) represents a column vector obtained by rearranging = [ … ] ∈ ℂ × by vertically stacking the column vectors of the matrix below in the order of the index, that is: For purposes of classification, we considered only the absolute value of DMD modes. Therefore, in the featuring process, we use the absolute valued matrices of and in Equation (18) denoted by | | and | |, respectively. The feature is determined in the -dimensional left singular vector space, using the transformation of each column of | | and | | in Equation (18) onto the first left singular vectors of | | obtained by SVD, such as: where ℒ ∈ ℝ × and ℒ ∈ ℝ × are matrices orthogonal to each other, ℒ ∈ ℝ × is a nonnegative diagonal matrix, is the transpose of the first columns of ℒ , and columns of and are regarded as the features of the training set and the testing set, respectively. Figure 6 exhibits the patterns of the left singular vector space and the distribution of the features derived from the two distinct training sets in Equation (14), each of which is formed by a combination of one of the ictal and interictal signals and one of the awake and sleep states. This provides visual identification of the components contributing to the classification and their distribution. The pattern of the graph shows that the feature components contributing to the classification of the ictal and interictal signals are associated with the high-frequency pattern of the DMD mode, and the components contributing to the classification of the awake and sleep states are associated with the low-frequency pattern. It is also found that such components contain well recognizable unique characteristics for each state. In addition, the SVD precisely detects the high-frequency patterns associated with ictal and interictal signals, and hence, it is more distinct than the low-frequency patterns associated with awake and sleep states. This will be confirmed by numerical simulation in Section 3.   (19), respectively. The five images in the first column are obtained from reshaping the magnitudes of the first five singular vectors into the form of the DMD mode. Here, the horizontal axis represents frequency and the vertical one channel. In each image in the second column, all the components of features associated with each singular vector are plotted. Here, each red circle represents an ictal signal or awake state as implying positivity, while each blue rectangle represents an interictal signal or sleep state as implying negativity. Here, the horizontal axis represents the index of the signal, and the vertical one weight. The images in the third column represent the distribution of features in three-dimensional space according to the components of the singular vector.

Classification
The extracted features are to be classified into ictal or interictal signals and also into awake and sleep states by employing a support vector machine (SVM) classifier. As shown in [4], the SVM is one of the most effective classifiers for EEG signals and it can be applied to the signals flexibly in various ways. The SVM algorithm seeks a linear classifier that minimizes the operational error and maximizes the margin hyperplane, and hence, it boosts the performance of classification. In this experiment, we used kernel-based SVM presented in [22], which is known to be useful to deal with nonlinear classification based on a linear discriminant function in a high-dimensional space.

Results
Our goal was to use the SVM to classify epileptic EEG signals into ictal or interictal signals, and also into signals in the awake state or those in the sleep state. Some particular properties of spatiotemporal patterns involved in classification are distinctly captured by the algorithm of the DMD combined with SVD as proposed in Section 2. For objective evaluation of the classification, the experimental datasets used in the learning process were selected completely differently from the datasets used in testing process. We constructed 10 training sets 's in Equation (14) by randomly choosing ictal signals in the awake state to 250 signals, ictal in sleep state to 250, interictal in awake state to 1000, and interictal in sleep state to 1000, which were obtained from 'Pt1_ictal1' and 'Pt1_ictal2' recordings, respectively. The testing set in Equation (14) was composed of ictal to 770, interictal with awake state to 14,750, and interictal with sleep state to 14,690 from 'Pt1_ictal3' and 'Pt1_ictal4'. After obtaining trained models by multiclass SVM for in Equation (19) from each , we averaged the confusion matrix values obtained by applying the feature library in Equation (19) from to each trained model. In order to measure the accuracy of the classification, the statistical assessment method defined in [23] was used. Since the patterns of interictal and sleep states are stable, the predictions of ictal and awake states were set to positive and those of interictal and sleep states were set to negative. The results show that only the magnitude of the phase can be also taken as a feature to classify the sleep and awake states, yielding the same outcomes as the conventional power spectrum analysis (using FFT and Wavelet). Figure 7 displays the confusion matrices of the testing data by the classifier of ictal and interictal signals and by that of awake and sleep states, and Table 2 reports the assessment of the confusion matrices of Figure 7. The classifier of ictal and interictal signals operates properly, regardless of whether the state of the testing data is awake or sleep. Similarly, the classifier for awake and sleep states also operates properly, regardless of whether the signal of the testing data is ictal or interictal. Since the high-frequency pattern of the DMD mode appears more clearly than other frequencies, it is notable that the classifier for ictal and interictal signals yields remarkable accuracy in classification even though the amount of the training data is insufficient. Consequently, the DMD can precisely capture the patterns of the signals related to an epileptic seizure.   Table 2. Statistics for the confusion matrices in Figure 7. The measurements in the table have the following meanings: ' Accuracy ' represents the overall effectiveness of a classifier, ' Sensitivity ' represents the effectiveness of a classifier to identify positive labels, and 'Specificity' represents how effectively a classifier identifies negative labels. In the formulas for these measurements, the values TP, FN, TN, and FP are used, and they mean 'true positive', 'false negative', 'true negative', and 'false positive', respectively. These values are obtained directly from the confusion matrix.

Discussion
It is well known that aberrant changes in neural activity in brain neural circuits, such as a soaring synchronization of neuronal firing, can cause epileptic seizures, and that such changes are captured in the form of high-frequency EEG signals [24]. Recently, it has been revealed with valid pieces of evidence through a variety of experiments that both ictal slow shifts and HFOs were located in the same area and were useful to detect the ictal onset zone [25]. The method presented in this paper is to capture such spatio-temporal patterns in the ictal state as they are, and the experimental results show that such patterns are inherent characteristics that can be identified. The differences and advantages of the work presented in this paper compared to the existing studies are as follows: (a) Existing studies on the identification of the ictal onset zone mostly focus on increasing statistical accuracy by finding the proper feature method for automatic seizure detection [26][27][28][29]. In the extracted feature, it is difficult to directly understand the mechanisms and characteristics, such as the ictal slow shift and HFO, of the ictal state for the individual patient. Figures 1 and 2 show the method presented in this paper directly interprets the dynamic mode of EEG signal to locate the position of the specific channel and frequency in which the slow shift phenomenon and HFO phenomenon occur and to track the state change over time of the pre-ictal and ictal state. Therefore, it is expected that the method presented in this paper can contribute significantly to further studies related to the prediction of the state of the ictal, which plays an important role in the epilepsy study. (b) A method of investigating the correlation between channels was recently proposed in [30] as another way of studying the mechanism of ictal phenomena for the prediction of epilepsy. In the work, it was shown that the information about changes in the network correlation provides insight for epileptic brain behavior, demonstrating that other locations of the brain are involved in the seizure other than the focus, and that there might be early indications for the seizure. The method that we present is to obtain left singular vectors that are clustered into correlated channels through the dimension reduction process for the libraries of the dynamic mode with SVD applied. Each of the left singular vectors is divided into channels that are simultaneously involved in the ictal and interictal and channels that only respond to the ictal state (for example, the figures in the third row of Figure 6a show the components of the channels and frequencies that react in both ictal and interictal states, whereas the figures in its second row identify the components that react in the ictal state only). In other words, the components of the dynamic mode contain information on both the channel and frequency, so a more sophisticated analysis can be made. (c) The outcome of machine learning algorithms, such as an artificial neural network (ANN) and support vector machine (SVM) algorithms, can be effectively used as physiological feedback to advanced implantable medical devices (IMDs), which will then expectantly operate in a closedloop fashion. As a result, the efficacy of the treatment will be improved by delivering intense targeted stimulation [31]. However, due to the inherent uncertainty of the brain signals and because EEG and ECoG vary a lot depending on age, environments, drug intake, etc., it is extremely challenging [32]. In addition, in the case of epilepsy, seizure patterns for each patient not only are unique but also vary with time [33]. As a result, a generic machine learning algorithm will not efficiently work for the same patient as well as for large patient groups [34]. A more common way to approach this problem is to collect continuous EEG and ECoG data, which captures unique ictal patterns and interictal patterns for individual patients. The collected data is then used to train machine learning algorithms and to develop a patient-specific seizure prediction algorithm. However, this approach is not scalable to large patient groups as developing patient-specific machine learning models requires enormous efforts in collecting, labeling, and training the machine learning algorithms. A number of studies are underway on the development of an online seizure advisory system that automates this process [35]. However, due to the risk and complexity involved in ECoG, it is strictly restricted to clinical use. There is no ECoG data obtained from the measurement of healthy individuals' epilepsy [30]. For this reason, from a clinical point of view, tools for prediction and identification based on ECoG data should be able to produce accurate results for subsequent observational data with the number of measurement data from a patient being minimized. Moreover, the tools should train the ECoG dataset obtained from an individual patient, considering the inherent specificities of the patient. The methodology proposed in this work meets those requirements above. In order to avoid possible errors in the derived results, these tools implement an intuitive configuration and fast calculation speed so that the features created by the tools enable us to instantly interpret the attributes associated with known ictal states and to judge whether and when the epileptic seizure occurs by monitoring the changes of magnitudes (i.e., whether the value is meaningful or not) and imaginary (i.e., phase angle) regarding the modes between channels in some special banded frequencies. Moreover, the methodology allows real-time visual monitoring of the modes.

Conclusions
This paper showed that each DMD mode can be configured by calculating the phase per channel for a specific frequency band of the ECoG signal, and the DMD mode allows near-accurate detection of two separate phenomena with distinct dynamic states, such as ictal and interictal. Moreover, existing studies analyzing sleep conditions have used power spectrum analysis to track changes in patterns at specific low frequencies. This paper suggested the possibility that these findings can be induced solely by comparing and analyzing the phase transition between channels.
Numerous studies have recently been conducted to classify epilepsy conditions and develop predictive models using data-based artificial intelligence or machine learning. However, data-based research is bound to show weaknesses in learning using only a small amount of precise and special data, such as ECoG. This is where the precise interpretation based on mathematical theory is needed. From this point of view, we experimentally confirmed that the DMD fits the oscillology model that describes the synchronization of cerebral signals, and if epilepsy can be represented as dynamic data that can be described by mathematical models in complex systems, the research aimed to show that even small amount of data can be interpreted correctly.
Based on the results of this study, we conclude that by analyzing the phase transition between channels of signals measured by using the DMD mode from the cerebral signal, significant results on the change of the dynamic state of the brain can be derived from the small size of data alone. However, this study was limited to one patient, so there are certain limitations. There remains a question of how inherent phase transition associated with sleep conditions or seizures present for each patient have distinct commonalities for certain patterns, and if so, how to generalize them. In addition, since it is necessary to be able to predict the next state from the existing state for practical use, we will develop a model that can predict the state transition of epilepsy using the DMD mode.
In summary, this research deals with the numerical experiment for classification of EEG signals by means of the DMD mode and it reveals that DMD helps visually understand the spatio-temporal patterns corresponding to the low frequency in the sleep state and those corresponding to the high frequency of the ictal state so that the DMD is one of the important tools for analyzing the dynamics involved in the signals of the brain.