C 2005) Journal of Medical Systems, Vol. 29, No. 6, December 2005 ( DOI: 10.1007/s10916-005-6133-1
Artificial Neural Network Based Epileptic Detection Using Time-Domain and Frequency-Domain Features V. Srinivasan,1,2 C. Eswaran,1 and N. Sriraam1
Electroencephalogram (EEG) signal plays an important role in the diagnosis of epilepsy. The long-term EEG recordings of an epileptic patient obtained from the ambulatory recording systems contain a large volume of EEG data. Detection of the epileptic activity requires a time consuming analysis of the entire length of the EEG data by an expert. The traditional methods of analysis being tedious, many automated diagnostic systems for epilepsy have emerged in recent years. This paper discusses an automated diagnostic method for epileptic detection using a special type of recurrent neural network known as Elman network. The experiments are carried out by using time-domain as well as frequency-domain features of the EEG signal. Experimental results show that Elman network yields epileptic detection accuracy rates as high as 99.6% with a single input feature which is better than the results obtained by using other types of neural networks with two and more input features. KEY WORDS: EEG; epilepsy; seizure; artificial neural network; time-domain and frequency-domain features.
INTRODUCTION Epilepsy is one of the most common neurological disorders. Electroencephalogram (EEG) signal is used for the purpose of its detection as it is a condition related to the brain’s electrical activity.(1) Epilepsy is characterized by the occurrence of recurrent seizures in the EEG signal. As the seizures are episodic in their occurrences, continuous monitoring of EEG is quite common. The EEG signal obtained from ambulatory recording systems contains EEG data for a very long duration even up to 1 week. It requires an expert’s effort in analyzing the entire length of the EEG recordings to detect the epileptic activity. The traditional methods of analysis being time consuming and tedious, many automated diagnostic systems have emerged in recent years.(1) 1 Centre
for Multimedia Computing, Faculty of Information Technology, Multimedia University, Cyberjaya, Malaysia. 2 To whom correspondence should be addressed; e-mail:
[email protected]. 647 C 2005 Springer Science+Business Media, Inc. 0148-5598/05/1200-0647/0
648
Srinivasan, Eswaran, and Sriraam
With the advent of technology, it is possible to store and process EEG data digitally. This digital EEG data can be fed to an automated seizure detection system in order to detect the seizures present in the EEG data. Hence, the neurologist can treat more patients in a given time as the amount of EEG data to be analyzed is reduced considerably due to automation. Automated diagnostic systems for epilepsy have been developed using different approaches. In 1982, Gotman(2) presented a computerized system for detecting a variety of seizures. In 1991, Murro et al.(3) developed an automated seizure detection system based on discriminant analysis of the EEG signal recorded from intracranial electrodes. In 1997, Qu and Gotman(4) proposed the use of a nearest-neighbor classifier on EEG features extracted in both the time—and frequency-domains to detect the onset of epileptic seizures. Artificial neural network (ANN) based detection systems for epileptic diagnosis have been proposed by several researchers. The method proposed by Weng and Khorasani(5) uses the features proposed by Gotman,(6) namely, average EEG amplitude, average EEG duration, coefficient of variation, dominant frequency, and average power spectrum as inputs to an adaptive structured neural network. The method proposed by Pradhan et al.(7) uses raw EEG signal as input to a learning vector quantization (LVQ) network. Recently, Vivek Prakash Nigam et al.(8) have proposed a new neural network model called LAMSTAR network and two time-domain attributes of EEG, namely, relative spike amplitude and spike rhythmicity have been used as inputs for the purpose of detection of epilepsy. This paper discusses an automated detection of epileptic seizures using a special type of recurrent neural network known as Elman network (EN). It is a two-layered back propagation neural network with a feedback connection from the output of the hidden layer to its input. In our approach, we make use of five different attributes to characterize the epileptic seizures. It includes three frequency-domain features and two time-domain features. The frequency-domain features used are dominant frequency,(5) average power in the main energy zone,(4) and normalized spectral entropy.(9) The last feature, namely, normalized spectral entropy has been so far used only for the EEG-based assessment of anesthetic depth and to the best of our knowledge, is used for the first time in this paper for the detection of epilepsy. The time-domain features(8) used in this work include spike rhythmicity and relative spike amplitude. Experiments are conducted using five different types of training schemes involving only one input feature as well as combinations of two and more input features. It is found from the results that EN yields the best result with a single feature fed as the input. The overall detection accuracy rate obtained in this case is about 99.6%, which is better than the overall detection accuracy of 98.4% obtained with the LAMSTAR neural network(8) using two time-domain features, namely, spike rhythmicity and relative spike amplitude as the inputs. Further, it is found that the overall detection accuracy rates obtained with EN by using combinations of two and more input features are less than the value obtained with a single input feature. However these values lie in an acceptable range of the clinical tests.(7)
An Automated Diagnostic Method for Epileptic Detection
649
MATERIALS AND METHODS EEG Data Acquisition and Selection Two sets of EEG data(10) corresponding to the normal and epileptic subjects are selected for the training and testing of EN. Each set contains 100 single channel EEG segments, with a segment duration of 23.6 s. These segments are selected and cut out from continuous multichannel EEG recordings after visual inspection for artifacts, e.g., due to muscle activity or eye movements.(10) The first set of EEG data corresponding to normal subjects is taken from the surface EEG recordings of five healthy subjects using the standardized electrode placement technique. The subjects are relaxed in an awaken state with eyes open.(10) Depth electrodes are implanted symmetrically into the hippocampal formations and strip electrodes are implanted into the lateral and basal regions (middle and bottom) of the neocortex. The second set of EEG data consists of epileptic EEG signals obtained from five different epileptic patients, recorded during the occurrence of epileptic seizures from all the implanted electrodes. The epileptic EEG segments are selected from all recording sites exhibiting ictal activity.(10) The EEG signals are recorded with 128-channels amplifier system, using an average common reference. After a 12 bit analog-to-digital conversion, the data are written continuously onto the disk of a data acquisition computer system at a sampling rate of 173.61 Hz with band-pass filter settings at 0.53–40 Hz (12 dB/octave).(10) Figures 1 and 2 show specimens of the normal and epileptic EEG signals, respectively. Feature Extraction Short sections of 1 s EEG epoch are used for the feature extraction. In order to detect the seizures as close to the clinical point of onset, the short sections of EEG provide the required accuracy in time-domain.(1) In the frequency-domain feature calculations, the input signal is assumed to be stationary and the short sections help in approximating the stationarity of the EEG signal.(1) Five features, namely, dominant frequency, average power in the main energy zone, normalized spectral entropy, spike rhythmicity, and relative spike amplitude are extracted from the normal and epileptic EEG to train and test the neural networks. The first two features, namely, dominant frequency(5) and average power in the main energy zone (4) are the frequency-domain features employed by Gotman (6) in his seizure detection system while the third feature, namely, normalized spectral entropy is a feature which is predominantly used only for EEG based assessment of anesthetic depth.(9) The time-domain features, namely, spike rhythmicity and relative spike amplitude have been adopted from the pre-processing algorithm employed by Vivek Prakash Nigam et al.(8) for the epileptic detection. For the calculation of the three frequency-domain features, a bandwidth in the range of 0.15–36 Hz is used.(3) Figures 3 and 4 show the normal and epileptic EEG signals for a duration of 1 s. Figures 5 and 6 show the power spectrum of the normal and epileptic EEG signal, in the frequency range of 0.15 and 36 Hz.
650
Srinivasan, Eswaran, and Sriraam
Fig. 1. Normal EEG.
Fig. 2. Epileptic EEG.
An Automated Diagnostic Method for Epileptic Detection
Fig. 3. Normal EEG (1 s duration).
Fig. 4. Epileptic EEG (1 s duration).
651
652
Srinivasan, Eswaran, and Sriraam
Fig. 5. Power spectrum of normal EEG (1 s duration).
Fig. 6. Power spectrum of epileptic EEG (1 s duration).
An Automated Diagnostic Method for Epileptic Detection
653
The five features are described in more detail in the sections below. Frequency-Domain Features The dominant frequency (DF)(5) is the most important characteristic for each epoch of the EEG signal in the frequency-domain. It is expressed as the frequency of the dominant peak in the freuency spectrum. The average power in the main energy zone (APMEZ ) is calculated for each epoch of the EEG signal from its average frequency (AF) which is defined in equation (1).(4) N
AF =
i=1
Poweri × Frequencyi N
(1) Poweri
i=1
where i represents the frequency component and N represents the total number of frequency components in the EEG epoch. The main energy zone for each epoch of the EEG signal is defined as the frequency band centered at the AF containing 80% of the total energy of the spectrum.(4) APMEZ is obtained by dividing the power in this band by its width.(4) The spectral entropy (SE)(9) corresponding to the frequency range [f1 , f2 ] is calculated for each epoch of the EEG signal using equation (2) SE =
f2
Pn (f i ) × log
f i =f 1
1 Pn (f i )
(2)
where fi represents the frequency component which ranges from f1 to f2 and Pn (fi ) represents the value of the normalized power spectral component at fi . The normalized spectral entropy (NSE) is obtained by dividing SE by a factor log (N) where N is equal to the total number of frequency components in the range [f1, f2 ] as defined in equation (3).(9) NSE =
SE log(N)
(3)
Time-Domain Features The time-domain features, namely, spike rhythmicity (SR) and relative spike amplitude (RSA) are determined after performing the following pre-processing steps on each epoch of EEG signal.(8) 1. A median filter of suitable length is applied to smoothen the EEG signal. 2. Filtered EEG is subtracted from the original EEG segment to obtain a difference signal. 3. The absolute value of the difference signal is further enhanced to demarcate the signal from the noise.
654
Srinivasan, Eswaran, and Sriraam
4. A threshold of 50% of the maximum spike amplitude is set to identify the number of spikes present in a particular EEG segment.(8) Thus, SR of a particular EEG segment is equal to the number of spikes passing the threshold value in that segment and the RSA is equal to the maximum amplitude value of all the spikes that pass through the threshold. Figures 7 and 8 show the enhanced difference signals obtained at the end of step 3 in the pre-processing process indicating the number of spikes in the normal and epileptic EEG, respectively. It can be seen from Fig. 7 that the number of spikes passing the threshold value in the normal EEG signal sample is 1 and the RSA is 2197 µV. Similarly, we observe from Fig. 8 that the number of spikes passing the threshold value in the epileptic EEG signal sample is 2 and the RSA is 5.08 × 106 µV. Artificial Neural Network Implementation The ANNs are considered to be good classifiers due to their inherent features such as adaptive learning, robustness, self-organization, and generalization capability.(5) The ANN considered in this paper for the epileptic detection is a special type of recurrent neural network known as EN. Figure 9 shows the basic
Fig. 7. Enhanced difference signal for normal EEG.
An Automated Diagnostic Method for Epileptic Detection
655
Fig. 8. Enhanced difference signal for epileptic EEG.
architecture of a recurrent neural network. The five different features which are obtained from the pre-processed EEG segments are used as the inputs for the neural network. For the two-layered EN, the activation functions used are tan-sigmoidal and log-sigmoidal for the hidden and output layers, respectively. The number of neurons used in the hidden layer and the output layer are 90 and 1, respectively. Gradient descent algorithm with an adaptive learning rate is used for training the EN.(11) The network is trained with a target value of 0 for normal EEG and 1 for epileptic EEG. The range of output values used for the classification are 0–0.3 for normal EEG and 0.7–1 for epileptic EEG. The neural network training parameters are as shown in Table I. Training Schemes Depending on the number of features used, the training schemes adopted are characterized into five types denoted as TSi (i = 1–5). A training scheme TSi uses i-features as inputs with the input layer of EN comprising i-neurons. For example, the training scheme TS3 uses three features as inputs and in this case the input layer of EN comprises three neurons.
656
Srinivasan, Eswaran, and Sriraam
Fig. 9. Recurrent neural network architecture.
For each training scheme, a total number of 2400 (1200 normal and 1200 epileptic) training patterns of 1 s duration have been used as the training data-set. A total number of 1000 (500 normal and 500 epileptic) test patterns of 1 s duration have been used as the test data-set for evaluating the performance of the neural network.
Table I. Elman Network Training Parameters Training parameters Initial learning rate Learning rate increase (LRI) Learning rate decrease (LRD) Momentum constant (MC) Maximum error ratio (MER) Performance goal (MSE)
Value 0.5 1.05 0.7 0.90 1.04 0.01
An Automated Diagnostic Method for Epileptic Detection
657
Performance Evaluation Parameters The performance of EN is evaluated by using parameters such as sensitivity, specificity, and overall accuracy which are defined as shown in equations (4), (5), and (6), respectively.(1) Sensitivity =
TNCP TNAP
(4)
where TNCP represents the total number of correctly detected positive patterns; TNAP represents the total number of actual positive patterns; and a positive pattern indicates a detected seizure. TNCN (5) Specificity = TNAN where TNCN represents the total number of correctly detected negative patterns; TNAN represents the total number of actual negative patterns; and a negative pattern indicates a detected non-seizure. TNCDP (6) Overall accuracy = TNAPP where TNCDP represents the total number of correctly detected patterns; TNAPP represents the total number of applied patterns; and a pattern indicates both seizure and non-seizure. RESULTS AND DISCUSSION Tables II–VI show the sensitivity, specificity, and overall detection accuracy of EN for the five methods of training schemes, namely, TS1 to TS5 . It can be observed from Tables II–VI that the EN gives the best sensitivity, specificity, and overall accuracy values for the training scheme TS1 i.e. when a single input feature is used. The accuracy obtained in this case is about 99.6% which is better than the values of 93.08% and 98.4% obtained with LVQ(7) and LAMSTAR(8) neural networks, respectively. This overall accuracy rate is also better than the value of 98% obtained by using EN with 10 neurons in the input layer where all the neurons are fed simultaneously from a single input feature vector, namely, SR.(12) Further, it may be noted that the range of overall accuracy rates obtained by using two and more input features (training schemes, TS2 –TS5 ) are in the acceptable range of the clinical tests.(7) Another important observation is that the NSE feature, which Table II. Results Obtained with Training Scheme TS1 Single input feature SR RSA DF APMEZ NSE
Sensitivity (%)
Specificity (%)
Overall accuracy (%)
99.4 98.6 99.6 99.6 99.6
99.8 94.4 99.6 99.6 99.6
99.6 96.5 99.6 99.6 99.6
658
Srinivasan, Eswaran, and Sriraam Table III. Results Obtained with Training Scheme TS2 Two input features SR–APMEZ SR–RSA SR–DF SR–NSE NSE–DF NSE–APMEZ NSE–RSA RSA–APMEZ APMEZ –DF DF–RSA
Sensitivity (%)
Specificity (%)
Overall accuracy (%)
92.8 98.2 98.2 99.6 90.4 99.8 94.2 99.8 94.4 99.4
99.2 95.6 98.4 99.0 91.8 96.6 92.0 95.4 99.4 95.2
96.0 96.9 98.3 99.3 91.1 98.2 93.1 97.6 96.9 97.3
Table IV. Results Obtained with Training Scheme TS3 Three input features SR–RSA–APMEZ SR–RSA–DF SR–RSA–NSE NSE–DF–APMEZ NSE–DF–SR NSE–DF–RSA APMEZ –SR–DF APMEZ –SR–NSE APMEZ –RSA–DF APMEZ –RSA–NSE
Sensitivity (%)
Specificity (%)
Overall accuracy (%)
99.6 98.8 98.0 94.8 96.8 98.2 100.0 99.4 99.2 99.0
95.2 94.8 94.0 99.0 98.2 92.6 97.6 97.2 95.2 94.8
97.4 96.8 96.0 96.9 97.5 95.4 98.8 98.3 97.2 96.9
Table V. Results Obtained with Training Scheme TS4 Four input features
Sensitivity (%)
Specificity (%)
Overall accuracy (%)
99.2 97.8 99.8 99.0 95.4
94.2 93.6 96.0 94.6 99.6
96.7 95.7 97.9 96.8 97.5
SR–RSA–DF–APMEZ SR–RSA–DF–NSE SR–RSA–NSE–APMEZ RSA–DF–APMEZ –NSE SR–DF–APMEZ –NSE
Table VI. Results Obtained with Training Scheme TS5 Five input features SR–RSA–DF– APMEZ –NSE
Sensitivity (%)
Specificity (%)
Overall accuracy (%)
99.6
94.4
97.0
An Automated Diagnostic Method for Epileptic Detection
659
has so far been used only for the EEG based assessment of anesthetic depth levels and not for epileptic detection yields the best overall accuracy rate of 99.6% with EN. The frequency domain features employed in this work is based on the periodogram pre-processing approach and hence would be more suitable for real time applications as they require less overall processing time.(13) CONCLUSION In this paper a recurrent type of neural network known as Elman network (EN) has been employed for the detection of epilepsy. Pre-processed EEG segments of 1 s duration have been used as test patterns. Five different features comprising two time-domain and three frequency-domain features are used in evaluating the performance of the neural networks. Five types of training schemes have been employed for training the neural network. The experimental results show that the epileptic detection can be carried out with an accuracy rate as high as 99.6% even with a single input feature. This will prove to be a significant result for the real-time applications as it will reduce the overall processing time considerably. The overall detection accuracy obtained with EN using a single attribute is better than that obtained with the LAMSTAR network using two attributes. Further, it has been found that the overall detection accuracy rates obtained with two and more input features are in the acceptable range of the clinical tests. REFERENCES 1. McGrogan, N., Neural Network Detection of Epileptic Seizures in the Electroencephalogram, 1999, http://www.new.ox.ac.uk/∼nmcgroga/work/transfer/. 2. Gotman, J., Automatic recognition of epileptic seizures in the EEG. Electroencephalogr. Clin. Neurophysiol. 54:530–540, 1982. 3. Murro, A. M., King, D. W., Smith, J. R., Gallagher, B. B., Flanigin, H. F., and Meador, K., Computerized seizure detection of complex partial seizures. Electroencephalogr. Clin. Neurophysiol. 79:330– 333, 1991. 4. Qu, H., and Gotman, J., A patient-specific algorithm for the detection of seizure onset in longterm EEG monitoring: Possible use as a warning device. IEEE trans. Biomed. Eng. 44(2):115–122, 1997. 5. Weng, W., and Khorasani, K., An adaptive structure neural network with application to EEG automatic seizure detection. Neural Netw. 9(7):1223–1240, 1996. 6. Gotman, J., and Wang, L., State-dependent spike detection: Concepts and preliminary results. Electroencephalogr. Clin. Neurophysiol. 79:11–19, 1991. 7. Pradhan, N., Sadasivan, P. K., and Arunodaya, G. R., Detection of seizure activity in EEG by an artificial neural network: A preliminary study. Comput. Biomed. Res. 29:303–313, 1996. 8. Nigam, V. P., and Graupe, D., A neural-network-based detection of epilepsy. Neurol. Res. 26:55–60, 2004. 9. Viertio-Oja, H., Maja, V., Sarkela, M., Talja, P., Tenkanen, N., Tolvanen-Laakso, H., Paloheimo, M., Vakkuri, A., Yli-Hankala, A., and Merilainen, P., Description of the EntropyTM algorithm as applied in the Datex-Ohmeda S/5TM Entropy Module. Acta Anaesthesiol. Scand. 48:154–161, 2004. 10. Andrzejak, R. G., Lehnertz, K., Mormann, F., Rieke, C., David, P., and Elger, C. E., Indications of nonlinear deterministic and finite-dimensional structures in time series of brain electrical activity: Dependence on recording region and brain state. Phys. Rev. E 64:1–8, 2001. 11. Demuth, H., and Beale, M., Neural Network Toolbox (for use with Matlab), Mathworks, Natick, Massachusetts, 2000.
660
Srinivasan, Eswaran, and Sriraam
12. Srinivasan, V., Eswaran, C., and Sriraam, N., Epileptic detection using artificial neural networks. In Proceedings of the 7th Biennial International IEEE Conference in Signal Processing and Communications, 2004. 13. Kiymik, M. K., Subasi, A., and Ozcalik, H. R., Neural networks with periodogram and autoregressive spectral analysis methods in detection of epileptic seizure. J. Med. Syst. 28(6):511–522, 2004.