Scholarly article on topic 'Adaptive heart rate-based epileptic seizure detection using real-time user feedback'

Adaptive heart rate-based epileptic seizure detection using real-time user feedback Academic research paper on "Medical engineering"

0
0
Share paper
Academic journal
Physiological Measurement
OECD Field of science
Keywords
{""}

Academic research paper on topic "Adaptive heart rate-based epileptic seizure detection using real-time user feedback"

Physiological Measurement

Institute of Physics and Engineering in Medicine

ACCEPTED MANUSCRIPT

Adaptive heart rate-based epileptic seizure detection using real-time user feedback

To cite this article before publication: Thomas De Cooman et al 2017 Physiol. Meas. in press https://doi.org/10.1088/1361-6579/aaa216

Manuscript version: Accepted Manuscript

Accepted Manuscript is "the version of the article accepted for publication including all changes made as a result of the peer review process, and which may also include the addition to the article by IOP Publishing of a header, an article ID, a cover sheet and/or an 'Accepted Manuscript' watermark, but excluding any other editing, typesetting or other changes made by IOP Publishing and/or its licensors"

This Accepted Manuscript is © 2017 Institute of Physics and Engineering in Medicine.

During the embargo period (the 12 month period from the publication of the Version of Record of this article), the Accepted Manuscript is fully protected by copyright and cannot be reused or reposted elsewhere.

As the Version of Record of this article is going to be / has been published on a subscription basis, this Accepted Manuscript is available for reuse under a CC BY-NC-ND 3.0 licence after the 12 month embargo period.

After the embargo period, everyone is permitted to use copy and redistribute this article for non-commercial purposes only, provided that they adhere to all the terms of the licence https://creativecommons.org/licences/by-nc-nd/3.0

Although reasonable endeavours have been taken to obtain all necessary permissions from third parties to include their copyrighted content within this article, their full citation and copyright line may not be present in this Accepted Manuscript version. Before using any content from this article, please refer to the Version of Record on lOPscience once published for full citation and copyright details, as permissions will likely be required. All third party content is fully copyright protected, unless specifically stated otherwise in the figure caption in the Version of Record.

View the article online for updates and enhancements.

This content was downloaded from IP address 132.174.250.220 on 18/01/2018 at 11:04

10 Adaptive Heart Rate-Based Epileptic Seizure

11 Detection Using Real-Time User Feedback

14 Thomas De Cooman1,2, Troels W. Kjffir3,

15 Sabine Van Huffel1,2, Helge B. Sorensen4

16 1 STADIUS Center for Dynamical Systems, Signal Processsing and Data

Analytics, Department of Electrical Engineering, KU Leuven, Leuven, Belgium

2 imec, Leuven, Belgium

, Roskild

Thomas De Cooman, Kasteelpark Arenberg 10, 3001 Leuven, Belgium E-mail: thomas.decooman@esat.kuleuven.be

18 3 Neurophysiology Center, Zealand University Hospital, Roskilde, Denmark

19 4 Department of Electrical Engineering, Technical University of Denmark, Kgs.

20 Lyngby, Denmark

52 Keywords: epilepsy, ECG, seizure detection, patient feedback, real-time adaptation

53 Submitted to: Physiol. Meas.

August 2017

Abstract. Automated seizure detection in a home environment has been of increased interest the last couple of decades. Heart rate-based seizure detection is a way to detect temporal lobe epilepsy seizures at home, but patient-independent classifiers showed to be insufficiently accurate. This is due to the high patient-dependency of heart rate features, whereas this method does not use patient-specific data. Patient-specific classifiers take into account patient-specific data, but often not enough patient data are available for a full robust patient-specific classifier. Therefore a real-time adaptive seizure detection algorithm is proposed here. The algorithm starts with a patient-independent classifier, but gradually adapts to the patient-specific characteristics while they are obtained on-the-run. This is done by using real-time user feedback to annotate previously generated alarms, causing an immediate update to the used support vector machine classifier. Data annotated as seizures are automatically removed from the updating procedure if their detection would lead to too many false alarms. This is done in order to cope with potential incorrect feedback. The adaptive classifier resulted in an overall sensitivity of 77.12% and 1.24 false alarms per hour on over 2833 hours art rate data from 19 patients with 153 clinical seizures. This is around 30% less false alarms compared to the patient-independent sifier with a similar sensitivity. This low-complex adaptive orithm is able to deal well with incorrect feedback, making it ideal for a seizure warning system, that in the future will also include complementary modalities to improve the performance.

Real-Time Adaptive Heart Rate-Based Seizure Detection 1. Introduction

Epilepsy is a neurological disease that affects around 1% of the people worldwide. For around 30% of these patients, their disease can not be controlled by anti-epilepti drugs. The question is how the quality of life of these patients can be improved in their everyday life. One solution is to use an automated warning system, which automatically detects an ongoing seizure and alarms the patients' caregivers, so they can give the patient the proper treatment. The key part of such a warning system is the automated seizure detection. In literature, epileptic seizure detection is typically done using the electroencephalogram (EEG), but obtaining EEG outside the hospital for long-term monitoring is not comfortable for the patient (Schulze-Bonhage et al. 2010). Therefore a lot of research has gone to automatically detect seizures using other easier obtainable signals such as accelerometers (ACM), electromyogram (EMG) and heart rate with wearable devices during the last couple of decades (Van de Vel et al. 2013).

Here, only the heart rate is used for seizure detection. Previous studies already showed that ictal heart rate changes could be found during most seizures (Zijlmans et al. 2002, Jansen & Lagae 2010). The ictal heart rate changes happen more frequently in temporal lobe epilepsy (TLE) patients than in other patients (Leutmezer et al. 2003) and are most often seen as expressions of strong sympathetic activations.

Most seizure detection algorithms using heart rate (and in general using all modalities) from literature use so-called patient-independent classifiers (De Cooman et al. 2017, Osorio 2014, Milosevic et al. 2016, Poh et al. 2012). They do not require patient-specific data, making them directly usable in practice. However, due to the large inter-patient variability in heart rate characteristics, these classifiers typically lead to too much false alarms to be used in practice (De Cooman et al. 2017). This issue can be solved by periodically changing the algorithm in order to change it to the patient-specific characteristics, which is nowadays assumed to be done after manual inspection. It is however very time-consuming and expensive to let a clinician evaluate previously recorded data of each patient and annotate potential seizure episodes. These annotations can only be made if they also contain reference video-EEG data, which means that this procedure should be done in a protected environment, lowering the usability in practice again.

Therefore, a real-time adaptive seizure detection algorithm is proposed here. The algorithm starts initially with a patient-independent classifier. Several currently available systems allow the usage of a prewarning, which allow the patient to indicate whether a warning might be correct or not before actually warning the relatives. If the patient can annotate it as a false alarm within a certain time limit (i.e. 10s), it generates no alarm to the relatives, otherwise the relatives are alarmed. This patient feedback can be used as annotations to these alarm data. The algorithm updates itself with this information in real-time, adapting to the patient characteristics over time. As patients might not be aware whether they actually had a seizure or not, extra procedures are added to the updating procedure to increase the robustness against incorrect user feedback. To our knowledge, this is the first paper that discusses real-time adaptive seizure detection using user feedback during full day monitoring. The proposed adaptive classifier can also be applied for seizure detection with other modalities such as ACM and EMG or as part of a multimodal system.

The three implemented approaches (patient-independent, patient-specific and real-time adaptive) are described in section 3. The used datasets are discussed in section 2. The results are shown and discussed in sections 4 and 5.

Real-Time Adaptive Heart Rate-Based Seizure Detection

5 2. Data Acquisition

7 Two different datasets are used in this study. The first dataset contains data obtained

8 from the University Hospital of Leuven (UZ Leuven), consisting of 17 patients wi

9 TLE and 127 complex partial seizures during in total 918 hours of recording. Th:

10 dataset is only used for training as will be described in section 3.

11 The second dataset is the publicly available EPILEPSIAE database, which is used

12 for the evaluation of the different algorithms (Ihle et al. 2012). It contains data from

13 epilepsy centra from Freiburg (Germany), Coimbra (Portugal) and Paris (France).

14 Every patient has at least 5 clinical seizures during recordings of at least 92 hours

15 per patient. In total 19 patients with TLE are used from the EPILEPSIAE dataset

16 containing scalp EEG data, including in total 158 clinical seizures in 2833.4 hours of

17 single-lead electrocardiogram (ECG) data. Five seizure annotations were not used as

18 the ECG was temporarily turned off just before, during or just after the seizure. ECG

19 signals are measured on the chest with a sampling frequency of 256Hz. Seizures were

20 annotated by expert neurologists using the gold video-EEG standard, and grouped

21 in five categories: simple partial (SP), complex partial (CP), secondary generalized

22 (SG), unclassified (UC) and subclinical (SC) seizures. Only the clinical seizures are

23 examined here, as these are of most interest to detect in a home environment. The

24 EEG seizure onsets are used as reference if available, otherwise the clinical onsets are

25 used. An overview of the used datasets is given in the supplementary material.

27 3. Methodology

29 Three algorithmic methodologies are evaluated here: a patient-independent, a patient-

30 specific and an adaptive approach. These approaches are now explained in more detail.

31 All mentioned patient-specific data originates from the EPILEPSIAE database and

32 all mentioned patient-independent data originates from the UZ Leuven database.

36 The first method is the patient-independent (P-I) algorithm. No patient-specific data

37 are used in order to train the classifier of this algorithm, only data from other patients

38 (from the UZ Leuven dataset) are used. Therefore this type of classifier can be used

39 from the beginning of the monitoring period, making it very useful in practice.

41 3.1.1. Preprocessing and feature extraction Preprocessing and feature extraction are

42 done as in De Cooman et al. (2017) according to the following steps. First, the heart

43 rate is extracted from the acquired ECG signal. This is done by using a real-time R

44 peak detection algorithm based on a dynamic threshold on the derivative signal. Next,

45 a preprocessing step tries to detect the heart rate increases (HRI) in real-time. This

46 method is based on heart rate gradient analysis and thresholds on the peak heart rate,

47 HRI duration and the absolute increase of heart rate during the HRI. This procedure

48 (called HRI-EXTRACT ) is completely P-I. If such a strong HRI is detected, multiple

49 heart rate features are extracted from this HRI and from one minute before the HRI. In

50 De Cooman et al. (2014), it was already shown that the maximal heart rate gradient,

51 HRI duration and the pre-HRI Hjorth activity (Hjorth 1970) are the 3 best features to

52 use for automated P-I seizure detection with a linear support vector machine (SVM)

53 classifier. Therefore only these features are used for classification here.

3.1. Patient-independent seizure detection

Real-Time Adaptive Heart Rate-Based Seizure Detection

3.1.2. Classification Let {x^y.j} be the training data with xi G Rd the input vector containing the selected feature data, and yi G { —1, +1} the corresponding output values. Let classes +1 and -1 correspond to respectively non-seizure and seizure data samples. By restricting ourselves to linear SVM, similarly as in De Cooman et (2014), the classifier output yj of data point Xj is then defined as yj = sign(wT with w G Rd the weight vector and b G R the scalar bias term. The unknown vari w and b can be found by solving the following optimization problem (with adjustm* to remove the class imbalance):

min- wT w + C + V & + C — V &

i=1\yi = +1 i=1\yi = -1

in which indicates the error on the classification of x

= N + + N— C - =

C = 2 * N + , C =

with N + and N- indicating the number of data points belonging to classes +1 and -1. The factor k (set to 2.5 according to De Cooman et al. (2017)) in C- increases the impact of misdetecting seizure samples compared to non-seizure samples.

The classifier training procedure depends on the different methods described in the following sections. The P-I classifier is trained on the entire UZ Leuven dataset.

3.2. Patient-specific seizure detection

The (semi-)patient-specific (P-S) approach follows a similar procedure as the P-I method: The same preprocessing procedure and features are used here as in the P-I approach, only a different classifier is used. This classifier is used to indicate what the maximal performance could be for the adaptive approach (see section 3.3).

Because not enough P-S data is available in the EPILEPSIAE database to create a fully P-S classifier, a mixed model is used here. Data from the specific test patient (from the EPILEPSIAE database) is mixed with data from other patients (from the UZ Leuven database) in order to train the classifier. Misclassification of P-S data should have more impact on the optimization function (1), which is adapted into

min 1 wT w+C + ^^ +C- ^^ with wi =

j=1|yi = + 1 i=1|yi = — 1

with PS the collection containing the indices of the P-S data points in the collected dataset. This way, more importance is given to the P-S data points with a factor A, which is set automatically by using leave-one-patient-out (LOPO) crossvalidation.

Training and testing of the P-S classifier is done using 5-fold crosstesting. The 4 folds of P-S data for training are mixed with P-I data from the UZ Leuven dataset to train the classifier, and is then evaluated on the fifth fold.

A : i G PS 1 : i G PS

3.3. Real-time adaptive seizure detection

The adaptive seizure detection classifier differs from the P-S classifier due to real-time adaptation to the patient-specific characteristics, whereas the P-S classifier mentioned

10 11 12

20 21 22

Real-Time Adaptive Heart Rate-Based Seizure Detection

Other patients

Offline

R peak detection HRI Extract Feature Extraction

Initial offline SVM training

Annotate da

& „^ ^

I svM t m

1 classifier Q

• In Real-time> R peak HRI Feature SVM ' IP

data detection Extract Extraction classifier Alarm! ||

Test patient

Patient

Figure 1. Overview of the proposed real-time adaptive seizure detector.

in section 3.2 is trained offline with P-S data. The adaptive algorithm originally starts with the P-I classifier described in section 3.1. For each new P-S data point (thus for each HRI detected by HRI-EXTRACT extracted in the EPILEPSIAE database) that is detected, the adaptive classifier is immediately updated (see figure 1). Two SVM parameters are updated here: the weight matrix w and the bias term b. From now on we call wt and bt (t > 1) the t-th value of w and b after adding data point xt to the classifier. The initial values w0 and b0 are the parameter values as found by the P-I classifier described in section 3.1. Although there exists an incremental way to update an SVM (Poggio & Cauwenberghs 2001), this method is too complex for real-time updating on limited hardware. Therefore, a simplified heuristic updating approach is used, which adapts to the P-S data equally fast and with lower complexity. This approach also includes procedures in order to lower the impact of incorrect user feedback, which is required if the system is used in practice.

For each new data point, it is first evaluated whether this data point is possibly caused by noise. This can occur if a noisy ECG segment leads to R peak detection errors. This kind of data should not cause a classifier update as it does not represent the real patient's characteristics. A data point is assumed to be noisefree if less than 10% of all immediate heart rate values in the HRI differ more than 20% compared to the previous immediate heart rate value. This metric thus gives an indication of possible R peak detection errors. Ectopic heartbeats during a HRI happen only rarely during ictal HRIs, so that this procedure did not lead to missing any ictal HRI.

3.3.1. Updating w updated. In SVM,

If the new data point xt is assumed to be noisefree, wt can be w can be written in the dual formulation as (Vapnik 1999)

mplexity o ind thus do

y^aiyiXi

To lower the complexity of the updating procedure, we however stay in the primal SVM problem, and thus do not use P-S a (support vector values), but use the same principle. Let w0 be the weight vector from the P-I classifier. If a P-S data point xt causes a classifier update, w^n ("nn" standing for "not normalized") is set to

YtXtVt

with yt

Vt = -1

yt =+1

= w0. The y parameter replaces the original a parameter here. For simplicity, nly take 2 values, which are chosen to have a similar ratio as the maximum

Real-Time Adaptive Heart Rate-Based Seizure Detection

values the a values can get in the P-I classifier (see equation (2), aj < Cj). That way the y parameters get larger values for the seizure samples as well. Normally only data points causing an error have aj = 0 in SVMs. Similarly, the update of wt only occurs here if |w^ 1Xt + bt-1| < 1. This way, also strong outliers will not cause an update w, increasing the robustness of the SVM updates.

To optimally benefit from the knowledge from the P-I classifier, the adaptive classifier should not deviate too much from it. It can be assumed that each P-S classifier shows sufficient resemblance with the P-I classifier. Therefore, wt is restricted so that its norm doesn't change more than a compared to w0 (||wt — w0

wt = wo +

II w"" - wo|

f(w"n - wo)

This is an assumption that is also used in transfer learning approaches (Yang et al. 2007), which benefit optimally from a reference classifier (here the P-I classifier) in order to get a stable classifier with limited training data. By including it in the adaptive approach, the classifier remains more stable and reliable during all classifier updates. The value of a is automatically set for each patient using LOPO crossvalidation on all patients of the EPILEPSIAE database except the test patient. If no update occurs after xt, wt is set to wt_i.

3.3.2. Updating b Once w is updated, the bias term b also needs to be updated. bt can be found by choosing the value that leads to the minimal sum of errors &, with

& = max(yi(wTrXj + b'), 0), 1 < i < N (7)

The errors & are only evaluated for b' G [bt-1 — e, bt-1 + e] to lower the complexity, preferring a smooth transition from P-I towards P-S classification. Parameter e should be a small value to maintain a smooth classifier transition (empirically set as 0.1). The errors are only evaluated for a fixed number of data points N, which is a mixture of P-I and P-S data. Every time a new P-S data point is annotated, a P-I data point from the same class is removed from memory and computation. This is done in order to limit the computation and memory requirements of the updating procedure.

Let Eb' be the averaged error caused by constant term b'

Y^N & v^N &

Z^j=1|yi = +1 Z^j=1|yi = -1 , . Eb' = ^N-+ L5 * --(8)

2^j=1|yi=+1 2^j=1|yi=-1

The weights wj give extra weight to the P-S data points as in (3). The class imbalance is removed by using weighted averages of both classes. The experimentally found factor 1.5 gives seizure data more impact on the b update. The new bt is then set as

bt = argmin Eb' (9)

Aftei late, the classification rule for the next data point xt+1 then becomes

y(xt+1) = sign(wT xt+1 + bt) (10)

The usage of annotations in the updating procedure has two main drawbacks. he annotations made by the user might be incorrect, leading to bad classifier

Real-Time Adaptive Heart Rate-Based Seizure Detection 7

updates. Secondly, short seizures are too hard to detect with heart rate-based seizure detection as they lead to very short HRIs, making it hard to differentiate them from non-epileptic HRIs. They are often also of less importance for real-time seizure detection applications due to their low risk for injuries. Therefore they should not be given the same importance as longer seizures during the update procedure, certainly

10 because the adaptive approach might base its model with just 1 P-S seizure. In order

12 c^aller or incorrectly annotated ictal HRIc If the output wnT

smaller or incorrectly annotated ictal HRIs. If the output wT xi + bt (with annotation yi = -1) of xj (P-S data point) is larger than 20% of the outputs from the already

14 collected P-S non-seizure data points, wi is set to 0 in equation (8) in order to remove

it from updating, as it is unclear whether it really represents seizure data, or might be an atypical seizure for that patient. In this case, the data point annotated as a seizure resembles non-epileptic P-S data too much and is therefore unlikely to be accurately detectable with the proposed method. Therefore it is removed from the updating procedure. Incorrectly annotated data should not cause a classifier update, and too short seizures leading to too much false alarms after a potential update should not cause a drastic change in the classifier.

3.3.3. Feedback procedure The real-time SVM updates require the availability of the annotations yt of each P-S data point xt. They are made by the patients or their caregivers for all P-S HRIs that are detected by HRI-EXTRACT, not only the HRIs that cause an alarm. We assume the feedback procedure to go as follows in practice:

20 21 22

28 • An alarm is generated: The user gives feedback about the alarm correctness. If

29 no response is given within a given time period (i.e. 10s), the alarm is assumed

30 to be correct as the patient is not able to cancel the alarm during a seizure.

31 • A seizure is missed: The user can indicate that a seizure is recently missed. In

32 this case, the algorithm can keep information about the HRIs of the last hour.

33 These HRIs are then marked as potential seizure HRIs. The procedure to remove

34 falsely annotated seizure HRIs eliminates most of the falsely annotated seizure

35 HRIs for SVM updating. If no such ictal HRI is found, no classifier update occurs.

36 • A non-seizure HRI is correctly ignored: If the procedure for a missed seizure is

37 not activated, the HRI is annotated as non-seizure and the classifier is updated.

^ 3.4. Evaluation criteria and additional tests

41 All classifiers are evaluated only on the EPILEPSIAE database. Four metrics are

42 used for evaluating seizure detection algorithms. The sensitivity (Se) indicates the

43 percentage of detected seizures. The number of false alarms per hour (FP/h) shows

44 how often a FP is generated in time, whereas the positive predictive value (PPV)

45 indicates the percentage of correct detections. The detection delay indicates the time

46 difference between the seizure onset and the moment of detection. A seizure is said to

47 be detected if an alarm is generated between 60 s prior to the seizure onset and 90 s

48 after the seizure onset (De Cooman et al. 2017). Different alarms within one minute

49 are clustered as one alarm. The patient feedback is assumed to be 100% accurate

50 unless specifically mentioned otherwise. To evaluate the impact of incorrect feedback,

51 an additional test is performed when a certain percentage of user feedback is incorrect.

52 For each percentage, 40 runs were simulated in which P-S data was randomly chosen

53 to be incorrectly annotated with the corresponding probability. In order to prove

Real-Time Adaptive Heart Rate-Based Seizure Detection

Table 1. Overview of the results of the different seizure detection classifiers.

Method Se (%) FP/h PPV (%)

Preprocessing procedure (HRI-EXTRACT) 84.31 3.63 1.24

Patient-independent approach 78.43 1.73 2.39

Patient-specific approach 76.47 1.09 3.67

Adaptive approach 77.12 1.24 3.25

100 C? 80

Ü 40 !=

m 20 0

PM 2 Hh 2

2 3 4 5 6 7

8 9 10 11 12 13 14 15 16 17 18 Patient

19 Total

I Patient-independent approach ] Adaptive approach | Patient-specific approach

in. h I

II Ini

II inl ■ I II ■■

2 3 4 5 6 7 8 9 10 11 12 13 14 k15 16

Patient

17 18 19 Total

Figure 2. Sensitivity and FP/h results per patient for the different classifiers.

that the adaptive classifier performs better than the P-I classifier, paired t-tests (with corresponding confidence intervals (CI)) are performed on Se, FP/h and PPV.

4. Results

4-1- Performance of the different seizure detection classifiers

Table 1 gives an overview of the results of the different real-time seizure detection approaches on the EPILEPSIAE database. 84.31% of the seizures were detected with the preprocessing procedure HRI-EXTRACT, which indicates the percentage of seizures with ictal strong HRIs. The P-I classifier resulted in a sensitivity of 78.43% with on average 1.73 FP/h. Seizures were detected on average 18s after seizure onset. The P-S approach resulted in only 1.09 FP/h with a similar sensitivity performance. By using the adaptive approach, only on average 1.24 FP/h were found, again with a similar sensitivity as the P-S approach. This is a drop of nearly 30% of false alarms compared to the P-I classifier. Figure 2 shows the results per patient for the 3 approaches. The results for the false alarm rate (FAR) (p<10-3, CI [-0.81,-0.26]) and PPV (p<10-4, CI [0.74%,1.57%]) from the adaptive classifier prove to be significantly better than those of the P-I classifier, but not for Se (p=0.38, CI [-3.71%,1.48%]). Both P-S and adaptive classifier resulted in an average detection delay of around 19s.

The purpose of the adaptive approach is to adapt to the P-S characteristics over time. Figure 3(a) shows the average FAR per 12 hours for the three approaches for two patients. For patient 1, the adaptive classifier starts with a FAR close to the P-I classifier. When more data is collected from the test patient, the results start to converge towards P-S performance, which is accomplished around 5 days after the

10 11 12

20 21 22

Real-Time Adaptive Heart Rate-Based Seizure Detection

0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 Time after start recording (days)

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 Time after start recording (days)

1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 Time after start recording (days)

0 0.5 1 1.5 2 2.5 3 3.5 4 Time after start recori

Figure 3. Illustration of convergence for the adaptive classifier. (a) Average FP/h per 12 hours of recording in function of time for patients 1 and 10 for the three different approaches. (b) Example of the SVM parameter convergence for patient 10. The different lines in the wt figure indicate the terms for the 3 features.

start of the recording. In case of patient 10, a similar pattern can be seen, but the adaptive classifier is able to show even a lower FAR than the P-S version after 4 days. A similar figure is shown in the supplementary material of this paper with the FAR averaged over all patients, illustrating that on average also improvement can be found over time. Figure 3(b) shows the SVM parameter convergence for patient 10, which reaches a nearly stable SVM classifier after 4 days of recording. The time of convergence typically depends on when sufficient P-S seizure data was collected.

4.2. Seizure sensitivity

Figure 4(a) gives an overview of the percentage of detected seizures for the different seizure types for both HRI-EXTRACT and the adaptive seizure detection approach. In the results for HRI-EXTRACT, it can be seen that ±84% of the SP, CP and UC seizures have significant ictal HRIs. All 4 generalized seizures show ictal strong HRIs.

The overall sensitivity however dropped by using the adaptive classifier. Mostly extra SP and UC seizures are missed by this procedure, resulting in a bigger difference in sensitivity for the CP and SG seizures compared to the SP and UC seizures.

Seizure duration also has an impact on the sensitivity. Figure 4(b) shows the sensitivity of the seizures based on their seizure duration for HRI-EXTRACT and the adaptive approach. The longer the seizure lasts, the higher the chance of detecting it with the adaptive classifier. The seizures that are missed extra in comparison with HRI-EXTRACT are mostly relatively short seizures (< 60s).

4.3. Impact of incorrect user feedback on real-time adaptive seizure detection

For now the assumption was made that all given user feedback was correct. In practice however, this will not be the case. Figure 5(a) shows the effect if only a certain percentage of user feedback is correct. From 10% correct feedback on, the PPV value increases slowly towards optimal PPV performance. The sensitivity does not change much for different feedback percentages, but mainly the FAR changes drastically. However, the overall effect of incorrect user feedback is rather limited. Figure 5(b)

Real-Time Adaptive Heart Rate-Based Seizure Detection

)80 ?60

¡5 200

=i 100

CP SG UC XTRACT and th

Figure 4. Impact factors on seizure sensitivity for HRI-EXTRACT and the proposed adaptive seizure detection classifier. (a) Impact of seizure type on sensitivity. The numbers between brackets indicate the number of seizures per type. (b) Impact of seizure duration on sensitivity. (c) Boxplots of the seizure duration for each seizure type analyzed in the dataset.

shows the impact of incorrect user feedback for both the proposed updating procedure and the standard updating procedure (Poggio & Cauwenberghs 2001). If the standard SVM updating procedure is used with 100% correct feedback, 78.43% sensitivity is achieved with 1.48 FP/h and 2.78% PPV, which is 0.24 FP/h more and 0.47% PPV less than with the proposed updating method. The performance of the standard updating procedure decreases very fast with only 0.1% incorrect user feedback, and with 10% incorrect feedback the PPV is already equally bad as for the preprocessing procedure HRI-EXTRACT. The proposed method however only shows a small drop in PPV here, with still a PPV of 3.05% at 10% incorrect user feedback.

5. Discussion

5.1. Comparison between the different approaches

If the P-I classifier is retrained on the UZ Leuven dataset in order to get the same sensitivity as the adaptive classifier on the validation dataset, the P-I classifier results in 77.78% sensitivity with 1.63 FP/h on the EPILEPSIAE database. This is an increase of almost 0.4 FP/h with a nearly identical sensitivity compared to the adaptive classifier. The adaptive classifier also shows results close to the assumed maximal P-S performance of the adaptive classifier, leading to on average only 0.15 FP/h more than the P-S performance. The adaptive approach indeed shows results that come close to P-S optimal performance after less than one week of recorded data with around 3-5 seizures. This shows that the used procedure to adapt to the patient characteristics leads to a nearly as efficient classifier as the P-S classifier, which is normally adapted offline by a neurologist or nurse. This procedure is thus more time and cost effective than the standard way of personalization. The proposed annotation procedure does not cause any extra burden to the patient if it is added to a system that already uses prewarnings. This adaptive approach just takes into account information that is already available in such systems, and will also lead to a lower FAR in practice.

Figure 2 shows the results for the different approaches for every patient. In most cases the FAR for the adaptive classifier lies between the FAR of the P-I and P-S classifiers with similar sensitivity results. For some patients the FAR is even lower for the adaptive classifier than for the P-S classifier. The reason for this is that the P-S classifier does not have a procedure to remove short or abnormal seizures

10 11 12

20 21 22

Real-Time Adaptive Heart Rate-Based Seizure Detection

0 10 20 30 40 50 60 70 80 90 100

£ 1.f u_

—©— Proposed with incorrect feedback 26 - K - Cauwenberghs with incorrect feedback

2.4 -> 2.2-

0 10 20 30 40 50 60 70 80 90 100

„ 3.2 £ 2.8

> 24 2

CL 2 1.

0 10 20 30 40 50 60 70 80 90 100 Percentage of correct given feedback

Percentage of correct

Figure 5. Impact of incorrect feedback on the performance. (a) Effect of different percentages of incorrect user feedback on sensitivity, FP/hour rate and PPV for the proposed adaptive seizure detection approach. The variation in performance between different runs is shown by the variation bars. (b) Comparison of the PPV values for the proposed updating procedure and the traditional SVM updating procedure in case 0, 0.1, 0.5, 1, 5 and 10% of user feedback is incorrect.

from the training set, whereas such a procedure was implemented for the adaptive approach. This procedure removed seizures that were unlikely to be detected from the training set, as adding them to the classifier would lead to an underestimate of the SVM boundary, leading to too many false alarms then strictly necessary. Normally atypical seizure HRIs would only have limited effect during SVM training if sufficient P-S seizures are already collected, but in the incremental approach it can occur that only one (abnormal) seizure might be available for a long time. By making this choice based on the collected non-seizure HRI data, this decision can be made much faster with sufficient accuracy. A second cause for this is that by making the assumption that the adaptive classifier should have a wt sufficiently similar to the P-I w0, a better classifier is found with the adaptive classifier. In some cases, training the P-S classifier led to strong changes in w compared to the P-I wo, which often resulted in a slightly worse performance. An example of this can also be seen in figure 3(a), for which after 4 days the adaptive classifier becomes better than the P-S classifier due to overtraining of P-S classifier on several SP seizures which are too hard to detect.

5.2. Seizure sensitivity

Figure 4 shows that the sensitivity changed for both seizure duration and seizure type. In order for a seizure to be accurately detectable using the heart rate, the seizure should indeed last long enough, so that the seizure HRIs can be sufficiently different from non-seizure HRIs (De Cooman et al. 2017, Hampel et al. 2016). Both reasons are however correlated in this database as shown in figure 4(c). Both CP and SG seizures were on average longer than SP and UC seizures, making them easier to detect with heart rate-based seizure detection. This is not only applicable between patients, but also within patients. An example of this can be found in patient 10, for which all CP seizures are detected, but all SP seizures were missed.

There is not only variability between seizure types, but also between patients. Most patients show to have sensitivities of 70-100%, but for 2 patients the sensitivity

Real-Time Adaptive Heart Rate-Based Seizure Detection 12

was lower than 40% for all approaches. For patient 3, all ictal HRIs showed to be insufficiently strong compared to inter-ictal HRIs, causing all seizures to be removed from the update procedure as they were marked as too short. Therefore this patient has a similar high FAR as the P-I approach. Patient 18 often had ictal bradycardia (sometimes following a small HRI), with an ictal ideoventricular rhythm, which is a

by the algorithm due to the lack of a strong HRI, it shows the benefits of monitoring the heart rate in epileptic patients in a home environment, as it allows to detect heart failure (if additional algorithms are applied) (Van de Vel et al. 2016).

5.3. Impact of incorrect user feedback on performance

\--------------------- ----O " --------------/ 1 ' -------------------------------------J------1 ' ------Wi' — \ 7

10 potentially life threatening heart condition. Although these seizures were not detected

17 Patients might not be aware that they had a seizure, or might not be certain about

18 it. If they do not have somebody accompanying them to indicate whether they indeed

19 had a seizure or not, this could potentially lead to incorrect user feedback.

20 The impact of incorrect feedback showed to be limited if enough feedback was

21 correct. The robustness against incorrect feedback is obtained by making 2 changes

22 to normal SVM updates. The first one is the use of the restriction ||wt — wo|| during

23 the updates. This avoids the adaptive classifier to become worse than the original P-I

24 classifier by assuming that in the P-S approach still most of the information of the P-I

25 approach applies (i.e. a longer HRI leads to a higher seizure probability). That way,

26 the classifier still gives a mediocre performance even if all feedback is incorrect.

27 The second change was the addition of the rule to remove data points xi with

28 Vi = —1 from updating bt if the output wtXi + bt-\ was higher than 20% of the

29 non-seizure P-S data. This not only limits the impact of feedback errors, but also

30 limits the impact of short seizures, again leading to a better performance. As in the

31 real-time adaptive approach only 1 seizure can be available to adapt to, this step can

32 be crucial for a robust but fast adaptation. The impact of annotating a seizure HRI

33 as non-seizure is limited due to the large amount of non-seizure data, leading to a

34 limited change in the classifier update. Figure 5(b) shows these changes did not only

35 make the adaptive classifier more robust against incorrect feedback, it also gave better

36 results than the normal SVM updating procedure in case of 100% feedback accuracy.

37 By incorporating a heuristic updating approach, the complexity of the updating

38 procedure is much lower than for the standard SVM updating procedure described in

39 (Poggio & Cauwenberghs 2001). Therefore this approach is more usable for real-time

40 updating with limited hardware. Although it was only evaluated here on linear SVM,

41 it can also be applied to other kernels if an estimation of the kernel function is used.

43 5.4. General discussion and future work

Section 4.3 shows that although giving correct feedback is important for optimal performance, the adaptive approach was able to cope well with large percentages of incorrect feedback. In cases of doubt, patients giving incorrect feedback will not have a drastic effect on the performance, which would be the case with normal updating procedures. A procedure is added here to automatically check if trying to add this seizure data to the SVM model would result in too many false alarms. This way, the model takes care of removing data caused by too short seizures, as they are very hard to detect using only the heart rate and are less important to detect due to their lower risk for injuries. These procedures make the algorithm more useful in practice in case

Real-Time Adaptive Heart Rate-Based Seizure Detection

no video-EEG is available to give true data annotations, which is ideal for usage in a home environment using wearable devices.

The adaptive approach showed to adapt to the P-S heart rate characteristics. Each patient has its own heart rate variability, both ictal and interictal, a incorporating this P-S information leads to an improved performance compar the P-I performance. However, the results can still be further improved. One o e drawbacks of the system is that we try to get a P-S optimal performance whil

12 features that showed to be good for P-I use. Better results might be obtained b;

13 also including features that work better in a P-S setting, such as for example th^ achieved ictal peak heart rate or the modified cardiac sympathetic index (De Cooman et al. 2015, Jeppesen et al. 2015). This is however left for future work.

16 Despite the increased performance and usability of the heart rate-based seizure

17 detection approach, the unimodal performance is still too low in order to be used

18 successfully in practice. One of the reasons is the fact that the ECG is sensitive to

19 motion artifacts, making it hard to accurately measure the heart rate from it. In order to accomplish better results, it is required to add additional signal modalities. Previous studies showed that using data from only 1 signal modality for automated seizure detection in a home environment are often insufficient in order to obtain performance that allows usage in practice (Milosevic et al. 2016, Poh et al. 2012). ACM and/or EMG sensors for example can be of great added value for the detection of strong convulsive seizures (Milosevic et al. 2016, Conradsen et al. 2012). Implementation of a similar adaptive approach for these modalities could also increase their unimodal performance. A combination of several adaptive approaches on different modalities will lead to a much stronger detection algorithm which is advised to be used in practice.

20 21 22

32 An adaptive seizure detection algorithm using only heart rate information is proposed. The initial patient-independent classifier was adapted to the patient-specific characteristics by using new patient-specific data points which are annotated with user feedback. The adaptive approach showed to rapidly increase in performance, while also being robust against potential incorrect feedback. This algorithm not only leads to a better performance, but also leads to better usability of such a system in practice. Features from other modalities will also be incorporated in the model in future work.

6. Conclusion

Acknowledgments

Research supported by Bijzonder Onderzoeksfonds KU Leuven (BOF): Center of Excellence (CoE): PFV/10/002(OPTEC), SPARKLE #: IDO-13-0358, C24/15/036, C32/16/00364; Fonds voor Wetenschappelijk Onderzoek-Vlaanderen (FWO): G.0A55.13N (Deep brain stimulation); Agentschap Innoveren & Ondernemen (VLAIO): STW 150466 OSA +, O&O HBC 2016 0184 eWatch; iMinds Medical Information Technologies: ICON: HBC.2016.0167 SeizeIT; Belgian Federal Science Policy Office IUAP #P7/19/ (DYSCO, 'Dynamical systems, control and optimization', 20122017); Belgian Foreign Affairs-Development Cooperation VLIR UOS programs (20132019); EU: European Union's Seventh Framework Programme (FP7/2007-2013): EU MC ITN TRANSACT 2012: #316679, The HIP Trial: #260777; Erasmus +: ING-DIVS 2016-1-SE01-KA203-022114; European Research Council: The research leading to these results has received funding from the European Research Council under the

Real-Time Adaptive Heart Rate-Based Seizure Detection 14

European Union's Seventh Framework Programme (FP7/2007-2013) / ERC Advanced Grant: BIOTENSORS (no 339804). This paper reflects only the authors' views and the Union is not liable for any use that may be made of the contained information. Thomas De Cooman is supported by an FWO SBO PhD grant.

References

12 Conradsen, I., Beniczky, S., Hoppe, K., Wolf, P. & Sorensen, H. B. (2012). Automated algo

13 for generalized tonic—clonic epileptic seizure onset detection based on semg zero-crossing rate,

14 Biomedical Engineering, IEEE Transactions on 59(2): 579—585.

De Cooman, T., Carrette, E., Boon, P., Meurs, A. & Van Huffel, S. (2014). Online seizure detection in

15 adults with temporal lobe epilepsy using single-lead ECG, Proceedings of the 22nd European

16 Signal Processing Conference (EUSIPCO), 2014, IEEE, pp. 1532-1536.

17 De Cooman, T., Van de Vel, A., Ceulemans, B., Lagae, L., Vanrumste, B. & Van Huffel, S.

(2015). Online Detection of Tonic-Clonic Seizures in Pediatric Patients using ECG and Low-Complexity Incremental Novelty Detection, Proc. of the 37th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC2015),

20 pp. 5597-5600.

21 De Cooman, T., Varon, C., Hunyadi, B., Van Paesschen, W., Lagae, L. & Van Huffel, S. (2017).

22 Online automated seizure detection in temporal lobe epilepsy patients using single-lead ecg,

International Journal of Neural Systems p. 1750022.

23 Hampel, K. G., Jahanbekam, A., Elger, C. E. & Surges, R. (2016). Seizure-related modulation of

24 systemic arterial blood pressure in focal epilepsy, Epilepsia .

25 Hjorth, B. (1970). EEG analysis based on time domain properties, Electroencephalography and

clinical neurophysiology 29(3): 306-310.

26 Ihle, M., Feldwisch-Drentrup, H., Teixeira, C. A., Witon, A., Schelter, B., Timmer, J. & Schulze-

27 Bonhage, A. (2012). Epilepsiae-a european epilepsy database, Computer methods and

28 programs in biomedicine 106(3): 127-138.

29 Jansen, K. & Lagae, L. (2010). Cardiac changes in epilepsy, Seizure 19(8): 455-460.

Jeppesen, J., Beniczky, S., Johansen, P., Sidenius, P. & Fuglsang-Frederiksen, A. (2015). Detection

30 of epileptic seizures with a modified heart rate variability algorithm based on lorenz plot,

31 Seizure 24: 1-7.

32 Leutmezer, F., Schernthaner, C., Lurger, S., Potzelberger, K. & Baumgartner, C. (2003).

Electrocardiographic changes at the onset of epileptic seizures, Epilepsia 44(3): 348-354.

Milosevic, M., Van de Vel, A., Bonroy, B., Ceulemans, B., Lagae, L., Vanrumste, B. & Van Huffel, S. (2016). Automated detection of tonic-clonic seizures using 3-d accelerometry and surface

35 electromyography in pediatric patients, IEEE Journal of Biomedical and Health Informatics

36 20(5): 1333-1341.

37 Osorio, I. (2014). Automated seizure detection using EKG, International Journal ofNeural Systems

37 24(02): 1450001.

38 Poggio, T. & Cauwenberghs, G. (2001). Incremental and decremental support vector machine

39 learning, Advances in neural information processing systems 13: 409.

40 Poh, M.-Z., Loddenkemper, T., Reinsberger, C., Swenson, N. C., Goyal, S., Sabtala, M. C., Madsen,

41 J. R. & Picard, R. W. (2012). Convulsive seizure detection using a wrist-worn electrodermal

activity and accelerometry biosensor, Epilepsia 53(5): e93-e97.

42 Schulze-Bonhage, A., Sales, F., Wagner, K., Teotonio, R., Carius, A., Schelle, A. & Ihle, M. (2010).

43 Views of patients with epilepsy on seizure prediction devices, Epilepsy & behavior 18(4): 388396.

Van de Vel, A., Cuppens, K., Bonroy, B., Milosevic, M., Jansen, K., Van Huffel, S., Vanrumste, B., Lagae, L. & Ceulemans, B. (2013). Non-eeg seizure-detection systems and potential sudep

46 prevention: State of the art, Seizure 22(5): 345-355.

47 Van de Vel, A., Smets, K., Wouters, K. & Ceulemans, B. (2016). Automated non-eeg based seizure

detection: Do users have a say?, Epilepsy & Behavior 62: 121-128.

Vapnik, V. (1999). The nature of statistical learning theory.

Yang, J., Yan, R. & Hauptmann, A. G. (2007). Adapting svm classifiers to data with shifted

50 distributions, Seventh IEEE International Conference on Data Mining Workshops (ICDMW

51 2007), IEEE, pp. 69-76.

52 Zijlmans, M., Flanagan, D. & Gotman, J. (2002). Heart rate changes and ECG abnormalities during

epileptic seizures: prevalence and definition of an objective clinical sign, Epilepsia 43(8): 84753 854.