Interictal Epileptiform Discharge Classification for the Prediction of Epilepsy Type in Children

Epilepsy is a neurological condition characterised by recurrent seizures. EEG is the most important test in the evaluation of patients with epilepsy. This study presents a new technique for helping to classify the type of epilepsy from pediatric EEGs. The method utilises spectrograms and signal images from EEGs with interictal epileptiform discharges and classifies the type of epilepsy as either focal or generalised. The model was trained on EEGs from 281 children, with 135 having focal epilepsy and 146 having generalised epilepsy. For each of the 19 channels, spectrograms and signal images were generated and used as inputs for five pre-trained transfer learning models: Inception, ResNet, DenseNet, VGG16, and VGG19. The method attained 70.1% cases correctly in identifying generalized epilepsy, 63.2% for focal epilepsy, and a correct classification rate of 66.8% on an independent test set. The method holds great potential for classifying epilepsy types with satisfactory classification performance and assisting neurologists in analysing both focal and generalised epilepsy.


INTRODUCTION
Epilepsy is a condition of the nervous system that results in repeated seizures.It results in disturbed electrical patterns in the brain and a variety of clinical symptoms that vary depending on which areas of the brain are affected [11].
Electroencephalogram (EEG) is the most important test in the evaluation of patients with unprovoked seizures and epilepsy [13].EEG provides an overview of neuronal activity across different cortical regions [10].Epilepsy syndromes are classified as focal or generalised based on electroclinical features [12].Focal seizures originate within networks limited to one hemisphere; generalized seizures originate within and rapidly engage bilaterally distributed networks [2].Neurophysiologists interpret EEG by visual inspection of the recorded data and look for interictal (i.e. between seizures) abnormalities to help in the potential diagnosis and classification of epilepsy.Researchers have begun to focus on automatic detection methods to assist in EEG interpretation [21].
The majority of automatic methods proposed for identifying seizure and non-seizure events to date use machine learning algorithms [4,[15][16][17].In practice, most EEGs do not capture seizure events.The vast majority of EEGs recorded in clinical practice are "interictal", meaning that they record the waking or sleeping states in between seizure episodes.
Interictal epileptiform discharges (IEDs) are characteristic signal patterns recorded from scalp EEGs that have a high association with epileptic disorders.The distribution of IEDs at the scalp can assist in classifying an epilepsy syndrome [3,5].Very few papers have been presented to identify IEDs in EEG recordings automatically.Moreover, current methods for creating an automated algorithm for detecting IEDs do not take into account the various types of epilepsy.They only identify IED and non-IED events without distinguishing which type of epilepsy the IED events belong to.Classifying the type of epilepsy based on IEDs is even more challenging, and we have not yet found an automated method currently for this purpose.
This study introduces a novel method for classifying epilepsy types in pediatric EEGs with IEDs, eliminating the necessity for human annotations to label epochs containing IEDs or not.The method was trained on EEGs from 281 children, comprising 135 EEGs with focal epilepsy and 146 EEGs with generalised epilepsy.The input for the method was generated by creating spectrograms and signal images from each of the 19 EEG channels and feeding them into five pre-trained transfer learning models, namely Inception, ResNet, DenseNet, VGG16, and VGG19.The training process took approximately seven days using the dataset of 281 children.The resulting classifier is capable of delivering the classification output in about 10 seconds on a standard personal computer.

MATERIALS AND METHODOLOGY 2.1 CHI EEG Dataset
Ethical approval was granted from the Medical Research Ethics Committee of Our Lady's Children's Hospital Crumlin, Dublin, Ireland (GEN/617/17).The study involved 281 children with epilepsy, comprising 135 with focal epilepsy (Female=54; Male=81) and 146 with generalised epilepsy (Female=74; Male=72).The training was conducted using 80% of the EEGs obtained from these children, while the remaining 20% were used for validation.For testing, EEGs from 152 children with focal epilepsy (Female=62; Male=90) and 162 children with generalised epilepsy (Female=109; Male=55) were used.Details of the number and duration of EEG recordings used for both training and testing can be found in Table 1. Figure 1 shows examples of spectrogram and EEG signal images related to focal epilepsy and generalized epilepsy.

Channel Selection
The 10-20 system of electrode placement [6] was used to record the EEG (Figure 2).Nineteen channels were chosen to gather data from various brain regions as summarised in Figure 2.

Data Pre-processing
To remove powerline interference from the raw EEG signals, a 50 Hz notch filter was applied.A Butterworth filter, specifically an infinite impulse response, was utilised to obtain the target frequency band (0.1-64 Hz) in the CHI EEG recordings.For each EEG channel, we produced a signal image and spectrogram, with each signal image and spectrogram associated with either a child with focal epilepsy or a child with generalised epilepsy.

Method Development
The epilepsy type classification method was developed using five popular CNN architectures, namely Inception, ResNet, DenseNet, VGG16, and VGG19.These models were utilised as feature extractors, with the initial layers frozen and an input size of 256×256×3.The final output layer was removed, and two fully connected layers (128 and 64) were added, each with a rectified linear unit (ReLU) activation.To prevent overfitting and improve generalization ability, regularization (L2: 0.05) was employed [20].The output layer used sigmoid activation for epilepsy type classification, and the training optimiser employed the Adam method with a batch size of 64 [8].Each of the five models was trained for 100 epochs.Moreover, the early stopping technique was applied with a patience value of 20.
The method architecture is illustrated in Figure 3.

Post-processing
Our previous research [16] has revealed that not all channels undergo significant signal changes during an abnormal event.To address this issue, we employed a Multilayer Perceptron (MLP) to combine predictions from VGG16 across nineteen channels in the training set for each child.Subsequently, the MLP model was applied to the VGG16 output for the nineteen channels in the test set.By using this approach, the MLP model was able to classify EEG signal images and spectrograms as focal epilepsy or generalised epilepsy for children by leveraging multiple EEG channels.Figure 3 shows the architecture of our method.

Performance Evaluation
We evaluated our method using the Correct Generalized Rate (CG Rate) which represents the percentage of correctly identified generalised epilepsy cases, the Correct Focal Rate (CF Rate) indicating the percentage of correctly identified focal epilepsy cases, and the Correct Classification Rate (CC Rate) which signifies the percentage of correctly identified cases of both focal and generalized epilepsy. Where: •

DISCUSSION
Previous research has focused on identifying IEDs in normal EEG recordings [7,9,14], but this is challenging due to the presence of noise and artefacts that make it difficult to detect epileptiform discharges automatically.Kerr et.al [7] built an approach using a multilayer perceptron to classify 156 patients admitted for video-EEG monitoring.The patient population was diagnostically diverse: 87 were diagnosed with either generalised or focal seizures, and 69 were diagnosed with nonepileptic seizures.They obtained a sensitivity of 92.0%.Tjepkema [14] implemented several combinations of convolutional and recurrent neural networks to determine the probability of the presence of epileptiform discharges in EEGs.The study utilised 50 EEGs from patients with focal epilepsy and 50 normal EEGs.Their method was able to detect epileptiform discharges with a sensitivity of 47.4% and specificity of 98.0%.These methods divided the EEGs into epochs, with each epoch corresponding to an IED event or a non-IED event.These methods are trained and tested using epochs that may belong to the same person in both the training and test sets, which may cause overfitting.
To avoid overfitting, Lourenco et al. [9] developed a VGG network trained on 2-s EEG epochs obtained from patients with focal and generalised epilepsy (39 and 40 patients, respectively) and 53 healthy controls.They trained and tested their model on EEG data from different individuals without overlap, and achieved 99.0% specificity and 79.0% sensitivity on the independent test set.However, this method requires EEG recordings to be segmented into epochs and relies on the manual annotation of IEDs within those epochs, which is a time-consuming and labour-intensive process.In this study, we developed an automatic method to classify the types of epilepsy based on IEDs of EEGs in children without the need for human annotations.
The performance of transfer learning models based on spectrograms and signal images on the training, validation, and test sets is presented in Table 2.The spectrogram-based VGG16 model achieved a correct classification rate of 55.9% on the test set, while  the signal image-based VGG16 model achieved 57.6% without postprocessing.However, not all channels experience significant signal changes during abnormal events [16,18].Therefore, we combined the results of multiple channels using MLP on the training set and applied the trained MLP model on the test set.Table 3 shows that after applying the MLP algorithm to only the spectrogram, the correct classification rate improved by 7% (from 55.9% to 62.0%), and for only the signal image, the correct classification rate improved by 6% (from 57.6% to 63.3%) on the test set.However, certain events were visible in EEG but not in spectrograms [19], which can affect the performance.Therefore, it is better to consider the EEG signals in both the time and frequency domains.We combined the results of the training set using MLP post-processing across multiple channels for both spectrogram and signal image-based transfer learning models, resulting in a significant improvement of the correct classification rate within the test set of approximately 10% (increasing from 55.9% and 57.6% to 66.8%) compared to the outcomes obtained without post-processing for the spectrogram-based and signal image-based models.
The present study has some limitations.The learning models have shown some capacity to distinguish focal from generalized epilepsy types.Sub-classification of focal and generalized epilepsy syndromes was not carried out within our dataset.Therefore it is unknown whether the learning model may perform better for some epilepsy syndromes (e.g.childhood absence epilepsy) than for others.Another limitation is in terms of the lack of explainability for the predictions made by the transfer learning-based epilepsy type classification method.Nevertheless, to assist clinicians in verifying IEDs in the frequency and time domain, we have provided visualisations of the spectrogram and signal image for each EEG channel (Figure 1).In future work, we aim to investigate explainable AI techniques [1] to gain a better understanding of the rationale behind the method's predictions and to establish trust with clinicians.

CONCLUSIONS
This study introduces an automated method for classifying epilepsy types on multiple channels of paediatric EEGs.The method utilises five commonly used CNN architectures (Inception, ResNet, DenseNet, VGG16, and VGG19) trained to classify epilepsy types based on EEG spectrograms and signal images.Unlike traditional methods that require feature estimation by domain experts, this approach can automatically identify epilepsy types based on IEDs without manual annotation of EEGs.This method holds some potential for automated classification of focal and generalized epilepsy syndromes using EEG data.

Figure 1 :
Figure 1: Examples of the spectrogram and EEG signal images of focal epilepsy and generalised epilepsy on channel F8.

Figure 3 :
Figure3: Overview of the transfer learning-based epilepsy type classification method.Firstly, powerline interference was eliminated using a 50 Hz notch filter for EEGs.Then, a Butterworth filter was applied to obtain the signal within the frequency range of 0.1 -64 Hz.Subsequently, the filtered signal from each channel was transformed into a signal image and spectrogram, and these were then fed into the VGG16 model.The post-processing stage utilised an MLP on the 19 channels to derive the final result.The output indicates whether the EEG belongs to a child with focal epilepsy or a child with generalised epilepsy.The classification system is binary, where 0 denotes the child with focal epilepsy and 1 represents the child with generalised epilepsy.

Table 1 :
Number and duration of EEG recordings used in this study.
True Generalised Epilepsy (TG): the number of children with generalised epilepsy predicted as children with generalised epilepsy • False Generalised Epilepsy (FG): the number of children with focal epilepsy predicted as children with generalised epilepsy • True Focal Epilepsy (TF): the number of children with focal epilepsy predicted as children with focal epilepsy • False focal Epilepsy (FF): the number of children with generalised epilepsy predicted as children with focal epilepsy

Table 2 :
Correct classification rate of spectrogram-based and signal image-based transfer learning models on the training, validation and test set.

Table 3 :
Performance of the application of the post-processing method on VGG16 model using the MLP on the test set.