Online Epileptic Seizure Detection in Long-term iEEG Recordings Using Mixed-signal Neuromorphic Circuits ======================================================================================================== * Olympia Gallou * Jim Bartels * Saptarshi Ghosh * Kaspar Schindler * Johannes Sarnthein * Giacomo Indiveri ## Abstract Seizure detection stands as a critical aspect of epilepsy management, which requires continuous monitoring to improve patient care. However, existing monitoring systems face challenges in providing reliable, long-term, portable solutions due to the computational expense and power demands of continuous processing and data transmission. Edge computing offers a viable solution by enabling efficient processing locally, close to the sensors and without having to transmit the sensory signals to remote computing platforms. In this work, we present a mixed-signal hardware implementation of a biologically realistic Spiking Neural Network (SNN) for always-on monitoring with on-line seizure detection. We validated the hardware system with wideband Electroencephalography (EEG) signal recordings with over 122 continuous hours of data, without pre-filtering. The network was tested with a cohort of 5 patients and a total number of 22 seizures including generalized and focal onsets. Our system effectively captures spatiotemporal features based on synchronized multichannel intracranial EEG activity, achieving 100% sensitivity across all patients and near zero false alarms. Remarkably, inference across patients required only calibrating the parameters of the network’s output layer on a single recorded seizure from the patient. Index Terms * EEG * seizure detection * event-based processing * spiking neural networks * neuromorphic processor * edge computing ## I. Introduction Epilepsy is one of the most prevalent neurological disorders that affects millions of people worldwide, with an estimated 5 million individuals diagnosed each year [1]. Approximately one-third of patients do not respond to existing pharmacological treatments and continue to suffer from uncontrolled seizures [2]. These recurrent episodes can significantly influence the quality of life of patients, increase the risk of accidents, and even lead to Sudden Unexpected Death in Epilepsy (SUDEP) [3]. In clinical practice, EEG and video surveillance remain the gold standard diagnostic tools. Drug-resistant patients may need to undergo invasive channel implantation when routine EEG findings are insufficient for surgical planning. In Epilepsy Monitoring Unit (EMU), patients need to stay restricted for several days connected to bulky machinery with many wires. Both invasive and noninvasive systems require significant hospital resource investments, extensive expertise, and time for manual EEG annotation. In addition, routine practice involves patients or caregivers filling out seizure diaries, which can, however, lead to misreporting and inaccurate records [4]. These challenges underscore the need for more efficient and patient-friendly embedded monitoring solutions. Recently, the market for remote epilepsy monitoring devices has experienced substantial growth. The development of wearable and implantable technologies addresses many limitations associated with traditional restrictive monitoring systems, including the physical constraints of wired EEG setups, accessibility, and the high costs associated with prolonged hospital stays. In general, the design of such battery-powered systems should be optimized in resource-controlled environments, where size, algorithmic complexity, and energy play a crucial role. State-of-the-art EEG devices [5]–[8] are equipped with various sensors that measure physiological signals such as accelerometry, heart rate variability, electrodermal or Electromyography (EMG) activity, while integrated Machine Learning has opened a new avenue for non-invasive real-time monitoring [9]–[11]. In the literature, most of the reported seizure detection devices are still in the early stages of development. Currently, there are only a few Food and Drug Administration (FDA) or EU-cleared devices in class II; these are capable of detecting Generalized Tonic-Clonic Seizure (GTCS) in real time with non-EEG modalities [8]–[11]. There are EEG-based devices that detect specific types of seizures, including focal seizures [12] or absence seizures [13]. Two primary challenges are associated with high computational demands that reduce battery life and sub-optimal performances characterized by high False-Alarm-Rate (FAR). The need for frequent battery recharges disrupts continuous monitoring and adds a layer of inconvenience and stress to the patient. In addition, elevated FAR can lead to desensitization and reduced compliance. Event-based neuromorphic devices have emerged as promising candidates for enabling energy-efficient biosignal monitoring and computation at the edge [14], [15] (Fig. 1). In particular, SNNs implemented in mixed-signal analog/digital neuromorphic processors have already been reported to perform spatiotemporal tasks that involve noisy electrophysiological signals efficiently [16]–[19]. In [20], an ultra-low-power Complementary Metal-Oxide-Semiconductor (CMOS)-based seizure detection approach is applied to in vitro Local Field Potential (LFP) signals, but shows very limited robustness against interictal periods carrying artifacts. ![Fig. 1:](http://medrxiv.org/https://www.medrxiv.org/content/medrxiv/early/2024/06/13/2024.06.13.24308876/F1.medium.gif) [Fig. 1:](http://medrxiv.org/content/early/2024/06/13/2024.06.13.24308876/F1) Fig. 1: Conventional and alternative neuromorphic System-On-Chip (SoC) approaches for EEG-based seizure detection. In this paper, we present and validate a robust spike-based hardware setup that enables long-term seizure monitoring from intracranial EEG signals using a low-power mixed-signal neuromorphic processor, with very low sensitivity to artifacts and false-alarm rates. ## II. Materials and methods ### A. Delta-modulation scheme and adaptive encoding As the neuromorphic chip expects inputs in the form of asynchronous events, the EEG signals in the input data streams must first be converted to an event-based representation. One of the most prevalent interfacing devices used for this purpose is the Asynchronous Delta Modulator (ADM) circuit [21]. The ADM operates by encoding the changes or “delta” in the input signal asynchronously, generating events whenever the signal crosses predefined delta-thresholds. If the amplitude change in the continuous time signal since the previous event increases by a delta threshold, the ADM produces an event labeled *“UP”*, and if the signal decreases by a delta threshold the circuit produces a *“DOWN”* event. A common challenge is to establish the value of the delta threshold parameter in a way that does not significantly affect biomarker detection performance based on different noise levels: if the delta parameter is too small, the ADM will produce many events, increasing bandwidth usage and power consumption. If it is set too high, the ADM will produce too few events, and loose relevant information in the original signal. Previous applications relied on baseline-heuristics for calibrating the ADM circuits [16], [19], [22]. Recently, a novel adaptive thresholding circuit for the ADM was introduced, ideal for always-on biomedical signal processing tasks, where the encoding threshold parameter adaptively changes in real time based on the amplitude of the incoming signals [23]. This adaptive ADM circuit can dynamically adjust the delta threshold parameter to amplitude changes that may occur during long recording sessions and minimize the generation of events in background activity while retaining the information related to large anomalous fluctuations. In this work we made a hardware-aware behavioral simulation of the circuit, employing an equivalent structure to reproduce its features for implementing such adaptive thresholding feature in our long-recording data-set sessions. To reduce the computational cost of the software simulation, the adaptive delta threshold values were calculated only during a calibration period of 10 s for each channel at the start of the first interictal recording session. After this calibration phase, the delta threshold voltage values were kept fixed for each signal and the subsequent hour segments for each patient. The other ADM free parameter is its refractory period [21]. In our simulation we set this to 10 μs. The original event-based Intracranial Electroencephalography (iEEG) signal streams, which encapsulate the temporal dynamics of the brain’s electrical activity were therefore converted to a compressed stream of events “UP” and “DN” that was then transmitted to the neuromorphic spiking neural network chip. ### B. Mixed-signal neuromorphic processor The SNN was configured on the mixed-signal Dynamic Neuromorphic Asynchronous Processor (DYNAP)-SE neuromorphic processor [24] as a prototype of an “always on” spike-based real-time seizure detection system. Each chips comprises 1024 Adaptive Exponential Leaky Integrate-and-fire (AdEx I&F) neurons, with 64 input synapse circuits each. The prototype SNN was designed to be scalable and employ a limited number of neurons (up to 106 neurons) on a single chip, for a maximum number of input EEG channels of 60, due to fan-in hardware constraints. As the synapse and neuron circuits are analog, the chip is affected by device mismatch, which can however be mitigated, using population coding and other bio-inspired processing strategies [25]. In this work, only the neuronal and synaptic parameters of two cores on the chip had to be tuned, to achieve the desired network behavior. In addition, we configured the synapse circuits to implement excitatory fast-α-Amino-3-hydroxy-5-methyl-4-isoxazolepropionic Acid (AMPA), slow-*N*-Methyl-d-aspartate (NMDA), and inhibitory shunting-γ-Aminobutanoic Acid (GABA)-A and subtractive-GABA-B type dynamics. ### C. The SNN architecture The hardware SNN was designed by following strategies that could help overcome the device mismatch and the noisy nature of subthreshold analog circuits, such as ensemble averaging and feedforward inhibition. The architecture is a shallow network which consists of interconnected neuron ensembles, organized into two simple successive feedforward layers as described in Fig. 2, where only a subset of 12 channels is depicted, for sake of clarity. The encoded input channels are grouped into triplets that simultaneously stimulate the adjacent excitatory and inhibitory neuron ensembles of the hidden layer with feed-forward AMPA connections. Each triplet represents a subset of encoded input EEG channels whose grouping can vary depending on the number of inputs. Each hidden neuronal ensemble comprises five neurons. The inhibitory clusters send inhibitory connections to all the hidden groups of neurons except the one that was excited from the same input triplet. From the hidden layer to the output, all hidden groups project NMDA excitatory connections to an additional inhibitory cluster, and excitatory AMPA connections to the read-out neuron. The cluster of inhibitory interneurons with slower inhibitory connections in the second layer plays a normalizing regulatory role, curtailing overexcitation that could otherwise lead to mis-classification. The weights and time constants of the neuron populations in the hidden layer were uniform and tuned based on two target seizure events with focal (10 seconds) and generalized onset (40 seconds). After this tuning process, the parameters were kept fixed for all subject recordings in the hidden layer. The output layer (weights and time constants) were further fine-tuned, for each subject, based on one single seizure onset from their corresponding data. ![Fig. 2:](http://medrxiv.org/https://www.medrxiv.org/content/medrxiv/early/2024/06/13/2024.06.13.24308876/F2.medium.gif) [Fig. 2:](http://medrxiv.org/content/early/2024/06/13/2024.06.13.24308876/F2) Fig. 2: Pipeline for spike-based electrographic seizure detection with a full-SNN architecture implemented on a neuromorphic processor. ### D. Human Long-term iEEG dataset We tested our network on continuous long-term recordings from the publicly available SWEC-ETHZ iEEG database [26]. The database includes hourly segmented recordings from drug-resistant patients who were monitored intracranially using grid, strip, or depth electrodes. After converting the analog signals to 16-bit digital format, median referencing and digital bandpass filtering between 0.5 Hz and 120 Hz, were applied. Expert annotations (onset and offset of the seizure) are provided for each ictal hour. We tested recordings of 5 patients with up to 60 input channels and 22 seizures with generalized and focal onsets. The analysis involves continuous event-based processing, allowing observation and detection of epileptic seizure events in their entirety. ## III. Results ### A. The SNN behavior Figure 3 shows the average firing rates of the ADM encoded input channels (top plot) and hidden excitatory and inhibitory neuron groups (bottom plot) during one hour. As shown, feedforward inhibition leads to a reduced firing rate in the hidden layer, while the read-out neuron in the output layer responds to sustained synchronized activity with a rapid increase in the firing rate shortly after the marked seizure onset. Interictal periods are characterized by near-zero firing rates in all patients, highlighting the output neuron’s inactivity or minimal activity in the absence of seizures. Based on this behavior, the estimated average power consumption of the chip, averaged across all configurations adapted to the varying number of channels for each patient is P=12.48 μW (see [27] for the details on the formula used to estimate the power consumption of each circuit component in the chip). ![Fig. 3:](http://medrxiv.org/https://www.medrxiv.org/content/medrxiv/early/2024/06/13/2024.06.13.24308876/F3.medium.gif) [Fig. 3:](http://medrxiv.org/content/early/2024/06/13/2024.06.13.24308876/F3) Fig. 3: Firing rates of the ADM encoded input channels, SNN neuron groups and output during one hour of recording. ### B. Synchronization scores and correlation matrices The degree of synchronization in different stages, from the original EEG to the encoded ADM input and hidden activity of the SNN, was quantified using group-specific correlation matrices and averaged synchronization scores (see in Fig. 4). The correlation matrices illustrate the similarity between the amplitude envelopes of different original EEG channel sets, while the synchronization scores, calculated with a coincidence window of 100 ms, indicate the ratio of observed coincidences to those expected by chance, providing a normalized measure of synchrony. These results indicate a consistent trend across both measures, suggesting that the amplitude synchronization of the EEG signals is mirrored in the temporal synchrony of the spike trains during an ictal period. Higher synchronization scores from ADM-encoded inputs correlate with higher CIs in the SNN hidden layers, demonstrating that the network effectively captures the relevant synchronization features to accurately detect seizure activity. ![Fig. 4:](http://medrxiv.org/https://www.medrxiv.org/content/medrxiv/early/2024/06/13/2024.06.13.24308876/F4.medium.gif) [Fig. 4:](http://medrxiv.org/content/early/2024/06/13/2024.06.13.24308876/F4) Fig. 4: Averaged Synchronization scores within groups based on Coincidence Index (CI). ### C. Patient-specific seizure detection We investigated the average firing rate of the output neuron during the ictal and interictal periods to minimize false alarms. This analysis aimed to determine the feasibility of using an optimal universal temporal window to calculate performance metrics. Figure 5 highlights the variability in firing rates between ictal patterns and patients, reflecting differences in seizure dynamics and characteristics. Sensitivity was defined as the proportion of detected seizures in the test set, and delay was calculated as the time from annotated seizure onset to the first 2-second detected interval that met the detection threshold of six spikes. The FAR was measured by counting 2-second intervals with six or more spikes during non-seizure periods and normalizing by the total duration of 20 interictal recording hours per patient. Table I summarizes for each patient the sensitivity, FAR, mean onset delay, and comparison with other works. In 3 out of 5 patients, the SNN achieved zero false alarms and accurately identified all seizure events. View this table: [TABLE 1:](http://medrxiv.org/content/early/2024/06/13/2024.06.13.24308876/T1) TABLE 1: Performance Metrics ![Fig. 5:](http://medrxiv.org/https://www.medrxiv.org/content/medrxiv/early/2024/06/13/2024.06.13.24308876/F5.medium.gif) [Fig. 5:](http://medrxiv.org/content/early/2024/06/13/2024.06.13.24308876/F5) Fig. 5: Mean firing rate during ictal and interictal periods for each patient. ## IV. Discussion and Conclusions We demonstrated that long-term reliable seizure monitoring and detection on a resource-constrained CMOS neuromorphic chip is feasible using population averaging and E-I balance mechanisms. Our proposed solution effectively addressed two common challenges: high FAR and power consumption. The hardware SNN successfully detected all seizure events in 5 patients. Future work aims at the realization of a dedicated ultra-low power ASIC with an Analog Front-End (AFE), an adaptive ADM encoding circuit and the corresponding SNN in one single device. New generations and advancements in specialized devices, particularly with AFE integration and online learning, hold the potential to provide a complete end-to-end solution for low-power implantable and wearable on-edge seizure detection devices. Although the implemented system operates in real time and the chip delivers very low latency, the network currently detects seizure onset activity with a mean delay of 18.8 seconds. Despite this delay, the significant reduction in latency achieved by the system, combined with clinically low FAR, paves the way for closed-loop neuromodulation SoC. Future work will aim to accomplish earlier detection delays to allow the development of closed-loop feedback strategies for real-time seizure suppression and dynamic neuromodulation. ## Data Availability The original data were derived from the following resources available in the public domain [http://ieeg-swez.ethz.ch/](http://ieeg-swez.ethz.ch/). [http://ieeg-swez.ethz.ch/](http://ieeg-swez.ethz.ch/) * Received June 13, 2024. * Revision received June 13, 2024. * Accepted June 13, 2024. * © 2024, Posted by Cold Spring Harbor Laboratory This pre-print is available under a Creative Commons License (Attribution-NonCommercial-NoDerivs 4.0 International), CC BY-NC-ND 4.0, as described at [http://creativecommons.org/licenses/by-nc-nd/4.0/](http://creativecommons.org/licenses/by-nc-nd/4.0/) ## References 1. [1].WHO, Epilepsy: a public health imperative. World Health Organization, 2019, isbn: 978-92-4-151593-1. 2. [2]. B. Sultana, M.-A. Panzini, A. Veilleux Carpentier, et al., “Incidence and prevalence of drug-resistant epilepsy: A systematic review and meta-analysis,” Neurology, vol. 96, no. 17, pp. 805–817, 2021. [CrossRef](http://medrxiv.org/lookup/external-ref?access_num=10.1212/WNL.0000000000011839&link_type=DOI) [PubMed](http://medrxiv.org/lookup/external-ref?access_num=33722992&link_type=MED&atom=%2Fmedrxiv%2Fearly%2F2024%2F06%2F13%2F2024.06.13.24308876.atom) 3. [3]. B. H. Brinkmann, P. J. Karoly, E. S. Nurse, et al., “Seizure diaries and forecasting with wearables: Epilepsy monitoring outside the clinic,” Frontiers in Neurology, vol. 12, p. 690 404, 2021. 4. [4]. M. J. Cook, T. J. O’Brien, S. F. Berkovic, et al., “Prediction of seizure likelihood with a long-term, implanted seizure advisory system in patients with drug-resistant epilepsy: A first-in-man study,” The Lancet Neurology, vol. 12, no. 6, pp. 563–571, 2013. 5. [5]. J. Arends, R. D. Thijs, T. Gutter, et al., “Multimodal nocturnal seizure detection in a residential care setting: A long-term prospective trial,” Neurology, vol. 91, no. 21, e2010–e2019, 2018. 6. [6]. S. Beniczky, I. Conradsen, O. Henning, M. Fabricius, and P. Wolf, “Automated real-time detection of tonic clonic seizures using a wearable emg device,” Neurology, vol. 90, no. 5, e428–e434, 2018. 7. [7]. S. Beniczky, S. Wiebe, J. Jeppesen, et al., “Automated seizure detection using wearable devices: A clinical practice guideline of the international league against epilepsy and the international federation of clinical neurophysiology,” Clinical Neurophysiology, vol. 132, no. 5, pp. 1173–1184, 2021. 8. [8]. A. van Westrhenen, R. H. Lazeron, J. P. van Dijk, et al., “Multimodal nocturnal seizure detection in children with epilepsy: A prospective, multicenter, long-term, in-home trial,” Epilepsia, vol. 64, no. 8, pp. 2137–2152, 2023. 9. [9]. F. Onorati, G. Regalia, C. Caborni, et al., “Prospective study of a multimodal convulsive seizure detection wearable system on pediatric and adult patients in the epilepsy monitoring unit,” Frontiers in Neurology, vol. 12, p. 724 904, 2021. 10. [10]. D. Johansson, F. Ohlsson, D. Krýsl, et al., “Tonic-clonic seizure detection using accelerometry-based wearable sensors: A prospective, video-eeg controlled study,” Seizure, vol. 65, pp. 48–54, 2019. 11. [11]. J. Jeppesen, J. Christensen, P. Johansen, and S. Beniczky, “Personalized seizure detection using logistic regression machine learning based on wearable ecg-monitoring device.,” Seizure, vol. 107, pp. 155–161, 2023. 12. [12]. M. A. Frankel, M. J. Lehmkuhle, M. Watson, et al., “Electrographic seizure monitoring with a novel, wireless, single-channel eeg sensor,” Clinical Neurophysiology Practice, vol. 6, pp. 172–178, 2021. [CrossRef](http://medrxiv.org/lookup/external-ref?access_num=10.1016/j.cnp.2021.04.003&link_type=DOI) 13. [13]. G. Japaridze, D. Loeckx, T. Buckinx, et al., “Automated detection of absence seizures using a wearable electroencephalographic device: A phase 3 validation study and feasibility of automated behavioral testing,” Epilepsia, vol. 64, S40–S46, 2023. 14. [14]. E. Covi, E. Donati, X. Liang, et al., “Adaptive extreme edge computing for wearable devices,” Frontiers in Neuroscience, vol. 15, 2021, issn: 1662-453X. 15. [15]. E. Donati and G. Indiveri, “Neuromorphic bioelectronic medicine for nervous system interfaces: From neural computational primitives to medical applications,” Progress in Biomedical Engineering, vol. 5, no. 1, p. 013 002, 2023, issn:2516-1091. 16. [16]. E. Donati, M. Payvand, N. Risi, et al., “Processing EMG signals using reservoir computing on an event-based neuromorphic system,” in Biomedical Circuits and Systems Conference, (BioCAS), IEEE, 2018, pp. 1–4. 17. [17]. S. Gerber, M. Steiner, Maryada, G. Indiveri, and E. Donati, “Neuromorphic implementation of ecg anomaly detection using delay chains,” Biomedical Circuits and Systems Conference (BioCAS), 2022. 18. [18]. M. Sharifshazileh, K. Burelo, J. Sarnthein, and G. Indiveri, “An electronic neuromorphic system for real-time detection of high frequency oscillations (HFOs) in intracranial EEG,” Nature Communications, vol. 12, no. 1, pp. 1–14, 2021. [CrossRef](http://medrxiv.org/lookup/external-ref?access_num=10.1038/s41467-021-21246-9&link_type=DOI) 19. [19]. F. Costa, E. V. Schaft, G. Huiskamp, et al., “Robust compression and detection of epileptiform patterns in ecog using a real-time spiking neural network hardware framework,” Nature Communications, vol. 15, no. 1, p. 3255, 2024. 20. [20]. M. Ronchini, Y. Rezaeiyan, M. Zamani, G. Panuccio, and F. Moradi, “Net-ten: A silicon neuromorphic network for low-latency detection of seizures in local field potentials,” Journal of Neural Engineering, vol. 20, no. 3, p. 036 002, 2023. 21. [21]. F. Corradi, H. You, M. Giulioni, and G. Indiveri, “Decision making and perceptual bistability in spike-based neuromorphic VLSI systems,” in International Symposium on Circuits and Systems, (ISCAS), IEEE, 2015, pp. 2708–2711. 22. [22]. K. Burelo, M. Sharifshazileh, G. Indiveri, and J. Sarnthein, “Automatic detection of high-frequency oscillations with neuro-morphic spiking neural networks,” Frontiers in Neuroscience, vol. 16, 2022, issn: 1662-453X. 23. [23]. M. Sharifshazileh and G. Indiveri, “An adaptive event-based data converter for always-on biomedical applications at the edge,” International Symposium on Circuits and Systems, (ISCAS), 2023. 24. [24]. S. Moradi, N. Qiao, F. Stefanini, and G. Indiveri, “A scalable multicore architecture with heterogeneous memory structures for dynamic neuromorphic asynchronous processors (DYNAPs),” IEEE Transactions on Biomedical Circuits and Systems, vol. 12, no. 1, pp. 106–122, 2018. 25. [25]. D. Zendrikov, S. Solinas, and G. Indiveri, “Brain-inspired methods for achieving robust computation in heterogeneous mixed-signal neuromorphic processing systems,” Neuromorphic Computing and Engineering, vol. 3, no. 3, p. 034 002, 2023, issn: 2634-4386. 26. [26].Sleep-Wake-Epilepsy-Center, SWEC-ETHZ iEEG database, Inselspital Bern and ISL, ETH Zurich. 27. [27]. N. Risi, A. Aimar, E. Donati, S. Solinas, and G. Indiveri, “A spike-based neuromorphic architecture of stereo vision,” Frontiers in Neurorobotics, vol. 14, p. 93, 2020, issn: 1662-5218. 28. [28]. A. Burrello, L. Cavigelli, K. Schindler, L. Benini, and A. Rahimi, “Laelaps: An energy-efficient seizure detection algorithm from long-term human iEEG recordings without false alarms,” in 2019 Design, Automation & Test in Europe Conference & Exhibition (DATE), IEEE, 2019, pp. 752–757.