Derivative parameters of electroencephalograms and their measurement methods

. The derivative parameters of electroencephalogram (EEG): baseline, upslope, downslope and width of EEG spikes are analysed in this work. Automatic methods of their measurement are presented. Validation of discussed parameters against their possible range (provided by neurologists) lets us to exclude some falsely positively detected spikes thus improving accuracy of the spike detection algorithm. These parameters might have some correlation between them and diagnosis of the patients.


Introduction
Benign childhood epilepsy with centrotemporal spikes (rolandic epilepsy RE) is the most common focal onset epilepsy in childhood. It is characterised by brief, simple, partial orofacial motor and/or sensory seizures, with or without secondary generalization. About 50% of seizures generalize secondarily. Seizures most often occur during sleep or upon awakening. Interictal electroencephalograms (EEG) usually show centrotemporal spikes (other brain regions may also be involved), often followed by slow waves. Spikes are activated by sleep and tend to shift from side to side.
The EEG hallmark of rolandic epilepsy is the rolandic discharge (RD) -sharpslow wave or spike detected over the centrotemporal brain regions (T3, T4, C3, C4 regions). Spikes, spike-wave complexes usually are high amplitude. In the majority of patients Rolandic sharp waves are located in centrotemporal regions, but other regions as central, centroparietal or centrofrontal, can also be involved. Atypical extracentrotemporal epileptiform discharges are detected in 17-21% of cases. The presence of RDs has to be find in order to diagnose RE in children with typical rolandic seizures. The sharp-slow wave morphology exhibits considerable stability within individuals, but amplitude and frequency of the RD are variable and changes during the course of the disease. Frequency of RD increases during the slow sleep remarkably. Rolandic discharges could be located in groups or as single graphoelements [12,9,1]. The topographical occurrence can change over time. A reliable identification of RD requires an experienced professional.
Rolandic discharges seem not to be pathognomonic of RE and may represent both a functional focus [2] and an expression of a focus secondary to an organic brain damage. BothBenign childhood epilepsy with centro-temporal spikes (BCECTS) and symptomatic partial epilepsy (SPE) with a lesion in rolandic area may present with rolandic discharges [7]. Rolandic spikes as an electroencephalography manifestation of oligodendroglioma was reported [4]. Patients presenting with peribuccal seizures, normal neurologic examinations, and EEG data initially suggestive of Rolandic epilepsy found to have focal lesions on neuroimaging were described [11].
The electro-clinical characteristics of sylvian seizures could be rolandic discharge in patients with symptomatic partial epilepsies. The morphological data of RD were investigated in order to find differences between idiopathic and symptomatic focal epilepsy EEG. Medeiros et al. [7] analyzed patients divided into two groups: those with benign childhood epilepsy with centrotemporal spikes (rolandic epilepsy) and symptomatic partial epilepsy (SPE), following ILAE criteria (1989). The EEG data analyzed were: horizontal dipole discharges, double spike phenomenon, the extension of epileptiform discharges and background activity. There was a predominance of horizontal dipole between patients with BCECTS compared with patients with SPE; however, this difference was not statistically significant. The slower background activity in the SPE group was the only variable with statistical significance. This study revealed similarities between rolandic discharges of two different epilepsy groups, as they are related to the area of the discharges and not to the epileptic syndrome itself [7].
It is important to identify RD during the investigation of the patients EEG in suspected Rolandic epilepsy, because it is important part of the diagnosis making. The EEG features which point to symptomatic focal epilepsy are: • background EEG abnormalities; • presence of unusual fast activity; • morphological modification of the centrotemporal spikes during sleep; • enhancement of slow waves following the spike/recurrence of spikes in trains; • intermittent slow-wave focus; • frontalization of the spikes.
Looking directly to the discharge, it is no clear differences of "true" RD in idiopathic epilepsies and spikes or sharp-waves looking like RD in perisylvian symptomatic focal epilepsies. We decided to analyse rolandic epileptiform discharges using mathematical methods. We compared rolandic spikes/sharp waves in idiopathic rolandic epilepsy and rolandic like discharges in symptomatic focal epilepsy in patients with cerebral palsy.
In our previous work [8] we discussed the improvements of spike detection algorithm itself as described in [3]. However the detection algorithm still has some flaws, some of these we address here. The detection algorithm itself is based on mathematical morphology and is heavily dependent on parameters like detection limit [8], so we improved on that by employing post-processing -evaluating metrics (for details see Section 1) of each detected spike and validating results against margins provided by neurologists (for details see Section 2).
The presented (in this work) measurement methods (of derivative parameters of EEG) have been implemented employing Python 2.7.10 programming language and libraries like Matplotlib, NumPy, SciPy, OpenCV, Eegtools and some others described in [8]. The data for testing were provided by The Childrens Hospital, Affiliate of Vilnius University Hospital Santariskiu Klinikos department of Neurology in EDF [6] and EDF+ [5] formats.

Determining main metrics of EEG spike
In order to evaluate main metrics of EEG spike a few intermediate parameters are calculated. We are going to deal with such metrics of EEG spike as baseline, upslope, downslope and width (defined further). In order to evaluate the upslope and the downslope, we need to calculate the baseline (which is used to calculate the maximum and half maximum of the spike) first. The baseline is calculated by averaging signal values from timespan about of about 50% of total spike duration before the spike and from timespan about of about 50% of total spike duration after the spike, leaving 5% seconds before the maximum and 20% seconds after the maximum out of the calculation in order to take out the bias of spike itself on the signal baseline. The baseline itself is not present in output of algorithm, but us used to determine other metrics. Arbitrary lengths of timespans are chosen as an experimental result, this value seems to give a good sample of evaluation baseline and still does not have too big probability to contain other spikes and artefacts, which could skew the results. Using too short section of signal results in worse results due to signal noise not being averaged out, too long -in results skewed by signal artefacts and other peaks. EEG spikes usually are found in multiple channels, but are analysed in channel where they are strongest. Our algorithm analyses spikes in channel where it finds most spikes, it is done because in other channels where spikes are not as clearly visible it tends to have lower sensitivity and omit some of the spikes, what makes that channel having the most detections as well. The maximum value of spike is simply either max or min value of the signal within (−0.05/+0.05) seconds within the spike detected. This interval is chosen because the sharp wave of spike lasts up to 0.1 seconds. Then these values are used in calculating the width of peak in half maximum. The spike characteristics detection schema is shown in Fig. 1. The width in half maximum is chosen for a few reasons. First of them is that measuring width of the peak at the baseline of peak is inaccurate: it is impossible to accurately determine the exact ending and starting place of the spike, because it is affected by noise and background activity of the brain. This is a common practice in other fields working with noisy signals, for example stellar spectroscopy. The width of peak in half maximum height basically represents the same parameter as width near bottom and is less affected by noise and other signal artefacts.
After that the slopes of EEG spike are calculated. Slope is calculated by fitting line using least squares method to the EEG spike. Upslope is calculated by fitting line to part of EEG spike before maximal value, which is less than 20 percent of maximum spike value and more than baseline plus 4 times variance of signal. Calculation of downslope is done in almost the same way except the part after the EEG spike is taken for it.

Post-processing of spike detection
Calculation of parameters described parameters helped on improving the initial EEG spike detection algorithm. Some falsely positively detected spikes were rejected on basis of calculated EEG spike parameters not being valid. Parameters are validated to have logical values and to be within meaningful medical range of these parameters like described in medical literature [10]. These parameters are length of sharp wave is between 40 and 80 ms, length of the slow wave is between 80 and 200 ms, absolute value of upslope should always be larger than absolute value of downslope, maximum value of the spike should be at least two times higher than background noise. The spike is rejected if average distance to baseline is greater than 100 µV, it usually means that even if spike is detected correctly the ability to measure its parameters is impeded by artefacts nearby it, so it is rejected from further analysis as well. Examples of spikes rejected are presented in Fig. 3. The EEG spike parameter detection algorithm was tested on 89 real patient EEG signals. The detected spike validation by values of its parameters rejects from 60 to 80% of falsely positively detected EEG spikes (depending on patient) thus increasing the overall specificity of the detection algorithm. The false positive detection rate of algorithm is between 10 and 30% depending on patient and detection limit parameter. This allows us to set detection limit more aggressively to increase sensitivity while maintaining specificity because false positive detections can be eliminated during post processing. 3 to 5% of correctly detected spikes are rejected as well formally decreasing the sensitivity of the algorithm as well, but usually these spikes are affected by noise or other artefacts making them less useful in further analysis, so this small decrease in sensitivity would not change our results in future work.
It should be noted that from Fig. 2(b) slopes of slow wave (between 0.05 and 0.15 seconds) can be separated but most of the time that is not the case. Usually these slopes are significantly affected by noise and background brain activity, more like in Fig. 2(a) and carry simmilar medical information to slopes of the sharp wave (upslope and downslope from Fig. 1) so we do not analyse them in this study. Upslopes and downslopes give us the same information with much better accuracy.

Results and conclusions
This work has two important results. First, methods (and their software implementation) for evaluating derivative parameters (for all detected EEG spikes such metrics as baseline, upslope, downslope, width are estimated) of EEG have been proposedsee Section 1. Second, we have improved accuracy of previously presented EEG spikes detection algorithm [3,8]. (by post-processing detected spikes, validating these derivative parameters against their meaningful medical range [10], see Section 2. We expect that future analysis (applying machine learning type methods) of discussed derivative parameters of EEG will benefit to automatic differentiation of patients, diagnosed with various central nervous system illnesses (e.g. rolandic epilepsy, symptomatic focal epilepsy, symptomatic focal epilepsy in patients with cerebral palsy and other illnesses, characterised by epileptoform EEG discharges).