Title: PPi: Pretraining Brain Signal Model for Patient-independent Seizure Detection
Venue: NeurIPS 2023
Accepted: yes
Keywords: Brain signal

Seizure detection

Pretraining

Domain generalization
Abstract: Automated seizure detection is of great importance to epilepsy diagnosis and treatment. An emerging method used in seizure detection, stereoelectroencephalography (SEEG), can provide detailed and stereoscopic brainwave information. However, modeling SEEG in clinical scenarios will face challenges like huge domain shift between different patients and dramatic pattern evolution among different brain areas. In this study, we propose a Pretraining-based model for Patient-independent seizure detection (PPi) to address these challenges. Firstly, we design two novel self-supervised tasks which can extract rich information from abundant SEEG data while preserving the unique characteristics between brain signals recorded from different brain areas. Then two techniques channel background subtraction and brain region enhancement are proposed to effectively tackle the domain shift problem. Extensive experiments show that PPi outperforms the SOTA baselines on two public datasets and a real-world clinical dataset collected by ourselves, which demonstrates the effectiveness and practicability of PPi. Finally, visualization analysis illustrates the rationality of the two domain generalization techniques.

PPi: Pretraining Brain Signal Model for Patient-independent Seizure Detection

Abstract

Automated seizure detection is of great importance to epilepsy diagnosis and treatment. An emerging method used in seizure detection, stereoelectroencephalography (SEEG), can provide detailed and stereoscopic brainwave information. However, modeling SEEG in clinical scenarios will face challenges like huge domain shift between different patients and dramatic pattern evolution among different brain areas. In this study, we propose a P retraining-based model for P atienti ndependent seizure detection (PPi) to address these challenges. Firstly, we design two novel self-supervised tasks which can extract rich information from abundant SEEG data while preserving the unique characteristics between brain signals recorded from different brain areas. Then two techniques, channel background subtraction and brain region enhancement , are proposed to effectively tackle the domain shift problem. Extensive experiments show that PPi outperforms the SOTA baselines on two public datasets and a real-world clinical dataset collected by us, which demonstrates the effectiveness and practicability of PPi. Finally, visualization analysis illustrates the rationality of the two domain generalization techniques.

1 Introduction

Epilepsy is a chronic disease of brain that affects more than 50 million people worldwide, and a large proportion of patients have drug resistant epilepsy (DRE) which cannot be controlled by medication. Actually 70% of them can live seizure-free only if the seizure onset zone (SOZ) can be located and surgically removed [1].

To diagnose epilepsy, the most direct quantitive data to reflect brain function is the electrical activity of the patient's brain. One of the methods to monitor the brain activity is EEG, in which small sensors are attached to the scalp to pick up the electrical signals produced by the brain. Although EEG is widely adopted in brain activity recordings due to its simplicity and relatively low cost, as a non-invasive method, EEG fails to pinpoint the exact seizure focus when the SOZ is located in the deep structure of the brain. In view of the importance of SOZ localization in the treatment of patients with DRE [2], an emerging method called SEEG [3] is applied to locate foci by implanting electrodes in the deep brain. The contacts (also called channels ) on the electrodes distribute around the suspected lesion across several brain areas, which provide stereoscopic recordings of the brain from both cortical and subcortical structures simultaneously [4].

feed in

infer

new patient

SEEG data

/gid00040

existing patients

/gid00034

/gid00035

/gid00036

/gid00037

/gid00038

/gid00039

record

record

treatment

assist the diagnosis

train

PPi

spectral

power

pretrain

…

…

repr

encoder

seizure prediction

< return

00:42:45

15 seconds per frame

SMA'14SMA°5

/w/

SMA'15SMA°6

mFCr3mFCr4

mFCI4mFCT5

mFCr5mFCr6

miFCrImFCr2

mFCr2mFCr3

mFCn6mFCr7

mFCr7mFCT8

ru"'v"

recerded

epleosy

recorded

eplepty

recerded

Name

recorded

eplepty

Asdeeda

C/4-

Cr5

CrS-

C76

0r3-

014

Cr2-

Cr3

Forecast Resut

00:42:47 12.

00:42:47 12.

00:42:47 12.

00:42:47 12.

Dur

mFCr9mFC10

mFCr8mFCr9

recorded

recerded

epleosy

eplepty

12 3 4 5 - 44

SMI'12-

SMA'9-

SMA'13

00:42:48 11,

00:42:48 11,

miFCr11-mFCI12

After collecting the SEEG recordings of patients, the process of epilepsy detection and diagnosis is traditionally treated as a manual task that highly depends on a few experienced neuroscientists, requiring considerable time and human resources [5]. Thus, automating this process could greatly improve the efficiency of clinical seizure detection. As shown in Fig. 1, firstly the model is trained using the labeled data from existing patients, and then the trained model will automatically detect seizures of the SEEG recordings of any new patient. Doctors can view SEEG waveforms and model predictions at the same time (shown on the right side of Fig. 1), and refer to the prediction results for more efficient diagnosis and further treatment. However, existing works for SEEG-based seizure detection mainly focus on the patient-specific setting [6, 7], which can only be trained and directly applied on the same patient due to the substantial differences of SEEG data between patients, resulting in hours even days of training for each new patient. Although a few studies follow the patient-independent setting, these works require manual sampling and denoising by a small number of experienced neurosurgeons, leading to a substantial data bias from real clinical data, which is also time consuming and inapplicable in clinical scenarios.

In fact, designing a model for patient-independent seizure detection on SEEG data under clinical requirements is quite an arduous task due to several unique challenges. Owing to the structural and functional differences of brain neural activities and the variation of invasive electrode numbers and locations (see Fig. 2) caused by individual differences in epileptogenic foci, the seizure patterns of SEEG data are quite different among individuals [8, 9]. Therefore, it is very difficult to perform patient-independent seizure detection on SEEG data. In addition, for epilepsy diagnosis, we have to detect seizures for each monitored brain areas to assist localization of SOZ. Meanwhile, for the fact that the cerebral is composed of multiple brain regions that exert a wide variety of functions [10], the

seizure patterns may greatly change across brain areas. Thus, to detect seizures for patients with different lesions, we should preserve the unique characteristics of brain areas. However, this is usually overlooked by existing works and is quite a challenging task under patient-independent setting.

To address the aforementioned challenges above, we propose a novel patient-independent seizure detection model called PPi, which can be successfully applied to clinical SEEG data. PPi adopts a self-supervised learning approach considering significant discrimination of brain areas and contextual coherence of SEEG signals to preserve the patterns of different channels and pretrain on large amount SEEG data. To handle the huge domain shift between patients, we propose channel background subtraction to align the distribution of the same brain region across different patients and brain region enhancement to mitigate the distribution shift brought by different brain regions. In the experimental phase, unlike existing works, we test our model on the real-world clinical data to verify the application value of our method. In summary, our key contributions comprise:

To the best of our knowledge, we are the first to conduct patient-independent seizure detection on a large-scale real-world clinical SEEG dataset under clinical requirements.

We propose two novel self-supervised pretraining tasks to preserve the unique patterns of different channels, and two techniques including channel background subtraction and brain region enhancement to handle the domain shift between different patients.

Extensive experiments show that PPi greatly outperforms the SOTA seizure detection methods (especially on the real-world clinical dataset), demonstrating the application value of our work.

2 Related Work

SEEG-based seizure detection. SEEG is an emerging method applied in seizure detection, which can localize the SOZ more precisely than those noninvasive recording methods. However, due to the low-quality, large-amount, high-dimensionality characteristics of SEEG data, it is still challenging to develop an automatic approach in SEEG-based seizure detection. Ganti et al. [11] improve seizure detection by temporal Generative Adversarial Networks (TGAN). Chen et al. [6] adopt a graph structure to detect epileptic wave. Xiao et al. [12] propose an SOZ localization method via analyzing the long-term SEEG monitoring for preoperative planning of epilepsy surgery. Although researchers have explored some possible approaches for SEEG-based seizure detection, almost all of these works focus on a patient-specific setting, none of which can be applied in actual clinical scenarios.

Domain generalization on brain signals. Our goal is to predict epileptic seizures of SEEG from unseen patients, which can be abstracted as a domain generalization (DG) problem on brain signals. Yang et al. [13] develop a new DG method named ManyDG, that can scale to such many-domain problems for seizure detection task on EEG. Ayodele et al. [14] use transfer component analysis and LSTM to detect epilepsy on EEG data. Jeon et al. [15] propose a mutual information-driven method to conduct subject-invariant and class-relevant deep representation learning of EEG. For these current DG works on brain signals, most of them are conducted on EEG data rather than more informative SEEG. Although Wang et al. [16] study SEEG-based seizure detection on the patient-independent setting, they conduct experiments on datasets which are not only much smaller in size than practical records. The datasets are also manually denoised and sampled to a balanced positive-negative sample ratio which brings about a huge data bias from the real clinical data, indicating that their work is still far from clinical requirements.

Self-supervised learning on brain signals. Self-supervised learning is an effective approach when the labeled data is limited. In the field of neural signal (e.g. SEEG, EEG), the label is often hard to obtain. Thus, researchers have developed some SSL methods for this field. Banville et al. [17] utilize relative positioning, temporal shuffling and contrastive predictive coding as the pretext tasks for EEG. Mohsenvand et al. [18] and Kostas et al. [19] model EEG signal using contrastive learning. Cai et al. [20] propose a self-supervised learning framework for brain signals that can be applied to pretrain either SEEG or EEG data. However, these works do not explicitly align the distribution gaps between different domains, which is crucial under the DG setting, especially for data with large domain differences such as SEEG.

3 Problem Formulation

Seizure detection on SEEG data can be viewed as a time series classification (TSC) task. The SEEG recording of a patient is a multivariate time series T ∈ R N × C , where N is the length of series, and C is the number of channels. According to the existing works on TSC task [21-23], given an SEEG recording x c = ( x 1 , x 2 , . . . , x N ) from channel c of a patient, we divide the contiguous data into small segments to construct data set S c = { s c, 0 , s c, 1 , . . . , s c,K -1 } and the corresponding label set Y c = { y c, 0 , y c, 1 , . . . , y c,K -1 } , where s c,k = { x l × k +1 , . . . , x l × ( k +1) } is the k -th segment data on channel c from T ( l is the length of each segment, K = ⌊ N/l ⌋ is the total number of segments on channel c ), and y c,k ∈ { 0 , 1 } is the label of s c,k , which indicates whether the segment contains a seizure event ( y c,k = 1 ) or not ( y c,k = 0 ).

The problem is a DG study in epileptic diagnosis scenario, in which each patient is regarded as a domain . Conceptually, DG deals with a challenging setting where one or several different but related domain(s) are given, and the goal is to learn a model that can generalize to an unseen test domain.

/gid00082/gid00071/gid00064/gid00081/gid00068

/gid00082/gid00071/gid00064/gid00081/gid00068

Task1: Channel Discrimination

Task2: Context Swapping

Samples from the same channel (c

1

= c

2

)

Samples from different channels

Samples with context above swapped

Samples without swapping

Samples with context below swapped

discriminator

feature

feature

Contextual Pairwise Sampling

CNN

LSTM

CNN

LSTM

CNN

LSTM

CNN

LSTM

CNN

LSTM

CNN

LSTM

discriminator

feature

feature

channel

0

channel

1

channel

2

channel

C-3

channel

C-2

channel

C-1

......

context below

context above

target segment

for seizure detection

Our goal is to utilize the data of labeled patients ( source domains ) to train a model which can be directly adopted to the data unseen patients ( target domains ).

4 Methodology

In this section, we introduce the technical details of PPi. As shown in Fig. 3, under the patientindependent setting, we first pretrain an encoder by performing two self-supervised tasks (Sec. 4.1.1) to capture rich information from time domain while preserving unique patterns for each channel, which is consistent with the physiological mechanism of seizures. The pretrained encoder is then applied to the seizure detection task (shown in Fig. 4). To further extract information of SEEG data from a more comprehensive perspective, we also introduce the features from frequency domain by computing the spectral powers in different frequency bands [24] of each segment (Sec. 4.1.2). Finally, based on the learned representations, from time and frequency domains, we adopt channel background subtraction and brain region enhancement techniques to handle the challenge of domain shift (Sec. 4.2).

4.1 SEEG Representation Learning

4.1.1 Self-supervised Learning Framework

Self-supervised learning is effective in extracting features for time series [6, 25, 26] and robust to data imbalance [6, 27]. Considering that the SOZ localization is critical for epilepsy diagnosis and treatment, the seizures should be detected on each channel located in different brain areas. However, different brain regions exert a great variety of brain functions [10] and often exhibit different seizure patterns [4]. Therefore, learning representations that preserve the unique patterns of each channel is more consistent with the physiological mechanism of seizures. Thus we design channel discrimination and context swapping tasks (shown in Fig. 3) considering significant discrimination of channels and contextual coherence of SEEG data, respectively.

Contextual pairwise sampling. It is unreasonable to predict whether a short segment is onset or not without contextual data because seizure patterns may vary greatly between different patients and even between different channels of the same patient. To overcome the limitation, we are inspired by the empirical criteria of neurosurgeons in judging seizures that the waveform characteristics of the seizure segment are significantly different from those of nearby normal signals, which is also quantified by Smith [28] as more spikes and sharp waves. Therefore, we introduce the nearby contextual information of a segment in our self-supervised tasks to enhance the discrimination ability of segment representations for detecting seizures. Specifically, the input covers not only the target segment s c,k which will be predicted (defined in Sec. 3), but also the h nearby segments on the left and right, which are called the context above and context below of s c,k respectively (See Fig. 3). The whole sequence we sample for the target segments s c,k is denoted as u c,k . Contextual pairwise sampling is then defined as the operation of randomly sampling two sequences u m c 1 ,k 1 , u m c 2 ,k 2 from channel c 1 and c 2 respectively, where m is the index for the sample set.

Channel discrimination. In order to preserve the unique characteristics of each channel, the model should identify how channels are different from each other. Motivated by this, we design a task guiding the model to differentiate whether the given two sequences are from the same channel or not. Specifically, we first sample a sequence pair u m 1 c 1 ,k 1 , u m 1 c 2 ,k 2 by contextual pairwise sampling, where the two sequences are sampled from the same or different channels with equal probability. Then u m 1 c 1 ,k 1 , u m 1 c 2 ,k 2 will be encoded to feature vectors h m 1 c 1 ,k 1 , h m 1 c 2 ,k 2 . We next obtain the difference vectors by computing an element-wise absolute difference:

After that, we utilize a discriminator to predict whether the sampled sequence pair comes from the same channel or not. We apply the binary cross-entropy, denoted as L cd , as the loss function of the channel discrimination task. Meanwhile, to avoid representation collapse and exploit the information from time domain, we apply a decoder to reconstruct the original sequences, denoted as ˆ u m 1 c 1 ,k 1 , ˆ u m 1 c 2 ,k 2 . Based on M 1 sequence pairs sampled in the channel discrimination task, the objective function for the reconstruction task is defined as:

Context swapping. Given that the model leverages contextual information to detect seizures, we also need to enhance the coherence semantic uniqueness of SEEG data. We then propose a task leading the model to identify whether the context has been replaced by that of other channels. First, we also adopt contextual pairwise sampling to sample two sequences from different channels. For the sampled sequence pair, we perform the swapping operation according to the following rules: (1) swap their context above with a probability of 0 . 25 ; (2) swap their context below with a probability of 0 . 25 ; (3) do not swap, otherwise. We do not perform reconstruction task here by reason of possibly corrupted sequences. After the processed data is fed into the encoder, we concatenate the encoded representations of the sequence pair to obtain the joint vectors. Finally, an MLP-based discriminator is utilized to discriminate whether the joint vectors are from swapped sequence pair or not. The binary cross-entropy, denoted as L cs , is also employed as the objective function of the context swapping.

Putting the objective functions all together, the overall self-supervised model will be jointly trained according to the objective function given by L ssl = L rec + L cd + L cs .

4.1.2 Frequency Domain Features

The proposed self-supervised learning tasks have a good capability of extracting features from time domain. To exploit SEEG data from a more comprehensive view, we adopt PSD (power spectral density), which has the ability to track the transient changes before and during seizure [29], to extract features from frequency domain. The PSD of a signal describes the distribution of the signal's total average power over frequency. Specifically, we first split the frequency domain into several bands according to the standard description for rhythmic activity [24]: (1) θ (4-8Hz), (2) α (8-13Hz), (3) β (13-30Hz), (4) γ 1 (30-50Hz), (5) γ 2 (50-70Hz), (6) γ 3 (70-90Hz), (7) γ 4 (90-110Hz), (8) γ 5 (110-128Hz). The absolute spectral power of a signal in a frequency band is then computed as the

pretrained encoder

self-attention

spectral

power

classifier

normal

seizure

CNN

CNN

LSTM

...

H

C

…

…

…

brain region

prediction

Brain Region Enhancement

Subtraction

aggregated

representation

difference

representation

logarithm of the sum of PSD coefficients within that frequency band. Mathematically, for segment s c,k , the absolute spectral power in the i -th frequency band is computed as:

In order to capture underlying correlations between different frequency bands and local patterns of contextual segments, the spectral powers will be encoded by a CNN-based encoder to obtain the representations from frequency domain of SEEG signals.

After obtaining the time domain representations from self-supervised learning tasks and frequency domain representations from spectral powers, a self-attention strategy is used to adaptively aggregate them to obtain the segment representations z c,k .

4.2 Patient-independent Seizure Detection

In order to solve the domain shift problem, we propose an assumption from a higher-order perspective that the differential distribution of normal and seizure segments of channels located in the same brain region would be similar in different patients. The assumption is reasonable because of the similarity in structure and function of the same brain region among patients, and the case study in Sec. 5.6 further supports it. Therefore, based on the assumption, we design two techniques called channel background subtraction and brain region enhancement, which fully consider the characteristics of SEEG, to align the data distribution between patients.

Channel background subtraction. Channel background subtraction enables the model to exclusively focus on the differences between seizure and normal segments of each channel, which aligns the distribution of channels within the same brain region across patients. In the field of neuroscience, Staba and Worrell [30] prove that the background brain activity, which refers to the brain activity when individuals are at rest or during sleep, contains important information about brain function and dysfunction in epilepsy. In our scenario, given the patient's limited mobility while monitored by SEEG, background is regarded as the SEEG signal in the absence of epileptic seizures. Therefore, we calculate the background representation e c,k for the segment representation z c,k as the average of all the seg-

Algorithm 1 Background Representation Calculation

for

c

= 0

,

1

, . . . , C

-

1

do

e

c,

0

z

c,

0

n

c

1

ˆ

y

c,

0

0

1

for

k

= 1

,

2

, . . . , K

-

1

do

e

c,k

e

c,k

-

1

if

ˆ

y

c,k

-

1

<

0

.

5

then

e

c,k

e

c,k

×

n

c

+

z

c,k

-

1

n

c

+1

n

c

n

c

+1

end if

z

′

c,k

z

c,k

-

e

c,k

Predict the seizure probability

ˆ

y

c,k

using

z

′

c,k

end for

end for

ment representations currently (before index k ) predicted to be normal in channel c . We show the details of the iterative updating method in Algo. 1. In channel background subtraction, z c,k will subtract e c,k to obtain the difference representation z ′ c,k . The operation aligns the distribution of channels located in the same brain region between patients, which is supported by the case study in Sec. 5.6.

Brain region enhancement. Channel background subtraction has aligned channel representations with similar latent differential distributions. However, with prior information of brain regions, explicit supervised learning can further constrain the differential distribution of channels in the same brain region between different patients, thus enhancing the generalization of PPi. Therefore, we extend the classification task from binary to multi-class, so that the classifier not only predicts whether the seizure occurs, but also determines which brain region the seizure locates in 2 . Specifically, taking z ′ c,k as input, the classifier outputs a tuple ( i c,k , y c,k ) , where i c,k is the index of the brain region that s c,k locates in and y c,k ∈ { 0 , 1 } is the prediction of whether s c,k is seizure or not. For the implementation, we construct integer multi-class labels by converting the tuple ( i c,k , y c,k ) to an integer y ′ c,k : y ′ c,k = i c,k ∗ 2 + y c,k . Therefore, the parity of y ′ c,k reflects whether the prediction result corresponds to a normal state or a seizure. We use a cross-entropy loss as the objective function of brain region enhancement.

5 Experiments

5.1 Dataset

Public datasets. The public datasets used in our paper, MAYO and FNUSA [32], are collected from two institutions: the Mayo Clinic (Rochester, Minnesota, United States of America) and St. Anne's University Hospital (Brno, Czech Republic), respectively. The MAYO dataset has 18 patients in total, including 56730 normal samples and 15227 seizure samples, respectively. The FNUSA dataset has 13 patients in total, including 94560 normal samples and 52470 seizure samples, respectively. For each dataset, we first remove the power line noise and down sample the dataset to 500Hz. Then we divide the patients into 6 groups without overlapping (details in App. B). We randomly choose 5 groups as the source domains (4 of which are used for training and 1 for validation) and the remaining group serves as the target domain. The experiments are repeated on all groups to test the average performance.

Clinical dataset. The clinical SEEG dataset we collect is from a first-class hospital. For the patients, 4 to 10 invasive electrodes with 52 to 126 channels are implanted in the brain to obtain 1000Hz SEEG signals. Since the clinical data are recorded with a high frequency on multiple channels, the dataset has more than 738 hours of recording and contains 123 patient files with an average size of 7.1 GB each. As for the annotation, professional neurosurgeons participate in seizure labeling. The positive sample ratio of a single patient in the dataset is around 0.004 on average, which is extremely imbalanced. We remove the power line noise and down sample the dataset to 250Hz. For the 7 patients in the clinical dataset, we split the patients into training, validation and test set with 5, 1 and 1 patients, respectively. We also repeat the experiments on all patients to obtain an overall results.

5.2 Experimental Setup

To evaluate the performance of the models, we conduct adequate experiments on two public datasets (MAYO and FNUSA) and the real-world clinical dataset. All experiments run on a Linux system with 2 CPUs (AMD EPYC 7H12 64-Core Processor) and 4 GPUs (NVIDIA GeForce RTX 3090). Our code is available at https://github.com/yzz673/PPi_public .

Evaluation Metrics. To comprehensively evaluate the experimental results, we use precision, recall, F1 and F2 as evaluation metrics. Here the F-score can be calculated by F β = (1+ β 2 ) × precision × recall β 2 × precision + recall . Usually, F2 is adopted in critical applications that value information retrieval more than accuracy (i.e., accepting a relatively large number of false positives but virtually guaranteeing that all the true positives are found). In our medical scenario, F2 is more valued than F1, since ignoring any seizure is costly in diagnosis.

Baselines. We compare our model with some DG methods for brain signals (SICR [15], SEEGNet [16]). Also, we compare with other DG algorithms designed for more general fields

(CDANN [33], CORAL [34], GroupDRO [35], MLDG [36], MMD [37], MTL [38], SANDMask [39], SD [40], SelfReg [41], TRM [42], VREx [43], IB-ERM [44], IB-IRM [44] ) and adopt two different feature extractors (TCN [45], MiniRocket [46]) to evaluate their performance based on different kinds of features. Furthermore, we select some self-supervised learning approaches for brain signals (BENDR [19]) and time series (Franceschi et al. [47]). More details of the baselines are shown in App. A.

5.3 Experimental Result

Tab. 1 summarizes the main results of our model and baselines on the two public datasets and the clinical dataset. Overall, our model outperforms all baselines on every metric on the three datasets, which demonstrates the excellent performance of PPi in the patient-independent seizure detection on SEEG data.

On the public datasets, PPi improves the performance 3 by 38.10 % and 24.98 % over the bestperforming baseline model in terms of F2-score respectively, showing that PPi has stronger generalization ability in seizure detection than other baselines. On our clinical dataset, PPi improves the performance by 54.93 %on F2-score. Compared with other baselines that treat all channels equally, our designed self-supervised tasks can preserve more unique characteristics of each channel. These tasks help our model to learn more informative representations from SEEG data, leading to a much better performance on channel-level seizure detection. For SEEG-Net [16] which also focuses on patient-independent seizure detection on SEEG, it can maintain a more balanced precision and recall than other baselines, and achieves almost the second/third highest F1-score in all datasets. The possible reason for its good performance is that SEEG-Net also considers the contextual information of SEEG data like our model. However, PPi still outperforms SEEG-Net by a large margin, as PPi

not only preserve unique characteristics of each channel, but also introduces the extra information of brain regions to enhance the generalization ability. In particular, we achieve better improvement on clinical dataset ( 54.93 %on F2-score) compared with the public datasets ( 38.10 %and 24.98 %on F2-score) mainly because the self-supervised pretraining on unlabeled data reduces reliance on labels, which makes PPi more adaptive to extremely imbalanced dataset than other supervised methods.

5.4 Ablation Study

To evaluate the effectiveness of each component in our model, we first conduct ablation experiments on four model variants to verify the effectiveness of the proposed self-supervised framework, including: (1) PPiSSL 1 : PPi without the channel discrimination task; (2) PPiSSL 2 : PPi without the context swapping task; (3) PPiSSL : PPi without all self-supervised tasks; (4) PPi-reconstruction: PPi without reconstruction loss. Then we use PPi-power: PPi without features of spectral powers, to demonstrate the benefits of introducing PSD based features. For the aggregation strategy, we replace the self-attention with mean pooling (denoted as PPi-self attention). Another two experiments are conducted to verify the significant generalization ability of our two techniques respectively, which are denoted as PPi-background and PPi-brain region. Due to the requirement of brain region labeling in brain region enhancement, the lack of such labels makes brain region enhancement inapplicable to the two public datasets.

The comparison results of the ablation experiments on all the three datasets are presented in Tab. 2. It shows that PPi beats other model variants on all metrics, proving the contribution of each component in our model. The performances of the variants that remove the self-supervised tasks drop greatly, which shows that our designed self-supervised tasks are capable of extracting informative representations from large amount imbalanced SEEG data. PPi-background and PPi-brain region cannot achieve performances that are competitive with the full model, validating the strong generalization ability of PPi to handle the huge domain shift across different patients. The improvement is empowered by the channel background subtraction and brain region enhancement techniques, which will be explored further in Sec. 5.6.

5.5 Hyperparameter Analysis

The contexts half length h (i.e. the length of context above or context below) is an important hyperparameter in PPi. Thus we evaluate the performance on the clinical dataset under different contexts half length (shown in Fig. 5). The results exhibits an increase of performance as h becomes larger, which illustrate that introducing the contexts of the target segment to increase the receptive field allows the model to compare the target segment with its nearby waveforms, resulting in better performance. However, the increase of contexts half length is also accompanied by a higher computational overhead, necessitating consideration of trade-offs when selecting the value of h .

contexts half length

h

score (%)

5.6 Case Study

Visual analysis of channel background subtraction. To handle domain shift, PPi adopts channel background subtraction which has the ability to align the distribution of the same brain region from different patients. In the visual analysis, we visualize such ability by comparing the aggregated representation z c,k (before subtraction) and the difference representation z ′ c,k (after subtraction) using t-SNE [48] plots. Specifically, we select two channels which locate in the same brain region from two different patients (denoted as p i , p j ) (results for more patients are shown in App. D.1). The t-SNE plots of their aggregated representations and difference representations are shown in Fig 6. The aggregated representations of p i and p j obviously exhibit

normal from Pi

seizure from Pi

normal from Pj

seizure from Pj

aggregated representations

difference representations

different distributions. After channel background subtraction, the distributions of the samples from p i and p j are very close, which illustrates that channel background subtraction successfully aligns the distribution space of the channels located in the same brain region between patients.

Confusion matrix of brain region enhancement. In order to demonstrate the effectiveness of brain region enhancement, we calculate the confusion matrix of the multi-classification. Fig. 7 shows the confution matrix from one of the patients (the confusion matrix of all the patients are shown in App. D.2), in which the vertical axis represents the multi-class label and the horizontal axis represents the multi-class prediction results. In the confusion matrix, most samples are distributed on the main diagonal, which reflects the good performance of the multi-classification task, illustrating the effectiveness of brain region enhancement.

6 Conclusion

UH 1y

44 19

UN 1

I

I IUN 128

IU 4

UH /

L

1

s#

+

In this paper, we propose PPi to conduct patient-independent seizure detection on SEEG in the clinical scenario. To detect seizures more accurately, PPi adopts a self-supervised pretraining strategy to extract information from SEEG signals while preserving the unique characteristics of each channel. Furthermore, we propose channel background subtraction and brain region enhancement to improve the generalization ability of PPi. Extensive experiments demonstrate the superior performance of PPi in the patient-independent seizure detection on two public and a clinical SEEG datasets (Sec. 5.3). The case study (Sec. 5.6) further illustrate the effectiveness of our proposed two techniques to reduce the huge domain shift between different patients.

Limitations and future works. Compared with EEG, SEEG is an emerging technique and the related research is limited. Although our work outperforms other methods by a large margin on the clinical dataset, in applications, the predicted results of PPi are mainly serve as a reference to assist doctors to achieve more efficient clinical diagnosis and treatment, rather than completely replace doctors in seizure detection. For the application, we have reached a cooperation with a first-class hospital and a related institution that is responsible for the development of an application software. In the future, our model will be integrated into the software to assist doctors in seizure diagnosis.

References

WHO. Epilepsy. https://www.who.int/news-room/fact-sheets/detail/ epilepsy , 2022.

Juan D Martinez-Vargas, Gregor Strobbe, Kristl Vonck, Pieter Van Mierlo, and German Castellanos-Dominguez. Improved localization of seizure onset zones using spatiotemporal constraints and time-varying source connectivity. Frontiers in Neuroscience , 11:156, 2017.

Soha Alomar, Jaes Jones, Andres Maldonado, and Jorge Gonzalez-Martinez. The stereoelectroencephalography methodology. Neurosurgery Clinics , 27(1):83-95, 2016.

Timothée Proix, Viktor K Jirsa, Fabrice Bartolomei, Maxime Guye, and Wilson Truccolo. Predicting the spatiotemporal diversity of seizure propagation and termination in human focal epilepsy. Nature communications , 9(1):1-15, 2018.

Florian Mormann and Ralph G. Andrzejak. Seizure prediction: making mileage on the long and winding road. Brain , 2016.

Junru Chen, Yang Yang, Tao Yu, Yingying Fan, Xiaolong Mo, and Carl Yang. Brainnet: Epileptic wave detection from seeg with hierarchical graph diffusion learning. In SIGKDD , pages 2741-2751, 2022.

Susanta Kumar Rout, Mrutyunjaya Sahani, PK Dash, and Pradyut Kumar Biswal. Multifuse multilayer multikernel rvfln+ of process modes decomposition and approximate entropy data from ieeg/seeg signals for epileptic seizure recognition. Computers in Biology and Medicine , 132:104299, 2021.

Wojciech Samek, Frank C Meinecke, and Klaus-Robert Müller. Transferring subspaces between subjects in brain-computer interfacing. IEEE Transactions on Biomedical Engineering , 60(8): 2289-2298, 2013.

Birgit Frauscher, Nicolás von Ellenrieder, François Dubeau, and Jean Gotman. Different seizureonset patterns in mesiotemporal lobe epilepsy have a distinct interictal signature. Clinical Neurophysiology , 128(7):1282-1289, 2017.

Ryuta Mizutani, Rino Saiga, Yoshiro Yamamoto, Masayuki Uesugi, Akihisa Takeuchi, Kentaro Uesugi, Yasuko Terada, Yoshio Suzuki, Vincent De Andrade, Francesco De Carlo, et al. Structural diverseness of neurons between brain areas and between cases. Translational psychiatry , 11(1):1-9, 2021.

Bhargava Ganti, Ganne Chaitanya, Ridhanya Sree Balamurugan, Nithin Nagaraj, Karthi Balasubramanian, and Sandipan Pati. Time-series generative adversarial network approach of deep learning improves seizure detection from the human thalamic seeg. Frontiers in Neurology , 13: 755094, 2022.

Linxia Xiao, Caizi Li, Yanjiang Wang, Junxi Chen, Weixin Si, Chen Yao, Xifeng Li, Chuanzhi Duan, and Pheng-Ann Heng. Automatic localization of seizure onset zone from high-frequency seeg signals: A preliminary study. IEEE Journal of Translational Engineering in Health and Medicine , 9:1-10, 2021.

Chaoqi Yang, M. Brandon Westover, and Jimeng Sun. Manydg: Many-domain generalization for healthcare applications, 2023.

Kayode Peter Ayodele, Wisdom O Ikezogwo, Morenikeji A Komolafe, and Philip Ogunbona. Supervised domain generalization for integration of disparate scalp eeg datasets for automatic epileptic seizure detection. Computers in Biology and Medicine , 120:103757, 2020.

Eunjin Jeon, Wonjun Ko, Jee Seok Yoon, and Heung-Il Suk. Mutual information-driven subjectinvariant and class-relevant deep representation learning in bci. IEEE Transactions on Neural Networks and Learning Systems , 2021.

Yiping Wang, Yanfeng Yang, Gongpeng Cao, Jinjie Guo, Penghu Wei, Tao Feng, Yang Dai, Jinguo Huang, Guixia Kang, and Guoguang Zhao. Seeg-net: An explainable and deep learningbased cross-subject pathological activity detection method for drug-resistant epilepsy. Computers in Biology and Medicine , page 105703, 2022.

Hubert Banville, Omar Chehab, Aapo Hyvärinen, Denis-Alexander Engemann, and Alexandre Gramfort. Uncovering the structure of clinical eeg signals with self-supervised learning, 2020.

Mostafa Neo Mohsenvand, Mohammad Rasool Izadi, and Pattie Maes. Contrastive representation learning for electroencephalogram classification. In Machine Learning for Health , pages 238-253. PMLR, 2020.

Demetres Kostas, Stephane Aroca-Ouellette, and Frank Rudzicz. Bendr: using transformers and a contrastive self-supervised learning task to learn from massive amounts of eeg data, 2021.

Donghong Cai, Junru Chen, Yang Yang, Teng Liu, and Yafeng Li. Mbrain: A multi-channel self-supervised learning framework for brain signals, 2023.

Anthony Bagnall, Jason Lines, Aaron Bostrom, James Large, and Eamonn Keogh. The great time series classification bake off: A review and experimental evaluation of recent algorithmic advances. Data Mining and Knowledge Discovery , 31(3):606-660, 2017.

Jason Lines, Luke M Davis, Jon Hills, and Anthony Bagnall. A shapelet transform for time series classification. In Proceedings of the 18th ACM SIGKDD international conference on Knowledge discovery and data mining , pages 289-297, 2012.

Patrick Schäfer. The boss is concerned with time series classification in the presence of noise. Data Mining and Knowledge Discovery , 29(6):1505-1530, 2015.

Zisheng Zhang and Keshab K Parhi. Low-complexity seizure prediction from ieeg/seeg using spectral power and ratios of spectral power. IEEE transactions on biomedical circuits and systems , 10(3):693-706, 2015.

Zezhi Shao, Zhao Zhang, Fei Wang, and Yongjun Xu. Pre-training enhanced spatial-temporal graph neural network for multivariate time series forecasting. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining . ACM, aug 2022.

Yuqi Nie, Nam H. Nguyen, Phanwadee Sinthong, and Jayant Kalagnanam. A time series is worth 64 words: Long-term forecasting with transformers, 2023.

Hong Liu, Jeff Z. HaoChen, Adrien Gaidon, and Tengyu Ma. Self-supervised learning is more robust to dataset imbalance, 2022.

Shelagh JM Smith. Eeg in the diagnosis, classification, and management of patients with epilepsy. Journal of Neurology, Neurosurgery & Psychiatry , 76(suppl 2):ii2-ii7, 2005.

Mojtaba Bandarabadi, César A Teixeira, Jalil Rasekhi, and António Dourado. Epileptic seizure prediction using relative spectral power features. Clinical Neurophysiology , 126(2):237-248, 2015.

Richard J Staba and Gregory A Worrell. What is the importance of abnormal 'background' activity in seizure generation? Issues in Clinical Epileptology: A View from the Bench , pages 43-54, 2014.

Nathalie Tzourio-Mazoyer, Brigitte Landeau, Dimitri Papathanassiou, Fabrice Crivello, Octave Etard, Nicolas Delcroix, Bernard Mazoyer, and Marc Joliot. Automated anatomical labeling of activations in spm using a macroscopic anatomical parcellation of the mni mri single-subject brain. Neuroimage , 15(1):273-289, 2002.

Petr Nejedly, Vaclav Kremen, Vladimir Sladky, Jan Cimbalnik, Petr Klimes, Filip Plesinger, Filip Mivalt, Vojtech Travnicek, Ivo Viscor, Martin Pail, et al. Multicenter intracranial eeg dataset for classification of graphoelements and artifactual signals. Scientific data , 7(1):1-7, 2020.

Ya Li, Xinmei Tian, Mingming Gong, Yajing Liu, Tongliang Liu, Kun Zhang, and Dacheng Tao. Deep domain generalization via conditional invariant adversarial networks. In ECCV , pages 624-639, 2018.

Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In ECCV , pages 443-450. Springer, 2016.

Shiori Sagawa, Pang Wei Koh, Tatsunori B Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. arXiv preprint arXiv:1911.08731 , 2019.

Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy Hospedales. Learning to generalize: Metalearning for domain generalization. In AAAI , volume 32, 2018.

Haoliang Li, Sinno Jialin Pan, Shiqi Wang, and Alex C Kot. Domain generalization with adversarial feature learning. In CVPR , pages 5400-5409, 2018.

Gilles Blanchard, Aniket Anand Deshmukh, Ürun Dogan, Gyemin Lee, and Clayton Scott. Domain generalization by marginal transfer learning. The Journal of Machine Learning Research , 22(1):46-100, 2021.

Soroosh Shahtalebi, Jean-Christophe Gagnon-Audet, Touraj Laleh, Mojtaba Faramarzi, Kartik Ahuja, and Irina Rish. Sand-mask: An enhanced gradient masking strategy for the discovery of invariances in domain generalization. arXiv preprint arXiv:2106.02266 , 2021.

Mohammad Pezeshki, Oumar Kaba, Yoshua Bengio, Aaron C Courville, Doina Precup, and Guillaume Lajoie. Gradient starvation: A learning proclivity in neural networks. Advances in Neural Information Processing Systems , 34:1256-1272, 2021.

Daehee Kim, Youngjun Yoo, Seunghyun Park, Jinkyu Kim, and Jaekoo Lee. Selfreg: Selfsupervised contrastive regularization for domain generalization. In ICCV , pages 9619-9628, 2021.

Yilun Xu and Tommi Jaakkola. Learning representations that support robust transfer of predictors. arXiv preprint arXiv:2110.09940 , 2021.

David Krueger, Ethan Caballero, Joern-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Dinghuai Zhang, Remi Le Priol, and Aaron Courville. Out-of-distribution generalization via risk extrapolation (rex). In ICML , pages 5815-5826. PMLR, 2021.

Kartik Ahuja, Ethan Caballero, Dinghuai Zhang, Jean-Christophe Gagnon-Audet, Yoshua Bengio, Ioannis Mitliagkas, and Irina Rish. Invariance principle meets information bottleneck for out-of-distribution generalization. Advances in Neural Information Processing Systems , 34: 3438-3450, 2021.

Colin Lea, Rene Vidal, Austin Reiter, and Gregory D Hager. Temporal convolutional networks: A unified approach to action segmentation. In ECCV , pages 47-54. Springer, 2016.

Angus Dempster, Daniel F Schmidt, and Geoffrey I Webb. Minirocket: A very fast (almost) deterministic transform for time series classification. In SIGKDD , pages 248-257, 2021.

Jean-Yves Franceschi, Aymeric Dieuleveut, and Martin Jaggi. Unsupervised scalable representation learning for multivariate time series, 2020.

Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research , 9(11), 2008.

A Details of Baselines

Firstly, we compare our model to some cross-subject methods on brain signals:

SICR [15]: a framework that learns class-relevant and subject-invariant feature representations, which shows a promising performance in non-invasive brain-computer interface.

SEEG-Net [16]: a model that can address the problems of sample imbalance, cross-subject domain shift, and poor interpretability and realizes high-sensitivity SEEG pathological activity detection. The source code of SEEG-Net is not released, so we implement it by ourselves to conduct the experiments.

Secondly, to further compare our model to some DG algorithms in more general areas, experiments were conducted with methods as follows:

CDANN [33]: an end-to-end conditional invariant deep DG approach by leveraging deep neural networks for domain-invariant representation learning.

CORAL [34]: an unsupervised domain adaptation method that aligns the second-order statistics of the source and target distributions with a linear transformation.

GroupDRO [35]: a model coupling group DRO models with increased regularization, where DRO allows to learn models that instead minimize the worst-case training loss over a set of groups.

MLDG [36]: a model agnostic training procedure for DG, which simulates train/test domain shift during training by synthesizing virtual testing domains within each mini-batch.

MMD [37]: an adversarial autoencoder framework to learn a generalized latent feature representation across domains.

MTL [38]: a representative framework for DG, which augments the original feature space with the marginal distribution of feature vectors.

SANDMask [39]: a masking strategy, which determines a continuous weight based on the agreement of gradients, in order to control the amount of update in each step of optimization under the notion of Out-of-Distribution (OOD) Generalization.

SD [40]: a regularization method aimed at decoupling feature learning dynamics, improving accuracy and robustness in cases hindered by gradient starvation.

SelfReg [41]: a regularization method for DG based on contrastive learning, self-supervised contrastive regularization.

TRM [42]: a robust estimation criterion that is specifically geared towards optimizing transfer to new environments.

VREx [43]: a penalty on the variance of training risks as a simpler variant based on a form of robust optimization over a perturbation set of extrapolated domains.

IB-ERM [44]: a DG method that improve generalization via minimizes the empirical risk over multiple domains.

IB-IRM [44]: a DG method that improve generalization via minimizes the invariant risk over multiple domains.

Furthermore, we choose some self-supervised learning approaches on brain signals or general time series as our baselines:

BENDR [19]: A self-supervised training model that learn compressed representations to model completely novel raw EEG sequences recorded with differing hardware, and different subjects performing different tasks.

Franceschi et al [47]. This work combines an encoder based on causal dilated convolutions with a novel triplet loss employing time-based negative sampling, obtaining general-purpose representations for variable length and multivariate time series.

B Details of Datasets

B.1 Public Datasets

The group dividing strategy and detailed statistics of the two public datasets are shown in Tab. 3. The datasets are publicly available to use under CC0 license and might be downloaded from https://springernature.figshare.com/collections/Multicenter_ intracranial_EEG_dataset_for_classification_of_graphoelements_and_ artifactual_signals/4681208 .

B.2 Clinical Dataset

The detailed information of the clinical dataset is shown in Tab. 4 and the sample rate of all the patients is 1000Hz.

C Experimental Results with Standard Deviation

The average performance with standard deviation of MAYO, FNUSA and clinical dataset are shown in Tab. 5, Tab. 6 and Tab. 7, respectively.

D Full Results of Case Study

D.1 Visual Analysis of Channel Background Subtraction

In order to show that the visual analysis in the case study( 5.6) is consistent across the patients in our clinical dataset, we plot six groups of t-SNE figures (shown in Fig. 8). In each group, the samples are from the same brain region of two patients, and the patients involved in these six examples include all the patients in the clinical dataset. For each group, the left and right are plotted with the representations before and after channel background subtraction. Overall, in each group of experiments, channel background subtraction shows a similar effect, indicating that the effect of channel background subtraction is consistent across patients.

nonmal from the Ist patient

seizure from the 1st patient

normal from the 2nd patient

seizure from the 2nd patient

D.2 Confusion Matrix of Brain Region Enhancement

The confusion matrix of multi-classification on all the patients are shown in Fig. 9. Note that the total number of classes in the confusion matrix is different for different patients. This is because the number and positions of electrodes implanted in each patient are different when the SEEG signal is collected, resulting in different brain regions involved by the SEEG data of different patients, which is also one of the reasons for domain shift.

patient 0

patient 1

patient 2

patient 3

patient 4

patient 5

patient 6

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe manuscript presents an innovative model called PPi (Pretraining-based model for Patient-independent seizure detection) for patient-independent seizure detection utilizing SEEG data. SEEG provides detailed and three-dimensional brainwave information which is advantageous for seizure detection. However, challenges emerge in modelling SEEG data due to the substantial domain shift between different patients and the evolving patterns among various brain areas.\n\nTo tackle these challenges, the authors introduce two novel self-supervised tasks during the pretraining phase. These tasks extract comprehensive information from the available SEEG data while preserving the unique characteristics of brain signals recorded from different brain areas. They also propose two techniques, channel background subtraction and brain region enhancement, to effectively address the domain shift problem between patients.\n\nThe performance of the PPi model is substantiated through extensive experiments conducted on two public datasets and a real-world clinical dataset collected by the authors. The experiments demonstrate that the PPi model outperforms state-of-the-art baselines, showcasing the practicality and effectiveness of the model. The authors also provide a visualization analysis that further validates the rationality of the two proposed domain generalization techniques.\n\nThe contributions of this work encompass the application of patient-independent seizure detection on a large-scale real-world clinical SEEG dataset under clinical requirements. This achievement highlights the innovation of the self-supervised pretraining tasks and the domain generalization techniques that the authors propose to manage the domain shift between patients. Furthermore, the superior performance of the PPi model is demonstrated through extensive experiments with other state-of-the-art methods, thereby emphasizing the significant application value of the work.\n\nSTRENGTHS:\n1. Figure 1. Figure 3. and Figure 4. are not only clear but also self-explanatory, demonstrating a well-designed visual depiction of the proposed method. This effectively simplifies the understanding of the framework architecture and the proposed method's workflow, serving as a useful tool for readers to follow the discussion and analysis in the manuscript.\n\n2. The paper included extensive experimentation, which covers three different datasets. Their rigorous approach in testing the proposed method against a broad range of state-of-the-art methods provides a robust and comprehensive evaluation of its performance. Such extensive evaluation contributes to the manuscript's credibility and confirms the model's generalizability and applicability to various data contexts.\n\n3. The performance of the PPi model, as reported in the results, is very promising. The superior performance of PPi when compared to state-of-the-art methods in seizure detection underlines the efficacy of the proposed method and its potential contribution to the field. It further exemplifies the practical significance and potential of the PPi model in real-world applications, especially in clinical scenarios.\n\n4. The authors' inclusion of an ablation study effectively demonstrates the impact and contribution of different components of the proposed method towards the overall performance. This provides clear insights into the proposed approach's effectiveness.\n\nWEAKNESSES:\n1. In Section 4.1.2, the authors stated that their proposed self-supervised learning (SSL) task exhibits a robust capability for extracting time-domain features. However, the basis for this assertion is unclear, and the inclusion of supporting references would strengthen the argument. Furthermore, the paper does not explain why the SSL tasks are applied solely to the time domain and not the frequency domain. Providing a more detailed discussion regarding these decisions would improve the narrative and understanding of the method.\n\n2. The clinical dataset described in Section 5.1 is highly imbalanced, yet the paper does not adequately assess how the model handles class imbalance. If the authors believe that the proposed SSL tasks can inherently address the data imbalance issue, then a more detailed analysis and validation of this claim would be beneficial.\n\n3. The authors mention the importance of preserving unique brain area characteristics for effective seizure detection across different lesions in the introduction section. However, it remains unclear how other individual differences are accounted for in their method, beyond the variance in seizure locations. Furthermore, there is a lack of qualitative analysis supporting how well the proposed model preserves the characteristics of different brain areas across channels, which is crucial to corroborate the authors' claims.\n\n4. Figure 5, in its current state, is relatively small and not entirely intuitive. The t-SNE plots, despite the authors mentioning that the t-SNE plots were only split after the dimensionality reduction, the plots do not clearly show that they are derived from the same calculation. I recommend reducing the total data points included in the plot, plotting both of them on the same t-SNE graph with 4 distinct colours instead of splitting them. In addition, add another set of t-SNE plots of two channels that were from different brain regions from two different patients as a comparison to demonstrate the unique characteristics of different brain regions are kept within the latent features.\n\n5. The ablation study should also include an evaluation of the reconstruction loss term and the self-attention layers' significance. Their roles and impacts on the model's performance should be more explicitly assessed to provide a more comprehensive understanding of the model's architecture and its component's contribution.\n\nQUESTIONS:\n1. In Section 5.4's Ablation study, the performance of the PPi-SSL model exhibits some inconsistencies. While it outperforms PPi-SSL2 on the FNUSA dataset, it shows considerably reduced effectiveness on the Clinical dataset. Could the authors expand on the potential reasons for these discrepancies? For instance, could the model have collapsed during training in the absence of reconstruction loss? Or might the performance variation be attributed to the differing class distributions within the datasets?\n\n2. Similarly in Section 5.4's Ablation study, it remains unclear why the condition of PPi-brain region isn't applicable to the two public datasets. Is it because the brain region enhancement cannot be used at all for the two public datasets?  A clarification on this matter from the authors would be appreciated.\n\nLIMITATIONS:\nplease refer to the weaknesses", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2023-06-26"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper proposes a model called PPi that pre-trains on SEEG data using two self-supervised tasks, followed by a channel background subtraction step as well as a brain region enhancement task for patient-independent seizure detection. Experiments on two public datasets and an internal dataset suggest that PPi outperforms existing models for seizure detection. Visualization of latent representations using a t-SNE plot indicate the effectiveness of the channel background subtraction step.\n\nSTRENGTHS:\n1. There is some originality in the design of the pre-training tasks and the channel background subtraction step.\n2. Overall the methods are sound and the paper is relatively easy to understand.\n3. The proposed model PPi shows improved performance over a set of baselines.\n\nWEAKNESSES:\n1. Several design choices in Methods need more justifications (see my questions below). \n2. All the datasets are from a small number of patients, which could be a limitation and should be discussed.\n3. Some notations and equations in Methods are not necessary, and can be better explained using plain texts. Overloaded notations make it harder to understand. For instance, Definition 1 is not necessary.\n4. While PPi outperforms baselines, the overall performance of PPi is still low, particularly on the clinical dataset, which could limit its clinical applicability.\n\nQUESTIONS:\n1. Some notations and equations in Methods are not necessary (e.g., Definition 1). Replacing some notations with plain language can help readability.\n2. In the pre-training phase, how to sample contexts if the target segment is in the beginning or end of the signal? Please clarify.\n3. More justifications for design choices are needed in Methods. For example, in “Channel discrimination” section, why is the difference vector used instead of a concatenated vector as done in “context swapping”? Why and how is self-attention used to aggregate frequency and time-domain representations?\n4. Reconstruction loss is included in the channel discrimination pre-training task. Please include an ablation to show the impact of reconstruction loss.\n5. In Section 5.4, the authors state that “for the ablation experiments on two public datasets, brain region enhancement is not applied due to lack of information about brain regions.” Does this mean that the results in Table 1 do not include brain region enhancement task for the two public datasets? Please clarify.\n6. For the visualization analysis in Section 5.5, it would be good to show other patient examples to make sure that the observation is consistent across patients (this should be doable given that there is only 7 patients in the clinical dataset). \n7. In my opinion, it’s a limitation that the data come from a small number of patients. This limitation should be discussed.\n\nLIMITATIONS:\nSome limitations are discussed in the end of the paper.", "TITLE": "Official Review", "RECOMMENDATION": 6, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-02"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nSeizure detection using stereoencephalographic data is crucial for epilepsy diagnosis. Owing to the large variety of seizure patterns and pathology, automated seizure detection is quite challenging, and manual annotation of data remains necessary. This study proposes a model to detect seizures from SEEG data in a patient-independent manner (PPi). The proposed model is based on self-supervised learning tasks. To handle the frequency domain shift between patients, they proposed background channel subtraction and brain region enhancement techniques. \nThe model presented in this article seems to outperform existing models, especially on clinical data. This article presents a model that could potentially help clinicians detect seizures.\n\nSTRENGTHS:\nThis study attempts to solve a common issue in epilepsy diagnosis, but this could also be helpful in annotating large SEEG datasets. The presentation of the results is clear, and all the results appear to be presented. The main strength of the proposed model is its capacity to be applicable to all types of patients by dealing with the huge domain shift between patients. The two techniques of channel background subtraction and brain region enhancement seem to be highly innovative and could potentially be applied to other datasets to answer other questions. The model performance appears to be very reasonable, especially for clinical data.\nOne of the main strengths of this study is the use of a self-supervised learning method that allows non-annotated data to be obtained, particularly when working on such rare datasets.\n\nWEAKNESSES:\nOne of the main issues in this study is that they do not show raw traces of data. It could have been good that we see some of the automatically detected seizures to see whether the well-detected seizures are the easiest to detect or if some very complex seizures are also detected. The main problem with epileptic seizures is that their patterns differ depending on the pathology and brain region. Some seizures, such as low-voltage fast-activity seizures, could potentially be very hard to detect by a model, at least the real start of the seizures. \nThey could be precise in the article if, for the seizures detected, there were many manual adjustments to do afterwards to correctly place the start of the seizure.\nThe performance of the model is correct based on other existing models; however, the presented results are not sufficient to fully rely on automatic detection. As they said in the discussion, this could be helpful for clinicians, but it cannot replace manual annotation at the moment.\n\nQUESTIONS:\nWhat preprocessing steps did you apply to the dataset ? However, this was not clear in the article.\n\n\nDid you process any artifact rejection before training ?\n\n\nCan you please show the raw traces of EEG for well-detected and undetected seizures ? Are there some patterns that the model is unable to detect ?\n\nLIMITATIONS:\nThe authors seems to correctly adress the limitations of the article", "TITLE": "Official Review", "RECOMMENDATION": 8, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-05"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis article deals with domain shifts in seizure detection with stereoelectroencephalography (SEEG), an emerging acquisition method in this field. To tackle this problem, the authors propose two different self-supervised tasks to learn meaningful features from the SEEG and propose also two preprocessing techniques to reduce the shift between the domain. All this propositions allow to beat the SOTA methods on two public datasets and also on their own clinical dataset.\n\nSTRENGTHS:\nThis paper proposes a new PPi method to be applied to an emerging field SEEG. PPi shows very good results compare to what the SOTA proposes. Moreover, the research is done in coordination with doctors, so the paper deals with real-world clinical issues. \n\nThe method is very clear.\n\nThe paper implements very nice experiments, allowing us to see the benefits of the method and the effects on the data. \n\nThe comparison is made over several other methods.\n\nIn addition, a new clinical dataset was collected for this paper. SEEG is a new field where every dataset is crucial to improve the impact in the science community.\n\nWEAKNESSES:\nIn the experimental part, the authors' claims do not link to the performance in Table 1. For example, they claim 54.93% on F2 score of improvement on the clinical dataset, but the average performance is only 35.51% in Table 1. \n\nThe PPi method is a concatenation of several components (SSL, frequency spectral features, brain region ...). Even with the ablation study is hard to understand what is the improvement of each component. The last experiment proposes visualizing the effect of the channels' background subtraction, but it is the only visible effect. Each other component does not seem to improve the results much except when all the components are combined.\n\nQUESTIONS:\nThe paper claims a 54% improvement in the F2 score, but it seems that Table 1 gives other results. 35,51% of F2 score is only a 17.40% improvement if we compare it to the best baseline results (i.e. MiniRocket with VREx). From where does this claim come from?\n\nIn Table. 2 for the ablation study, It is hard to understand which layer is removed. For example, PPi-power means the all PPi framework without feature and spectral power, so only encoding features? same question for PPi-SSL. With this experiment, it seems that none of the layers are useful alone to improve performance. For each row of the tables, the performances are below the baseline. is PPi useful only when all the components are taken?\n\nProposing a new clinical dataset can be game-changing in such an emerging field as SEEG. Will the dataset be publicly available too?\n\nThe score on the clinical dataset seems worse than on the public dataset. Do you think the score can be improved? Does 35% of F2 score enough to help the doctor to detect seizures in the brain?\n\nLIMITATIONS:\nNo limitation", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-06"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper proposes a patient-independent seizure detection framework called PPi for stereoelectroencephalography (SEEG) data. It utilizes self-supervised learning for taking into account discriminability of brain areas and contextual coherence of SEEG signals to preserve the patterns of different channels. The authors propose to use channel background subtraction for distributional alignment of brain regions across patients and handle inter-patient domain shift. Evaluation is performed on two public and one clinical data-set against several baseline methods.\n\nSTRENGTHS:\n1. Evaluation is performed on three separate datasets against several baseline methods.\n\n2. Performance tables reported appear to consistently suggest that PPi provides improvements against the selected baselines for seizure detection.\n\n3. The ablation studies support the need for different components that the model combines.\n\nWEAKNESSES:\n1. The presentation of the main methodology reads as a piecing together of multiple existing modules making the novelty of the proposed method unclear for this application.\n\n2. The tables do not report standard deviation measures for any of the methods or discussions of statistical significance measures, making it hard to gauge the robustness of the method to the data splits.\n\nQUESTIONS:\n1. The channel distribution alignment visualization in Fig. 5 does not appear to result in a clear separation between the epileptic and controls subjects. Could the authors provide more intuition on why the representation leads to enhanced classification performance between the two classes?\n\n2. A suggestion would be to include a shortened version of the explanation Section E: Brain Region Enhancement Details from the appendix in the main text of the work to improve readability and aid readers in understanding the multi-classification setup.\n\nLIMITATIONS:\nThe authors have identified the limitations of their work in a separate subsection within the conclusion and have indicated potential for clinical deployment. It would be great if the authors could provide more information regarding the clinical targets (eg. detection accuracy) to be met for translation.", "TITLE": "Official Review", "RECOMMENDATION": 5, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2023-07-09"}

comments: SUMMARY:
This paper presents a pretraining-based model for patient-independent seizure detection (PPi) on SEEG data in the clinical scenario. The proposed method adopts a self-supervised pretraining strategy to extract information from SEEG signals while preserving the unique characteristics of each channel, and applies channel background subtraction and brain region enhancement techniques to improve the generalization ability of PPi. The experimental results carried out on two public datasets and a real clinical dataset have shown that the proposed method outperforms the SOTA baselines.

STRENGTHS:
- A pretraining-based model for patient-independent seizure detection (PPi) using SEEG signals. 
- The proposed method adopts two self-supervised pretraining strategies (channel discrimination and context swapping) to extract information from SEEG signals while preserving the unique characteristics of each channel, and applies channel background subtraction and brain region enhancement techniques to effectively tackle the domain shift problem and thus improve the generalization ability of PPi.

WEAKNESSES:
-  The use of PSD-based features which is widely applied in the literature to extract features from the frequency domain of the EEG/SEEG signals.

QUESTIONS:
1) Various types of EEG/SEEG features have been proposed in the literature. It is suggested to highlight the effectiveness of PSD-based features in the proposed method.
2) Update the references by considering some recent and relevant studies.

LIMITATIONS:
Yes, but briefly. It is suggested to discuss more this point.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 3
DATE: 2023-07-16