PPi: Pretraining Brain Signal Model for Patient-independent Seizure Detection
Authors: Zhizhang Yuan
Daoze Zhang
Yang Yang
Junru Chen
Yafeng Li
Venue: NeurIPS 2023 poster (2023)
Keywords: Brain signal
Seizure detection
Pretraining
Domain generalization
TL;DR: We propose a pretraining-based model to conduct patient-independent seizure detection on SEEG in the clinical scenario.

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
Zhizhang Yuan' Zhejiang University
Daoze Zhang Zhejiang University zhangdzēz ju. edu. on
Yang Yang! Zhejiang University yangyažzjuu edu. cn
zhizhangyuanez ju. edu. en
Junru Chen Zhejiang University
Yafeng Li Nuozhu Technology Co., Ltd. yafeng 1...1iii. li@neurox. en
Abstract
Automated seizure detection great importance to epilepsy diagnosis treat- ment. An emerging method used in seizure detection, stereeelectreencehhalggaaa (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, propose Pretraining- 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 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.
model for Patient-indepene
Introduction
Epilepsy is a chronic disease of brain that affects more than 50 million people worldwide, and 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 ①
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 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 its simplicity and relatively low cost, as non-invasive method, EEG fails to pinpoint the exact seizure focus when the SO7. is located in the deep structure of the brain. 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 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
Equua contribution. Corresponding author.
37th Conference on Neural Information Processing Systems (NcurIPS 2023).

---

SEEG data
P
Fecord
spectral
infer
existing patients
messder
Oprerait>
PPi
nOW paliint
Seazare predliction
treafment
assist the diagnosis
Figure 1: Overview of the automated scizure detection pipeline. Firstly, the model is trained utilizing the SEEG data from existing patients. Then for real- worldworld application, the doctors can upload the SEEG data of new patients and obtain the results of seizure detection predicted by the model, to easily enjoy the diagnostic assistance which is helpful for further treatment.
After collecting the SEEG recordings of patients, the process of epilepsy detection and diagnosis is traditionally treated as manual task that highly depends on 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. I 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. D. 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 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 setting, these works require manual sampling and denoising by a small number of experienced neurosurgeons, leading to substantial data bias from real clinical data, which is also time consuming and inapplicable in clinical scenarios.
In fact, designing a model for patient-independel independent seizure de- tection 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 1. 19. Therefore, it is very difficult to perform patient-independent seizure detection on SEEG data. In ad- dition, for epilepsy diagnosis, we have to detect seizures for each monitored brain areas assist localization of SOZ. Mean- while, 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-independee setting.
Figure 2: Different SEEG elec- trode numbers and locations of two patients.
To address the aforementioned challenges above, we propose 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, 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 natient-independen seizure detection on 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 localize the SOZ. more precisely than those noninvasive recording methods. However, due the low-quality, large-amount, high-dimnnsiionllty characteristics of SEEG data, it is still challenging to develop an automatic approach in SEEG-based seizure detection. Ganti al. [1] improve seizure detection by temporal Generative Adversarial Networks (TGAN). Chen et al. [6] adopt a graph structure detect epileptic wave, Xiao et al. [[2] 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 domain generalization (DG) problem on brain signals. Yang et al. 13 develop new DG method named ManyDG, that can scale to such many nomain problems for seizure detection task on EEG. Ayodele et LSTM to detect epilepsy on EEG data. Jeon et al. [15] propose mutual information-drie
14 use transfer component analysis and 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 [66 study SEEG-based seizure detection on the patient-independen 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 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 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 SEEG data can be viewed time series classification (TSC) task. The SEEG recording of patient is a multivariate time series T E NCC 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 2, = (2, -2....: ..n ) from channel e of a patient, we divide the contiguous data into small segments construct data set S. {Sc.D, &c,,,, -.. Kc and the corresponding label set W. {Me,o, Ve.1:--.; Ke -1), where &c, = ( (1xx=++)...,(x((4444))) is the k-th segment data on channel e from T (1 is the length of each segment, K = |N/I] is the total number of segments on channel c), and &e.k {0, 1} is the label of Sc,,, which indicates whether the segment contains
seizure event (yr., = 1) or not (ye,k = 0).
The problem is a DG study in epileptic diagnosis scenario, in which each patient is regarded as 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 model that can generalize to unseen test domain.
3

---

chaened 0
Discrimination
share
share
N
fealurrs
CNN
chanad/ /
dagiininsorr
Samples different
chanac
May.
Ratuna
ONN
Bld
Samples chanael
(c)
Cree
contest above
below
Task2: Context Swapping
fial
target segment
0.25
Loca
Blor
chnanel C-2
Samples with context above swapped
chanael C-I
diccrminans
Samples swapping
M4--1.k
0.25
96-h ...
Pairwise Sampling
Samples with context below swapped
seizure detection
Figure 3: Self-supervised pretraining of PPi. The pretraining is mainly performed by the two self- supervised tasks shown in the figure. In each task, the pairs sampled by contextual pairwise sampling will be properly processed according the task and discriminator is employed to discriminate the postive and negative samples (Sec. 4.1.I). The pretrained encoder will be used for the seizure detection (shown in Fig. 4).
Our goal is utilize the data labeled patients (source domains) 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. under the patient- independent setting, first pretrain encoder by performing 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 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
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 great variety of brain functions [10] and often exhibit different seizure patterns (4. Therefore, learning representations that preserve the unique patterns of each channel more consistent with the physiological mechanism of seizures. Thus we design channel discrimination and context swapping tasks (shown Fig. 3 considering significant discrimination of channels and contextual coherence of SEEG data, respectively.
Self-supervised learning effective in extracting features for time series 25 26

---

Contextual pairwise sampling. It 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 segment in our self-supervised tasks enhance the discrimination ability of segment representations for detecting seizures. Specifically, the input covers not only the target segment s which will be predicted (defined in Sec. 3), but also the h nearby segments the left and right, which are called the context above and context below of $c,k respectively (See Fig. 3) The whole sequence sampling is then defined as the operation of randomly sampling two sequences 2d (yy Meg,k2 from channel e₁ and 02 respectively, where m is the index for the sample set.
sample for the target segments S,, is denoted as u. Contextual pairwise
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 task guiding the model to differentiate whether the given two sequences are from the same channel or not. Specifically, we first sample sequence pair c, u "0 kz
k2 by contextual pairwise sampling, where the two sequences are sampled from the same or different channels with equal probability. Then u wirkk " will be encoded to feature vectors h h "aikk We next obtain the difference vectors by computing an element-wise absolute difference:
hd abbs my
my o2.kk
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 Lad, 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 kk + U by Based on M1 sequence pairs sampled in the channel discrimination task, the objective function for the reconstruction task is defined as:
Mi Cree Σ mi11
(1
mi 02.1 -
1|2
U 2 11²).
(2)
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 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: (I) swap their context above with 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-base discriminator is utilized to discriminate whether the joint vectors are from swapped sequence pair or not. The binary cross-entropy, denoted as Les, 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 Lest Lree + fee Lee-
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 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) 0 (4-8H2), (2) (8- (8-13H2), (3) (13-30Hz), (4) 71 (30-50Hz), (5) 72 750-70Hz), (6) 73 (70-90H2), (7) 74 (90-110Hz), (8) 75 (110-128H2). The absolute spectral power of a signal in a frequency band is then computed as the
5

---

CNN
Chanael Background Subtraction
Brain Region Enhancemennt
spectral power
Per
pretrained encoder
sormal
Mikk
#ggregated representation
differennee
classifier
brain region prediction
represcatation
Figure 4: Overall architecture PPi. The representations encoded from the pretrained encoder and spectral powers (Sec. (41.22 aggregated by a self-attention strategy obtain the aggregated representation kc &c, is then be processed by channel background subtraction and brain region enhancement obtain the difference representation z',, for seizure detection (Sec. 4.2)
logarithm of the sum of PSD coefficients within that frequency band. Mathematically. for segment 8o,k, the absolute spectral power in the i-th frequency band is computed as:
P c,k = log
Σ
PSD (w), i E (1,2,....
(baan(())
In order to capture underlying correlations between different frequency bands and local patterns of contextual segments, the spectral powers will be encoded by CNN-based encoder to obtain the representations from frequency domain of SEEG signals.
After obtaining the time domain representations from self self-supervised learning tasks and frequency domain representations from spectral powers, self-attention strategy used adaptively aggregate them to obtain the segment representations cc,
4.2 Patient-independenn Seizure Detection
In order solve the domain shift problem, propose assumption from 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. [.6 further supports Therefore, based the assumption, design techniques called channel background subtraction and brain region enhancement, which fully consider the characteristics of SEEG, 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 mo- bility while monitored by SEEG, background is regarded as the SEEG signal in the absence of epileptic seizures. Therefore, we calculate the background representation Cc,k for the segment representation 2,, as the average of all the seg- ment representations currently (before index k) predicted to be normal in channel c. We show the details of the iterative updating method in Algo. [] In channel background subtraction, Ze, will subtract ec,k to obtain the difference representation 2²_4- The operation aligns the distribution of channels located in the same brain region between patients, which supported by the case study in Sec. [.6] Since the patient must be in normal state at the start of the SEEG recording, it is reasonable dc.0 0.
Algorithm 1 Background Representation Calculation
for = 0, 1,...,..
e,,0 < Ze,0
<-1 1
je.0
for
2, ...., K do
Ca,k t Cc,k-1
if jc.k-1 < 0.5 then
6c, + Co.k Xmott.kk11
The + mot1
end if
z',x <- Zo,k Ec,k
Predict the scizure probability De.k using 2'Cx
end for
end

---

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 Specifically, taking Z/c as input, the classifier outputs a tuple (fc.k, Vc.k), where te,k is the index of the brain region that Sc,k locates in and ye.k {0,1} is the prediction of whether Sc,k is seizure implementation, we construct integer multi-class labels by converting the tuple (ie Vc.k) ) to an integer V'ax² V2_1- = le.k #2 Ve.k- Therefore, the parity of V',, reflects whether the prediction result corresponds to normal state or seizure. We use cross-entropy loss the objective function of brain region enhancement.
not. For the
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 for validation) and the remaining group serves the target domain. The experiments are repeated on all groups to test the average performance.
Clinical dataset. The clinical SEEG dataset collect is from 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 recorded with a high frequency 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 patients in the clinical dataset, we split the patients into training, validation and test set with 5, I and 1 patients, respectively. We also repeat the experiments on all patients to obtain an overall results.
multiple channels, the
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 Co-e Processor) and 4 GPUs (NVIDIA GeForce RTX 3090). Our code is available
http:////ggitubb..ooooy/////// public
Evaluation Metrics. To comprehensively evaluate the experimental results, we use precision, recall, Fl and F2 as evaluation metrics. Here the F-score can be calculated by F3 (xr.eP)xprrccssiixxx x Usually, F2 is adopted in critical applications that value information retrieval more than accuracy (i.e., accepting 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 costly in diagnosis.
82 xxprccssinn
We compare our model with some DG methods for brain signals (SICR [15] SEEG- Net (6).. Also, we compare with other DG algorithms designed for more general fields
Baselines.
In our study, brain regions are divided according to a medical standard template called automated anatomical labeling (AAL) (31). which is digital atlas of the human brain. AAL defines 1 116 different regions in total, of which 90 in the cerebrum and 26 are in the cerebellum.
7

---

(CDANN B3 CORAL 34
GroupDRO 35 MLDG 36 MMD 37 MTL B8] SANDMask (9)
and adopt two different feature extractors (TCN 45 MiniRocket 46 to evaluate their performance based different kinds of features. Furthermore, we select some self supervised learning approaches for brain signals (BENDR [1]] and time series (Franceschi et al. 47 More details of the baselines are shown in
SD 40 SelfReg A.. TRM 42). VREx 43 IB -RM 44 IB- IRM
44
App.A.
Table I: Average performance of patient-independer seizure detection tasks two public datasets and our clinical dataset. The v indicates the first in a column, y indicates the second, and & indicates the third. The performance with standard deviation is given in App.
Dataset
MAYO
FNUSA
Clinical
Model
Pre.
Rec.
F1
Rec.
Rec.
CDANN
16.13
*68.
14
24.74
37. 84
32.71
69.62
43.09
54.88
1.42
44,20
2.72
6.08
CORAL
17.01
64.08
25.73
38.30
33.87
65.46
43.63
53.84
1.59
47.24
3.03
6.64
GroupDRO
17:26
64.25
26.02
38.68
33.24
62.14
41.90
51.27
1.53
47.13
2.91
6.35
18.88
61.38
27.96
*40.39
32.81
28.85
MMD
15.79
67.41
24.45
37.68
32.87
*69.38
43.51
55.30
1.90
46.84
3.26
6.59
MTL
16.13
51.87
22.56
31.74
32.70
53.10
38.48
44.78
1.43
9.19
2.30
3.73
SANDMask
16.47
68.66
25.00
38.15
32.16
59.46
39.62
48.59
1.34
#47.22
2.60
5.95
SD
15.29
60.70
23.10
34.67
34.30
65.54
43.77
53.88
1.52
46.46
2.91
6.38
SeltReg
9.42
58.65
15.50
26.29
25.35
35.87
48.79
0.92
44.48
1.76
3.94
TRM
16.94
59.60
24,47
35.67
34.32
62.26
43.39
51.93
1.53
47.34
2.91
6.35
VREx
16.74
60.41
25,06
36.87
33.17
61.75
41.84
51.11
10.98
42.17
5.33
IBEERM
17.27
64.29
26.04
38.71
34.34
62.94
42.93
52.22
1.53
47.34
2.91
6.35
TB-IRM
16.75
60.45
25.08
36.90
34.26
63.06
43.10
52.44
1.52
45.65
2.89
CDANN
16.22
15.44
15.14
15.20
48.73
36.97
38.26
37.02
2.09
45.27
3.98
8.68
CORAL
47.61
25.30
27.57
$2.50
42.54
GroupDRO
41.99
34.02
35.98
34.49
69.79
48.74
55.31
50.83
1.37
46.95
2.64
6.03
ML.GG
10.32
50.04
15.35
24.70
34.67
63.56
37.88
46.75
0.52
15.58
1.01
2.29
MiniRocker
MMD
22.34
21.82
19.58
20.33
69.33
46.63
50.04
47.06
5.10
39.97
3.95
7.55
MTL
21.67
46.11
27.72
35.03
56.85
59.71
"56.93
58.28
12.57
45.79
4.02
5.15
SANDMask
4.32
7,40
13.14
12.56
33.33
18.14
24.88
44.87
2.59
4.73
SD
37.57
30.90
32.46
31.10
68.74
$0.59
53.26
50.92
6.40
39.73
9.43
15.29
SeltReg
31.09
14.46
18,02
15.65
61.18
33.26
39
34.99
16.33
42.06
*14.51
16.61
TRM
35.97
40.34
35.51
37.15
66.32
53.63
53.50
52.68
5.00
33.31
7.81
12.51
VREx
38.63
33.92
33.37
32.88
65.23
55.20
54.34
53.91
7.47
44.50
11.37
*17.11
IB-ERM
35.02
43.92
36.79
39.62
66.34
53.41
53.17
$2.40
4.94
43.01
8.12
13.79
IB-IRM
36.27
43.22
*37.36
39.57
64.67
54.02
53.69
53.00
8.56
44.63
11.18
15.06
BENDR
23,26
45.02
25.90
30.23
40.45
37.22
34.42
34.01
2.48
28.99
3.58
5.79
Franceschi et al.
34.21
40.98
33.94
35.15
43.28
50.56
44.03
48.97
2.62
44.74
4.26
9.65
SICR
10.18
4.56
6.10
5.06
23.51
7.16
9.79
8.01
*25.34
29.22
9.19
9.80
SEBG-Net
*45.41
45.62
43.54
44.22
#69.39
53.75
60.02
*55.99
32.81
20.82
22.92
PPi
49.85
69.67
54.35
61.07
71.73
70.81
70.61
70.55
29.76
47.59
30.92
35.51
5.3
Experimental Result
Tab. |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 PPi in the patient-independent seizure detection on SEEG data.
On the public datasets, PPi improves the performance by 38. 10% and 24.98% performing baseline model in terms of F2-score respectively, showing that PPi has stronger general- ization ability in seizure detection than other baselines. On our clinical dataset, PPi improves the performance by 94. on F2-score. Compared with other baselines that treat all channels equally, our designed self- cuffssueervieed tasks can preserve more unique characteristics of each channel. These tasks help our model to learn more informative representations from SEEG data, leading to much better performance on channel-level seizure detection. For SEEG-Net [66] which also focuses on patient- intient-independenn seizure detection on SEEG, it can maintain more balanced precision and recall 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 large margin, PPi
the best-
than other baselines, and achieves almost the second/third highest FI-score
Herr calculate the relative improvement.
8

---

not only preserve unique characteristics of each channel, but also introduces the extra information of brain regions 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- superviseee framework, including: (1) PPi-SSL;: PPi without the channel discrimination task; (2) PPi-SS PPi without the context swapping task; (3) PPi-SSL: 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 PPi-self attention). Another two experiments 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.
Table 2: Results of ablation experiments on two public datasets and the clinical dataset.
Dataset
MAYO
FNUSA
Clinical
Model
Pre.
Rec.
F2
Pre.
Rec.
F1
F2
Pre.
Rec.
F2
PPi-SSL1
43.69
48.01
31.22
35.37
58.46
59.39
56.05
57.27
20.68
44.23
19.13
24.63
PPi-8.SI2
40.69
38.32
34.72
35.74
47.69
50.53
76.79
48.42
20.75
42.82
18.72
23.73
PPi-SSL
35.65
22.89
25.92
23.77
69.00
44.29
53.04
47.29
7.53
30.75
10.94
16.08
PPi-reconstruuctin
44.01
50.29
34.15
36.89
60.78
62.31
59.48
60.02
22.04
44.84
21.23
25.01
PPi-puwer
48.60
31.43
29.01
28.31
62.89
54.48
56.77
55.13
28.13
30.48
19.75
20.87
PPi-self attention
48.82
60,20
51.15
55.41
65.14
66.91
62.17
63.98
28.67
46.98
29.56
32.59
PPi-background
46.80
31.31
31.08
30.05
57.83
50.20
51.68
50.28
20.42
35.40
21.83
26.74
PPi-hrain region
18.01
46.86
21.53
28.33
PPi
49.85
69.67
54.35
61.07
71.73
70.81
70.61
70.55
29.76
47.59
30.92
35.51
The comparison results of the ablation experiments on all the three datasets are presented in Tab. 2 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 supervueee 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. [56
5.5
Hyperparameter Analysis
The contexts half length h (i.e. the length of context above or context below) is important hyperparameter in PPi. Thus we evaluate the performance on the clinical dataset under differ- ent 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 increase the receptive field allows the model to compare the target segment with its nearby waveforms, result- ing 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.
prodsion
recall
F3.5
40
P3
comeeas half length k
Figure 5: Performance on clinical dataset under different contexts half length h.
9

---

5.6
Case Study
Visual analysis of channel background sub- traction. To handle domain shift, PPi adopts channel background subtraction which has the abillity align the distribution of the same brain region from different patients. In the visual anal- ysis, visualize such ability by comparing the aggregated representation Zc, (before subtrac- tion) and the difference representation z'.,. (af- ter subtraction) using t-SNE [48] plots. Specifi- cally, we select two channels which locate in the same brain region from two different patients (denoted as pt, p2) (results for more patients are shown in App. [.I). The t-SNE plots of their aggregated representations and difference repre- sentations are shown in Fig 6 The aggregated representations of p3 and Pj obviously exhibit different distributions. After channel background subtraction, the distributions of the samples from p: and pj 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.
scenal fou Ps
wikane Pr
nomal Py
viien Fj
esgroggted rppccntatiioo
Figure 6: t-SNE plots of aggregated representa- tions (left) and difference representations (right) of two channels from the same brain region of pa- tients p; and pj-
Confusion matrix of brain region enhancement. order demonstrate the effectiveness of brain region enhancement, we cal- culate the confusion matrix of the calliiclassification. Fig. 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 perfor- mance of the multi-classificttion task, illustrating the effectiveness of brain region enhancement.
Figure 7: Confusion matrix of brain region enhancement.
Conclusion
In this paper, we propose PPi to conduct scenario. To detect seizures more accurately, PPi adopts 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 two public and 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.
seizure detection on SEEG in the clinical
Limitations and future works. Compared with EEG, SEEG is emerging technique and the related research is limited. Although our work outperforms other methods by large margin on the clinical dataset, applications. the predicted results of PPi are mainly serve as a reference 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 related institution that is responsible for the development of an application software. In the future, our model will be integrated into the software assist doctors in seizure diagnosis.
Acknowledgement
This work is supported by NSFC (No.62166233,. the National Key Research and Development Project of China (N022018AA4010190) and the Fundamental Research Funds for the Central Universities.
10

---

References
[1] WHO. Epilepsy. epilepsy 2022.
whw.
[2] Juan D Martinez- Vargas, Gregor Strobbe, Kristl Vonck, Pieter Van Mierlo, and German Castellanos- Lostellanos-Dominguez Dominguez. Improved localization of seizure onset zones using spatiotemporal constraints and lin-varying source connectivity. Frontiers in Neuroscience, 11:156, 2017. The stereo-
[3] Soha Alomar, Jaes Jones, Andres Maldonado, and Jorge Gonzalez- electroencephalograahy methodology. Neurosurgery Clinics, 27(1):83 95. 2016.
[4] 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.
[5] Florian Mormann and Ralph G. Andrzejak. Seizure prediction: making mileage on the long and winding road. Brain, 2016.
[6] 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.
[7] Susanta Kumar Rout, Mrutyunjaya Sahani, PK Dash, and Pradyut Kumar Biswal. Multifuse multilayer multikernel rvfin+ process modes decomposition and approximate entropy data from ieeg/seeg signals for epileptic seizure recognition. Computers in Biology and Medicine, 132:104299, 2021.
[8] Wojeiech Samek, Frank C Meinecke, and Klaus-Robert Müller. Transferring subspaces between subjects in brain-compuue interfacing. IEEE Transactions on Biomedical Engineering, 60(8): 2289 2298, 2013.
[9] Birgit Frauscher, Nicolás von Ellenrieder, François Dubeau, and Jean Gotman. Different seizure- onset patterns in mesiotemporal lobe epilepsy have a distinct interictal signature. Clinical Neurophysiology. 128(7):2282 1289, 2017.
[10] Ryuta Mizutani, Rino Saiga, Yoshiro Yamamoto, Masayuki Uesugi, Akihisa Takeuchi, Kentaro Uesugi, Yasuko Terada, Yoshio Suzuki, Vincent De Andrade, Francesco De Carlo, et al. Struc- tural diverseness of neurons between brain areas and between cases. Translational psychiatry, 11(1):1-9, 2021.
[11] Bhargava Ganti, Ganne Chaitanya, Ridhanya Sree Balamurugan, Nithin Nagaraj, Karthi Bala- subramanian, 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.
[12] Linxia Xiao, Caizi Li, Yanjiang Wang, Junxi Chen, Weixin Si, Chen Yao, Xifeng Li, Chuanzhi Duan, and theng-Ann Heng. Automatic localization of seizure onset zone from grequeryy seeg signals: A preliminary study. IEEE Journal of Translational Engineering in Health and Medicine, 9:1-10, 2021.
[13] Chaoqi Yang, M. Brandon Westover, and Jimeng Sun. Manydg: Many-domain generalization for healthcare applications, 2023.
[14] 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.
[15] Eunjin Jeon, Wonjun Ko, Jee Seok Yoon, and Heung-ll Suk. Mutual information-driven subject- invariant and class-relevant deep representation learning in bei. IEEE Transactions on Neural Networks and Learning Systems, 2021.

---

[16] 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 learning- based cross-subject pathological activity detection method for drug-resistant epilepsy. Comput- ers Biology and Medicine, page 105703, 2022.
[17] 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.
[18] Mostafa Neo Mohsenvand, Mohammad Rasool Izadi, and Pattie Maes. Contrastive representa- tion learning for electroenceephalograa classification. In Machine Learning for Health, pages 238-253, PMLR, 2020.
[19] Demetres Kostas, Stephane Aroca-Ouellete, and Frank Rudzicz. Bendr: and contrastive self--upervised learning task to learn from massive amounts of eeg data, 2021.
using transformers
[20] Donghong Cai, Junru Chen, Yang Yang, Teng Liu, and Yafeng Li. Mbrain: A multi-channel self-supervised learning framework for brain signals, 2023.
[21] 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):006-66,, 2017.
[22] 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.
[23] Patrick Schäfer. The boss is concerned with time series classification in the presence of noise. Data Mining and Knowledge Discovery, 2906):1505-1530, 2015.
[24] 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.
[25] 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.
[26] Yuqi Nie, Nam H. Nguyen, Phanwadee Sinthong, and Jayant Kalagnanam. A time series is worth 64 words: Long-term forecasting with transformers, 2023.
[27] Hong Liu, Jeff Z. HaoChen, Adrien Gaidon, and Tengyu Ma. Self-supervised learning is more robust to dataset imbalance, 2022.
[28] Shelagh JM Smith. Eeg in the diagnosis, classification, and management of patients with epilepsy. Journal of Neurology, Neurosurgery & Psychiatry, 76(suppl 2):i12-i17, 2005.
[29] 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.
[30] Richard Staba and Gregory A Worrell. What is the importance of abnormal "background" activity in seizure generation? Issues in Clinical Epilepiology: A View from the Bench, pages 43-54, 2014.
[31] Nathalie Tzourio- Mazooe,, Brigitte Landeau, Dimitri Papathanassiou, Fabrice Crivello, Octave Etard, Nicolas Delcroix, Bernard Mazoyer, and Mare Joliot. Automated anatomical labeling of activations in spm using a macroscopic anatomical parcellation of the mni mri single-subject brain. Neuroimage, (5(1):273-289 2002.
[32] 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.
12

---

[33] Ya Li, Xinmei Tian, Mingming Gong, Yajing Liu, Tongliang Liu, Kun Zhang, and Dacheng Tao. Deep domain generalization via conditional invariant adversarial networks. ECCV, pages 624-639, 2018.
[34] Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In ECCV, pages 443 450. Springer, 2016.
[35] Shiori Sagawa, Pang Wei Koh, Tatsunori Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. arXiv preprinl arXiv: 1xXvv:911.0087/11 2019.
[36] Da Li, Yongxin Yang. Yi-Zhe Song, and Timothy Hospedales. Learning to generalize: Meta- learning for domain generalization. In AAAI, volume 32, 2018.
[37] Haoliang Li, Sinno Jialin Pan, Shiqi Wang, and Alex Kot. Domain generalization with adversarial feature learning. In CVPR, pages 5400-5409, 2018.
[38] Gilles Blanchard, Aniket Anand Deshmukh, Urun Dogan, Gyemin Lee, and Clayton Scott. Domain generalization by marginal transfer learning. The Journal of Machine Learning Research, 22(1))46-100, 2021.
[39] 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 preprini (tfi::2106.02222 2021.
[40] 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,
2021.
[41] Daehee Kim, Youngjun Yoo, Seunghyun Park, Jinkyu Kim, and Jackoo Lee. Selfreg: Self- supervised contrastive regularization for domain generalization. In ICCV, pages 9619-9628, 2021.
[42] Yilun Xu and Tommi Jaakkola. Learning representations that support robust transfer of predic- tors. arXiv preprint arXiv:21 2021.
[43] David Krueger, Ethan Caballero, Joem-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Dinghuai Zhang, Remi Le Priol, and Aaron Courville, Out-of-distribun generalization via risk extrapo- lation (rex). In ICML, pages 5815-5826. PMLR, 2021.
[44] Kartik Ahuja. Ethan Caballero, Dinghuai Zhang, Jean Shn-Christoppe Gagnon-Audet Yoshua Bengio, Joannis Mitliagkas, and Irina Rish. Invariance principle meets information bottleneck for -uitt---ditribuutinn generalization. Advances Neural Information Processing Systems, 34: 3438 3450, 2021.
[45] Colin Lea, Rene Vidal, Austin Reiter, and Gregory D Hager. Temporal convolutional networks: unified approach to action segmentation. In ECCV, pages 47-54. Springer, 2016.
[46] 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.
[47] Jven Franceschi, Aymeric Dieuleveut, and Martin Jaggi. Unsupervised scalable represen- tation learning for multivariate time series, 2020.
[48] Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, (11), 2008
13

---

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 representa- tions, which shows a promising performance non-invasive brain-computer interface.
SEEG-Net [16]: 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 3
an end-to-end conditional invariant deep DG approach by leveraging deep neural networks for domain-invariane representation learning.
CORAL 34
unsupervised domain adaptation method that aligns the second-order statistics of the source and target distributions with a linear transformation.
GroupDRO 35 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 [6]: 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
adversarial autoencoder framework learn a generalized latent feature representation across domains.
MTL [3]: representative framework for DG, which augments the original feature space with the marginal distribution of feature vectors.
SANDMask 339:
masking strategy, which determines a continuous weight based on the agreement of gradients, order to control the amount of update each step optimization under the notion of iitto--Distributionn (OOD) Generalization.
SD 40 regularization method aimed decoupling feature learning dynamics, improving accuracy and robustness in cases hindered by gradient starvation.
regularization method for DG based contrastive learning, self self-supervised contrastive regularization.
SelfReg [1
TRM 42
a robust estimation criterion that is specifically geared towards optimizing transfer to new environments.
VREx 43): penalty on the variance of training risks as a simpler variant based on form of robust optimization over perturbation of extrapolated domains.
IB-ERM a DG method that improve generalization via minimizes the empirical risk over multiple domains.
IB-IRM 44 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:
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.
BENDR [9]:
Franceschi et al 47 This work combines encoder based on causal dilated convolutions with a novel triplet loss employing time-based negative sampling, obtaining general-purposs. representations for variable length and multivariate time series.
14

---

B Details of Datasets
B.1
Public Datasets
The group dividing strategy and detailed statistics of the two public datasets are shown in
Tab.
The datasets are publicly available to under CCO license and might be downloaded
from
intracranial BEG Barod_ddtasettece for of
and
Table 3: Group dividing strategy and detailed statistics of two public datasets.
Dataset
MAYO
Dataset
FNUSA
Group id
Group id
Patient id Artifacts Seizure Normal
Patient id Artifacts Seizure Normal
2318
0
330
1912
Groupl
18
1700
0
3126
Group1
5059
1527
5452
58
3432
Total
4076
3432
3456
Total
5059
3439
5452
0
883
8653
2892
1657
7809
Group2
740
Group2
6750
19
5613
0
Total
6353
883
8653
Total
2892
8407
7809
466
1923
12
8076
Group3
1002
0
6583
Group3
8463
0
16
3699
0
177
12
1343
7710
38217
Total
5167
1923
7159
Total
9818
15786
38217
4636
0
2057
1554
962
Group4
2063
0
790
Group4
5416
7738
2689
23
761
2747
644
Total
7460
2747
3491
Total
5416
9292
3651
12873
0
18
1896
20860
Group5
0
0
25951
Group5
10
5786
4260
1545
8
0
2816
Total
12873
2816
25951
Total
5804
6156
22405
14
0
3426
498
11 13
3339
4072
2890
Group6
17
4096
0
6098
Group6
181
5318
14136
20
1278
0
1424
Total
5374
3426
8020
Total
3520
9390
17026
B.2
Clinical Dataset
The detailed information of the clinical dataset is shown in Tab. and the sample rate of all the patients is 1000Hz.
Table
Details information of the clinical dataset.
Patient id
Time (hours)
#Electrodes
#Channels
Positive sample ratio
#Timestamps
121.4
10
126
0.0028
180632184
34.7
52
0.0020
21642853
167.7
10
126
0.0011
241488147
73.7
8
116
0.0077
102649651
161.3
8
112
0.0037
195457035
54.3
93
0,0016
43684998
125.2
59
0.0167
70605073
15

---

C Experimental Results with Standard Deviation
The average performance with standard deviation of MAYO, FNUSA and clinical dataset shown in Tab.
Tab. and Tab. 7 respectively.
D
Full Results of Case Study
D.1 Visual Analysis 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 Fig. B). In each group, the samples 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.
Ineaal pakke
sonar here the to pract
patiat
Figure 8: Six visualization examples as a supplement and improvement to the visual analysis of channel background subtraction.
D.2 Confusion Matrix of Brain Region Enhancement
The confusion matrix of nulti-classification on all the patients shown in Fig. Note that the total number of classes in the confusion matrix different for different patients. This is because the number and positions of electrodes implanted in each patient different when the SEEG signal is collected, resulting in different brain regions involved by the SEEG data of different patients, which also one of the reasons for domain shift.
16

---

patient 0
patient
patient 2
patient 3
patient
patient
patient 6
Figure 9: Confusion matrix of brain region enhancement from the multi-classification results of all patients in the clinical dataset.
17

---

Table Average performance with standard deviation of patient-independen seizure detection tasks on MAYO. The v indicates the first in column, v indicates the second, and "y indicates the third.
Datasct
MAYO
Model
CDANN
16.13 5.00
68.144
24.74 = 7.67
37.84
8.74
CORAL
17.01 5.14
64,08
25.73
6.63
38.30
GroupDRO
17.26 5.10
64.25
2.32
26.02
1: 6.43
38.68
6.82
MLDG
18.88 4.22
61.38
4.65
27.96
= 4.92
40.39
4.78
MMD
15.79 4.37
67.41
7.21
24.45
:: 6.28
1.34
MTL
16.13 4.772
51.87
11.96
22.56
= 5.11
31.74
5.72
SANDMask
16.47
6.62
38.15
8.64
SD
15.29 5.08
60.70 + 3.01
23.10 = 6.38
34.07
6,69
SelfReg
9.42
58.65
14.87
5.55
26.29
TRM
16.94 + 4.82
39.60 5.18
24.47
5.30
35.07
5.56
VREx
16.74
60.41
25.06
36.87
IB ERM
17.27 5.5010
64.29 1 2.30
26.04
1: 6.44
38.71
6.82
IB IRM
16.75
60.45
25.08
36.90
CDANN
16.22 +
15.44
15.14 5,49
15.20
CORAL
+47.61
14.14
25.30 9.35
27.57
10.35
25.46
9.55
GroupDRO
34.02
13:71
35.98
34.49
MLDG
10.32 + 3.16
30.04
12.47
15.35
+ 5.36
24.70
7.85
MintRocket
MMD
22.34
21.82
19.58
20.33
MTL
21.67 7.13
46.11 2 12.08
27.72 7.58
35.03
7,90
SANDMask
4.32
33.33
7.40
13.14
37.57 7.52
30.90 6:21
32,46 - 6.00
31.10
5.76
SelfReg
31.09 +
14,46
18.02 6.85
15.65
TRM
35.97 7.11
40.34
8.15
35.51 5.86
37.15
3.92
VREx
38.63 + 7.60
33.92
33.37 6.66
32.88
IB ERM
35.02 7.18
43.92
1.49
36.79
+ 6.25
39.62 3.55
IB. J_JRM
36.27
7.56
43.22
6.55
37.36 5.92
39.57 4.71
BENDR
23.26
45.02
25.90 547
30.23
Franceschi et al.
34.21 + 4.96
40.98
7.29
33.94 = 6.33
35.15
6.72
SICR
10.18 + 6.38
4,56 2: 2.72
6.10 + 3.75
5.06 3,04
SEEG-Net
45.41
45.62
*43,54+
*44.22
PPi
49.85
69.67.1
54.35
61.07:1
Table Average performance with standard deviation of patient-independent seizure detection tasks on FNUSA. The v indicates the first in column, v indicates the second, and *y indicates the third.
Dataset
FNUSA
Model
Pre.
F1
F2
CDANN
32.71 + 6.42
69.624: 277
43.09
3.61
54.88
+ 3.58
CORAL
33.87 6.25
65.46 3,33
43.63
5.78
53.84
4.44
GroupDRO
33.24 6.43
62.14
2.99
41,90
5:24
51.27
3.47
MLDG
32.81 1 6.61
56.81
40.41
5.43
48.24
3.71
MMD
32.87 :
969 069.381155
5.98
4.28
TCN
MTT.
32.70 = 6.4
53. 10:0=10 11.03
38.48
6663
44.78
7.54
SANDMask
32.16
59.46
39.62
48.59
7.87
SD
34.30 + 6.11
1.85 65.54
43.77
+ 5.08
53.88
+ 3.16
SelfReg
25.35
66.75
35.87
9.95
48.79
TRM
34.32 + 6.17
4.01 62.26
43.39
5.10
51.93
+ 3.76
VREX
33.17
61.75
41.84
51.11
IB ERM
34.34 6.15
1.88 63.06
62.94
42.93
= 4.93
$2,22
+ 1.58
IB 3_IRM
34.26 6.14
43.10
52.44
CDANN
48.73
36.97
38.26
37.02
CORAL
68.46 7.01
46.55
11.81
52,50
+: 8.63
48,36 + 10.57
GroupDRO
69.794
48,74
55.31
50.83
MLDG
34.67 1: 10.16
63.56
16.37
37 88
5.75
46.75
1 7.83
MiniRocket
MMD
69.33 6.50
46.63
50.04
47.06
MTL
56.85 1: 5.25
59.71
10.71
+56.93 6.94
58.28 9.00
SANDMask
12.56
33.33
18.14
24.88
SD
68.74 11.63
50.59
12.30
53.26
+ 6.88
50.92 + 10.09
SelfReg
61.18
33.26
39.29
10.66
34,99 +
TRM
66.32 12.14
53.63
12.07
53,50
5.78
52.68 1: 9.35
VREx
65.23
55.20
+
54.34
5.36
53.91
+ 7.58
ERM
66.34 :: 12.17
53.41
12.38
53.17
5.82
52.40
1 9:57
IRM
64.67 11.99
54,02
11.29
$3.69
5.41
$3,00
1: 8.55
BENDR
40.45 7,02
37.22
34,42
34.01 +: 6.10
Franceschi et
43.28 5.90
50.56
8.39
44.03
7.11
48,97 + 7.68
SICR
23.51 4: 14.12
7.16 4: 5.66
9.79 =: 7.87
8.01 6.37
SEBG-Nel
#69.39:1.933
53.75
60.02.1:
+55.99
PPi
71.73
70.81
70.61
70.55
18

---

Table 7: Average performance with standard deviation of patient-independent seizure detection tasks on clinical dataset. The v indicates the first in column, indicates the second, and *y indicates the third.
Dataset
Clinical
Model
Pre.
Rec.
F1
F2
CDANN
1.42
44.20
2.72
6.08
CORAL
1.59 0.4
47.24
+ 2.12
3.03 + 1.20
6.64
2:3
GroupDRO
1.53
47.13
2.91
6.35
MLDG
28.85.1
6.68 1: 3.92
2.55 1.5.8
2.58 1 0.89
MMD
0.70
46.84
3.26
6.59 +
TCN
MTL
1.43 0.56
9.19 0.59
1.88
3.73 1 1.18
SANDMask
1.34 0.344
$47.22:144
2.60
5.95 +
SD
1.52 0.60
2.91 1.13
6.38 + 2.38
SeltReg
0.92 0.62
44.48 5.04
+.16
3.94
2.52
TRM
1.53 0.60
47.34+1.4
2.91 1.12
+ 2.35
VREx
10.98 5.000
42.17 8225
2.78
5.33
ERM
1.53 0.60
47.3411.00
1.12
6.35
2.35
IB B_RRM
1.52 0.60
2.699 45.65
2.89
1.13
6.31 1 2:38
CDANN
2.09 0.83
45.27 + 15.7
3.98
+
8.68 + 3.47
CORAL
1.68 0.66
42.54
+ 19334
3.20
+ 1.30
7.08
+ 3.04
GroupDRO
1.37 0.62
46.95
7.15
2.64
6.03
2:33
MLDG
0.52 0.91
15.58 + 21.61
1.01
+ 1.75
+ 332
MiniRocket
MMD
5.10
39.97
19.12
3.95
7.55 2.90
MTL
45.79
15000
3.79
2.77
SANDMask
1.49 +
44.87 + 10.27
2.59
4.19
4.73 + 7.06
SD
2.66
14.38
9.43
4.26
15.29
SelfReg
16.33 = 6.81
42.06
+ 1484
#14.51 8.98
16.61 888
TRM
5.00
33.31
7.81
12.51
VREx
7.47 4-4.3
44,50
+ 10.18
11.37
+: 6.68
+17.11+ 8.94
ERM
4.94
43.01
8.12
13.79
IB IRM
8.56 4:549
44.63
+ 11.52
11.18 +: 6.41
15.06 + 7.38
BENDR
2.48 +.91
28,99 + 6.90
3.58 + 1.44
5.79 + 2:33
Franceschi
44.74
4.26
+
SICR
#25.34.1 15.68
29,22
1: 20.08
9.19 4.89
4.41
SEEG-Net
20.06 5.56
32.81
+ 8.50
20.82
22.92 5.96
PPi
29.76.1. 5.45
47.59
30.92:1
35.51 2.35
19


Reviews:
[{"review_id": "r7IiDVdDII", "reviewer": "Reviewer_oXnd", "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.", "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.\n2) Update the references by considering some recent and relevant studies.\n", "limitations": "Yes, but briefly. It is suggested to discuss more this point.", "rating": 6, "confidence": 5, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "- A pretraining-based model for patient-independent seizure detection (PPi) using SEEG signals. \n- 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.\n", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We thank the reviewer for all the insightful comments. Responses to specific comments are listed below. \n\n* **Q1: Highlight the effectiveness of PSD-based features in the proposed method.**\n\n  Thank you for the good suggestion. There are some related works which support the effectiveness of PSD-based method in seizure deteciton. For example, [1] stated that the spectral power of brain signal has the ability to track the transient changes before and during seizure.  [2] argued that the spectral power in certain sub-bands of the SEEG, specifically in higher frequency sub-bands, may play a key role in seizure prediction. \n\n  We will add the above works in the manuscript to highlight the effectiveness of PSD-based features in our proposed method.\n\n* **Q2: Update the references.**\n\n  Thank you for the good suggestion. We will update some of the references to more recent studies. The updates are as follows:\n\n  - In line 31 of the manuscript, sentence \"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\". We will replace the original reference of this sentence by [5].\n\n  - In line 38 of the manuscript, sentence \"However, existing works for SEEG-based seizure detection mainly focus on the patient-specific setting\". We will replace the original reference of this sentence by [3].\n\n  * In line 82 of the manuscript, sentence \"Ayoubian et al. employ wavelet decomposition, feature extraction, adaptive thresholding and artifact removal in SEEG data\". We will replace the sentence by \"Truong et al. [6] propose Integer-Net to conduct seizure detection on both EEG and SEEG\".\n\n  * In line 101 of the manuscript, we will add a sentence \"Zhang et al. [4] regularize the discrepancy between closely-related domains to achieve domain generalization\".\n\nReferences:\n\n[1]M. Bandarabadi, C. A. Teixeira, J. Rasekhi, and A. Dourado, “Epileptic seizure prediction using relative spectral power features,” Clin Neurophysiol., 2014.\n\n[2]Netoff T, Yun P, Parhi K. Seizure prediction using cost-sensitive support vector machine. Engineering in medicine and biology society, 2009 EMBC 2009. In: Annual international conference of the IEEE 2009. p. 3322–5.\n\n[3]Chen J, Yang Y, Yu T, et al. Brainnet: Epileptic wave detection from seeg with hierarchical graph diffusion learning[C]//Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining. 2022: 2741-2751.\n\n[4]Zhang W, Ragab M, Foo C S. Domain Generalization via Selective Consistency Regularization for Time Series Classification[C]//2022 26th International Conference on Pattern Recognition (ICPR). IEEE, 2022: 2149-2156.\n\n[5]Mormann F, Andrzejak RG. Seizure prediction: making mileage on the long and winding road. Brain. 2016 Jun;139(Pt 6):1625-7. \n\n[6]Truong N D, Nguyen A D, Kuhlmann L, et al. Integer convolutional neural network for seizure detection[J]. IEEE Journal on Emerging and Selected Topics in Circuits and Systems, 2018, 8(4): 849-857."}, {"review_id": "6U6iKCG5Dn", "reviewer": "Reviewer_zvti", "summary": "This 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.", "questions": "1. 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.", "limitations": "The 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.", "rating": 5, "confidence": 4, "soundness": 2, "presentation": 2, "contribution": 2, "strengths": "1. 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", "weaknesses": "1. 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\n", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We thank the reviewer for all the insightful comments. Responses to specific comments are listed below. \n\n* **W1: Clarification for the unclearness of novelty raised by presentation.**\n\n  Thanks for pointing this out. The novelty of the proposed method are listed below:\n\n  * Our method contains two novel self-supervised pretraining tasks (i.e., channel discrimination and context swapping). Different from other SSL studies, the motivation of our designed tasks is to preserve the unique patterns of each channel, which is more consistent with the physiological mechanism of seizures.\n\n  * We propose two techniques including channel background subtraction and brain region enhancement in our method to handle the domain shift between different patients. Different from other domain generalization works (e.g. [1], [2], [3] ), we fully consider the characteristics of SEEG in our design, so that we can achieve better performance in this scenario.\n\n  We will incorporate the above content into the methodology section to enhance the clarity of the novelty in the proposed method.\n\n* **W2: Report standard deviation of the experiments.**\n\n  We are sorry for not reporting the standard deviation of the experiments. Due to the limitation of the reply characters, we report the results with standard deviation of our model and several well-performed baselines as follows:\n\n  |                 | MAYO         |         |        |           | FNUSA        |               |              |              | Clinical     |               |              |              |\n  | --------------- | ------------ | ------------- | ------------ | ------------ | ------------ | ------------- | ------------ | ------------ | ------------ | ------------- | ------------ | ------------ |\n  |                 | Pre.         | Rec.          | F1           | F2           | Pre.         | Rec.          | F1           | F2           | Pre.         | Rec.          | F1           | F2           |\n  | TCN+CDANN | 16.13+/-5.80 | 68.14+/-4.17  | 24.74+/-7.67 | 37.84+/-8.74 | 32.71+/-6.42 | 69.62+/-2.77  | 43.09+/-5.61 | 54.88+/-3.58 | 1.42+/-0.51  | 44.20+/-13.85 | 2.72+/-0.98  | 6.08+/-2.21  |\n  | TCN+MLDG        | 18.88+/-4.22 | 61.38+/-4.65  | 27.96+/-4.92 | 40.39+/-4.78 | 32.81+/-6.61 | 56.81+/-2.41  | 40.41+/-5.43 | 48.24+/-3.71 | 28.85+/-9.34 | 6.68+/-3.92   | 2.55+/-0.58  | 2.58+/-0.89  |\n  | MiniRocket+MTL  | 21.67+/-7.15 | 46.11+/-12.08 | 27.72+/-7.38 | 35.03+/-7.90 | 56.85+/-5.25 | 59.71+/-10.71 | 56.93+/-6.94 | 58.28+/-9.00 | 12.57+/-9.03 | 45.79+/-15.03 | 4.02+/-3.79  | 5.15+/-2.87  |\n  | MiniRocket+VREx | 38.63+/-7.60 | 33.92+/-8.63  | 33.37+/-6.66 | 32.88+/-7.15 | 65.23+/-9.83 | 55.20+/-9.33  | 54.34+/-5.36 | 53.91+/-7.58 | 7.47+/-4.73  | 44.50+/-10.18 | 11.37+/-6.68 | 17.11+/-8.94 |\n  | SEEG-Net       | 45.41+/-9.96 | 45.62+/-9.56  | 43.54+/-8.84 | 44.22+/-8.98 | 69.39+/-9.23 | 53.75+/-7.62  | 60.02+/-8.05 | 55.99+/-7.73 | 20.06+/-5.56 | 32.81+/-8.50  | 20.82+/-5.70 | 22.92+/-5.96 |\n  | PPi | 49.85+/-6.93 | 69.67+/-2.82  | 54.35+/-4.72 | 61.07+/-4.69 | 71.73+/-4.06 | 70.81+/-2.14  | 70.61+/-2.82 | 70.55+/-2.28 | 29.76+/-5.45 | 47.59+/-5.16  | 30.92+/-3.45 | 35.51+/-2.35 |\n\n  We will **update all the experiment results** in the manuscript with standard deviation in the final version.\n\n* **Q1: Clarification for Fig.5 in case study with examples.**\n\n  Thanks for pointing this out. In the field of SEEG for seizure detection, there will be some ambiguous samples in the labeling process of epilepsy. Not even human experts can be 100% sure about the labels of these samples, thus there will be some discrepancies in the results marked by different annotators in the labeling process.  It is also difficult for the model to handle these samples. For exmaple, in Fig. 1 from the pdf file in global response, the signals highlighted with blue are very similar with the normal signals (highlighted with yellow) but were labeled as seizure. Likewise, there will also be some signals that look like seizures but are labeled as normal. \n\n  Due to the above reasons, in our scenario, it is almost impossible to result in a very clear seperation between seizure and normal samples. In Fig. 5 of the manuscript, the seizure samples are clustered at the edges, enabling the classifier to distinguish most of the samples.\n\n* **Q2: Add a shortend version of Section E in the appendix to the main text.**\n\n  Thank you for the good suggestion. We will add a new section (Section 5.6) in the manuscript which includes one of the figures from Fig. 7 to Fig. 13 in Appendix and the following paragraph:\n\n  \"In order to demonstrate the effectiveness of brain region enhancement, we calculate the confusion matrix of the multi-classification. Fig. 6 shows the confution matrix from one of the patients (the confusion matrix of all the patients are shown in Appendix E), in which the vertical axis represents the multi-class label $y_{c,k}'$ and the horizontal axis represents the multi-class prediction result $\\hat{y}_{c,k}'$. We can see that 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.\"\n\nReferences:\n\n[1]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 learning based cross-subject pathological activity detection method for drug-resistant epilepsy. Computers in Biology and Medicine, page 105703, 2022.\n\n[2]Daehee Kim, Youngjun Yoo, Seunghyun Park, Jinkyu Kim, and Jaekoo Lee. Selfreg: Self-supervised contrastive regularization for domain generalization. In ICCV, pages 9619–9628, 2021.\n\n[3]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."}, {"review_id": "KW37da5mHT", "reviewer": "Reviewer_iQPF", "summary": "This 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.", "questions": "The 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\n\n\n\n", "limitations": "No limitation", "rating": 7, "confidence": 3, "soundness": 3, "presentation": 2, "contribution": 3, "strengths": "This 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.", "weaknesses": "In 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.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Thank you for your constructive and detailed comments. Responses to specific comments are listed below. \n\n* **Q1: Calculation method of performance improvement value in the manuscript.**\n\n  We apologize that the calculation of the improvement may not be clearly stated in the manuscript. Actually, the improvement claimed in our manuscript is a relative improvement which is also utilized in [1]. Specifically, suppose the performances are $a$% and $b$% (a>b), then the relative improvement is calculated as $\\frac{a-b}{b}\\times 100$%. We will add a clear description in the main manuscript.\n\n* **Q2: Detailed explanation and discussions about ablation study.**\n\n  In the ablation study, PPi-SSL1, PPi-SSL2, PPI-SSL are included to demonstrate the effectiveness of our self-supervised tasks. PPi-SSL1 means in the pre-training stage, we only do the context swapping task. Likewise, PPi-SSL2 means in the pre-training stage, we only do the channel discrimination task. **PPi-SSL means the encoder is not pre-trained by the self-supervised tasks and directly trained in the downstream seizure detection.** PPi-power is included to demonstrate the effectiveness of the features from frequency domain. **PPi-power means we only use the encoder pre-trained with the self-supervised tasks to encode the data to representations, but do not use the power spectral density.**\n\n  Since each component is carefully designed, if any part is missing, the performance of the model will drop a lot compared to the complete version, resulting in a lower than the best baseline. It also reflects that our model is not simply a patchwork of individual components, but that these components work together.\n\n* **Q3: Plans about releasing our clinical dataset.**\n\n  Thank you for providing this good advice. Releasing such a clinical dataset involves highly sensitive intracranial data and personal privacy concerns and we are working hard to make the dataset publicly available. \n\n  It is very difficult to make this dataset all public in a short time. Therefore, we plan to promote the release of our dataset in the following two steps: \n\n  * Step1: We will engage in proactive communication with the hospital and strive to make a subset of raw data available within a half year. Similar to the procedures outlined in our manuscript, these data releases will also adhere to ethical review mandates.\n  * Step2: In the future, we will examine the feasibility of releasing the complete dataset once it receives the necessary ethical review approval. This will enable researchers to utilize the large-scale dataset for further research purposes.\n\n* **Q4: Discussions about the potential improvement.**\n\n  In addition to the model, the dataset itself will also have a great impact on the score (such as the ratio of positive and negative samples, data noise, label noise, etc.). So in the experiments, the scores on clinical dataset are lower than those on public datasets. We believe that scores can be improved mainly in two ways. The first is optimizing the model (such as model design, model training) to get a higher performance. The second is to improve the quality of the dataset (e.g., clean the data carefully before training). We will continue to explore for better performance in the future.\n\n  In the main manuscript (limitations and future works), we stated that the predicted results of our model 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. Additionally, during our research, we engaged in discussions with doctors who expressed their positive response towards our model’s performance that aids in the diagnosis of epilepsy at the current stage.\n\nReferences:\n\n[1]Chen J, Yang Y, Yu T, et al. Brainnet: Epileptic wave detection from seeg with hierarchical graph diffusion learning[C]//Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining. 2022: 2741-2751."}, {"review_id": "n5Y7VLFOu5", "reviewer": "Reviewer_M3UK", "summary": "Seizure 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", "questions": "What 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", "limitations": "The authors seems to correctly adress the limitations of the article", "rating": 8, "confidence": 3, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "This 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.", "weaknesses": "One 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", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We thank the reviewer for all the insightful comments. Responses to specific comments are listed below. \n\n* **Q1&Q2: Preprocessing steps for the datasets.**\n\n  For the public datasets, we first remove the power line noise and then dowm sample the data to 500Hz. For the clinical dataset, we remove the powerline noise, down sample the data to 250Hz and apply a normalization to each channel by the equation $\\frac{x-\\mu}{\\sigma}$, where $\\mu, \\sigma$ are the mean and standard deviation of the channel. \n\n  For artifact rejection, we remove the power line noise in the public datasets and clinical dataset before training.\n\n  We apologize for not clearly mentioning the preprocessing steps and will add the above description to our manuscript.\n\n* **Q3: Examples of SEEG signals of well-detected and undetected seizures by the model.**\n\n  Of course, we pick up the raw traces of well-detected and undetected seizures which are shown in Fig. 1 in the pdf file in global response. In Fig. 1, we show two examples. In the examples, we highlight the normal signals (when the patient is in the absence of epilepsy) with yellow, the well detected seizures with red, and the undetected seizures with blue. \n\n  In most cases, those more pronounced seizure signals (with more violent fluctuations, highlighted in red) were easier for the model to identify. However, some seizure signals are very similar to their nearby normal signals (highlighted in blue), making it difficult for the model to identify such signals."}, {"review_id": "hjobCaR9zx", "reviewer": "Reviewer_LsDA", "summary": "This 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.", "questions": "1. 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. ", "limitations": "Some limitations are discussed in the end of the paper.", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 2, "strengths": "1. 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. ", "weaknesses": "1. 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.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We thank the reviewer for all the insightful comments. Responses to specific comments are listed below. \n\n* **Q1: Replace some notations with plain language in the manuscript.**\n\n  Thank you for this good suggestion. The plain language version for Definition 1 is in line118-119: \"Our goal is to utilize the data of labeled patients (source domains) to train a model which can be directly adopted to the data of unseen patients (target domains).\" We will remove Definition1 for better readability.\n\n  In line 160: \"where the sampling probability $P(c1= c2) = P(c1\\neq c2) = 0.5$\", we will change with \"where the two sequences are sampled from the same or different channels with equal probability.\"\n\n* **Q2: The solution of sampling contexts for the beginning or end of the signal.**\n\n  In the pre-training phase, the data scale is large, so we just simply ignore the beginning and the end of the signal. We apologize for not clearly clarifying this and we will add the clarification to the main manuscript.\n\n* **Q3: Clarification for \"difference vector\" used in \"channel discrimination\" and ablation for aggregation strategy.**\n\n  In channel discrimination, since the target is to compare the difference between two signals, we consider to use a elementwise absolute difference. This choice is motivated from [1], in which they do a relative positioning (RP) task. In RP, they train the model to dicriminate whether the given two time windows are far or close to each other. They use the elementwise absolute difference to combine the two vectors. Since RP and channel discrimination both involve the comparison of the difference between the given two samples, we think a elementwise absolute difference may be more suitable. \n\n  While context swapping does not involve a direct comparison of the difference between the given two samples, but more focus on the coherence semantic uniqueness of contextual information. As a result, we think a concatenated vector is more suitable for context swapping.\n\n  In the aggregation strategy, by assigning weights to representations in the time and frequency domains through the attention mechanism, the model can adaptively choose between the two representations. In the implementation, we feed the time domain representation and frequency domain representation into a self-attention layer, and then apply a mean pooling to the output of this layer. To verify the effectiveness of self-attention experimentally, we add an addtional ablation experiment on self-attention (result is shown in Table 1 in the global response).\n\n* **Q4: Ablation for reconstruction loss.**\n\n  Thanks for the good advice. The ablation with the reconstrcution loss is shown in Table 1 in the global response. We will add this result along with the ablation for self-attention aggregation to the original ablation study to our revised paper, including the settings, results and corresponding analysis.\n\n* **Q5: Clarification about brain region enhancement task for the two public datasets.**\n\n  Yes, the results of the two public datasets in Table 1 do not include brain region enhancement task. As the brain region enhancement needs the brain region labels and these two public datasets do not contain brain region labels, brain region enhancement cannot be applied to the two public datasets.\n\n* **Q6: Additional experiments for case study.**\n\n  Thank you for this good suggestion. We conduct another 6 groups of visualization analysis and show the results in Fig. 2 from the pdf file in global response. The patients we chose cover all the 7 patients in the clinical dataset. In the new visualization analysis, we made the following improvements to make the results more clear (suggestions for improvement come from reviewer DeFx): \n\n  (1) We reduce the number of points included in the plot to a fifth of the original by random sampling.\n\n  (2) We plot the representations of two patients on the same t-SNE graph with 4 distinct colours instead of splitting them.\n\n  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.\n\n* **Q7: Discussions about subject numbers.**\n\n  Thanks for pointing this out. The number of patients in our datasets (7 in clinical dataset, 13 in MAYO and 18 in FNUSA) are relatively small compared to other fields (e.g. EEG). This is a good suggestion and we will discuss this limitation in our manuscript. \n\n  Actually SEEG is an emerging field, and the conditions for obtaining data are very strict as it requires craniotomy surgery for electrode implantation and long-term data recording. Some other works in this field also contains a limited number of patients (e.g., [2] contains 10 patients, [3] contains 10 patients). We are working hard to communicate with hospitals, hoping to release more data. Strive to alleviate the problem of insufficient data in the field of SEEG.\n\n\nReferences:\n\n[1]Hubert Banville, Omar Chehab, Aapo Hyv.rinen, Denis-Alexander Engemann, and Alexandre Gramfort. Uncovering the structure of clinical eeg signals with self-supervised learning. Journal of Neural Engineering, 18:046020, 2021.\n\n[2]Chen J, Yang Y, Yu T, et al. Brainnet: Epileptic wave detection from seeg with hierarchical graph diffusion learning[C]//Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining. 2022: 2741-2751.\n\n[3]Wang C, *et al.*, \"BrainBERT: Self-supervised representation learning for intracranial recordings.\" *International Conference on Learning Representations, 2023*. "}, {"review_id": "XvBFqQSZIp", "reviewer": "Reviewer_DeFx", "summary": "The 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", "questions": "1. 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.", "limitations": "please refer to the weaknesses", "rating": 5, "confidence": 3, "soundness": 2, "presentation": 3, "contribution": 2, "strengths": "1. 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.", "weaknesses": "1. 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.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We thank the reviewer for all the insightful comments. Responses to specific comments are listed below. \n\n* **W1: Add supporting references to strengthen the argument for SSL tasks.**\n\n  Thanks for the suggestions. [1], [3], [4] are some works which also apply SSL to extract time-domain features. [2] stated that the performance gap between balanced and imbalanced pre-training with SSL is significantly smaller than the gap with supervised learning, which means the SSL is more robust in our scenario.\n\n  Our SSL tasks are applied solely to the time domain because the designed tasks are mainly to capture the change of the signal over time. Especially in context swapping, this task is to enhance the coherence semantic uniqueness of contextual information, which is based on time domain information.\n\n  We will add the above discussions to our manuscript.\n\n* **W2: Add supporting references to explain why SSL can be robust to dataset imbalance.**\n\n  Thanks for the suggestions. There are some works which claim that SSL can address the data imbalance issue. For example, [1] \\(SIGKDD 2023\\) adopts SSL pre-training to alleviate the data imbalance. [2] (ICLR 2022 spotlight) systematically investigate SSL under dataset imbalance and find that SSL is more robust to dataset imbalance. We will add the above works to the manuscript to clarify this claim.\n\n* **W3&W4: Motivations for preserving unique brain area characteristics and additional visualization analysis as supporting.**\n\n  Thanks for the concerns and suggestions. Our response is consists of two parts.\n\n  (1) Since the similarity in structure and function of the same brain region among patients, the representations of the same brain regions can be aligned (illustrated by the case study). Thus, we only consider preserving the unique characteristics among different brain regions rather than other individuals differences.\n\n  (2) We conducted visualization analysis with 7 more examples (shown in Fig. 2 and Fig. 3 from the pdf file in global response).  As you suggested, we reduce the number of points included in the plot to a fifth of the original and plot both figures of two patients on the same t-SNE graph with 4 distinct colours. \n\n  In Fig. 2, 6 more examples were included. In each of them, the representations are from the same brain region of two different patients.\n\n  In Fig. 3, we add another example where the representations are from different brain regions of two different patients. Compared with other plots, the distributions in this plot are not totally aligned after the channel background subtraction, indicating the unique characteristics of different brain regions are preserved within the latent features.\n\n* **W5: Ablation study for reconstruction and self-attention layer.**\n\n  Thanks for the suggestion. The ablation study of the reconstruction loss term and the self-attention layers' significance is shown in Table 1 in the global response. We will add the results to the original ablation study to our revised paper, including the settings, results and corresponding analysis.\n\n* **Q1: Discussions about exhibiting performance variations on different datasets (explored by additional experiments).**\n\n  Thanks for bringing up this point. Actually on the FNUSA dataset, PPi-SSL obtains 47.29% on F2 score, which is slightly lower than PPi-SSL2 (48.42%). On MAYO and clinical dataset, the performance of PPi-SSL shows a considerably decrease compared with PPi-SSL2. In order to explore such discrepancies, we reconducted these two sets of experiments and obtained similar results:\n\n  |          | MAYO         |              |              |              | FNUSA        |              |              |              | Clinical     |              |              |              |\n  | -------- | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ |\n  |          | Pre.         | Rec.         | F1           | F2           | Pre.         | Rec.         | F1           | F2           | Pre.         | Rec.         | F1           | F2           |\n  | PPi-SSL2 | 41.27+/-5.59 | 39.10+/-5.43 | 36.02+/-4.97 | 36.96+/-5.13 | 50.45+/-7.45 | 49.43+/-6.86 | 47.25+/-2.80 | 48.78+/-4.49 | 18.94+/-4.82 | 47.21+/-6.87 | 16.85+/-3.02 | 24.15+/-3.16 |\n  | PPi-SSL  | 33.23+/-8.44 | 24.02+/-5.12 | 26.12+/-5.83 | 24.47+/-5.24 | 74.20+/-7.96 | 40.11+/-5.78 | 52.56+/-4.93 | 45.36+/-5.35 | 9.87+/-2.14  | 25.32+/-4.65 | 12.74+/-2.66 | 16.19+/-2.99 |\n\n  So we think the performance variation might be attributed to the differing class distributions within the datasets.\n\n* **Q2: Clarification about brain region enhancement task for the two public datasets.**\n\n  In the manuscript, line 296: \"For the ablation experiments on two public datasets, brain region enhancement is not applied due to lack of information about brain regions.\"\n\n  As the brain region enhancement needs the brain region labels and these two public datasets do not contain brain region labels, brain region enhancement cannot be applied to the two public datasets. We will reorganize our description in the text to make it more clear: \"Due to the requirement of brain region labeling in brain region enhancement, the lack of such labels in the two public datasets makes brain region enhancement inapplicable to the public datasets\".\n\nReferences:\n\n[1]Chen J, Yang Y, Yu T, et al. Brainnet: Epileptic wave detection from seeg with hierarchical graph diffusion learning[C]. 2022.\n\n[2]Liu H, HaoChen J Z, Gaidon A, et al. Self-supervised learning is more robust to dataset imbalance[J]. 2021.\n\n[3]Shao Z, Zhang Z, Wang F, et al. Pre-training enhanced spatial-temporal graph neural network for multivariate time series forecasting[C]. 2022.\n\n[4]Nie Y, Nguyen N H, Sinthong P, et al. A time series is worth 64 words: Long-term forecasting with transformers[J]. 2022."}]

Author rebuttal:
### Global response

We thank the reviewers for their close read of this manuscript and their insightful comments. 

In response to reviewers' comments, we additionally performed 2 sets of experiments in the ablation study and 7 sets of experiments in the case study. Several important suggestions were made and we have considered each carefully and revised accordingly. Please find our replies to the reviewers below for detailed responses to the reviewers’ comments. We hope these updates address all key concerns and clarify the significance of our work. 

**Note**

* In the global response, we **upload a pdf file**, which includes our additional experiments for the case study and two examples of SEEG signals with detection results.

* We conducted 2 additional experiments in ablation study on the reconstrcution loss and the self-attention. The results are shown in Table 1.

  * PPi-reconstruction: Pre-training w/o reconstrcution loss.
  * PPi-self attention: Aggregate the representations from time and frequency domains by a simple mean pooling w/o self-attention layer.

  Table 1: The ablation study on the reconstrcution loss and the self-attention.

  |                    | MAYO             |                  |                  |                  | FNUSA            |                  |                  |                  | Clinical         |                  |                  |                  |
  | ------------------ | ---------------- | ---------------- | ---------------- | ---------------- | ---------------- | ---------------- | ---------------- | ---------------- | ---------------- | ---------------- | ---------------- | ---------------- |
  |                    | Pre.             | Rec.             | F1               | F2               | Pre.             | Rec.             | F1               | F2               | Pre.             | Rec.             | F1               | F2               |
  | PPi-reconstruction | 44.01+/-11.56    | 50.29+/-10.39    | 34.15+/-8.26     | 36.89+/-8.75     | 60.78+/-11.33    | 62.31+/-9.79     | 59.48+/-7.9      | 60.02+/-6.86     | 22.04+/-8.38     | 44.84+/-10.93    | 21.23+/-6.41     | 25.01+/-7.96     |
  | PPi-self attention | 48.82+/-5.10     | 60.2+/-3.07      | 51.15+/-4.64     | 55.41+/-4.43     | 65.14+/-6.01     | 66.91+/-2.95     | 62.17+/-3.93     | 63.98+/-3.42     | 28.67+/-5.61     | 46.98+/-5.46     | 29.56+/-3.59     | 32.59+/-2.68     |
  | PPi                | **49.85+/-6.93** | **69.67+/-2.82** | **54.35+/-4.72** | **61.07+/-4.69** | **71.73+/-4.06** | **70.81+/-2.14** | **70.61+/-2.82** | **70.55+/-2.28** | **29.76+/-5.45** | **47.59+/-5.16** | **30.92+/-3.45** | **35.51+/-2.35** |

  We will add these two sets of experimental results to the original ablation study in our manuscript.

Thanks again for the thoughtful commentary. We have put in considerable effort to improve our manuscript, and we sincerely hope you will find our responses informative and helpful.

Meta-review: The 6 reviewers here have expressed support on this work and did endorse it for publication. Given the thorough reviews and later discussions I support the publication of this work at NeurIPS 2023.
Decision: Accept (poster)