Seizure Detection in Medical IoT: Hybrid CNN-LSTM-GRU Model with Data Balancing and XAI Integration
Abstract
:1. Introduction
- ▪
- Layer 1: In this layer, the essential role is played by MIoT sensors and actuators responsible for collecting and monitoring various medical and healthcare data.
- ▪
- Layer 2: This layer encompasses the utilization of gateway and edge devices, serving as intermediaries connecting the Wireless Sensor Network (WSN) to cloud servers. These devices form an integral part of the MIoT-based controller platform.
- ▪
- Layer 3: The utilization of cloud computing comes into play here, demonstrating its efficiency in powering intelligent medical IoT systems. The proposed system employs cloud computing servers for the storage and processing of industrial control field data obtained through the MIoT-based controller. The collected medical data are periodically transmitted to the appropriate channel via an IoT protocol like the Constrained Application Protocol (CoAP).
- ▪
- Layer 4: At this layer, the focus shifts towards crafting mobile and web applications that interface with cloud servers to access analytical outcomes generated by applying machine learning techniques to store medical and healthcare data. The primary objective is to provide actionable decision-making insights for healthcare institutions.
- The proposed hybrid framework is a merge of deep learning techniques including Convolutional Neural Networks (CNNs), Long Short-Term Memory (LSTM) networks, and Gated Recurrent Units (GRUs) The suggested hybrid framework is validated for seizure detection in EEG signals.
- The synthetic minority oversampling technique (SMOTE) is applied and is used to balance the dataset by creating additional samples for the minority class. Additionally, the Explainable Artificial Intelligence (XAI) technique, SHAP (Shapley Additive Explanations), is applied to evaluate the importance and effectiveness of the features.
- To validate and determine the effectiveness of the proposed technique in identifying seizures, the comparison result with existing Machine Learning (ML) and Deep Learning (DL) models is conducted. The results demonstrate that the CNN-LSTM-GRU model performed better than other models in the detection of seizures. The proposed technique has a higher accuracy, precision, F1 score, recall, and specificity.
- The proposed model is designed with real Medical IoT (MIoT) applications. So, the model extends the scope of seizure monitoring intelligently due to its scalability and flexibility. The designed approach allows a range of MIoT components to operate efficiently regardless of the deployment environment.
2. Materials and Methods
3. Proposed Seizure Detection for MIoT
3.1. Stages of Proposed Framework
- Step 1 (Data Acquisition): At this initial stage, the imbalanced seizure datasets are collected, forming the foundation for subsequent phases within the proposed framework.
- Step 2 (Data Preprocessing): All instances of the dataset are imported to make them suitable for further processing within the framework. To effectively address the imbalance problem, the SMOTE technique is applied to handle seizure instances.
- Step 3 (Model Training/Testing): The preprocessed and rebalanced dataset is divided into an 80–20 ratio, where 20% is allocated for the testing phase and 80% for the training phase. This initiates the training phase for hybrid Deep Learning models (i.e., CNN-LSTM-GRU). To evaluate the proposed framework, a subset of randomly selected training data is used for the chosen DL for seizure analysis.
- Step 4 (Feature interpretability): In this segment of the framework, the SHAP (Shapley Additive Explanations) technique is employed to enhance interpretability, providing insights into feature contributions for the prediction. This makes it easier to comprehend how the model is attained and helps in the decision-making process
3.2. Proposed Model Architecture
4. Experimental Results
4.1. Epileptic Seizure Recognition Dataset
4.2. Evaluation Metrics
4.3. Results Analysis
4.4. Comparison Results
4.5. Limitations and Challenges
- ▪
- Lack of External Evaluation: The framework’s performance, while impressive, is primarily evaluated using internal validation. The absence of external evaluation on diverse datasets limits its generalizability and raises concerns about its applicability to broader populations.
- ▪
- Synthetic Data Bias: Although SMOTE effectively addresses class imbalance, it may introduce biases by generating synthetic samples that do not fully capture the variability and complexity of real-world data.
- ▪
- Sensitive Medical Data Handling: Managing sensitive medical data presents significant challenges, necessitating strict compliance with data privacy regulations such as HIPAA or GDPR and the implementation of robust anonymization and security measures.
- ▪
- Computational Complexity: The hybrid model’s complexity, combining CNN, LSTM, and GRU architectures, may result in high computational demands, potentially limiting its deployment on resource-constrained devices, especially in real-time Medical IoT (MIoT) environments.
- ▪
- Scalability and Integration: Integrating the model into existing MIoT frameworks and ensuring scalability across diverse medical applications and hardware configurations remains challenging.
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Hemdan, E.E.D.; Essa, Y.M.; Shouman, M.; El-Sayed, A.; Moustafa, A.N. An efficient IoT based smart water quality monitoring system. Multimed. Tools Appl. 2023, 82, 28827–28851. [Google Scholar] [CrossRef]
- Zayed, S.M.; Attiya, G.M.; El-Sayed, A.; Hemdan, E.E.D. A review study on digital twins with artificial intelligence and internet of things: Concepts, opportunities, challenges, tools and future scope. Multimed. Tools Appl. 2023, 82, 47081–47107. [Google Scholar] [CrossRef]
- Miotto, R.; Wang, F.; Wang, S.; Jiang, X.; Dudley, J.T. Deep learning for healthcare: Review, opportunities and challenges. Briefings Bioinform. 2018, 19, 1236–1246. [Google Scholar] [CrossRef] [PubMed]
- Shokri, R.; Shmatikov, V. Privacy-preserving deep learning. In Proceedings of the 2015 53rd Annual Allerton Conference on Communication, Control, and Computing (Allerton), Denver, CO, USA, 12–16 October 2015; pp. 909–910. [Google Scholar] [CrossRef]
- Zhang, X.; Yao, L.; Huang, C.; Sheng, Q.Z.; Wang, X. Enhancing Mind Controlled Smart Living Through Recurrent Neural Networks. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, Halifax, NS, Canada, 13–17 August 2017; Volume 13. [Google Scholar]
- Filho, C.A.S.; Attux, R.; Castellano, G. Can graph metrics be used for EEG-BCIs based on hand motor imagery? Biomed. Signal Process. Control 2018, 40, 359–365. [Google Scholar] [CrossRef]
- Liu, Y.; Huang, H.; Xiao, F.; Malekian, R.; Wang, W. Classification and recognition of encrypted EEG data based on neural network. J. Inf. Secur. Appl. 2020, 54, 102567. [Google Scholar] [CrossRef]
- Zhang, S.; Sun, L.; Mao, X.; Hu, C.; Liu, P. Review on EEG-Based Authentication Technology. Comput. Intell. Neurosci. 2021, 2021, 5229576. [Google Scholar] [CrossRef]
- Jiao, Y.; Zhang, Y.; Chen, X.; Yin, E.; Jin, J.; Wang, X.Y.; Cichocki, A. Sparse Group Representation Model for Motor Imagery EEG Classification. IEEE J. Biomed. Health Inform. 2018, 23, 631–641. [Google Scholar] [CrossRef] [PubMed]
- Chatterjee, R.; Maitra, T.; Islam, S.H.; Hassan, M.M.; Alamri, A.; Fortino, G. A novel machine learning based feature selection for motor imagery EEG signal classification in Internet of medical things environment. Futur. Gener. Comput. Syst. 2019, 98, 419–434. [Google Scholar] [CrossRef]
- Tang, Z.; Li, C.; Sun, S. Single-trial EEG classification of motor imagery using deep convolutional neural networks. Optik 2017, 130, 11–18. [Google Scholar] [CrossRef]
- Li, X.; La, R.; Wang, Y.; Niu, J.; Zeng, S.; Sun, S.; Zhu, J. EEG-based mild depression recognition using convolutional neural network. Med. Biol. Eng. Comput. 2019, 57, 1341–1352. [Google Scholar] [CrossRef] [PubMed]
- Alomari, M.H.; Abubaker, A.; Turani, A.; Baniyounes, A.M.; Manasreh, A. EEG Mouse: A Machine Learning-Based Brain Computer Interface. Int. J. Adv. Comput. Sci. Appl. 2014, 5, 4. [Google Scholar] [CrossRef]
- Ward, C.; Picone, J.; Obeid, I. Applications of UBMs and I-vectors in EEG subject verification. In Proceedings of the 2016 38th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Orlando, FL, USA, 16–20 August 2016; Volume 2016. [Google Scholar]
- Sun, Y.; Chen, X. [Retracted] Automatic Detection of Epilepsy Based on Entropy Feature Fusion and Convolutional Neural Network. Oxidative Med. Cell. Longev. 2022, 1, 1322826. [Google Scholar]
- Ru, Y.; Li, J.; Chen, H.; Li, J. Epilepsy Detection Based on Variational Mode Decomposition and Improved Sample Entropy. Comput. Intell. Neurosci. 2022, 2022, 6180441. [Google Scholar] [CrossRef] [PubMed]
- Zazzaro, G.; Pavone, L. Machine Learning Characterization of Ictal and Interictal States in EEG Aimed at Automated Seizure Detection. Biomedicines 2022, 10, 1491. [Google Scholar] [CrossRef] [PubMed]
- Islam, S.; Thapa, K.; Yang, S.-H. Epileptic-Net: An Improved Epileptic Seizure Detection System Using Dense Convolutional Block with Attention Network from EEG. Sensors 2022, 22, 728. [Google Scholar] [CrossRef]
- Mardini, W.; Yassein, M.M.B.; Al-Rawashdeh, R.; Aljawarneh, S.; Khamayseh, Y.; Meqdadi, O. Enhanced Detection of Epileptic Seizure Using EEG Signals in Combination with Machine Learning Classifiers. IEEE Access 2020, 8, 24046–24055. [Google Scholar] [CrossRef]
- Mallick, S.; Baths, V. Novel deep learning framework for detection of epileptic seizures using EEG signals. Front. Comput. Neurosci. 2024, 18, 1340251. [Google Scholar] [CrossRef]
- Ying, N.; Li, H.; Zhang, Z.; Zhou, Y.; Chen, H.; Yang, M. ViTDFNN: A Vision Transformer Enabled Deep Fuzzy Neural Network for Detecting Sleep Apnea-Hypopnea Syndrome in the Internet of Medical Things. IEEE Trans. Fuzzy Syst. 2024, 33, 82–93. [Google Scholar] [CrossRef]
- Xu, Z.; Wang, Z. MCV-UNet: A modified convolution & transformer hybrid encoder-decoder network with multi-scale information fusion for ultrasound image semantic segmentation. PeerJ Comput. Sci. 2024, 10, e2146. [Google Scholar]
- Kanadath, A.; Jothi, J.A.A.; Urolagin, S. CViTS-Net: A CNN-ViT Network with Skip Connections for Histopathology Image Classification. IEEE Access 2024, 12, 117627–117649. [Google Scholar] [CrossRef]
- Bhattacharya, A. Applied Machine Learning Explainability Techniques: Make ML Models Explainable and Trustworthy for Practical Applications Using LIME, SHAP, and More; Packt Publishing Ltd.: Birmingham, UK, 2022. [Google Scholar]
- Adadi, A.; Berrada, M. Peeking inside the black-box: A survey on explainable artificial intelligence (XAI). IEEE Access 2018, 6, 52138–52160. [Google Scholar] [CrossRef]
- Arrieta, A.B.; Díaz-Rodríguez, N.; Del Ser, J.; Bennetot, A.; Tabik, S.; Barbado, A.; Garcia, S.; Gil-Lopez, S.; Molina, D.; Benjamins, R.; et al. Explainable Artificial Intelligence (XAI): Concepts, taxonomies, opportunities and challenges toward responsible AI. Inf. Fusion 2020, 58, 82–115. [Google Scholar] [CrossRef]
- Loh, H.W.; Ooi, C.P.; Seoni, S.; Barua, P.D.; Molinari, F.; Acharya, U.R. Application of explainable artificial intelligence for healthcare: A systematic review of the last decade (2011–2022). Comput. Methods Programs Biomed. 2022, 226, 107161. [Google Scholar] [CrossRef]
- Saraswat, D.; Bhattacharya, P.; Verma, A.; Prasad, V.K.; Tanwar, S.; Sharma, G.; Bokoro, P.N.; Sharma, R. Explainable AI for Healthcare 5.0: Opportunities and Challenges. IEEE Access 2022, 10, 84486–84517. [Google Scholar] [CrossRef]
- Zhang, H.; Guan, C.; Ang, K.K.; Wang, C.; Chin, Z.Y. BCI competition IV–data set I: Learning discriminative patterns for self-paced EEG-based motor imagery detection. Front. Neurosci. 2012, 6, 7. [Google Scholar]
- 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]
- Schalk, G.; McFarland, D.J.; Hinterberger, T.; Birbaumer, N.; Wolpaw, J.R. BCI2000: A gen-eral-purpose brain-computer interface (BCI) system. IEEE Trans. Biomed. Eng. 2004, 51, 1034–1043. [Google Scholar] [CrossRef] [PubMed]
- Obeid, I.; Picone, J. The Temple University Hospital EEG Data Corpus. Front. Neurosci. 2016, 10, 196. [Google Scholar] [CrossRef] [PubMed]
- Guttag, J. CHB-MIT Scalp EEG Database, version 1.0.0; PhysioNet. MIT Laboratory for Computational Physiology: Cambridge, MA, USA, 2010. [Google Scholar] [CrossRef]
- Ihle, M.; Feldwisch-Drentrup, H.; Teixeira, C.A.; Witon, A.; Schelter, B.; Timmer, J.; Schulze-Bonhage, A. EPILEPSIAE–A European epilepsy database. Comput. Methods Programs Biomed. 2012, 106, 127–138. [Google Scholar] [CrossRef] [PubMed]
- Andrzejak, R.G.; Lehnertz, K.; Mormann, F.; Rieke, C.; David, P.; Elger, C.E. Indications of nonlinear deterministic and finite-dimensional structures in time series of brain electrical activity: Dependence on recording region and brain state. Phys. Rev. E 2001, 64, 061907. [Google Scholar] [CrossRef] [PubMed]
- Hemdan, E.E.-D.; El-Shafai, W.; Sayed, A. CR19: A framework for preliminary detection of COVID-19 in cough audio signals using machine learning algorithms for automated medical diagnosis applications. J. Ambient. Intell. Humaniz. Comput. 2022, 14, 11715–11727. [Google Scholar] [CrossRef] [PubMed]
- Zayed, S.M.; Attiya, G.; El-Sayed, A.; Sayed, A.; Hemdan, E.E.-D. An efficient fault diagnosis framework for digital twins using optimized machine learning models in smart industrial control systems. Int. J. Comput. Intell. Syst. 2023, 16, 69. [Google Scholar] [CrossRef]
- Rezk, N.G.; Alshathri, S.; Sayed, A.; Hemdan, E.E.-D.; El-Behery, H. XAI-Augmented Voting Ensemble Models for Heart Disease Prediction: A SHAP and LIME-Based Approach. Bioengineering 2024, 11, 1016. [Google Scholar] [CrossRef] [PubMed]
- Alalayah, K.M.; Senan, E.M.; Atlam, H.F.; Ahmed, I.A.; Shatnawi, H.S.A. Effective Early Detection of Epileptic Seizures through EEG Signals Using Classification Algorithms Based on t-Distributed Stochastic Neighbor Embedding and K-Means. Diagnostics 2023, 13, 1957. [Google Scholar] [CrossRef] [PubMed]
- Akyol, K. Stacking ensemble based deep neural networks modeling for effective epileptic seizure detection. Expert Syst. Appl. 2020, 148, 113239. [Google Scholar] [CrossRef]
- Kode, H.; Elleithy, K.; Almazedah, L. Epileptic Seizure detection in EEG signals using Machine Learning and Deep Learning Techniques. IEEE Access 2024, 12, 80657–80668. [Google Scholar] [CrossRef]
- Woodbright, M.; Verma, B.; Haidar, A. Autonomous deep feature extraction based method for epileptic EEG brain seizure classification. Neurocomputing 2021, 444, 30–37. [Google Scholar] [CrossRef]
Reference | Methodology | Key Features | Dataset |
---|---|---|---|
Jiao et al. [7] | Sparse Group Representation Model (SGRM) | Uses intersubjective data for BCI | BCI Competition IV (64 EEG channels, 1000 Hz sampling rate, 2 classes, and 7 subjects) [29] |
Chatterjee et al. [8] | Fuzzy Discernibility Matrix (FDM) with SVM and Ensemble | Extracts optimal features from EEG signals | BCI Competition-II Dataset-III [30] training and 140 test trials 9 s long each, 3 channels, 128 Hz sampling rate, 2 classes) [29] |
Tang et al. [9] | Deep CNN | Applied for EEG data classification | Experimental dataset (private dataset from 2 subject 28 experiments) |
Alomari et al. [11] | Coiflets Wavelet and Amplitude Estimation | Feature extraction from EEG signals | PhysioNet EEG dataset (1500 two-minute EEG recordings, obtained from 109 subject) [31] |
Ward et al. [12] | Joint Factor Analysis and I-vectors | Feature extraction with UBM classification | |
Y. Sun and X. Chen. [13] | Multi-feature Fusion with CNN | Used for epilepsy detection | CHB-MIT EEG Dataset (182 records of 23 seizure cases) [33] |
Ru et al. [14] | Noisy Environment Algorithm with VMD | Uses sample entropy and phase synchronization | CHB-MIT EEG Dataset (182 records of 23 seizure cases) [33] |
G. Zazzaro and L. Pavone [15] | Inclusion of Includes preictal/ictal (seizure-related) and interictal (non-seizure) EEG | Enabling patient-specific seizure detection and cross-patient model generalizability | Freiburg Seizure Prediction EEG Database (21 subject of seizure patients using 128 channels, 256 Hz sampling rate) [34] |
Islam et al. [16] | Epileptic-Net | Dynamic deep learning model for seizures | BONN EEG Dataset (4096 samples) [29] |
Khan et al. [17] | Time and Frequency Features with ML models | Logistic Regression, Decision Trees, SVM on TUH corpus | Temple University Hospital (TUH) (16,986 sessions from 10,874 subjects) [34] |
Mardini et al. [18] | DWT, Genetic Algorithm, ML Classifiers | Reduces computation for seizure detection | BONN EEG Dataset (4096 samples) [29] |
Zhan et al. [20] | Hybrid Deep Learning | Using Bi-LSTM, GRU, and average pooling layer | BONN EEG Dataset (4096 samples) [29] |
Class Type | Classes Description | Number of Cases |
---|---|---|
1 (Seizure) | Recording of seizure activity | 2300 |
0 (Normal) | Normal activity | 9200 |
Predicted Seizure | Predicted Normal | |
---|---|---|
Actual Seizure | TP | FP |
Actual Normal | FN | TN |
Algorithm | Accuracy | Precision | Recall | F1-Score |
---|---|---|---|---|
LR | 0.6207 | 0.65 | 0.64 | 0.64 |
DT | 0.9234 | 0.92 | 0.92 | 0.92 |
NB | 0.8891 | 0.90 | 0.89 | 0.89 |
SVM | 0.9647 | 0.96 | 0.96 | 0.96 |
RF | 0.9707 | 0.97 | 0.97 | 0.97 |
KNN | 0.9834 | 0.98 | 0.98 | 0.98 |
CNN | 0.964 | 0.985 | 0.977 | 0.981 |
LSTM | 0.9848 | 0.986 | 0.988 | 0.987 |
GRU | 0.9788 | 0.983 | 0.984 | 0.983 |
Proposed Hybrid Model Without SMOTE | 0.9787 | 0.9786 | 0.9787 | 0.9785 |
Proposed Hybrid Model With SMOTE | 0.9913 | 0.9913 | 0.9913 | 0.9913 |
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
Torkey, H.; Hashish, S.; Souissi, S.; Hemdan, E.E.-D.; Sayed, A. Seizure Detection in Medical IoT: Hybrid CNN-LSTM-GRU Model with Data Balancing and XAI Integration. Algorithms 2025, 18, 77. https://doi.org/10.3390/a18020077
Torkey H, Hashish S, Souissi S, Hemdan EE-D, Sayed A. Seizure Detection in Medical IoT: Hybrid CNN-LSTM-GRU Model with Data Balancing and XAI Integration. Algorithms. 2025; 18(2):77. https://doi.org/10.3390/a18020077
Chicago/Turabian StyleTorkey, Hanaa, Sonia Hashish, Samia Souissi, Ezz El-Din Hemdan, and Amged Sayed. 2025. "Seizure Detection in Medical IoT: Hybrid CNN-LSTM-GRU Model with Data Balancing and XAI Integration" Algorithms 18, no. 2: 77. https://doi.org/10.3390/a18020077
APA StyleTorkey, H., Hashish, S., Souissi, S., Hemdan, E. E.-D., & Sayed, A. (2025). Seizure Detection in Medical IoT: Hybrid CNN-LSTM-GRU Model with Data Balancing and XAI Integration. Algorithms, 18(2), 77. https://doi.org/10.3390/a18020077