Deep learning-based real-time seizure detection and multi-seizure classification on pediatric EEG
Hyewon Jeong, Kwanhyung Lee, Seyun Kim, Hoon-Chul Kang, Donghwa Yang

TL;DR
This paper presents a deep learning method for real-time seizure detection and classification in pediatric EEG data.
Contribution
A novel deep learning model combining ResNet and LSTM for real-time seizure detection and multi-class classification in pediatric patients.
Findings
ResNet with LSTM achieved an AUROC of 0.98 and APROC of 0.73 for real-time seizure detection.
ResNet50 without frequency bands feature extraction achieved 0.99 AUROC and 0.99 APPRC for multi-class seizure classification.
Abstract
To develop a reliable and accurate seizure detection method using deep learning models capable of detecting and classifying multiple seizure types in real time. We retrospectively collected electroencephalography (EEG) recordings, which were acquired as part of routine diagnostic tests for patients aged 3 months to ≤18 years of age with childhood absence epilepsy, infantile epileptic spasms syndrome, other generalized epilepsy, and focal epilepsy, between January 2018 and December 2022 at Severance Children’s Hospital. We used EEG recordings from both seizure and non-seizure patients, which were downsampled to 200 Hz for real-time seizure detection and multi-classification. Of the 199 patients (620 seizures), 49 (297 seizures) belonged to the childhood absence epilepsy group, 16 (200 seizures) to the infantile epileptic spasms syndrome group, 14 (76 seizures) to other generalized…
Genes, proteins, chemicals, diseases, species, mutations and cell lines named across the full text — each resolved to its canonical identifier and authoritative record.
Click any figure to enlarge with its caption.
Figure 1
Figure 2| Variables | Total ( | Normal ( | CAE ( | IESS ( | Generalized ( | Focal ( |
|---|---|---|---|---|---|---|
| Sex, male | 89 (44.7) | 50 (49.5) | 13 (26.5) | 10 (62.5) | 8 (57.1) | 8 (42.1) |
| Age at diagnosis, year | 7.7 (5.2–9.7) | 8.8 (12.3–14.7) | 7.5 (5.5–8.6) | 0.6 (0.5–0.9) | 10.6 (7.9–13.0) | 12.4 (9.4–15.8) |
| Age at seizure onset, year | 5.5 (1.9–7.6) | - | 6.2 (4.9–7.6) | 0.6 (0.4–0.8) | 2.2 (1.1–7.4) | 8.1 (4.0–9.4) |
| Normal brain MRI findings | 28 (51.9) [54]b | - | 5 (100.0) (5) | 8 (50.0) | 8 (57.1) | 7 (36.8) |
| Number of ASM | 2 (2–4) | - | 2 (1–2) | 2 (2–4) | 4 (4–5) | 4 (3–4) |
| Group | Dataset type | Number of patients | Negative length (sec) | Positive length (sec) | Average event length (sec) | Number of seizure |
|---|---|---|---|---|---|---|
| Normal | Train | 81 | 136,110 | 0 | N/A | N/A |
| Test | 20 | 34,830 | 0 | N/A | N/A | |
| CAE | Train | 40 | 55,377 | 2,402 | 9.2 | 262 |
| Test | 9 | 12,134 | 376 | 10.74 | 35 | |
| IESS | Train | 13 | 88,304 | 157 | 0.95 | 166 |
| Test | 3 | 17,600 | 33 | 0.98 | 34 | |
| Generalized | Train | 12 | 29,313 | 532 | 7.95 | 67 |
| Test | 2 | 3,552 | 77 | 8.61 | 9 | |
| Focal | Train | 16 | 51,506 | 3,358 | 83.96 | 40 |
| Test | 3 | 10,397 | 814 | 116.33 | 7 |
| Window Size (Seconds) | 4 | 12 | |||||
|---|---|---|---|---|---|---|---|
| Models | Seizure type | AUC (std) | APR (std) | F1 (std) | AUC (std) | APR (std) | F1 (std) |
| CNN2D + LSTM | Any | 0.9727 (0.00) | 0.7027 (0.04) | 0.6399 (0.05) | 0.9687 (0.00) | 0.7031 (0.04) | 0.6641 (0.06) |
| CAE | 0.9888 (0.00) | 0.9743 (0.01) | 0.9092 (0.02) | 0.9952 (0.00) | 0.9873 (0.00) | 0.9445 (0.00) | |
| IESS | 0.8721 (0.01) | 0.5552 (0.02) | 0.2246 (0.05) | 0.7988 (0.05) | 0.6317 (0.05) | 0.3708 (0.09) | |
| Generalized | 0.8347 (0.05) | 0.648 (0.04) | 0.313 (0.09) | 0.8117 (0.04) | 0.6371 (0.03) | 0.3092 (0.04) | |
| Focal | 0.953 (0.02) | 0.9029 (0.03) | 0.7432 (0.03) | 0.9394 (0.02) | 0.8933 (0.04) | 0.7432 (0.07) | |
| ResNet-short + LSTM | Any | 0.9684 (0.00) | 0.6884 (0.04) | 0.6468 (0.02) | 0.9799 (0.00) | 0.7302 (0.03) | 0.6746 (0.02) |
| CAE | 0.9877 (0.00) | 0.9684 (0.01) | 0.9113 (0.01) | 0.9945 (0.00) | 0.9826 (0.01) | 0.9345 (0.02) | |
| IESS | 0.7955 (0.04) | 0.5282 (0.01) | 0.1368 (0.02) | 0.7454 (0.04) | 0.5594 (0.03) | 0.2461 (0.05) | |
| Generalized | 0.757 (0.09) | 0.6103 (0.03) | 0.2643 (0.05) | 0.8578 (0.03) | 0.7151 (0.04) | 0.4661 (0.07) | |
| Focal | 0.957 (0.01) | 0.9122 (0.01) | 0.782 (0.02) | 0.9463 (0.02) | 0.8954 (0.05) | 0.746 (0.1) | |
| ResNet-short+Dilation + LSTM | Any | 0.9679 (0.01) | 0.6855 (0.02) | 0.6497 (0.03) | 0.9678 (0.01) | 0.7227 (0.04) | 0.6643 (0.04) |
| CAE | 0.9891 (0.00) | 0.9578 (0.03) | 0.887 (0.05) | 0.994 (0.00) | 0.9766 (0.02) | 0.9083 (0.08) | |
| IESS | 0.8229 (0.03) | 0.5344 (0.01) | 0.6813 (0.03) | 0.7285 (0.03) | 0.5487 (0.02) | 0.222 (0.04) | |
| Generalized | 0.7575 (0.05) | 0.6192 (0.03) | 0.3219 (0.05) | 0.836 (0.01) | 0.6607 (0.04) | 0.3616 (0.05) | |
| Focal | 0.9544 (0.5) | 0.9084 (0.03) | 0.775 (0.05) | 0.9576 (0.01) | 0.926 (0.03) | 0.806 (0.07) | |
| MobileNetV3-short + LSTM | Any | 0.9675 (0.00) | 0.6921 (0.05) | 0.6415 (0.05) | 0.9627 (0.02) | 0.6724 (0.07) | 0.6264 (0.06) |
| CAE | 0.9881 (0.00) | 0.9724 (0.00) | 0.8992 (0.01) | 0.9932 (0.00) | 0.9785 (0.01) | 0.9155 (0.02) | |
| IESS | 0.7597 (0.06) | 0.5243 (0.02) | 0.113 (0.03) | 0.6411 (0.12) | 0.5404 (0.04) | 0.18 (0.06) | |
| Generalized | 0.7735 (0.04) | 0.6183 (0.02) | 0.2975 (0.04) | 0.8094 (0.09) | 0.6626 (0.08) | 0.36 (0.13) | |
| Focal | 0.9684 (0.03) | 0.9272 (0.02) | 0.7902 (0.05) | 0.9594 (0.09) | 0.9136 (0.08) | 0.8092 (0.06) | |
| Extractor type | Raw | Frequency bands | |||||
|---|---|---|---|---|---|---|---|
| Models | Type | AUC (std) | APR (std) | F1 (std) | AUC (std) | APR (std) | F1 (std) |
| CNN2D + LSTM | CAE | 0.9976 (0.0032) | 0.996 (0.0056) | 0.9805 (0.0204) | 0.8865 (0.0627) | 0.8859 (0.0609) | 0.8375 (0.0475) |
| IESS | 1.0 (0.0) | 1.0 (0.0) | 0.9886 (0.0165) | 0.9991 (0.0018) | 0.9986 (0.0028) | 0.9649 (0.0433) | |
| Generalized | 0.8807 (0.1231) | 0.7258 (0.1372) | 0.7844 (0.1401) | 0.9789 (0.0257) | 0.8799 (0.0937) | 0.8187 (0.1544) | |
| Focal | 0.9517 (0.034) | 0.7954 (0.0847) | 0.77 | 0.9571 (0.0422) | 0.6788 (0.2759) | 0.7028 (0.1542) | |
| Weighted | 0.9824 (0.0124) | 0.9525 (0.0145) | 0.9457 (0.0269) | 0.9471 (0.0295) | 0.9132 (0.0497) | 0.8754 (0.0429) | |
| ResNet50 | CAE | 0.9944 (0.007) | 0.9937 (0.0071) | 0.9827 (0.0141) | 0.98 (0.032) | 0.9429 (0.049) | 0.9574 (0.0083) |
| IESS | 1.0 (0.0) | 1.0 (0.0) | 0.9772 (0.0168) | 0.9955 (0.0046) | 0.9913 (0.0098) | 0.9646 (0.0151) | |
| Generalized | 0.9904 (0.0144) | 0.9646 (0.0381) | 0.9128 (0.0774) | 0.9915 (0.0156) | 0.9323 (0.1255) | 0.926 | |
| Focal | 0.9934 (0.0099) | 0.9706 (0.0385) | 0.9313 (0.0731) | 0.97 (0.0565) | 0.9634 (0.0513) | 0.936 | |
| Weighted | 0.9961 (0.0035) | 0.9912 (0.007) | 0.9689 (0.0177) | 0.98 (0.0148) | 0.9628 (0.0198) | 0.9552 (0.0139) | |
| MobilenetV3 | CAE | 0.9919 (0.0094) | 0.9919 (0.0078) | 0.9654 (0.0226) | 0.9656 (0.0351) | 0.9505 (0.0468) | 0.8576 (0.0517) |
| IESS | 0.9999 (0.0002) | 0.9998 (0.0003) | 0.9799 (0.0187) | 0.9957 (0.0065) | 0.9886 (0.0194) | 0.9942 (0.0071) | |
| Generalized | 0.9921 (0.0095) | 0.9403 (0.0747) | 0.8307 (0.1389) | 0.9912 (0.0111) | 0.9204 (0.1109) | 0.8006 (0.1248) | |
| Focal | 0.9989 (0.0015) | 0.9901 (0.0129) | 0.8416 (0.0636) | 0.9971 (0.0025) | 0.9748 (0.018) | 0.6833 (0.127) | |
| Weighted | 0.9957 (0.0039) | 0.9894 (0.0081) | 0.9468 (0.0263) | 0.9829 (0.016) | 0.9645 (0.0297) | 0.8918 (0.0414) | |
| DenseNet | CAE | 0.929 (0.0563) | 0.9433 (0.0423) | 0.9456 (0.0333) | 0.9846 (0.0082) | 0.978 (0.0126) | 0.9445 (0.041) |
| IESS | 0.9969 (0.0047) | 0.9939 (0.0098) | 0.985 (0.0235) | 0.9964 (0.0019) | 0.9943 (0.0033) | 0.9337 (0.0393) | |
| Generalized | 0.9278 (0.0495) | 0.6919 (0.0677) | 0.852 (0.0482) | 0.8012 (0.0793) | 0.5004 (0.1595) | 0.6506 (0.123) | |
| Focal | 0.9886 (0.0128) | 0.9165 (0.0938) | 0.766 (0.114) | 0.9993 (0.0015) | 0.9937 (0.0127) | 0.898 (0.0749) | |
| Weighted | 0.961 (0.023) | 0.9347 (0.0251) | 0.9367 (0.0215) | 0.9711 (0.0096) | 0.9352 (0.0177) | 0.9052 (0.0352) | |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsEEG and Brain-Computer Interfaces · Epilepsy research and treatment · Neonatal and fetal brain pathology
Introduction
Since the advent of several powerful modern machine learning and deep learning models, several attempts have been made to detect seizures and abnormal waves in electroencephalography (EEG) signals (1–5). More recent studies have demonstrated the performance of advanced tasks such as multi-class seizure detection (6–10), and real-time seizure detection (11–15). Although previous studies have explored multiple model architectures for seizure detection and classification, certain limitations make their direct use in neurology wards challenging. First, very few studies were designed for real-time seizure detection (11, 12), which limits their practical application. Moreover, several recent studies have focused on classifying pre-cut seizure signals, which is an approach with limited applicability in real-world clinical settings for seizure detection (16–18). Real-time seizure detection and classification are invaluable as timely identification allows for immediate intervention, which potentially aids in mitigating the severity of the episode. Furthermore, it also helps in preventing further complications and swift adjustment of treatment strategies (19).
The performances of several previous seizure detection models (1–5) have only been evaluated using public benchmark datasets (12, 20–23). Furthermore, the reported model performances could not be fairly compared with each other as they used distinct experimental settings and evaluation metrics until Lee et al. (11) proposed a comprehensive analysis of seizure detection in real-time setting.
Developing and deploying real-time seizure detectors and classifiers is crucial for the diagnosis and treatment of patients with epilepsy. Seizure events of patients are routinely monitored with 24 h inpatient video-EEG recordings. Onset of seizure is usually recorded by pressing the button when the family members notice the onset of ictal period that could be of noticeable clinical importance. However, several event onsets are prone to be missed on-site. This might be due to the fact that medical associates cannot always monitor the EEG signals. Moreover, even family members cannot always notice the onset of seizures for some types of seizures which have subtle clinical symptoms, such as infantile epileptic spasms syndrome.
This study aimed to investigate the applicability of our deep learning-based real-time seizure detection model to real-world pediatric EEG datasets and validate its generalizability for multiple seizure classifications. We used the models from the study by Lee et al. (11), that showed promising results for real-time seizure detection tasks when applied to public adult EEG data with seizure events.
In this study, the models constructed for real-time seizure detection incorporated the architectures of Convolutional Neural Networks (CNN) and autoregressive layers. The configurations included were CNN2D + Long-Short Term Network (LSTM), ResNet-short+LSTM, ResNet-short+Dilation+LSTM, and MobileNetV3-short+LSTM. Moreover, for the multi-class classification task, we explored multiple CNN baselines such as ResNet50, MobilenetV3, and DenseNet. We extended the binary real-time seizure detection of Lee et al. (11) to multi-seizure classification tasks, and evaluated the performance of the two tasks on pediatric EEGs within a cohort of four types of seizures: Childhood Absence Epilepsy (CAE), Infantile Epileptic Spasms Syndrome (IESS), Generalized Epilepsy (GN), and Focal Epilepsy (FC). The study findings would exemplify the applicability and generalizability of our approach for readily applicable deep learning-based real-time seizure detection and multi-seizure classification.
Materials and methods
Study population
This study was performed at the epilepsy clinic of Severance Children’s Hospital between 2018 and 2022, and included patients under the age of 18 years with seizures. The inclusion criteria were: (1) patients diagnosed with CAE, IESS, other generalized epilepsy, and focal epilepsy; and (2) those who had seizures during EEG. We excluded patients who did not have seizures during EEG recording. In addition, we obtained EEG records from patients with headache who did not have any seizure episodes, and designated them as the negative control group.
All the procedures in this study were performed in accordance with the tenets of Declaration of Helsinki. The study was approved by the Institutional Review Board of Severance Hospital (IRB 4–2023-0967).
Data collection
We reviewed the patients’ medical records and collected data regarding age of seizure onset, age at the time of diagnosis, brain magnetic resonance imaging (MRI) findings, number of anti-seizure medications, EEG findings, and raw EEG data. First, we analyzed EEG data from patients diagnosed with CAE, IESS, other generalized epilepsy, and focal epilepsy, ensuring that their seizures were captured during the EEG recordings. Following this, two pediatric neurologists annotated the data, marking the onset times of seizures for each patient.
Dataset preprocessing
We developed a Python program that utilized the Minimum-norm estimation (MNE) open-source package to facilitate preprocessing and extraction of EEG data from files with edf extensions. To implement real-time seizure detection, our first step involved identifying specific seizure periods (Figure 1a, Step 1). Subsequently, we bracketed each seizure period with up to 1 h of non-seizure period on either side of the identified seizure. These data were then segmented into non-overlapping multiple 30 s intervals of EEG signals, which formed the basis for our training set (consistent with routine EEG page durations and to provide sufficient temporal context around ictal transitions). We excluded EEG signal data chunks with lengths of less than 30 s. To streamline the training process for real-time detection, we randomly chose a maximum of ten 30 s non-seizure intervals per one 30 s seizure interval.
Schematic illustration of (a) seizure signal preprocessing and real-time seizure detection (b: Step 1), multi-class seizure classification process (b: Step 2). (a) Preprocessing for seizure detection and classification. We segmented the entire seizure signal into shorter 30 s segments, creating a chunked dataset. Additionally, for multi-class classification, the dataset included up to 30 s of non-ictal period prior to the seizure onset (total up to 120 s), enriching the model with valuable pre-ictal signal information. (b) Two-stage seizure detection and classification. We identify the seizure using the sliding window (Step 1: real-time seizure detection) and classified the detected seizures into one of the multiple possible types (Step 2: multi-class classification).
For multi-seizure classification, we identified the specific time frames during which the seizures occurred. To gather information regarding transition from non-seizure to seizure periods, we encapsulated the identified seizure segments with non-seizure durations. These comprised non-ictal periods of a maximum of 30 s before and up to 5 s after each identified maximum 120 s seizure episode. In cases where the non-ictal period preceding the targeted seizure period was shorter than 30 s due to a previous seizure or absence of a previous recording, the maximum possible non-ictal period was collected for multi-class seizure classification input. For EEG signals extending beyond 120 s, we confined our analysis to the initial 120 s. Separately, for multi-class seizure classification task, we defined the input seizure EEG signal to be ≤ 120 s, as we were more concerned about classifying seizure types than fast real-time detection.
For both real-time seizure detection and multi-seizure classification, we sampled raw EEG recordings at a sampling rate of 200 Hz, the lowest frequency recorded in our pediatric patient population. We used double banana montage that included transverse montage added to bipolar montage. This montage included the following electrode pairs: ‘fp1-f7’, ‘fp2-f8’, ‘f7-t3’, ‘f8-t4’, ‘t3-t5’, ‘t4-t6’, ‘t5-o1’, ‘t6-o2’, ‘t3-c3’, ‘c4-t4’, ‘c3-cz’, ‘cz-c4’, ‘fp1-f3’, ‘fp2-f4’, ‘f3-c3’, ‘f4-c4’, ‘c3-p3’, ‘c4-p4’, ‘p3-o1’, ‘p4-o2’, ‘fz-cz’, and ‘cz-pz’. Differences between the signals from two adjacent leads were extracted to obtain these electrode pairs. The amplitude of each seizure was normalized on the basis of minimum and maximum values of training data signals.
For our main result, we did not further use signal feature extractors. This was due to the fact that Lee et al. (11) demonstrated that the seizure detection model that used raw dataset without any signal feature extractors performed at par with those with signal feature extractors. We also tested the Frequency Bands feature extractor introduced by Lee et al. (11), specifically for multi-seizure classification tasks. The extractor averaged the signal data within the frequency ranges of 1–4, 4–8, 8–12, 12–30, 30–50, 50–70, and 70–100 Hz. According to Lee et al. (11), this extractor achieved the second fastest processing speed and showed a relatively high seizure detection performance among the five feature extractors. For real-time seizure detection, the model obtained an input of 30 s signal data at each epoch, wherein a shorter sliding window shift. We explored the performance of four different models with 4 s (11) and 12 s (11, 24) sliding window lengths and 1 s window shift length. With a 1 s window shift, the per-window inference time of the detection models has been shown to remain well below the update interval in prior work (11), making the proposed framework suitable for online (closed-loop) seizure detection. For a multi-class classification task, the model obtained the entire cropped signal chunk with the label for the whole signal, indicating whether an input chunk included each corresponding seizure type.
Each input window was labeled with a categorical seizure label for multi-class seizure classification. Each window was labeled with five categorical labels according to the International League Against Epilepsy (ILAE) classification: (25) normal signals, CAE, IESS, GN, and FC. The data processing steps explained in this section followed the same settings as those in our previous study (11).
Model specification
We extensively compared the performance of the models for real-time seizure detection and multi-class seizure classification tasks. For real-time detection networks, we adopted the model code and training loop of real-time seizure detection from a previous study (11) (https://github.com/AITRICS/EEG_real_time_seizure_detection). Among the 15 models tested by Lee et al. (11), we selected four lightweight and fast models (CNN2D + LSTM, ResNet-short+LSTM, ResNet-short+Dilation+LSTM, and MobileNetV3-short+LSTM) that were at par with the best performing model. All models implemented for real-time seizure detection integrated the architecture of CNN with autoregressive models, as illustrated in Figure 1b.
For multi-class seizure classification, the following four models were tested: CNN2D + LSTM (11), ResNet50 + Conv2D, DenseNetV3 (26), and MobileNetV3 (27). We adapted these models from their original designs with minor alterations to the CNN modules, specifically employing a one-dimensional filter for improved signal information extraction. The training process utilized a batch size of 16 and was trained for 20 epochs using the Adam optimizer with a learning rate sweep ranging between 1e^(−3) - 1e^(−5). The model was optimized using binary cross-entropy loss function for real-time seizure detection, and cross-entropy loss for multi-classification tasks.
Model evaluation
To evaluate the model’s performance, we conducted 5-fold cross-validation and calculated the average Area Under the Receiver Operator Curve (AUROC) and Area under the Precision Recall Curve (AUPRC) scores. We evaluated the performance of each experimental setting and model by comparing their performances. The models were evaluated using the scikit-learn module (28).
Results
Baseline characteristics
A total of 98 patients were diagnosed with epilepsy and treated with anti-seizure medications between 2018–2022. One hundred and one patients with headache had normal EEG findings and were classified as the negative control group. Finally, 199 patients were included in this study.
The median age of the patients at the time of diagnosis was 7.7 years [interquartile range, (IQR) 5.2–9.7], and the study population comprised 89 males (44.7%). Twenty-eight (51.9%) of the 54 patients had normal brain MRI findings. The IESS group was the youngest at the time of onset of seizures, and the proportion of female patients with CAE was high. There were no significant differences among the four groups in terms of baseline characteristics, including the number of anti-seizure medications (Table 1).
EEG dataset for seizure detection and multi-class seizure classification
We have summarized the number of patients, length of the negative signal (negatively labeled for seizures, i.e., a signal without seizure events), and positive signal (signal labeled positive to contain seizure events) for each seizure type in Table 2. We included a total of 199 patients, including 101 healthy individuals, 98 patients with childhood epileptic seizure (620 seizures), 49 with CAE (297 seizures), 16 with IESS (200 seizures), 14 with GN (76 seizures), and 19 with FC (47 seizures) (Table 2).
Real-time seizure detection
For real-time binary seizure detection, we first chose a short (4 s) and a relatively long sliding window length (12 s) for input of four distinct models, and analyzed the performance of each model (Table 3; Figure 2). A window size of 4 s was the optimal setting chosen by Lee et al. (11), considering the trade-off between performance and speed. The 12 s sliding window was the closest window length to the size of the physicians process each time (15 s). The ResNet-short + LSTM model with a 12 s sliding window demonstrated the best overall performance for real-time seizure detection among the four different models with two different window lengths, demonstrating an AUC of 0.9799 for detecting any kind of seizure (Table 3).
Subgroup area under the curve (AUROC) plots for binary seizure (a–e) and multi-class seizure detection (f–i). (a–e) represent the AUC for detecting various seizure types: (a) Any type, (b) CAE, (c) IESS, (d) GN, and (e) FC. (f–i) illustrate the AUC for detecting different seizure types in multi-class classification tasks: (f) CAE, (g) IESS, (h) GN, and (i) FC. W = 4 and W = 12 indicates window length of 4 s and 12 s, respectively. For multi-class seizure classification model, we included the cases of using raw signal (raw) and power spectral density (frequency bands, PSD) were used.
The performances of the four real-time seizure detection models demonstrated gaps across the distinct seizure-type subgroups. Real-time detection of CAE showed superior performance over detection of any type (Any in Table 3, AUC of 0.9799 with ResNet-short + LSTM, 12 s window), achieving an AUC of 0.9945 with ResNet-short + LSTM using a window size of 12 s (CAE in Table 3). Detecting focal seizures (Focal in Table 3) showed a slightly lower performance compared to detecting any kind of seizure (Any in Table 3), with an AUC of 0.957 with the same window size (12 s) and model architecture (ResNet-short + LSTM). Finally, the detection of IESS and generalized seizures exhibited the lowest performance among the four seizure types, with AUCs of 0.7454 and 0.8578, respectively, when using the same window size (12 s) and model architecture (ResNet-short + LSTM).
Among the four models that were evaluated, increasing the window size led to an improved performance for CAE detection (Table 3, ResNet-short + LSTM model showed an AUC of 0.9877 for a window size of 4 s and 0.9945 for 12 s), while resulting in decreased performance for IESS detection (ResNet-short + LSTM model showed an AUC of 0.7955 for 4 s and 0.7454 for 12 s). The performance of detecting focal seizures was not significantly affected by the size of the sliding window (ResNet-short + LSTM model showed an AUC of 0.957 for 4 s and 0.9463 for 12 s window length). The real-time seizure detection models employing deep hidden layers with a 12 s sliding window (ResNet-short + LSTM, ResNet-short + Dilation + LSTM, and MobileNetV3-short + LSTM) exhibited higher seizure detection performance in comparison to a relatively shallow hidden layer model (CNN2D + LSTM).
Multi-class seizure classification
We have presented the performances of four different models with and without frequency bands feature extractor for multi-class seizure detection in Table 4. Among the four models, ResNet50 without the frequency bands feature extractor exhibited the best overall performance, with a weighted AUC of 0.9961, APR of 0.9912, and F1 score of 0.9689 (Figure 2).
Table 4 illustrates that the usage of frequency bands can either be advantageous or disadvantageous for multi-class seizure detection depending on the model. For high-performing models, such as ResNet50 and DenseNet, no significant difference was observed in the weighted average performance when using raw signal inputs or frequency bands. However, models such as CNN2D + LSTM and MobileNetV3 showed significantly higher performance when using raw signal inputs as opposed to frequency bands.
Our results further demonstrate that performance in classifying specific seizure types depends on the selection of an appropriate feature extractor and model. The CAE enhanced the performance when raw signal inputs were used, specifically with the CNN2D + LSTM, ResNet50, and MobileNetV3 models. Contrarily, DenseNet exhibited improved performance when the frequency bands were used as feature extractors for EEG signals of CAE. Interestingly, IESS showed no significant changes in the AUC, regardless of the feature extractors and models used. GN showed similar performance irrespective of whether a feature extractor was used for models such as ResNet50 and MobileNetV3. However, GN displayed higher performance when raw signal was used with CNN2D + LSTM and DenseNet. Finally, FC showed comparable and non-significant performance, irrespective of the feature extractors and models used.
Discussion
This study marks a significant step forward in the application of real-time seizure detection in pediatric epilepsy cases, an area for which such techniques have not yet been applied. Although numerous attempts have been made to detect seizures, our study underscores the need to manage this issue in real-time, a feat that was previously regarded as challenging. Furthermore, the unique neurophysiological patterns in children and adolescents present a particular challenge, and the ability of our model to handle these intricacies demonstrates its potential and versatility.
Many seizure detection studies rely on pre-cut seizure signals (16–18) with signal feature extractors including frequency bands, linear frequency cepstral coefficients, frequency bands (11), fast fourier transform (11, 29), wavelet packet decomposition (29), or Dual-tree Complex Wavelet Transform (30). Tang et al. (24) used the sliding window method; however, the non-overlapping window shifts compromised detection resolution, impeding timely intervention. Shawki et al. (12) applied overlapping sliding windows in their approach, but the method demonstrated a comparatively lower seizure detection performance.
We achieved superior performance with one of our models, ResNet-short LSTM with 12 s window size. This model displayed an AUROC of approximately 0.98 in detecting any seizures across four baselines (Table 3). This highlights the applicability of our real-time seizure-detection techniques to real-world pediatric datasets, even in complex and diverse clinical settings. Detecting the seizure classes IESS and GN posed a significant challenge, as was reflected by their comparatively lower performance compared to other seizure types. The brief sequences of IESS events complicate their detection, and the heterogeneity of GN, which encompasses diverse features such as head drop and atonic seizures, adds to this complexity. Our results indicate that adopting shorter sliding windows is advantageous for detecting IESS due to its fleeting nature. In the context of FC, the window size did not significantly influence the detection performance. Despite the inherent challenges of seizure-specific detection, our model demonstrated robustness across various configurations and window lengths, underscoring its versatility in detecting pediatric seizure types.
Furthermore, our model demonstrated an impressive ability to accurately classify multiple types of seizures, demonstrating an overall performance score of more than 0.95 in classifying any kind of seizure (Table 4). This represents a critical advantage as it allows clinicians to rapidly and accurately diagnose and differentiate various seizure types, ultimately facilitating the provision of more personalized care.
A notable result of our study was the heterogeneous performance in classifying certain seizure types, which depended on the model and feature extractor. The findings in Table 4 suggest the need for careful selection of feature extractors based on the specific seizure type and chosen machine learning model. A remarkable finding was the insignificant changes in IESS detection performance, regardless of the model and feature extraction, which indicated that the classification task was relatively straightforward despite the challenges of detecting IESS seizure events. Furthermore, the multi-classification model performed flawlessly (AUC of 1.0) on IESS. The unique challenge with IESS is its detection rather than classification, as IESS has a distinct, brief characteristic that can make initial detection challenging. However, once detected, the distinctive nature of these spasms makes their classification relatively straightforward, which explains the exceptional performance of the model. Furthermore, the GN class showed relatively low performance due to the heterogeneous nature of the seizure class discussed above.
In real-world EEG monitoring, adequate system performance should be defined by a balance between sensitivity, false alarm burden, and detection latency, rather than by idealized performance on curated offline datasets. From a clinical perspective, minimizing missed seizure events while maintaining a manageable false alarm rate is often more important than achieving perfect classification accuracy, particularly during prolonged monitoring. Detection latency is also a key consideration, as timely identification of seizure onset may be more clinically relevant than optimal classification performance at early screening stages.
Unlike many previous studies based on retrospectively segmented EEG data, this study analyzed EEG signals in a continuous and time-sequential manner using sliding windows, without predefined seizure segments. This design better reflects real-world EEG monitoring and may support clinician-led EEG interpretation by facilitating the identification of potential seizure events during routine scalp EEG or long-term video-EEG monitoring, rather than serving as a fully automated diagnostic system.
Although our findings are promising, we acknowledge the limitations inherent to the study’s retrospective design and the challenges of validation in a real-world setting. Although we performed two-stage real-time seizure detection and classification, these two processes were not implemented end-to-end fashion in the current model. Therefore, there is room for improvement. Future developments could aim to incorporate simultaneous and end-to-end real-time detection and classification (Figure 1b), which would further enhance the clinical applicability and efficiency of our model. Further prospective studies are necessary to confirm our results and establish the real-time applicability of the model in other clinical environments. Nevertheless, our study established a foundation for developing a system for real-time seizure detection and classification, particularly for the pediatric population.
Our study underscores the vast potential of deep learning and artificial intelligence in transforming the pediatric neurology landscape, particularly in terms of early detection and classification of seizures. With continued refinement, these systems promise a future in which epilepsy management can be greatly enhanced, providing patients with rapid, effective, and personalized care (Figure 2).
In conclusion, we validated that our real-time seizure detection framework and model could be applied to detect seizures in a real-world setting using EEGs from a pediatric neurology ward. Instead of relying on offline analysis or public benchmarks, this work demonstrates real-time seizure detection and multi-class seizure classification on routine inpatient pediatric EEGs. The real-time seizure detection results with models benchmarked from previous studies showed that this seizure detection framework exhibits good performance for screening out seizures and thus could be applied in a realistic setting. Importantly, we characterized deployment-relevant design trade-offs in temporal windowing, showing that optimal window length depends on seizure subtype. Furthermore, multiple models tested in this work can be used to classify multiple seizure types, with good performance for different pediatric seizure types, extending realistic real-time detection to multi-class classification within a unified pediatric cohort and validating a pragmatic two-stage framework aligned with clinical monitoring workflows.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Acharya UR Oh SL Hagiwara Y Tan JH Adeli H. Deep convolutional neural network for the automated detection and diagnosis of seizure using EEG signals. Comput Biol Med. (2018) 100:270–8. doi: 10.1016/j.compbiomed.2017.09.017, 28974302 · doi ↗ · pubmed ↗
- 2Roy S Kiral-Kornek I Harrer S. "Chrono Net: a deep recurrent neural network for abnormal EEG identification" In: . Artificial intelligence in medicine: 17th conference on artificial intelligence in medicine, AIME 2019, Poznan, Poland, June 26–29, 2019, proceedings 17. Cham, Switzerland: Springer International Publishing (2019).
- 3Mohsenvand MN Izadi MR Maes P. Contrastive representation learning for electroencephalogram classification Machine Learning for Health. PMLR, Online. (2020).
- 4Golmohammadi M. "Gated recurrent networks for seizure detection" In: . 2017 IEEE signal processing in medicine and biology symposium (SPMB). New Jersey, USA: IEEE, Piscataway (2017).
- 5Akbarian B Erfanian A. A framework for seizure detection using effective connectivity, graph theory, and multi-level modular network. Biomed Signal Process Control. (2020) 59:101878. doi: 10.1016/j.bspc.2020.101878 · doi ↗
- 6Raghu Sriraam N Temel Y Rao SV Kubben PL. A convolutional neural network based framework for classification of seizure types. Annu Int Conf IEEE Eng Med Biol Soc. New Jersey, USA: IEEE, Piscataway (2019) 2019:2547–2550.10.1109/EMBC.2019.885735931946416 · doi ↗ · pubmed ↗
- 7Daoud H Bayoumi MA. Efficient epileptic seizure prediction based on deep learning. IEEE Trans Biomed Circuits Syst. (2019) 13:804–13. doi: 10.1109/TBCAS.2019.2929053, 31331897 · doi ↗ · pubmed ↗
- 8Ahmedt-Aristizabal D Fernando T Denman S Petersson L Aburn MJ Fookes C. Neural memory networks for seizure type classification. Annu Int Conf IEEE Eng Med Biol Soc. (2020) 2020:569–75. doi: 10.1109/EMBC 44109.2020.9175641, 33018053 · doi ↗ · pubmed ↗
