Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Journal of Signal Processing

Volume 5 Issue 1

A Novel Approach for EEG Signal Classification using Wavelet


Transform and Random Forests
Parth Sagar1*, Shivraj Kone2, Munmun Bhagat3
1,2,3
Assistant Professor, Department of Computer Engineering, SPPU, Pune, Maharashtra, India
*Email:parth.cool007@gmail.com
DOI:

Abstract
Unprovoked seizure is the symptoms of Epilepsy disorder. An electroencephalogram (EEG) is
a test that perceives electrical activity in your mind using nearly nothing, level metal circles
(anodes) added to your scalp. The EEG signals are used for diagnosis of the patient whether
it is seizure or non-seizure which causes epilepsy. The essential objective of this paper is to
build a classifier that can accurately recognize whether a subject is seizure patient or non-
seizure patient. The proposed system classifies the EEG signals into two classes using
different supervised learning algorithm. Features are extracted using discrete wavelet
transform (DWT) and Genetic algorithm approach. Features dimensions have been reduced
using Principal component analysis (PCA) before feature extraction. Different classification
algorithms like support vector machine, logistic regression and decision tree classifier.
Random forest based classification with regularization gives best results which is best from
the existing system.

Keywords:EEG, DWT, Neurons, Brain

INTRODUCTION who play out the arrangement by


An EEG records the electrical movement straightforward arbitrary inspecting and
of neurons in the brain. Fluctuations in the highlight extraction[7]. A large portion of
electricity are estimated from the voltage the strategies complete component
distinction of electrodes associated with extraction on the signs preceding order and
the brain network [1]. The indicative would thus be able to be considered as
procedure utilizing an EEG is completed two-advance methodology. In spite of the
by checking patients constantly more than fact that it has points of interest, highlight
a few days. By the by, a large portion of extraction may prompt some essential data
the recorded information must be watched in the crude highlights being lost. Besides,
and examined outwardly by a specialist so utilizing separated highlights to foresee the
as to identify epilepsy accurately[2, 3]. class of new cases now and again prompts
This discovery methodology is viewed as poor execution, which implies that the
wasteful, as the time has come expending strategy performs well in preparing
and exorbitant. Hence, devices or information however neglects to order the
techniques that lead to the quick and testing information well. Hira and Gillies
precise determination of epilepsy are (2015) thoroughly talk about the
required. Actually, various techniques shortcomings and points of interest of
have been produced to recognize instances highlight choice and extraction. This
of epilepsy. Ongoing takes a shot at EEG circumstance prompts the proposal that the
arrangement are, among others, those of full highlights ought to be utilized now and
who utilize factual ghostly element again.
extraction straightforwardly to characterize
the EEG flag, which apply k-NN to the On account of the idea of the EEG record,
unearthly highlights of EEG records, and, the RF and SVM strategies can't be

6 Page 6-12 © MAT Journals 2019. All Rights Reserved


Journal of Signal Processing
Volume 5 Issue 1

straightforwardly connected to the flag characterization systems as of now score


produced from an EEG and the flag in this extensively higher than this. Information
manner must be changed. This handling and growth is required to be vital
examination changes the flag utilizing and various methodologies will be
Discrete Wavelet Transform (DWT) as the considered[8].
preprocessing strategy. DWT is a
generally prescribed approach for When a practical classifier has been
investigating information that has both created, the objectives are twofold. First to
time and frequency. By deteriorating the utilize present day profound learning
flag into restricted components (both time procedures to expand the test accuracy.
and frequency), Mallat and Hwang (1992) One proposed approach is sketched out in
contend that DWT can describe the a paper that proposes anticipating the
example well. changed EEG frequencies into a 2D
picture with a profundity measurement for
The base outcome required for this venture frequency band. This organization makes
to be a full achievement is to have built up for perfect contributions to a standard
a classifier that is able to do precisely convolution neural network. This or
ordering scraps of EEG session another profound learning approach might
information as being from the be utilized to accomplish the most
representation of either a commonplace or astounding conceivable accuracy[9]. The
a new ability. Since this is a double second arrangement of objectives base on
characterization issue with adjusted giving knowledge into the basic systems in
classes, the base standard for accuracy is brain work. The techniques for
0.5. Full achievement would mean having achievement of these objectives will rely
an accuracy of in any event 70% (in spite upon the subtleties of the machine learning
of the fact that this number is self- calculations that can effectively group the
assertive). Best in class EEG EEG information[10].

Figure 1:Brain Waves Type.

Delta: has a frequency of < 3 Hz. It will in rest. It might happen centrally with
general be the most noteworthy in force subcortical sores and all in all
and the wave with biggest timeframe. appropriation with diffuse sores, metabolic
Usually as the predominant musicality in encephalopathy hydrocephalus or
babies up to 1 year and in stages 3 and 4 of profound midline sores. It is typically most

7 Page 6-12 © MAT Journals 2019. All Rights Reserved


Journal of Signal Processing
Volume 5 Issue 1

noticeable frontally in grown-ups (for the scalp. An EEG test or


example FIRDA - Frontal Intermittent electroencephalogram can take a gander at
Rhythmic Delta) and posteriorly in non the electrical action of the brain and may
grown-ups for example OIRDA - Occipital help in deciding if a patient experiencing
Intermittent Rhythmic Delta) [5]. EEG test is encountering a seizure[13]. It
might likewise help in anticipating
Theta: has frequency of 3.5-7.5 Hz and is whether more seizures will happen.
delegated "moderate" action. It is Certain examples on the EEG are average
consummately regular in kids <13 years of epilepsy. On the off chance that an
and in rest however not ordinary in individual's brain waves demonstrate those
conscious adults.It can be viewed as an kinds of examples, the individual is about
appearance of central subcortical injuries; twice as liable to create epilepsy[14].
it can likewise be seen in summed up There are diverse mental phases of an
appropriation in diffuse scatters, for epileptic patient as can be recognized from
example, metabolic encephalopathy or a the adjustment in their brain waves and
few occasions of hydrocephalus[4]. henceforth are pondered the EEG signals.
These are: Ictal alludes to the physiologic
Alpha: has a frequency of 7.5 to 13 Hz. Is state or occasion of a seizure. The word
typically best seen in the back locales of begins from the Latin ictus, which means a
the brain on each side, being higher in stroke or a blow. In (EEG), the account
force on the prevailing side. It is seen amid a seizure is designated "ictal"[15].
when shutting the eyes and unwinding, and The accompanying definitions allude to
evaporates when opening the eyes or the relationship of seizures with time. Pre-
cautioning by components like reasoning, ictal alludes the condition just before the
ascertaining, and so forth. It is the seizure, cerebral agony, or stroke, anyway
significant mood found in typical loosened it has starting late been discovered that a
up grown-ups. It is available for the couple of qualities of this state, (for
greater part of the life especially after the instance, Migraine air) demonstrate the
thirteenth year[4]. start of the ictal state. Post-Ictal shows the
state not long after the ictal state. Interictal
Beta: beta action is "quick" action. It has a alludes to the interval between seizures,
frequency of more noteworthy than 14Hz. that are portrays an epileptic issue. For
It is typically seen on the two sides in most by far of the overall public of
symmetrical circulation and is most epileptic patients, the interictal on the
apparent frontally.It is quickened by scalp state exists for over 99% of their
narcotic entrancing medications especially lifetime. This Interictal period EEG
the benzodiazepines and barbiturates. It recording is broke down by numerous
might be not be available or less in zones nervous system specialists to distinguish
of cortical harm. It is typically considered epilepsy in patients[16].
as an ordinary beat. It is the prevailing
mood in patients who are alert, on edge or Epileptic patients experience the ill effects
have their eyes opened. The noticeable of different difficulties in their everyday
brainwaves have been shown in Figure life. They may experience different
1[4]. physical harms or mishaps at the season of
the seizure in the event that they are
LITERATURE SURVEY occupied in specific undertakings which
The universally institutionalized 10-20 may include overwhelming machinery for
frameworks are normally used to record example driving. Thusly discovery of
unconstrained EEG. In this framework 21 seizure is critical for determining its
electrodes are connected on the outside of motivation, root, and so forth with the goal

8 Page 6-12 © MAT Journals 2019. All Rights Reserved


Journal of Signal Processing
Volume 5 Issue 1

that legitimate treatment and prescription variation present in the data set. This is
can be offered to those epileptic patients achieved by transforming to uncorrelated
experiencing epilepsy and diminish the features called as principal components,
opportunity of physical harm or and which are ordered so that the first few
mishaps[18]. The customary method for retain most of the variation present in all
identifying seizure in EEG signals is the of the original variables.First represent
manual skimming through 10s or even the independent features in terms of
100s of long stretches of recorded EEG matrix. Find the mean of the matrix for
motions alongside the requirement for a each features results in a vector of
specialist for the undertaking. This is features mean. Compute the covariance
extremely a strenuous and tedious matrix of the whole dataset using the
employment and furthermore inclined to formula.
human blunders. Subsequently auto
location of seizure in EEG signals is = ,
essential. Numerous such strategies are
accessible utilizing diverse methodologies
for a similar issue. In this task we made a Where, X & Y are the two features.
framework which dissects the EEG
signals channel astute, and extricates Computer eigen values and eigen vectors
highlights from them utilizing Discrete and sort the eigenvectors by decreasing
Wavelet Transform (DWT) trailed by eigen values and choose k eigenvectors
nourishing those highlights to a neural with the largest eigen values to form a d ×
network for discovery of seizure. The k dimensionalmatrix W. So W is the new
accessible EEG signals have been dimension of the features.
characterized into 3 classes-ordinary,
interictal and ictal. Different classifiers Feature Extraction
Feature extraction is the process of
have been tried against similar highlights
selecting best features from the available
extricated from the EEG signs to pass features. Discrete Wavelet Transform
judgment on their relative execution. (DWT) is used along with Genetic
Algorithm (GA).
PROPOSED WORK
Data Preprocessing Discrete Wavelet Transform (DWT):
Data is preprocessed using DWT is an implementation of the wavelet
standardization and normalization to get transform using a discrete set of the
the proper accuracy after applying the wavelet scales and translations obeying
algorithms. For the experimental setup the some defined rules. The discrete signal
data label is divided into two classes that , is a set of N
are classes with 5,4,3,2 are as non-seizure samples taken from a continuous signal
activity and 1 as seizure activity. + m ∆t), (m = 0,1, …, N-1) for
some initial time and sampling period
Dimension Reduction using Principle
. The basic functions
Component Analysis (PCA)
There are more than 170 features in the and
EEG dataset used for the experiment. For are also
avoiding over fitting of the classification
model reduction of size of the feature is vectors containing N elements.
necessary. PCA is used to reduce the Correspondingly the wavelet expansion
becomes discrete wavelet transform
dimensionality of a data set consisting of
(DWT). The discrete function is
a large number of interrelated and represented as a weighted sum in the
dependent variables while retaining the

9 Page 6-12 © MAT Journals 2019. All Rights Reserved


Journal of Signal Processing
Volume 5 Issue 1

space spanned by the bases and . min_weight_fraction_leaf=0.0,


n_estimators=100, n_jobs=1,
Genetic Algorithm (GA) oob_score=False, random_state=None,
GA is an optimization approach which is verbose=0,
analogous to evolution process of Man and warm_start=False)
based on natural selection. At each step, it
selects individuals at random from the EXPERIMENTAL SETUP AND
current population to be root and uses RESULTS
them to produce the leaves for the next Dataset
generation maintaining the parent child The first dataset from the reference
relationship. Over successive generations, comprises of 5 unique envelopes, each
the population "evolves" toward an with 100 documents, with each record
optimal solution. Here the genetic speaking to a solitary subject/individual.
algorithm is used as search problem for Each document is an account of mind
movement for 23.6 seconds. The relating
finding the best features from the data set.
time-arrangement is inspected into 4097
The initial population for EEG is a matrix
information focuses. Every datum point is
of dimension population size. A fitness the estimation of the EEG recording at an
function is defined which selects the alternate point in time. So we have all out
subset of the features extracted from 500 people with every ha 4097
DWT. The search for best features is information focuses for 23.5 seconds. The
carried out in all generations until the information is rearranged and each 4097
optimal solution is obtained or the information focuses into 23 lumps, each
maximum generation limit is reached. piece contains 178 information focuses for
1 second, and every datum point is the
Classification estimation of the EEG recording at an
The selected features and the label are alternate point in time. So now we have 23
given as input to the classifier with x 500 = 11500 snippets of data (push),
regularization for maintain the best fit every data contains 178 information
model. Different classification algorithms focuses for 1 second (segment), the last
are used for comparing the results. In this section speaks to the mark y{1,2,3,4,5}.
approach Random Forest classifier has The reaction variable is y in segment 179,
been used which the best classifier is the Explanatory factors X1, X2,..., X178, y
found out after experimentation. Random contains the classification of the 178-
Forest is a decision tree algorithm. It is the dimensional information vector. Explicitly
y in {1, 2, 3, 4, 5}. In the test setup we
group of different decision trees and the
have isolated the information into two
best one is selected. The nodes of the tree
classes that is classes with 5,4,3,2 are as
are calculated using different parameters
non-seizure action and 1 as seizure action.
like entropy and variance.
Experimental Setup
RandomForestClassifier(bootstrap=True, Python numpy, pandas and scikit-learn
class_weight=None, criterion='gini', packages have been used for
max_depth=None, max_features='auto', experimenting on the database. For our
max_leaf_nodes=None, experimental setup we have divided the
min_impurity_decrease=0.0, data into two classes that is classes with
min_impurity_split=None, 5,4,3,2 are as non-seizure activity and 1 as
min_samples_leaf=1, seizure activity. The data is divided into
min_samples_split=2, training data set (75%) and testing dataset
(25%) with k-fold cross validation. The

10 Page 6-12 © MAT Journals 2019. All Rights Reserved


Journal of Signal Processing
Volume 5 Issue 1

database is then standardizes and feed to from the EEG signals particularly help in
the feature extraction algorithm as per the increasing the classification accuracy for
above approach. The accuracy of the detection of seizure. Finally the EEG
classification model is the calculated and records obtained from the database were
compared. classified into 2 classes: (i) Seizure, (ii)
Non Seizure. Classifier used for
Results classifying this data Random Forest
The results obtained are encouraging. showed promising results in terms of
Without even using a recurrent neural accuracy, sensitivity and specificity when
network, the Random Forest algorithm is verified using 75% of the available EEG
able to correctly classify the EEG signals data as training set and the remaining 25%
which detect the seizure and non-seizure as the test set. Different classification
activity. However, the best results were algorithms were compared like logistic
obtained when the network was trained on regression, k nearest neighbor, SVM and
samples from the same recording session. random forest. Random forest will give the
While this may be practical for basic brain maximum accuracy when trained.
research, it would be less practical for use
in BCI technology.This further REFERENCES
recommends utilizing EEG will probably 1. Biomedical signal acquisition.
require an iterative methodology of https://www.medicine.mcgill.ca.
preparing on a huge populace and after Accessed: 2017-04-30.
that adjusting on a particular person. It is 2. The bonneeg database.
consequently suggested that future http://epileptologiebonn.de/cms/frontc
research be done on the conceivable ontent.php?idcat=193lang=3.
utilization of Transfer Learning methods to Accessed: 2017−04−30.
the order of EEG signals. 3. Recognition of speech artifacts in eeg
records.
Different classification algorithms were http://docplayer.com.br/18572674-
compared like logistic regression, k Reconhecimento-de-
nearest neighbor, SVM and random forest. artefactosrelativos-a-fala-em-registos-
Random forest will give the maximum de-eeg.html. Accessed: 2017-06-20.
accuracy when trained. 4. The-mystery-of-gamma-waves.
http://q4lt.com/the-mystery-of-
The performance is evaluated by confusion gammawaves. Accessed: 2017-06-20.
matrix and then finding accuracy. 5. Lehnertz K. Rieke C. Mormann F.
David P. Andrzejak, R. &C. Elger.
# Accuracy = TP + TN / TP + TN + FN + Indications of nonlinear deterministic
FP and finite dimensional structures in
accuracy = (cm[0][0] + cm[1][1]) / time series of brain electrical activity:
(cm[0][0] + cm [0][1] + cm [1][0] + dependence on recording region and
cm[1][1]) brain state. Phys. Rev. E. v64. 061907.
# Accuracy 6. Bradley Lee Barnhart. The Hilbert-
accuracy * 100 Huang Transform: theory, applications,
development. PhD thesis, University of
CONCLUSION Iowa. 2011.
EEG signal records were decomposed 7. Dr Colin Tidy Dr Tim Kenny. Epilepsy
using multi-level DWT and further with focal seizures.
subjected to envelope analysis of the http://www.stillingtondoctors.co.uk.
coefficients obtained from DWT. This Accessed: 2017-04-30.
preprocessing before feature extraction

11 Page 6-12 © MAT Journals 2019. All Rights Reserved


Journal of Signal Processing
Volume 5 Issue 1

8. David Monaghan Edmond Mitchell 14. Julian Dorado Cristian R. Munteanu


&Noel E. O’Connor. Classification of Alejandro Pazos Ling Guo, ´Daniel
sporting activities using smartphone Rivero. Automatic feature extraction
accelerometers. Sensors. 2013; 13(4). using genetic programming: An
9. GoldbergerL., L. AmaralA. N., Glass application to epileptic eeg
L., HausdorffJ. M., IvanovP. Ch., classification. Expert Systems with
Mark R. G., MietusJ. E., Moody G. B., Applications: An International
PengC.-K., & Stanley H. E.. Journal.August 2011; 38(8): pp.
PhysioBank, PhysioToolkit, and 10425–10436.
PhysioNet: Components of a new 15. S.N. Sharma Narendra Kumar
research resource for complex Ambulkar. Detection of epileptic
physiologic signals. Circulation.2000; seizure in eeg signals using window
June; 101(23): pp. e215– width optimized s-transform and
e220, Circulation Electronic Pages: artificial neural networks. In IEEE
http://circ.ahajournals.org/content/101/ Transactions on Biomedical
23/e215. full PMID: 1085218; Doi: 10. EngineeringBombay Section
1161/01.CIR.101.23.e215. Symposium (IBSS). September 2015.
10. Robert plonseyJaakkomalmivuo. Bio- 16. HasanOcak. Automatic detection of
electromagnetism: Principles and epileptic seizures in eeg using discrete
applications of bioelectric and wavelet transform and approximate
biomagnetic fields. entropy. Expert Systems with
http://www.bem.fi/book/13/13.htm. Applications: An International
1995. Accessed: 2017-04-30. Journal.March 2009; 36(2): pp. 2027–
11. Brain Y.,KabirInf., Zhang E.Siuly. 2036.
World academy of science, 17. NahidDadmehrSamanwoyGhosh-
engineering and Dastidar, HojjatAdeli. Principal
technology.International Journal of component analysis-enhanced cosine
Medical, Health, Biomedical, radial basis function neural network for
Bioengineering and Pharmaceutical robust epilepsy and seizure detection.
Engineering. 2007; 1(3). IEEE Transactions on Biomedical
12. Brain Y. Inf. Kabir, Zhang E.Siuly. Engineering.February 2008; 55(2): pp.
Epileptic seizure detection from eeg 512–518.
signals using logistic model trees. 18. Amit M. Shelat. Seizures.
Brain Informatics.June 2016; 3(2): pp. https://medlineplus.gov/ency/article/00
93–100. 3200.htm. Accessed: 2017-04-30
13. Dr Tim Kenny. Epilepsy with focal
seizures. Cite this article as:
https://patient.info/in/health/epilepsy-
with-focal-seizures. 2015. Accessed:
2017-04-30.

12 Page 6-12 © MAT Journals 2019. All Rights Reserved

You might also like