1 Introduction

Epilepsy is disorders of the brain which can be detected using EEG signals. Features of EEG are patient specific in nature and vary largely from one person to other. Immense progress in the field of neuroscience for the last four decades have opened new avenues in which epilepsy, a disorder that is dynamic and variable in nature, can be treated as a certain percentage of epileptic seizure is still refractory to medications. Work is going on for the past few decades to design automated system that can analyze and detect seizure and predict them before its occurrence so that required measures can be taken to prevent them and provide the patient with a better quality of life. Some of the methods have been described below.

Epilepsy in a person can be observed through seizures due to abnormal neuronal activity [1]. Persons with disorder in central nervous system experience seizures [2]. Various reasons for epilepsy are mutation in molecular mechanism, severe blow to the head, brain malignancy or cerebral infection [3]. Seizure consists of various kinds of waveforms, spikes, sharp waves, sleep spindles and periods [4]. Accurate patient specific detectors were designed using SVM classifiers in [5]. Sensitivity and false detection rate has been used as standard for measuring performance by researchers in [6]. There are limitations in automatically detecting and predict seizures [7]. In [8], k-means clustering and a multi-layer ANN are proposed for EEG classification.

In this work a machine learning technique is used to distinguish between epileptic and non-epileptic activity from EEG recordings. The paper is organized as follows. Section 2 gives overview about the literature review. Section 3 describes the machine learning technique, Sect. 4 presents the proposed methodology, results are discussed in Sects. 5 and 6 contains comparative study followed by conclusion in the last section.

2 Literature review

In the last few decades numerous work have been conducted by researchers to understand epilepsy and the characteristics of brain activity that accompanies a epilepsy attack and detect and predict the onset of seizure. The earliest of work can be traced back to 1982 by Gotman who developed patient non-specific detectors.

Adeli et al. [9] used wavelet filters in their study so that the signals were restricted under 60 Hz. Various other techniques have been used for artifacts removal such as independent component analysis (ICA) while blind source separation is also used segregating EEG based data. Cascade of adaptive filters have been used by Garces Correa et al. [10]. in order to remove the presence of noise and other artifacts from the EEG signal. The amplitude as feature was used by Minasyan et al. [11] so that an input vector was built which was used in the artificial neural network (ANN). Regularity and synchronicity are the chosen parameters that are used to analyze the similarity between the signals. Fotiadis et al. [12] presented a study regarding the use of time frequency analysis for classification of EEG segments for epilepsy along with comparison of different other methods based on EEG signals. Short time Fourier transformation and power spectral density was evaluated for each EEG segment.

Parvez and Paul [13] in their paper explored general epileptic seizure detection and prediction procedure for obtaining features of ictal and inter ictal recordings using different transformations and decompositions. Orhan et al. [8] brought forward classification based on multilayer perceptron neural network (MLPNN) that was used as a decision making system in epilepsy treatment. In this method the EEG signals that were recorded were broken down into sub bands of frequency using discrete wavelet transformation (DWT). Adeli and Ghosh-Dastidar [14] also gave a complete methodology for seizure detection. A wavelet-chaos strategy was presented for the detection of seizures and epilepsy. The classification accuracy was nearly 95%. Xie et al. [15] worked on a new detection method that would help in epilepsy seizure detection. The working design was based on principal component analysis (PCA) and features that were partially extracted.

Various methods have been used over the years that could detect and predict epileptic seizures. But there is no performance evaluation framework that would set a benchmark on the basis of accuracy. Also the performance of these different methods should be based on the dataset that is being used by the researchers as difference in the dataset can have significant effect on the outcome of the method applied. Therefore performances should be evaluated depending on the dataset used.

3 Machine learning technique

Machine learning has become the backbone in information technology as there is a surge in the amount of information and data available in the day-to-day life of human beings that are needed to be processed and analyzed to uncover knowledge and patterns [16]. The machine learning technique used in this work is artificial neural network (ANN). The ANN is inspired from biological neural network or neurons. ANN is basically consist of input, weight, bias, transfer functions, outputs etc. There are various types of neural network architecture such as perceptron, feed forward networks, Elman neural network, back-propagation neural network etc. In this work two neural networks are taken and a comparative study of two neural networks is carried out.

3.1 Perceptron neural network

In 1950s Rosenblatt and other researchers develop a neural network called perceptron. Perceptron learning rule is used to modify the weight and bias of the network. The output of the network is given by,

$${\text{a }} = {\text{ hardlim}}\left( {{\text{Wp }} + {\text{ b}}} \right)$$
(1)

Where a = output, W = weight, b = bias, p = input, hardlim = transfer function. The network architecture of perceptron neural network is shown in Fig. 1. In Fig. 1, R = number of inputs, S = number of neurons, n = net inputa.

Fig. 1
figure 1

Perceptron network

3.2 Back-propagation neural network

It is a multilayer feed forward neural network. A feed forward neural network is shown in Fig. 2. It is a generalization of least mean square algorithm. The sensitivities are back-propagated through the network backward. The back-propagation neural network is used in this work to determine the epileptic and non-epileptic signals.

Fig. 2
figure 2

Three layer feed forward neural network

4 Proposed method

The proposed machine learning based method is described below in the following subsections. The flowchart of the proposed method is shown in Fig. 3.

Fig. 3
figure 3

Flowchart of the proposed method

4.1 Dataset

The dataset that was considered in the paper are taken from physio-net data base which belonged to the patient from Children’s Hospital Boston [17]. It consisted of pediatric patients’ scalp EEG recordings. Each patient file recorded a minimum of one and a maximum of four seizures using the bipolar placement of electrodes [18]. The EEG recordings were sampled at 256 Hz at 16 bit resolution. Although specifically the hemisphere of occurrence was not mentioned, most of the burst of activity was noticed in the frontal and fronto-central channels. The dataset that was considered belonged to female patient those recordings showed presence of epileptic activity in the frontal part of the brain and it was simple and complex partial in nature. Figure 4 shows the signals obtained from channel 1 and channel 2 during normal and epileptic stage. Figure 4a shows the EEG signals for channel 1 during normal and epileptic condition. Figure 4b shows the EEG signals for channel 2 during normal and epileptic condition. From Fig. 4 it can be observed that normal and epileptic signals magnitude is different. Hence it can be used as input to machine learning based method for classification.

Fig. 4
figure 4

a Channel 1 EEG signals, b channel 2 EEG signals

4.2 Proposed machine learning method

In this paper a machine learning technique named as ANN has been used to predict normal and epileptic conditions using EEG recordings. The EEG scalp data obtained is applied to the neural network and the target set is designed according to the dataset. The data is trained in the designed network as well as tested. Two ANN architectures are used to carry out the proposed method, perceptron and back-propagation. For the two different network architecture different transfer functions are used. In the back propagation neural network the dataset is trained in different configuration by varying the number of neurons. The performance goal is also varied for the network design in order to increase the accuracy rate for correct classification of normal and seizure data. After various trial optimal neural network for both the networks are obtained. The final neural network configuration obtained is shown in Fig. 5 for both networks. Figure 5a shows the optimal network obtained for perceptron neural network. Figure 5b shows the optimal network obtained for back-propagation. Table 1 shows the optimal configuration of both the network.

Fig. 5
figure 5

a Perceptron, b back-propagation

Table 1 Configuration of the neural network

5 Results

The performance of the proposed machine learning based method for epilepsy detection is evaluated. The performance of the method was evaluated in terms of % accuracy in detecting the epilepsy.

5.1 Performance with perceptron neural network

The performance of the perceptron network is analyzed in terms of time taken; mean square error and percentage accuracy. Figure 6 absolute error obtained in detecting normal and epileptic signals. The overall performance of the method is shown in Table 2. From all the results obtained it can be observed that the proposed method can detect the normal and epileptic signals but the accuracy can still improve.

Fig. 6
figure 6

Absolute error

Table 2 Performance of perceptron neural network

5.2 Performance with back-propagation network

The performance of the network is also analyzed in terms of time taken; mean square error and percentage accuracy. The overall performance of the method is shown in Table 3. From Table 3 it can be observed that all the variation of network has % accuracy of 100%. Figure 7 shows the output of the various neural networks varying error goal. From Fig. 7 it can be observed that the output with error goal 0.00001 is more modified. Hence it is taken as optimal neural network. Figure 8 shows the absolute error obtained in detecting normal and epileptic signals. From all the results obtained it can be observed that the proposed method can detect the normal and epileptic signals.

Table 3 Performance of back-propagation neural network
Fig. 7
figure 7

Output varying error goal. a mse = 0.001, b mse = 0.0001, c mse = 0.00001

Fig. 8
figure 8

Absolute error obtained

5.3 Comparison

Various methods have been proposed for seizure detection by different researchers. Table 4 shows the comparision of various methods used for epilepsy detection. Although other method shows more accuracy, the dataset used is too small from which accuracy can be predicted correctly. Proposed method has an accuracy of 100% with a large data set which is most probable happen in real life events.

Table 4 Comparison of various methods

6 Conclusion

In this work machine learning has been used to detect normal and epileptic condition. In this method EEG signals are used to predict the epileptic and non-epileptic condition. The performance of the method is 100% accurate with all the tested cases. In this work an instance has been used to ascertain the performance of different neural network models. The future work of the method lies in its implementation in real time scenarios such as hospitals and understand not only the accuracy of the methods but also the shortcomings in different real life situations. The future progress of the work will depend on how well the difficulties are addressed and significant changes are brought in devising efficient seizure detection systems.