Interpretable EEG-Based Epileptic Seizure Detection Using XGBoost Optimized by an Enhanced Bird Swarm Algorithm

Md Daud Ibrahim1, Rana Ahmed2, Anup Chandra Sagor3, Md Belayet Hossain Babla4*

Abstract

Epilepsy affects approximately 50 million people worldwide, and because unexpected seizures can cause serious injuries, efficient automated seizure detection is a clinical priority. This study analyzes electroencephalogram (EEG) signals from the Bangalore EEG Epilepsy Dataset (BEED) using an interpretable machine learning framework that differentiates seizure from non-seizure states. Extreme Gradient Boosting (XGBoost) was used as the classifier and optimized with an Enhanced Bird Swarm Algorithm (EBSA) incorporating a dynamic inertia weight, fitness-weighted vigilance, and Lévy flight-based exploration for feature selection and hyperparameter tuning. The dataset was split into 70% training and 30% testing subsets, and stratified 5-fold cross-validation was used to assess reliability. SHapley Additive exPlanations (SHAP), partial dependence plots (PDPs), and a global surrogate decision tree were used to enhance transparency and clinical interpretability. The baseline XGBoost model achieved 99.71% accuracy, 99.61% precision, 100.00% recall, and a 99.81% F1-score. With EBSA-based feature selection, the optimized model used only 11 features and achieved 99.54% accuracy, 99.39% precision, 100.00% recall, and a 99.70% F1-score. The optimization converged within approximately 60 epochs, and 5-fold cross-validation yielded a mean accuracy of 99.74% and a mean recall of 100.00%. SHAP analysis identified X15, X8, and X6 as the most influential features, PDP analysis revealed positive relationships between X1 and X4 and seizure prediction and non-monotonic effects for X3 and X8, and the surrogate tree identified X8 as the primary decision-boundary feature. The framework can be extended to multi-class seizure classification and validated on additional EEG datasets such as Bonn and CHB-MIT.

Keywords

epilepsy; electroencephalography (EEG); XGBoost; feature selection; seizure classification; Bangalore EEG Epilepsy Dataset (BEED); Bird Swarm Algorithm (BSA); SHAP; partial dependence plots; model interpretability

Cite This Article

Ibrahim, M. D., Ahmed, R., Sagor, A. C., Babla, M. B. H. (2026). Interpretable EEG-Based Epileptic Seizure Detection Using XGBoost Optimized by an Enhanced Bird Swarm Algorithm. International Journal of Scientific Advances (IJSCIA), Volume 7| Issue 5: Sep – Oct 2026, Pages 814-828. URL: https://www.ijscia.com/wp-content/uploads/2026/10/Volume7-Issue5-Sep-Oct-No.1102-814-828.pdf

Volume 7 | Issue 5: Sep – Oct 2026