0% found this document useful (0 votes)
4 views

Paper67_camerar

This paper explores the use of Machine Learning models to predict epilepsy by analyzing EEG signals, which are often misdiagnosed using traditional methods. It employs Discrete Wavelet Transform to extract features from EEG data and compares various classifiers, including ANN, SVM, and KNN, to determine their effectiveness in seizure prediction. The study finds that ANN achieved the highest accuracy of 98%, highlighting the potential of Machine Learning in improving epilepsy diagnosis and patient care.

Uploaded by

ZoHaib JaWed
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Paper67_camerar

This paper explores the use of Machine Learning models to predict epilepsy by analyzing EEG signals, which are often misdiagnosed using traditional methods. It employs Discrete Wavelet Transform to extract features from EEG data and compares various classifiers, including ANN, SVM, and KNN, to determine their effectiveness in seizure prediction. The study finds that ANN achieved the highest accuracy of 98%, highlighting the potential of Machine Learning in improving epilepsy diagnosis and patient care.

Uploaded by

ZoHaib JaWed
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Epilepsy Prediction using Machine Learning

Abstract -- Epilepsy has severe impacts on patients including resting. Delta is recorded when the person is awake and
disruptance of their social relationships and less mobility. there is significant mental activity going on.
Prediction of the disease can help the patient prevent the Epilepsy is a life threatening disorder. The patient's life is
onset of seizures with the help of appropriate medication.
affected depending on the severity of the seizure. Early
Since the traditional methods of studying EEG are prone to
misdiagnosis, Machine Learning can provide a more
prediction of a seizure can alert the medical team to take
accurate diagnosis. In this paper, we aim to survey models as necessary action. In other words, detection of preictal
to better describe methodologies for a high precision model state can control the severity of the seizure and provide
to predict epilepsy in patients. Epilepsy is a neurological sufficient time to the medical team to devise strategies.
disorder caused due to disturbance in the electrical activity
of neurons. Detection of an Epileptic seizure is a tedious task Traditionally, EEG graphs are observed by a medical
requiring an expertise in the Medical field. The lives of practitioner. This process is cumbersome and it is
Epileptic patients can be improved multifold through early vulnerable to a misdiagnosis. The EEG data often has
detection of the seizure. Neurons transfer messages through errors due to noise and interference from the equipment,
electrical activity which can be recorded through an
thus, making Epilepsy Detection more challenging. For an
Electroencephalogram (EEG). This work showcases the
efficiency of different Machine Learning models to detect an accurate detection of Epilepsy, neurologists study the
Epileptic seizure. In order to transform EEG signal to time- EEG data for weeks or months. Over the last few decades,
frequency domain we employed Discrete Wavelet a variety of Machine Learning algorithms have been
Transform. employed to address this problem.
Based on the decomposition obtained from Discrete Wavelet
Transform, different features were extracted from the sub To study EEG signals we have employed Discrete
bands which were later fed into classification models.This Wavelet Transform unlike the conventional Fourier
paper introduces a variety of Machine Learning classifiers Transform. Fourier Transform provides a high resolution
to detect Epilepsy including ANN, KNN, Logistic Regression
in frequency domain i.e we can see which frequencies are
and Support Vector Machine.
present in the signal. The disadvantage of Fourier
Keywords—Epilepsy, Seizure, EEG (Electroencephalogram),
Transform is that it doesn’t tell us the time instant at
Machine Learning, KNN (K-Nearest Neighbor), Logistic which these frequencies are present. In order to address
Regression, Artificial Neural Network, SVM (Support Vector this issue, Discrete Wavelet Transform is used. DWT
Machine) ))
localizes the signal in time-frequency domain [3]-[5].

I. INTRODUCTION The main aim of this paper is to compare the performance


of different Machine Learning models in Detection of
Epilepsy is a severe neurological disorder caused due to Epilepsy. Our study focused on studying EEG signals in
unbalanced excitement of neurons. The primary symptom time-frequency domain. This paper is organized as
of Epilepsy is a seizure. It causes loss of consciousness, follows: Section II gives an insight about related work in
confusion and cognitive disability. Globally, 65 million this domain. Section III focuses on the dataset.
people suffer from Epilepsy and the number is increasing Methodology is presented in Section IV. Section V
at a drastic rate [1]. emphasizes on Results followed by Future scope in
Out of every 1000 people, 4 to 10 people suffer from an Section VI. Conclusions from this project are displayed in
active seizure at any point of time [2]. Section VII.

Electroencephalogram (EEG) is used to record electrical Problem Statement


activity in the brain. According to the EEG signals, the
brain activity of patients is classified into four states:
To analyze and compare the performance of different
preictal state, which is the pre seizure state, ictal state,
machine learning models and identify the most
which defines the time of seizure, postictal state that is the
efficient model for the detection of Epilepsy using
time right after the seizure and lastly, interictal state
Electric signals.
which defines the time period between two seizures.
Delta is recorded during deep sleep. Theta, when the Major Contributions
patient is asleep. Alpha, when the patient is awake but
mental activity is low. In other words, the patient is This paper proposes models to better predict Epilepsy in
patients. The number of cases of Epilepsy in a year is an
2019 THIRD IEEE INTERNATIONAL CONFERENCE ON ELECTRICAL, COMPUTER AND COMMUNICATION TECHNOLOGIES

enormous number. This paper aims to help researchers Authors in [14] had the objective to predict Epilepsy
choose the best Machine Learning algorithm to improve using Support Vector Machine. In addition to this, the
prediction of Epilepsy. Image Processing was proposed performance and accuracy of the model was studied.
before machine learning for Epilepsy Detection.
Transformation of EEG signals was achieved through
Fourier Transform. However, due to electrical III. DATASET
interference and other artifacts detection of noise through
visual depiction over a long time is cumbersome. Also, The dataset used in this project was obtained from the
transformation of signals to frequency domain using Bonn University, Germany. It is a publicly available
Fourier transform gives data from only frequency domain. dataset and comprises of 5 sets that are A, B, C, D and E.
EEG signals are non stationary and for accurate prediction Amplification of signals is achieved through 128 channels
data from both time and frequency domain is needed. In and a 12 bit ADC is employed with a sampling frequency
the view of this scenario, Discrete Wavelet transform is of 173.6 Hz.
introduced. The demerits of Epilepsy Prediction using
image processing are overcome by the proposed project Sets A and B consist of readings obtained from healthy
"Epilepsy Prediction using Machine Learning". patients with eyes open and closed respectively. Sets C
and D consist of data collected from epileptic patients
during seizure free interval. Set D data is recorded from
II. RELATED WORK the epileptogenic zone whereas Set C has data from
hippocampal formation of opposite hemisphere. Set E
Prediction of Epilepsy has been under research since the contains data of epileptic patients during seizure. 11,500
past couple of decades. Numerous research papers have samples are taken in the dataset with each class
been published that introduce new models to predict containing 2300 samples as shown in Fig.1.
Epilepsy with more accuracy. Many researches have been
conducted to preprocess the EEG signals in an efficient
manner. Following research papers have helped us shape
the methodology of this project and have given us a
detailed insight about the technologies used in this
domain.

Authors in [6]-[8] had the aim to predict Epilepsy using


EEG signals. Various datasets have been used and the
input datasets have been preprocessed in different ways
including filters.

Authors in [9]-[10] used Machine Learning classifiers to


predict an Epileptic seizure like KNN, neural networks,
etc. A comparison of all these models has been made.
Fig 1. Histogram of the dataset

Authors in [11] aimed to predict Epilepsy using EEG


Set E contains data of patients at the time of an
signals. This paper focused on the problems faced by
epileptic seizure. The waveform representing an epileptic
Deep Learning and Artificial Intelligence in regards to seizure is shown in Fig. 2. The blue line shows samples
processing the raw EEG signals that may lead to from Set E.
misdiagnosis. Various evaluation metrics are used to
display the results and shortcomings of the methods.

The authors focus on comparing the EEG signals of a


normal patient to that of an Epileptic patient. Raw EEG
wave undergo Fourier Transformation and Short Time
Fourier Transformation. [12]

Author in [13] emphasized on the causes of Epilepsy and


the factors that could increase the risk of this Epileptic
seizures. While predicting Epilepsy these risk factors can
be taken into consideration
Fig 2. EEG Signals from the dataset

2
IV.METHODOLOGY hyperparameter for random forest grid search has been
used. Like ANOVA test, the result from Random Forest is
entered into Support Vector Machine to determine the
EEG signals contain noise due to interference from the
prediction accuracy when only features from Random
equipment or eye movements. Noise is removed using
Forest are used. The accuracy of prediction after using
different filters. However, the dataset in consideration is
Random Forest features is the same as ANOVA i.e 96%.
already denoised. All the sets are prepared for
If all the features of the original dataset are considered for
decomposition using Discrete Wavelet Transform. EEG
prediction the accuracy of the model increases by 1%.
signal is a time series digital sample of analog voltages
generated due to neural activity.
Logistic Regression
As mentioned before, Wavelet transform allows us to
analyse data in time-frequency domain unlike Fourier Logistic Regression predicts a binary outcome by
Transform. Wavelets belong to different families like labelling the signal as epileptic or non-epileptic. It is a
Haar, Daubechies, Symlets, etc. We used wavelets from straightforward algorithm and thus, the accuracy is not
the Daubechies family of fourth order to achieve very high. We applied a confusion matrix to see how
decomposition upto level 4. many actual values matched with the predicted values. In
the confusion matrix 1 stands for Epileptic and 0 stands
The dataset contains 179 features which are given as an for healthy. The confusion matrix is shown in Fig. 3.
input to feature selection algorithm Random Forest. After
feature selection, machine learning algorithms are
employed. The various models that are used:

ANOVA

ANOVA uses statistics to determine the


relationship between dependent and independent
variables. Using train_test_split, the dataset is split
into two parts. Test data contains 33% of the
original data that equals to 3450 instances and the
training data contains 67% of the original data that
equals 7705 instances.
Fig 3. Confusion Matrix of Logistic Regression
The 20 most important features according to
ANOVA test are:[2, 5, 8, 10, 11, 14, 17, 19, 20, 21,
Support Vector Machine
22, 23, 26, 28, 29, 32, 35, 37, 44, 46] These
features are entered into support vector machine to
check the accuracy and efficiency of the selected In this project, we have used SVM for the purpose of
features. The following figure represents the binary classification. SVM is trained using the dataset that
precision, recall, f1-score and support after only has already been classified into epileptic signal and
ANOVA features are considered. According to normal signal. Whenever new data is entered into this
this, the accuracy of prediction using ANOVA model, it figures out which category does it belong to.
features only is 96%.
SVM separates the data set into two categories through an
ideal line called hyperplane. Hyperplane is allotted in
such a way that the distance between the hyperplane and
Random Forest support vectors is the maximum. In other words, SVM
draws a hyperplane in such a way that the two classes are
Random Forest is also a supervised learning model that as far away from the hyperplane. This makes the decision
works on decision trees. The number of decision trees making process accurate. Fig 4. Illustrates the confusion
varies from one situation to another. Each decision tree matrix obtained from SVM.
classifies data like an if statement based on previous
results. Using data from decision trees, random forest
algorithm determines the relationship between
independent and dependent variables. To find the best
2019 THIRD IEEE INTERNATIONAL CONFERENCE ON ELECTRICAL, COMPUTER AND COMMUNICATION TECHNOLOGIES

Fig 4. Confusion Matrix of SVM Fig 6. Confusion Matrix of KNN

Artificial Neural Network V.RESULTS

It is created in a way that it replicates the connection of 20 features were selected using ANOVA and Random
neurons in the human brain. In other words, the aim of Forest. The accuracy of prediction using these 20 features
ANN is to reason like human brain. ANN has a network was 96%. However, the accuracy increased to 97% when
of millions of neurons that are arranged in layers. Most of all features were taken into consideration while making
these layers are interconnected. the prediction.

ANN learns by enormous amount of training data fed into Data of 2300 people was given as input to four models.
it. A confusion matrix of this algorithm is shown in Fig. 5. Out of the four models, Artificial Neural Network
demonstrated an accuracy of 98% followed by SVM and
KNN at 97% and 92% respectively. At the bottom of the
list was Logistic Regression with an accuracy of 82%.

KNN is the fastest model taking 4.209 seconds to


complete execution followed by Logistic Regression and
Support Vector Machine taking 7.513 and 13.374 seconds
respectively. At the bottom is ANN taking 147.307
seconds to finish.

From Fig 5 it can be clearly seen that ANN has predicted


that 1852 people are healthy and 448 are epileptic. Out of
a total of 448 labelled as Epileptic, only 416 people had
epilepsy. We can manually calculate the accuracy of each
model by adding the true positives and negatives across
Fig 5. Classification Matrix of ANN the diagonal and dividing it by the total entries. Table I
shows the metrics of each model.
K- Nearest Neighbor (KNN)
TABLE I: PREDICTION METRICS BY DIFFERENT MODELS

KNN uses distance metric between two points like


Model People predicted People predicted
Euclidian Distance method. The letter “k” is a parameter
with Epilepsy as healthy
that contains the value of number of nearest neighbors to
Linear Regression 448 1852
include during the prediction. The confusion matrix of
this algorithm is shown in Fig. 6. ANN 448 1852
SVM 426 1874
KNN 470 1830

VI.SCOPE AND FUTURE ENHANCEMENTS

4
Communication Conference (IEMCON), pages 395–400.
IEEE, 2018.
The prediction of Epilepsy is still being researched and
thoroughly studied. No model is able to predict Epilepsy [6] A. Hamad, E. H. Houssein, A. E. Hassanien and A. A.
with 100% accuracy yet. A monitoring device could be Fahmy, ”Feature extraction of epilepsy EEG using discrete
used to detect changes in a patient’s physiology that could wavelet transform”, Proc. 12th Int. Comput. Eng. Conf.
(ICENCO), pp. 190-195, Dec. 2016.
enhance the prediction dramatically.
[7] U. R. Acharya, S. Vinitha Sree, G. Swapna, R. J. Martis and
Integrating Machine Learning algorithms with brain J. S. Suri, ”Automated EEG analysis of epilepsy: A review”,
pacemakers to stimulate neural tissues using electrical Knowl.-Based Syst., vol. 45, pp. 147-165, Jun. 2013.
signals. Besides this the equipment to record EEG should [8] P. P. M. Shanir, K. A. Khan, Y. U. Khan, O. Farooq, and H.
be carefully handled in order to avoid any interference. Adeli, “Automatic seizure detection based on morphological
features using one dimensional local binary pattern on long-
term eeg,” Clinical EEG and Neuroscience, 2017.

[9] Sharmila, A., and P. Geethanjali. ”DWT based detection of


VII. CONCLUSION epileptic seizure from EEG signals using naive Bayes and k-
NN classifiers.” Ieee Access 4 (2016): 7716-7727.
Epilepsy puts immense psychological pressure on the [10] Souza, Csar R. ”Kernel functions for machine learning
patient. An early diagnosis of an epileptic seizure can applications.” Creative Commons Attribution-
improve the lives of patients multifold. Noncommercial-Share Alike 3 (2010): 29

[11] Ghosh-Dastidar, Samanwoy, Hojjat Adeli, and Nahid


Early diagnosis of a seizure can give the medical team Dadmehr. ”Mixed band wavelet-chaos-neural network
enough time to take necessary actions like setting up the methodology for epilepsy and epileptic seizure detection.”
medical equipment and discussing the plan of action. IEEE transactions on biomedical engineer ing 54.9 (2007):
1545-1551
Over the past few decades, prediction of Epilepsy has [12] Peker, M., B. Sen, and D. Delen. ”A Novel Method for
become a hotspot for researchers across the globe. Our Automated Diagnosis of Epilepsy Using Complex-Valued
goal is to contribute in this process of Epileptic Prediction Classifiers.” IEEE journal of biomedical and health
System. informatics 20.1 (2016): 108.

[13] S. D. Shorvon, “The causes of epilepsy: changing concepts of


etiology of epilepsy over the past 150 years,” Epilepsia, vol.
REFERENCES 52, no. 6, pp. 1033–1044, 2011.
[14] C. Cortes and V. Vapnik, “Support-vector networks,”
[1] O. Khouma, M. L. Ndiaye, S. M. Farsi, J. Montois, I. Diop, Machine learning, vol. 20, no. 3, pp. 273–297, 1995.
and B. Diouf, “Comparative methods of spike detection in
epilepsy,” in SAI 2015. IEEE, 2015, pp. 749–755.

[2] Epilepsy Foundation of America. About Epilepsy: The


Basics. http://www.epilepsy.com/learn/about-epilepsy-
basics;.
[3] Mehmet Akin. Comparison of wavelet transform and fft
methods in the analysis of EEG signals. Journal of medical
systems, 26(3):241–247, 2002

[4] V. Joshi, R. B. Pachori, and A. Vijesh, “Classification of ictal


and seizure-free EEG signals using fractional linear
prediction,” BIOMED. SIGNAL PROCES., vol. 9, pp. 1–5,
2014.

[5] Memoona Iftikhar, Shoab Ahmad Khan, and Ali Hassan. A


survey of deep learning and traditional approaches for EEG
signal processing and classification. In 2018 IEEE 9th
Annual Information Technology, Electronics and Mobile

You might also like