Epileptic Seizure Detection and Prediction in EEGs Using Power Spectra Density Parameterization

Power spectrum analysis is one of the effective tools for classifying epileptic signals based on electroencephalography (EEG) recordings. However, the conflation of periodic and aperiodic components within the EEG may presents an obstacle to epilepsy detection or prediction. In this paper, we explored the significance of the periodic and aperiodic components of the EEG power spectrum for the detection and prediction of epilepsy respectively. We use a power spectrum density parameterization method to separate the periodic and aperiodic components of the signals, and validate their roles in epilepsy detection and prediction on two public datasets. The average classification accuracy of the periodic and aperiodic components for 10 clinical tasks on the Bonn EEG database were 73.9% and 96.68%, respectively, and increases to 98.88% when combined. For 22 patients on the CHB-MIT Long-term EEG database, the combined features achieve an average detection accuracy of 99.95% and successfully predict all seizures with low false prediction rates. We conclude that both the periodic and aperiodic components of the EEG power spectrum contributed to discriminating different stages of epilepsy, but the aperiodic neural activity played a decisive role in classification. This discovery has significant implications for diagnosing epileptic seizures and providing personalized brain activity information to improve the accuracy and efficiency of epilepsy detection.


I. INTRODUCTION
E PILEPSY is a neurological disorder that affects more than 50 million people worldwide [1].It is characterized by recurrent seizures caused by abnormal brain activity, which can daily functioning and quality of life [2].Since impair antiepileptic drugs have limitations and surgery is not always available, accurate diagnosis and prediction of epileptic seizures are essential for improving the quality of life of epilepsy patients.Electroencephalogram (EEG) is considered one of the effective tools in diagnosing epilepsy because the electrical activity of the brain changes significantly during and near a seizure onset [3].However, the current practice of manually reviewing and analyzing EEG signals by neurologists is inefficient, subjective, and prone to errors.Therefore, there is a great need for developing automated techniques to identify seizures from EEG signals.However, this task is challenging due to the complex nature of EEG signals, such as low signal-to-noise ratio, high dimensionality, nonstationarity, non-linearity, variability, and artifacts [4], [5].Therefore, various non-stationary signal analysis techniques have been proposed and applied in epilepsy detection methods, such as short-time Fourier transform (STFT), wavelet transform (WT), Wigner-Ville distribution (WVD), and the Welch's method.These techniques provide different ways to represent and extract information from EEG signals in the time-frequency domain.For instance, STFT has been used to generate EEG spectrograms and employ a multi-view deep learning model for seizure detection [6].WT has been used to extract effective features such as relative energy, relative amplitude, coefficient of variation, and fluctuation index for seizure detection [7].WVD has been used to propose a brain rhythm sequencing technique for seizure detection [8].Welch's method, which is the one use in this paper, has also been used to calculate the power spectral density of EEG signals for detecting epileptic seizures [9], [10].
In addition, researchers have developed many other detection methods to accurately diagnose epilepsy.For example, the intrinsic mode function (IMF) based phase space representation method, which uses empirical mode decomposition (EMD) to decompose brain electrical signals into multiple IMFs, and then reconstructs the phase space of each IMF as a feature for classifying epileptic signals [11], [12], [13], as well as extracting features of brain electrical signals by calculating the second-order difference of IMF [14].Furthermore, the Fourier-Bessel series expansion based empirical wavelet transform method [15] and the fractional linear prediction(FLP) based method [16] are also used for epilepsy detection.
Recently, an epilepsy detection method based on convolutional long-short-term memory neural networks has been shown to outperform existing state-of-the-art methods in detecting seizures and is suitable for use as an automated system for diagnosing epilepsy [17].Moreover, a new framework for the automated detection of neonatal seizures based on the Morse Wavelet approach coupled with a local binary pattern algorithm and a graph-based community detection algorithm was proposed for the detection of neonatal seizures.The results show that this method is more accurate in detecting epileptic seizures compared to traditional methods [18].However, these methods also have their limitations, such as such as high computational costs or the need for large amounts of training data to achieve high accuracy.
Power spectral density (PSD) analysis is one of the most important and simplest methods in the processing of EEG signals in frequency domain, and it is widely used for epilepsy signal classification [19], [20], [21], [22].However, traditional PSD methods often ignore or confound the aperiodic component of the neural power spectra, treating them as noise or as nuisance variables that need to be corrected, and fail to capture the true oscillations of brain activity.The conflation of periodic and aperiodic components within the EEG may presents an obstacle to epilepsy detection or prediction.Numerous studies have shown that aperiodic components in epilepsy signals have physiological correlates [23], [24], [25], [26], [27], [28], [29], [30].This component can be described by a 1 f χ function, where the χ parameter, also known as the aperiodic exponent, reflects the distribution of aperiodic power across frequencies and is comparable to the negative slope of the power spectrum when measured in log-log space [31].It has been demonstrated that trait-like variances in aperiodic activity may serve as biological indicators for aging [32], development [27], and diseases like attention deficit hyperactivity disorder (ADHD) [28] or schizophrenia [29].Mila et al. have also found that the aperiodic component in the PSD parameterization algorithm varies with cortical depth [30], which is considered a potential psychopathology biomarker in pediatric focal epilepsy [33].At the microscopic scale, aperiodic activity has been found to be correlated with neuronal population spiking and integration of underlying synaptic currents that fluctuate in the initiation, propagation, and termination of epileptiform activity.Therefore, we hypothesize that both periodic and aperiodic components of the neural power spectra can provide unique information for epilepsy detection and prediction.In this paper, we try to explore the significance of the periodic and aperiodic components of the EEG power spectrum for the detection and prediction of epilepsy.
To test our hypothesis, we improve on the traditional PSD method by employing the Fitting Oscillations and One-Over F (FOOOF) parametric method to extract the periodic and aperiodic components of PSD.We provided a detailed explanation of our proposed new method and validated our hypothesis by comparing our method with traditional PSD methods using two authoritative epilepsy datasets: the Bonn dataset and the CHB-MIT long-term EEG database.We explored the roles that periodic and aperiodic activity play in the detection or prediction of seizures, presented the effectiveness of our method in detection and prediction, as well as compared the performance of different classifiers.
In this paper, we make the following contributions: First, we reveal the significance of the periodic and aperiodic components of the EEG power spectrum for epilepsy detection and prediction.Second, we propose a novel method for epilepsy detection and prediction by fusing the periodic and aperiodic components of EEG power spectrum.
The rest of this study is organized as follows.Section II describes the two EEG datasets used to evaluate the proposed method, introduces the proposed method for detecting and predicting epileptic seizures, describes the classification task, reports the classifier we used, and the evaluation metrics used to evaluate the proposed method.Section III presents the evaluation results, including the impact of different features and different classifiers on epilepsy detection and prediction results, and the numerical results of predicting real data from the "CHB-MIT Scalp EEG Database".Section IV provides comparisons with other existing methods and discusses our entire work.Section V summarizes the conclusions.

A. Datasets
Two authoritative and public epilepsy EEG datasets are used for the training evaluation of our approach, including the Bonn University dataset [34] and the Children's Hospital Boston-Massachusetts Institute of Technology (CHB-MIT) scalp EEG database.The brief descriptions of the datasets are given in the following subsections.
1) Bonn University Dataset: This dataset is available from the Department of Epileptology at the University of Bonn and is widely used in epileptic detection and research.The entire dataset includes five subsets (denoted A-E) each containing 100 single-channel EEG segments of 23.6 s duration.All EEG signals were recorded with the same 128-channel amplifier system using an averaged reference electrode and sampled at 173.61 Hz.Sets A and B have been acquired from surface EEG recordings of five healthy volunteers with the state of eyes open and closed, respectively.Sets C, D, and E are both collected from five patients.Specifically, signals in subsets C and D have been measured in the seizure-free stage from the epileptogenic zone (D) and the hippocampal formation of the opposite hemisphere of the brain (C).Subset E contains seizure activity from all recording sites exhibiting ictal activity.For more detailed information about the data collection process, please see [34].
2) CHB-MIT Scalp EEG Database: This database consists of bipolar scalp EEG recordings from 23 pediatric subjects (18 females and 5 males) with intractable seizures from the Children's Hospital Boston [35].The age of the patients ranges from 1.5 to 22 years.All signals are sampled at 256 Hz using the International 10-20 system of EEG electrode positions.The database consists of 916 hours of continuous scalp EEG and contains 157 seizure events.Additionally, the EEG record failed to read patient 13, which was discarded in this work.More information about the CHB-MIT dataset is available at: (https: //physionet.org/content/chbmit/1.0.0/).

B. Parametric Power Spectral Density Method
In this work, we used a PSD parameterization algorithm for epilepsy detection and prediction.The block diagram of the proposed methodology can be seen in Fig. 1.We first filtered the raw EEG signals with a 0-40 Hz bandpass FIR filter and divided them into 10-second segments with 90% overlap between adjacent segments.Next, we computed the power spectral density of each segment using FFT based on Welch's method and used the Fitting Oscillations and One-Over F (FOOOF) parametric method [36] to extract the periodic and aperiodic components of the PSD.We used the three parameters of center frequency, power, and bandwidth of the highest peak in the periodic component, as well as the parameters of offset and exp in the aperiodic component, as the feature vector for each segment.Finally, we classified the feature vectors of each segment using a classifier to obtain the classification results.
1) Parametric Power Spectral Density: The algorithm we used in this work to separate the PSD into periodic and aperiodic components was first introduced by Donoghue et al. [36].The algorithm characterizes the putative periodic oscillation parameters by the center frequency, power, and bandwidth of the PSD peak, while the aperiodic component is described by an offset parameter and an exponential parameter, which can be interpreted as the intercept and slope of the periodic component in log power spectrum coordinates.This method assumes that the PSD can be reconstructed by the sum of multiple Gaussian functions (periodic components) and a Lorentzian function (aperiodic component): (1)

TABLE I TEN DIFFERENT CLASSIFICATION TASKS OF THE BONN DATASET
First, it flattens the power spectrum by subtracting an initial estimate of the aperiodic component.Then, it iteratively identifies peaks in the flattened spectrum by fitting Gaussian functions with predefined bandwidth limits.These Gaussians are subtracted from the original spectrum to refine the estimate of the aperiodic component.Finally, it computes the goodness of fit by comparing the sum of the fitted components with the raw spectrum.The Gaussian function is defined by where a is the power of the peak (decibels), µ is the center frequency (Hz), σ is the standard deviation of the Gaussian (Hz), and f is the vector of input frequencies (Hz).The Lorentzian function is defined as where b is the broadband offset, χ is the exponent, and k is the parameter that controls the bend of the aperiodic component.
2) Feature Selection: The algorithm calculates three parameters for each periodic component based on the Gaussian fit: (1) Center frequency (CF): the mean value of the Gaussian.
(2) Power (PW): the distance between the Gaussian peak and aperiodic fit.(3) Bandwidth (BW): 2 times the standard deviation of the fitted Gaussian.We selected these three parameters for the highest peak as our periodic features, because they reflect the location, amplitude, and width of each oscillation.We also selected offset and exponent as our aperiodic features, because they reflect the baseline power level and rate of power decrease across frequencies.Therefore, we used a total of five features for each segment.We used default parameter settings for all power spectrum parameterization processes.For more details about this algorithm, please see [36].

C. Epilepsy Detection Task
We divide the detection task into two parts.In the first part, we use ten common classification problems from the Bonn dataset to test our algorithm as shown in Table I.
In the second part of our detection task, we classify the preictal and ictal stages of the CHB-MIT dataset.This dataset consists of long-term EEG recordings from 23 patients with epilepsy.To ensure consistency across different cases, we only Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
use the channels that were available throughout each recording session.Moreover, we address the issue of data imbalance between seizure and non-seizure classes by selecting pre-ictal data with equal length as ictal data before each seizure onset.This way, we can train and test our algorithm using crossvalidation on balanced data sets.
SVM has been confirmed as a high-performance classifier in many previous studies [37], which is a supervised learning model in machine learning, usually used for pattern recognition, classification, and regression analysis.Since a non-linear SVM is expected to have a higher computational cost and be slower to compute, we used a linear SVM instead of a non-linear SVM.The KNN algorithm is a simple, easy-toimplement supervised machine learning algorithm that can be used to solve both classification and regression problems.It finds the nearest neighbors for each data according to the Euclidean distance, then selects the K-nearest neighbors, specifying the data labels based on the labels of the majority [38].In this article, K is considered to be three.Decision tree (DT) learning is a method of approximating discrete-valued functions by recursively dividing the instance space to predict the correct class [39].It is among the most popular inductive inference algorithms and has been successfully applied to a broad range of tasks from learning to diagnose medical cases to learning to assess the credit risk of loan applicants.Linear discriminant analysis (LDA) is a supervised method for introducing class information based on mean vectors and covariance matrices of feature vectors for individual classes.This classifier draws a hyperplane to separate the features belonging to two different classes.
2) Evaluation Metrics for Detection: We evaluated the performance of our proposed epilepsy detection scheme using four indicators: sensitivity (SEN), specificity (SPE), accuracy (ACC), and Matthews correlation coefficient (MCC) [40].These indicators are calculated as follows: where true positive (TP) and true negative (TN) separately represent the number of sections marked as positive and negative accurately.False positive (FP) is the number of positive records that are wrongly classified as negative.False negative (F N ) is exactly contrary to that, which denotes the number of segments labeled as negative but are positive indeed.In the epilepsy detection part, the EEG signals of ictal and inter-ictal are defined as positive (P) and negative (N ), respectively.SEN measures how well the scheme can detect positive (ictal) EEG signals, while SPE measures how well the scheme can exclude negative (inter-ictal) EEG signals.ACC measures the overall correctness of the scheme, that is, the proportion of EEG signals that are correctly classified as positive or negative.MCC measures the correlation and balance between the detection results and the actual conditions, and it ranges from −1 to 1, where 1 indicates a perfect prediction, 0 indicates a random prediction, and −1 indicates an inverse prediction.MCC is considered a robust and informative metric for binary classification evaluation.

D. Epilepsy Prediction Task
We use CHB-MIT data to evaluate the performance of parametric methods on the prediction classification task.The classification task is to distinguish between interictal and preictal brain states using the parametric approach.In the epilepsy prediction experiment, to use all available EEG data for a more complete evaluation, we used oversampling.The interictal EEG signals are divided into smaller groups that matched the duration of the pre-ictal class, and the mean value of the classification results is used in the estimation of the total seizure prediction performance.The classifier uses the SVM and KNN described earlier.
1) Evaluation Metrics for Prediction: In the epilepsy prediction section, we calculated the specificity in Equation 4, where positive (P) and negative (N ) were changed to pre-ictal and interictal.The prediction rate (Pr ed) is a measure of the algorithm's ability to correctly predict seizures and is defined as the proportion of seizures that are correctly predicted out of the total number of seizures.The false prediction rate (F P R) declares the false alarm generation rate as the number of FPs per hour of EEG recordings.A positive value of prediction time TP as the difference between the onset of the seizure marked in the database and the time of the first record inside the correspondent prediction interval classified as true indicates how early a seizure is predicted.At the same time, we also calculated the positive predictive value P P V = TP (TP + FP) to evaluate the performance of the method.Furthermore, the classification results are evaluated using the 10-fold cross-validation technique to verify the robustness of our proposed method.The advantage of K-fold cross-validation is that all the observations in the database are eventually used for both training and testing.

A. Classification Performance on Detection Tasks
1) Epileptic Detection of the Bonn Database: In this section, the multi-classification task of the Bonn EEG dataset is first used to verify the effectiveness of the proposed method.First, the power spectrum is parameterized to obtain effective features for epilepsy classification.Use the default parameters to gain the feature vector composed of five features: CF, PW, BW, exp, and offset.The box-and-whisker plots of features between different categories are shown in Fig. 2, which shows good discrimination in terms of the median, quartile, upper quartile, and interquartile range of the features.To be more  Then, we compare the performance of parametric and traditional power spectrum methods on the Bonn data classification task.For the traditional method, we chose the dominant frequency of the power spectral density calculated by the Welch's method and its power as features.Periodic and aperiodic components are chosen as features for the parametric method.The results in Table II show that the parametric method obtains  II show that the parametric method outperforms the traditional method in sensitivity, specificity and accuracy for all tasks.For instance, in the interictal vs ictal task (Case 4), the parametric method attains 98.5% accuracy, while the traditional method lags behind with 89.5%.This implies that the parametric method can better recognize interictal and ictal EEG signals, which are both seizure states but have distinct patterns.In the normal vs interictal vs ictal task (Case 10), the parametric method reaches 97.2% accuracy, while the traditional method falls short with 86.2%.This indicates that the parametric method can handle more challenging classification tasks with multiple classes and still maintain a high performance.In the normal vs ictal tasks (Cases 1, 2 and 5), the parametric method achieves perfect scores of 100% in all three indicators, meaning that it can flawlessly separate normal and seizure EEG signals, which are vital for epilepsy diagnosis and treatment.The average values of SEN, SPE and ACC for all tasks increase by 10.5%, 7.88% and 8.25% respectively when using the parametric method instead of the traditional method.This demonstrates that using the parameterized power spectrum as a feature is more discriminative and can enhance the classification accuracy.
Finally, classification experiments on 10 clinical tasks of the Bonn EEG dataset are implemented using three features of periodic, aperiodic, and periodic plus aperiodic, respectively.We choose the support vector machine as the classifier here and employ Sensitivity, Specificity, and Accuracy to quantify our experimental results, as shown in Table III.It can be seen that using only the periodic component as a feature, the obtained values of the three classification indicators are significantly lower than those of the other two types of features, and the accuracy of cases 4 and 9 is even lower than 65%.If aperiodic components are used as features, there is a significant improvement in classification performance compared to periodic components.In particular, Task 9 showed the largest improvement, with its accuracy increasing from 66.23%, 77.52%, and 57.70% to 98.97%, 98.03%, and 96% for Sensitivity, Specificity, and Accuracy, respectively.
Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

TABLE IV SEIZURE DETECTION PERFORMANCE ACHIEVED BY THE PROPOSED METHOD ON THE CHB-MIT DATASET USING SVM CLASSIFIER
This finding provides evidence that aperiodic components contain more useful classification information compared to periodic components.When we combined the two components as features, most of the classification results improved even further.For cases 1, 2, and 5, the three indicators reached 100%, and the accuracy of the other 7 cases also improved to more than 97%.The obtained results suggest that combining the two features can improve classification performance.
2) Epileptic Detection of the CHB-MIT Database: In this section, we further verify the performance of our proposed algorithm for power spectral density parameterization and seizure detection on the CHB-MIT database.The CHB-MIT database consists of scalp EEG data that have been annotated by clinical experts as epileptic or non-epileptic seizures.We segment the EEG signal into 10-second windows, and each segment forms a sample with 23 channels.The feature vector of each sample has 115 features (23 * 5).We then feed the feature of each segment into an SVM classifier to perform seizure identification.Table IV shows the experimental results.
As can be seen from Table IV, our algorithm achieves a specificity (SPE) of 100% for all patients, and a high sensitivity (SEN), accuracy (ACC), and MCC with mean values of 99.9%, 99.9%, and 0.99 respectively.The lowest MCC value among all subjects is still 0.98.These results demonstrate that the extracted features have a remarkable seizure detection ability.Moreover, such consistent performance across all cases also proves that our algorithm has good generalization and stability.Next, we compare our algorithm with different features and different classification methods on the CHB-MIT dataset.We use four popular classification methods: SVM, KNN, DT, and LDA, as shown in Fig. 3.Among the four classification methods, using only the periodic component as a feature leads to the worst performance.The DT classifier has the lowest SEN, SPE, ACC, and MCC values of 89.44%, 89.73%, 89.58%, and 0.79 respectively.When we use the aperiodic component as a feature, the performance of all four classifiers improves significantly, and the KNN classifier achieves the best results with SEN, SPE, ACC values of 99.8% and an MCC value of 0.997.When we combine both periodic and aperiodic components as features, the SVM classifier outperforms other classifiers with SEN, SPE, ACC values of 99.90%, 100%, 99.95% and an MCC value of 0.999 respectively.Both SVM and KNN classifiers show remarkable performance when using aperiodic components or a combination of periodic and aperiodic components as features.The LDA classifier also attains over 99% for all evaluation metrics when using a combination of periodic and aperiodic components as features.These results indicate that our algorithm can maintain good stability with various classification methods and that adding aperiodic component features can enhance the classification performance.
Finally, we compared the performance of different classification methods to identify the optimal classifier for epilepsy detection on the CHB-MIT dataset.Our results showed that SVM has the highest performance on all evaluation metrics, followed by KNN and LDA.On the other hand, although DT had the worst performance, it still averaged over 98.5% for all evaluation metrics.This suggests that the SVM classifier may be a better choice for predicting epilepsy using our proposed algorithm on the CHB-MIT dataset.

B. Classification Performance on Prediction Tasks
In this section, we evaluate the performance of our proposed algorithm for epilepsy prediction using CHB-MIT data.Our goal is to predict seizures within 10 minutes or 30 minutes before their onset.We choose KNN and SVM because they perform better than other methods in our previous epilepsy detection part.To improve our seizure prediction performance, we perform post-processing on our predictions.Since isolated false positives during inter-ictal periods are common, we use a voting scheme to filter out spurious predictions.Specifically, for 10 consecutive predictions, we raise an alarm only if there are at least 8 positive predictions.This reduces the number of false alarms and increases the reliability of our algorithm.Table V presents the seizure prediction results obtained for each patient in the CHB-MIT database, as well as the overall average result across all patients.All seizures are successfully predicted with a prediction rate of 100% with different classifiers or preictal windows.KNN attains the best SPE and PPV of two different preictal windows on average, all reaching 100%.And hence getting the best false alarm rate (0.01 times per hour), which is an important indicator for evaluating predictions.Considering that zero rates of false predictions are achieved for up to 18 of the 19 cases used in the evaluation, there is a strong indication that the seizure prediction is very accurate with few false alarms.The SVM classifier also has high SPE and PPV values (>99.8%),but its FPR is much higher than that of KNN (0.42/h and 1.24/h for 10min and 30min preictal windows, respectively).Both classification methods achieve rapid seizure prediction, but KNN has a shorter time-to-prediction (Tp) than SVM in the 30min preictal window.Tp measures the interval between the first alarm and the seizure onset.In our results, KNN's average Tp was 1788.11s, while SVM's average Tp was 1778.11s.These results suggest that the algorithm combined with KNN can effectively distinguish between interictal and preictal stages, with better performance than the combination with SVM.

IV. DISCUSSION
In the present study, we proposed a novel seizure detection and prediction strategy that combines putative periodic oscillatory and aperiodic components in the neural power density of EEG signals.Moreover, we performed the classification tasks with periodic and aperiodic parameters and a combination of both, respectively, and compared the results of the parametric algorithm with those of traditional methods.We find that the aperiodic component improves the classification performance, making it better than the traditional method.Finally, the performance of the four classifiers for the new strategy was quantified, and epilepsy detection and prediction were performed.
In the detection task, for the Bonn dataset, the algorithm proposed in this study not only efficiently processed 10 different cases but also achieved 100% recognition rates for SEN, SPE and ACC in all three classification tasks (A-E, B-E, AB-E) for both normal and epileptic states, demonstrating that distinguishing between normal and epileptic states is an advantage of this algorithm.Table VI compares the method proposed in this paper with some of the state-ofthe-art epilepsy detection methods using the Bonn database.It can be seen that [41] also selected PSD as a feature, but our work achieved better results.Moreover, this work obtains higher classification accuracy for all classification tasks than those shown in [42], [43], and [44].The feature selection algorithm is used in [45] and [46], which increases calculation time and the risk of overfitting.By comparison, our method only uses five features and does not screen features for different cases.In addition, [47], [48], [49], [50] only verified the effectiveness of the method in Bonn data, and did not explore the performance of the proposed method in other long-term data sets.Our method has been verified to perform Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

TABLE VI COMPARED WITH OTHER RELATED WORK IN THE DETECTION EXPERIMENT DATASETS)
well in Bonn and CHB-MIT datasets, which proves that our method has better adaptability.Although the A-E and B-E classification tasks in the Bonn dataset in [51] have reached 100%, which is the same as our results, their performance on the CHB-MIT dataset is only 97.1-97.77-97.18, not as good as the 99.9-100-99.9obtained by our method.Moreover, they used more than 50 features in this work, and a large number of features seriously increased the computational complexity and time cost the detection algorithm.In Table VII, it is evident that the proposed method outperformed the recently developed by a good margin for experimental cases of the CHB-MIT database.Additionally, all 23 cases from the CHB-MIT database utilized for complete evaluation in our work, while [52], [53], [54] only selected a few patients for their analysis.
For the prediction part, we used the records of 19 patients in the CHB-MIT database for evaluation, which are more than [60], [61], [62], as shown in Table VIII.While the choice of prediction time domain, [63] is significantly shorter, putting pressure on successful intervention in epilepsy.Although [61], [63], [64] also achieved 100% prediction rates for epilepsy, the specificity and false alarm rates were lower than our results.[60], [62] failed to predict all epilepsy, but our algorithm successfully predicted all epilepsy.As a result, our algorithm performs stably and well in epilepsy detection and prediction tasks on different datasets.Our experiments demonstrate that separating the putative aperiodic component from the neural power spectral density and using it as a feature can improve the classification accuracy by 7.5%, which seems to imply that the aperiodic component contains a large amount of classification information.The study by Bateman and Seyal [65] showed that 33% of seizures had oxygen levels below 90%, 10% had seizures below 80%, and4% had seizures below 70%.The study by Jonathan et al. confirmed that functional MRI blood oxygen level-dependent signal correlates with aperiodic component offset [26].Other studies [23], [25] have also demonstrated that the neuronal population spiking is also closely related to the aperiodic component offset, and the so-called spike discharge phenomenon on the EEG during epileptic seizures is caused by synchronized bursts from a sufficient number of neurons.In addition, some studies [24] have found that the aperiodic exponent is related to the integration of the underlying synaptic currents.Sayin et al. found that the initial seizure sharply increases excitatory synaptic transmission, thereby enhancing NMDA receptor-dependent synaptic inward currents, enhancing excitability and increasing intracellular calcium concentrations [66].The above studies can demonstrate that trait-like differences in aperiodic activity are shown to be potential biomarkers of epilepsy disorders.
Compared to earlier methods that utilized computationally costly classifiers, our algorithm presents a more time-efficient and economical solution for EEG analysis.The computational time of our proposed framework consists of three parts: preprocessing data in Matlab, fitting FOOOF models in Python, and analyzing FOOOF results in Matlab.Table IX shows the average computational time for each part of our framework for each epoch (10s) of the CHB-MIT dataset.The total computational time of our framework is the sum of the three parts and the classification time.Since the classification time varies depending on the classifier used, the third part shows the classification time of four different classifiers after feature extraction.Our framework was developed and tested on a The average computational time of our framework for each epoch was 0.0111 seconds.The most computationally expensive part of the proposed algorithm is the computation of FOOOF models.In comparison, Mansouri et al. implemented their proposed online EEG seizure detection algorithm on the same dataset using MATLAB R2017b with Intel Core i7-6700 CPU @ 4.00 GHz with 32 GB RAM.They used the same epoch length of 10 seconds as we did, and the computation time for each epoch was 12.9ms, which is 1.8ms slower than our method [67].Supratak et al. implemented their algorithm in MATLAB on a machine with 16.0 GB RAM and a clock speed of GHz.The training time for different patients varied from 2 to 5 hours, and the computation time for detecting seizures in each 1-second EEG segment was approximately 10 milliseconds [68].Our proposed framework required less training time while achieving similar or better performance with significantly lower computational requirements.This makes it well-suited for developing real-time epilepsy detection and prediction devices, which could be a valuable tool for patients with epilepsy.This makes it well-suited for developing real-time epilepsy detection and prediction devices, which could be a valuable tool patients with Our proposed algorithm has several advantages.It does not require predefining specific frequency bands of interest and can provide additional brain activity information.This provides richer classification information for epilepsy EEG signals, improving classification accuracy.Additionally, the algorithm is simple, with few features and high classification efficiency.However, our method also has some limitations.The FOOOF algorithm requires fine-tuning of its settings to achieve optimal results.For example, the number of peaks to fit affects computation time and classification accuracy.Fitting more peaks reduces fitting errors but increases computation time, potentially impacting realtime detection and prediction of epilepsy.On the other hand, reducing the number of peaks to fit can save computation time but may introduce errors that affect classification accuracy.
Therefore, extensive experimentation is required to achieve a balance between classification time and accuracy.

V. CONCLUSION
In this study, we proposed a novel algorithm for EEGbased epilepsy detection and prediction, which extracts both periodic and aperiodic components of the power spectral density as features and uses machine learning classifiers to classify interictal, preictal, and ictal periods.The algorithm was evaluated on two authoritative epilepsy datasets, the Bonn dataset and the CHB-MIT dataset, and achieved high accuracy, sensitivity, specificity, and Matthews correlation coefficient in all classification tasks.Importantly, our findings suggest that aperiodic neural activity carries more classification information than neural oscillations, enabling better classification of different epilepsy states.The addition of aperiodic component features implies physiological significance and improves the classification accuracy.Our proposed method performed extremely well in the ictal/non-ictal discrimination task, with all seizures successfully predicted under two different preictal windows of 10 min and 30 min, and the false alarm rate was only 0.01/h.
These results indicate that the proposed algorithm can effectively perform multi-classification of EEG signals of epileptic seizures, with low computational complexity and high discrimination accuracy.Compared with existing methods, the proposed algorithm has better adaptability to different EEG data, and can obtain better performance on both short-term and long-term EEG data.The proposed strategy may be valuable in assisting physicians to make accurate and rapid diagnoses for epilepsy patients.
Future research directions may include investigating ways to optimize the parameter settings for different PSD calculation methods to improve classification performance in EEG signal analysis, as well as verifying the proposed method on other EEG databases, including the real clinical dataset and the authoritative public EEG dataset, and exploring its applications for diagnosing other diseases.

Fig. 2 .
Fig. 2. Boxplots of periodic and aperiodic features of the five datasets.Three periodic features (CF: center frequency, PW: peak power, BW: peak bandwidth) and two aperiodic features (offset and exponent) are plotted for different datasets, respectively.

Fig. 3 .
Fig. 3. Comparison of seizure detection results with different features and classifiers in CHB-MIT data.Different color histograms represent the average results related to different features.Bars: standard deviations.

TABLE II COMPARISON
OF EVALUATION INDICATORS OBTAINED BY TRADITIONAL METHODS AND PARAMETRIC METHODS ON THE BONN DATABASE

TABLE III SEIZURE
DETECTION PERFORMANCE USING PERIODIC COMPONENTS, APERIODIC COMPONENTS, AND THE COMBINATION OF PERIODIC AND APERIODIC COMPONENTS improved sensitivity, specificity and accuracy over traditional methods for any task.The results in Table

TABLE V SEIZURE
PREDICTION RESULTS FOR THE CHB-MIT EEG DATABASE.PREICTAL WINDOW DURATION: 10 MIN AND 30MIN.PRED = CORRECTLY PREDICTED SEIZURES, SPE = SPECIFICITY, TP = PREDICTION TIME, PPV = POSITIVE PREDICTIVE VALUE, BPPV = BALANCED POSITIVE PREDICTIVE VALUE, FPR = FALSE PREDICTION RATE

TABLE IX COMPUTATIONAL
TIME OF EACH PART OF OUR FRAMEWORK FOR THE CHB-MIT DATASET PER EPOCH