DOI: 10.5281/zenodo.13940412
title: Spiking Seizure Classification Dataset
title: An event-driven neural network for monitoring of epileptic seizures on low-power neuromorphic hardware

description: Dataset for event encoded analog EEG signals for detection of Epileptic seizures 

This dataset contains events that are encoded from the analog signals recorded during pre-surgical evaluations of patients at the Sleep-Wake-Epilepsy-Center (SWEC) of the University Department of Neurology at the Inselspital Bern. The analog signals are sourced from the SWEC-ETHZ iEEG Database

This database contains event streams for 10 seizures recorded from 5 patients and generated by the DYnamic Neuromorphic Asynchronous Processor (DYNAP-SE2) to demonstrate a proof-of-concept of encoding seizures with network synchronization. The pipeline consists of two parts (I) an Analog Front End (AFE) and (II) an SNN termed as"Non-Local Non-Global" (NLNG) network. 

In the first part of the pipeline, the digitally recorded signals from SWEC-ETHZ iEEG Database are converted to analog signals via an 18-bit Digital-to-Analog converter (DAC) and then amplified and encoded into events by an Asynchronous Delta Modulator (ADM). Then in the second part, the encoded event streams are fed into the SNN that extracts the features of the epileptic seizure by extracting the partial synchronous patterns intrinsic to the seizure dynamics. 

Details about the neuromorphic processing pipeline and the encoding process are included in a manuscript under review.  The preprint is available in bioRxiv

InstallationThe installation requires Python>=3.x and conda (or py-venv) package. Users can then install the requirements inside a conda environment using 

conda env create -f requirements.txt -n sez

Once created the conda environment can be activated with conda activate sez



The main files in the database are described in the hierarchy below.

 

EventSezDataset/

├─ data/

│ ├─ P x S x

│ │ ├─ Pat x _Sz_ x _CH x .csv

├─ LSVM_Params/

│ ├─ opt_svm_params/

│ ├─ pat_x_features_SYNCH/

├─ fig_gen.py

├─ sync_mat_gen.py

├─ SeizDetection_FR.py

├─ SeizDetection_SYNCH.py

├─ support.py

├─ run.sh

├─ requirements.txt

 

where x represents the Patient ID and the Seizure ID respectively.



requirements.txt: This file lists the requirements for the execution of the Python code.

fig_gen.py: This file plots the analog signals and the associated AFE and NLNG event streams. The execution of the code happens with `python fig_gen.py 1 1 13', where patient 2, seizure 1, and channel 13 of the recording are plotted.

sync_mat_gen.py: This file describes the function for plotting the synchronization matrices emerging from the ADM and the NLNG spikes with either linear or log colorbar. The execution of the code happens with `python sync_mat_gen.py  1 1' or `python sync_mat_gen.py 1 1 log'. This execution generated four figures for pre-seizure, First Half of seizure, Second Half of seizure, and post-seizure time periods, where patient 1 and seizure 1. The third option can either be left blank or input as `lin` or `log`, for respective color bar scales. The time is the signal-time as mentioned in the table below.

run.sh: A simple Linux script to run the above code for all patients and seizures.

SeizDetection_FR.py: This file runs the LSVM on the ADM and NLNG spikes, using the firing rate (FR) as a feature. The code is currently set up with plotting with pre-computed features (in the LSVM_Params/opt_svm_params/ folder). Users can use the code for training the LSVM with different parameters as well.

SeizDetection_SYNCH.py: This file runs the LSVM on the kernelized ADM and NLNG spikes, using the flattened SYNC matrices as a feature. The code is currently set up with plotting with pre-computed features (in the LSVM_Params/pat_x_features_SYNCH/ folder). Users can use the code for training the LSVM with different parameters as well.

LSVM_Params: Folder containing LSVM features with different parameter combinations.

support.py: This file contains the necessary functions.

data/P1S1/: This folder, for example, contains the event streams for all channels for seizure 1 of patient 1.</p>



Pat1_Sz_1_CH1.csv: This file contains the spikes of the AFE and the NLNG layers with the following tabular format (which can be extracted by the fig_gen.py)






## Comments

# SStart: 180        //Start of the Seizure in signal time# SEnd: 276.0       //Start of the Seizure in signal time# Pid: 2                  // The patient ID as per the SWEC-ETHZ iEEG Database             # Sid: 1                  // The Seizure ID as per the SWEC-ETHZ iEEG Database             # Channel_No: 1  // The channel number






SYS_time
signal_time
dac_value
ADMspikes
NLNGspikes


The time from the interface FPGA
The time of the signal as per the SWEC ETHZ Database
The value of the analog signals as recorded in the SWEC ETHZ Database
The event-steam is the output of the AFE in boolean format. True represents a spike
The spike-steam is the output of the SNN in boolean format. True represents a spike
description: Patient Description




ID
SWEC Database ID
Age (y)
Engel outcome
 No. of electrodes


Seizure durations

(Sez-1/Sez-2) (s)



Epilepsy

lobe/MRI 



1
ID2
19
1
42
96/260
TLE/pos. 


2
ID9
27
1
56
104/118
TLE/neg.    


3
ID1
24
2
47
125/70
TLE/neg.    


4
ID16
31
2
59
81/67
TLE/pos.  


5
ID4
32
4
62
160/127
PLE/pos.




 
description: Long-term monitoring of biomedical signals is crucial for modern clinical treatment of neurological disorders such as epilepsy. Encoding epileptic seizures with partial synchronization using a spiking neural network (SNN) offers a promising avenue as such networks can be implemented on ultra-low-power neuromorphic processors. Indeed, such bio-inspired neuromorphic systems containing mixed-signal asynchronous electronic circuits can perform always-on monitoring of biomedical signals for extended periods of time, without having to employ traditional clocked analog-to-digital conversion or cloud-based processing platforms.

Here, we present a novel SNN architecture, co-designed and implemented with a mixed-signal neuromorphic chip, for monitoring epileptic seizures. Our hardware-aware SNN captures the phenomenon of partial synchronization within brain activity during seizures. We validate the network on a full-custom mixed-signal neuromorphic hardware using real-time analog signals converted from an Electroencephalographic (EEG) seizure data-set, and encoded as streams of events by an asynchronous delta modulation (ADM) circuit, directly integrated, together with its analog front-end (AFE) signal conditioning circuits, on the same die of the neuromorphic SNN chip.

We demonstrate the ability of the hardware SNN to extract local synchronization patterns from the event streams and show that such patterns can facilitate seizure detection using a simple linear classifier. This research represents a significant advancement toward developing embedded intelligent “wear and forget” units for resource-constrained environments. These units could autonomously detect and log relevant EEG events of interest in out-of-hospital environments, offering new possibilities for patient care and management of neurological disorders.