This repository explores the application of deep learning algorithms for both seizure detection and seizure prediction using Electroencephalogram (EEG) signals.
We implement and compare various deep learning models to detect and predict seizures in patients with neurological disorders. The models are trained and evaluated on Raw EEG samples.
The ‘Seina Scalp Dataset’, was utilized having clinical EEG recordings from epilepsy patients using the 10-20 EEG system and having sampling rate of 512 Hz.
- Frontal (FP1, FP2, F3, F4, F7, F8, FZ)
- Central (C3, C4, CZ)
- Parietal (P3, P4, P7, P8, PZ)
- Temporal (T7, T8)
- Occipital (O1, O2)
3 channels of EEG data are shown namely - FZ, CZ, PZ channels respectively, along with their categorization of 3 states of seizure – preictal, ictal, postictal.
- Down-sampling: EEG recordings were down-sampled from 512 Hz to 128 Hz to reduce computational overhead without any compromise of vital brainwave dynamics.
- Segmentation: EEG signals were divided into 5-second windows (640 samples per window at 128 Hz). This can help in better detection and prediction without overlapping.
- Normalization: A specific type of feature scaling is done, called ‘z-score standardization’ in which single EEG epochs were individually normalised, i.e. by subtracting the mean and dividing by the standard deviation. This is applied so that it can reduce inter-patient data variation.
- Artifact Management: These EEG Segments having extreme outliers, NaN values, or non-biological noise, were clipped, interpolated and removed.
- Hybrid CNN-BiLSTM
- Attention-Augmented Multilayer Perceptron (MLP)
- Transformer-based Model
- Feedforward Neural Network (FNN)
- Transformer-based Model
Method Pipeline with Deep Learning Model Architectures
| Model | Accuracy | Average Prediction Probabilities |
|---|---|---|
| CNN-BiLSTM | 0.9833 (98.33%) | 0.9692 |
| Autoencoder | 0.9696 (96.96%) | 0.9383 |
| Attention Model | 0.9567 (95.67%) | 0.8157 |
Probability of Preictal Detection across the Temporal Domain of Testing Dataset
| Model | True Positive Area | False Positive Area | Approx. Accuracy |
|---|---|---|---|
| FNN | 0.3 min | 0.1 min | 0.75 (75 %) |
| Transformer Model | 1 min | 0.2 min | 0.89 (~90 %) |
Temporal Overlay Plot for Seizure Detection
Poker Hand Prediction
├── Seizure Detection.ipynb
├── Seizure Detection.ipynb
├── LICENSE
├── NOTICE
└── README.md