Weakly supervised inter-seizure epilepsy sample discharge detection method based on space prior
By constructing an EEG signal database containing coarse-grained time-level labels and fine-grained channel-level labels, and combining channel feature encoding and fusion modules, the problems of high channel-level labeling cost and lack of information in time-level labels in existing technologies are solved, and efficient and accurate detection of epileptiform discharges is achieved.
Patent Information
- Application Number
- CN202610096980.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-23
- Publication Date
- 2026-02-27
AI Technical Summary
In existing technologies, channel-level labeling is costly, and time-level labels lack channel information, making it difficult to accurately locate epileptic foci. Existing deep learning methods suffer from low efficiency and insufficient accuracy in detecting epileptiform discharges.
A weakly supervised interictal epileptiform discharge detection method based on spatial priors is adopted. By constructing an EEG signal database containing coarse-grained time-level labels and fine-grained channel-level labels, and utilizing an intra-channel feature encoding module, an inter-channel feature fusion module, and a prototype-based decision module, automatic detection of IEDs is achieved.
It enables the automatic detection of channel-level locations of epileptiform discharges under time-level labels that are more readily available in clinical settings, improving detection accuracy and efficiency while reducing the need for high-quality, fine-grained channel-level labeling.
Smart Images

Figure CN121570190A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electroencephalogram (EEG) signal processing technology, specifically relating to a method for detecting weakly supervised interictal epileptiform discharges based on spatial prior. Background Technology
[0002] According to the latest data from the World Health Organization, epilepsy is the fourth most common neurological disorder worldwide, causing a range of serious health risks including brain dysfunction, cardiopulmonary failure, traumatic brain injury, and even sudden death. In clinical practice, the diagnosis and management of epilepsy primarily rely on visual examination of scalp electroencephalography (EEG) recordings. Interictal epileptiform discharges (IEDs) are a key biomarker frequently observed in epilepsy patients. However, manually annotating IEDs in EEG recordings is both time-consuming and inefficient, especially in long-term monitoring. This process not only requires experienced neurophysiologists but also suffers from significant inter-interpretation variability, potentially increasing the risk of misdiagnosis.
[0003] Therefore, developing methods capable of automatically analyzing EEG records and accurately detecting IEDs is of great significance for supporting and improving clinical diagnostic processes. In recent years, inspired by the significant achievements of deep learning in medical imaging and physiological signal analysis, an increasing number of deep learning-based algorithms have been proposed for the automated detection of IEDs. These methods mainly cover two task types: time-level classification and channel-level classification. However, existing methods still face certain challenges: while channel-level classification can provide detailed spatial location information, it relies on a large amount of fine-grained channel-level annotation, resulting in high implementation costs; in contrast, while time-level labels are easier to obtain and the annotation process is relatively simple, they do not contain channel-level information, making it difficult to accurately locate interictal epileptiform discharges, which is precisely the key to identifying epileptic foci. Summary of the Invention
[0004] This invention provides a weakly supervised method for detecting interictal epileptiform discharges based on spatial priors, addressing the problems of high channel-level annotation costs and the lack of channel information in time-level labels, which makes it difficult to accurately locate epileptic foci, as mentioned in the existing methods. The specific technical solution is as follows:
[0005] A method for detecting interictal epileptiform discharges based on spatial priors, comprising the following steps:
[0006] Acquire multi-channel EEG signal data and divide it into multiple data segments with the same duration, each data segment containing EEG signals from multiple channels;
[0007] Coarse-grained annotation is performed on the data segments to indicate whether each segment contains an IED event. The data segments are divided into training set, validation set and test set. Fine-grained annotation is performed on the data segments in the test set to mark the exact channel location where IED exists. A brain signal database containing both coarse-grained time-level labels and fine-grained channel-level labels is constructed.
[0008] Preprocessing of EEG signals;
[0009] Construct and train a weakly supervised interictal epileptiform discharge detection network model, which includes:
[0010] The intra-channel feature encoding module is used to extract deep features independently from each channel of a given multi-channel EEG signal input to generate intra-channel features.
[0011] The inter-channel feature fusion module includes a graph-based spatial fusion branch and a projection branch, which are used to fuse inter-channel spatial dependencies and preserve channel-specific features, respectively. Intra-channel features are input into the two branches to generate channel-independent features and channel-fused features, respectively.
[0012] The prototype-based decision module is used to calculate the similarity between channel-independent features and channel-fused features and multiple learnable prototypes, and outputs channel-level IED prediction probability and time-level IED prediction probability.
[0013] The EEG signal is input into the trained model, and the model outputs the prediction results of whether IED exists in each channel.
[0014] Furthermore, the data segment is 1 second long, each segment contains 20 channels of EEG signals, and the sampling rate is 256 Hz.
[0015] Furthermore, the preprocessing includes removing electrooculography and electromyography artifacts using a 0.5-70 Hz bandpass filter.
[0016] Furthermore, the data segments are divided into training, validation, and test sets in an 8:1:1 ratio.
[0017] Furthermore, the in-channel feature encoding module extracts the time-frequency features of each channel through one-dimensional convolution and deep feature neural networks, and generates in-channel features through global average pooling dimensionality reduction.
[0018] Furthermore, the graph-based spatial fusion branch constructs an adjacency matrix to represent the spatial relationships between channels and uses graph convolution operations to fuse the feature information of spatially adjacent channels to obtain channel fusion features.
[0019] Furthermore, the adjacency matrix is constructed based on the three-dimensional physical coordinates of the EEG electrodes, and the spatial correlation between channels is calculated using normalized Euclidean distance.
[0020] Furthermore, the projection branch consists of a linear layer and a Sigmoid activation function, which maps the intra-channel features to a semantic space consistent with the channel fusion features through linear transformation, thereby obtaining channel-independent features.
[0021] Furthermore, the prototype-based decision module generates channel-level IED prediction probabilities by calculating the similarity between channel features and multiple learnable prototypes, and further obtains time-period-level IED prediction results by aggregating the maximum values.
[0022] Furthermore, the network model is trained using a composite loss function, which is:
[0023]
[0024]
[0025]
[0026]
[0027]
[0028]
[0029] in, yes The weights corresponding to each function, The number of input signals. It is the one-hot encoding of the nth signal at the time interval of the kth class. These are prototype features learned through network learning. It is a small constant introduced to ensure numerical stability. For the number of prototypes, It refers to the number of channels for inputting EEG signals. It is a pseudo-tag for the c-th channel of the b-th input signal. This represents the time periods with the pseudo-label "IED" among all time periods where IEDs exist. The set of channels.
[0030] The spatial prior-based weakly supervised interictal epileptiform discharge detection method provided by this invention uses time-level IED labels, which are relatively easier to obtain clinically, as coarse-grained labels to train the network, thereby achieving automatic channel-level IED detection and alleviating the problem of lack of high-quality, fine-grained channel-level annotations in clinical practice. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a schematic diagram of the weakly supervised interictal epileptiform discharge detection network model of this application. Detailed Implementation
[0033] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0034] This application discloses a method for detecting weakly supervised interictal epileptiform discharges based on spatial priors, comprising the following steps:
[0035] S1: Acquire multi-channel EEG signal data and divide it into multiple data segments with the same duration. Each data segment contains EEG signals from multiple channels.
[0036] Specifically, EEG signal data with a sampling rate of 256 Hz were collected, and signals from 20 channels were obtained using a bipolar montage configuration. These signals were then divided into a series of data segments with a duration of 1 second.
[0037] S2: Perform coarse-grained annotation on the data segments to indicate whether each segment contains an IED event. Divide the data segments into training, validation, and test sets. Perform fine-grained annotation on the data segments in the test set to mark the exact channel location where an IED exists. This completes the construction of an EEG signal database that simultaneously contains coarse-grained time-level labels and fine-grained channel-level labels.
[0038] The data was divided into training, validation, and test sets, with a proportion of 80%, 10%, and 10%, respectively, and there was no overlap between the three sets. Next, clinical experts performed coarse-grained annotation on these 1-second data segments, determining whether at least one channel in each segment contained an IED. Furthermore, the clinical experts performed fine-grained annotation on the data segments in the test set, specifically marking the exact channel locations where IEDs were present. Finally, a standardized EEG signal database was constructed, containing both coarse-grained time-level labels and fine-grained channel-level labels. The number of sampling points for each signal sample in this dataset is 256.
[0039] S3: Preprocessing of EEG signals.
[0040] The obtained EEG signals were denoised using a 0.5~70Hz bandpass filter to remove artifacts such as electrooculography (EOG) and electromyography (EMG).
[0041] S4: Construct and train a weakly supervised interictal epileptiform discharge detection network model.
[0042] like Figure 1 As shown, the model includes an intra-channel feature encoding module, an inter-channel feature fusion module, and a prototype-based decision module.
[0043] The intra-channel feature encoding module is used to independently extract deep features from each channel of a given multi-channel EEG signal to generate intra-channel features. The module extracts the time-frequency features of each channel using one-dimensional convolution and a deep feature neural network, and then uses global average pooling to reduce the dimensionality, thus generating the intra-channel features.
[0044] Specifically, the in-channel feature encoding module in this embodiment is designed to extract features from multi-channel EEG signals. Deep features are extracted independently from each channel. Specifically, for ease of description, a batch dimension B is introduced. Original input By reconstructing the data by integrating the channel dimension C into the batch dimension, we obtain... Subsequently, each channel signal is locally encoded using one-dimensional convolution to capture time and frequency features. Based on this representation, a deep feature extraction network (such as VGG16 or Darknet53) is used to extract more comprehensive time and frequency features, resulting in an intermediate representation. Next, dimensionality reduction is achieved by performing global average pooling on the sequence dimension E. Finally, the batch dimension B and channel dimension C are separated to obtain the final intra-channel features. In this invention, C=20 and K=512.
[0045] The inter-channel feature fusion module includes a graph-based spatial fusion branch and a projection branch, used to fuse spatial dependencies between channels and preserve channel-specific features, respectively. Intra-channel features are input into the two branches, generating channel-independent features and channel-fused features, respectively. The graph-based spatial fusion branch constructs an adjacency matrix to represent the spatial relationships between channels and uses graph convolution operations to fuse feature information from spatially neighboring channels to obtain channel-fused features. In this embodiment, the adjacency matrix is constructed based on the three-dimensional physical coordinates of the EEG electrodes, and normalized Euclidean distance is used to calculate the spatial correlation between channels. The projection branch consists of a linear layer and a sigmoid activation function, which maps intra-channel features to a semantic space consistent with the channel-fused features through linear transformation, obtaining channel-independent features.
[0046] Specifically, the graph-based spatial fusion branch in this embodiment employs a graph convolutional layer designed based on the spatial distribution of EEG electrodes, enhancing the inter-channel dependencies while maintaining the independence of each channel. Specifically, an adjacency matrix is first constructed based on the three-dimensional physical coordinates of the electrodes. And apply it to graph convolution operations. Adjacency matrix The construction process consists of two steps, as described below.
[0047] The first step involves employing a bipolar montage configuration, where each dual channel consists of a pair of electrodes. Definition. Spatial coordinates of a bipolar channel. Through electrodes and The midpoint of the Cartesian coordinates is calculated as follows:
[0048]
[0049] in, This represents the electrode coordinates obtained from a standard EEG system (such as the standard-1020 template in the MNE). The channel position matrix can be obtained by calculating all C channels through this process. The MNE mentioned in parentheses above refers to MNE Python, a powerful open-source Python library specifically designed for processing, analyzing, and visualizing neurophysiological data such as electroencephalograms (EEG), magnetoencephalograms (MEG), and eye-tracking graphs (EOG).
[0050] The second step is to calculate the Euclidean distance between all channel pairs to construct the distance matrix. Subsequently, by normalizing D and taking its complement, the adjacency matrix is obtained. :
[0051]
[0052]
[0053] This method assigns larger edge weights to spatially proximate channels, while gradually decreasing the edge weights of spatially distant channels to zero, thus embedding prior information about the electrode space into the adjacency matrix. Based on the constructed adjacency matrix... Channel fusion features were calculated. :
[0054]
[0055] in, For trainable weight matrix, For bias terms, This represents the Sigmoid activation function.
[0056] In this embodiment, the projection branch consists of a linear layer and a sigmoid activation function. It uses in-channel features As input, channel-independent features after linear transformation are generated. Its definition is as follows:
[0057]
[0058] in, and These represent the learnable weights and bias parameters of the linear layer, respectively.
[0059] Without this projection, the feature distribution after channel fusion may deviate significantly from the original intra-channel feature space, leading to feature misalignment and gradient instability. The linear transformation, by transforming the intra-channel features... Features of channel fusion Projecting them into the same semantic space effectively alleviates this problem, allowing for the computation of their similarity to the prototype in a consistent space.
[0060] The prototype-based decision module calculates the similarity between channel-independent features and channel-fused features and multiple learnable prototypes, outputting channel-level IED prediction probabilities and time-period-level IED prediction probabilities. The prototype-based decision module generates channel-level IED prediction probabilities by calculating the similarity between channel features and multiple learnable prototypes, and further obtains time-period-level IED prediction results through maximum aggregation.
[0061] Specifically, channel-independent characteristics and channel fusion features The similarity is calculated with each of the M embedded learnable prototype vectors to obtain the channel-independent similarity matrix. Channel fusion similarity matrix Each element in the matrix represents the probability that the corresponding channel belongs to the corresponding prototype. The first prototype is set to represent IED activity, from which the channel-level IED prediction probabilities can be obtained. Finally, by taking all channels... The maximum value is used to obtain the IED prediction value at the time period level. and .
[0062] In this embodiment, the prototype-based decision module achieves channel-level and time-period-level IED prediction by measuring the similarity between channel features and the prototype. Specifically, for each channel fused feature vector... Calculate its relationship with each of the M learnable prototypes. Calculate the Euclidean distance and convert it into a similarity score:
[0063]
[0064] in, Indicates the channel index. Indicates the prototype index. This is a small constant introduced to ensure numerical stability. The final result is... It is a channel fusion similarity matrix, where each element represents the response value of a specific channel to a specific prototype, and is normalized using the Softmax function along the prototype dimension. Similarly, channel-independent features... The channel-independent similarity matrix is also obtained through the same process. Of the M prototypes, the first prototype is designated to represent IED activity. Therefore, the channel-level IED probability for the c-th channel is defined as:
[0065]
[0066] Finally, by selecting channel-level probabilities from all C channels The maximum value is used to obtain the time-period IED prediction. And construct a binary classification probability vector:
[0067]
[0068] In this embodiment, a weakly supervised interictal epileptiform discharge detection network model based on spatial priors is trained using training samples. The Adam optimization method is used to dynamically adjust the learning rate of the network model during training. In this embodiment, the number of samples used for each model training iteration is 32, and the training iterates through the samples 2000 times. If the optimal result is not updated within 20 iterations, the training is terminated early. The training learning rate is 3e-4. The network model is trained using a composite loss function, which is:
[0069]
[0070]
[0071]
[0072]
[0073]
[0074]
[0075] in, yes The weights corresponding to each function, The number of input signals. It is the one-hot encoding of the nth signal at the time interval of the kth class. These are prototype features learned through network learning. It is a small constant introduced to ensure numerical stability. For the number of prototypes, It refers to the number of channels for inputting EEG signals. It is a pseudo-tag for the c-th channel of the b-th input signal. This represents the time periods with the pseudo-label "IED" among all time periods where IEDs exist. The set of channels.
[0076] in, and The definition is as follows:
[0077]
[0078]
[0079] Here, TopK returns the indices of the k channels with the highest predicted IED probabilities. It is the normalized spatial correlation score between channel k and channel c. It is a similarity threshold used to determine whether channels are spatially related. It is an indicator function that takes the value 1 when the internal condition is true, and 0 otherwise.
[0080] S5: Input the EEG signal into the trained model, and the model outputs the prediction results of whether IED exists in each channel.
[0081] Specifically, in this embodiment, a multi-channel EEG signal is given. The data is then input into a trained interictal epileptic discharge detection network model to obtain the corresponding channel-independent similarity matrix. and the corresponding channel-level IED probability ,when When this happens, it is determined that the channel has detected an IED.
[0082] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the above embodiments do not limit the present invention in any way, and all technical solutions obtained by equivalent substitution or equivalent transformation fall within the protection scope of the present invention.
Claims
1. A spatial-prior-based weakly supervised interictal epileptiform discharge detection method, characterized in that, The method comprises the following steps: obtaining multi-channel electroencephalogram signal data, dividing the data into multiple data segments with the same length, each data segment containing multi-channel electroencephalogram signals; coarse-grained labeling of the data segments, labeling whether each segment contains an IED event, dividing the data segments into a training set, a validation set and a test set, and fine-grained labeling of the data segments in the test set to mark the accurate channel position of the IED, thereby constructing an electroencephalogram signal database containing coarse-grained time period labels and fine-grained channel labels; preprocessing the electroencephalogram signals; constructing and training a weakly supervised interictal epileptiform discharge detection network model, which comprises: an intra-channel feature encoding module for independently extracting deep features from each channel of the given input multi-channel electroencephalogram signal to generate intra-channel features; an inter-channel feature fusion module comprising a graph-based spatial fusion branch and a projection branch for fusing the spatial dependence between channels and preserving channel-specific features, respectively, and the intra-channel features are input into the two branches to generate channel-independent features and channel fusion features, respectively; a prototype-based decision module for calculating the similarity between the channel-independent features and the channel fusion features and a plurality of learnable prototypes to output channel-level IED prediction probabilities and time period-level IED prediction probabilities; inputting the electroencephalogram signal into the trained model, and the model outputs the prediction results of whether there is an IED in each channel.
2. The weakly supervised interictal epileptiform discharge detection method based on spatial prior according to claim 1, wherein the length of the data segment is 1 second, each segment contains 20 channels of electroencephalogram signals, and the sampling rate is 256 Hz.
3. The weakly supervised interictal epileptiform discharge detection method based on spatial prior according to claim 1, wherein the preprocessing comprises removing electrooculogram and electromyogram artifacts using a 0.5-70 Hz bandpass filter.
4. The weakly supervised interictal epileptiform discharge detection method based on spatial prior according to claim 1, wherein the data segments are divided into a training set, a validation set and a test set in a ratio of 8:1:
1.
5. The weakly supervised interictal epileptiform discharge detection method based on spatial prior according to claim 1, wherein the intra-channel feature encoding module extracts time-frequency features of each channel through one-dimensional convolution and deep feature neural networks, and reduces the dimension through global average pooling to generate intra-channel features.
6. The weakly supervised interictal epileptiform discharge detection method based on spatial prior according to claim 1, wherein the graph-based spatial fusion branch represents the spatial relationship between channels by constructing an adjacency matrix, and fuses the feature information of spatially adjacent channels through graph convolution operation to obtain channel fusion features.
7. The weakly supervised interictal epileptiform discharge detection method based on spatial prior according to claim 6, wherein the adjacency matrix is constructed based on the three-dimensional physical coordinates of the electroencephalogram electrodes, and the spatial correlation between channels is calculated using normalized Euclidean distance. 8. The weakly supervised seizure-onset interval detection method based on spatial prior according to claim 1, wherein, the projection branch is composed of a linear layer and a Sigmoid activation function, and the intra-channel features are mapped to a semantic space consistent with the channel fusion features through linear transformation to obtain channel-independent features.
9. The weakly supervised seizure-onset interval detection method based on spatial prior according to claim 1, wherein, the prototype-based decision module calculates the similarity between the channel features and a plurality of learnable prototypes to generate channel-level IED prediction probabilities, and further aggregates the maximum value to obtain a time period-level IED prediction result.
10. The weakly supervised seizure-onset interval detection method based on spatial prior according to claim 1, wherein, the network model is trained using a composite loss function, and the loss function is: wherein, is the weight corresponding to each function, is the number of input signals, is the one-hot encoding of the nth signal at the kth class of time period level, is the prototype feature learned by the network, is a small constant introduced to ensure numerical stability, is the number of prototypes, is the number of channels of the input electroencephalogram signal, is the pseudo label of the cth channel of the bth input signal, represents the time period in which the pseudo label is IED among all the time periods in which IED exists, is the set composed of all the channel pairs.
Citation Information
Patent Citations
Epilepsy positioning and seizure prediction method based on deep learning integrated model
CN113647962A
Automatic detection method and equipment for epilepsy sample discharge of inter-seizure electroencephalogram
CN116369943A
Interepileptic brain wave abnormal signal positioning method and device, equipment and medium
CN116807496A
Epileptic seizure detection and positioning system and method combining time convolution and Transform network
CN120203503A
Double-branch microevent detection method based on weak supervision
CN120277496A