Enhanced Early Detection of Epileptic Seizures Through Advanced Line Spectral Estimation and XGBoost Machine Learning †
Abstract
1. Introduction
- Interictal Phase: This phase can be defined as the interictal or normal phase. This is the resting phase where the patient is aware and in good mental status. There is a possibility of milder symptoms, which may be identified on EEG as changes in brain waves, signifying epilepsy or the potential for it.
- Preictal Phase: The preictal phase refers to the time period right before a seizure occurs. During this time, there are often physiological changes that can act as early warning signs of a seizure. Detecting the preictal phase allows for interventions to be put in place that may prevent a seizure or reduce its severity.
- Ictal Phase: This phase also includes the seizure itself, during which there is normal electrical activity and physical symptoms. Detecting the seizure in real time is important for medical response and for monitoring the safety of the patient.
- Postictal Phase: The postictal phase involves the return to baseline function and may include confusion, drowsiness, or other transient neurological deficits.
- The inclusion of ALSE in the model enables it to identify subtle variations in raw EEG signals that suggest imminent seizure activity.
- We selected XGBoost for seizure prediction because of its high precision combined with its ability to manage complex data patterns effectively.
- The model makes robust and dependable predictions for early seizure detection because evaluations are conducted through multiple metrics alongside visualizations.
2. Literature Review
3. Background
- Raw Signal Acquisition: EEG signals represent neural activity during normal (interictal) and pre-seizure (preictal) periods. EEG recordings, however, may also include noise such as electromyographic artifacts, line noise, and movement artifacts, among others, which need to be carefully removed.
- Dimensionality Reduction: The other problem with using raw EEG is the high dimensionality. This causes overfitting and computational overheads. Dimensionality reduction is required to extract only the most informative signal features.
- Data Augmentation: The last data pre-processing problem is class imbalance in the dataset. The amount of seizure intervals is far less than the normal ones. Synthetic minority oversampling or SMOTE is used to synthesize more training samples and balance the classes to decrease model bias to the majority class.
- Temporal Segmentation: EEG data are segmented to preserve the temporal characteristics and to provide adequate resolution for feature extraction. Window size and overlap are chosen such that they are appropriate for the seizure prediction horizon.
- represents the discrete-time EEG signal;
- denotes the amplitude of the kth spectral line;
- represents the normalized frequency of the kth component;
- is the phase of the kth sinusoid;
- represents additive white noise;
- is the total number of spectral bands.
4. Proposed Methodology
| Algorithm 1 Seizure Prediction using XGBoost with ALSE Feature Extraction |
| Input: |
| - Raw EEG signals (N samples × M time points) - Binary labels (0 = interictal, 1 = preictal/seizure) |
| Output: |
| - Evaluation Metrics, Confusion Matrix - ROC Curve Visualization, Feature importance plot for XGBoost |
| data /* Apply Advanced Line Spectral Estimation (ASLE) */ 3: Extract frequency-domain features fi = [ f1, f2, …, fk ] where k is the number of features 4: Concatenate all features fi = Line Spectral Frequencies, Amplitude, Phase shifts 5: Construct the feature matrix Xalse = [ f1, f2, …, fN ] 6: Split Xalse (Xtrain, Xtest), (ytrain, ytest) 7: max_depth, learning_rate, n_estimators/* Define XGBoost Model */ 8: Optimize using /*Objective function */ /*Probability of Seizure*/ 10: model.fit(Xtrain, ytrain)/* Train Model */ 11: ypred = model.predict(Xtest)/* Predict Seizure Event */ 12: Evaluate the model using standard metrics 13: ConfMatrix = confusion_matrix(ytest, ypred)/* Plot confusion matrix */ 14: ROC = plot_roc_curve(ytest, yprob)/* Plot ROC Curve */ |
Computational Optimization
- Toeplitz Matrix Inversion: In the Toeplitz structure of autocorrelation matrices, using the Levinson–Durbin algorithm, the autocorrelation matrix can be inverted in a fast way; this reduces the time complexity from O(N3) to O(N2).
- Capon Beamforming: Spatial filtering can be used to improve the signal-to-noise ratio by attenuating interference while maintaining signals in desired directions.
- Non-uniform FFT: Fast evaluation of the Fourier transform at arbitrary frequency samples can be performed with reduced computation while retaining spectral resolution.
5. Experimental Results and Analysis
- Main spectral features (X1–X10) contribute high discriminability for seizure detection;
- Temporal dynamics features (X170–X178) constitute a moderate contribution to classification accuracy;
- Mid-range statistical features (X50–X150) make a consistent but lower individual contribution.
5.1. Advanced Line Spectral Estimation Results
- True and estimated frequencies have a similar increasing trend for each index.
- A slight deviation in estimated frequency from the true frequency is observed at the sixth and ninth index.
- True and estimated frequency are in very good agreement in the high-frequency part (11th and 12th index).
- The mean square error between true and estimated frequency is 0.0034 Hz.
- The largest error in the estimation is 0.12 Hz at the sixth index.
5.2. Classification Results on GPU
5.3. Comparative Analysis
- Decision Tree Classification: Decision trees divide the feature space into a set of simple decision rules. These rules are easily interpretable, but a single tree may not have the desired properties, such as overfitting in high dimensional EEG feature spaces. As such, a tree requires tuning via pruning methods.
- Random Forest Ensemble: Random forests are an ensemble of decision trees trained on random subsets of the data. Random forests decrease the variance of predictions, while also being more robust. Additionally, random forests provide feature importance rankings.
- Neural Network Architectures: Deep neural networks, particularly CNN and RNN architectures, are capable of modeling non-linear temporal dependencies in EEG signals but require substantial computational resources. Convolutional layers are adept at capturing spatial patterns, while recurrent structures model temporal dependencies.
- XGBoost Implementation: The XGBoost classifier employs gradient boosting with regularization to avoid overfitting while maintaining high predictive accuracy. It also supports parallel processing for efficient training on large EEG datasets.
6. Conclusions and Future Scope
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Kunekar, P.; Gupta, M.K.; Gaur, P. Detection of epileptic seizure in EEG signals using machine learning and deep learning techniques. J. Eng. Appl. Sci. 2024, 71, 21. [Google Scholar] [CrossRef]
- Ein Shoka, A.A.; Dessouky, M.M.; El-Sayed, A.; Hemdan, E.E. EEG seizure detection: Concepts, techniques, challenges, and future trends. Multimed. Tools Appl. 2023, 82, 42021–42051. [Google Scholar] [CrossRef] [PubMed]
- Rasyaad, F.; Rizal, A.; Wijayanto, I. Enhancing epileptic seizure classification using entropy measures on EEG signals. In Proceedings of the 2025 4th International Conference on Electronics Representation and Algorithm (ICERA), Yogyakarta, Indonesia, 12 June 2025; pp. 382–387. [Google Scholar] [CrossRef]
- Yu, A.; Singh, M.; Pandey, A.; Dybas, E.; Agarwal, A.; Kao, Y.; Zhao, G.; Kao, T.-J.; Li, X.; Shin, D.S.; et al. Integrating manual preprocessing with automated feature extraction for improved rodent seizure classification. Epilepsy Behav. 2025, 165, 110306. [Google Scholar] [CrossRef] [PubMed]
- Shabarinath, B.B.; Challagulla, K.; Visodhan, M.R. A comparative study of epileptic seizure detection framework using SVM and ELM. In Proceedings of the 2019 International Conference on Intelligent Computing and Control Systems (ICCS), Madurai, India, 15–17 May 2019; pp. 302–306. [Google Scholar] [CrossRef]
- Zhao, Y.; Chu, D.; He, J.; Xue, M.; Jia, W.; Xu, F.; Zheng, Y. Interactive local and global feature coupling for EEG-based epileptic seizure detection. Biomed. Signal Process. Control 2023, 81, 104441. [Google Scholar] [CrossRef]
- Aboyeji, S.T.; Ahmad, I.; Wang, X.; Chen, Y.; Yao, C.; Li, G.; Tong, M.C.F.; Siu, A.K.Y.; Zhao, G.; Chen, S. DCSENets: Interpretable deep learning for patient-independent seizure classification using enhanced EEG-based spectrogram visualization. Comput. Biol. Med. 2025, 185, 109558. [Google Scholar] [CrossRef] [PubMed]
- Shoeibi, A.; Ghassemi, N.; Khodatars, M.; Jafari, M.; Hussain, S.; Alizadehsani, R. Application of deep learning techniques for automated detection of epileptic seizures: A review. Biomed. Signal Process. Control. 2020, 57, 101–118. [Google Scholar]
- Boonyakitanont, P.; Lek-Uthai, A.; Chomtho, K.; Songsiri, J. A review of feature extraction and performance evaluation in epileptic seizure detection using EEG. Biomed. Signal Process. Control. 2019, 48, 222–235. [Google Scholar] [CrossRef]
- Selim, S.; Elhinamy, E.; Othman, H.; Abouelsaadat, W.; Salem, M.A.-M. A review of machine learning approaches for epileptic seizure prediction. IEEE Trans. Biomed. Eng. 2019, 66, 2798–2809. [Google Scholar]
- Wang, Y.; Li, Z.; Feng, L.; Bai, H.; Wang, C. Hardware design of multiclass SVM classification for epilepsy and epileptic seizure detection. IET Circuits Devices Syst. 2018, 12, 469–478. [Google Scholar] [CrossRef]
- Hansen, T.L.; Fleury, B.H.; Bhaskar, D. Superfast Line Spectral Estimation. IEEE Trans. Signal Process. 2018, 66, 2511–2526. [Google Scholar] [CrossRef]
- Shabarinath, B.B.; Muralidhar, P. Epileptic seizure inference using kernelized SVM with integrated training on PYNQ-Z2. In Proceedings of the 2022 IEEE International Symposium on Smart Electronic Systems (iSES), Warangal, India, 18–22 December 2022; pp. 251–256. [Google Scholar] [CrossRef]
- Guttag, J. CHB-MIT Scalp EEG Database (Version 1.0.0); RRID:SCR_007345; PhysioNet; MIT Laboratory for Computational Physiology: Cambridge, MA, USA, 2010. [Google Scholar] [CrossRef]

| Parameter | Value |
|---|---|
| Overall Accuracy | 95.50% |
| Sensitivity (Recall) | 92.23% |
| Specificity | 93.38% |
| F1-Score | 94.12% |
| Average Prediction Time (GPU) | 23.48 min |
| Maximum Prediction Time (GPU) | 33.46 min |
| SLSE Window Length | 256 samples |
| Window Overlap Ratio | 50% |
| Primary Classifier | XGBoost ensemble |
| CHB-MIT Participants | 24 subjects |
| NIMS Participants | 24 subjects |
| Total Recording Duration | 4 h per subject |
| Sampling Rate | 256 Hz |
| XGBoost | Neural Network | |||||
|---|---|---|---|---|---|---|
| Precision | Recall | F1-Score | Precision | Recall | F1-Score | |
| 0 | 1.00 | 1.00 | 1.00 | 0.46 | 0.41 | 0.43 |
| 1 | 1.00 | 1.00 | 1.00 | 0.50 | 0.6 | 0.53 |
| Accuracy | 1.00 | 0.49 | ||||
| Macro avg | 1.00 | 1.00 | 1.00 | 0.48 | 0.48 | 0.48 |
| Weighted avg | 1.00 | 1.00 | 1.00 | 0.48 | 0.49 | 0.48 |
| XGBoost | Random Forest | |||||
|---|---|---|---|---|---|---|
| Precision | Recall | F1-Score | Precision | Recall | F1-Score | |
| 0 | 1.00 | 1.0 | 1.00 | 0.95 | 0.94 | 0.94 |
| 1 | 1.00 | 1.0 | 1.00 | 0.92 | 0.91 | 0.91 |
| Accuracy | 1.00 | 0.93 | ||||
| Macro avg | 1.00 | 1.00 | 1.00 | 0.94 | 0.92 | 0.92 |
| Weighted avg | 1.00 | 1.00 | 1.00 | 0.94 | 0.93 | 0.93 |
| XGBoost | Decision Tree | |||||
|---|---|---|---|---|---|---|
| Precision | Recall | F1-Score | Precision | Recall | F1-Score | |
| 0 | 1.00 | 1.0 | 1.00 | 0.85 | 0.80 | 0.82 |
| 1 | 1.00 | 1.0 | 1.00 | 0.81 | 0.8 | 0.84 |
| Accuracy | 1.00 | 0.83 | ||||
| Macro avg | 1.00 | 1.00 | 1.00 | 0.83 | 0.83 | 0.83 |
| Weighted avg | 1.00 | 1.00 | 1.00 | 0.83 | 0.83 | 0.83 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Krishna, K.R.; Shabarinath, B.B. Enhanced Early Detection of Epileptic Seizures Through Advanced Line Spectral Estimation and XGBoost Machine Learning. Comput. Sci. Math. Forum 2025, 12, 4. https://doi.org/10.3390/cmsf2025012004
Krishna KR, Shabarinath BB. Enhanced Early Detection of Epileptic Seizures Through Advanced Line Spectral Estimation and XGBoost Machine Learning. Computer Sciences & Mathematics Forum. 2025; 12(1):4. https://doi.org/10.3390/cmsf2025012004
Chicago/Turabian StyleKrishna, K. Rama, and B. B. Shabarinath. 2025. "Enhanced Early Detection of Epileptic Seizures Through Advanced Line Spectral Estimation and XGBoost Machine Learning" Computer Sciences & Mathematics Forum 12, no. 1: 4. https://doi.org/10.3390/cmsf2025012004
APA StyleKrishna, K. R., & Shabarinath, B. B. (2025). Enhanced Early Detection of Epileptic Seizures Through Advanced Line Spectral Estimation and XGBoost Machine Learning. Computer Sciences & Mathematics Forum, 12(1), 4. https://doi.org/10.3390/cmsf2025012004