Method, system and storage medium for epileptic wave detection across patients based on difference matrix

By constructing a differential matrix in SEEG data and combining a convolutional neural network, the problems of poor epilepsy wave detection and poor generalization performance in SEEG data in the prior art are solved, and precise epilepsy seizure detection among different patients is achieved.

CN114931362BActive Publication Date: 2025-04-18ZHEJIANG UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210655871.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-10
Publication Date
2025-04-18
Estimated Expiration
2042-06-10

AI Technical Summary

Technical Problem

The prior art has poor epilepsy wave detection effect in SEEG data and poor generalization performance, making it difficult to effectively detect epilepsy seizures among different patients.

Method used

Using a differential matrix-based method, augmented data is constructed by obtaining the original EEG signal data and splicing it with local context reference, normal waveform reference and global approximate seizure waveform reference. Then, the characteristics of different indicators are extracted, the difference matrix is ​​constructed, and the convolutional neural network is used to encode and classify to realize the detection of epilepsy.

Benefits of technology

It realizes accurate prediction of epilepsy wave detection on SEEG data, has good generalization ability, and can effectively detect epilepsy seizures among different patients.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114931362B_ABST
    Figure CN114931362B_ABST
Patent Text Reader

Abstract

The present invention proposes a method, system and storage medium for cross-patient epilepsy wave detection based on a differential matrix, which belongs to the technical field of signal processing and pattern recognition. The original EEG signal data of the segment to be detected is obtained, and the local context reference, normal waveform reference and global approximate attack waveform reference are spliced ​​on the front and back sides to construct the augmented data of the segment to be detected; the features of different indicators of the augmented data are extracted to form a differential matrix of different indicators, and the differential matrices of the different indicators are spliced ​​to obtain a synthetic differential matrix of the segment to be detected; the synthetic differential matrix of the segment to be detected is iteratively encoded, and the encoding results are classified to obtain the detection result of whether the segment to be detected is an epileptic attack. The present invention realizes epilepsy detection on SEEG data by utilizing the differences between epileptic brain waves and normal brain waves in three aspects: slope, amplitude and intensity, as well as three important references, combined with differential operations and dedicated convolutional neural networks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of signal processing and pattern recognition, and in particular to a method, system and storage medium for detecting epileptic waves across patients based on a differential matrix. Background Art

[0002] Epilepsy is a chronic neurological disease caused by excessive discharge of neurons, which can cause body convulsions, loss of consciousness and even life-threatening. It has become one of the most common neurological diseases. Today, more than 65 million people worldwide are affected by epilepsy, and one-third of epilepsy is difficult to be completely cured medically [Min Li 2021]. Stereo-encephalography (SEEG) is a representative iEEG technology that inserts electrodes into the human brain for signal recording. This mature technology has been proven to be effective and safe, and has the advantage of being minimally invasive [Alomar 2016]. In addition, compared with other iEEG methods (such as ECoG, LFP), SEEG provides EEG recording functions for both cortical and subcortical structures, becoming a mainstream method for epilepsy localization [Proix 2018]. At present, epilepsy detection and diagnosis based on EEG recordings are mainly performed by well-trained neurologists. However, these manual detection tasks are very time-consuming and tedious. It takes several hours or even longer to identify epileptic seizure events in a single patient [Mormann 2007].

[0003] In addition, the results of epilepsy detection are highly dependent on the experience of neurologists. In this context, research on automated epilepsy detection has developed rapidly, however, most of them are based on non-invasive electrophysiological monitoring recordings and implemented in a single patient setting. Due to the lack of stereoscopic information and finer EEG signals provided by invasive recording methods, existing methods will fail when the epileptogenic lesions are located in deeper brain structures (e.g., hippocampus, insula). More importantly, existing methods driven by supervised machine learning methods can only be trained and applied on the same patient due to individual differences between patients. Therefore, for each new patient, a lot of data collection and annotation work is required to train the classifier parameters. In fact, these single-patient-based methods will add additional burden and reduce the diagnostic efficiency in real-world situations. Therefore, studying SEEG-based epilepsy detection models with a certain level of generalization and cross-patient capabilities is the first step towards clinical diagnostic applications.

[0004] However, brain activity is a non-stationary signal that varies greatly between individuals due to various factors: (1) Brain neural activity is inherently patient-specific due to structural and functional differences between patients, including neurodevelopment, mental status, etc. [Samek 2013]. (2) SEEG is a personalized method tailored to each patient's clinical situation [Chabardes 2018], where electrode placement (e.g., brain region of insertion, number of channels, etc.) varies for each specific patient. (3) EEG seizure patterns vary greatly between different epilepsy patients [Hossain 2019], ranging from low-voltage fast activity, high-amplitude low-frequency periodic spikes to high-amplitude fast oscillations [Frauscher 2017, Truccolo 2011]. In addition, different pathogenic mechanisms can also lead to different seizure patterns. These factors inevitably lead to huge domain shifts between patients, making the generalization of seizure detection across patients in SEEG an open question. Summary of the invention

[0005] In order to solve the problems of poor epileptic wave detection effect and poor generalization performance of SEEG data in the prior art, the present invention proposes a cross-patient epileptic wave detection method, system and storage medium based on a differential matrix, which realizes epilepsy detection on SEEG data by utilizing the differences between epileptic brain waves and normal brain waves in slope, amplitude and intensity as well as three important references, combined with differential operations and convolutional neural networks.

[0006] The present invention adopts the following technical solution:

[0007] In a first aspect, the present invention provides a method for detecting epileptic waves across patients based on a difference matrix, comprising:

[0008] Obtaining the original EEG signal data of the segment to be detected, and splicing the local context reference, the normal waveform reference and the global approximate seizure waveform reference on the front and back sides of the detection segment to construct augmented data of the segment to be detected;

[0009] Extracting features of different indicators of augmented data, forming differential matrices of different indicators, and splicing the differential matrices of different indicators to obtain a synthetic differential matrix of the segment to be detected; the different indicators include slope indicators, amplitude indicators and intensity indicators;

[0010] The synthetic difference matrix of the segment to be detected is iteratively encoded, and the encoding result is classified to obtain a detection result of whether the segment to be detected is an epileptic seizure.

[0011] In a second aspect, the present invention provides a differential matrix-based cross-patient epileptic wave detection system for implementing the differential matrix-based cross-patient epileptic wave detection method described above.

[0012] In a third aspect, the present invention provides a computer-readable storage medium having a program stored thereon, wherein when the program is executed by a processor, it is used to implement the above-mentioned differential matrix-based cross-patient epileptic wave detection method.

[0013] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention is based on a generalized difference matrix and a difference matrix convolutional neural network encoder to model the SEEG epilepsy detection model of the dynamic change pattern of EEG activity, which can realize a given series of continuous SEEG multi-channel time series data segments of fixed duration, through feature extraction of input data and modeling of the difference matrix, thereby achieving accurate prediction of SEEG data epileptic waves. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 is a schematic diagram of a method for detecting epileptic waves across patients based on a difference matrix according to an exemplary embodiment;

[0015] Figure 2 It is a schematic diagram showing construction and update of the most recent normal waveform reference according to an exemplary embodiment.

[0016] Figure 3 is a schematic diagram of constructing a global approximate onset waveform reference according to an exemplary embodiment;

[0017] Figure 4 is an example showing that an epileptic wave is similar to a normal wave according to an exemplary embodiment.

[0018] Figure 5 is a schematic diagram showing how a difference matrix reflects changes in neural activity during the evolution of epilepsy according to an exemplary embodiment. DETAILED DESCRIPTION

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

[0020] In order to perform cross-patient epilepsy detection in SEEG, the present invention faces the challenge of domain shift due to the differences in physiology, pathology, epileptic seizure patterns and diagnosis between different patients. In order to overcome these limitations, the present invention proposes a novel neural network based on a differential matrix to simulate a universal epilepsy representation, which can be applied to different patients. In this embodiment, the model used in the cross-patient epilepsy wave detection method based on the differential matrix is ​​denoted as "DMNet". Based on a generalizable differential matrix and a differential matrix convolutional neural network encoder, a SEEG epilepsy detection framework that models the dynamic change pattern of EEG activity is constructed. The overall framework of the present invention consists of three important components: a differential matrix building module that converts time series data, three important references (local context reference, recent normal waveform reference, and global approximate seizure waveform reference) introduced to better capture changes in EEG activity, and a differential matrix encoder that performs characterization learning on the differential matrix for classification by the classifier.

[0021] Figure 1 The overall framework of DMNet is shown in Figure 2. k , the present invention will detect fragment s k The nearby τ segments are used as local context references, and the nearby normal waveform reference and the global approximate onset waveform reference are added to form a three-segment sequence based on slope, amplitude, and intensity; a difference operation is then performed to obtain a synthetic difference matrix, which will be sent to the encoder to learn high-level representations; finally, the classifier is used to obtain s k The test results are either normal or an epileptic seizure.

[0022] Each part is described below.

[0023] (a) Construction of difference matrix.

[0024] The present invention will detect fragment s k And three references are used for differential operation, and the present invention constructs the following segment sequence:

[0025]

[0026] Among them, s k is the original data of the kth segment to be detected, || is the connection operation, refers to the local context reference, and Indicates that it will connect to s k A reference subset of the anterior and posterior sides of and They are the nearby normal reference and the global approximate seizure waveform reference, and the two subsets of each reference are placed in s k On both sides, the final Sk represents the augmented data of the kth segment to be detected, and the augmented data includes several time series segments s.

[0027] Figure 1 The left part of the diagram gives an explanation. Through data analysis, it can be seen that the significant characteristics of SEEG activity of epileptic seizures are mainly reflected in frequency and amplitude. Therefore, the present invention uses three indicators to describe S k Each time series segment s in , in order to give a more comprehensive representation of the time series segment:

[0028] SLOPE(s)=max(|s 1:l -s 0:l-1 |)

[0029] AMPLITUDE(s)=max(|s|)

[0030] INTENSITY(s)=cusp(s)×mean(|s 1:l -s 0:l-1 |)

[0031] Among them, s 1:l Represents the data slice from 1 to l in the sequence segment s, SLOPE(.) represents the maximum slope calculation, AMPLITUDE(.) represents the maximum absolute amplitude calculation, cusp(.) represents the cusp count, mean(.) represents the mean calculation, and INTENSITY(.) represents the intensity calculation.

[0032] Specifically, SLOPE can describe the speed of change and the amplitude of brain signal fluctuations, while AMPLITUDE can describe the vertical distance of the time series from the x-axis. Performing a max operation on these two indicators helps to eliminate the impact of noise and make the representation more robust. In addition, the present invention also defines the INTENSITY of the time series segment, where cusp calculates the number of cusps in the segment, indicating the speed of change of SEEG, and the average value of the slope describes the magnitude of the fluctuation. Through the analysis of EEG signals, it is obvious that there are differences in slope, amplitude and intensity between normal and epileptic seizure activities, and these three descriptive indicators are reasonable.

[0033] The present invention can obtain the feature vector of the augmented data Sk of the kth segment to be detected: like Figure 2 The three vectors shown in the upper left corner, where p represents S k The total number of time series segments in , * indicates indicators, including slope indicators, amplitude indicators, and strength indicators.

[0034] Then perform a difference operation on all elements in the vector (such as Figure 1 As shown), we get a difference matrix:

[0035]

[0036] in, represents the differential features of the i-th and j-th time series segments in the augmented data of the k-th segment to be detected, represents the characteristics of the i-th time series segment, Represents the characteristics of the j-th time series segment;

[0037] After that, the three normalized difference matrices are connected in the third dimension to obtain the final composite difference matrix

[0038] (ii) Local context reference

[0039] As mentioned above, capturing brain activity changes is the key to eliminating domain shifts between different patients. However, a specific segment is usually too short to contain rich neural activity. To this end, this paper introduces a local context reference Used for signal differencing operations to compare the epileptic seizure events in that segment with the normal background activity nearby.

[0040] Specifically, for a segment s k , defining its local context reference is a continuous sequence of segments of length 2τ, i.e., the segments in s in time order k The adjacent segments before and after (representing and Each contains τ segments). We get:

[0041]

[0042] In practice, local contextual references are effective, especially for short-term epileptic seizures, by capturing changes in neural activity that occur over a short period of time.

[0043] (iii) The most recent normal waveform reference.

[0044] The duration of epileptic seizures varies greatly from patient to patient, but the duration of epileptic seizures in the same patient is not the same, and this variation will hinder the detection of epileptic seizures. For the middle part that is the detection target, there is no normal waveform for comparison because the epileptic seizure event occupies its entire context reference. The above-mentioned local context reference can only capture the transition changes between adjacent segments, and the epileptic seizure segment will be indistinguishable from the normal segment. In order to solve this problem, the present invention introduces a nearby normal reference, that is, a segment classified as normal, to ensure that there are always normal events for comparison of differential operations.

[0045] Details of the normal reference build process are given in Figure 2 Given B synthetic difference matrices in the t-th iteration update, B represents the batch size, first input it into the model and obtain the detection result Indicates the detection result of the Bth segment. In this embodiment, the detection result is obtained The model consists of a CNN encoder and a classifier.

[0046] Then apply the filter to select the segments classified as normal to form a set of segments Used to update the nearby normal reference. It is worth noting here that there is a pre-ictal evolution process before the epileptic seizure, during which the brain activity gradually approaches the epileptic seizure pattern, but is clinically regarded as normal. Considering that directly Assuming that the normal reference will introduce pre-ictal mode and lead to weak comparison between normal and epileptic events, the present invention introduces a momentum update strategy, using the update rate parameter α to update the nearby normal reference To get a more robust result, as follows:

[0047]

[0048] Among them, len(·) represents the number of fragments in the set, is the preset threshold.

[0049] after, Updated in the normal reference memory for the next iteration. When performing the difference, Rnn is divided into two equal parts (i.e. R nn1 and R nn2 ), and concatenate them to the preceding and following references of the segment sequence with local context to compensate for normal background EEG activity.

[0050] (iv) Global approximate seizure waveform reference.

[0051] In many cases, oscillations in neural activity also occur during normal events, making it difficult to distinguish between epileptic seizures and normal events in different patients. Figure 4 An intuitive example is given, where epileptic seizures and normal waves from different patients are very similar to brain activity patterns, causing their corresponding difference matrices to become indistinguishable. Moreover, this phenomenon also occurs in the same patient. This problem is due to the fact that the difference matrix is ​​constructed based on only local information. Although the oscillations of neural activity cause similar local contextual changes, from a global perspective within the same channel, there are still some only slight signal differences (e.g., amplitude, frequency, etc.) between epileptic seizures and normal activities.

[0052] In order to solve the above problems, the present invention introduces a global approximate seizure waveform reference as a standard seizure pattern (SSP) to represent the global characteristics of the seizure, which can be used to better distinguish epileptic waves from normal events of neural activity oscillations. Figure 3 The details of the global epileptiform reference are shown. Please note that SSP is not necessarily composed of all epileptic seizure waves, but is a globally representative epileptiform seizure pattern. Inspired by this idea, the present invention sorts all segments in the same channel according to the indices of amplitude, slope and intensity respectively. For each metric, the largest first Γ segments are taken as the candidate set of the most representative epileptiform segments in the corresponding channel. And merge the three sets into where *∈{slope, amplitude, intensity} represents the metric, Γ∈(0, m-1] is the adjustable setting size, and m is the total number of segments in the current channel.

[0053] Considering S gs The representative epileptiform segments in will also be highly variable, and directly performing differential operations on them will inevitably lead to false negative detections. For example, an epileptic seizure with the largest slope may produce a huge difference from the target seizure waveform with a smaller slope, resulting in an erroneous result of detecting the target as normal. In order to keep the variance of SSP within a limited range, the present invention selects the epileptic segment that is most similar to the detected segment and its local context reference as the global approximate seizure waveform reference R gs .

[0054] Specifically, the present invention will detect fragment s k and its surrounding local context references are divided into two equal parts, and the corresponding values ​​of the three indicators are calculated, denoted as and

[0055] Then select S gs The candidate in which the index value Closest and As a global epilepsy-like reference:

[0056]

[0057]

[0058] in, and is the detection fragment s k The global epilepsy-like references will be connected to the posterior and anterior normal references with local context and nearby segment sequences, thus providing global SSP information.

[0059] (V) Differential matrix encoder.

[0060] After performing the differential operation, three differential matrices are obtained according to the three indicators of each detection segment: The three difference matrices are normalized and combined into a composite difference matrix (SDM), denoted as In this embodiment, a CNN convolutional neural network is used as an encoder to learn the constructed SDM representation for final classification.

[0061] Inevitably, the range of SDM values ​​varies from patient to patient, which makes it difficult for the encoder to learn a general representation for different patients. Therefore, the SDM needs to be normalized. In order to preserve the relative proportions of the matrix and neural activity information, the present invention proposes signed min-max normalization, which implements min-max normalization on the SDM while maintaining the signed value. Normalization is performed before the SDM is fed into the CNN model (e.g. Figure 1 shown).

[0062] In this step, first, the sign of each value is saved as a matrix L k . Secondly, after taking the absolute value, each of the three difference matrices is min-max normalized. Finally, use the matrix L k To restore the positivity of the difference matrix, the implementation process can be expressed as:

[0063]

[0064] in, represents the symbol matrix, N min-max represents min-max normalization, represents the normalized difference matrix.

[0065] Naturally, the three indicators (slope, amplitude, and intensity) play different roles in the epilepsy detection task. The present invention can also use an attention mechanism to simulate the importance of the difference matrix based on different indicators, thereby realizing adaptive feature map fusion. Specifically, by calculating the The importance coefficient α is calculated and weighted to obtain a more effective synthetic difference matrix. After representation learning in the encoder, it is input into the classifier to obtain whether each segment to be detected is an epileptic seizure.

[0066] In a specific implementation of the present invention, a method for detecting epileptic waves across patients based on a difference matrix includes:

[0067] Step 1, obtaining the original EEG signal data of the segment to be detected, and splicing the local context reference, normal waveform reference and global approximate seizure waveform reference on the front and back sides of the detection segment to construct augmented data of the segment to be detected;

[0068] In this step, the focus is on obtaining three references of the segment to be detected and splicing them on the front and back sides of the segment to be detected to obtain the augmented data of the segment to be detected:

[0069]

[0070] Among them, s k is the original data of the kth segment to be detected, || is the connection operation, Represents the segment to be detected s k The local context reference of and Indicates connection to s k A reference subset of the anterior and posterior sides of Indicates the segment to be detected s k Normal waveform reference, Indicates connection to A reference subset of the anterior and posterior sides of Represents the segment to be detected s k The global approximate onset waveform reference, Indicates connection to The reference subset of the front and back sides, S k represents the augmented data of the kth segment to be detected, and the augmented data includes several time series segments s.

[0071] Specifically, the following steps are included:

[0072] Step 1.1, get the local context reference:

[0073] In the segment to be detected k A continuous segment sequence of length τ is selected before and after , expressed as:

[0074]

[0075] in, Represents the segment to be detected s k The local context reference of Indicates the segment to be detected s k Partial above reference, Represents the segment to be detected s k Local context reference, s k-τ Indicates the segment to be detected s k The fragment of the previous τ steps, s k+τ Represents the segment to be detected s k Then the fragment of τ steps;

[0076] Will and Splice them into the fragments to be detectedk The front and back sides.

[0077] Step 1.2, get the normal waveform reference:

[0078] In the process of iteratively encoding the synthetic difference matrix of the to-be-detected segment, in the initial iteration, several segments are obtained as candidate segments and spliced ​​into the to-be-detected segment s k On both sides of the initial encoding process, the encoding results are classified, and the candidate segment set corresponding to the synthetic difference matrix with the classification result being normal is selected The candidate fragment collection Divide into two equal parts and splice them on the front and back sides of the local context reference;

[0079] Afterwards, in the process of performing the t-th iteration encoding of the synthetic difference matrix of the to-be-detected segment, the synthetic difference matrix of the augmented data of the to-be-detected segment generated in the t-1-th iteration is encoded and classified, and the candidate segment set corresponding to the synthetic difference matrix with a normal classification result is selected. Candidate segment set Perform a momentum update:

[0080]

[0081] Where len(·) represents the number of fragments in the collection, is the preset threshold, α is the update rate parameter; the candidate segment set obtained after momentum update It is used as a normal waveform reference and divided into two equal parts, which are spliced ​​on the front and back sides of the local context reference for the next iteration.

[0082] Step 1.3, obtain the global approximate attack waveform reference:

[0083] Initialize several segments, calculate the characteristics of different indicators of each segment, and select the largest first Γ segment under each indicator as the reference candidate segment set of the global approximate seizure waveform;

[0084] The detection fragment s k and its local context reference are divided into two equal parts, and the corresponding values ​​on each index are calculated, denoted as and

[0085] Select the segment with the closest index value from the global approximate seizure waveform reference candidate segment set. and The fragment is used as a global approximate onset waveform reference:

[0086]

[0087]

[0088]

[0089] in, is the detection fragment s k The global approximate onset waveform reference, Spliced ​​on the front and back sides of the normal waveform reference, S gs (i) represents the i-th segment in the global approximate onset waveform reference candidate segment set, *={slope, amplitude, intensity} represents the slope index, amplitude index and intensity index respectively.

[0090] Step 2, extracting the features of different indicators of the augmented data, forming a difference matrix of different indicators, and splicing the difference matrices of different indicators to obtain a synthetic difference matrix of the segment to be detected; the different indicators include a slope indicator, an amplitude indicator, and an intensity indicator;

[0091] This step can be implemented as follows:

[0092] Step 2.1: Extract the characteristics of different indicators of augmented data. Refer to the formula introduced in the first part "(I) Construction of difference matrix" above to obtain the characteristics of each indicator of all time series segments s in the augmented data, which can be recorded as They represent the slope index, amplitude index and intensity index respectively;

[0093] Step 2.2, perform differential operations on all elements of each indicator feature to obtain the differential matrix under each indicator:

[0094]

[0095] in, represents the differential features of the i-th and j-th time series segments in the augmented data of the k-th segment to be detected, represents the characteristics of the i-th time series segment, represents the feature of the jth time series segment, and p represents S k The total number of time series segments in ;

[0096] Step 2.3, normalize the difference matrix under each indicator:

[0097]

[0098] in, represents the symbol matrix, N min-max represents min-max normalization, represents the normalized difference matrix;

[0099] Step 2.4, concatenate the normalized difference matrices under each index to obtain the segment to be detected s k The corresponding synthetic difference matrix

[0100] In addition, before concatenating the normalized difference matrices, the normalized difference matrices of different indicators can also be obtained. The importance coefficient process is to normalize the difference matrix of different indicators according to the importance coefficient. Weighting is performed before splicing.

[0101] Step 3, iteratively encode the synthetic difference matrix of the segment to be detected, classify the encoding results, and obtain a detection result of whether the segment to be detected is an epileptic seizure.

[0102] In this embodiment, a differential matrix-based epilepsy wave detection system across patients is also provided, which is used to implement the above-mentioned embodiments, and will not be repeated hereafter. The terms "module", "unit", etc. used below can implement a combination of software and / or hardware for a predetermined function. Although the systems described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible.

[0103] The system comprises:

[0104] A local context reference module, which is used to obtain a local context reference of the detection segment;

[0105] A normal waveform reference module, which is used to obtain a normal waveform reference of the detection segment;

[0106] A global approximate seizure waveform reference module, which is used to obtain a global approximate seizure waveform reference of the detection segment;

[0107] A difference matrix construction module is used to sequentially splice the local context reference, the normal waveform reference, and the global approximate onset waveform reference on the front and back sides of the detection segment to obtain the augmented data of the detection segment; and to extract the features of different indicators of the augmented data to form a difference matrix of different indicators, and splice the difference matrices of different indicators to obtain a synthetic difference matrix of the segment to be detected; the different indicators include slope indicators, amplitude indicators and intensity indicators;

[0108] A difference matrix encoder module, which is used to iteratively encode the synthetic difference matrix of the segment to be detected;

[0109] The classifier module is used to classify the encoding results to obtain a detection result of whether the segment to be detected is an epileptic seizure.

[0110] The implementation process of the functions and effects of each module in the above-mentioned system is specifically detailed in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated 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 schematic, wherein the modules described as separate components may or may not be physically separated, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative labor. An embodiment of the present invention also provides a computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, the above-mentioned method of epilepsy wave detection across patients based on a differential matrix is ​​implemented.

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

[0112] This embodiment verifies the implementation effect of the present invention through a specific experiment.

[0113] (1) Data collection.

[0114] The SEEG dataset used in this experiment was provided and authorized for use by a tertiary hospital, and contains SEEG recording data from 5 patients. In order to meet the needs of diagnosis, 4 to 10 depth electrodes will be implanted for each refractory patient, each of which has 52 to 126 channels to record the patient's EEG signals. SEEG recordings are downsampled to 512-1024Hz by the diagnostic recording system. In particular, because for a certain patient, his SEEG data is large in scale, the sampling frequency is very high, and contains multiple channels, this dataset is very large, exceeding 150 hours and the data volume is much larger than 100GB.

[0115] (2) Data preprocessing.

[0116] In order to improve the efficiency of the evaluation model, this experiment downsampled the SEEG recording data to 256Hz, and divided the continuous data into 1445856 segments, each containing 100 points. All segments were labeled by professional physicians, and the number of epileptic seizure segments accounted for approximately 0.0004 of the total number of segments, indicating that the labels of this dataset are very unbalanced. Therefore, this experiment uses precision, recall and F-measures to compare the effects of the model of the present invention with the model of the prior art.

[0117] (3)Comparative experiment

[0118] In order to fully verify the effectiveness of the model of the present invention, this experiment compared it with several different types of baseline models, which were divided into epileptic wave detection for a single patient and epileptic wave detection across patients.

[0119] Single patient epileptic wave detection. Training and testing will be performed on a single patient. In particular, for each patient, the dataset is randomly divided into training validation and test sets at a ratio of 5:1:4. The baseline models compared with the present invention model include:

[0120] Machine learning-based methods: Linear discriminant analysis (LDA [Balakrishnama 1998]) and support vector machine (SVM [Zhang 2012]) are used as classifiers, and the input data is the EEG band converted into a power spectrum diagram (PSD) and then classified.

[0121] Convolutional neural network based methods: This method uses convolutional neural networks as feature extractors for epileptic wave detection. More specifically, the detection segments are converted into 2D spectrograms using short-time Fourier transform, which are then input into classic convolutional neural networks for classification, such as Resnet [He 2015], Xception [Chollet 2016], and Densenet [Huang 2016].

[0122] Time-based classification methods: This includes state-of-the-art methods such as LSTM-FCN[Karim 2017], STSF[Cabello2020], TCN[Bai 2018], and MiniRocket[Dempster 2020], which can directly input time series fragments for classification.

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

[0124] Table 1 Average results of epileptic wave detection in individual patients

[0125]

[0126] As can be seen from Table 1, the model of the present invention has a very good effect on the classic machine learning algorithm, the amazing time series classification algorithm and the classic image classification algorithm. In particular, for the F2 index, the algorithm of the present invention has a 4.93% improvement over the best baseline algorithm Densenet. It can be explained that although the amount of information of a single patient is much less than that of multiple patients, the algorithm can more accurately capture the onset pattern of epileptic waves and the difference from ordinary waveforms, thus having a better effect.

[0127] Cross-patient epilepsy wave detection. For patients who need epilepsy detection, the data of this patient is used as the target domain, and the labels and data of all other patients are used as the source domain for model training and verification. The baseline models compared with the model of the present invention include:

[0128] SICR[Jeon 2019]: This algorithm has shown promising results in the field of non-invasive brain-computer interfaces by learning category-dependent and patient-invariant features.

[0129] MTL [Blanchard 2021]: This is a representative work on domain generalization, which exploits the original feature space augmented to include the marginal distribution of the generated features, because it reflects the fact that in domain generalization, information about the test task must be obtained from the marginal feature distribution of that task.

[0130] SD[Pezeshki 2020]: It aims to decouple the model from feature learning dynamics by introducing a new regularizer, improving robustness in situations hampered by gradient starvation.

[0131] Fishr[Rame 2021]: It introduces a regularization term to enhance the domain invariance of the loss gradient space, thereby improving the generalization ability of the model.

[0132] TRM[Xu 2021]: It introduces an evaluation criterion specifically designed to optimize the transfer of algorithms to new data.

[0133] IB-ERM[Ahuja 2021]: It is a method to improve generalization by minimizing the empirical risk across multiple domains.

[0134] CDANN[Li 2018]: It is an end-to-end domain generalization method for domain-invariant representation learning.

[0135] SelfReg[Kim 2021]: It is a domain generalization method based on self-supervised contrastive regularization.

[0136] MMD[Li 2018]: It is an adversarial autoencoder framework for learning generalized latent feature representations across domains.

[0137] GroupDRO[Sagawa 2019]: It is a model that combines distributionally robust optimization with regularization constraints, where distributionally robust optimization allows the model to be learned instead of minimizing the worst-case training loss on a set of predefined groups.

[0138] The test results are shown in Table 2.

[0139] Table 2 Average results of epileptic wave detection across patients

[0140]

[0141] As can be seen from Table 2, the algorithm of the present invention is superior to other baseline algorithms, and the F2 effect is improved by 18.65% compared with the best baseline method. The results show the effectiveness of the model of the present invention in cross-patient epileptic seizure detection, revealing the great potential of differential operations in capturing general seizure patterns and eliminating regional offsets. At the same time, the effects of recall and precision are better than most other baseline algorithms, which shows that the current algorithm can capture more seizure epileptic waves in a more accurate manner. This also shows that most generalized transfer algorithms based on computer vision and natural language processing cannot be directly applied to epilepsy detection scenarios based on SEEG data.

[0142] (4) Ablation experiment

[0143] This embodiment conducts an ablation experiment to verify the effectiveness of each main module in the model. More specifically, the present invention removes each of the following components from the model to see how they affect the performance respectively:

[0144] DMNet-NG: Delete the nearest normal waveform reference and the global approximate onset waveform reference, and only keep the segment to be detected and the local context reference for differential operation.

[0145] DMNet-N: Only the nearest normal waveform reference is deleted.

[0146] DMNet-G: Only the global approximate onset waveform reference is removed.

[0147] DMNet-AMMN: Replace the signed max-min normalization with the absolute value max-min normalization.

[0148] The test results are shown in Table 3.

[0149] Table 3 Ablation experiment results

[0150]

[0151] As can be seen from Table 3, DMNet outperforms other variants, among which the model without two references (DMNet-NG) has the worst performance, demonstrating the necessity of capturing local normality and global information. This is crucial for modeling general epileptic seizure representation. The performance of DMNet+AMMN is slightly lower than that of DMNet, indicating that the symbolic information retained in DMNet also helps in learning and detecting general seizure patterns.

[0152] (5) Case studies

[0153] In order to study how the difference matrix reflects the changes in neural activity during the evolution of epileptic seizures, the present invention visualizes a SEEG recording and the corresponding difference matrix on the three indicators of the sampling detection segment. Figure 5 As shown, there is a huge difference between the epileptic seizure and normal matrices during the evolution of the epileptic seizure. For normal events (e.g., segments a, b, c, and i), the difference matrix tends to be simple, while the matrix of epileptic events (e.g., segments d, e, f, and g) presents drastic neural changes. This case clearly illustrates how the difference matrix captures changes in neural activity and shows the effectiveness of the method proposed in the present invention.

[0154] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.

Claims

1. A cross-patient epileptic wave detection system based on a difference matrix, characterized in that: The system comprises: A local context reference module, which is used to obtain a local context reference of the detection segment; A normal waveform reference module, which is used to obtain a normal waveform reference of the detection segment; A global approximate seizure waveform reference module, which is used to obtain a global approximate seizure waveform reference of the detection segment; A difference matrix construction module is used to sequentially splice the local context reference, the normal waveform reference, and the global approximate onset waveform reference on the front and back sides of the detection segment to obtain the augmented data of the detection segment; and to extract the features of different indicators of the augmented data to form a difference matrix of different indicators, and splice the difference matrices of different indicators to obtain a synthetic difference matrix of the segment to be detected; the different indicators include slope indicators, amplitude indicators and intensity indicators; A difference matrix encoder module, which is used to iteratively encode the synthetic difference matrix of the segment to be detected; The classifier module is used to classify the encoding results to obtain a detection result of whether the segment to be detected is an epileptic seizure.

2. The epileptic wave detection system across patients based on a difference matrix according to claim 1, characterized in that: The methods for obtaining local context references include: In the segment to be detected k A continuous segment sequence of length τ is selected before and after , expressed as: in, Indicates the segment to be detected s k The local context reference of Indicates the segment to be detected s k Partial above reference, Indicates the segment to be detected s k Local context reference, s k-τ Represents the segment to be detected s k The fragment of the previous τ steps, s k+τ Represents the segment to be detected s k Then the fragment of τ steps; Will and Splice them into the fragments to be detected k The front and back sides.

3. The epileptic wave detection system across patients based on the difference matrix according to claim 1, characterized in that: The methods for obtaining a normal waveform reference include: In the process of iteratively encoding the synthetic difference matrix of the to-be-detected segment, in the initial iteration, several segments are obtained as candidate segments and spliced ​​into the to-be-detected segment s k On both sides of the initial encoding process, the encoding results are classified, and the candidate segment set corresponding to the synthetic difference matrix with the classification result being normal is selected The candidate fragment collection Divide into two equal parts and splice them on the front and back sides of the local context reference; Afterwards, in the process of performing the t-th iteration encoding of the synthetic difference matrix of the to-be-detected segment, the synthetic difference matrix of the augmented data of the to-be-detected segment generated in the t-1-th iteration is encoded and classified, and the candidate segment set corresponding to the synthetic difference matrix with a normal classification result is selected. For the candidate segment set Perform a momentum update: Where len(·) represents the number of fragments in the collection, is the preset threshold, α is the update rate parameter; the candidate segment set obtained after momentum update It is used as a normal waveform reference and divided into two equal parts, which are spliced ​​on the front and back sides of the local context reference for the next iteration.

4. The epileptic wave detection system across patients based on the difference matrix according to claim 1, characterized in that: The method for obtaining the global approximate seizure waveform reference comprises: Initialize several segments, calculate the characteristics of different indicators of each segment, and select the largest first Γ segment under each indicator as the reference candidate segment set of the global approximate seizure waveform; The detection fragment s k and its local context reference are divided into two equal parts, and the corresponding values ​​on each index are calculated, denoted as and Select the segment with the closest index value from the global approximate seizure waveform reference candidate segment set. and The fragment is used as a global approximate onset waveform reference: in, is the detection fragment s k The global approximate onset waveform reference, Spliced ​​on the front and back sides of the normal waveform reference, S gs (i) represents the i-th segment in the global approximate onset waveform reference candidate segment set, *={slope, amplitude, intensity} represents the slope index, amplitude index and intensity index respectively.

5. The epileptic wave detection system across patients based on differential matrix according to claim 1 or 4, characterized in that: The calculation formulas for the slope index, amplitude index and strength index are: SLOPE(s)=max(|s 1:l -s 0:l-1 |) AMPLITUDE(s)=max(|s|) INTENSITY(s)=cusp(s)×mean(|s 1:l -s 0:l-1 |) Among them, s 1:l Represents the data slice from 1 to l in the sequence segment s, SLOPE(.) represents the maximum slope calculation, AMPLITUDE(.) represents the maximum absolute amplitude calculation, cusp(.) represents the cusp count, mean(.) represents the mean calculation, and INTENSITY(.) represents the intensity calculation.

6. The epileptic wave detection system across patients based on difference matrix according to claim 1, characterized in that: The augmented data of the fragment to be detected is expressed as: Among them, s k is the original data of the kth segment to be detected, || is the connection operation, Represents the segment to be detected s k The local context reference of and Indicates connection to s k A reference subset of the anterior and posterior sides of Represents the segment to be detected s k Normal waveform reference, Indicates connection to A reference subset of the anterior and posterior sides of Represents the segment to be detected s k The global approximate onset waveform reference, Indicates connection to The reference subset of the front and back sides, S k represents the augmented data of the kth segment to be detected, and the augmented data includes a number of time series segments s.

7. The epileptic wave detection system across patients based on difference matrix according to claim 1, characterized in that: Extract the features of different indicators of augmented data and construct the difference matrix of different indicators, including: The index features of all time series segments s in the augmented data are recorded as They represent the slope index, amplitude index and intensity index respectively; Perform differential operations on all elements of each indicator feature to obtain the differential matrix under each indicator: in, represents the differential features of the i-th and j-th time series segments in the augmented data of the k-th segment to be detected, represents the characteristics of the i-th time series segment, represents the feature of the jth time series segment, and p represents S k The total number of time series segments in ; Normalize the difference matrix under each indicator: in, represents the symbol matrix, N min-max represents min-max normalization, Represents the normalized difference matrix; the normalized difference matrices under each index are spliced ​​to obtain the segment to be detected s k The corresponding synthetic difference matrix 8. The epileptic wave detection system across patients based on differential matrix according to claim 7, characterized in that: Before concatenating the normalized difference matrices, the normalized difference matrices of different indicators are obtained. The importance coefficient process is to normalize the difference matrix of different indicators according to the importance coefficient. Weighting is performed before splicing.

9. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, it is used to implement a method for detecting epilepsy waves across patients based on a differential matrix. The method for detecting epilepsy waves across patients based on a differential matrix includes: Obtaining the original EEG signal data of the segment to be detected, and splicing the local context reference, the normal waveform reference and the global approximate seizure waveform reference on the front and back sides of the detection segment to construct augmented data of the segment to be detected; Extracting features of different indicators of augmented data, forming differential matrices of different indicators, and splicing the differential matrices of different indicators to obtain a synthetic differential matrix of the segment to be detected; the different indicators include slope indicators, amplitude indicators and intensity indicators; The synthetic difference matrix of the segment to be detected is iteratively encoded, and the encoding result is classified to obtain a detection result of whether the segment to be detected is an epileptic seizure.

Citation Information

Patent Citations

  • EEG Signal Mixed Noise Processing Method, Equipment and Storage Medium

    AU2020103949A4

  • Real-time epileptic seizure detecting and monitoring system for epileptic video electroencephalogram examination

    CN113842118A