• Users Online: 126
  • Print this page
  • Email this page

 Table of Contents  
Year : 2020  |  Volume : 10  |  Issue : 6  |  Page : 266-271

Feature extraction for epileptic seizure detection using machine learning

Department of Computer Engineering, Pune Institute of Computer Technology, Pune, Maharashtra, India

Date of Submission11-Nov-2020
Date of Acceptance17-Nov-2020
Date of Web Publication24-Dec-2020

Correspondence Address:
Renuka Mohan Khati
P-157, Sarvatra Vihar Colony, Khadki, Pune - 411 004, Maharashtra
Login to access the Email id

Source of Support: None, Conflict of Interest: None

DOI: 10.4103/cmrp.cmrp_52_20

Rights and Permissions

Background: Epilepsy is a common neurological disorder and affects approximately 70 million people worldwide. The traditional approach used by neurologists for the detection of seizure is time consuming.
Aim: An automated approach is required that can assist the neurologists in seizure diagnosis in order to minimise the diagnostic time.
Materials and Methods: Electroencephalogram (EEG) signals record the electrical activities of the brain and can be used effectively in seizure diagnosis. We have evaluated our system using Bonn university database. Appropriate feature selection is very important in pattern recognition problems. We used recursive feature elimination (wrapper method), for the selection of best features. In our study, we have used EEG signals to evaluate the performance of seven machine learning algorithms.
Results: We obtained a classification accuracy of 99%, which is a significant improvement over the state-of-the-art methods. The classification performance across 10 folds of cross validation of Logistic regression and Adaboost was the highest with an accuracy of 99%. While using naive bayes and random forest, the Area under the ROC curve value obtained was 1. The sensitivity obtained using naive bayes classifier was 100%.
Conclusion: Our approach requires minimum feature extraction that makes it an efficient approach. Recursive feature elimination was used to select the features which yield good accuracy results. It was observed that logistic regression and Adaboost performed superior with an accuracy of 99%.

Keywords: Epilepsy, feature extraction, feature selection

How to cite this article:
Khati RM, Ingle R. Feature extraction for epileptic seizure detection using machine learning. Curr Med Res Pract 2020;10:266-71

How to cite this URL:
Khati RM, Ingle R. Feature extraction for epileptic seizure detection using machine learning. Curr Med Res Pract [serial online] 2020 [cited 2021 Jan 19];10:266-71. Available from: http://www.cmrp.org/text.asp?2020/10/6/266/304823

  Introduction Top

Today, we are living in an era of medical research in which by making use of sophisticated data-processing technologies, patient's health status can be monitored.[1] Epilepsy is a neurological disorder characterised by recurrent seizure activity.[2] Epilepsy affects approximately 70 million people worldwide. Epilepsy is a central nervous system neurological disorder that is characterised by seizures and occurs due to episodes of abnormal electrical discharges in the brain.[3] It is a tedious task for neurologists to detect the presence of seizures in long electroencephalogram (EEG) recordings. One of the challenges in biomedical research is the classification of EEG signals automatically with good accuracy in order to assist the neurologists in the diagnosis. Machine learning algorithms can be used to make seizure diagnosis faster.

EEG is the most common diagnostic tool used for epileptic seizure detection. EEG signals can be recorded by placing electrodes on the patient's scalp.[4] An automated approach for the detection of seizures can assist neurologists in seizure detection and can reduce the diagnostic time.[5],[6]

Our approach requires minimum feature extraction that makes it an efficient approach. We have extracted 11 efficient features, namely minimum value, maximum value, mean, standard deviation, root mean square (RMS), zero cross-frequency, variance, median, skewness, Shannon entropy and kurtosis. For the selection of best features, we used a wrapper method called recursive feature elimination. Using recursive feature elimination, out of 11 features, eight features were selected. We have evaluated our system using Bonn university database.

Related studies

In any machine learning process, the first step in which data get transformed into a form that can be easily interpreted by the algorithm is data pre-processing. In some approaches, empirical mode decomposition had been used,[7] while some have done removal of noise and artefacts[8],[9] to perform data pre-processing. In the pre-processing stage,[10] automatic channel selection engine has been used that searches for that intracranial electroencephalogram (iEEG) channel, which is making the most contribution to seizures. Hence it is efficient in terms of computation, without sacrifice in the accuracy. Denoised Fourier transform and cross-correlation across electrodes were used in time and frequency domains for pre-processing of data in the approach proposed by Kumar et al.[4]

After pre-processing of EEG signal, feature extraction should be performed. The classification of epileptic EEG signals from healthy EEG signals depends on the features selected to train the model.[11] Various algorithms such as target point selection, current maxima and lower threshold have been used for feature extraction.[9] Time and frequency domain features have been used for classification by some researchers.[3],[5],[7],[12],[13] Along with time and frequency domain features,[13] certain statistical features and non-linear wavelet-based entropy features have been extracted. Twelve potential features were extracted by Raghu et al.[11] to train their model. Teager energy, power spectral density (Yule–Walker) and entropy (Shannon and Renyi) features were extracted by Sriraam et al.[8] where Teager energy is an operator that can be used to estimate the energy of a non-stationary signal. Yule–Walker method was selected as the best feature extraction method. Shannon entropy is the best possible lossless compression that provides low entropy values; Renyi entropy is a generalised form of Shannon's entropy.

Time, wavelet and spectral domain features were extracted by Nandy et al.[9] in addition to connectivity and entropy-based features. Fourteen features were extracted from EEG signals by Costa et al.,[14] and comparison was performed for estimating the accuracy of six types of neural network architectures. After pre-processing, features such as standard deviation, kurtosis, mean, variance and skewness were extracted by Priyanka et al.[15] The main idea behind the approach proposed by Choubey and Pandey[16] was using reduced features for the detection of epileptic seizures. K nearest neighbour (KNN) classifier was used to classify the EEG signal using expected activity measurement coefficient and Hurst exponent with Higuchi fractal dimension features. Twenty-four features from time, frequency and time–frequency domain were extracted by Hernández et al.[1] In the approach proposed by Bhowmick et al.,[17] they have trained their model using a unique feature set involving time domain features, zero crossing, RMS, waveform length and mean absolute value.

Feature selection and feature ranking can be performed after feature extraction. Feature ranking was performed using t-test, receiving operator characteristics, Bhattacharyya and Wilcoxon methods by Raghu et al.,[11] after which 8 features out of the 12 were considered favourable for classification purposes. Feature selection using multi-objective evolutionary algorithm in the approach proposed by Nandy et al.,[9] whereas firefly optimisation was used by Sharaf et al.[18] In order to improve feature selection, hypothetical testing was performed by Harpale and Bairagi.[3] In order to improve accuracy, feature ranking can be implemented.[15]

After feature selection, classification should be performed. Random forest classifier was used by Sharaf et al.[18] for the classification and prediction of seizure and seizure-free classes. Fuzzy classifier was used by Harpale and Bairagi[3] to classify the EEG signals in order to predict seizure, and they have used pattern-adapted wavelet transform for the improvement of classification. Support vector machine (SVM) was used for classification by Nandy et al.[9] For the hyper parameter tuning of SVM, Bayesian optimisation algorithm was used. Multilayer perceptron was used by Sriraam et al.[8] as a classifier. Five different algorithms were used for the classification of normal and abnormal patients using neural networks, radial basis function and SVM, machine learning techniques by Sood.[19] It was observed that neural network outperforms for their work.

A technique known as stacked bidirectional long short-term memory was used in the approach proposed by Thara et al.,[20] which was capable of addressing the gradient problem that is seen in recurrent neural networks. To propose an approach that is generalised across different subjects for the detection of seizure, KNN classifier was used.[21] Intracranial EEG signals along with various classification algorithms of machine learning were used for performing the classification by Ilakiyaselvan et al.[22] For the prediction of seizures using several machine learning algorithms, intracranial EEG signals were used by Sood.[4] Discrete wavelet transform and parametric methods based on autoregressive model, both features were provided to classifiers like artificial neural networks, SVMs, KNNs, kmeans, naive Bayesian in the approach proposed by Karlık and Hayta.[23] It was observed that KNN, SVMs and artificial neural networks were the most efficient classification algorithms.

Clustering technique was used to discover different groups of data, that is healthy and epileptic seizures.[24] After dividing the data into different clusters, features were extracted from each cluster. These features were validated using SVMs, logistic regression and naive Bayes. The goal of Houta et al.[25] was to use an in-ear sensor for the detection of seizures and connect relevant actors to exchange the medical data using networking infrastructure.

  Materials and Methods Top

In this section, we elaborate the proposed framework for seizure detection. This approach implements the following stages: feature extraction, feature selection, building a model (training) and model validation. Initially, EEG signals were loaded, and feature extraction was performed. After feature extraction, feature selection was performed using recursive feature elimination method which is a type of wrapper method for feature selection. [Figure 1] shows the schematic diagram of the proposed approach.
Figure 1: Schematic diagram of the proposed approach

Click here to view

Dataset used

We have used Bonn university database in our proposed approach. This dataset consists of five sets each having 100 EEG segments of 23.6 s duration. All EEG segments were recorded with a sampling rate of 173.61 Hz and were filtered using 0.53–40 Hz bandpass filtering.[1] Set B and set E were used in the proposed approach. Set B was recorded from five healthy patients, using standard electrode placement scheme. Set E consists of all epileptic segments.

Feature extraction

The accuracy of pattern recognition problems largely depends on the feature extraction. In order to get good classification results, largely discriminating features are required to be extracted. The number of features extracted should be less and should consume less computation time.

We have extracted 11 features by considering the demand of reasonable computation: minimum value, maximum value, mean, standard deviation, RMS, zero cross-frequency, variance, median, kurtosis, skewness and Shannon entropy.Consider the EEG signal is represented as X = X1, X2, X3,…, Xn. [Figure 2] shows the heatmap of the features used in the experimentation.
Figure 2: Heatmap for the correlation between the selected features of Bonn university database

Click here to view

Minimum value

Minimum value is the minimum value of a particular signal.

Maximum value

Maximum value is the maximum value of a particular signal.


Mean is defined as the average of a signal. It is also known as expectation. Mean is given by:

where μ is the mean.


Variance is the average of the squared difference of the signal and mean. It measures the dispersion of signal from its mean value.[15] Variance is given by:

where μ is the mean.

Standard deviation

Standard deviation is defined as the square root of variance. It is denoted by σ.

Zero cross-frequency

The point where zero axis is cut by the wave by changing its state from positive to negative or vice versa is called zero crossing.[17] Zero cross-frequency can be defined as the frequency with which the signal changes from positive to negative or negative to positive.

Root mean square

RMS can be defined as the effective value of the signal's varying voltage. It is the quadratic or generalised mean.[17] RMS is given by:

where XRMS is the RMS value of the signal.


Median is the median value among all values.


Kurtosis describes observed data distribution across mean.[11] It is a statistical measure. Kurtosis is given by:

where μ is the mean and σ is the standard deviation.


Skewness determines the asymmetry of data around the samples' mean. Skewness is negative and positive when the data spread is more towards the left of the mean and the data spread is more towards the right, respectively.[11] Skewness can be defined as:

where μ is the mean and σ is the standard deviation.

Shannon entropy

Shannon entropy is based on the formula of Shannon entropy with non-normalised property.[11] Shannon entropy is given by:

Feature selection

The selection of appropriate feature is important in order to improve the performance of machine learning algorithms.

Recursive feature elimination (Wrapper method)

We have used a wrapper method called recursive feature elimination. To determine the best number of features to select, we used cross-validated selection of the best number of features. Out of the 11 features, eight features were selected, namely minimum value, maximum value, mean, standard deviation, RMS, zero cross-frequency, variance and median.


'No Free Lunch' theorem states that a single model cannot work the best for all problems. Hence, the approach is to test multiple models in order to get the one that works the best for a given problem. In our approach, we are testing the following seven classification models:

Naive Bayes

Naive Bayes is a Bayes theorem-based probabilistic classifier. It makes an assumption that the extracted features are independent, that is the presence or absence of a feature makes no impact on the presence or absence of other features. For the estimation of the parameters in naive Bayes model, maximum likelihood procedure is used. The resulting class is the class with the highest posterior priority.[24]

Support vector machine

SVM works by determining an optimal hyper plane for linearly separable patterns. The optimisation is performed by determining the hyper plane that brings maximum separation between the data points of two different classes.[12] Linear kernel was used in our approach.


Adaboost is an ensemble technique in which the dataset is weighed. The weak learners are trained on a subset of data such that the misclassified samples are provided with higher weights. In this way, more importance is given to the previously misclassified sample while training.[22]

Decision tree

Decision tree classifies the data into distinct classes by checking the similarities among the data. Until the termination, the attributes keep on splitting into branches.[13]

Random forest

Random forest is an ensemble technique that works by constructing a group of trees, where each tree grows, making binary decisions. The best feature is used to perform the node split. The importance of features is computed on the basis of decreasing Gini index. In our approach, the number of binary trees was set to 100.[12]

Logistic regression

Logistic regression classifier is commonly used to estimate the likelihood of the presence of a disease. This algorithm fits a separating hyper plane that separates the two classes.[24]

K nearest neighbours

KNN is a widely used machine learning algorithm. It employs lazy learning. It is known as instant-based algorithm. It was observed that KNN works effectively with rapidly changing data.

Model training/validation

In this approach, 200 EEG samples were used as input data with classes: 'healthy' and 'seizure'. 'Healthy' class denotes non-epileptic EEG signal, whereas 'seizure' class denotes epileptic EEG signal and was used for the detection of epileptic seizure. The feature set extracted was used to generate the training and testing sets using ten-fold cross-validation.

Ten-fold cross-validation

The data were divided into ten folds, out of which nine folds were used for training and the class of the remaining fold is predicted based on the training performed using those nine folds. The samples in the test fold are completely unseen. This complete process is repeated ten times.

  System Evaluation Top


Accuracy is the performance metrics used to evaluate the classification model. It is the ratio of correct predictions to the total number of predictions. Accuracy is given by:

where TP, TN, FP and FN are true positive, true negative, false positive and false negative, respectively.


Precision is the ratio of relevant instances to the retrieved instances. Precision is given by:


Sensitivity is defined as the ratio of total amount of relevant instances that were retrieved actually. Sensitivity is given by:


Specificity is used to measure the proportion of actual negatives as such correctly identified. Specificity is given by:

F1 score

F1 score is the harmonic mean of precision and recall. F1 score is given by:

Area under the receiver operating characteristic curve

Area under the receiver operating characteristic (ROC) curve (AUC) provides an aggregate measure of the performance across all possible classification thresholds.

  Results and Conclusion Top

Currently, the epileptic activity in the EEG recording is examined using traditional technologies. Automating this process will have many advantages such as faster diagnosis and reduction in the seizure diagnostic cost. Features from EEG signals were extracted for the detection of epilepsy using appropriate feature extraction and feature-ranking techniques. We have used recursive feature elimination method to select the important features. Feature selection provides an advantage that it does not require any expert to carefully select the features that are optimal. [Table 1] shows the results obtained using different classifiers. Using our approach, we obtained a classification accuracy of 99%, which is a significant improvement over the state-of-the-art methods. The classification performance across ten folds of cross-validation of logistic regression and Adaboost was the highest with an accuracy of 99%. While using naive Bayes and random forest, the AUC value obtained was 1. The sensitivity obtained using naive Bayes classifier was 100%. For seizure diagnosis, quick and accurate results are expected; hence, our goal was detecting epilepsy with good accuracy using machine learning techniques, by extracting minimum number of robust features. The proposed approach has a classification accuracy of 99%, which is a significant improvement in the field of neuroscience.
Table 1: Results

Click here to view

Financial support and sponsorship


Conflicts of interest

There are no conflicts of interest.

  References Top

Hernández DE, Trujillo L, Z-Flores E, Villanueva OM, Romo-Fewell O. Detecting epilepsy in EEG signals using time, frequency and time-frequency domain features. Stud Syst Decis Control 2018;143:167-82.  Back to cited text no. 1
Paul F, David H, Abir H, Dhiya Al-J, Khaled Abdel-A. “Automatic Epileptic Seizure Detection Using Scalp EEG and Advanced Artificial Intelligence Techniques”. BioMed Res Int 2015;2015:17.  Back to cited text no. 2
Harpale V, Bairagi V. An adaptive method for feature selection and extraction for classification of epileptic EEG signal in significant states. J King Saud Univ 2018. [doi: 10.1016/j.jksuci. 2018.04.014].  Back to cited text no. 3
Kumar R, Jhelumi RR, Singh AM, Kumar P. Feature engineering coupled machine learning algorithms for epileptic seizure forecasting from intracranial EEGs. BioRxiv 2017.  Back to cited text no. 4
Mporas I, Tsirka V, Zacharaki EI, Koutroumanidis M, Megalooikonomou V. Online seizure detection from EEG and ECG signals for monitoring of epileptic patients. Lect Notes Comput Sci 2014;8445 LNCS: 442-7.  Back to cited text no. 5
Das K, Daschakladar D, Roy PP, Chatterjee A, Saha SP. Epileptic seizure prediction by the detection of seizure waveform from the pre-ictal phase of EEG signal. Biomed Signal Process Control 2020;57:101720.  Back to cited text no. 6
Usman SM, Usman M, Fong S. Epileptic seizures prediction using machine learning methods. Comput Math Methods Med 2017;2017:9074759.  Back to cited text no. 7
Sriraam N, Raghu S, Tamanna K, Narayan L, Khanum M, Hegde AS, et al. Automated epileptic seizures detection using multi-features and multilayer perceptron neural network. Brain Inform 2018;5:10.  Back to cited text no. 8
Nandy A, Alahe MA, Nasim Uddin SM, Alam S, Nahid A, Awal MA. Feature extraction and classification of EEG signals for seizure detection. 1st Int Conf Robot Electr Signal Process Tech ICREST 2019;2019:480-5.  Back to cited text no. 9
Truong ND, Kuhlmann L, Bonyadi MR, Yang J, Faulks A, Kavehei O. Supervised learning in automatic channel selection for epileptic seizure detection. Expert Syst Appl 2017;86:199-207.  Back to cited text no. 10
Raghu S, Sriraam N, Hegde AS. Features ranking for the classification of epileptic seizure from temporal EEG. Int Conf Circuits Control Commun Comput (I4C) 2016;2017:1-4.  Back to cited text no. 11
Manzouri F, Heller S, Dümpelmann M, Woias P, Schulze-Bonhage A. A comparison of machine learning classifiers for energy-efficient implementation of seizure detection. Front Syst Neurosci 2018;12:1-11.  Back to cited text no. 12
Hussain L. Detecting epileptic seizure with different feature extracting strategies using robust machine learning classification techniques by applying advance parameter optimization approach. Cogn Neurodyn 2018;12:271-94.  Back to cited text no. 13
Costa RP, Oliveira P, Rodrigues G, Leitão B, Dourado A. Epileptic seizure classification using neural networks with 14 features. In: Lovrek I, Howlett RJ, Jain LC, editors. Knowledge-Based Intelligent Information and Engineering Systems. KES 2008. Lecture Notes in Computer Science. Vol. 5178. Springer; 2008.  Back to cited text no. 14
Priyanka S, Dema D, Jayanthi T. Feature selection and classification of Epilepsy from EEG signal. Int Conf Energ 2017;2018:2404-6.  Back to cited text no. 15
Choubey H, Pandey A. Classification and detection of epilepsy using reduced set of extracted features. Int Conf Signal Process Integr Networks 2018;2018:560-4.  Back to cited text no. 16
Bhowmick D, Singh A, Sanyal S. Recognition of epilepsy from non-seizure electroencephalogram using combination of linear SVM and time domain attributes. Int Conf Contemp Comput IC3 2017 2018;2018:1-4.  Back to cited text no. 17
Sharaf AI, El-Soud MA, El-Henawy IM. An automated approach for epilepsy detection based on tunable Q -Wavelet and firefly feature selection algorithm. Int J Biomed Imaging 2018;2018:5812872.  Back to cited text no. 18
Sood M. Performance analysis of classifiers for seizure diagnosis for single channel EEG data. Biomed Pharmacol J 2017;10:795-803.  Back to cited text no. 19
Thara TD, PremaSudha BG, Xiong F. Epileptic seizure detection and prediction using stacked bidirectional long short term memory. Pattern Recognit Lett 2019;128:529-35.  Back to cited text no. 20
Fergus P, Hignett D, Hussain AJ, Al-Jumeily D. An advanced machine learning approach to generalised epileptic seizure detection. Lect Notes Comput 2014;8590 LNBI: 112-8.  Back to cited text no. 21
Ilakiyaselvan N, Bhatt H, Shukla U, Nayeemulla Khan A, Shahina A. Epileptic seizure prediction through machine learning and spatio-temporal features based time series analysis of intracranial electroencephalogram data. Int J Eng Adv Technol 2019;9:4763-70.  Back to cited text no. 22
Karlık B, Hayta ŞB. Comparison machine learning algorithms for recognition of epileptic seizures in EEG 2019.  Back to cited text no. 23
Kabir E, Siuly, Cao J, Wang H. A computer aided analysis scheme for detecting epileptic seizure from EEG data. Int J Comput Intell Syst 2018;11:663-71.  Back to cited text no. 24
Houta S, Bisgin P, Dulich P. Machine Learning Methods for Detection of Epileptic Seizures with Long-Term Wearable Devices. Elev Int Conf EHealth, Telemedicine, Soc Med 2019:108-13.  Back to cited text no. 25


  [Figure 1], [Figure 2]

  [Table 1]


Similar in PUBMED
   Search Pubmed for
   Search in Google Scholar for
 Related articles
Access Statistics
Email Alert *
Add to My List *
* Registration required (free)

  In this article
Materials and Me...
System Evaluation
Results and Conc...
Article Figures
Article Tables

 Article Access Statistics
    PDF Downloaded16    
    Comments [Add]    

Recommend this journal