International Epilepsy Day is celebrated each year on the 2nd Monday of February, and is a nice opportunity to raise awareness of epilepsy: what it is, how it can be treated, and what is needed to bring treatment to all people who need it.
Since epilepsy detection has been the topic of my research for the last four years, I wanted to bring in the perspective of computer scientists on challenges that still separate us from having wearable epilepsy monitoring devices in everyday life.
But first…
Why talk about epilepsy?
Epilepsy is a chronic neurological disorder characterized by the unexpected occurrence of seizures, which impose serious health risks and many restrictions on the daily life of patients. More importantly, it affects 0.6 to 0.8% of the world’s population [1], meaning close to 1 person in every 150. It is one of the most common neurological diseases [2], in addition to migraine, stroke, and Alzheimer’s disease. However, the causes of epilepsy are not yet fully understood, but the proposed classification is into idiopathic (with a presumed genetic basis), symptomatic (resulting from a structural abnormality), or cryptogenic (resulting from an unknown underlying cause) [3]. There are several divisions of epileptic seizures, and the three simplest are:
- Generalized (involve the whole brain) and focal or partial (have a clear focal point in the brain)
- With or without motor components, i.e. muscle spasms and shaking
- With or without loss of consciousness
Important to know is that today, existing pharmacological treatments do not help one-third of the patients. The danger of having seizures, as well as the fact that many seizures remain unreported due to the patients’ lack of memory of the episode, urges the development of seizure detection solutions in daily life with small, non-stigmatizing, wearable devices.

Figure 1. Epilepsy is characterized by sudden and unexpected seizures with symptoms such as confusion, dizziness, loss of consciousness or uncontrolled muscle contractions
Wearables for epilepsy
Wearables for epilepsy have immense potential for detecting seizures or even ideally predicting them, which is instrumental in designing novel treatments, assisting patients in their daily lives, and preventing possible accidents. Hopefully, one day such devices could warn patient that seizure is coming, send information to his doctor/family and even dose the medication. Patients with epilepsy have expressed a strong interest in the use of new technologies in their daily lives [4]. This need is also evident in the growing number of studies and publications on seizure detection methods and wearable devices. However, technology is not yet allowing us such ideal scenarios.
EEG (electroencephalogram) is the most widely adopted clinical technique for diagnosing, detecting, anticipating, and predicting seizures in clinical practice. Thus, research groups are working on reduced channel set wearable EEG devices, such as eGlasses [5], behind-the-ear sensors [6], or even in-ear devices [7].

Figure 2. EEG based devices for epilepsy monitoring: A. behind-the-ear device proposed in [6], B. e-Glasses proposed in [5], C. in-ear device proposed in [7], and D. CE-certified device from Byteflies [8]
However, EEG is not an ideal biosignal for out-patient wearable devices as it can hardly be instructable and inconspicuous, which is very important as patients are generally afraid of the stigma brought about by wearing such devices. Other biosignals have potential in detecting seizures in much less invasive way and being integrated into small watch or ring-like devices. Some of them are:
- respiration (RSP),
- heart patterns measured through photoplethysmography (PPG) – optical sensors used to measure blood volume changes in e.g., fingers, wrists or earlobe,
- skin temperature (SKT) and electrodermal activity (EDA) which often change when under stress,
- muscle contractions measured with electromyograms (EMG),
- or general body movements measured with gyroscopes and accelerometers (ACC).
In fact, EMG-based devices such as EDII (IctalCare) or SPEAC monitor (The Brain Sentinel) and accelerometry-based ones such as EpiCare Free (Danish Care Technology) or SmartWatch (SmartMonitor) were among the first wearable devices to monitor epilepsy that were proposed. However, they can accurately detect only generalized convulsive seizures that are characterized by uncontrollable shaking, which represent only a small portion of seizures.
Thus, multi-modal devices are being developed. Some examples that are actually available on the market are the Epilert bracelet (www.epilert.io), The Nightwatch (www.nightwatchepilepsy.com), Byteflies’s Sensor-Dot (www.byteflies.com) or Empatica E4 or Embrace 2 (www.empatica.com/research/e4/). Unfortunately, due to mostly working on generalized seizures with strong motor component and not really so well for focal, these devices are not yet fully used in practice.
Finally, innovative solutions for the detection of non-convulsive seizures (which are the majority of seizures) and seizures in a broad range of patients with different seizure origins and morphologies are still ahead of us. Machine and deep learning naturally pose as potential solutions. However, it is not that easy.

Figure 3. Examples of multi-modal devices for epilepsy monitoring
Machine learning for epilepsy – what is the challenge?
Although many studies report impressive levels of accuracy in epilepsy detection using Machine Learning (ML) or Deep Learning (DL) methods, as mentioned, widespread adoption of commercial technology has not yet happened.
The reasons are many, some of which are specific to epilepsy and epilepsy datasets:
- Epilepsy itself and epilepsy recordings are characterized by the vast imbalance in data distribution (i.e., the amount of seizure vs. non-seizure data). There are different approaches used in ML, such as data over or under-sampling (or their combinations); however, this does not represent reality. Thus, if we need to have realistic performance of the algorithm, it is essential to at least test them on the original distribution of data.
- Further, seizures show highly personal patterns, meaning that general models that are trained on a big dataset of many patients will not necessarily perform well on all individuals. However, training individual models requires either weeks of recordings from individuals, which is often infeasible, or requires new methods of personalizing general models using the specific features of individual patients – a field that is not yet well explored.
- We do not have many publicly available epilepsy datasets as most of them are kept private, which makes it hard to use their full potential. At the same time, the performance of the algorithm might highly depend on the characteristics of a dataset, making it hardly comparable with other reported results. Thus, initiatives to create more public datasets are needed.
The second aspect that poses challenges is the methodologies used in training and testing ML algorithms. On the one hand, this makes reported results hard to relate to what would be performed in real life when patients are using devices 24/7. On the other hand, it makes comparison with other algorithms impossible unless researchers reimplement selected algorithms for comparison within their own evaluation framework, which is highly time-consuming, and almost nobody does it. This issue has been tackled in other research fields by providing a standard machine-learning task definition and benchmark, effectively leading to dramatic improvements in fields such as image classification, conversational agents, or computational models of brain function. Thus, recently, in the scope of my PhD and research project, we focused on designing the methodological framework for epilepsy detection. In the scope of the framework, we propose standardization in datasets, evaluation methodologies, and performance metrics. We focus on several important aspects of ML algorithm evaluation:
- Datasets are often in different formats, making usage of multiple of them extremely time-consuming and unlikely. This prevents us from fairly comparing results from different authors using different datasets. As part of our proposal, we selected a small group of publicly available datasets and standardized the format of data and annotations, thus encouraging researchers to train and test their algorithms on multiple datasets. This also allows for testing the generalizability of the algorithms as well as knowledge transfer between different datasets.
- Evaluation methodology, most prominently the cross-validation approach, has a large influence on reported results but is often not described well enough. Further, many methods exist to split the data, but they do not necessarily meet the requirement of independence between the training and test sets, which could lead to overestimation of the performance of an algorithm. For example, in epilepsy detection, an overestimation of the accuracy is present due to the same subjects being present both in the training and test sets, which has to be strongly avoided. Moreover, in personal models, it is important to respect the chronology of recordings by using retrospective data in the training set and prospective data in the test set.
- Finally, performance metrics used to report results are critical, not only for fair comparison between studies but also for adoption and interpretation of the reported results. On one side, computer scientists use metrics like sensitivity, precision, F1 or AUC score, etc., on a sample basis, while on the other side, medical experts and patients ask for the sensitivity of seizure episodes (not samples) and a number of false positives per day, too. Thus, we need metrics that satisfy the needs of both communities, which we propose in our framework.
The proposed framework and benchmark to be used for testing epilepsy detection algorithms using EEG 10-20 scalp recordings can be found on our website: https://eslweb.epfl.ch/epilepsybenchmarks/
In the end, it is important to understand the complexity of requirements such devices need to satisfy in order to be accepted by patients and doctors. They must be precise and reliable but also lightweight, small, and unobstructing, with significant computational power and sufficient battery lifetime. This means that many state-of-the-art algorithms are infeasible due to excessive memory and/or power requirements.

Figure 4. The example between evaluating performance on the scale of samples (interesting for engineers) and on the scale of epilepsy events (interesting for patients and doctors)
Hyperdimensional computing for epilepsy
For the reason of the computational and memory challenges of many DL algorithms today, in my Ph.D. thesis, I focused on testing one new approach to machine learning called hyperdimensional computing (HDC).
HDC is a novel ML paradigm inspired by neuroscience research, based on data representation in the shape of high-dimensional hypervectors, usually having more than 10000 dimensions [8]. This paradigm shift in data representation brings various advantages for efficient learning and low-power hardware implementation: parallelization possibilities open the way to design efficient accelerators [9] or in-memory computation [10]. But also, from a learning perspective, it opens new paths for semi-supervised [11], distributed [12], continuous online learning [12], or multi-centroid learning [14]. Thus, HD computing has attracted a great deal of attention for various biomedical applications, one of them being epilepsy detection [15,16].
As part of my PhD thesis at EPFL in Lausanne, I worked on improving two main parts of the HD computing workflow: encoding data into vectors and learning from those vectors. For example, for encoding, I proposed different methods to encode three-dimensional sets of information (features with spatial and temporal information), such as EEG.
Then, to improve learning on highly personalized and unbalanced data such as epilepsy ones, I proposed a new multi-centroid learning approach[14], where the algorithm automatically decides when some patterns are too different, and multiple subclasses (centroids) are needed to represent one class (e.g., seizures).
Then, we studied the interplay between personal and general models [17]. For example, if each patient wears their own device and the algorithm learns a model for that patient, how to use those personal models to create a general model? How many personal models are needed to create a reliable general model, and how can we combine both general model and personal models to achieve higher seizure detection accuracy?
We also tested knowledge transfer between models trained on different datasets to test how realistic it is to train models once and use them on slightly different recording setups.
Finally, one important aspect of HDC is its potential for real-time interpretability of predictions, telling us which EEG channels or features were most important for deciding on the seizure or non-seizure prediction at every point in time. This aspect is very important as black-box models are not well accepted in the medical domain, no matter their performance.

Figure 5. Example of the simplest way of encoding data to HD vectors and learning from them.
Finally, I believe that hyperdimensional computing is one way that can help bring wearable and interpretable healthcare systems closer to reality and patients’ everyday lives, but there are many more that are still not explored! And epilepsy patients are still waiting. Thus, if you are going into machine learning, maybe epilepsy detection could be one of your next challenges to tackle 😀
For all questions, feel free to contact me at una.pale (at) gmail.com
[1] F. Mormann et al., “Seizure prediction: the long and winding road”, Brain: A Journal of Neurology, 2007, DOI:10.1093/brain/awl241.
[2] M. Ihle et al., “EPILEPSIAE – an European epilepsy database”, ComputerMethods and Programs in Biomedicine, 2012. DOI: 10.1016/j.cmpb.2010.08.011.
[3] P. Kwan and M. J. Brodie, “Early identification of refractory epilepsy”, The New England Journal of Medicine, 2020. DOI: 10.1056/NEJM200002033420503.
[4] S. K. Simblett et al., “Patient perspectives on the acceptability of mHealth technology for remote measurement and management of epilepsy: a qualitative analysis”, Epilepsy & Behavior, 2019. DOI: 10.1016/j.yebeh.2019.05.035.
[5] D. Sopic et al., “E-Glass: A Wearable System for Real-Time Detection of Epileptic Seizures”, in IEEE International Symposium on Circuits and Systems (AISCAS), 2018, DOI: 10.1109/ ISCAS.2018.8351728.
[6] M. Guermandi et al., “A wearable device for minimally-invasive behind-the-ear EEG and evoked potentials”, in IEEE Biomedical Circuits and Systems Conference (BioCAS), 2018, DOI: 10.1109/BIOCAS.2018.8584814.
[7] M. Guermandi et al., “A wireless system for EEG acquisition and processing in an earbud form factor with 600 hours battery lifetime”, in IEEE Engineering in Medicine & Biology Society (EMBC), 2022, DOI: 10.1109/EMBC48229.2022.9871874.
[8] P. Kanerva, “Hyperdimensional Computing: An Introduction to Computing in Distributed Representation with High-Dimensional Random Vectors”, Cognitive Computation, 2009, DOI:10.1007/s12559-009-9009-8.
[9] M. Imani et al., “Revisiting Hyper Dimensional Learning for FPGA and Low-Power Architectures”, IEEE HPCA, 2021, DOI:10.1109/HPCA51647.2021.00028.
[10] G. Karunaratne et al., “Energy Efficient In-Memory Hyperdimensional Encoding for Spatio-Temporal Signal Processing”, IEEE TCAS, 2021, DOI:10.1109/TCSII.2021.3068126.
[11] M. Imani et al., “SemiHD: Semi-Supervised Learning Using Hyperdimensional Computing”, IEEE ICCAD, 2019, DOI:10.1109/ICCAD45719.2019.8942165.
[12] M. Imani et al., “A Framework for Collaborative Learning in Secure High-Dimensional Space”, IEEE CLOUD, 2019, DOI:10.1109/CLOUD.2019.00076.
[13] S. Benatti et al., “Online Learning and Classification of EMG-Based Gestures on a Parallel Ultra-Low Power Platform Using Hyperdimensional Computing”, IEEE TBIoCAS, 2019, DOI:10.1109/TBCAS.2019.2914476.
[14] U. Pale et al., “Multi-Centroid Hyperdimensional Computing Approach for Epileptic Seizure Detection”, Frontiers in Neurology, 2022, DOI: 10.3389/fneur.2022.816294
[15] A. Burrello et al., “An Ensemble of Hyperdimensional Classifiers: Hardware-Friendly Short-Latency Seizure Detection With Automatic iEEG Electrode Selection”, IEEE JBHI, 2021, DOI:10.1109/JBHI.2020.3022211.
[16] F. Asgarinejad et al., “Detection of Epileptic Seizures from Surface EEG Using Hyperdimensional Computing”, IEEE EMBC, 2020, DOI:10.1109/EMBC44109.2020.9175328.
[17] U. Pale et al., “Combining general and personal models for epilepsy detection with hyperdimensional computing“, Artificial Intelligence in Medicine, 2024, DOI: 10.1016/j.artmed.2023.102754