Journal of Healthcare Engineering
Volume 2017 (2017), Article ID 3035606, 7 pages
https://doi.org/10.1155/2017/3035606

Research Article

Epileptic MEG Spike Detection Using Statistical Features and Genetic Programming with KNN

Turky N. Alotaiby,¹ Saud R. Alrshoud,¹ Saleh A. Alshebeili,² Majed H. Alhumaid,³ and Waleed M. Alsabhan¹

¹KACST, Riyadh, Saudi Arabia
²KACST-TIC in Radio Frequency and Photonics for the e-Society (RFTONICS), Electrical Engineering Department, King Saud University, Riyadh, Saudi Arabia
³King Fahad Medical City, Riyadh, Saudi Arabia

Correspondence should be addressed to Turky N. Alotaiby; totaiby@kacst.edu.sa

Received 18 May 2017; Revised 6 August 2017; Accepted 13 September 2017; Published 1 October 2017

Academic Editor: Zhongwei Jiang

Copyright © 2017 Turky N. Alotaiby 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.

Abstract.

Epilepsy is a neurological disorder that affects millions of people worldwide. Monitoring the brain activities and identifying the seizure source which starts with spike detection are important steps for epilepsy treatment. Magnetoencephalography (MEG) is an emerging epileptic diagnostic tool with high-density sensors; this makes manual analysis a challenging task due to the vast amount of MEG data. This paper explores the use of eight statistical features and genetic programing (GP) with the K-nearest neighbor (KNN) for interictal spike detection. The proposed method is comprised of three stages: preprocessing, genetic programming-based feature generation, and classification. The effectiveness of the proposed approach has been evaluated using real MEG data obtained from 28 epileptic patients. It has achieved a 91.75% average sensitivity and 92.99% average specificity.

1. Introduction

Epilepsy is a neurological brain disorder characterized by recurrent seizures. It has been estimated to affect around 1% of the world’s population [1]. Yearly, some 200,000 new cases of epilepsy are being diagnosed in the United States and about 2.4 million new cases globally [2]. Patients with epilepsy can harm themselves and/or others during a seizure episode. Different technologies have been used for monitoring and analyzing brain activities, such as EEG and FMRI. The former is considered the primary tool for epilepsy diagnosis. Due to the recent advancement in technology, magnetoencephalography (MEG), a neuroimaging technique that records the magnetic field generated by the brain’s electrical current using superconducting quantum interference devices (SQUIDs), has become a new information source for brain activities, and it is used clinically in different applications [3, 4] such as a diagnostic tool in pre- and postsurgical assessments [5–7]. Surgical intervention is preceded by seizure localization, which starts with spike detection. Researchers have developed different methods for interictal EEG spike detection [8–16] and criteria for defining EEG spikes [10]. However, until now, there has been no formal definition of MEG spikes [17]. Direct application of EEG spike criteria on MEG spikes may not be always valid [18]. Ossenblok et al. [19] found that MEG spikes are more distinguishable from the background activities and sharper. One explanation of the differences between EEG and MEG spikes may be attributable to the fact that a MEG signal is not distorted or attenuated by the materials’ conductivity that lie between the brain and the recording device [20–26]. In fact, EEG and MEG data are complementary and should not be considered as mutually exclusive. Most commonly, in clinical practice, interictal epileptic spikes are manually identified and marked by the neurologist through visual inspection of the MEG (about 300 sensors) recording, which is a very tedious, time-consuming, and subjective method [8, 27–29]. A MEG reading session can take hours due to the vast amount of MEG data. Thus, an objective, reliable, and automatic method for the detection of interictal spikes is strongly desired in clinical practices. In this work, we develop a novel MEG epileptic spike detection algorithm by segmenting the data into overlapping segments and extract eight easy to calculate statistical features: the maximum and minimum values, mean, standard deviation, median, interquartile range, kurtosis, and skewness. Then, the genetic programming (GP) is used to improve the discrimination performance of the K-nearest neighbor (KNN) classifier. Figure 1 represents a spiky and nonspiky MEG segments taken from an epileptic patient.

Figure 1: MEG interictal spiky and nonspiky segments.

MEG data drawn from 28 epileptic patients is used to evaluate the performance of the proposed method. The obtained results show that it has better performance compared with the previously published work [30, 31].

This paper is organized as follows. After the introduction in Section 1, Section 2 presents an overview of GP. The clinical MEG data used to evaluate the proposed methodology is described in Section 3. The spike detection methodology is presented in Section 4. Section 5 presents and compares our results with those of other MEG spike detection algorithms. Finally, the conclusions are drawn in Section 6.

2. Genetic Programming

GP is a well-known evolutionary algorithm used to optimize solutions using biological evolution mechanisms [32], and it has been used for the classification of data and signals [33, 34]. GP is a population-based algorithm, which means that it starts with multiple initial solutions and tries to generate new and better solutions. Each solution (i.e., each individual in the population) is a mathematical formula that is represented as a tree. In the tree-based GP, the tree’s terminal nodes are the input data and the internal nodes are functions. A binary function node has two “children,” while a unary operator node has one “child.” The output node gives the output of the tree. Figure 2 shows an example of the mathematical tree structure formula, where D1 to D5 are five different inputs of a problem.

Figure 2: Example of tree structure formula.

Each tree structure formula generated by the GP is evaluated using the fitness function, which is defined based on the problem, to give a value that represents the significance of each tree formula for solving the given problem. This value is called the “fitness value.” The fitness function design is problem-dependent. When the formula with the higher fitness value is required, then it is known as a maximization problem. Otherwise, it is a minimization problem. In each generation of the GP, it derives new trees from the best trees found by implementing some GP operations. Crossover and mutation are the most commonly used GP operations to generate new trees. The crossover is performed by swapping randomly selected branches of a tree with other randomly selected branches from other trees that are from the current generation. This operation generates two new offsprings. The mutation is performed by replacing a randomly selected branch of a tree with a new randomly generated tree.

The following steps describe the common procedure of a GP:

(1)Initialization: It generates an initial population that represents the first generation. This is usually done with the creation of random solutions.(2)GP operations (crossover and mutation): It operates on the population trees depending on a probability (crossover probability and mutation probability).(3)Evaluation: It calculates the fitness value of the new individuals using a fitness function. The main objective of the function is to give a value to each individual, which represents how good it is. This value is then used to identify the best individual.(4)Selection: It transfers trees with the best fitness values to the next generation. The trees are selected from both the current and previous generations.(5)Termination: If the termination condition has been met, the algorithm stops and reports the fittest tree (or best solution) that it has found. The termination condition could be a certain number of generations or a certain fitness value. If the termination condition has not been met, the algorithm creates a new generation by repeating steps 2 to 5.

3. Clinical MEG Data

The proposed methodology tested on high-quality MEG data recorded at the National Neuro Institute (NNI), the King Fahad Medical City (KFMC) in Riyadh, Saudi Arabia uses Elekta Neuromag in a shielded room, in which there are 306 sensors (102 magnetometer and 204 gradiometer). These sensors are categorized and distributed over the head according to the eight brain regions (left temporal, right temporal, left frontal, right frontal, left parietal, right parietal, left occipital, and right occipital). Each region has 26 channels, except for the left occipital and right occipital regions, which have 24 channels only. In our development, data of the 204 gradiometer sensors have been used.

Magnetic brain activity of 28 epileptic patients (patients’ ages range between 14 and 43 years) in resting-state supine position at a sampling frequency of 1000 Hz and band-pass of 0.03 to 330 Hz is recorded in separate sessions of 15 minutes each. In synchrony with the MEG, 21-channel electroencephalogram (EEG, international 10–20 system), electrooculogram (EOG), and electrocardiogram (ECG) were also recorded. The MEG signals were then band-pass filtered between 1 and 50 Hz for visual inspection and examined together with the concurrent 21-channel EEG data by at least one MEG/EEG technician and one neurology consultant, following the standard principles established for clinical EEG. There are no more than three sessions for each patient, with 433 spikes in total. The experts determine the brain region and spikes’ duration (start–end) by visual inspection. The dataset contains two patients with right frontal, one patient with left frontal, two patients with right parietal, three patients with left parietal, 11 patients with right temporal, and nine patients with left temporal, with 26/24 channels of each.

4. Spike Detection Methodology

The proposed spike detection methodology comprises three stages: preprocessing, GP-based feature generation, and classification. Figure 3 depicts an overview of the methodology. The next subsections detail each stage.

Figure 3: Spike detection methodology overview.

4.1. Preprocessing Stage

In this stage, three tasks are performed: data segmentation, data smoothing, and feature extraction. The multichannel MEG signal is segmented into epochs of  ms with 50% overlapping between two successive epochs. N is selected based on the analysis of spike duration in all the epileptic patients used in this study. Figure 4 shows the histogram of the spikes’ durations. A median filter is then applied on each segment to smoothen the signal. From each segment, eight statistical features are extracted: the maximum and minimum values, mean, standard deviation, median, interquartile range, kurtosis, and skewness.

Figure 4: Spikes’ duration distribution.

The mean and median are the most used measures for central tendency. Equation (1) is used to obtain the mean (), where is the ith data point of the segment and is the length of the segment. To measure the statistical dispersion of segment data points, we used the standard deviation and the interquartile range. Equation (2) is used to calculate the standard deviation (). The interquartile range (IQR) is the difference between the median of the lower-half data points (Q1) and the median of the upper-half data points (Q3). Kurtosis and skewness are measurements of the shape of the distribution of data. Kurtosis measures the curviness of the data distribution and indicates whether it is peaked or flat. Skewness measures the symmetry of the data distribution around the mean. Equations (3) and (4) are performed to calculate the kurtosis and skewness, respectively [35].

4.2. GP-Based Feature Generation

In this stage, the GP algorithm is applied to automatically create the new feature (best mathematical formula) that combines selected features. Different input feature (max, min, mean, standard deviation, median, IQR, kurtosis, and skewness) combinations are tried by GP in the form of individuals. Table 1 presents the GP’s input values that returned the best results. The six mathematical operations used are summation, subtraction, multiplication, sine, cosine, and natural logarithm. The GP starts with 25 random individuals (first generation). Its operations (crossover and mutation) are applied on the individuals, according to a probability. The GP operations’ probabilities change, depending on the results of the previous generation. The initial adaptive probabilities for crossover and mutation are 90% and 10%, respectively. The new generated trees (formulas) are limited to 25 levels. Therefore, the crossover and the mutation are not allowed to break this limit. The fittest 25 individuals (of the parents and the children) are selected as the new generation. In other words, the 25 formulas that give the best fitness values are selected. The GP algorithm terminates after 100 generations, and the best individual (formula) is reported.

Table 1: GP parameters.

Parameter
Value

Population size
25

Number of generations
100

Maximum tree level
25

Crossover initial probability
90%

Mutation initial probability
10%

Functions
Plus, minus, times, sin, cos, log

The fitness function used to evaluate the formulas is the K-nearest neighbor (KNN) [36], which is a supervised learning model. It uses preclassified records to classify unknown records based on the extracted features. KNN classifies a new record based on the majority of the “k”-similar preclassified records. Usually, the similarity measurement is a distance function (e.g., Euclidean function). We used a small set of data in order to use KNN as a fitness function. This data was divided into two groups. The first group of segments was used as reference points for the KNN, while the second group was used to validate the formulas. Each group has an equal number of spike and nonspike segments. The fitness value is the error rate of the KNN classification results. The GP formula with the minimum error rate (best formula) is selected to be used in the next stage. GPLab toolbox has been used for the experiments in this work [37].

4.3. Classification

After finding the best mathematical formula (with the lowest error rate), KNN algorithm is then used to classify data of each channel of a particular region of the brain using the same reference points mentioned in stage two. Note that the similarity measure used by the KNN approach is based on the calculated features. In particular, the KNN algorithm has input and reference points. The input points of KNN algorithm are the outputs of the previously determined formula, obtained when this formula is applied to features of segment under consideration. The reference points of KNN algorithm, on the other hand, are the outputs of the same formula, obtained when the formula is applied to the features of reference segments. For classifying a 26/24-channel segment, majority voting among the 26/24 decisions is employed to determine whether it is a spike or a nonspike segment.

5. Results and Discussion

We applied our spike detection approach on the data of 28 epileptic patients (mentioned in Section 3), of which eight were used in stage two and 20 in the classification stage. Two metrics were used to evaluate the performance, sensitivity, and specificity of the approach. Sensitivity represents the ratio of number of times the classifier makes correct positive decisions (i.e., detects spikes) to the total number of positive decisions. Specificity is the ratio of number of times the classifier makes correct negative decisions (i.e., detects spike-free segments) to the total number of negative decisions [38]. After data processing, eight patients were randomly selected to be used in the GP-based feature generation stage. Data of four of these patients were used as KNN reference points and the other four as unknown inputs with their ground truth values to find the best GP formula. The best formula was then applied to the new features of segments of the remaining 20-patient data to conduct the classification stage. Note that in the classification stage, we use the same reference points extracted from the data of four patients used to find the best GP formula.

Thereafter, the KNN is used to classify the 26/24-channel segment of data belonging to one of the eight regions of the brain using the new feature, where nearest neighbor. The classifier results for each channel of a given segment are binary: “1” for channel with spikes and “0” for spike-free channel. A majority voting strategy is then used among the results of 26 channels to classify a segment of a particular region of the brain as spike or spike-free segment. The segment is labeled as a spike segment when the number of channels having spikes in the region under consideration is >13.

The proposed algorithm achieved an average sensitivity and specificity of 91.75% and 92.99%, respectively, in 17 experiments. Figure 5 presents two formulas’ trees generated through GP evolution. In particular, these formulas are two out of 17 optimum formulas obtained by conducting 17 experiments. The right formula in Figure 5, which is using one feature X ₄ (standard deviation), gave the best performance out of the 17 formulas, as demonstrated (highlighted) in Table 2.

Figure 5: Examples of GP trees of the new feature.

Table 2: Results of 20 experiments.

Run
Sensitivity
Specificity

1
91.62%
93.63%

2
91.62%
93.90%

3
92.18%
91.64%

4
92.74%
92.71%

5
93.30%
92.41%

6
92.74%
91.70%

7
93.30%
91.40%

8
91.62%
93.42%

9
92.18%
92.73%

10
91.62%
93.34%

11
91.06%
93.54%

12
88.83%
94.17%

13
91.06%
93.54%

14
90.50%
93.80%

15
93.85%
92.29%

16
89.94%
93.73%

17
91.62%
92.92%

Khalid et al. [30] proposed a method for MEG spike detection using a common special pattern with linear discriminant analysis and achieved a sensitivity of 89.745% and a specificity of 89.154% on the same dataset. Applying the method of Ossadtchi et al. [31], which is a MEG spike detection algorithm using independent component analysis, on this dataset resulted in 83.278% sensitivity and 79.945% specificity. The results presented in this work demonstrate the potential of the proposed patient-independent method for use as a spike detection system.

6. Conclusion

In this work, we have presented a patient-independent spike detection approach based on statistical features and created the best possible features using GP. The approach consists of three stages: preprocessing, GP-based feature generation, and classification. GP with KNN is used to generate feature(s) that are more distinctive and reduce the input dimensions. The experimental results using real MEG data showed the effectiveness of the method in detecting interictal spikes with high sensitivity and specificity. The proposed spike detection method achieved an average sensitivity of 91.75% and an average specificity of 92.99%, respectively. This approach is a valuable tool for epileptologists, helping to accelerate the epilepsy diagnosis process.

Conflicts of Interest

The authors declare that there is no conflict of interest regarding the publication of this paper.

Acknowledgments

The authors would like to acknowledge the support received from King Fahad Medical City (KFMC), Kingdom of Saudi Arabia.

References

A. Varsavsky, I. Mareels, and M. Cook, Epileptic Seizures and the EEG: Measurement, Models, Detection, and Prediction, CRC Press, Boca Raton, Fl, USA, 2010.

World Health Organization, “Fact sheet on epilepsy,” October 2012, http://www.who.int/mediacentre/factsheets/fs999/en/index.html.

P. Ritva and I. S. Mohamed, “Magnetoencephalography (MEG) and other neurophysiological investigations,” Handbook of Clinical Neurology, vol. 111, pp. 461–465, 2013.

S. Braeutigam, “Magnetoencephalography: fundamentals and established and emerging clinical applications in radiology,” ISRN Radiology, vol. 2013, Article ID 529463, 18 pages, 2013.

X. De Tiège, E. Carrette, B. Legros et al., “Clinical added value of magnetic source imaging in the presurgical evaluation of refractory focal epilepsy,” Journal of Neurology, Neurosurgery & Psychiatry, vol. 83, no. 4, pp. 417–423, 2012.

S. Kharkar and R. Knowlton, “Magnetoencephalography in the presurgical evaluation of epilepsy,” Epilepsy & Behavior, vol. 46, pp. 19–26, 2015.

R. Wennberg and D. Cheyne, “Reliability of MEG source imaging of anterior temporal spikes: analysis of an intracranially characterized spike focus,” Clinical Neurophysiology, vol. 125, no. 5, pp. 903–918, 2014.

S. B. Wilson and R. Emerson, “Spike detection: a review and comparison of algorithms,” Clinical Neurophysiology, vol. 113, no. 12, pp. 1873–1881, 2002.

Z. Ji, T. Sugi, S. Goto et al., “An automatic spike detection system based on elimination of false positives using the large-area context in the scalp EEG,” IEEE Transactions on Biomedical Engineering, vol. 58, pp. 2478–2488, 2011.

J. Gotman and P. Gloor, “Automatic recognition and quantification of interictal epileptic activity in the human scalp EEG,” Electroencephalography and Clinical Neurophysiology, vol. 41, pp. 513–529, 1976.

T. P. Exarchos, A. T. Tzallas, D. I. Fotiadis, S. Konitsiotis, and S. Giannopoulos, “EEG transient event detection and classification using association rules,” IEEE Transactions on Information Technology in Biomedicine, vol. 10, pp. 451–457, 2006.

M. Adjouadi, M. Cabrerizo, M. Ayala et al., “A new mathematical approach based on orthogonal operators for the detection of interictal spikes in epileptogenic data,” Biomedical Sciences Instrumentation, vol. 40, pp. 175–180, 2004.

K. P. Indiradevi, E. Elias, P. S. Sathidevi, N. S. Dinesh, and K. A. Radhakrishnan, “A multi-level wavelet approach for automatic detection of epileptic spikes in the electroencephalogram,” Computers in Biology and Medicine, vol. 38, pp. 805–816, 2008.

A. T. Tzallas, P. S. Karvelis, C. D. Katsis, D. I. Fotiadis, S. Giannopoulos, and S. Konitsiotis, “A method for classification of transient events in EEG recordings: application to epilepsy diagnosis,” Methods of Information in Medicine, vol. 45, pp. 610–621, 2006.

I. Güler and E. D. Übeyli, “Adaptive neuro-fuzzy inference system for classification of EEG signals using wavelet coefficients,” Journal of Neuroscience Methods, vol. 148, pp. 113–121, 2005.

Y. Liu, C. Lin, J. Tsai, and Y. Sun, “Model-based spike detection of epileptic EEG data,” Sensors, vol. 13, pp. 12536–12547, 2013.

R. Nowak, M. Santiuste, and A. Russi, “Toward a definition of MEG spike: parametric description of spikes recorded simultaneously by MEG and depth electrodes,” Seizure, vol. 18, no. 9, pp. 652–655, 2009.

Y. Kakisaka, Z. I. Wang, R. Enatsu et al., “The magnetoencephalography correlate of EEG POSTS (positive occipital sharp transients of sleep),” Journal of Clinical Neurophysiology: Official Publication of the American Electroencephalographic Society, vol. 30, no. 3, p. 235, 2013.

P. Ossenblok, J. C. de Munck, A. Colon, W. Drolsbach, and P. Boon, “Magnetoencephalography is more successful for screening and localizing frontal lobe epilepsy than electroencephalography,” Epilepsia, vol. 48, no. 11, pp. 2139–2149, 2007.

Ü. Aydin, J. Vorwerk, P. Küpper et al., “Combining EEG and MEG for the reconstruction of epileptic activity using a calibrated realistic volume conductor model,” PLoS One, vol. 9, no. 3, article e93154, 2014.

J. Vorwerk, J. H. Cho, S. Rampp, H. Hamer, T. R. Knösche, and C. H. Wolters, “A guideline for head volume conductor modeling in EEG and MEG,” NeuroImage, vol. 100, pp. 590–607, 2014.

J.-M. Schoffelen and J. Gross, “Source connectivity analysis with MEG and EEG,” Human Brain Mapping, vol. 30, no. 6, pp. 1857–1865, 2009.

S. Sato, M. Balish, and R. Muratore, “Principles of magnetoencephalography,” Journal of Clinical Neurophysiology, vol. 8, pp. 144–156, 1991.

D. Y. Ko, C. Kufta, D. Scaffidi, and S. Sato, “Source localization determined by magnetoencephalography and electroencephalography in temporal lobe epilepsy: comparison with electrocorticography: technical case report,” Neurosurgery, vol. 42, pp. 414–421, 1998.

D. Cohen and B. N. Cuffin, “Demonstration of useful differences between magnetoencephalogram and electroencephalogram,” Electroencephalography and Clinical Neurophysiology, vol. 56, pp. 38–51, 1983.

M. Iwasaki, E. Pestana, R. C. Burgess, H. O. Lüders, H. Shamoto, and N. Nakasato, “Detection of epileptiform activity by human interpreters: blinded comparison between electroencephalography and magnetoencephalography,” Epilepsia, vol. 46, pp. 59–68, 2005.

J. J. Halford, “Computerized epileptiform transient detection in the scalp electroencephalogram: obstacles to progress and the example of computerized ECG interpretation,” Clinical Neurophysiology, vol. 120, no. 11, pp. 1909–1915, 2009.

N. Acir, I. Oztura, M. Kuntalp, B. Baklan, and C. Güzeliş, “Automatic detection of epileptiform events in EEG by a three-stage procedure based on artificial neural networks,” IEEE Transactions on Biomedical Engineering, vol. 52, no. 1, pp. 30–40, 2005.

A. S. Gevins and A. Rémond, Methods of Analysis of Brain Electrical and Magnetic Signals, vol. 1, Elsevier Science Limited, Amsterdam, 1987.

M. I. Khalid, T. Alotaiby, S. A. Aldosari et al., “Epileptic MEG spikes detection using common spatial patterns and linear discriminant analysis,” IEEE Access, vol. 4, pp. 4629–4634, 2016.

A. Ossadtchi, S. Baillet, J. C. Mosher, D. Thyerlei, W. Sutherling, and R. M. Leahy, “Automated interictal spike detection and source localization in magnetoencephalography using in dependent components analysis and spatio-temporal clustering,” Clinical Neurophysiology, vol. 115, no. 3, pp. 508–522, 2004.

J. Koza, Genetic Programming: On the Programming of Computers by Means of Natural Selection, MIT press, Cambridge, MA, USA, 1992.

P. G. Espejo, S. Ventura, and F. Herrera, “A survey on the application of genetic programming to classification,” IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews), vol. 40, no. 2, pp. 121–144, 2010.

M. W. Aslam, Z. Zhu, and A. K. Nandi, “Automatic modulation classification using combination of genetic programming and KNN,” IEEE Transactions on Wireless Communications, vol. 11, no. 8, pp. 2742–2750, 2012.

NIST/SEMATECH, “e-Handbook of statistical methods,” March 2016, http://www.itl.nist.gov/div898/handbook/.

T. Cover and P. Hart, “Nearest neighbor pattern classification,” IEEE Transactions on Information Theory, vol. IT-13, no. 1, pp. 21–27, 1967.

http://gplab.sourceforge.net/.

M. I. Khalid, S. A. Aldosari, S. A. Alshebeili, T. Alotaiby, M. H. Al-Hameed, and L. Jad, “MEG data classification for healthy and epileptic subjects using linear discriminant analysis,” in 2015 IEEE International Symposium on Signal Processing and Information Technology (ISSPIT), pp. 360–363, Abu Dhabi, United Arab Emirates, December 2015.