Keywords

1 Introduction

Seizures are the result of sudden surge of electrical activity in the brain. This electrical activity is caused due to complex chemical imbalance that occurs in nerve cells in the brain. Although, seizures are not a disease themselves. On the contrary, it is the symptom of different disorders that affects the brain. While some seizures may disable a person, other types of seizures may not be identified at all. That is why a device capable of detecting a seizure and notifying a caregiver that medical attention is required could make dealing with epilepsy easier. At this moment, scalp electroencephalogram (EEG) test is the most widely recognized approach to diagnose epilepsy. EEG is a non-invasive, electrophysiological monitoring method to study electrical activity in the brain [1].

In this paper, we constructed detectors capable of detecting seizure quickly and with high accuracy using machine learning. The first step of seizure detection is to segment the EEG recording. So, we sampled the recorded time series into multiple distinct data points, each of which represents the value of the EEG recording at different points in time. We have EEG recordings of 500 individuals for 23.6 s, where each recording was sampled into 4097 data points. We have to train a seizure detector which signal is relevant or not. Hence, we opted to tackle the seizure detection problem using a supervised model. Even though the physiological activity is multiclass, we grouped them together and treated it as a binary classification problem. The reason behind doing such is that it is neither effortless nor reasonable for a medical expert to distinguish and label the classes comprising of the seizure and non-seizure states. On the contrary, classifying electrical brain activity into two classes, seizure and non-seizure, is considered to be an accepted clinical practice. A neural network plays a fundamental part in providing a high accuracy. They are loosely modeled to mimic the working mechanism of a human brain in order to label or classify raw input. Training on a labeled dataset is needed so that the model can classify unlabeled raw data based on the similarities to the training data.

2 Related Work

Gotman et al. [2] utilized sharp wave and spike recognition method. They additionally reinforced this procedure in Gotman [3], Gotman [4], Koffler et al. [5], Qu et al. [6].

Wilson et al. [7] tested a modified seizure detection algorithm which honed a new Reveal algorithm comprising of three methods: matching pursuit, small neural network rules, and a new connected object hierarchical clustering algorithm; all three of them being novel in their application to seizure detection. This study validated the Reveal algorithm as it performed better than the other methods.

Srinivasan et al. [8] suggested a neural network framework for automated epileptic EEG detection. As the input feature of the framework, it utilizes approximate entropy (ApEn) which is a logical parameter that determines the consistency of the present amplitude values of a physiological signal in light of its past amplitude values. It has been observed that the value of the approximate entropy decreases rapidly amid the onset of an epileptic seizure. Utilizing this information, the framework of the suggested model was developed. In this paper, two different neural networks were evaluated which were Elman and probabilistic neural network. The authors observed that they could achieve an accuracy of almost 100% using their proposed framework.

Shoeb et al. [1] assessed a machine learning way to deal with developing patient-particular classifiers that distinguishes seizure activity from other brain activities with the help of the analysis of the scalp EEG. In contrast to past endeavors, which concentrated on grown-up EEG, the authors assessed their model on pediatric scalp EEG since it displays more fluctuation in seizure and non-seizure activity. The authors trained a support vector machine (SVM) to classify seizure and non-seizure activity. They generated nonlinear decision boundaries utilizing a RBF kernel as the seizure and non-seizure classes are generally not linearly divisible. The authors have claimed a higher accuracy and sensitivity than the Reveal algorithm, which is a patient non-specific detector using machine learning.

Guo et al. [9] introduced a unique technique for automated epilepsy diagnosis by utilizing an artificial neural network, along with the line length features in light of wavelet transform multiresolution decomposition. The authors achieved great accuracy which validated the effectiveness of the method.

Swami et al. [10] proposed an efficient technique for epileptic seizure detection which utilized dual-tree complex wavelet transform for feature extraction. The proposed system gave classification performance (accuracy, sensitivity, and specificity) that was through the roof. The authors claimed that this technique can be utilized for a quick and accurate detection of epileptic seizure.

3 Proposed Method

In our effort to build a system capable of detecting epileptic seizure, we have constructed a DNN classifier consisting of five hidden layers, where each layer comprises of 85 neurons. To train the classifier, it was provided with the necessary parameters, i.e., the features responsible for epileptic seizure detection. Finally, to evaluate the performance of the DNN classifier, we compared it with other models, such as multilayer perceptron (MLP) and k-nearest neighbor (K-NN ).

MLP comprises of two layers—input layer and output layer—with one or multiple layers in-between. Each layer consists of neurons which are powered by a nonlinear activation function. Its numerous layers and nonlinear inducement are what makes it different from a linear perceptron. The model is trained on a dataset with the help of supervised learning.

KNN—k-nearest neighbor—is a nonparametric algorithm where a new variable is allocated to a class by measuring the distance (mainly Euclidian distance) of the new point with the existing points of different classes. The point is then categorized with the class which has the greatest number of points with the least possible distance, i.e., the maximum number of neighboring variables. This model is used for classification and regression purposes in machine learning.

The general steps performed by us for this experiment are as follows

  1. 1.

    Pre-processing: This is the first step that is needed to be performed before the classifier is developed. The following pre-processing steps were performed to the dataset.

    1. (i)

      Feature Extraction—This step deals with the extraction of features most significant for solving the classification problem. The datasets are usually composed of redundant attributes which serve no intrinsic part in solving the problem. So, it is essential that the unneeded attributes are filtered out such that the significant features can be provided the utmost attention.

    2. (ii)

      Data Cleaning—In majority of the cases, the dataset contains missing or inconsistent values which may hinder the process of the training of the model. Such problems are dealt with in this step of pre-processing by getting rid of the inconsistencies.

    3. (iii)

      Data Normalization—Usually, when the attribute values are ranged distinctly, the dataset is normalized to maintain a value range in between −1 and +1. By doing such, the distance among the attribute values is also reduced.

  2. 2.

    After the steps of pre-processing were over, the whole data set was split into two distinct sets, training and testing set, in a ratio of 7:3. To achieve the optimal result, both the data sets are shuffled.

  3. 3.

    In the training phase of the DNN classifier, the model was provided with the training dataset. Through this process, the classifier is trained.

  4. 4.

    After the training of the DNN classifier was over, the performance of the model was evaluated with the help of the testing data set. This step is the testing phase of the classifier.

After the completion of the training and testing phases, the accuracy of the model was calculated to evaluate the performance of the model.

4 Deep Neural Network

DNN is a subgroup of artificial intelligence which involves methods where it learns features directly from data as opposed to being hand engineered by the human. It causes a phenomenon called a feature hierarchy, where a layer trains on the output of the previous layer, and the more we advance through the neural network, and the complexity of decision making increases. The execution mechanism is in the form of graphs which helps it to execute the code in a distributed manner. The data comes into an input layer and flows across an output layer. The layers between input and output layers have hidden layers which are responsible for running calculations. Deep neural network consists of two or more layers; these are input layer and output layer. Deep neural networks are generally feedforward where the connection between the layers does not form a loop. Instead, the data flows forward such that the output of one layer is the input of the next layer. However, TensorFlow is an open-source library developed by Google which is compatible with many variants of machine learning. These networks are often powered by a gradient descent algorithm, which is one of the most popular optimization algorithms. The purpose of the gradient descent algorithm is to minimize the loss which is achieved through backpropagation at each iteration.

In a neural network, a layer is composed of numerous nodes which are similar to neurons. The neurons are responsible for receiving a set of inputs and processing the output with the assistance of a set of weights and an activation function. The output processed by these neurons is picked up by the next layer of neurons as their input. These inputs are further assigned an individual weight which denotes the significance of the input or the feature in accordance with the classification problem.

figure a

DNN can also be used to model sequences where the data points are not single images but rather temporally dependent. Deep learning also typically defines sets of predefined features and the data and they work to extract these features as part of their pipeline. The key differentiation point of deep learning is that it recognizes many practical situations.

Deep neural networks have the advantage of learning from massive load of unlabeled data which makes it a more favorable option over other learning algorithms. For it to be able to analyze unstructured data, first the neural network needs to be trained on a labeled dataset. However, the performance can be made exponentially better if the model can be provided huge quantities of training data to learn from. The more data the network will analyze, the more accurate it will become in its decision making.

5 Properties of the Scalp Electroencephalogram (EEG)

EEG is the continuous recording of the electrical brain activity. There are billions of brain cells called neurons, and the neurons have axons that relieve neurotransmitters and the dendrites they receive them. The axons of other neurons they cause electrical polarity change inside the neuron. This polarity change is what the EEG is recording. The brain gives off electromagnetic waves when there is electricity running in the brain, which produces brain waves that is amplified quite a lot.

Researchers are often interested in recordings from epilepsy patients because the information retrieved the EEG signals of epilepsy patients provide a particular outlook of the human brain. Such information grants an opportunity to the researchers to find something unprecedented.

6 Scalp EEG Dataset

The neural network was provided a dataset consisting of the recordings of the EEG signal recorded for 3.3 h and sampled at 173.61 Hz while the settings of the bandpass filter were set at 0.53–40 Hz (12 dB/oct.). Using a common frame of reference, the EEG readings were recorded with the help of a 128-channel amplifier system. Subsequently, the recorded data was sampled and written onto a disk using a 12-bit analog-to-digital conversion system [11].

The data set was divided into five sets, where each set consists of 100 single channel EEG segments lasting for a duration of 23.6 s. These sections were chosen and removed from the EEG dataset after analyzing for artifacts, e.g., because of activity in the muscular area or optic movement. Each of the sets consists of a distinct criterion which must be fulfilled by the sampled data. The data included in sets A and B is comprised of signal recorded from five volunteers, in their relaxed state, using the method of regulated electrode placement scheme. Data in set A included the data collected from the volunteers who had their eyes open, while in set B, they had their eyes closed. On the other hand, sets C, D, and E consisted of EEG recordings archived from presurgical diagnosis. While set D contained the EEG signals recorded from inside the epileptogenic zone, those in set C were recorded from the hippocampal formation of the opposite hemisphere of the brain. Sets C and D consist of EEG signals which represent the non-seizure activity. On the contrary, set E contains data when the subject was suffering from seizure. The data was recorded from the parts of the brain which exhibit ictal activity [12].

The EEG dataset which was evaluated in this paper was obtained from the UC Irvine Machine Learning Repository. It can be downloaded from the following website: http://archive.ics.uci.edu/ml/index.php.

7 Performance Metrics

After the training and the testing phases were over, the performance of the model was evaluated in terms of Accuracy, Precision, Recall, and F1 Score.

  • Accuracy is denoted by the ratio of the number of observations predicted accurately by the model to the total number of observations made by the model.

    $$\begin{aligned} {\text{Accuracy}} & = \left( {{\text{True Positives}}\left( {\text{TP}} \right) + {\text{True Negatives}}\left( {\text{TN}} \right)} \right)/\left( {\text{TP}} \right. \\ & \quad \left. { + {\text{False Positives}}\left( {\text{FP}} \right) + {\text{False Negatives}}\left( {\text{FN}} \right) + {\text{TN}}} \right) \\ \end{aligned}$$
  • Precision is the proportion of accurately anticipated positive observations to the aggregate anticipated positive observations.

    $${\text{Precision}} = {\text{TP}}/\left( {{\text{TP}} + {\text{FP}}} \right)$$
  • Recall is the ratio of correctly positive classifications from cases that are actually positive—yes.

    $${\text{Recall}} = {\text{TP}}/({\text{TP}} + {\text{FN}})$$
  • F1 Score is denoted by the mean of two components: precision and recall.

    $${\text{F}}1\,{\text{Score}} = {{2*\left( {{\text{Recall}}*{\text{Precision}}} \right)} \mathord{\left/ {\vphantom {{2*\left( {{\text{Recall}}*{\text{Precision}}} \right)} {\left( {{\text{Recall}} + {\text{Precision}}} \right)}}} \right. \kern-0pt} {\left( {{\text{Recall}} + {\text{Precision}}} \right)}}$$

8 Results and Discussion

We evaluated our suggested model in accordance with the above-mentioned performance metrics and composed our result.

Table 1 illustrates the comparison study of the DNN model with the KNN and the MLP model. The table showcases that the accuracy of the DNN model is 80% which is comparatively better than the accuracy of the KNN model and the MLP model. However, precision is where the DNN model falls short, exhibiting only 64%, while the other two models displayed a precision of more than 70%. Additionally, the recall value of the DNN model (80%) is slightly better than that of the MLP model (79%), while the recall of the KNN model was only 76%. Another important performance metric is the F-measure. The DNN model displays a F-measure percentage of 71% with the KNN model at 72% and the MLP model at 78%.

Table 1 Performance comparison between different models

Based on the study above, it can be inferred that the performance of the KNN model is by far the worst among the three. On the other hand, the DNN model exhibits the best signs of performance and can be concluded as the ideal classifier for this problem.

9 Conclusion

Thus, our study proposes the use of a deep-neural-network-based classifier instead of the traditional classifiers like MLP and KNN in detecting seizures of patients suffering from epilepsy. From the results obtained, it is seen that these traditional methods fall short when compared to deep neural networks. DNN yields a far better accuracy than MLP or KNN. Nevertheless, in the near future, focus should be on developing more efficient classifiers and in proper feature selection to yield the highest accuracies.