Professional Documents
Culture Documents
Research Article
An Automated Approach for Epilepsy Detection Based on
Tunable Q-Wavelet and Firefly Feature Selection Algorithm
Received 20 April 2018; Revised 18 August 2018; Accepted 27 August 2018; Published 10 September 2018
Copyright © 2018 Ahmed I. Sharaf et al. This is an open access article distributed under the Creative Commons Attribution License,
which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Detection of epileptic seizures using an electroencephalogram (EEG) signals is a challenging task that requires a high level of
skilled neurophysiologists. Therefore, computer-aided detection provides an asset to the neurophysiologist in interpreting the EEG.
This paper introduces a novel approach to recognize and classify the epileptic seizure and seizure-free EEG signals automatically
by an intelligent computer-aided method. Moreover, the prediction of the preictal phase of the epilepsy is proposed to assist the
neurophysiologist in the clinic. The proposed method presents two perspectives for the EEG signal processing to detect and classify
the seizures and seizure-free signals. The first perspectives consider the EEG signal as a nonlinear time series. A tunable Q-wavelet is
applied to decompose the signal into smaller segments called subbands. Then a chaotic, statistical, and power spectrum features sets
are extracted from each subband. The second perspectives process the EEG signal as an image; hence the gray-level co-occurrence
matrix is determined from the image to obtain the textures of contrast, correlation, energy, and homogeneity. Due to a large number
of features obtained, a feature selection algorithm based on firefly optimization was applied. The firefly optimization reduces the
original set of features and generates a reduced compact set. A random forest classifier is trained for the classification and prediction
of the seizures and seizure-free signals. Afterward, a dataset from the University of Bonn, Germany, is used for benchmarking
and evaluation. The proposed approach provided a significant result compared with other recent work regarding accuracy, recall,
specificity, F-measure, and Matthew’s correlation coefficient.
lifetime. These nonepileptic seizures are similar to neighbor classifier was used for the classification of epileptic
epileptic seizures, but they are not related to epilepsy seizures and seizure-free signals. The wavelet transformation
[2]. Hence, the classification of both epileptic and is usually employed with nonlinear measures to recognize
nonepileptic seizures is further significant. seizures and seizure-free patients from raw EEG signals.
(2) Although qualified professional neurologists can An automatic epilepsy detection approach proposed by [15]
visually detect epileptic seizures from an EEG data used the discrete wavelet transformation (DWT) for signal
sheet, it is still considered a time-consuming process. decomposition and generated a feature set using improved
correlation-based feature selection (ICFS). Then, the random
The diagnostics of epilepsy are usually performed by manual forest classifier is applied for classification. The DWT has
inspections of the EEG signals which not an easy task and been used with many nonlinear features, and the effectiveness
requires a highly skilled neurophysiologist. Also, the manual of this approach has been proved [16–23]. Although wavelet
inspection of a long interval recording is a tedious and transformation is an effective method for EEG signal analysis,
time-consuming process. Therefore, an intelligent clinical this transformation has some limitations [24]. The selection
computer-aided design (CAD) tool that analyzes the EEG of an appropriate wavelet bias is vital in the time-frequency
signal and detects the epileptic seizure is required. signal analysis.
Various case studies have reported the advantages of A flexible wavelet transformation proposed by [25],
using automated methods to recognize epileptic seizures namely, tunable Q-wavelet transformation (TQWT), controls
from EEG signals. Many techniques are commonly employed the transformation of a discrete time signal by an easily
for automated EEG analysis and epilepsy detection. Most tunable variable called the Q-factor. The TQWT solved the
of these techniques consist of two stages: the first is con- primary limits of the wavelet filter banks by providing a tun-
cerned with feature extraction from the raw EEG signal; able Q-factor that controls the number of the oscillations of
the other is dedicated to classifying the features [2]. The the wavelet transformation. Moreover, the TQWT decreased
feature extraction process is concerned with obtaining sig- the search space of filter banks by providing three variables
nificant information from the raw EEG data as well, as it only for adjusting. Also, many researchers applied TQWT for
could be implemented in the time, frequency, and time- physiological signal analysis and proved its effectiveness [21,
frequency domains. The time domain and frequency domain 22, 26, 27]. However, the after-mentioned methods provided
are used for signal processing when the EEG is assumed to a static set of features (e.g., statistical, nonlinear, and spectral)
be a stationary signal. On the other hand, when the EEG and did not discuss the adaptive behavior of these features as
signal is considered nonstationary [4, 5], then the time- a dynamical system.
frequency domain is employed. Case studies demonstrated In this paper, an intelligent computer-aided design (CAD)
that the time-frequency domain is more suitable for EEG tool that analyses the EEG signal and classifies the epileptic
signal analysis and could obtain significant results [2]. Many seizure and the seizure-free signal from the input EEG. That
algorithms have been proposed for elliptic seizure detection provides an asset to the neurophysiologist in interpreting the
within the time-frequency domain such as empirical mode EEG and reduces the diagnostics time. The proposed method
decomposition (EMD) [6, 7] and wavelet transformation [8– is based on data fusion of a single-channel EEG signal and an
10]. The EMD methods provided a leading trend to detect image processing approach. In the single-channel EEG signal,
elliptic seizures from the EEG signal. The EMD has been the EEG data are processed as a time-frequency time series.
combined with 2D and 3D phase space representation (PSR) The signal is divided into smaller segments of data using
features to identify elliptic seizures. Then, a least-squares tunable Q-wavelet. Some statistical features are extracted
support vector machine (LS-SVM) is used to perform the from this time series in the time domain and frequency
classification process [11]. A combination of different intrinsic domain. On the other hand, an image processing technique
mode functions (IMFs) is constructed as a set of features extracts the significant texture from the medical image. Thus,
to utilize the classification problem [12]. The EMD has also the gray-level co-occurrence matrix is applied to the image,
been used to decompose an EEG signal into a collection of and the contrast, correlation, energy, and homogeneity are
symmetric and band-limited signals. Then, a second-order extracted. The data fusion approach is used to combine these
difference plot (SODP) is applied to obtain an elliptical area. features of the input EEG signal and construct a large dataset
The area under this shape with 95% confidence is used for each patient. Because of a large number of the extracted
as a selection measure fed to an artificial neural network features, a feature reduction algorithm is needed to reduce
(ANN) to determine the seizures and seizure-free signals [6]. the processing time by obtaining a compact subset of features
Although the EMD methods proved their effectiveness, these instead of the original one. Moreover, the feature reduction
methods suffer from the mode-mixing problem, which pro- algorithm selects the relevant features, removes redundant
duces intermediate signals and noise. Local Binary Pattern features, and discovers the dependency among these features.
(LBP) based methods represents a different approach of the Therefore, the firefly algorithm is used to find the optimal
epilepsy detection. The work presented by [13] suggested a subset of features. Consequently, bootstraps are obtained by
feature extraction based on one dimensional LBP to classify resampling the compact subset to train the random forest
the epileptic seizure, seizure-free, and the healthy classes classifier. The final decision is obtained by performing a vote
from the EEG signal. In [14], the researchers have imple- for each decision tree of the forest. Hence, the classification
mented a technique based on the combination of the LBP of seizure and seizure-free is obtained. A real-world dataset
and the Gabor filter of the EEG signals. Then, the k-nearest from the University of Bonn is used for benchmarking and
International Journal of Biomedical Imaging 3
validation of the proposed method. A numerical experiment calculated from the time domain of the input signal. This
has been implemented, and a comparative study presented feature set contains mean (𝜇), standard deviation (𝑆𝑇𝐷), vari-
a promising efficiency of the proposed system regarding the ance (var), Shannon entropy (𝐻), and approximate entropy
overall accuracy, sensitivity, and specificity. (ApEn). The mathematical formulation of each feature is
The remainder of this manuscript is organized as follows: shown as follows [28–31]:
the preliminaries concepts were introduced in Section 2.
Section 3 introduced the combinational hybrid system of 1 𝑁
𝜇 (𝑥) = ∑𝑥 (5)
the epilepsy detection. The experiment and discussion were 𝑁 𝑖=1 𝑖
presented in Section 4. Lastly, the paper was concluded in
Section 5. 1 𝑁 2
𝑆𝑇𝐷 (𝑥) = √ ∑ (𝑥𝑖 − 𝜇𝑥 ) (6)
𝑁 − 1 𝑖=1
2. Preliminary Knowledge
1 𝑁 2
2.1. Tunable Q-Wavelet Transformation (TQWT). The tun- var (𝑥) = ∑ 𝑥 − 𝜇 (7)
ability of the Q-factor provided a proficient method to adopt 𝑁 − 1 𝑖=1 𝑖
the wavelet transformation [25]. The TQWT have three
𝑁
inputs: Q-factor denoted by 𝑄, which determines the number
𝐻 (𝑋) = ∑𝑃 (𝑥𝑖 ) log (𝑃 (𝑥𝑖 )) (8)
of oscillations of the wavelet; the number of the oversampling 𝑖=1
rate, which is denoted by 𝑟 and which determines the number
of the overlapping frequency responses; and the number of 𝐴𝑝𝐸𝑛 (x) = 𝜙𝑚 (𝑟) − 𝜙𝑚+1 (𝑟) . (9)
stages of decomposition, denoted by 𝐽. For each decomposi-
The second set of features calculates the power spectrum of
tion stage, the target signal 𝑠[𝑛] with a sample rate of 𝑓𝑠 could
the input signal based on the frequency domain analysis.
be represented by low-pass and high-pass subbands with
This feature set contains spectral centroid (𝑆𝐶), spectral speed
sampling frequencies of 𝛼𝑓𝑠 and 𝛽𝑓𝑠 , respectively, where 𝛼 and
(𝑆𝑆), spectral flatness (𝑆𝐹), spectral slope (𝑆𝑆𝐼), and spectral
𝛽 are the parameters of signal scaling. The low-pass subband
entropy (𝑃𝑆𝐸), where 𝑌(𝑞) denotes the for the discrete
is presented by low-pass filter 𝐻0 (𝜔) and low-pass scaling
Fourier transformation of the input signal 𝑓(𝑛). The math-
𝐿𝑃𝑆(𝛼). Similarly, the high-pass subband 𝜔1 is produced by
ematical formulation of each feature is shown as follows [32]:
𝐻1 (𝜔) and 𝐻𝑃𝑆(𝛽). The low-pass and high-pass subband
signals are formulated as follows: ∑𝑀−1
𝑞=0 𝑞 𝑌 (𝑞)
𝑆𝐶 = 𝑀−1 (10)
H𝑐0 (𝜔) ∑𝑞=0 𝑌 (𝑞)
2
{ 0, 𝛼𝜋 ≤ |𝜔| ≤ 𝜋 } ∑𝑀−1
𝑞=0 (𝑞 − 𝑆𝐶) 𝑌 (𝑞)
{
{ }
} 𝑆𝑆 = (11)
{ 𝜔 + (𝛽 − 1) 𝜋 } (1)
= {𝜃 ( ) , (1 − 𝛽) 𝜋 ≤ |𝜔| < 𝛼𝜋 ∑𝑀−1
𝑞=0 𝑌 (𝑞)
{ }
}
{
{ 𝛼+𝛽−1 }
} 1/𝑀
{ 1, |𝜔| < (1 − 𝛽) 𝜋 } ∏𝑀−1
𝑞=0 𝑌 (𝑞)
𝑆𝐹 = 𝑀−1 (12)
{ 0, |𝜔| < (1 − 𝛽) 𝜋 } (1/𝑀) ∑𝑞=0 𝑌 (𝑞)
{
{ }
}
{ 𝛼𝜋 − 𝜔 }
H1 (𝜔) = {𝜃 ( , 𝑀 ∑𝑀−1 𝑀−1 𝑀−1
) , (1 − 𝛽) 𝜋 ≤ < 𝛼𝜋 𝑞=0 𝑓𝑚 𝑌 (𝑞) − ∑𝑞=0 𝑓𝑚 ⋅ ∑𝑞=0 𝑌 (𝑞)
|𝜔| } (2)
{ }
{ 𝛼+𝛽−1
{ }
} SSI = (13)
2 − (∑𝑀−1 𝑌 (𝑞))
2
{ 1, 𝛼𝜋 ≤ |𝜔| ≤ 𝜋 } 𝑀∑𝑀−1 𝑞=0 𝑓𝑚
𝑞=0
where 𝜃(𝜔) could be defined as follows: 𝑛
𝑌 (𝑞) 𝑌 (𝑞)
𝑃𝑆𝐸 = −∑ 𝑛 ln ( 𝑛 ) (14)
𝜃 (𝜔) = 0.5 (1 + cos (𝜔)) (2 − cos (𝜔))0.5 , |𝜔| ≤ 𝜋 (3) 𝑖=1 ∑𝑖=1 𝑌 (𝑞) ∑𝑖=1 𝑌 (𝑞)
The third set of features contains chaotic measures to obtain
Both of 𝑟 and 𝑄 could be represented as filter-bank variables the dynamic behavior of the EEG signal. This set includes
𝛼 and 𝛽 as follows: Higuchi’s fractal dimension (𝐻𝐹𝐷), Hurst exponent (𝐻𝑟 ),
𝛽 and Katz fractal exponent (𝐾𝐴𝑇𝑍). These features are
𝑟= , formulated as follows [33–36]:
1−𝛼
(4) 𝑘
2−𝛽 𝐻𝐹𝐷 = ln ( ) (15)
𝑄= . 𝐿 (𝑘)
𝛽
𝑅 (𝑛)
𝐸[ ] = 𝑐𝑛𝐻𝑟 (16)
2.2. Feature Sets. The feature sets used in this research are 𝑆 (𝑛)
grouped into four main groups which are statistical, power
log (𝑛)
spectrum, chaotic features, and gray-level co-occurrence 𝐾𝐴𝑇𝑍 = (17)
matrix (GLCM). The first group contains a set of five features log (𝑛) + log (𝑑/𝐿)
4 International Journal of Biomedical Imaging
The final set of features consists of statistical measures 3. The Combinational Hybrid System of
of an image represented as matrices called gray-level co- Epilepsy Detection from EEG Signal
occurrence matrix (GLCM) where 𝐶(𝑖, 𝑗) represents an entry
in co-occurrence matrix and 𝑖, 𝑗 = 0, 1, 2, . . . 𝐿 − 1, where In this research, a hybrid system was proposed to detect
𝐿 is the number of gray levels in the image. Those matrices both seizures and seizure-free conditions from a raw EEG
represent the spatial dependencies between the gray levels of signal. Although some investigations focused on the feature
image reflecting the structure of the underlying texture. After extraction level, the proposed system was established based
the normalization of these matrices, the contrast, correlation, on four main levels. This system combined the data fusion
energy, and homogeneity are computed as follows: approach with firefly optimization and random forest. The
𝑇𝑄𝑊𝑇 was applied for EEG signal decomposition; then the
𝐿−1 𝐿−1 features were constructed using a data fusion technique. Due
2
𝐸𝑛𝑒𝑟𝑔𝑦 = ∑ ∑ 𝐶 (𝑖, 𝑗) (18) to the large number of features obtained for each subband
𝑖=0 𝑗=0 (𝑓𝑒𝑎𝑡𝑢𝑟𝑒𝑠𝐶𝑜𝑢𝑛𝑡 × 𝐽 × 𝑄), a feature reduction was applied to
𝐿−1 𝐿−1
reduce the features and to obtain a compact set of features
2 instead of the original one. The obtained compact set of
𝐶𝑜𝑛𝑡𝑟𝑎𝑠𝑡 = ∑ ∑ (𝑖 − 𝑗) 𝐶 (𝑖, 𝑗) (19)
𝑖=0 𝑗=0
features was fed to a random forest algorithm to obtain
the classification rules and hence used for training. After
𝐿−1 𝐿−1 (𝑖 − 𝜇𝑖 ) (𝑗 − 𝜇𝑗 ) 𝐶 (𝑖, 𝑗) training, the classifier should be able to classify and estimate
𝐶𝑜𝑟𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 = ∑ ∑ (20) the preictal phase. The proposed system was divided into
𝑖=0 𝑗=0 𝜎𝑖 𝜎𝑗 the following four levels of processing and then described in
𝐿−1 𝐿−1
detail as shown in Figure 1.
1
𝐿𝑜𝑐𝑎𝑙 ℎ𝑜𝑚𝑜𝑔𝑒𝑛𝑒𝑖𝑡𝑦 = ∑ ∑ 2
𝐶 (𝑖, 𝑗) (21) (i) EEG decomposition using TQWT
𝑖=0 𝑗=0 1 + (𝑖 − 𝑗)
(ii) Feature extraction using data fusion based on single-
channel EEG signal and co-occurrence matrix
2.3. Firefly Optimization Algorithm. The firefly algorithm is
a swarm based stochastic search technique [37]. The firefly (iii) Feature reduction using firefly optimization algo-
optimization algorithm consists of a set of members called rithm
fireflies; each firefly represents a candidate solution. The (iv) Training of random forest classifier to detect the
most attractive firefly is considered to be the leader firefly seizures and seizure-free EEGs
that leads the other candidates to the best region. The
attractiveness is calculated based on the light intensity which 3.1. EEG Decomposition Using TQWT. The preprocessing
is usually determined by the objective fitness function. The level applies the 𝑇𝑄𝑊𝑇 decomposition to the input EEG
attractiveness between two fireflies 𝑋𝑖 and 𝑋𝑗 is determined signal. The 𝑇𝑄𝑊𝑇 converted the continuous EEG signal
as follows: to discrete potions of data that could be handled more
2 effectively. This wavelet transformation is used because of its
𝛽 (𝑟𝑖𝑗 ) = 𝛽0 𝑒−𝛾𝑟𝑖𝑗 (22) effectiveness in signal decomposition and its tunability. The
obtained subbands using the 𝑇𝑄𝑊𝑇 provided a significant
𝐷
2
difference between the seizure-free and the epileptic seizure
𝑟𝑖𝑗 = √ ∑ (𝑥𝑖𝑑 − 𝑥𝑗𝑑 ) (23) of the EEG signals as shown in Figure 2. The subfigures
𝑑=1 denoted by (a), (b), (c), and (d) visualize the histogram of the
first, second, third, and fourth subbands of the seizure-free
where 𝐷 denotes the problem dimension such that 𝐷 = class. The remaining subfigures denoted by (e), (f), (g), and
{1, 2, . . . , 𝑑}, 𝑟𝑖𝑗 denotes the distance between 𝑋𝑖 and 𝑋𝑗 . (h) represent the histogram of the epileptic seizure class for
Parameter 𝛽0 denotes the initial attractiveness at 𝑟 = 0 and the same subbands. The values of the extracted subbands of
𝛾 denotes the light absorption factor such that 𝛾 ∈ [0, 1]. the second class are about ten times stronger than the first
Each firefly 𝑋𝑖 is compared with the other fireflies 𝑋𝑗 where class that prove the efficiency of this decomposition.
𝑗 ∈ {1, 2, . . . 𝑁} such that 𝑖 ≠ 𝑗 and 𝑁 denotes the count of the
fireflies. If firefly 𝑋𝑖 is better (brighter) than 𝑋𝑗 , then firefly 3.2. Feature Extraction Using Data Fusion Based on a Single-
𝑋𝑗 moves towards 𝑋𝑖 with a step movement formulated as Channel EEG and a Co-Occurrence Matrix. In the first
follows: perspective, the EEG signal was described as a nonstationary
−𝛾𝑟𝑖𝑗2
time series. After the decomposition of the EEG signal using
𝑋𝑖𝑑 (𝑡 + 1) = 𝑋𝑖𝑑 (𝑡) + 𝛽0 𝑒𝑖𝑗 (𝑋𝑗𝑑 (𝑡) − 𝑋𝑖𝑑 (𝑡)) the TQWT, a feature extraction process was performed to
(24) obtain significant characteristics from each TQWT subbands.
+ 𝛼𝜖𝑖 The extracted features were categorized into three main
groups. The first group determines the statistical character-
where 𝜖𝑖 represents uniform a randomly distributed variable istics in the time domain. The mean, standard deviation,
such that 𝜖𝑖 ∈ [−0.5, 0.5] and 𝛼 denotes the movement step variance, Shannon entropy, and approximate entropy were
such that 𝛼 ∈ [0, 1]. calculated in the first group as formulated from (5) to (9).
International Journal of Biomedical Imaging 5
Extract
Image Apply TQWT for the chaotic features
signal decomposition Train the random forest
classifier
Extract Constrcut feature
statistical features Feature reduction using
space using data firefly algorithm End
EEG Signal fusion
Extract Classifiy and estimate
power spectrum seizures using the trained
features model
Extract
Single EEG Channel Co-occurrence
matrix
Input Level 1 Level 2 Level 3 Level 4
Figure 1: Block diagram of the combinational hybrid system of epilepsy detection from EEG signal with 4 levels of processing.
2500 1200
2000 1000
1000
2000 800
1500
occurance
occurance
occurance
occurance
800
1500 600
1000 600
1000 400
400
500 500 200 200
0 0 0 0
−20 0 20 −40 −20 0 20 40 −50 0 50 100 −200 0 200 400
V V V V
800 800
1500 1500
occurance
occurance
occurance
0 0 0 0
−200 0 200 −400 −200 0 200 400 −500 0 500 −1000 −500 0 500 1000
V V V V
Figure 2: Illustration of seizure-free and epileptic seizures of subbands obtained from TQWT with Q = 1, r = 3, J = 3. Figures (a), (b), (c),
and (d) represent the first, second, third, and fourth subbands obtained from seizure-free signals. Figures (e), (f), (g), and (h) represent the
first, second, third, and fourth subbands obtained from the epileptic seizures.
This group indicates some statistical information obtained exponent, and Katz fractal exponent were computed for each
from the time domain of TQWT subband. The second subband as formulated from (15) to (18).
group of features determines a power spectrum analysis In the second perspective, the input EEG signal was
of obtained subbands. The discrete Fourier transformations converted to a gray image. Then a co-occurrence matrix was
(DFT) were applied to convert these subbands into a fre- computed to obtain the gray levels of the image. Then the
quency domain. Then the power spectrum features were textures of contrast, correlation, energy, and homogeneity
extracted. The second group consists of the spectral centroid, were calculated from this matrix to represent the statistical
spectral speed, spectral flatness, spectral slope, and spectral measures of the image as formulated from (19) to (21). Finally,
entropy as formulated from (10) to (14). The power spectrum after computing the feature space, a data fusion was applied
analysis represents an effective method to study the frequency to merge all of these features and create a single dataset.
behavior of the signal. The last group of features performs a
chaotic analysis of each subband. Because of the nonlinearity 3.3. Feature Reduction Using Firefly Optimization Algorithm.
of the EEG signals, a nonlinear analysis is required. One of In this section, a feature reduction algorithm based on
the best analyses used for this issue is the chaotic analysis. the firefly algorithm is proposed [37, 38]. This algorithm
In this analysis, the Higuchi fractal dimension (HFD), Hurst implements a chaotic movement, simulated annealing (SA)
6 International Journal of Biomedical Imaging
Algorithm 1: The pseudocode of the proposed feature reduction algorithm based on firefly optimization and SA.
to produce efficient offspring candidates, and memory aware- respectively. The values of 𝑤1 and 𝑤2 are set to 0.9 and 0.1,
ness of the best and worst solutions to improve the search respectively, as a recommended by [38].
diversity and prevent local optima. The firefly population is
randomly initialized using a chaotic logistic map to ensure The Attractiveness Movement Step. The proposed algorithm
the diversely of the candidates and the randomness of each used a chaotic logistic map to initialize the firefly population
firefly. Afterwards, the fitness function is computed for each and hence increases the diversity and avoid local optima.
candidate and identifies both the best and worst solutions as After obtaining the global best solution 𝑔𝑏𝑒𝑠𝑡 , an alternative
𝑔𝑏𝑒𝑠𝑡 and 𝑔𝑤𝑜𝑠𝑟𝑡 , respectively. For each iteration, an alternative leader firefly 𝑆𝑏𝑒𝑠𝑡 is declared with a competitive fitness but
candidate is declared as 𝑆𝑏𝑒𝑠𝑡 with a competitive fitness located in a different region. Since both leaders are more
and located in a different region. Both of the best and the likely to discover distinctive search regions, this strategy
alternative candidate sets are used to lead weak solutions to reduces the probability of being trapped in the local optima.
reach the optimal region and prevent local optima problem. In addition, the optimal offspring of the mean positions of the
The mean of the leader firefly and the alternative one is two leaders and the neighboring brighter candidates are used
enhanced using SA algorithm to obtain a better solution to lead the search process and guide the solutions with lower
𝑔𝑏𝑒𝑠𝑡 . The improved local and global solutions are used to light intensity to move towards the optimal region.
guide the low lightness fireflies to move towards that stronger
lightness. The algorithm is repeated until the maximum 𝑥𝑖 = 𝑥𝑖 + 𝛽0 𝐶𝑘 (𝑥𝑗 − 𝑥𝑖 ) + 𝐶𝑘 𝜀 (𝑔𝑏𝑒𝑠𝑡
− 𝑥𝑖 ) + 𝛼
number of iterations is reached, or a termination criterion is (26)
achieved. The behavior of the proposed algorithm is deter- × sign [𝑟𝑎𝑛𝑑 − 0.5]
mined by some properties, namely, the objective function, the
attractiveness movement step, and population diversity. The 𝑥𝑗 = 𝑥𝑗 + 𝜎1 (27)
proposed algorithm is demonstrated in Algorithm 1.
𝑔𝑏𝑒𝑠𝑡 = 𝑚𝑒𝑎𝑛 (𝑔𝑏𝑒𝑠𝑡 + 𝑆𝑏𝑒𝑠𝑡 ) + 𝜎2 (28)
The Objective Function. This function is used to evaluate each
candidate in the algorithm and defined as follows: where 𝑥𝑗 denotes the offspring candidate with a brighter
neighboring solution, 𝑥𝑗 is defined by the SA as shown in (26),
𝑤2
and 𝑔𝑏𝑒𝑠𝑡 represents the fitter offspring solutions of the mean
𝑓 (𝑥) = 𝑤1 × 𝑎𝑐𝑐𝑢𝑟𝑎𝑐𝑦 (𝑥) + (25)
number of features of the leader firefly and the alternative one as formulated in
(27). It worth mentioning that the values of 𝜎1 and 𝜎2 are
where 𝑤1 and 𝑤2 represent the weights of the classifi- two random variables set using the Gaussian distribution.
cation accuracy and the number of the selected features, The movement step of the firefly is determined as shown in
International Journal of Biomedical Imaging 7
(28), where 𝐶𝐾 represents the chaotic map variable in the most stable tree classification that results in a generalized
movement step and 𝜀 denotes the randomized vector defined experience of the classifier. The original dataset is divided
in the traditional firefly algorithm. Parameter 𝛼 denotes an into two parts. The first part is used to train each tree by
adaptive step initialized to 0.5 to control the diversity of the bootstrapping technique. The other part is used to evaluate
search process. the accuracy of the classification. Each tree is allowed to reach
the maximum depth without tree pruning to obtain a high
Offspring Generation Using SA. The proposed algorithm used variance classifier. The splitting process remains until only
SA for generating better candidates to enhance the search one instance of a single class is dropped from any leaf node
process as much as possible as shown in Algorithm 2. The or a predefined termination condition is achieved. When
SA accepts both of the best solution 𝑔𝑏𝑒𝑠𝑡 and the alternative the forest is established, the number of subsets remained as
solution 𝑆𝑏𝑒𝑠𝑡 as main inputs, then the traditional SA is a constant. The obtained route of traversal from the root
applied. The better solution generated is accepted by default node to the leaf node is applied to the new instances or
according to the SA heuristics. On the other hand, the the unlabeled instance for classification. The final decision
weaker solution should be accepted with specific probability for classifying a new instance is provided by determining
as shown in (29), where Δ𝑓 denotes the difference of the each class that has the most votes from every decision tree.
fitness (energy) between to candidates and 𝑇𝑐 denotes the The random forest performs slightly better when compared
current temperature. A simple linear cooling mechanism is with other classifiers such as discriminant analysis, SVM, and
used to control the value of the temperature. artificial neural network (ANN) [15, 39].
Δ𝑓
𝑝𝑥𝑗 = exp ( ) (29) 3.5. Performance Evaluation. Various performance formulas
𝑇𝑐
were used to evaluate the effectiveness of a classifier. The sen-
Population Diversity. In each iteration, the worst solution is sitivity (SEN) or recall, specificity (SPEC), accuracy (ACC),
detected after the ranking process as shown in Algorithm 1. F-measure, Matthew’s correlation coefficient (MCC), and
The remaining solutions are guided by the average position receiver operating characteristics (ROC) are used to evaluate
obtained from (30) where 𝜎 denotes a random value obtained the efficiency of the random forest classifier [40–42]. These
by Gaussian map. parameters are defined as follows:
𝑔𝑏𝑒𝑠𝑡 + 𝑆𝑏𝑒𝑠𝑡 𝑔 + 𝑆𝑏𝑒𝑠𝑡
𝑥𝑗𝑤𝑜𝑟𝑠𝑡 = + 𝜎 (𝑥𝑗𝑤𝑜𝑟𝑠𝑡 𝑏𝑒𝑠𝑡 ) (30) 𝑇𝑃
2 2 𝑆𝐸𝑁 = × 100 (31)
𝑇𝑃 + 𝐹𝑁
3.4. Classification and Learning. The random forest (RF) is 𝑇𝑁
𝑆𝑃𝐸𝐶 = × 100 (32)
a successful ensemble approach used in supervised machine 𝑇𝑁 + 𝐹𝑃
learning to solve classification or regression problems [39].
𝑇𝑃 + 𝑇𝑁
It consists of a collection of decision trees that could act 𝐴𝐶𝐶 = × 100 (33)
as a single classifier with multiple classification methods 𝑇𝑃 + 𝑇𝑁 + 𝐹𝑃 + 𝐹𝑁
or a method that has several variables. Several subsets of 2𝑇𝑃
the training data are supplied to each tree to achieve the 𝐹 − 𝑚𝑒𝑎𝑠𝑢𝑟𝑒 = × 100 (34)
2𝑇𝑃 + 𝐹𝑃 + 𝐹𝑁
8 International Journal of Biomedical Imaging
SUBBAND
SUBBAND
1 1
2 2
3 3
4 4
0 500 1000 1500 2000 2500 3000 3500 4000 0 500 1000 1500 2000 2500 3000 3500 4000
TIME (SAMPLES) TIME (SAMPLES)
(a) EEG Sample for patient with seizure-free (b) EEG Sample for patient with seizures
1.00 1
0.99
0.80 0.98
0.97
PERCENTAGE
PERCENTAGE
0.60 0.96
0.95
0.40 0.94
0.93
0.20 0.92
0.91
0.00 0.9
1 2 3 4 5 10 1 2 3 4 5
LEVELS OF DECMPOSISTION (J) NUMBER OF FEATURES
1 STD
0.98
0.96
0.94 <= 28.73 > 28.73
PERCENTAGE
0.92
0.9 0 ApEn
0.88
0.86 <= 0.16 > 0.16
0.84
0.82
0.8 Katz 1
1 2 3 5 7 9 10
Q
<= 1.46 > 1.46
ACC SPEC
Precision 0 1
Recall
Figure 5: Performance measures of the proposed approach with Figure 7: The classification rules obtained from the proposed
varied levels of decomposition. system to classify the seizure-free (0) and the epileptic seizure (1)
signals.
Yuan et al.2011
Figure 8: The total accuracy (%) of various methods employed to detect the disorder of the epilepsy.
(ii) The detection of the preictal phase from studying the each segment. After the dataset was constructed, a feature
healthy and ictal phase of each patient reduction algorithm based on firefly optimization was used to
(iii) The detection of the preictal phase that provided the reduce the irrelevant features and remove redundancy. Then,
ability to send warning alert to the physicians to an RF was trained to classify and predict the epileptic seizures
prepare the medical assessment for the patient and seizure-free EEG signals from the dataset. The experi-
mental results showed that the proposed method achieved
(iv) The proposed method being robust and reliable as its a satisfactory degree of 99% accuracy, 97% precision, 97%
performance was benchmarked using 10-fold cross- specificity, 98% recall, 98% F-measure, and 95% MCC at the
validation third level of decomposition.
(v) The dynamic behavior obtained from the firefly
algorithm which made the system adaptive to many Data Availability
features according to each case study.
(vi) A few sets of parameters required to analyze the EEG The dataset used to support the findings of this research was
signal typical three variables (𝑄, 𝑟, 𝐽). included in the article and can be found as a citation to “R.G.
Andrzejak, K. Lehnertz, F. Mormann, C. Rieke, P. David,
The limitations of this research were summarized as follows: C.E. Elger, Indications of Nonlinear Deterministic and Finite-
Dimensional Structures in Time Series of Brain Electrical
(i) The limited number of the studied subjects (typically
Activity: Dependence on Recording Region and Brain State,
100 per class)
Physical Review E, 64 (2001) 061907”.
(ii) The diagnosis process that may be reduced because of
depending on some additional software prerequisites.
Conflicts of Interest
5. Conclusion The authors declare that they have no conflicts of interest.
[5] P. Ghaderyan, A. Abbasi, and M. H. Sedaaghi, “An efficient [21] A. R. Hassan, S. Siuly, and Y. Zhang, “Epileptic seizure detection
seizure prediction method using KNN-based undersampling in EEG signals using tunable-Q factor wavelet transform and
and linear frequency measures,” Journal of Neuroscience Meth- bootstrap aggregating,” Computer Methods and Programs in
ods, vol. 232, pp. 134–142, 2014. Biomedicine, vol. 137, pp. 247–259, 2016.
[6] R. B. Pachori and S. Patidar, “Epileptic seizure classification [22] S. Patidar and T. Panigrahi, “Detection of epileptic seizure using
in EEG signals using second-order difference plot of intrin- Kraskov entropy applied on tunable-Q wavelet transform of
sic mode functions,” Computer Methods and Programs in EEG signals,” Biomedical Signal Processing and Control, vol. 34,
Biomedicine, vol. 113, no. 2, pp. 494–502, 2014. pp. 74–80, 2017.
[7] A. R. Hassan and A. Subasi, “Automatic identification of [23] J. Jia, B. Goparaju, J. Song, R. Zhang, and M. B. Westover,
epileptic seizures from EEG signals using linear programming “Automated identification of epileptic seizures in EEG signals
boosting,” Computer Methods and Programs in Biomedicine, vol. based on phase space representation and statistical features in
136, pp. 65–77, 2016. the CEEMD domain,” Biomedical Signal Processing and Control,
vol. 38, pp. 148–157, 2017.
[8] M. Sharma, A. Dhere, R. B. Pachori, and U. R. Acharya,
“An automatic detection of focal EEG signals using new class [24] T. Gandhi, B. K. Panigrahi, and S. Anand, “A comparative study
of time–frequency localized orthogonal wavelet filter banks,” of wavelet families for EEG signal classification,” Neurocomput-
Knowledge-Based Systems, vol. 118, pp. 217–227, 2017. ing, vol. 74, no. 17, pp. 3051–3057, 2011.
[25] I. W. Selesnick, “Wavelet transform with tunable Q-factor,” IEEE
[9] O. Faust, U. R. Acharya, H. Adeli, and A. Adeli, “Wavelet-
Transactions on Signal Processing, vol. 59, no. 8, pp. 3560–3575,
based EEG processing for computer-aided seizure detection and
2011.
epilepsy diagnosis,” Seizure, vol. 26, pp. 56–64, 2015.
[26] S. Patidar and R. B. Pachori, “Classification of cardiac sound
[10] Y. Kumar, M. L. Dewal, and R. S. Anand, “Relative wavelet signals using constrained tunable-Q wavelet transform,” Expert
energy and wavelet entropy based epileptic brain signals clas- Systems with Applications, vol. 41, no. 16, pp. 7161–7170, 2014.
sification,” Biomedical Engineering Letters, vol. 2, no. 3, pp. 147–
[27] S. Patidar, R. B. Pachori, A. Upadhyay, and U. Rajendra Acharya,
157, 2012.
“An integrated alcoholic index using tunable-Q wavelet trans-
[11] R. Sharma and R. B. Pachori, “Classification of epileptic seizures form based features extracted from EEG signals for diagnosis
in EEG signals based on phase space representation of intrinsic of alcoholism,” Applied Soft Computing, vol. 50, pp. 71–78, 2017.
mode functions,” Expert Systems with Applications, vol. 42, no. [28] R. G. Andrzejak, K. Lehnertz, F. Mormann, C. Rieke, P. David,
3, pp. 1106–1117, 2015. and C. E. Elger, “Indications of nonlinear deterministic and
[12] V. Bajaj and R. B. Pachori, “Epileptic seizure detection based on finite-dimensional structures in time series of brain electrical
the instantaneous area of analytic intrinsic mode functions of activity: dependence on recording region and brain state,”
EEG signals,” Biomedical Engineering Letters, vol. 3, no. 1, pp. Physical Review E: Statistical, Nonlinear, and Soft Matter Physics,
17–21, 2013. vol. 64, no. 6, 2001.
[13] Y. Kaya, M. Uyar, R. Tekin, and S. Yıldırım, “1D-local binary [29] P. Swami, A. K. Godiyal, J. Santhosh, B. K. Panigrahi, M. Bhatia,
pattern based feature extraction for classification of epileptic and S. Anand, “Robust expert system design for automated
EEG signals,” Applied Mathematics and Computation, vol. 243, detection of epileptic seizures using SVM classifier,” in Proceed-
pp. 209–219, 2014. ings of the 2014 3rd IEEE International Conference on Parallel,
[14] T. S. Kumar, V. Kanhangad, and R. B. Pachori, “Classification Distributed and Grid Computing, PDGC 2014, pp. 219–222,
of seizure and seizure-free EEG signals using local binary India, December 2014.
patterns,” Biomedical Signal Processing and Control, vol. 15, pp. [30] P. Swami, T. K. Gandhi, B. K. Panigrahi, M. Tripathi, and S.
33–40, 2015. Anand, “A novel robust diagnostic model to detect seizures in
[15] M. Mursalin, Y. Zhang, Y. Chen, and N. V. Chawla, “Automated electroencephalography,” Expert Systems with Applications, vol.
epileptic seizure detection using improved correlation-based 56, pp. 116–130, 2016.
feature selection with random forest classifier,” Neurocomputing, [31] H. Ocak, “Automatic detection of epileptic seizures in EEG
vol. 241, pp. 204–214, 2017. using discrete wavelet transform and approximate entropy,”
Expert Systems with Applications, vol. 36, no. 2, pp. 2027–2036,
[16] L. Wang, W. Xue, Y. Li et al., “Automatic epileptic seizure
2009.
detection in EEG signals using multi-domain feature extraction
and nonlinear analysis,” Entropy, vol. 19, no. 6, 2017. [32] J.-H. Kang, Y. G. Chung, and S.-P. Kim, “An efficient detection
of epileptic seizure by differentiation and spectral analysis of
[17] Q. Yuan, W. Zhou, L. Zhang et al., “Epileptic seizure detection electroencephalograms,” Computers in Biology and Medicine,
based on imbalanced classification and wavelet packet trans- vol. 66, pp. 352–356, 2015.
form,” Seizure, vol. 50, pp. 99–108, 2017.
[33] S. Barua, M. U. Ahmed, C. Ahlstrom, S. Begum, and P. Funk,
[18] S. Lahmiri, “Generalized Hurst exponent estimates differentiate “Automated EEG Artifact Handling with Application in Driver
EEG signals of healthy and epileptic patients,” Physica A: Monitoring,” IEEE Journal of Biomedical and Health Informatics,
Statistical Mechanics and its Applications, vol. 490, pp. 378–385, 2017.
2018. [34] G. E. Polychronaki, P. Y. Ktonas, S. Gatzonis et al., “Comparison
[19] U. R. Acharya, F. Molinari, S. V. Sree, S. Chattopadhyay, K. H. of fractal dimension estimation algorithms for epileptic seizure
Ng, and J. S. Suri, “Automated diagnosis of epileptic EEG using onset detection,” Journal of Neural Engineering, vol. 7, no. 4,
entropies,” Biomedical Signal Processing and Control, vol. 7, no. 2010.
4, pp. 401–408, 2012. [35] J. Gorecka, “Detection of ocular artifacts in EEG data using
[20] R. Dhiman, J. S. Saini, and Priyanka, “Genetic algorithms tuned the Hurst exponent,” in Proceedings of the 20th International
expert model for detection of epileptic seizures from EEG Conference on Methods and Models in Automation and Robotics,
signatures,” Applied Soft Computing, vol. 19, pp. 8–17, 2014. MMAR 2015, pp. 931–933, August 2015.
12 International Journal of Biomedical Imaging
Rotating Advances in
Machinery Multimedia
The Scientific
Engineering
Journal of
Journal of
Hindawi
World Journal
Hindawi Publishing Corporation Hindawi
Sensors
Hindawi Hindawi
www.hindawi.com Volume 2018 http://www.hindawi.com
www.hindawi.com Volume 2018
2013 www.hindawi.com Volume 2018 www.hindawi.com Volume 2018 www.hindawi.com Volume 2018
Journal of
Control Science
and Engineering
Advances in
Civil Engineering
Hindawi Hindawi
www.hindawi.com Volume 2018 www.hindawi.com Volume 2018
Journal of
Journal of Electrical and Computer
Robotics
Hindawi
Engineering
Hindawi
www.hindawi.com Volume 2018 www.hindawi.com Volume 2018
VLSI Design
Advances in
OptoElectronics
International Journal of
International Journal of
Modelling &
Simulation
Aerospace
Hindawi Volume 2018
Navigation and
Observation
Hindawi
www.hindawi.com Volume 2018
in Engineering
Hindawi
www.hindawi.com Volume 2018
Engineering
Hindawi
www.hindawi.com Volume 2018
Hindawi
www.hindawi.com www.hindawi.com Volume 2018
International Journal of
International Journal of Antennas and Active and Passive Advances in
Chemical Engineering Propagation Electronic Components Shock and Vibration Acoustics and Vibration
Hindawi Hindawi Hindawi Hindawi Hindawi
www.hindawi.com Volume 2018 www.hindawi.com Volume 2018 www.hindawi.com Volume 2018 www.hindawi.com Volume 2018 www.hindawi.com Volume 2018