SEEG Epileptic Wave Detection Method, System and Storage Medium Based on Hierarchical Graph Diffusion Learning

The BrainNet model learned by hierarchical map diffusion combines graph structure and brain wave diffusion to solve the accuracy of epilepsy wave prediction in SEEG data, and improves the performance and robustness of the model under unbalanced data.

CN114938946BActive Publication Date: 2025-07-11ZHEJIANG UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210655910.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-10
Publication Date
2025-07-11
Estimated Expiration
2042-06-10

AI Technical Summary

Technical Problem

The existing epilepsy wave prediction methods are not effective on SEEG data, and it is difficult to effectively utilize the unique characteristics of SEEG data, resulting in insufficient prediction accuracy.

Method used

Using a method based on hierarchical map diffusion learning, the BrainNet model is designed to realize channel, region and patient-level epilepsy wave detection through graph structure learning and brain wave diffusion process, combined with timing pre-training technology.

Benefits of technology

Accurate epilepsy wave prediction of SEEG data is realized, the model's performance under unbalanced data is improved, and the robustness and prediction accuracy are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114938946B_ABST
    Figure CN114938946B_ABST
Patent Text Reader

Abstract

The present invention discloses a SEEG epileptic wave detection method, system and storage medium based on hierarchical graph diffusion learning, belonging to the technical fields of signal processing and pattern recognition. The method includes obtaining the original SEEG signal and extracting the representations of each time period, where the representations of each time period include the channel representations of each time period, the regional representations of each time period and the patient representations of each time period; based on graph structure learning and brain wave diffusion process, alternately performing cross-time diffusion and intra-time diffusion to obtain the representations after intra-time diffusion of each time period, where the representations after intra-time diffusion of each time period include the channel representations after intra-time diffusion of each time period, the regional representations after intra-time diffusion of each time period and the patient representations after intra-time diffusion of each time period; designing a loss function with the probabilities of epileptic seizures occurring in each time period at three levels, and when performing SEEG epileptic wave detection, obtaining the final detection result only according to the probabilities of epileptic seizures occurring in each time period at the channel level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of signal processing and pattern recognition, and in particular, to a SEEG epileptic wave detection method, system, and storage medium based on hierarchical graph diffusion learning. Background Art

[0002] Epilepsy is a phenomenon caused by abnormal discharge of nerve cells in the brain. The existing monitoring technologies mainly include scalp electroencephalogram (EEG) and stereo electroencephalogram (SEEG). The method proposed in the present invention aims to automatically predict epileptic waves in SEEG data. Compared with the newly invented SEEG, for the epileptic wave prediction task in EEG data, a large amount of work has been carried out to understand epilepsy and the characteristics of brain activities accompanying epilepsy, so as to predict epileptic waves and the lesion area. The earliest research can be traced back to 1982 when Gotman proposed a patient-nonspecific detector [Gotman 1982]. In [Tzallas 2012], researchers used sensitivity and false detection rate as criteria for measuring performance. [Fotiadis 2015] designed a precise patient-specific detector using an SVM classifier. [Fergus 2016] found that epilepsy contains various characteristic waveforms, such as spikes, sharp waves, sleep spindles, and cycles. Predicting epileptic waves using these traditional methods requires rigorous feature engineering and a large amount of domain knowledge, resulting in very time-consuming. Therefore, research has proposed end-to-end deep learning-based methods. Roy [Roy 2018] combined a one-dimensional convolutional layer with a gated recurrent unit (GRU) to predict epileptic waves. Lawhern [Lawhern 2018] proposed a model called EEGNet, which consists of two-dimensional convolutional layers and pooling layers, designed for EEG-based brain-computer interfaces, and can also be used for the epileptic wave prediction task in EEG data. Daoud [Daoud 2019] designed an unsupervised pre-trained deep convolutional autoencoder model. After pre-training, a Bi-LSTM network was used for downstream epileptic wave classification. Although these models are all deep learning-based algorithms, they are designed specifically for EEG data and are difficult to be directly applied to SEEG data or have poor effects.

[0003] SEEG data varies greatly among different patients, such as the number of electrodes and the implanted brain locations. Therefore, compared with EEG data with standard regulations, SEEG data faces greater challenges. In addition to models specifically designed for epilepsy prediction, general time series classification models can also be used for this task. A traditional approach is to extract effective features from the raw data and connect a well-trained classifier, such as ST [Lines 2012], TSF [Deng 2013], etc. However, the main challenge here is that there are no explicit features in the sequence. Therefore, many studies focus on the embedding of time series [Bagnall 2017]. Algorithms based on DTW and traditional embedding techniques [Hayashi 2005] aim to project the original time series into a feature vector space; while symbolic representation [Lapham 2015] uses symbols (such as characters in a given alphabet) to transform the time series. By adopting a different perspective, the model based on shapelet discovery [Baydogan 2016] attempts to identify typical subsequences according to certain criteria, such as information gain. Another approach focuses on deep learning techniques, such as RNN and its variants (LSTM, GRU, etc.). In addition, since the dimension of time series features may be large and there may be different levels of correlation between features, a hierarchical LSTM-based model has been proposed to learn these hierarchical relationships (e.g., HBRNN [Du 2015]). These general time series classification models are also the technologies to be compared in the present invention. However, due to their failure to consider many unique characteristics of epilepsy data, their performance in the epilepsy prediction task is less than satisfactory. Summary of the Invention

[0004] To solve the problem that the existing technology has poor prediction effect on epileptic waves, the present invention proposes a SEEG epileptic wave detection method, system and storage medium based on hierarchical graph diffusion learning. By utilizing the diffusion property of epileptic brain waves and combining time series pre-training technology and graph neural network technology, epilepsy prediction on SEEG data is realized.

[0005] The present invention adopts the following technical solutions:

[0006] In the first aspect, the present invention provides a SEEG epileptic wave detection method based on hierarchical graph diffusion learning, including:

[0007] Obtain the original SEEG signal and extract the representations of each time period, where the representations of each time period include the channel representations of each time period, the regional representations of each time period, and the patient representations of each time period;

[0008] Based on graph structure learning and brain wave diffusion process, cross-time diffusion and intra-time diffusion are alternately executed to obtain the representations after diffusion in each time period. The representations after diffusion in each time period include the channel representations after diffusion in each time period, the regional representations after diffusion in each time period, and the patient representations after diffusion in each time period.

[0009] A loss function is designed based on the probabilities of epileptic seizures occurring in each time period at three levels. When performing SEEG epileptic wave detection, the final detection result is obtained only according to the probabilities of epileptic seizures occurring in each time period at the channel level.

[0010] In a second aspect, the present invention provides a SEEG epileptic wave detection system based on hierarchical graph diffusion learning for implementing the above SEEG epileptic wave detection method.

[0011] In a third aspect, the present invention provides a computer-readable storage medium with a program stored thereon. When the program is executed by a processor, it is used to implement the above SEEG epileptic wave detection method based on hierarchical graph diffusion learning.

[0012] Compared with the prior art, the beneficial effects of the present invention are as follows: The present invention can realize a given series of SEEG multi-channel time series data segments with a continuous fixed duration. Through feature extraction and diffusion modeling of the input data, the probability of each segment and each channel being an epileptic wave is output, thereby realizing the accurate prediction of epileptic waves in SEEG data. Brief Description of the Drawings

[0013] Figure 1 is an overall schematic diagram of a SEEG epileptic wave detection method based on hierarchical graph diffusion learning shown according to an exemplary embodiment;

[0014] Figure 2 is a design schematic diagram of a pre-trained model BCPC shown according to an exemplary embodiment. The left side represents the pre-task, and the right side is the corresponding mask matrix;

[0015] Figure 3 is a specific process schematic diagram of the model BrainNet of the present invention at the channel level shown according to an exemplary embodiment. Detailed Embodiments

[0016] The present invention will be further described below in conjunction with the drawings and embodiments. The drawings are only schematic diagrams of the present invention. Some of the block diagrams shown in the drawings are functional entities, which do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor systems and / or microcontroller systems.

[0017] In this embodiment, the model used in the SEEG epilepsy wave detection method based on hierarchical graph diffusion learning is recorded as "BrainNet", which is a deep learning framework based on time series pre-training, graph structure learning, graph neural network and hierarchical learning. The overall framework of the present invention (BrainNet) consists of four main modules: a pre-training module BCPC designed for the input SEEG raw data, a graph diffusion module that changes over time, a prediction module and a hierarchical design module. In addition, those skilled in the art can also add other modules for achieving the purpose of the present invention, such as SEEG signal acquisition module, training module, display module, etc. Specifically, the present invention first extracts features from the original SEEG time series data through a pre-training module; then, the channel is regarded as a node, and the propagation of the EEG signal is modeled in combination with graph structure learning and graph diffusion modules; finally, the prediction module inputs the obtained representation and gives the prediction result of the epileptic wave. This embodiment first explains how the first three modules work together from the channel level, and then explains the specific method of hierarchical design.

[0018] 1. Pre-training module BCPC.

[0019] Use a predefined multi-layer convolutional neural network Embedding the original SEEG signal as local features In order to enable the model to extract bidirectional information, the present invention adopts Transformer with a specially designed mask matrix [Vaswani 2017] As an autoregressive model, to obtain the global context feature z.

[0020] Figure 2 The design schematic diagram of the pre-training model BCPC of the present invention is shown. For self-supervised learning algorithms, the key to learning discriminative representations is to construct effective pre-tasks. Following the classic self-supervised learning model of time series, comparative predictive coding (CPC) [Oord 2018], the present invention sets the pre-task as: using the global context features output by the autoregressive model based on the local features of the middle part of the fragment to predict the P local features of the head and tail of the fragment obtained from the encoder. Unlike CPC, the present invention believes that the bidirectional model will make the model's expressive power more effective by allowing the context features to simultaneously include semantic information in two directions in the time dimension, which is also illustrated in existing work such as BERT [Devlin 2019] and ELMo [Peters 2018]. Therefore, the pre-training model of the present invention is designed to predict the context in two directions in a skip-gram manner.

[0021] In a specific implementation of the present invention, Figure 2As shown, a sequence is divided into two equal semi - subsequences: the left side is used to encode reverse information, while the right side is used to encode forward information. The time coordinate at the center of the sequence is set to 0, and positive (negative) subscripts are assigned to the elements in the front (back) sequence. With this definition, the t - th row in the mask matrix represents the local features observable when constructing the global context features, that is:

[0022]

[0023]

[0024] where s t is the original SEEG signal at the t - th time period, z t is the local feature sequence of the original SEEG signal at the t - th time period, z t,τ is the local feature with index τ in the local features, c t,τ is the global feature of the original SEEG signal at the t - th time period aggregated within the range of (z t,τ ....z t,-τ ), τ ∈ [L,…, - L]; c t,L and c t,-L are concatenated and linearly mapped to be the representation r t at the t - th time period.

[0025] After that, based on the InfoNCE loss, let c t,τ predict the unobserved local feature p steps away from the global context feature, that is z t,τ+sgn(τ)·p . In this embodiment, the contrastive loss of BCPC within the t - th time period is defined as follows:

[0026]

[0027] where, represents a subset of random noise containing negative samples and a unique positive sample, n represents random noise, and sgn(·) is the sign function. In this embodiment, a bilinear classifier is used as the scoring function for each prediction step, Score p (.) represents the score at the p - th prediction step, and P represents the range of prediction steps away.

[0028] II. Graph Diffusion Module.

[0029] Through the above-mentioned pre-training module, the representation of each time period can be obtained, but the interaction between channels and the potential diffusion pattern are ignored. Therefore, the present invention further proposes a graph diffusion module to explicitly model the diffusion process of SEEG in the human brain. More specifically, the present invention adopts an approach that alternates between two steps of graph structure learning and brain wave diffusion to achieve this goal in an end-to-end, data-driven manner.

[0030] The following separately introduces the two parts:

[0031] (2.1) Graph structure learning.

[0032] Generally speaking, the challenge in modeling graph diffusion lies in the unknown potential correlations and diffusion paths between channels. Therefore, the present invention proposes to learn a graph structure where all channels are nodes, with one channel as one node. The key to solving this problem is how to quantify the influence of one channel on another. A traveling wave is a waveform that maintains some characteristics such as shape and frequency during propagation in different channels. Inspired by the phenomenon of the widespread existence of traveling waves in brain electrical activities, the present invention aims to propose a structure learning algorithm based on this.

[0033] Under the assumption that similar channels are more likely to carry the same traveling wave propagating over time, this embodiment uses the cosine function to measure the correlation between channel pairs. Considering the asymmetric time delay of traveling waves, it is necessary to distinguish the direction of the correlation. Therefore, this embodiment uses a pair of learnable weight parameters W1 and W2 for the source and target to identify important features before similarity calculation. Specifically, each channel corresponding to the original SEEG signal is used as a node, and a score matrix containing the scores between each node pair is obtained from the Cartesian product v1×v2 of the source node set v1 and the target node set v2 where the node features of the source node set and the target node set are h1 and h2 respectively, and the calculation process of the score matrix is as follows:

[0034]

[0035] where, i∈v1, j∈v2, ⊙ represents the Hadamard product, represents the score of the source node i and the target node j, as the element in the i-th row and j-th column of the score matrix h1(i) represents the feature of the source node i, and h2(j) represents the feature of the target node j. It should be noted that, is very likely to represent a dense graph. In order to maintain the sparsity of the graph structure recommended by the work in the field of neuroscience and remove the irrelevant and spurious connections caused by low-frequency fluctuations or physiological noise, this embodiment uses a threshold-based filtering function F θ (·) to filter out unnecessary edges, and the calculation is as follows:

[0036]

[0037] Among them, x represents the element in the score matrix to be filtered, that is in F θ (x) represents the filtered result; according to the above formula, finally, the filtered graph structure is obtained for participating in subsequent calculations.

[0038] (2.2) Brain wave diffusion.

[0039] The constructed graph structure represents the relative correlation between channels. The greater the edge weight, the more likely diffusion occurs. The objective of the present invention is to track the diffusion process along the constructed graph structure to enhance the representation of traveling waves. During epileptic seizures, faster and more significant propagation of spike and wave discharge patterns will occur, which means that the propagated representation is more distinguishable. Therefore, in view of the natural message-passing ability of graph neural networks on graphs, the present invention adopts this type of model to simulate the brain wave diffusion process.

[0040] In this embodiment, a single-layer directed GCN is taken as an example to describe this process. Specifically, given a graph The representation of the target node j∈v2 after diffusion is calculated as follows:

[0041]

[0042] where Θ is the learnable linear transformation matrix of the directed GCN, σ(·) represents the ReLU activation function, and h′2(j) represents the representation of the target node after diffusion.

[0043] (2.3) Component merging.

[0044] Since the duration of epileptic waves is either long or short, the BrainNet proposed by the present invention learns two types of diffusion processes. Specifically, cross-time diffusion naturally simulates the propagation of longer epileptic waves between two consecutive time periods. At the same time, fast signal diffusion within each channel during the same time period is captured through intra-time diffusion. Based on the structure learning and brain wave diffusion process, the graph structure learning and brain wave diffusion process are unified and formulated as a function Next, this symbol will be used to introduce the graph diffusion module involving two types of diffusion.

[0045] The graph diffusion module alternately executes two diffusion steps in the order of cross-time diffusion and intra-time diffusion. Given the representation obtained from the intra-time diffusion process in the (t - 1)-th time period The cross-time diffusion in the t-th time period is derived as follows:

[0046]

[0047] Among them, both the source node set and the target node set consist of all channels, that is, C t = C for all t = 1,..., |S|, where C represents the set containing all channels, and C t represents the set of channels in the t-th time period, S represents the set of time periods, and |S| represents the total number of segments. represents the cross-time-diffused channel representation in the t-th time period. represents the trainable matrix for cross-time diffusion, Θ cr represents the trainable parameter for cross-time diffusion, θ cr represents the threshold of the filtering function for cross-time diffusion. Here, only subscripts are used to emphasize the time index. Essentially, cross-time diffusion models the influence of the representation from the previous time period to the current time period (r t ).

[0048] After cross-time diffusion in the t-th time period, the intra-time diffusion process, with a slightly different formula, traces the correlation between representations within the same time period as follows:

[0049]

[0050] Among them, represents the trainable matrix for intra-time diffusion, Θ in represents the trainable parameter for intra-time diffusion, θ in represents the threshold of the filtering function for intra-time diffusion; the output representation obtained after intra-time diffusion will participate in the cross-time diffusion of the next time period and finally enter the prediction stage. It is worth mentioning that the first cross-time diffusion has no historical representation of the previous time period. To address this issue, in this embodiment, a virtual node set v0 and a virtual representation h0 are defined to construct an empty graph and perform diffusion on it.

[0051] As described above, the two diffusion modes are modeled separately, and the two steps are performed alternately. So far, the representation after being processed by the graph diffusion module has been obtained for further classification.

[0052] In a specific implementation of the present invention, when calculating the channel representation after intra-time diffusion in each time period, the original SEEG signal is divided into two equal semi-subsequences, with the time index at the central position marked as 0, and the channel representation after intra-time diffusion in the t-th time period is calculated according to the original SEEG signal corresponding to the forward time index Calculate the diffused reverse channel characterization within the t-th time period based on the original SEEG signal corresponding to the reverse time index Combine and after splicing as the final channel characterization.

[0053] III. Hierarchical design module.

[0054] Figure 3 Shows the specific process of the BrainNet algorithm of the present invention at the channel level. From left to right, the first part represents the process of obtaining the representation r of the time period using the pre-trained BCPC t . The second part describes the cross-time diffusion process from the (t - 1)-th time period to the t-th time period, where the cross-time diffusion graph structure is first generated by the cross-time graph structure learning sub-module, and then the GNN is used on the generated graph. The third part corresponds to the intra-time diffusion process, which is based on a mechanism similar to the cross-time process. The output of this part will be used for the cross-time diffusion process of the next time step. The fourth part combines the representation generated by the alternating diffusion as the input with the original representation r t to predict whether a seizure occurs in the t-th time period.

[0055] Given the representation obtained from the graph diffusion module, the present invention will and r t connect them together, and then pass them through the discriminator D implemented by a two-layer MLP as a prediction module to obtain the prediction probability Figure 3 For convenience, only the process of splicing and r t is shown. In this embodiment, binary cross-entropy is used to define the seizure wave detection task at the channel level, and the objective function is:

[0056]

[0057] where c represents the c-th channel, represents the label of the t-th time period of the c-th channel, represents the prediction probability of the t-th time period of the c-th channel, represents the cross-entropy loss at the channel level, and |S| represents the total number of segments.

[0058] However, the diffusion process at the channel level has a limited view and lacks a more macroscopic perception. Figure 1 Shows the problem studied by the present invention: seizure wave prediction. Figure 1 (a) Shows an electrode with three channels (A1, A2, and A3) implanted into a patient's brain to collect the electrical signals of the patient across two brain regions. Seizure waves are in Figure 1(a) The following example is marked by a rectangle in the SEEG data. Figure 1 (b) The solution of the present invention is shown, that is, jointly learning the diffusion process of epileptic seizures and detecting epileptic waves at three levels. In a real-world scenario, doctors usually make a diagnosis for epileptic patients step by step: whether the patient has epilepsy, which brain regions are suspected epileptic regions, and where the specific location in the brain that directly causes epileptic seizures is. Inspired by this process, the present invention proposes a new framework called BrainNet, which adopts a hierarchical structure to jointly model epileptic waves and their diffusion processes at three different levels, from high to low in order: patient, brain region, and channel levels (each channel corresponds to a specific location in the brain), which helps to capture epileptic waves more precisely, especially improving the robustness of the model to handle severe noise in SEEG data. In summary, as Figure 1 shown, the present invention will simultaneously consider comprehensive information at the channel, brain region, and patient levels to enable more accurate detection.

[0059] The hierarchical task design combining these three levels will be described in more detail below in the present invention.

[0060] (3.1) Hierarchical label construction.

[0061] The labels are initially at the channel level. According to the reverse logical order of the doctor's diagnosis, if at least one of the channels it contains is epileptic, a brain region is labeled as epileptic. Similarly, if at least one brain region is abnormal, the patient is considered to be in an epileptic seizure state. More specifically, given the label of the t-th time period containing all channels, the channels are first divided into different brain regions through the mapping b(·). Then for each brain region b∈B, the time period label is assigned as follows:

[0062]

[0063] where, represents the label of the b-th brain region in the t-th time period, represents the label of the c-th channel in the t-th time period, b(.) represents the mapping function, and c:b(c) = b represents mapping the channel c to the brain region b;

[0064] In a similar way, the time period label at the patient level is constructed based on the labels of the brain regions:

[0065]

[0066] where, represents the label of the patient in the t-th time period, and B represents the set of brain regions.

[0067] (3.2) High-level representation learning.

[0068] By aggregating representations from lower levels to obtain higher-level representations, in this embodiment, a max pooling operation is used to aggregate the representations because what is ultimately needed are those features that contribute the most to the lower-level seizure states. Therefore, this aggregation method is more in line with the construction process of hierarchical labels.

[0069] Taking the representation of brain regions as an example, this embodiment uses the element-wise max pooling method as follows:

[0070]

[0071] where \(b\in B\), \(d\) represents the dimension of the representation, represents the \(i\)-th dimension representation of the \(b\)-th brain region in the \(t\)-th time period, \(r\) t,c represents the \(c\)-th channel representation in the \(t\)-th time period, \(b(.)\) represents the mapping function, and \(c:b(c)=b\) means mapping channel \(c\) to brain region \(b\).

[0072] Similarly, the patient representation formula for each time period is:

[0073]

[0074] where, represents the \(i\)-th dimension representation of the patient in the \(t\)-th time period.

[0075] After the pooling operation, on the high-level representation, a graph diffusion module is used to obtain their respective objective functions, that is, and Each objective function is defined as a binary cross-entropy similar to the channel-level objective function. Considering that completely independent parameters cannot guarantee a consistent optimization direction, the present invention allows the three levels to share the same parameter set in the graph diffusion module and the prediction module to align their representation spaces.

[0076] Finally, by combining the tasks at different levels, the following overall objective function to be jointly optimized is obtained:

[0077]

[0078] where, represents the cross-entropy loss at the channel level, represents the cross-entropy loss at the region level, represents the cross-entropy loss at the patient level, represents the total loss.

[0079] Guided by the labeled data, the proposed model BrainNet is optimized through backpropagation and learns the representation embedding space for the epileptic wave detection task. Through the hierarchical task framework, BrainNet is expected to aggregate more accurate information at a higher level and in turn feedback it to the lower level, thereby resisting data noise and improving the model performance.

[0080] When using the trained model BrainNet for SEEG epileptic wave detection, the final detection result is obtained only based on the probability of epileptic seizures occurring in each time period at the channel level.

[0081] In a specific implementation of the present invention, the SEEG epileptic wave detection method based on hierarchical graph diffusion learning includes:

[0082] Step 1: Obtain the original SEEG signal and extract the representations of each time period. The representations of each time period include the channel representations of each time period, the regional representations of each time period, and the patient representations of each time period.

[0083] Step 2: Based on graph structure learning and the brain wave diffusion process, alternately perform cross-time diffusion and intra-time diffusion to obtain the representations after intra-time diffusion in each time period. The representations after intra-time diffusion in each time period include the channel representations after intra-time diffusion in each time period, the regional representations after intra-time diffusion in each time period, and the patient representations after intra-time diffusion in each time period.

[0084] Step 3: Design a loss function based on the probabilities of epileptic seizures occurring in each time period at three levels. When performing SEEG epileptic wave detection, the final detection result is obtained only based on the probability of epileptic seizures occurring in each time period at the channel level.

[0085] Step 1 can be implemented by using the above-mentioned pre-training module BCPC to obtain the representations of each time period. The specific steps are as follows:

[0086] Step 1.1: Extract the local feature sequence z of the original SEEG signal t ;

[0087] Step 1.2: Mark the index of the central position of the local feature sequence as 0, divide the local feature sequence into two equal semi-subsequences, and mark the bidirectional index to obtain z t =(z t,τ ,…,z t,0 ,…,z t,-τ ), where z t,τ represents the local feature with index τ in the local feature sequence;

[0088] Step 1.3: Aggregate the local feature sequence to obtain the global feature c t,τ ;

[0089] Step 1.4, set τ ∈ [L, …, -L], where L is the aggregation range, and splice the two results c t,L and c t,-L after linear mapping as the channel representation r t for the t-th time period;

[0090] Step 1.5, according to the brain location corresponding to the channel, divide all channels into different regions, and use the max-pooling operation to aggregate all channel representations corresponding to the time period in each region to obtain the region representation for each time period b ∈ B, where b represents the b-th brain region and B represents the set of brain regions; use the max-pooling operation to aggregate all region representations corresponding to the time period to obtain the patient representation for each time period

[0091] Step 2 To obtain the diffused representation within each time period, the above graph diffusion module and hierarchical design module can be used to implement, and the specific steps are as follows:

[0092] Step 2.1, calculate the cross-time diffused channel representation for the t-th time period according to the cross-time graph diffusion module:

[0093]

[0094] where, represents the calculation of the cross-time graph diffusion module, represents the trainable matrix of cross-time diffusion, Θ cr represents the trainable parameter of cross-time diffusion, C t represents the set of channels for the t-th time period, C t-1 represents the set of channels for the (t - 1)-th time period, represents the diffused channel representation within the (t - 1)-th time period, r t represents that the original SEEG signal is the representation for the t-th time period, represents the cross-time diffused channel representation for the t-th time period, θ cr represents the threshold of the filtering function of cross-time diffusion;

[0095] Step 2.2, calculate the diffused channel representation within the t-th time period according to the intra-time graph diffusion module:

[0096]

[0097] where, represents the calculation of the intra-time graph diffusion module, represents the trainable matrix of intra-time diffusion, Θ in represents the trainable parameter of intra-time diffusion, θ inThe threshold of the filtering function for diffusion within a time period represents the channel representation after diffusion in the t-th time period;

[0098] Step 2.3: Based on the graph structure learning and the brain wave diffusion process, alternately execute the cross-time diffusion in Step 2.1 and the diffusion within a time period in Step 2.2 to obtain the channel representations after diffusion in each time period.

[0099] In this embodiment, when calculating the channel representations after diffusion in each time period, the original SEEG signal is divided into two equal semi-subsequences, with the time index at the central position marked as 0. Calculate the channel representation after diffusion in the t-th time period according to the original SEEG signal corresponding to the forward time index. Calculate the reverse channel representation after diffusion in the t-th time period according to the original SEEG signal corresponding to the reverse time index. Concatenate and as the final channel representation.

[0100] Similarly, let C t-1 = B, C t = B, and calculate the region representations after diffusion in each time period; let C t-1 = {1}, C t = {1}, and calculate the patient representations after diffusion in each time period.

[0101] In this embodiment, the calculation steps of the cross-time graph diffusion module and the diffusion within a time period graph diffusion module include two parts: graph structure learning and brain wave diffusion. Denote the calculations of the two parts of graph structure learning and brain wave diffusion as During the calculation process of the cross-time graph diffusion module, During the calculation process of the diffusion within a time period graph diffusion module,

[0102] When calculating the representations after diffusion in each time period at different levels, the cross-time graph diffusion module and the diffusion within a time period graph diffusion module share model parameters, that is, when calculating the representations after cross-time diffusion in each time period at different levels, the parameters of the cross-time graph diffusion module are the same, and when calculating the representations after diffusion within a time period in each time period at different levels, the parameters of the diffusion within a time period graph diffusion module are the same.

[0103] The implementation process of Step 3 needs to use a hierarchical design module to design a loss function based on the probabilities of epileptic seizures occurring in each time period at three levels, including the channel-level loss, the region-level loss, and the patient-level loss; the labels in the region-level loss and the patient-level loss are obtained according to the labels of the channel-level loss.

[0104] In this embodiment, a SEEG epileptic wave detection system based on hierarchical graph diffusion learning is also provided. This system is used to implement the above-mentioned embodiment, and the parts that have been described will not be elaborated again. The following terms such as "module" and "unit" can be a combination of software and / or hardware that can achieve a predetermined function. Although the system described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible.

[0105] The system includes:

[0106] A SEEG signal acquisition module, which is used to acquire the original SEEG signal;

[0107] A pre-training module, which is used to extract the representations of each time period from the original SEEG signal;

[0108] A graph diffusion module, which alternately performs cross-time diffusion and intra-time diffusion based on graph structure learning and the brain wave diffusion process to obtain the representations after intra-time diffusion in each time period;

[0109] A hierarchical design module, which is used to call the pre-training module and the graph diffusion module to respectively implement the representations of each time period and the representations after intra-time diffusion in each time period at the three levels of channel, region, and patient;

[0110] A training module, which is used to train the graph diffusion module, and design a loss function based on the probabilities of epileptic seizures occurring in each time period at the three levels of channel, region, and patient during the training process;

[0111] A detection module, which is used for the SEEG epileptic wave detection process after training, and outputs the final detection result according to the probabilities of epileptic seizures occurring in each time period at the channel level.

[0112] For the implementation processes of the functions and roles of each module in the above system, please refer to the implementation processes of the corresponding steps in the above method for details, which will not be elaborated here. For the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The system embodiment described above is only illustrative. The modules described as separate components may or may not be physically separated, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the present invention. Those of ordinary skill in the art can understand and implement it without creative efforts. The embodiment of the present invention also provides a computer-readable storage medium, on which a program is stored. When the program is executed by a processor, the above-mentioned SEEG epileptic wave detection method based on hierarchical graph diffusion learning is implemented.

[0113] The computer-readable storage medium may be an internal storage unit of any device with data processing capabilities described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium may also be an external storage device of any device with data processing capabilities, such as a plug-in hard disk, a Smart Media Card (SMC), an SD card, a Flash Card, etc. equipped on the device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of any device with data processing capabilities. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and may also be used to temporarily store data that has been output or is to be output.

[0114] The technical effects of the present invention are verified by experiments below.

[0115] (1) Data collection. The SEEG dataset used in the experiments of this embodiment was provided by a top-three hospital. For patients with epilepsy, 4 to 10 invasive electrodes with 52 to 126 channels were used to record SEEG signals at 256 Hz to 1024 Hz; these numbers vary from patient to patient. It is worth noting that since the SEEG signals are collected through multiple channels at a high frequency, the dataset is very large. A total of 526 hours of SEEG signals with a size of 769 GB were collected during the experiment process. Although each prediction is for a specific patient, in order to verify the universality and stability of the model of the present invention, all experiments were repeated for multiple patients. According to the obtained dataset, epileptic waves were labeled by experts. In this experiment, all time points in the epileptic waves were regarded as positive samples, and the remaining time points were regarded as negative samples. The average positive sample rate of a single patient in the dataset is about 0.003, which is very unbalanced.

[0116] (2) Data preprocessing. For pre-training tasks, for each patient, 10,000 normal segments with a window length of 1 second were randomly selected. Then 90% of the sampled segments were used for training, and the rest were used for verification. As for the epileptic wave prediction task, for each patient, 13,300 segments were first obtained to train the model (85% for training and 15% for verification). For the test phase, in order to explore the performance of different models under datasets with different positive sample ratios, three test sets were sampled in this experiment. Each test set included 1,140, 9,690, and 95,190 segments of each patient, and the positive-negative sample ratios were 1:5, 1:50, and 1:500 respectively.

[0117] (3) Description of the baseline algorithm

[0118] Channel-level epileptic wave detection. In this experiment, BrainNet was compared with several univariate time series classification models. For each baseline model, an independent model was trained for each channel, and the average result of a patient across all channels was obtained. The comparison models are as follows:

[0119] TSF[Deng 2013]: This is a tree ensemble method for time series classification. The features used in TSF are basic time series features, including the mean, standard variance, and slope of segments.

[0120] STSF[Cabello 2020]: This is an interval-based tree model that uses a top-down approach to search for relevant subsequences in three different time series representations before training any tree classifier.

[0121] MiniRocket[Dempster 2021]: This method reformulates Rocket[Dempster 2020] into a fast version, maintaining substantially the same accuracy.

[0122] WEASEL 2017]: This method uses a sliding window approach to convert time series into feature vectors. Then the vectors are analyzed by a classifier.

[0123] LSTM-FCN[Karim 2018]: This is used for univariate time series classification consisting of an LSTM layer and a CNN layer.

[0124] TS-TCC[Eldele 2021]: This is a contrastive method that learns time series representations through two different views generated by weak augmentation and strong augmentation of the original segments.

[0125] Patient-level epileptic wave detection. The following multivariate time series classification models were used as baseline models in this experiment:

[0126] EEGNet[Lawhern 2018]: This is a model proposed in the field of neuroscience. Specifically, it is a compact convolutional neural network for EEG-based brain-computer interfaces.

[0127] TapNet[Zhang 2020]: An attention prototype network that leverages the advantages of traditional and deep learning-based methods to perform multivariate time series classification.

[0128] MLSTM-FCN[Karim 2019]: This is a deep learning framework consisting of an LSTM layer, stacked CNN layers, and Squeeze-and-Excitation blocks for multivariate time series classification.

[0129] NS[Franceschi 2019]: This method uses an unsupervised approach that employs time-based negative sampling to learn embeddings. Then, an SVM is applied to perform the final classification.

[0130] The test results are shown in Table 1.

[0131] Table 1 Average performance of the epileptic wave detection task at the channel and patient levels

[0132]

[0133] As shown in the channel-level epileptic wave detection results in Table 1, in the channel-level task, the F2 metric of BrainNet on the test datasets with positive-to-negative sample ratios of 1:5, 1:50, and 1:500 increased by 12.31%, 36.66%, and 142.03% respectively. In particular, as the labels became increasingly imbalanced, the performance of the baseline model decreased rapidly, while BrainNet still maintained better performance than the baseline model. The increasing performance improvement ratio means that the model of the present invention can better handle imbalanced data, which is more in line with the actual clinical scenario. Compared with the univariate baseline model, BrainNet takes advantage of learning how epileptic waves spread across channels. For example, the correlation between two channels A1 and A2 is low in the normal state, that is, the normal brain waves spread very weakly between them. However, during epileptic seizures, their correlation increases significantly, which is reflected in the larger edge weights in the diffusion graph learned by the model of the present invention. When BrainNet determines that A1 contains epileptic seizures, it can further infer the epileptic state of A2 through the diffusion process and the learned graph structure. This makes the prediction result of A2 more reliable compared to only considering A2.

[0134] As shown in the patient-level epileptic wave detection results in Table 1, at the patient level, the F2 performance of BrainNet also increased by an average of 50.95% on the three test datasets. The results show the superiority of the hierarchical task design of the present invention, which can make more accurate predictions by utilizing finer information at the lower level. More specifically, BrainNet can provide some evidence of specific local (channel and brain region levels) information for the global system (patient), which is beneficial to the patient-level detection task. For example, when inferring whether a patient has epilepsy, knowing which specific brain region has epileptic waves will increase the confidence of the model.

[0135] (4) Ablation experiment

[0136] Further ablation experiments were conducted to verify the effectiveness of each main module in the model. In this experiment, each of the following parts was removed from the model: the pre-training module (BrainNet-BCPC), the intra-time diffusion (BrainNet-Inner), the cross-time diffusion (BrainNet-Cross), the hierarchical task framework (BrainNet-Multi), and the graph diffusion module (BrainNet-Graph). The influence degree on the overall effect was tested respectively, and the test results are shown in Table 2.

[0137] Table 2 Results of Ablation Experiments

[0138]

[0139] The evaluation results of the ablation experiments on the test dataset with a positive-negative sample ratio of 1:500 are reported in Table 2. It can be observed that BrainNet achieved the best performance in all metrics compared to all ablation model versions, which proves the effectiveness of each module in the model of the present invention. For BrainNet-BCPC, the significant performance drop indicates the strong representation ability of BCPC. Comparing with BrainNet-Graph that obtains representations from BCPC and directly inputs them into the MLP, it shows that the graph diffusion module of the present invention achieved excellent performance improvement (more than 390% improvement in terms of F2), which also indicates the importance of modeling the diffusion process.

[0140] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of patent protection. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A SEEG epileptic wave detection method based on hierarchical graph diffusion learning, characterized in that, Comprising: Obtain the original SEEG signal and extract the characteristics of each time period. The characteristics of each time period include the channel characteristics, region characteristics, and patient characteristics of each time period. Based on graph structure learning and brain wave diffusion process, alternately perform cross-time diffusion and intra-time diffusion to obtain the characteristics after intra-time diffusion in each time period. The characteristics after intra-time diffusion in each time period include the channel characteristics, region characteristics, and patient characteristics after intra-time diffusion in each time period. Specifically: Calculate the channel characteristics after cross-time diffusion in the t-th time period according to the cross-time graph diffusion module. Among them, represents the calculation of the cross - time graph diffusion module, represents the trainable matrix of cross - time diffusion, Θ cr represents the trainable parameter of cross - time diffusion, C t represents the channel set at the t - th time period, C t-1 represents the channel set at the (t - 1)-th time period, represents the channel representation after diffusion within the (t - 1)-th time period, r t represents that the original SEEG signal is the channel representation at the t - th time period, represents the channel representation after cross - time diffusion at the t - th time period, θ cr represents the threshold of the filtering function for cross - time diffusion; Calculate the channel characteristics after intra-time diffusion in the t-th time period according to the intra-time graph diffusion module. Among them, represents the calculation of the graph diffusion module within the time,[[]] represents the trainable matrix of diffusion within the time, Θ in represents the trainable parameter of diffusion within the time, θ in represents the threshold of the filtering function of diffusion within the time,[[]] represents the channel representation after diffusion in the t-th time period; Similarly, let C t-1 = B, C t = B, and calculate the regional representation after diffusion in each time period; let C t-1 = {1}, C t = {1}, and calculate the patient representation after diffusion in each time period; design a loss function based on the probabilities of epileptic seizures in each time period at three levels. When performing SEEG epileptic wave detection, obtain the final detection result only according to the probabilities of epileptic seizures in each time period at the channel level.

2. The SEEG epileptic wave detection method based on hierarchical graph diffusion learning according to claim 1, wherein, The extraction process of the channel characteristics in each time period includes: Extract the local feature sequence z of the original SEEG signal t ; Mark the index of the central position of the local feature sequence as 0, divide the local feature sequence into two equal semi - subsequences, mark the bidirectional index, and obtain z t =(z t,τ ,…,z t,0 ,…,z t,-τ ), where z t,τ represents the local feature with index τ in the local feature sequence; Aggregate the local feature sequences to obtain the global features. Among them, c t,τ is the aggregation of the original SEEG signals in the t-th time period, which aggregates the global features within the range of (z t,τ …z t,-τ ), where τ ∈ [L, …, -L] and L is the aggregation range; Two results c in the aggregated range boundaries t,L and c t,-L are concatenated and linearly mapped to be used as the channel representation r for the t-th time period t .

3. A SEEG epileptic wave detection method based on hierarchical graph diffusion learning according to claim 2, characterized in that, According to the brain locations corresponding to the channels, all channels are divided into different regions, and the maximum pooling operation is used to aggregate all channel representations in the corresponding time periods in each region to obtain the region representations for each time period. b ∈ B, where b represents the b-th brain region and B represents the set of brain regions; Aggregate all regional representations corresponding to the corresponding time period by using the max pooling operation to obtain the patient representations for each time period 4. A SEEG epileptic wave detection method based on hierarchical graph diffusion learning according to claim 1, characterized in that, The calculation steps of the cross - time graph diffusion module and the intra - time graph diffusion module include two parts: graph structure learning and brain wave diffusion. Denote the calculations of these two parts of graph structure learning and brain wave diffusion as During the calculation process of the cross - time graph diffusion module, During the calculation process of the intra - time graph diffusion module, The graph structure learning includes: Regarding each channel corresponding to the original SEEG signal as a node, construct a source node set v1 and a target node set v2, and obtain a score matrix containing scores between each pair of nodes from the Cartesian product v1×v2 of the source node set v1 and the target node set v2 where \(i\in v1\), \(j\in v2\), and \(\odot\) represents the Hadamard product; represents the score of the source node \(i\) and the target node \(j\), which is the element in the \(i\)-th row and \(j\)-th column of the score matrix \(h1(i)\) represents the feature of the source node \(i\), and \(h2(j)\) represents the feature of the target node \(j\); Use a threshold-based filtering function \(F(·)\) that includes adjustable hyperparameters \(\theta\) to filter out unnecessary edges. If θ (·), then retain Otherwise, set it to zero, and finally obtain the filtered graph structure ​ The brain wave diffusion includes: where Θ is a learnable linear transformation matrix, σ(·) represents the ReLU activation function, and h ′ 2(j) represents the representation of the target node after diffusion.

5. A SEEG epileptic wave detection method based on hierarchical graph diffusion learning according to claim 4, characterized in that, When calculating the characteristics after intra-time diffusion in each time period at different levels, the cross-time graph diffusion module and the intra-time graph diffusion module share model parameters.

6. The SEEG epileptic wave detection method based on hierarchical graph diffusion learning according to claim 1, wherein When calculating the channel representation after diffusion in each time period, the original SEEG signal is divided into two equal semi-subsequences, with the time index at the central position marked as 0. The channel representation after diffusion in the t-th time period is calculated based on the original SEEG signal corresponding to the forward time index. The reverse channel representation after diffusion in the t-th time period is calculated based on the original SEEG signal corresponding to the reverse time index. The and are concatenated as the final channel representation.

7. A SEEG epileptic wave detection method based on hierarchical graph diffusion learning according to claim 1, characterized in that Design the loss function based on the probabilities of epileptic seizures in each time period at three levels, including the channel-level loss, region-level loss, and patient-level loss. The labels in the region-level loss and patient-level loss are obtained according to the labels of the channel-level loss. The formula is: Among them, represents the label of the b-th brain region in the t-th time period, represents the label of the t-th time period of the c-th channel, and b(.) represents a mapping function, where c: b(c) = b means mapping channel c to brain region b; Construct the time period labels at the patient level based on the labels of the brain regions. where, represents the label of the patient in the t-th time period, and B represents the set of brain regions.

8. An SEEG epileptic wave detection system based on hierarchical graph diffusion learning for implementing the SEEG epileptic wave detection method described in claim 1, characterized in that, The system includes: A SEEG signal acquisition module for acquiring the original SEEG signal. A pre-training module for extracting the characteristics of each time period from the original SEEG signal. A graph diffusion module that alternately performs cross-time diffusion and intra-time diffusion based on the graph structure learning and brain wave diffusion process to obtain the characteristics after intra-time diffusion in each time period. A hierarchical design module for calling the pre-training module and the graph diffusion module to respectively implement the characteristics of each time period and the characteristics after intra-time diffusion in each time period at three levels: channel, region, and patient. A training module for training the graph diffusion module and designing the loss function based on the probabilities of epileptic seizures in each time period at three levels: channel, region, and patient during the training process. A detection module for the SEEG epileptic wave detection process after training, and outputting the final detection result according to the probability of epileptic seizures in each time period at the channel level.

9. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it is used to implement the SEEG epileptic wave detection method based on hierarchical graph diffusion learning described in any one of claims 1-7.

Citation Information

Patent Citations

  • Method and system for positioning epilepsy electroencephalogram signal characteristics

    CN105615877A

  • Epilepsy detection and alarm system and working method thereof

    CN110051349A