Introduction

Epilepsy is a disorder of cortical excitability and interictal electroencephalography (EEG) remains the most convenient and the least expensive way to demonstrate physiological manifestations of this disorder [13].

Epilepsy is classified as either generalized or partial with several subcategories in each class. In the management of patients with established epilepsy, the concept of epilepsy syndrome based on age at onset, seizure type or types, EEG findings and etiology has been an important advancement [4]. The correct diagnosis of a patient’s epilepsy syndrome clarifies the choice of drug treatment and also allows an accurate assessment of prognosis in many cases [36].

Recent developments in medicine show that diagnostic expert systems can help physicians make a definitive diagnosis. Artificial Neural Network (ANN) has been found to be helpful in expert systems in the diagnoses of diseases and used in many different situations [79]. ANNs have also been used for the detection of seizure activity [1012]. The results of these studies on detection of seizure events in EEGs of epileptic patients showed that ANNs are capable of capturing qualitative information from an EEG with over 90% accuracy. Walczak and Nowack [13] were the first to use ANNs for the diagnosis of epilepsy. However, they did not obtain high categorization accuracy. Some authors also applied neural network and statistical recognition methods to EEG analysis [1418]. These results confirmed that the proposed models have potential in classifying the EEG signals.

Although ANNs have been used for the detection of seizure activity related to video EEGs analysis before, none of the previous works classify the subgroups of primary generalized epilepsy. In this study, we have extended our study in which we classified epilepsy groups such as partial and primary generalized epilepsy in order to test to what extent we could determine the subgroups of generalized epilepsy classification of the patients with the method of ANN.

Material and methods

Collection and processing of data

Seventy-nine patients with primary generalized epilepsy diagnoses according to International League against Epilepsy [19] are included in this study. The patients at the clinic of epilepsy outpatients of Cukurova University Medical School, Neurology Department between the years of 2002–2005 were examined and included in the study. The epilepsy diagnosis was based on the medical history, clinical findings, electrophysiological reports, radiological and biochemical analysis.

This study considers the categorization of sex, age of seizure onset groups, seizure types, the loss of consciousness in the course of seizure time and the properties of the first interictal EEG analysis of epileptic patients. Patients are classified as having early or late age on set of seizures based on a cut-off age value. In this study, we selected the cut-off value as 20 years according to literature [20]. In the classification belonging to age of seizure onset: the patients between 0–20 year olds were classified as group 1, between 21–60 year olds were classified as group 2. The EEG records were detected by 12 channel Nihon-Kohden EEG machine. Each EEG record was done for 20 min, but the EEG of the activated sleep was recorded for 2 h. The patients who had pseudo seizures and EEG from out of our electrophysiology laboratory were excluded from the study. Eventually, we reevaluated 418 patients with their first EEGs and clinical properties. All the EEGs examined in this study were recorded after postictal period of seizure.

EEG signals contain a wide range of frequency components; this range is classified approximately in a number of frequency bands as follows: δ (0.5–4 Hz), θ (4–8 Hz), α (8–13 Hz), β (13–30 Hz). The δ, θ waves were accepted as abnormal activities, whereas α, β waves were accepted as normal. On the other hand, sharp, sharp and wave, spike, spike and wave activities were accepted as abnormal signals as well. While the frequency component of delta and theta activities as stated above is a limited application, the frequency of the other abnormal activities is not limited [21]. Two experienced neurologists in the clinical analysis of EEG signals inspected each record separately in the study to categorize signals. The EEGs of every patient were evaluated by using visual methods. The activity properties of EEG findings were classified in the direction of group 1: sharp and/or spikes; group 2: delta and/or theta, group 3: normal. In the course of EEG, the physiological conditions of the patients were determined as either awake or sleep and the existence of rhythmicity of the abnormal activities were categorized as yes or no. The localization of abnormal activities was categorized; either they are focal (frontal, temporal, parietal, occipital or in more fields than one) or generalized or normal. On the other hand, abnormal activities were categorized from the point of hemispheric lateralization as right, left, diffuse and normal. We determined the frequency of abnormal waves (how many times a second these activities have been repeated), and duration of the abnormal signals (how long abnormal signals take during the EEG recording) on the EEG. On the other hand we checked the parameter of whether the loss of consciousness in the course of seizure time was being identified (yes/no/sometimes reported but not in all seizure).

Multilayer perceptron neural network (MLPNN)

The architecture of Multilayer Perceptron Neural Networks may contain two or more layers. Each layer consists of units which receive their input from a layer directly below and send their output to units in a layer directly above the unit. The input node activation values x i are multiplied by the strengths of the respective connection weights w ji and summed at each hidden layer node. The weighted sum is then transmitted by an appropriate transfer function into the activation value of the hidden node, which becomes the input to the output layer nodes.

$$y_j = f\left( {w_{ji} x_i } \right)$$
(1)

where f is an activation function that is necessary to transform the weighted sum of all inputs. In most applications a feed-forward network with a single layer of hidden units is used with a sigmoid activation function for the units. For the output units, an activation function suitable for the distribution of the target values should be chosen. For binary (0/1) targets, the logistic function is an excellent choice. For categorical targets using 1-of-K coding, the softmax activation function is the logical extension of the logistic function [2224].

The sum of squared differences between the desired and output values of the output neurons E is defined as

$$E = \frac{1}{2}\sum\limits_j {\left( {y_{dj} - y_j } \right)^2 } $$
(2)

where y dj is the desired value of output neuron j and y j is the actual output of that neuron. The connections w ji between the neurons are arranged by using a “learn” algorithm. There are many training algorithms used to train an MLPNN and a frequently used one is called backpropagation (BP) training algorithm [23, 25]. Although the BP algorithm has been a significant milestone in neural network research area of interest, it has been known as an algorithm with a very poor convergence rate. Many attempts have been made to speed up the BP algorithm. A significant improvement on realization performance can be observed by using various second order approaches namely Newton’s method, conjugate gradient’s, or the Levenberg–Marquardt (LM) optimization technique [2629]. LM can be thought of as a combination of the steepest descent and the Gauss–Newton method. In the last years, the LM method, directly taken from the Optimization field, has been increasing its popularity within the neural networks community. The difference between optimization and neural network applications of the method comes from the fact that in the latter there is usually a great deal of parameters to be estimated [30, 31].

A commercial Microsoft Windows based ANN software package was used to set up the ANNs in the study. The type of neural network used in the study has been a Multilayer Perceptron neural network with Levenberg–Marquardt.

The input of the MLPNNs had ten nodes representing parameters which are the age of seizure onset groups, sex, the activity properties of EEG findings, the physiological conditions of the patients during EEG, the existence of rhythmicity of the abnormal activities, the localization of abnormal signals, hemispheric lateralization, the frequency of abnormal waves, the duration of the abnormal signals and the loss of consciousness in the course of seizure time. The duration of the abnormal signals and the frequency of abnormal waves that we used as input to MLPNNs were interval variables. The coding of categorical and ordinal variables was shown in Table 1.

Table 1 Coding of input parameters used in training and testing of neural networks

Results

Seventy-nine patients who had been diagnosed with epilepsy were included in this study. Thirty (37.9%) of patients were female and 49 (62.1%) of them were male. According to the age of seizure onset groups, the patients were between 0–20 years in 58 patients (73.4%), between 21–60 years in 21 (26.6%) of all patients. Patients who were diagnosed as primary generalized epilepsy were classified as generalized tonic–clonic (n = 23), absans (n = 11), myoclonic (n = 5), atonic (n = 0), more than one type of seizures (n = 40). The data set was summarized in Table 2.

Table 2 Demographic and disease properties of the patients

The learning of the network was executed by applying the input and output vectors. In this classification, the output layer of MLPNN represented the subgroups of primary generalized epilepsy (generalized tonik–klonik, absans, myoclonic and more than one type seizure) and was coded as 1, 2, 3 and 4, respectively. In the hidden layer and the output layer, the activation functions were selected as sigmoid and softmax function, respectively. The MLPNNs were developed using the 34 training examples, while the remaining 45 examples were used for testing the model. For obtaining a better generalization, nine training examples were selected randomly to be used as a cross validation set. The class distribution of the samples in training, validation and test data sets were summarized in Table 3.

Table 3 The class distribution of the samples for the subgroups of primary generalized epilepsy

It is important to determine the architecture of MLPNNs having the best generalization. Therefore, we have formed different MLPNNs composed of different number of nodes in the hidden layer in order to find optimal topologies of MLPNNs. The most popular approach to finding the optimal number of nodes in hidden layer is by trial and error. In order to evaluate the performance of the neural networks, classifications were done by the expert neurologists and the classification results calculated at the output of neural network were compared.

When the structure of the neural network was formed as a result of the performed experiments, the MLPNN having 45 nodes in the hidden layer had the best total classification accuracy of 84.4% (Fig. 1).

Fig. 1
figure 1

Total classification accuracy of tested MLPNNs for the subgroups of primary generalized epilepsy

The classifications done by the expert neurologists and classification results calculated at the output of neural network were compared in order to evaluate the performance of the neural network. The first four columns of the Table 4 represented the confusion matrix for the classification subgroups of primary epilepsy.

Table 4 Confusion matrix and statistical parameters for the subgroups of primary generalized epilepsy

Accuracy for each subgroup is expressed as the ratio of number of correctly classified cases within the subgroup over the total number of cases in that subgroup. Total classification accuracy shows the overall performance of a neural network over. As it is seen from Table 4, the MLPNN classified the subgroups of primary generalized epilepsy with the accuracy of 84.4%. It classified generalized tonik–klonik, absans, myoclonic and more than one type seizures epilepsy groups correctly with the accuracy of 78.5%, 80%, 50% and 91.6%, respectively.

Additionally, ten new MLPNNs were constructed for determining significant variables. As the results shown in Table 5, all variables were significant because the classification accuracy of MLPNN decreased when one of them was omitted from the input vector. Therefore, no variables were excluded. The loss of consciousness in the course of seizure time variable caused the largest decrease in the classification accuracy when it was left out.

Table 5 Ten variables classification accuracy for the subgroups of primary generalized epilepsy

Discussion

EEG findings enhance the multi-axial diagnosis of epilepsy in terms of whether the seizure disorder is partial or generalized. As other laboratory tests, it should be used in conjunction with clinical data. However, partial and generalized seizure disorders show some overlap both clinical and EEG manifestation. The conceptual classification of seizures as partial or primary generalized epilepsy is important and clinically useful because the knowledge of an individual patient’s epilepsy group allows the assessment of prognosis and the choice of the most effective antiepileptic drug.

Most of the studies carried out earlier focused on the epileptic seizure detection and the classification of EEG signals through ANN using some of EEG properties. In this study, we have extended our studies in which we classified epilepsy groups such as partial and primary generalized epilepsy [17] and the subgroups of partial epilepsy [18] in order to test to what extent we could determine the subgroups of primary generalized epilepsy classification of the patients with the method of ANN. The neural networks were trained by the parameters obtained from not only the EEG signals, but also the demographic properties of patients and the parameter of the loss of consciousness in the course of seizure. This is the first study to classify the subgroups of primary generalized epilepsy using the neural network according to these parameters. To achieve this aim, the demographic properties, the loss of consciousness in the course of seizure and the first EEGs of 79 patients were evaluated and applied to neural network as independent variables. Subsequently, the MLPNNs trained with Levenberg–Marquardt algorithm were used to classify the subgroups of primary generalized epilepsy. In the present study, each formed MLPNNs having different number of node in the hidden layer from 1 to 100 were trained for classifying primary generalized epilepsy groups in order to find optimal number of nodes in the hidden layer. When the structure of the neural network was formed as a result of the performed experiments, it was found that; the MLPNN having 45 nodes in the hidden layer had the best total classification accuracy for the classification the subgroups of primary generalized epilepsy (Fig. 1).

The MLPNN classified the subgroups of primary generalized epilepsy with the accuracy of 84.4% according to Table 4. The MLPNN had a good accuracy for the detection of more than one type of seizure. In our study, all variables we studied were significant and no variable was removed. On the other hand, the parameter of the loss of consciousness in the course of seizure constituted the most significant variables in the classification of epilepsy groups by using MLPNN (Table 5). When the confusion matrix and the classification accuracies obtained for each subgroup are examined, the MLPNN have obtained acceptable classification success. These outcomes indicate that this model may classify the subgroups of primary generalized epilepsy successfully after it is developed.