Seizure Type Classification on EEG Signal using Support Vector Machine

One instrument to record the activity of brainwave in a specific time is called Electroencephalography (EEG). EEG signal can be used to analyze the epilepsy disease. Brainwave of seizure patient has a low frequency with a tighter pattern than brainwave of normal people. We use data from Temple University Hospital Seizure Corpus (TUSZ) that represents an accurate clinical condition characterization. Based on neurologist report, several types of seizure can be found in the dataset. In this research, we classify three types of seizure, Generalized Non-Specific Seizure (GNSZ), Focal Non-Specific Seizure (FNSZ) and Tonic-Clonic Seizure (TCSZ). We added a normal EEG signal, so we have four classes to be classified using Support Vector Machine (SVM). The training dataset consists from 120 data (20 GNSZ, 50 FNSZ, 25 TCSZ and 25 Normal), while the evaluation dataset is 90 datasets (20 GNSZ, 50 FNSZ, 5 TCSZ and 15 Normal). We observe the combination of three feature extraction method, Mel Frequency Cepstral Coefficients (MFCC), Hjorth Descriptor and Independent Component Analysis (ICA). The best result obtained by combining MFCC and Hjorth descriptor that can detect seizure type with 90.25%, 97.83%, and 91.4% of average sensitivity, average specificity, and accuracy respectively.


Introduction
The brain is one of the most important organs in the human body as a central nervous system (CNS) which functions as a controlling center, intelligence, creativity, emotions, memories, and body movements. Inside the brain, there are neuron cells that are connected through synapses to deliver information when responding to a stimulus. The process of sending this information through electricity transmission as a result of neuronal cell biopotential activity. Under normal conditions or healthy people, this electrical activity is found in all area of the brain and then produces brain waves that can be studied. When the electrical cells of neurons disrupted by either excessive activity or loss of the function of biopotential signal transmission, it can cause brain function disorders. One of the effects of abnormalities in electrical functions is epilepsy, which is generally characterized by body seizures and merely stares blankly for a few seconds during a seizure with a specific duration. According to WHO, Epilepsy is one of the most common neurological disorders. Based on a survey, about 50 million people worldwide have epilepsy [1].
Patient with epilepsy needs a continuous treatment that can increase their quality of life. First treatment that can be done is by medication. in this process, the patient's EEG signal need to be monitored and analyzed continuously in a certain period. The analysis of EEG signal usually done manually by a certified neurologist. Due to the massive development of computer technology, seizure detection, and seizure types classification in EEG signal can be done by applying digital signal processing using simple and even complex methods. Analyzing computed EEGs can help us to get information that can be used to diagnose normal brain activity or epilepsy. Doctors generally classify seizures as either focal or generalized, to determine the right treatment for the treatment of this disease [2].
Some researchers have conducted studies to detect the phase of seizures through EEG signal processing as reported in the study [3][4][5][6][7][8]. In this study, the classification of the seizure phase was called pre-ictal, ictal, inter-ictal and postictal with the aim of analyzing differences in characteristics in each phase. The method used for signal processing can be done in the time, frequency or timefrequency domains. Another important study was early detection of the phase before seizures to give an alarm to epilepsy patients as reported in the study [9][10][11]. Early detection is essential to help people with epilepsy predict conditions that they will experience in the future so that they prepare their self, such as finding a safe place before the seizures occur.
In this research, we detect the type of seizures as opportunities and challenges to help the neurologist in classifying the seizure from EEG recording. This classification of seizure may respond to the right treatment and if possible, prognosis prediction. Different types of seizures may also be used to determine the original location and seizure pattern so that that appropriate medical measures can be determined, either in the form of medication or surgery. Therefore, in this proposed study, we conducted an epileptic EEG signal processing simulation to differentiate the types of seizure. The seizure types studied in this research were a generalized non-specific seizure, non-specific focal seizure, and tonic-clonic seizure [12]. The methods used in this research were Mel Frequency Cepstral Coefficients (MFCC), Hjorth Descriptor, and Independent Component Analysis (ICA) as features extractions while Support Vector Machine (SVM) used as the classifier.
Analyzing EEG signal in time and frequency domains are essential. Dominant timing and frequency band belong to every EEG signal for extracting different features [13]. Hjorth Descriptor was one of a method that works in time domain [14]. MFCC can process quasi-stationary signals which in the forms of sound signals and EEG signals [15]. This method has widely used in EEG signal processing with high accuracy [16]. ICA can be used to obtain considering only the relevant signals and powerful tool for the biomedical analysis involved more channels in electroencephalogram [17,18].

Temple University Hospital Seizure Corpus
Temple University Hospital Seizure Corpus (TUSZ) is the most massive open source corpus that represents an accurate clinical condition characterization [12,19]. Data recorded by using 250 Hz and 256 Hz frequency sampling each second from each data. Electrode placement on the scalp is using the standard 10/20 system. Data were taken at one part in the frontal cortex. The data consists of 3 types of seizures. There are GNSZ, FNSZ, and TCSZ. GNSZ can be seen from the spastic focal of the spike. A signal can be declared as a generalized non-specific seizure signal if there is not much evidence of its existence, it can be defined as generalized seizure type. FNSZ cannot be specified by its type, and its location is in the hemispheric or focal part of the brain. TCSZ has two steps of events, at first stiffening or tonic phase and then jerking of the body or clonic phase [12].
The number of training dataset is 120 signals consist of 20 GNSZ, 50 FNSZ, 25 TCSZ, and 25 Normal EEG signals. On the other hand, the number of evaluation dataset is 90 signals that consist of 20 GNSZ, 50 FNSZ, 5 TCSZ, and 15 Normal EEG signals. Each data extracted by using five scenarios explained in the next section.

Hjorth Descriptor
Hjorth Descriptor method as feature extraction works in time domain [14]. The output of this method represented with three parameters. They are activity, mobility, and complexity [13]: a. Activity It's the average of signal power and the surface of power spectrum in frequency domain can be indicated with this parameter by using the variance of time function. The value of activity can be large if there are many high frequency components of its signal, vice versa. (1) Mobility is the average of power spectrum frequency.
c. Complexity Complexity is the first derivative of mobility ratio of its signal.

Mel Frequency Cepstral Coefficients
Sampling frequency that is used for processing these data using MFCC method is 8000 Hz. The steps of MFCC extraction feature described as follows [16,20,21]: 1. Data were divided into some frames. Framing, the duration each frame was 30 ms. 2. Hamming window, the length of window is the value of sampling frequency times duration each frame.
where: = sample of signal windowing to-n = value of sample to-n = value of windowing to-n = number of samples in the frame 3. FFT, changing from the time domain to frequency domain. The output of this process called spectrum. 4. Mel-frequency wrapping, calculating the log amplitude at spectrum into Mel scale by using triangle filter bank. The output of this process was log energy for each filter. 5. Cepstrum, transforming mel-spectrum coefficient by using Discrete Cosine Transform (DCT) producing fourteen cepstral coefficients for each frame

Independent Component Analysis
Independent Component Analysis (ICA) commonly used for blind source separation. It needs specific conditions in order to separate a mixed signal. These conditions were (1) Independent, namely S1 and S2 as different random variables. (2) Fundamental and essential principle in estimating ICA is Non-Gaussianity. The presence or absence of kurtosis can indicate Gaussian or not a signal. If the kurtosis value is 0, then the signal is a Gaussian signal. Conversely, if the positive or negative kurtosis value is called a non-gaussianity signal [17,18].
The results of the algorithm that have been processed are independent components that have a kurtosis value not equal to 0. Then the highest value of kurtosis is chosen. Next is to find the statistical value of the selected component. The weight formula for every i can be calculated using Eq.8 [17].

Support Vector Machine
Support Vector Machine (SVM) was developed by Vapnik in 1995 to solve a classification problem. This primary goal then extended to give solution for regression technique [22]. Basically, SVM is a type of linear classifier where it can separate two classes by making optimal hyperplane function with the most significant margin. Hyperplane can be said as a dimensionless vector space that can clearly divide the vector space into two different classes. The primary goal of calculating the hyperplane is to maximize the distance from the nearest class pattern [23,24]. Fig. 1 shows an example of the use of hyperplane for splitting two classes [24]. Consider a training dataset with number of samples, and represent each sample dimension as shown in Eq.9. denotes the sample class label with . The boundary that separates each classes is shown in Eq.10, where and represent the weight and bias respectively. Eq.11 shows the linear classifier's decision function. To find the maximum margin, the distance value between hyperplane and its nearest point needs to be maximized. It can be done by finding the minimum point of Eq.12, taking into account the constraint of Eq.13 [25]. SVM kernel can be grouped into two, and they are linear SVM and nonlinear SVM. The nonlinear kernel consists of two polynomial functions (quadratic and cubic), and the radial basis function (fine, medium, and coarse gaussian). In this research, we use these six kernels to find out which one suitable for the classification process [24]. The dataset consists from 210 signals, that split into 120 training data and 90 evaluation data. Those data consist from 20 GNSZ, 50 FNSZ, 25 TCSZ, and 25 Normal EEG signals. On the other hand, the number of evaluation data was 90 signals that consist of 20 GNSZ, 50 FNSZ, 5 TCSZ, and 15 Normal EEG signals.

Testing Scenario
In this research, we do five scenarios that combine the use of three feature extraction methods.
1. The first scenario, extracting the features by using Hjorth Descriptor with three features (Activity, mobility, and complexity).

Classification Result
We used R2018b version of Matlab software. We use MFCC toolbox for extracting 14 cepstral coefficients, and SVM toolbox for the classifier. We used 5-fold cross validation to test generalization capabilities. After that, we split the dataset into training and testing data as mentioned in section 2. Figure 2 shows the example of normalized seizure type signals, GNSZ, FNSZ, TCSZ, and normal EEG signal. Visually the pattern of each seizure signal shows that they follow the general information about the seizure, which has a lower frequency, and higher amplitude [2]. We observe the optimum classification result from different SVM kernels. The kernels used were linear, quadratic, cubic, fine, medium, and coarse Gaussian. The result from each scenario are