EEG-Based Epileptic Seizure Prediction
By Courage Attikpo
What Is Epilepsy and Why Does Prediction Matter?
Epilepsy is a brain condition where a person experiences repeated seizures. A seizure is a sudden burst of abnormal electrical activity in the brain. Depending on which part of the brain is affected, it can look like a brief blank stare, uncontrolled shaking, or a full loss of consciousness. Over 70 million people worldwide live with epilepsy, and around one in three of them cannot control their seizures with medication alone.
The hardest part about epilepsy is not knowing when the next seizure will come. That unpredictability stops people from driving, working certain jobs, or even being alone. If a system could warn a person a few minutes before a seizure, they could sit down, alert someone nearby, or take a fast-acting medication. That is the goal of seizure prediction.
An EEG (electroencephalogram) records the brain's electrical activity using electrodes placed on the scalp. It is the main tool used in epilepsy research because it is non-invasive, relatively affordable, and can run continuously for hours. The brain passes through four measurable states around a seizure: a normal resting state between seizures, a pre-seizure build-up phase with subtle electrical changes, the seizure itself, and a recovery phase after. Seizure prediction focuses on detecting that pre-seizure build-up phase before the seizure begins.
How the EEG Signal Is Processed
A raw EEG signal is messy. It picks up interference from eye blinks, muscle movements, heartbeat, and electrical equipment nearby. The first step is cleaning: filters are applied to remove power-line noise and anything outside the brain's useful frequency range. More advanced methods use mathematical tools like Wavelet Transform or Independent Component Analysis to separate and remove non-brain signals while keeping the real brain activity intact. Once the signal is clean, the next step is feature extraction, turning the signal into numbers that describe its key properties. There are four main types of features:
- Time-domain features: basic measurements like average amplitude, variance, and signal complexity.
- Frequency-domain features: how much energy sits in each brainwave band (Delta, Theta, Alpha, Beta, Gamma). Seizures tend to change the energy distribution across these bands.
- Time-frequency features: tools like the Short-Time Fourier Transform (STFT) or Wavelet Transform show how the frequency content of the signal changes over time, useful because seizures happen quickly.
- Non-linear features: measurements like entropy (how random the signal is) and Lyapunov exponent (how unstable the system is) can detect subtle pre-seizure changes up to 240 minutes before onset.
The goal of feature extraction is to give the model enough information to distinguish a pre-seizure brain from a normal one. In a wearable device where resources are limited, a feature selection step then picks only the most useful features to keep the system lightweight.
Building the Prediction Model
Once features are extracted, a model is trained to classify each window of EEG as either pre-seizure or normal. Classical machine learning methods like Support Vector Machines (SVM) and k-Nearest Neighbours (KNN) work well when given good hand-crafted features. A wearable device study achieved 91.5% accuracy using Boosted Trees with just eight features from EEG, ECG (heart rhythm), and PPG (pulse) signals combined.
Deep learning models go further by learning features on their own, directly from the raw or lightly processed signal. The most common architectures are:
- CNN (Convolutional Neural Network): good at detecting local patterns in the signal, such as characteristic spike shapes.
- LSTM / GRU (Long Short-Term Memory / Gated Recurrent Unit): designed for sequences over time, they remember earlier parts of the signal when classifying the current moment.
- Hybrid models (CNN + LSTM or CNN + Bi-GRU): combine both strengths, pattern detection and memory, and consistently outperform either alone.
- Transformer: uses an attention mechanism to focus on the most informative time points across a long window.
Because pre-seizure segments are much rarer than normal segments, the dataset is imbalanced. Techniques like Random Under-Sampling (which removes excess normal examples) or GAN-based data generation (which creates synthetic seizure examples) are used to balance the training data before the model sees it.
For wearable deployment, the model must be small and fast. A lightweight 2D-CNN with an attention block and a Bi-GRU layer, trained on STFT spectrograms, gives the best balance of accuracy and efficiency. It can be compressed further through a process called quantisation, reducing its memory footprint so it runs on a low-power microcontroller.
Evaluating the Model
Accuracy alone is a misleading metric for seizure prediction because the dataset is so imbalanced. A model that never predicts a seizure can still score 99% accuracy. The metrics that actually matter are:
- Sensitivity: what percentage of real pre-seizure windows did the model correctly identify?
- Specificity: how often did it correctly identify a normal window as normal?
- False Positive Rate (FPR/hour): how many false alarms does it raise per hour? Too many false alarms make a device useless in daily life.
- AUC: the area under the ROC curve, a single number summarising sensitivity vs. specificity trade-offs.
The model is trained on 70% of the data and tested on the remaining 30%. Five-fold cross-validation is also used, the data is split into five parts and the model is trained and tested five times on different splits, which gives a more reliable performance estimate than a single split.
What Still Needs to Be Solved
Despite strong benchmark results, several problems prevent these systems from being used in everyday life. Most published datasets are small, typically 20 to 30 patients, and were recorded in controlled hospital settings with the patient lying still. Real-world use involves motion, sweat, loose electrodes, and variable signal quality.
Seizure patterns also differ significantly between patients, and even change in the same patient over time. A model trained on one person’s data often performs poorly on another’s. Building a model that adapts to the individual without requiring months of labelled seizure data upfront remains an open problem.
Finally, most studies are not evaluated under clinically meaningful conditions. The field is moving toward standard criteria that measure prediction horizon, seizure occurrence period, sensitivity, and false alarm rate together, because a device that gives a 30-second warning is not as useful as one that gives a 5-minute warning.
The path forward involves building larger open datasets from wearable-grade recordings, developing models that personalise themselves over time, and validating systems in real ambulatory settings outside the hospital.
Source: Zhang et al., "A review of epilepsy detection and prediction methods based on EEG signal processing and deep learning," Frontiers in Neuroscience (2024) and Rasheed et al., "Machine Learning for Predicting Epileptic Seizures Using EEG Signals: A Review," arXiv Review (2020).

Courage Xoese Attikpo
Engineering & Research
Electrical Engineering student at KNUST, passionate about using technology to build early warning detection tools for neurological diseases.
More like this
Epilepsy Through The Lens Of EEG
Epilepsy affects over 50 million people worldwide, but it can be difficult to diagnose. Discover how EEG brings clarity to seizure detection and classification.
Translational fMRI: Bridging Neuroscience, Medicine, and Clinical Practice.
Functional Magnetic Resonance Imaging (fMRI) is advancing beyond cognitive research into clinical practice, driving innovations in neurosurgical planning, biomarker discovery, and personalized therapeutic monitoring.
Like this? Get the next one.
One email when we publish. No noise.
One email when we publish. Unsubscribe any time. Privacy.