Keywords

1 Introduction

Seizure is a common neurological disorder caused by abnormal electrical activities in the brain. Most often a seizure begins with micro-seizures starting asynchronously from small neuronal clusters. These micro-seizures then construct a macroscale hypersynchronization, i.e., a seizure in combined form [11]. Epilepsy is a chronic disorder of the brain that can be caused by some underlying disease mechanism and is usually characterized by occurrence of seizure. However, the exact cause remains unknown in about 50% of patients [15].

It is estimated that about 70% of people living with epilepsy could live seizure-free if proper diagnosis and treatment are followed. However, in developing countries, epilepsy is still not considered as a disease of importance. The negligence in treatment due to lack of awareness, resources, and manpower as caregivers often leads to premature mortality of epileptic patients [3].

Epilepsy is characterized by recurrent epileptic seizures. Electroencephalogram (EEG) is helpful in evaluating a patient with epilepsy [13]. It is usually interpreted by an experienced neurologist, epileptologist or an electrophysiologist. Often, the intermediate or borderline EEG recordings of individuals create a lot of confusion in clinical decision making. Whether these recordings behave as normal or epilepsy cannot be specifically determined, and thus it affects treatment. Clinicians are usually inclined towards further observation and treatment as and when required. Automated analysis and classification of such EEG data with the help of computational techniques can be helpful in interpreting such recordings as normal or epilepsy. Although a considerable amount of work has been done to classify EEG signals as either normal or epilepsy [1, 2, 14], none of them involves categorization of intermediate EEG data.

In this paper, we have analyzed EEG data of 91 healthy volunteers and 119 epilepsy patients to categorize 14 intermediate individuals. We have extracted 120 significant features from adjacency matrices obtained from the EEG data of all the categories. Thereafter, scaled conjugate gradient (SCG) feed forward neural network (FNN) is employed to classify the data in a frame of two-class problem. Silhouette based k-means clustering has been used to extract clusters of normal and epileptic EEG data followed by superimposition of the intermediate data to either epileptic or normal classes using minimum squared Euclidean distance.

2 Data

We have collected Electroencephalographic (EEG) data [8] of epileptic, intermediate and normal individuals, recorded using 16 channels/electrodes placed on the scalp. The location and naming of the electrodes follow the internationally accepted Modified Combinatorial Nomenclature (MCN) system [10].

Here, we have collected data from 91 healthy volunteers comprising 36 males and 55 females with a mean age of 19.1 years. Besides 119 patients suffering from epilepsy have been considered. Among them, 53 are males and 66 are females with a mean age of 18.75 years. Intermediate data (data which cannot be rightly classified as normal or epilepsy) has been collected from 14 individuals. Here, a total of 73 EEG recordings have been selected from 7 females and 7 males with a mean age of 44.21 years.

EEG Data have been recorded using Recorders & Medicare Systems Pvt. Ltd. (RMS) computerized EEG machine and Nihon Kohden Neurofax (NKN) EEG-1200, for an interval of 20–30 min each. During recording, all the participants have been asked to relax in a no-thinking state, and to lay motionless as far as possible keeping their eyes open.

3 Method

The methodology involves data filtering, data pre-processing, computation of adjacency matrix, creation of the final dataset, classifying normal and epileptic data and finally categorization of intermediate data as depicted in Fig. 1.

Data Filtering and Pre-processing

Data filtering steps include resampling, re-referencing, baseline correction and Independent Component Analysis (ICA) as per our previous investigations [5, 6]. Here we have used EEGLAB toolbox [7] version 13 in MATLAB R2018a platform to implement the data filtering steps.

Fig. 1.
figure 1

Flowchart of the overall methodology.

In addition, we have employed a sliding window based eigenvalue decomposition technique to remove unwanted noise from the filtered time series data so that an adjacency matrix of the network, connecting positional nodes of the electrodes, can be generated. A vector of length l has been defined to measure the potential of each electrode on a continuous time series. Here, we have designed a window of size s to slide over the entire length l to divide the data into \(N_{trial}\) number of smaller segments/trials for each class, such as normal, epileptic and intermediate. Thus, we have obtained 1085, 834 and 499 trial data from 91 healthy volunteers, 119 epileptic and 14 intermediate patients respectively. It helps in increasing the number of inputs applied to the learning algorithm. Here, the sliding window has an overlap of 20%.

Computing Correlation Matrix. We have computed Pearson’s correlation coefficient to measure the linear dependency of one channel to another. Here, for each window of size s, and two channels \(\varvec{x}^p=[x_1^p,x_2^p,\ldots , x_s^p]^T\) and \(\varvec{x}^q=[x_1^q,x_2^q,\ldots , x_s^q]^T\), the Pearson’s correlation coefficient \(({c_{pq}})\) can be calculated as

$$\begin{aligned} c_{pq} = \frac{1}{s-1}\sum _{i=1}^{s} \bigg ( \frac{x_i^p - \mu _{x^p}}{\sigma _{x^p}} \bigg ) \bigg ( \frac{x_i^q - \mu _{x^q}}{\sigma _{x^q}} \bigg ) \end{aligned}$$
(1)

Here, the terms \(\mu _{x^p}\) and \(\mu _{x^q}\) represent the mean values, while \(\sigma _{x^p}\) and \(\sigma _{x^q}\) stand for standard deviations of \(\varvec{x}^p\) and \(\varvec{x}^q\) respectively.

Thus, we obtain a correlation matrix \(\mathbf C =[c_{pq}]_{n \times n}\) for each trial of each class, where \(n=16\) in our study. Here \(c_{pq}=1\) if \(p=q\), otherwise \(c_{pq}\) lies between \(+1\) and \(-1\). Positive values represent positive correlation and negative values represent negative correlation, while a value of zero represents no linear correlation between channels. Higher the value, higher is the correlation between channels/electrodes.

Filtering Correlation Matrix. In order to get a more appropriate noise free correlation among channels, we have carried out eigenvalue decomposition [9] on the correlation matrix. The eigenvalue spectrum of the correlation matrix contains a global part \(\mathbf C ^{global}\) with the largest eigenvalue, regional part \(\mathbf C ^{regional}\) of our interest with intermediate eigenvalues, and finally a random part \(\mathbf C ^{random}\) which contains a bulk of small eigenvalues. Thus, the correlation matrix \(\varvec{(C)}\) can be expressed as

$$\begin{aligned} \varvec{C} = \varvec{\nu }_0 \lambda _0 {\varvec{\nu }_0}^T + \sum _{i=1}^{n_h} \varvec{\nu }_i \lambda _i {\varvec{\nu }_i}^T + \sum _{j=n_h+1}^{n-1} \varvec{\nu }_j \lambda _j {\varvec{\nu }_j}^T \end{aligned}$$
(2)

Here, the term \(n_h\) determines the separating boundary between \(\mathbf C ^{regional}\) and \(\mathbf C ^{random}\). The terms \(\varvec{\nu }_0\) and \(\lambda _0\) stand for the eigenvector and eigenvalue of the global part respectively, while \(\varvec{\nu }_i\) and \(\lambda _i\), for \(i = 1,\ldots , n_h,\) represent the eigenvectors and eigenvalues of the regional part respectively. Similarly, the terms \(\varvec{\nu }_j\) and \(\lambda _j\), for \(i = n_{h+1},\ldots , n-1,\) represent the eigenvectors and eigenvalues of the random part respectively.

Filtering the correlation matrix involves removal of both the global and random part. The global part contributes to the highest eigenvalues and affects all the channels during the recording of EEG. On the other hand, random noise that lies at the bottom of the eigenvalue spectrum, may interfere with one or more channels but does not affect all the channels as in the case of global noise. Thus, the filtered correlation matrix can be written as

$$\begin{aligned} \varvec{C}_{filtered} = \sum _{i = 1}^{n_h } \varvec{\nu }_i \lambda _i {\varvec{\nu }_i}^T \end{aligned}$$
(3)

Here, \(n_h\) has been selected in such a way that it can be possible to nullify the effect of the random part by filtering out the eigenvectors with minimum eigenvalues. There are 16 eigenvalues (\(\lambda _{i}\), for \(i = 1, \cdots , 16\) ) for each correlation matrix of each trials for each class. The highest eigenvalue in the eigenvalue spectrum represents the global part of each correlation matrix. Besides, the random part contains the smallest eigenvalues. For epilepsy, we have chosen \(n_h\) to be 6, i.e., after removing the global part, the next six highest eigenvalues contribute to the regional part. Similarly, we have set \(n_h\) as 7 and 8 for normal and intermediate trials respectively.

The determination of \(n_h\) is difficult but obtaining an exact value is not crucial, as a small change of \(n_h\) does not affect the result. In the eigenvalue spectrum, the eigenvalues corresponding to the regional part, are confined to a small portion. Therefore, if we neglect the eigenvalues that lie close to the boundary of the random region, it does not affect the final result much.

Computation of Adjacency Matrix

We set a cutoff value \(\alpha \) from the filtered correlation matrix to obtain an adjacency matrix A. The value \(\alpha \) can be calculated as

$$\begin{aligned} \alpha = \frac{1}{N_{ind}}\sum _{i=1}^{N_{ind}}\bigg (\frac{1}{N_{trial}}\sum _{j=1}^{N_{trial}}\bigg (\frac{1}{n \times n}\sum _{k,l}|c_{kl}|\bigg )\bigg ) \end{aligned}$$
(4)

where \(N_{ind}\) represents number of individuals belonging to each class, and \(N_{trial}\) is the number of trials carried out on each individual. Subsequently, \(c_{kl}\) is an element of the \(n\times n\) matrix \(\varvec{C_{filtered}}\). Thus, for \((a,b)^{th}\) element of \(\varvec{C_{filtered}}\) for each trial, \(|c_{ab}| \ge |\alpha |\) and \(a \ne b\), we consider an edge between \(a^{th}\) and \(b^{th}\) electrode with the corresponding correlation value (\(|c_{ab}|\)) as weights, otherwise we have considered no edge between the two electrodes.

Creation of the Final Dataset

The resultant adjacency matrix provides a weighted undirected graph \(\mathbf {G}(V,E)\), where V is a finite non-empty set of electrodes and E is the set of edges. There exists a function from \(V \times V \rightarrow E\) such that, \(E = \{\{u,v\}|u,v \in V,\) and \(u \ne v\}\). Thus, for a set of 16 electrodes, there are maximum of significant connections possible. These connections are considered as features. Besides, the weight value assigned to each connection represents a feature value. Thus, the training input matrix for the learning algorithm (a feed forward neural network) is represented by \(\mathcal {I}_{N_{trial} \times 121}\) such that \(e_{ij} \in \mathcal {I}\) \((j \ne 121)\) represents \(j^{th}\) feature of \(i^{th}\) trial and \(e_{ij} \in \mathcal {I}\) \((j=121)\) represents the class level of \(i^{th}\) trial. Similarly, the test input matrix for the learning algorithm is denoted by \(\mathcal {I}^{'}_{N_{trial} \times 120}\) such that \(e_{ij} \in \mathcal {I}^{'}\) represents \(j^{th}\) feature of \(i^{th}\) trial.

We have used 1919 samples/trials to be classified into two classes, viz., epilepsy and normal. Out of the total number of samples 70% (1343 samples) are randomly selected for training while 10% (192 samples) are considered for validation. The remaining 20% (384 samples) are used to test the prediction accuracy.

Classifying Normal and Epileptic Data

Here, we have classified epileptic and normal samples using a scaled conjugate gradient (SCG) [4, 12] feed-forward neural network for its quick and better convergence rate. Besides, SCG has shown better classification accuracy compared to self-organizing feature map, multilayer perceptron and support vector machine.

We have randomly chosen an initial weight vector and set an initial conjugate vector to the steepest descent vector. Thereafter, we have calculated the Hessian matrix approximation and the scaling factor. The scaling factor has been readjusted based on the value of error approximation, whenever the Hessian matrix is not positive definite. Subsequently, the step size has been calculated. The process has been repeated iteratively until it meets the predefined performance goal or maximum validation failure.

During implementation of the aforesaid algorithm, we have set the maximum validation failures as 10, whereas the minimum performance gradient has been considered as . Subsequently, we have considered the learning rate of 0.1. Here, the hidden layer consists of 100 nodes.

Categorization of Intermediate Data

The normal and epileptic data have again been fed into the trained feedforward neural network (FNN) to generate all the corresponding points on the output space. In order to eliminate outliers from the output space under consideration, we have used curve fitting toolbox implemented in MATLAB R2018a. Here, we have considered the data points on the output space as outliers those lie above or below 1.5 times the standard deviation from the mean.

The outlier removed data are then clustered into k clusters using average silhouette based k-means clustering algorithm. Further, the trained FNN generated output points for intermediate trials have been projected on resulting k clusters for normal and epileptic dataset. Here, the squared Euclidean distance from each intermediate output point d to each cluster center \(\psi _i, \, for \,\,i=1,\ldots ,\,k\), can be calculated as

$$\begin{aligned} \gamma ^2 = (\psi _i - d) *(\psi _i - d)^{T} \end{aligned}$$
(5)

Now, the point d has been clubbed into the cluster corresponding to minimum \(\gamma ^2\). Similarly, all other output points for intermediate epileptic trails have been categorized as either normal or epilepsy. For each individual patients, if more than 50% of trails have been categorized as normal/epilepsy, then the individual recording has been treated as that of the same category. Whereas, if exactly 50% of trials have been categorized as normal/epilepsy, we have left the individual recording as undetermined.

4 Results and Discussion

Here, applying scaled conjugate gradient feed forward neural network with 100 nodes in the hidden layer, we have correctly classified 781 epilepsy and 1049 normal trials out of total 1919 trials obtained from 91 normal and 119 epileptic individuals. Subsequently, 53 epileptic trials have wrongly been classified as normal, while 36 normal trials have wrongly been classified as epileptic. Thus, it has shown an overall accuracy of 95.36%.

Fig. 2.
figure 2

The outlier removed output points from feed forward neural network for the two classes, i.e., normal and epilepsy, have been plotted on the output space and clustered into four different clusters (left). Depending on minimum squared Euclidean distance from the cluster centres, the output points for intermediate data have been categorized as either normal or epilepsy (right).

Thereafter, intermediate data have been applied as inputs to the previously trained aforementioned FNN model. The output points for intermediate data have been used to categorize intermediate epileptic patients as either normal individuals or epileptic patients. Here, the output obtained from the trained FNN for all normal and epileptic trials have been clustered to serve as a template for categorizing the intermediate data as depicted in Fig. 2. In this context, it should be noted that out of 73 intermediate EEG recordings involving 14 individuals, clinicians are able to identify 38 recordings (obtained from nine individuals) as belonging to either epilepsy or normal category. Here, 31 predictions obtained by the proposed methodology have matched with the clinical recommendation. However, one recording have not be identified, while six recordings have wrongly been predicted, thus giving us an accuracy of 81.58% for intermediate recordings. On the other hand, while categorizing intermediate individuals into either normal or epilepsy class and comparing the results with the diagnosis by clinicians, we have found that the proposed methodology has correctly identified 7 individuals while 2 individuals have wrongly been categorized.

Table 1. Clinical view and computational prediction for intermediate recordings
Table 2. Clinically and computationally predicted decisions for intermediate individuals

Henceforth, we obtain an accuracy of 77.78% for intermediate individuals. Although clinicians have failed to identify the remaining 35 recordings, the proposed method is able to categorize 12 of them as epileptic and leave another one as undetermined, while rest have been categorized as normal. Thus, three clinically unidentified individuals have computationally been categorized as normal while two have been categorized as epileptic. Here, an individual has been assigned to a particular class containing his/her maximum recordings. The summary of our findings are found in Tables 1 and 2.

5 Conclusion

The primary objective of this article is to categorize intermediate EEG data into two classes; namely, normal and epilepsy. It would assist clinicians in their decision making regarding patients who cannot be rightly categorized. Clinically these individuals are usually treated according to the symptoms as and when observed. Therefore, it delays the process of disease identification and treatment.

Here we have tried to employ different machine learning tools to categorize intermediate recordings as either normal or epilepsy. It is quite successful in categorizing each intermediate recordings and has shown 77.78% accurate result for individuals. The prediction made by the methodology can thus help clinicians in accurately diagnosing individuals as normal, epilepsy or intermediate.

This study has been conducted on individuals above the age of 10 years. Among them, most of the people are right-handed. All recordings have been taken at no sleep and eye open state. Similar studies can be conducted on children and/or during sleep. Further, obtaining regional brain signatures from right brain dominant individuals and comparing them with our study may provide a more clear picture of brain regions that are usually affected during epilepsy.