




技术领域technical field
本发明涉及信号处理和模式识别技术领域,尤其涉及一种基于差分矩阵的跨患者的癫痫波检测方法、系统和存储介质。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 epilepsy waves across patients based on differential matrix.
背景技术Background technique
癫痫是一种由神经元过度放电引起的慢性神经系统疾病,会导致身体抽搐、意识丧失甚至导致生命危险,已成为最常见的神经系统疾病之一。如今全世界有超过6500万人受到癫痫的影响,其中三分之一的癫痫疾病是医学上难以完全治愈的[Min Li 2021]。Stereo-encephalography(SEEG)是一种代表性的iEEG技术,将电极插入人脑进行信号记录。这种成熟的技术已被证明是有效和安全的,并且具有微创的优势[Alomar 2016]。此外,与其他iEEG方法(如ECoG、LFP)相比,SEEG同时提供皮质和皮质下结构的脑电记录功能,成为癫痫定位的主流方法[Proix 2018]。目前,基于脑电记录的癫痫检测和诊断主要由训练有素的神经科医生进行。但是,这些人工检测的任务非常耗时且乏味。识别单个患者的癫痫发作事件需要几个小时甚至更长的时间[Mormann 2007]。Epilepsy is a chronic neurological disease caused by excessive discharge of neurons, which can cause body convulsions, loss of consciousness and even life-threatening, and 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 disorders are medically incurable [Min Li 2021]. Stereo-encephalography (SEEG) is a representative iEEG technique in which electrodes are inserted into the human brain for signal recording. This well-established technique has been shown to be effective and safe, and has the advantage of being minimally invasive [Alomar 2016]. Furthermore, compared to other iEEG methods (e.g. ECoG, LFP), SEEG provides EEG recordings of both cortical and subcortical structures, becoming the mainstream method for epilepsy localization [Proix 2018]. Currently, epilepsy detection and diagnosis based on EEG recordings are mainly performed by trained neurologists. However, these manual detection tasks are time-consuming and tedious. Identifying seizure events in a single patient can take hours or more [Mormann 2007].
此外,癫痫检测的结果高度依赖神经科医生的经验。在这种情况下,自动化癫痫检测的研究发展迅速,然而,其中大部分是基于无创电生理监测记录,并在单个患者的设定中实施。由于缺乏侵入性记录方式提供的立体信息和更精细的脑电信号,当致癫痫病灶位于大脑更深的结构(例如海马、岛叶)时,现有方法将失败。更重要的是,由监督机器学习方法驱动的现有方法,由于患者之间存在个体差异,只能在同一患者上进行训练和应用。因此,对于每一个新的患者,都需要大量的数据收集和标注工作来训练分类器参数。事实上,这些基于单个患者的方法会增加额外的负担并降低现实情况下的诊断效率。因此,研究具有一定泛化水平和跨患者能力的基于SEEG的癫痫检测模型是迈向临床诊断应用的第一步。Furthermore, the results of epilepsy testing are highly dependent on the experience of the neurologist. In this context, research into 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. Existing methods fail when epileptogenic foci are located in deeper brain structures (eg, hippocampus, insula) due to the lack of stereoscopic information and finer EEG signals provided by invasive recording modalities. What's more, 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 large amount of data collection and labeling work is required to train the classifier parameters. In fact, these single-patient-based approaches add additional burden and reduce diagnostic efficiency in real-world situations. Therefore, researching SEEG-based epilepsy detection models with a certain level of generalization and cross-patient capability is the first step towards clinical diagnostic applications.
然而,大脑活动是非平稳信号,由于各种因素,个体之间存在很大差异:(1)由于患者之间的结构和功能差异,包括神经发育、精神状态等,脑神经活动本质上是患者特异性的[Samek2013]。(2)SEEG是针对每位患者的临床情况量身定制的个性化方法[Chabardes2018],其中电极放置位置(例如,插入大脑区域、通道数量等)因每位特定患者而异。(3)不同癫痫患者的脑电信号发作模式差异很大[Hossain 2019],从低电压快速活动、高振幅低频周期性尖峰到高振幅快速振荡[Frauscher 2017,Truccolo 2011]。此外,不同的致病机制也会导致不同的癫痫发作模式。这些因素不可避免地导致患者之间发生巨大的域偏移,使得SEEG中跨患者癫痫发作检测的泛化成为一个悬而未决的问题。However, brain activity is a non-stationary signal and varies greatly between individuals due to various factors: (1) Due to structural and functional differences between patients, including neurodevelopment, mental state, etc., brain nerve activity is inherently patient-specific Sexual [Samek2013]. (2) SEEG is an individualized approach tailored to each patient's clinical situation [Chabardes2018], where electrode placement (e.g., insertion brain region, number of channels, etc.) varies for each specific patient. (3) EEG seizure patterns vary widely in 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 large domain shifts between patients, making the generalization of seizure detection across patients in SEEG an open question.
发明内容SUMMARY OF THE INVENTION
为了解决现有技术针对SEEG数据癫痫波检测效果差、泛化性能差的问题,本发明提出了一种基于差分矩阵的跨患者的癫痫波检测方法、系统和存储介质,通过利用癫痫脑波与正常脑波在斜率、振幅以及强度这三个方面的差异以及三个重要的参考,结合差分操作和卷积神经网络,实现了在SEEG数据上的癫痫检测。In order to solve the problems of poor detection effect and poor generalization performance of SEEG data in the prior art, the present invention proposes a method, system and storage medium for detecting epilepsy waves across patients based on difference matrix. The differences in slope, amplitude, and intensity of normal brain waves and three important references, combined with differential operations and convolutional neural networks, enable epilepsy detection on SEEG data.
本发明采用如下技术方案:The present invention adopts following technical scheme:
第一个方面,本发明提供了一种基于差分矩阵的跨患者的癫痫波检测方法,包括:In a first aspect, the present invention provides a method for detecting epilepsy waves across patients based on a difference matrix, comprising:
获取待检测片段的原始脑电信号数据,并在检测片段的前后两侧拼接局部上下文参考、正常波形参考和全局近似发作波形参考,构建待检测片段的增广数据;Obtain 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 rear sides of the detected segment to construct the augmented data of the segment to be detected;
提取增广数据的不同指标的特征,构成不同指标的差分矩阵,将所述的不同指标的差分矩阵拼接,得到待检测片段的合成差分矩阵;所述的不同指标包括斜率指标、幅度指标和强度指标;Extracting the features of different indexes of the augmented data to form difference matrices of different indexes, and splicing the difference matrices of different indexes to obtain a composite difference matrix of the segment to be detected; the different indexes include slope indexes, amplitude indexes and strengths index;
对待检测片段的合成差分矩阵进行迭代编码,对编码结果进行分类,得到待检测段是否是癫痫发作的检测结果。The synthetic difference matrix of the segment to be detected is iteratively encoded, the encoding results are classified, and the detection result of whether the segment to be detected is an epileptic seizure is obtained.
第二个方面,本发明提供了一种基于差分矩阵的跨患者的癫痫波检测系统,用于实现上述的基于差分矩阵的跨患者的癫痫波检测方法。In a second aspect, the present invention provides a cross-patient epilepsy wave detection system based on a difference matrix, which is used to implement the above-mentioned difference matrix-based cross-patient epilepsy wave detection method.
第三个方面,本发明提供了一种计算机可读存储介质,其上存储有程序,其特征在于,该程序被处理器执行时,用于实现上述的基于差分矩阵的跨患者的癫痫波检测方法。In a third aspect, the present invention provides a computer-readable storage medium on which a program is stored, characterized in that, when the program is executed by a processor, the program is used to realize the above-mentioned differential matrix-based cross-patient epilepsy wave detection method.
与现有技术相比,本发明的具备的有益效果是:本发明基于可泛化的差分矩阵和差分矩阵卷积神经网络编码器,建模脑电活动动态变化模式的SEEG癫痫检测模型,能够实现给定一系列连续的固定时长的SEEG多信道时间序列数据段,通过对输入数据的特征提取与差分矩阵的建模,从而实现对SEEG数据癫痫波的精准预测。Compared with the prior art, the present invention has the beneficial effects as follows: the present invention is based on the generalizable difference matrix and the difference matrix convolutional neural network encoder, modeling the SEEG epilepsy detection model of the dynamic change pattern of brain electrical activity, and can Realize a series of continuous SEEG multi-channel time series data segments of fixed duration, and achieve accurate prediction of SEEG data epilepsy by extracting the features of the input data and modeling the difference matrix.
附图说明Description of drawings
图1是根据一示例性实施例示出的基于差分矩阵的跨患者的癫痫波检测方法的示意图;FIG. 1 is a schematic diagram of a method for detecting epilepsy waves across patients based on a differential matrix according to an exemplary embodiment;
图2是根据一示例性实施例示出的最近正常波形参考的构建与更新示意图。FIG. 2 is a schematic diagram showing the construction and update of the latest normal waveform reference according to an exemplary embodiment.
图3是根据一示例性实施例示出的全局近似发作波形参考的构建示意图;FIG. 3 is a schematic diagram illustrating the construction of a global approximate seizure waveform reference according to an exemplary embodiment;
图4是根据一示例性实施例示出的癫痫波与正常波相似的例子。FIG. 4 shows an example of an epileptic wave similar to a normal wave according to an exemplary embodiment.
图5是根据一示例性实施例示出的差异矩阵如何反映癫痫演变过程中的神经活动变化的示意图。FIG. 5 is a schematic diagram illustrating how the difference matrix reflects the neural activity changes during the evolution of epilepsy, according to an exemplary embodiment.
具体实施方式Detailed ways
下面结合附图和实施例对本发明进行进一步说明。附图仅为本发明的示意性图解,附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应,可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。The present invention will be further described below with reference to the accompanying drawings and embodiments. The accompanying drawings are only schematic diagrams of the present invention. Some block diagrams shown in the accompanying drawings are functional entities, which do not necessarily correspond to physical or logically independent entities. These functional entities can be implemented in the form of software, or in a These functional entities are implemented in multiple hardware modules or integrated circuits, or in different network and/or processor devices and/or microcontroller devices.
为了在SEEG中进行跨患者癫痫检测,由于不同患者在生理、病理学、癫痫发作模式和诊断方面的差异,本发明面临着领域偏移的挑战。为了克服这些限制,本发明提出了一种新颖的基于差分矩阵的神经网络来模拟通用癫痫表征,它可以应用于不同的患者。本实施例中,将基于差分矩阵的跨患者的癫痫波检测方法使用的模型记为“DMNet”,基于可泛化的差分矩阵和差分矩阵卷积神经网络编码器,建模脑电活动动态变化模式的SEEG癫痫检测框架,本发明的整体框架由3个重要的组件组成:对时序数据进行转换的差分矩阵构建模块、为了更好地捕获脑电活动变化从而引入的3个重要的参考(局部上下文参考、最近正常波形参考以及全局近似发作波形参考)和对差分矩阵进行表征学习以供分类器进行分类的差分矩阵编码器。For cross-patient epilepsy detection in SEEG, the present invention faces the challenge of domain shift due to differences in physiology, pathology, seizure patterns, and diagnosis among different patients. To overcome these limitations, the present invention proposes a novel differential matrix-based neural network to model a generic epilepsy representation, which can be applied to different patients. In this embodiment, the model used in the differential matrix-based cross-patient epilepsy wave detection method is denoted as "DMNet", and the dynamic changes of EEG activity are modeled based on the generalizable differential matrix and differential matrix convolutional neural network encoder. The model SEEG epilepsy detection framework, the overall framework of the present invention consists of three important components: a differential matrix building block for transforming time series data, and three important references (local contextual reference, last normal waveform reference, and global approximate seizure waveform reference) and a differential matrix encoder that learns representations of differential matrices for classification by the classifier.
图1展示了DMNet的整体框架概览图。对于检测片段sk,本发明将检测片段sk附近的τ片段作为局部上下文参考,并增加附近的正常波形参考和全局近似发作波形参考,以形成基于斜率、振幅和强度的三个片段序列;然后执行差分运算以获得合成差分矩阵,该矩阵将被送到编码器以学习高级表征;最后使用分类器获得sk的检测结果,即正常或者癫痫发作。Figure 1 shows an overview of the overall framework of DMNet. For the detection segmentsk , the present invention uses the τ segment near the detection segmentsk as the local context reference, and adds the nearby normal waveform reference and the global approximate seizure waveform reference to form three segment sequences based on slope, amplitude and intensity; Difference operations are 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 the detection result ofsk , i.e. normal or seizure.
下面分别对各个部分进行说明。Each part is described below.
(一)差分矩阵的构建。(1) Construction of the difference matrix.
本发明将检测片段sk以及三种参考进行差分运算,本发明构建了如下的段序列:The present invention performs differential operation on the detection segmentsk and three kinds of references, and the present invention constructs the following segment sequence:
其中,sk是第k个待检测段的原始数据,||是连接操作,指的是局部上下文参考,和表示将连接到sk的前后侧的参考子集;和分别是附近的正常参考和全局近似发作波形参考,每一种参考的两个子集分别放置在sk两侧,最后得到的Sk表示第k个待检测段的增广数据,增广数据中包括了若干个时间序列片段s。Among them,sk is the original data of the k-th segment to be detected, || is the join operation, refers to a local context reference, and represents the reference subset that will be connected to the front and rear sides ofsk ; and They are the nearby normal reference and the global approximate seizure waveform reference, respectively. The two subsets of each reference are placed on both sides ofsk respectively. The final obtainedSk represents the augmented data of the kth segment to be detected. In the augmented data Several time series segments s are included.
图1的左边部分给出了说明。通过对数据分析可见,癫痫发作的SEEG活动的显著特征主要体现在频率和幅度大小上。因此,本发明使用三个指标来描述Sk中的每个时间序列片段s,以便对时间序列片段更全面的表示:An illustration is given in the left part of Figure 1. Through data analysis, it can be seen that the salient features of SEEG activity of epileptic seizures are mainly reflected in the frequency and amplitude. Therefore, the present invention uses three indicators to describe each time series segment s inSk , so as to have a more comprehensive representation of the time series segment:
SLOPE(s)=max(|s1:l-s0:l-1|)SLOPE(s)=max(|s1:l -s0:l-1 |)
AMPLITUDE(s)=max(|s|)AMPLITUDE(s)=max(|s|)
INTENSITY(s)=cusp(s)×mean(|s1:l-s0:l-1|)INTENSITY(s)=cusp(s)×mean(|s1:l -s0:l-1 |)
其中,s1:l表示序列片段s中从1到l的数据切片,SLOPE(.)表示最大斜率计算,AMPLITUDE(.)表示最大绝对值幅度计算,cusp(.)表示尖点数计数,mean(.)表示均值计算,INTENSITY(.)表示强度计算。Among them, s1: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 value amplitude calculation, cusp(.) represents the cusp count, mean( .) indicates mean calculation and INTENSITY(.) indicates intensity calculation.
具体来说,SLOPE可以描述变化的速度和大脑信号波动的幅度,而AMPLITUDE可以描述时间序列偏离x轴的垂直距离。对这两个指标进行max运算,有助于消除噪声的影响,使表示更加鲁棒。此外,本发明还定义了时间序列段的INTENSITY,其中cusp计算了段中的尖点数,表示SEEG的变化速度,斜率的平均值描述了波动的大小。通过对脑电信号的分析,显然正常和癫痫发作活动在斜率、幅度和强度上存在差异,这三个描述性指标是合理的。Specifically, SLOPE can describe the speed of change and the magnitude of brain signal fluctuations, while AMPLITUDE can describe the vertical distance that a time series deviates from the x-axis. Performing the max operation on these two indicators helps to eliminate the influence of noise and make the representation more robust. In addition, the present invention also defines the INTENSITY of the time series segment, in which cusp calculates the number of cusps in the segment, representing the change speed of SEEG, and the average value of the slope describes the magnitude of the fluctuation. From the analysis of EEG signals, it is clear that there are differences in slope, amplitude and intensity between normal and seizure activity, and these three descriptive indicators are reasonable.
本发明可以得到第k个待检测段的增广数据Sk的特征向量如图2左上角所示的三个向量,其中,p表示Sk中的时间序列片段总数,*表示指标,包括斜率指标、幅度指标和强度指标。The present invention can obtain the feature vector of the augmented data Sk of the kth segment to be detected The three vectors shown in the upper left corner of Figure 2, where p represents the total number of time series segments inSk , and * represents indicators, including slope indicators, amplitude indicators, and intensity indicators.
然后对向量中的所有元素进行差分运算(如图1所示),得到一个差分矩阵:Then do a difference operation on all the elements in the vector (as shown in Figure 1) to get a difference matrix:
其中,表示第k个待检测段的增广数据中第i和j个时间序列片段的差分特征,表示第i个时间序列片段的特征,表示第j个时间序列片段的特征;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 feature of the i-th time series segment, represents the feature of the jth time series segment;
之后,在第三维上连接三个归一化后的差分矩阵,得到最终的合成差分矩阵After that, connect the three normalized difference matrices in the third dimension to get the final synthetic difference matrix
(二)局部上下文参考。(2) Local context reference.
如前所述,捕捉大脑活动变化是消除不同患者之间域偏移的关键。然而,一个特定的片段通常太短而无法包含丰富的神经活动。为此,本发明引入了局部上下文参考用于信号差分操作,以便将该片段的癫痫发作事件与其附近的正常背景活动进行比较。As mentioned earlier, capturing changes in brain activity is key to eliminating domain shifts between different patients. However, a given segment is often too short to contain rich neural activity. To this end, the present invention introduces local contextual references Used for signal differential operations to compare the seizure event of this segment to its nearby normal background activity.
具体来说,对于一个片段sk,定义其局部上下文参考为一个长度为2τ的连续的段序列,即由按时间顺序在sk之前和之后的相邻段组成(分别表示和每个包含τ个段)。得到:Specifically, for a fragmentsk , define its local context reference is a continuous segment sequence of length 2τ, that is, it consists of adjacent segments before and aftersk in time order (respectively denoted by and Each contains τ segments). get:
在实践中,局部的上下文参考是有效的,特别是对于短期癫痫发作,通过捕捉在短时间内发生的神经活动变化。In practice, local contextual references are effective, especially for short-term seizures, by capturing changes in neural activity that occur over a short period of time.
(三)最近正常波形参考。(3) The most recent normal waveform reference.
不同患者的癫痫发作持续时间差异很大,但同一个患者的癫痫发作持续时间并不相同,这种变化会阻碍癫痫发作的检测。对于作为检测目标的中间部分,没有正常的波形进行比较,因为癫痫发作事件占据了它的整个上下文参考。上述的局部上下文参考只能捕捉到相邻段之间的过渡变化,癫痫发作段将与正常段无法区分。为了解决这个问题,本发明引入了附近的正常参考,即被归类为正常的段,以保证始终有正常的事件用于进行差分运算的比较。Seizure duration varies widely from patient to patient, but within the same patient, this variability can hinder seizure detection. For the middle part, which is the target of detection, there is no normal waveform to compare because the seizure event occupies its entire contextual reference. The local context reference described above can only capture transitional changes between adjacent segments, and seizure segments will be indistinguishable from normal segments. 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 is always a normal event for the comparison of the difference operation.
附近的正常参考构建过程的细节在图2中描述。给定第t次迭代更新中B个合成差分矩阵,B表示批次大小,首先将其输入模型并得到检测结果表示第B个片段的检测结果。本实施例中,用于获取检测结果的模型由CNN编码器和分类器构成。Details of the nearby normal reference building process are depicted in Figure 2. Given B synthetic difference matrices in the t-th iteration update, where B represents the batch size, first input it into the model and get the detection result Indicates the detection result of the B-th fragment. In this embodiment, it is used to obtain the detection result The model consists of a CNN encoder and a classifier.
然后应用过滤器筛选出被分类为正常的片段,构成一组片段集合用于更新附近的正常参考。此处值得注意的是,在癫痫发作之前有一个pre-ictal的演化过程,在这个过程中大脑活动会逐渐接近癫痫发作模式,但在临床上被视为正常。考虑到直接将视为正常参考将引入pre-ictal模式并导致正常和癫痫事件之间的比较较弱,本发明引入动量更新策略,使用更新率参数α来更新附近的正常参考以便获得更鲁棒的结果,如下所示:Then apply a filter to filter out the fragments that are classified as normal to form a set of fragments Used to update nearby normal references. It is worth noting here that there is a pre-ictal evolutionary process preceding epileptic seizures, during which brain activity gradually approaches a seizure pattern, but is clinically considered normal. considering the direct Considering that the normal reference will introduce a pre-ictal pattern and lead to weaker comparisons between normal and epileptic events, the present invention introduces a momentum update strategy that uses the update rate parameter α to update nearby normal references for more robust results as follows:
其中,len(·)表示片段集合中的数量,是预设的阈值。where len( ) represents the number of fragments in the collection, is the preset threshold.
之后,在正常参考记忆中更新以进行下一次迭代。在进行差分时,将Rnn分成两个相等的部分(即Rnn1和Rnn2),并将它们连接到具有局部上下文的段序列的前后两侧参考,以补偿正常的背景脑电活动。after, Update in normal reference memory for next iteration. When differencing, Rnn was split into two equal parts (i.e.,Rnn1 andRnn2 ) and connected to the anterior-posterior reference of the segment sequence with local context to compensate for normal background EEG activity.
(四)全局近似发作波形参考。(4) Global approximate seizure waveform reference.
在许多情况下,神经活动振荡也发生在正常事件中,因此难以区分不同患者的癫痫发作和正常事件。图4给出了一个直观的例子,其中来自不同患者的癫痫发作和正常波与大脑活动模式非常相似,导致它们对应的差异矩阵变得无法区分。此外,这种现象也发生在同一患者身上。这个问题是由于差分矩阵是仅仅基于局部信息构建的。尽管神经活动振荡引起了类似的局部上下文变化,但从同一通道内的全局角度来看,癫痫发作和正常活动之间仍然存在一些只有轻微的信号差异(例如,幅度、频率等)。In many cases, oscillations in neural activity also occur during normal events, making it difficult to distinguish between seizures and normal events in different patients. Figure 4 presents an intuitive example where seizure and normal waves from different patients are so similar to brain activity patterns that their corresponding difference matrices become indistinguishable. Furthermore, this phenomenon also occurred in the same patient. This problem is due to the fact that the difference matrix is constructed based on local information only. Although neural activity oscillations caused similar local contextual changes, there were still some only slight signal differences (e.g., amplitude, frequency, etc.) between seizures and normal activity from a global perspective within the same channel.
为了解决上述问题,本发明引入了全局近似发作波形参考作为标准发作模式(SSP)来表示发作的全局特征,借助它可以更好地将癫痫波与神经活动振荡的正常事件区分开来。图3展示了全局癫痫样参考的细节。请注意,SSP不一定由所有癫痫发作波组成,是一个具有全球最具代表性的癫痫样发作模式。受这个想法的启发,本发明分别根据幅度、斜率和强度的指标并分别对同一通道中的所有段对应的指标进行排序。对于每个指标,将最大的前Γ片段作为相应通道中最具代表性的癫痫样片段的候选集并将三个集合合并为其中*∈{slope,amplitude,intensity}表示指标,Γ∈(0,m-1]是可调整的设置大小,m是当前通道的总片段数。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 features of seizures, with which the epileptic waves can be better distinguished from normal events of neural activity oscillations. Figure 3 shows the details of the global epileptiform reference. Note that the SSP does not necessarily consist of all seizure waves and is the most representative epileptiform seizure pattern globally. Inspired by this idea, the present invention sorts the indices corresponding to all segments in the same channel according to the indices of amplitude, slope and intensity, respectively. For each metric, the largest pre-Γ segment was taken as the candidate set for the most representative epileptiform segment in the corresponding channel and merge the three sets into where *∈{slope,amplitude,intensity} denotes the metric, Γ∈(0, m-1] is the adjustable set size, and m is the total number of fragments for the current channel.
考虑到Sgs中具有代表性的癫痫样片段也将是高度可变的,直接对其进行差分运算将不可避免地导致检测的假阴性。例如,具有最大斜率的癫痫样发作可能会与具有较小斜率的目标发作波形产生巨大差异,从而导致将目标检测为正常的错误结果。为了将SSP的方差保持在有限范围内,本发明选择与检测片段及其局部上下文参考最相似的癫痫样片段作为全局近似发作波形参考Rgs。Considering that the representative epileptiform segments in Sgs will also be highly variable, directly differencing them will inevitably lead to false negatives of detection. For example, an epileptiform seizure with the largest slope can be significantly different from a target seizure waveform with a smaller slope, leading to false results in detecting the target as normal. In order to keep the variance of the SSP within a limited range, the present invention selects the epileptiform segment most similar to the detection segment and its local context reference as the global approximate seizure waveform reference Rgs .
具体来说,本发明将检测片段sk及其前后的局部上下文参考分成两等份,并计算三个指标上的对应值,记为和Specifically, the present invention divides the detection segmentsk and the local context references before and after it into two equal parts, and calculates the corresponding values on the three indicators, denoted as and
然后选择Sgs中的候选,其中指标值最接近和作为全局类似癫痫参考:Then select candidates in Sgs , where the index value closest and As a global similar epilepsy reference:
其中,和是检测片段sk的全局类似癫痫参考,它们将连接到具有局部上下文和附近的片段序列的后侧和前侧正常参考,从而提供全局SSP信息。in, and are global epilepsy-like references for detection segmentssk , which will be connected to posterior and anterior normal references with local context and nearby segment sequences, thus providing global SSP information.
(五)差分矩阵编码器。(5) Differential matrix encoder.
执行差分运算后,根据每个检测段的三个指标得到三个差分矩阵将这三个差分矩阵进行归一化处理并合并为一个合成差分矩阵(SDM),记为本实施例中,采用CNN卷积神经网络作为编码器来学习构建的SDM表示以进行最终分类。After the difference operation is performed, three difference matrices are obtained according to the three indicators of each detection segment The three difference matrices are normalized and combined into a synthetic 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.
不可避免地,SDM值的范围因患者而异,这使得编码器很难学习不同患者的一般表示。因此,需要对SDM进行归一化。为了保留矩阵和神经活动信息的相对比例,本发明提出了有符号的最小-最大归一化,它在SDM上实现了最小-最大归一化,同时保持了符号值。在将SDM输入CNN模型之前执行归一化(如图1所示)。Inevitably, the range of SDM values varies from patient to patient, which makes it difficult for the encoder to learn general representations for different patients. Therefore, SDM needs to be normalized. In order to preserve the relative scale of matrix and neural activity information, the present invention proposes signed min-max normalization, which implements min-max normalization on SDM while preserving signed values. Normalization is performed before feeding the SDM into the CNN model (as shown in Figure 1).
本步骤中,首先,将每个值的符号保存为矩阵Lk。其次,取绝对值后,对三个差分矩阵中的每一个进行最小-最大归一化。最后,使用矩阵Lk来恢复差分矩阵的正负性,该实现过程可以表示为:In this step, first, the sign of each value is stored as a matrix Lk . Second, after taking the absolute value, min-max normalization is performed on each of the three difference matrices. Finally, using the matrix Lk to restore the positive and negative of the difference matrix, the realization process can be expressed as:
其中,表示符号矩阵,Nmin-max表示最小-最大归一化,表示归一化后的差分矩阵。in, represents the symbolic matrix, Nmin-max represents the min-max normalization, represents the normalized difference matrix.
自然地,三个指标(斜率、幅度、强度)在癫痫检测任务中扮演着不同的角色,本发明还可以采用了注意力机制来模拟基于不同指标的差分矩阵的重要性,从而实现自适应特征图融合。具体来说,通过计算不同指标的的重要性系数α,并对其加权以获得更有效的合成差分矩阵。在编码器中进行表示学习后,输入分类器,得到每一个待检测段是否是癫痫发作。Naturally, the three indicators (slope, amplitude, intensity) play different roles in the epilepsy detection task, and the present invention can also use an attention mechanism to simulate the importance of difference matrices based on different indicators, so as to achieve adaptive features Image fusion. Specifically, by calculating the , and weight it to obtain a more efficient synthetic difference matrix. After representation learning in the encoder, it is input to the classifier to get whether each segment to be detected is an epileptic seizure.
在本发明的一项具体实施中,基于差分矩阵的跨患者的癫痫波检测方法包括:In a specific implementation of the present invention, the method for detecting epilepsy waves across patients based on difference matrix includes:
步骤1,获取待检测片段的原始脑电信号数据,并在检测片段的前后两侧拼接局部上下文参考、正常波形参考和全局近似发作波形参考,构建待检测片段的增广数据;
本步骤中,重点在于获取待检测片段的三种参考并拼接在待检测片段的前后两侧,得到待检测片段的增广数据:In this step, the key point is to obtain three kinds of references of the segment to be detected and spliced on the front and rear sides of the segment to be detected to obtain the augmented data of the segment to be detected:
其中,sk是第k个待检测段的原始数据,||是连接操作,表示待检测片段sk的局部上下文参考,和表示连接到sk的前后侧的参考子集;表示待检测片段sk的正常波形参考,表示连接到的前后侧的参考子集;表示待检测片段sk的全局近似发作波形参考,表示连接到的前后侧的参考子集,Sk表示第k个待检测段的增广数据,所述的增广数据中包括了若干个时间序列片段s。Among them,sk is the original data of the k-th segment to be detected, || is the join operation, represents the local context reference of the segmentsk to be detected, and represents the reference subset connected to the front and rear sides ofsk ; represents the normal waveform reference of the segmentsk to be detected, means connected to A reference subset of the anterior and posterior sides of ; represents the global approximate seizure waveform reference of the segmentsk to be detected, means connected to The reference subset on the front and back sides of , Sk represents the augmented data of the k-th segment to be detected, and the augmented data includes several time series segments s.
具体的,包括以下步骤:Specifically, it includes the following steps:
步骤1.1,获取局部上下文参考:Step 1.1, get the local context reference:
在待检测片段sk的前后各选取一个长度为τ的连续的段序列,表示为:A continuous segment sequence of length τ is selected before and after the segmentsk to be detected, which is expressed as:
其中,表示待检测片段sk的局部上下文参考,表示待检测片段sk的局部上文参考,表示待检测片段sk的局部下文参考,sk-τ表示待检测片段sk之前τ步长的片段,sk+τ表示待检测片段sk之后τ步长的片段;in, represents the local context reference of the segmentsk to be detected, represents the partial above reference of the segmentsk to be detected, Represents the local context reference of the segmentsk to be detected,sk-τ represents the segment of τ steps before the segmentsk to be detected, andsk+τ represents the segment of τ steps after the segmentsk to be detected;
将和分别拼接在待检测片段sk的前后两侧。Will and They are spliced on the front and rear sides of the segmentsk to be detected, respectively.
步骤1.2,获取正常波形参考:Step 1.2, get normal waveform reference:
在执行对待检测片段的合成差分矩阵进行迭代编码的过程中,初始迭代时,获取若干片段作为候选片段,并将其拼接在待检测片段sk的两侧,针对初始编码过程,对编码结果进行分类,选取分类结果为正常的合成差分矩阵对应的候选片段集合将候选片段集合分成两个相等的部分,拼接在局部上下文参考的前后两侧;In the process of iterative encoding of the composite difference matrix of the segment to be detected, at the initial iteration, several segments are obtained as candidate segments, and spliced on both sides of the segment to be detectedsk , and the encoding results are processed for the initial encoding process. Classification, select the candidate segment set corresponding to the normal synthetic difference matrix with the classification result Collect candidate fragments Divided into two equal parts, spliced on the front and back sides of the local context reference;
之后,在执行对待检测片段的合成差分矩阵进行第t次迭代编码的过程中,根据第t-1次迭代生成的待检测片段的增广数据的合成差分矩阵进行编码和分类,选取分类结果为正常的合成差分矩阵对应的候选片段集合对候选片段集台进行动量更新:After that, in the process of performing the t-th iteration encoding on the synthetic difference matrix of the segment to be detected, encoding and classification are performed according to the synthetic difference matrix of the augmented data of the segment to be detected generated by the t-1 iteration, and the classification result is selected as: The candidate segment set corresponding to the normal synthetic difference matrix candidate segment set Do a momentum update:
其中,len(·)表示集合中的片段数量,是预设的阈值,α为更新率参数;将经动量更新后得到的候选片段集合作为正常波形参考并分成两个相等的部分,拼接在局部上下文参考的前后两侧,用于进行下一次迭代。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 the momentum update As a normal waveform reference and divided into two equal parts, spliced on the front and back sides of the local context reference for the next iteration.
步骤1.3,获取全局近似发作波形参考:Step 1.3, obtain global approximate seizure waveform reference:
初始化若干片段,计算各片段不同指标的特征,选取各指标下最大的前Γ片段作为全局近似发作波形参考候选片段集合;Initialize several segments, calculate the characteristics of different indicators of each segment, and select the largest front Γ segment under each indicator as the global approximate seizure waveform reference candidate segment set;
将检测片段sk及其局部上下文参考分成两等份,并计算各指标上的对应值,记为和Divide the detection segmentsk and its local context reference into two equal parts, and calculate the corresponding value on each index, denoted as and
从全局近似发作波形参考候选片段集合中选取指标值最接近和的片段作为全局近似发作波形参考:Select the index value closest to the global approximate seizure waveform reference candidate segment set and Snippet as a global approximate seizure waveform reference:
其中,是检测片段sk的全局近似发作波形参考,分别拼接在正常波形参考的前后两侧,Sgs(i)表示全局近似发作波形参考候选片段集合中的第i个片段,*={slope,amplitude,intensity}分别表示斜率指标、幅度指标和强度指标。in, is the global approximate seizure waveform reference for detection segmentsk , Spliced on the front and back sides of the normal waveform reference, Sgs (i) represents the ith segment in the global approximate seizure waveform reference candidate segment set, *={slope, amplitude, intensity} represents the slope index, amplitude index and intensity, respectively index.
步骤2,提取增广数据的不同指标的特征,构成不同指标的差分矩阵,将所述的不同指标的差分矩阵拼接,得到待检测片段的合成差分矩阵;所述的不同指标包括斜率指标、幅度指标和强度指标;Step 2, extracting features of different indexes of the augmented data to form difference matrices of different indexes, and splicing the difference matrices of different indexes to obtain a composite difference matrix of the segment to be detected; the different indexes include slope indexes, amplitudes indicators and strength indicators;
本步骤的实现方式可以为:The implementation of this step can be as follows:
步骤2.1,提取增广数据的不同指标的特征可参考上述第一部分“(一)差分矩阵的构建”介绍的公式,得到增广数据中所有时间序列片段s的各指标特征记为分别表示斜率指标、幅度指标和强度指标;Step 2.1, to extract the characteristics of different indicators of the augmented data, refer to the formula introduced in the above-mentioned first part "(1) Construction of the difference matrix", and obtain the characteristics of each indicator of all the time series segments s in the augmented data, which are recorded as: respectively represent the slope index, the amplitude index and the strength index;
步骤2.2,对各指标特征的所有元素进行差分运算,得到各指标下的差分矩阵:Step 2.2, perform differential operation on all elements of each index feature to obtain the difference matrix under each index:
其中,表示第k个待检测段的增广数据中第i和j个时间序列片段的差分特征,表示第i个时间序列片段的特征,表示第j个时间序列片段的特征,p表示Sk中的时间序列片段总数;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 feature of the i-th time series segment, represents the feature of the jth time series segment, and p represents the total number of time series segments inSk ;
步骤2.3,对各指标下的差分矩阵进行归一化处理:Step 2.3, normalize the difference matrix under each index:
其中,表示符号矩阵,Nmin-max表示最小-最大归一化,表示归一化后的差分矩阵;in, represents the symbolic matrix, Nmin-max represents the min-max normalization, represents the normalized difference matrix;
步骤2.4,对各指标下归一化后的差分矩阵进行拼接,得到待检测片段sk对应的合成差分矩阵Step 2.4, splicing the normalized difference matrix under each index to obtain the synthetic difference matrix corresponding to the segmentsk to be detected
此外,在对归一化后的差分矩阵进行拼接之前,还可以包括获取不同指标的归一化后的差分矩阵的重要性系数的过程,根据重要性系数对不同指标的归一化后的差分矩阵进行加权后再进行拼接。In addition, before splicing the normalized difference matrix, it may also include obtaining the normalized difference matrix of different indicators The process of the importance coefficient, the difference matrix after normalization of different indicators according to the importance coefficient After weighting, stitching is performed.
步骤3,对待检测片段的合成差分矩阵进行迭代编码,对编码结果进行分类,得到待检测段是否是癫痫发作的检测结果。Step 3: Iteratively encode the composite difference matrix of the segment to be detected, classify the encoding result, and obtain a detection result of whether the segment to be detected is an epileptic seizure.
在本实施例中还提供了一种基于差分矩阵的跨患者的癫痫波检测系统,该系统用于实现上述实施例,已经进行过说明的不再赘述。以下所使用的术语“模块”、“单元”等可以实现预定功能的软件和/或硬件的组合。尽管在以下实施例中所描述的系统较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能的。This embodiment also provides a differential matrix-based cross-patient epilepsy wave detection system, which is used to implement the above embodiments, and what has been described will not be repeated here. The terms 'module', 'unit', etc. used below may be a combination of software and/or hardware that implements a predetermined function. Although the systems described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware, are also possible.
所述的系统包括:The system includes:
局部上下文参考模块,其用于获取检测片段的局部上下文参考;a local context reference module, which is used to obtain the local context reference of the detection segment;
正常波形参考模块,其用于获取检测片段的正常波形参考;a normal waveform reference module, which is used to obtain the normal waveform reference of the detection segment;
全局近似发作波形参考模块,其用于获取检测片段的全局近似发作波形参考;a global approximate seizure waveform reference module, which is used to obtain the global approximate seizure waveform reference of the detected segment;
差分矩阵构建模块,其用于将局部上下文参考、正常波形参考、全局近似发作波形参考依次拼接在检测片段的前后两侧,得到检测片段的增广数据;以及用于提取增广数据的不同指标的特征,构成不同指标的差分矩阵,将所述的不同指标的差分矩阵拼接,得到待检测片段的合成差分矩阵;所述的不同指标包括斜率指标、幅度指标和强度指标;A differential matrix building module, which is used to sequentially 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 obtain the augmented data of the detection segment; and different indicators for extracting the augmented data The characteristics of the different indexes constitute the difference matrix of different indexes, and the difference matrices of the different indexes are spliced to obtain the composite difference matrix of the segment to be detected; the different indexes include a slope index, an amplitude index and an intensity index;
差分矩阵编码器模块,其用于对待检测片段的合成差分矩阵进行迭代编码;a differential matrix encoder module, which is used to iteratively encode the composite differential matrix of the segment to be detected;
分类器模块,其用于对编码结果进行分类,得到待检测段是否是癫痫发作的检测结果。The classifier module is used for classifying the coding result to obtain the detection result of whether the segment to be detected is an epileptic seizure.
上述系统中各个模块的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。对于系统实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的系统实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本发明方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。本发明实施例还提供一种计算机可读存储介质,其上存储有程序,该程序被处理器执行时,实现上述的一种基于差分矩阵的跨患者的癫痫波检测方法。For details of the implementation process of the functions and functions of each module in the above system, please refer to the implementation process of the corresponding steps in the above method, which will not be repeated here. For the system embodiment, since it basically corresponds to the method embodiment, reference may be made to the partial description of the method embodiment for related parts. The system embodiments described above are merely illustrative, wherein the modules described as separate components may or may not be physically separated, that is, may be located in one place, or may 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 effort. Embodiments of the present invention further provide a computer-readable storage medium on which a program is stored, and when the program is executed by a processor, implements the above-mentioned method for detecting epilepsy waves across patients based on a difference matrix.
所述计算机可读存储介质可以是前述任一实施例所述的任意具备数据处理能力的设备的内部存储单元,例如硬盘或内存。所述计算机可读存储介质也可以是任意具备数据处理能力的设备的外部存储设备,例如所述设备上配备的插接式硬盘、智能存储卡(Smart Media Card,SMC)、SD卡、闪存卡(Flash Card)等。进一步的,所述计算机可读存储介质还可以既包括任意具备数据处理能力的设备的内部存储单元也包括外部存储设备。所述计算机可读存储介质用于存储所述计算机程序以及所述任意具备数据处理能力的设备所需的其他程序和数据,还可以用于暂时地存储已经输出或者将要输出的数据。The computer-readable storage medium may be an internal storage unit of any device with data processing capability described in any of the foregoing embodiments, such as a hard disk or a memory. The computer-readable storage medium can also be an external storage device of any device with data processing capabilities, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), an SD card, a flash memory card equipped on the device (Flash Card) etc. Further, the computer-readable storage medium may also include both an internal storage unit of any device with data processing capability and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the device with data processing capability, and can also be used to temporarily store data that has been output or will be output.
本实施例通过一项具体是实验来验证本发明的实施效果。This embodiment verifies the implementation effect of the present invention through a specific experiment.
(1)数据采集。(1) Data collection.
本次实验中使用的SEEG数据集由一家三甲医院提供并授权使用,包含了5个患者的SEEG记录数据。为了满足诊断的需求,对于每个难治性的患者将会植入4到10个深度电极,其中每个电极有52到126个通道,用于记录患者的脑电信号。SEEG记录通过诊断记录系统降采样至512-1024Hz。特别地,由于对于某个确定的患者来说,他的SEEG数据规模大、采样频率非常高并且含有多个通道,这个数据集非常大,超过了150个小时并且数据量远大于100GB。The SEEG dataset used in this experiment was provided and licensed by a tertiary hospital, including SEEG recording data of 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, which are used to record the patient's EEG signals. SEEG recordings were downsampled to 512-1024 Hz by a diagnostic recording system. In particular, due to the large scale, high sampling frequency and multiple channels of SEEG data for a certain patient, this data set is very large, exceeding 150 hours and the data volume is much larger than 100GB.
(2)数据预处理。(2) Data preprocessing.
为了提高评估模型的效率,本次实验对SEEG记录数据降采样至256Hz,并且将这些连续的数据分割成1445856个段,每个段含有100个点。所有的段都经过了专业的医师进行标注,癫痫发作段的数量占总段数的比例大致是0.0004,表明了这个数据集的标签是非常不平衡的。所以本次实验采用查准率、召回率和F-measures来对比本发明的模型与现有技术的模型的效果。In order to improve the efficiency of evaluating the model, this experiment downsampled the SEEG recording data to 256Hz, and divided these continuous data into 1445856 segments, each segment contains 100 points. All segments have been labeled by professional physicians, and the ratio of the number of epileptic segments to the total number of segments is roughly 0.0004, indicating that the labels of this dataset are very unbalanced. Therefore, in this experiment, the precision, recall and F-measures are used to compare the effects of the model of the present invention and the model of the prior art.
(3)对比实验。(3) Comparative experiments.
为了全面验证本发明模型的有效性,本次实验将其与几种不同类型的基线模型进行了比较,分为单个患者的癫痫波检测和跨患者的癫痫波检测。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, divided into epileptic wave detection for a single patient and epileptic wave detection across patients.
单个患者的癫痫波检测。将会在单个患者下进行训练和测试。特别地,对于每个患者,随机地按5:1:4划分数据集为训练验证和测试集,与本发明模型进行对比的基线模型包括:Epilepsy wave detection in a single patient. Training and testing will be performed on a single patient. In particular, for each patient, the data set is randomly divided into training validation and test sets by 5:1:4, and the baseline model compared with the model of the present invention includes:
基于机器学习的方法:将线性判别分析(LDA[Balakrishnama 1998])和支持向量机(SVM[Zhang 2012])作为分类器,输入的数据是将脑电波段转换为功率频谱图(PSD),然后进行分类。Machine learning based methods: Linear discriminant analysis (LDA [Balakrishnama 1998]) and support vector machine (SVM [Zhang 2012]) are used as classifiers, the input data is to convert EEG bands into power spectrograms (PSD), and then sort.
基于卷积神经网络的方法:这种方法使用卷积神经网络作为特征提取器进行癫痫波检测。更确切地说,使用短时傅里叶变换将检测段转换为2D的频谱图,然后输入至经典的卷积神经网络中进行分类,如Resnet[He 2015]、Xception[Chollet 2016]和Densenet[Huang 2016]。Convolutional Neural Network-Based Methods: This method uses a convolutional neural network as a feature extractor for epilepsy wave detection. More precisely, short-time Fourier transform is used to convert detection segments into 2D spectrograms, which are then fed into classical convolutional neural networks for classification, such as Resnet [He 2015], Xception [Chollet 2016] and Densenet [ Huang 2016].
基于时间分类的方法:包含了最先进的方法如:LSTM-FCN[Karim 2017]、STSF[Cabello2020]、TCN[Bai 2018]和MiniRocket[Dempster 2020],它们能直接输入时间序列片段进行分类。Temporal classification-based methods: Contains 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 segments for classification.
测试结果如表1所示。The test results are shown in Table 1.
表1单个患者的癫痫波检测的平均结果Table 1 Average results of epileptic wave detection for a single patient
从表1可见,本发明的模型对于经典的机器学习算法、效果惊人的时间序列分类算法和经典的图像分类算法,都有着很好的效果,特别是对于F2指标,本发明的算法相对于最好的基线算法Densenet有着4.93%的提升。可以说明虽然单个患者相比于多个患者的信息量会少许多,但是算法能够更加精确地捕获癫痫波的发作模式以及与普通波形的区别,从而有着更好的效果。As can be seen from Table 1, the model of the present invention has a very good effect on the classical machine learning algorithm, the time series classification algorithm with amazing effect and the classical image classification algorithm, especially for the F2 index, the algorithm of the present invention is better than the most The good baseline algorithm Densenet has a 4.93% improvement. It can be shown 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 seizure pattern of epileptic waves and the difference from ordinary waveforms, so that it has better results.
跨患者的癫痫波检测。对于需要进行癫痫检测的患者,把这个患者的数据当作目标域,其它所有的患者的标签和数据当作源域用于模型的训练和验证,与本发明模型进行对比的基线模型包括:Epilepsy wave detection across patients. For a patient who needs epilepsy detection, the data of this patient is regarded as the target domain, and the labels and data of all other patients are regarded as the source domain for model training and verification. The baseline model compared with the model of the present invention includes:
SICR[Jeon 2019]:这个算法通过学习类别相关和患者不变的特征,在非侵入式脑机接口领域有着很好的效果。SICR [Jeon 2019]: This algorithm works well in the field of non-invasive brain-computer interfaces by learning category-dependent and patient-invariant features.
MTL[Blanchard 2021]:这是领域泛化的代表性工作,利用原始特征空间被增强以包括产生特征的边际分布,因为它反映了这样一个事实,即在领域泛化中,有关测试任务的信息必须从该任务的边缘特征分布中获取。MTL [Blanchard 2021]: This is a representative work of domain generalization, with the original feature space augmented to include marginal distributions of generated features, as it reflects the fact that, in domain generalization, information about the test task is It must be obtained from the marginal feature distribution for this task.
SD[Pezeshki 2020]:它通过引入一个新的正则化项,旨在解耦特征学习动态的模型,在受到梯度饥饿阻碍的情况下提高鲁棒性。SD [Pezeshki 2020]: It improves robustness when hindered by gradient starvation by introducing a new regularization term that aims to decouple the model from feature learning dynamics.
Fishr[Rame 2021]:它通过引入一个正则化项,来增强损失梯度空间的域不变性,从而提高模型的泛化能力。Fishr [Rame 2021]: It enhances the domain invariance of the loss gradient space by introducing a regularization term, thereby improving the generalization ability of the model.
TRM[Xu 2021]:它通过引入一个评估标准,专门用于优化算法向新的数据进行迁移。TRM [Xu 2021]: It introduces an evaluation criterion specifically for the optimization algorithm to migrate to new data.
IB-ERM[Ahuja 2021]:它是一种通过最小化多个域的经验风险来提高泛化的方法。IB-ERM [Ahuja 2021]: It is a method to improve generalization by minimizing empirical risk across multiple domains.
CDANN[Li 2018]:它是一种用于领域不变表示学习的端到端领域泛化方法。CDANN [Li 2018]: It is an end-to-end domain generalization method for domain-invariant representation learning.
SelfReg[Kim 2021]:它是一种基于自监督对比正则化的域泛化方法。SelfReg [Kim 2021]: It is a domain generalization method based on self-supervised contrastive regularization.
MMD[Li 2018]:它是一个对抗式的自动编码器框架,用来学习跨领域的广义潜在特征表示。MMD [Li 2018]: It is an adversarial autoencoder framework to learn generalized latent feature representations across domains.
GroupDRO[Sagawa 2019]:它是一个结合分布鲁棒优化与正则化限制的模型,其中分布鲁棒优化允许学习模型,而不是在一组预定义的组上最小化最坏情况下的训练损失。GroupDRO [Sagawa 2019]: It is a model that combines distribution-robust optimization with regularization constraints, where distribution-robust optimization allows learning the model instead of minimizing the worst-case training loss over a predefined set of groups.
测试结果如表2所示。The test results are shown in Table 2.
表2跨患者的癫痫波检测的平均结果Table 2 Average results of epileptic wave detection across patients
从表2可见,本发明的算法优于其他基线算法,与最佳基线方法相比,F2的效果提高了18.65%。结果表明本发明的模型对交叉患者癫痫发作检测的有效性,揭示了差异性操作在捕获一般发作模式和消除区域偏移方面的巨大潜力。同时召回率(Recall)和查准率(Precision)的效果相比其它大部分的基线算法都要好,可以说明当前的算法能够在更精确的情况下,捕获更多的发作癫痫波,这也表明了大部分基于计算机视觉和自然语言处理领域的泛化迁移算法并不能直接应用在基于SEEG数据的癫痫检测场景下。It can be seen from Table 2 that the algorithm of the present invention is superior to other baseline algorithms, and the effect of F2 is improved by 18.65% compared with the best baseline method. The results demonstrate the effectiveness of the model of the present invention for seizure detection in crossed patients, revealing the great potential of differential manipulation in capturing general seizure patterns and eliminating regional shifts. At the same time, the recall rate and precision rate (Precision) are better than most other baseline algorithms, which shows that the current algorithm can capture more seizure waves with more precision, which also shows that However, most generalization transfer algorithms based on computer vision and natural language processing cannot be directly applied to epilepsy detection scenarios based on SEEG data.
(4)消融实验(4) Ablation experiment
本实施例进行消融实验以验证模型中每个主要模块的有效性。更具体地说,本发明从模型中删除了以下每个组件,以查看它们如何分别影响性能:This embodiment conducts ablation experiments 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 performance individually:
DMNet-NG:删除最近正常波形参考和全局近似发作波形参考,仅仅保留待检测段和局部上下文参考用于差分操作。DMNet-NG: Deletes the most recent normal waveform reference and the global approximate seizure waveform reference, and only retains the segment to be detected and the local context reference for differential operations.
DMNet-N:仅删除最近正常波形参考。DMNet-N: Remove only the nearest normal waveform reference.
DMNet-G:仅删除全局近似发作波形参考。DMNet-G: Remove only global approximate seizure waveform reference.
DMNet-AMMN:将带符号的最大-最小归一化替换为绝对值的最大-最小归一化。DMNet-AMMN: Replace signed max-min normalization with absolute max-min normalization.
测试结果如表3所示。The test results are shown in Table 3.
表3消融实验结果Table 3 Results of ablation experiments
从表3可见,DMNet的性能优于其他变体,其中没有两个参考的模型(DMNet-NG)的性能最差,证明了局部正常和全局捕获信息的必要性。这对于一般癫痫发作表征建模是至关重要的。DMNet+AMMN的性能较DMNet有所下降,表明DMNet中保留的符号信息也有助于一般发作模式的学习和检测。As can be seen from Table 3, DMNet outperforms other variants, with the model without two references (DMNet-NG) having the worst performance, proving the necessity of local normal and global capture of information. This is critical for modeling seizure representations in general. The performance of DMNet+AMMN is lower than that of DMNet, indicating that the retained symbolic information in DMNet also contributes to the learning and detection of general seizure patterns.
(5)案例研究(5) Case studies
为了研究差分矩阵如何反映癫痫发作演变过程中的神经活动变化,本发明可视化了一段SEEG记录以及采样检测段的三个指标上的相应差分矩阵。如图5所示,在癫痫发作演变过程中,癫痫发作和正常矩阵之间存在巨大差异。对于正常事件(例如,段a、b、c和i),差异矩阵往往是简单的,而癫痫事件的矩阵(例如,段d、e、f和g)中呈现出剧烈的神经变化。这个案例清楚地说明了差分矩阵如何捕捉神经活动的变化,并表明本发明提出的方法的有效性。In order to study how the difference matrix reflects the neural activity changes during the evolution of epileptic seizures, the present invention visualizes a section of SEEG recording and the corresponding difference matrix on three indicators of the sampling detection section. As shown in Figure 5, there is a large difference between the seizure and normal matrices during the evolution of the seizure. For normal events (eg, segments a, b, c, and i), the difference matrix tends to be simple, whereas matrices for epileptic events (eg, segments d, e, f, and g) exhibit drastic neural changes. This case clearly illustrates how the difference matrix captures changes in neural activity and demonstrates the effectiveness of the method proposed in the present invention.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对专利保护范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present application, and the descriptions thereof are relatively specific and detailed, but should not be construed as a limitation on the scope of patent protection. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the scope of protection of the present application should be determined by the appended claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210655871.1ACN114931362B (en) | 2022-06-10 | 2022-06-10 | Method, system and storage medium for epileptic wave detection across patients based on difference matrix |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210655871.1ACN114931362B (en) | 2022-06-10 | 2022-06-10 | Method, system and storage medium for epileptic wave detection across patients based on difference matrix |
| Publication Number | Publication Date |
|---|---|
| CN114931362Atrue CN114931362A (en) | 2022-08-23 |
| CN114931362B CN114931362B (en) | 2025-04-18 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210655871.1AActiveCN114931362B (en) | 2022-06-10 | 2022-06-10 | Method, system and storage medium for epileptic wave detection across patients based on difference matrix |
| Country | Link |
|---|---|
| CN (1) | CN114931362B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116712089A (en)* | 2023-07-26 | 2023-09-08 | 华南师范大学 | Methods to enrich epileptiform discharges between epileptic seizures and predict pathogenic lesions |
| CN117958777A (en)* | 2024-01-16 | 2024-05-03 | 中国科学院自动化研究所 | Non-invasive blood pressure detection system, method, electronic device and storage medium |
| CN118203334A (en)* | 2024-03-19 | 2024-06-18 | 中南大学 | A method and system for intelligent identification of multiple abnormal EEG patterns |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO1982003977A1 (en)* | 1981-05-15 | 1982-11-25 | Hosp Medical Center Childrens | Brain electrical activity mapping(beam) |
| US5311876A (en)* | 1992-11-18 | 1994-05-17 | The Johns Hopkins University | Automatic detection of seizures using electroencephalographic signals |
| US20180276822A1 (en)* | 2015-09-07 | 2018-09-27 | The Regents Of The University Of California | Ultra-dense electrode-based brain imaging system |
| AU2020103949A4 (en)* | 2020-12-08 | 2021-02-11 | Fudan University | EEG Signal Mixed Noise Processing Method, Equipment and Storage Medium |
| CN113842118A (en)* | 2021-12-01 | 2021-12-28 | 浙江大学 | Epileptic seizure real-time detection monitoring system for epileptic video electroencephalogram examination |
| WO2022016981A1 (en)* | 2020-07-24 | 2022-01-27 | 深圳市欢太科技有限公司 | Image processing methods and apparatus, storage medium, and electronic device |
| CN114569141A (en)* | 2022-03-07 | 2022-06-03 | 南京邮电大学 | Epilepsy prediction system based on feature channel fusion and deep learning |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO1982003977A1 (en)* | 1981-05-15 | 1982-11-25 | Hosp Medical Center Childrens | Brain electrical activity mapping(beam) |
| US5311876A (en)* | 1992-11-18 | 1994-05-17 | The Johns Hopkins University | Automatic detection of seizures using electroencephalographic signals |
| US20180276822A1 (en)* | 2015-09-07 | 2018-09-27 | The Regents Of The University Of California | Ultra-dense electrode-based brain imaging system |
| WO2022016981A1 (en)* | 2020-07-24 | 2022-01-27 | 深圳市欢太科技有限公司 | Image processing methods and apparatus, storage medium, and electronic device |
| AU2020103949A4 (en)* | 2020-12-08 | 2021-02-11 | Fudan University | EEG Signal Mixed Noise Processing Method, Equipment and Storage Medium |
| CN113842118A (en)* | 2021-12-01 | 2021-12-28 | 浙江大学 | Epileptic seizure real-time detection monitoring system for epileptic video electroencephalogram examination |
| CN114569141A (en)* | 2022-03-07 | 2022-06-03 | 南京邮电大学 | Epilepsy prediction system based on feature channel fusion and deep learning |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116712089A (en)* | 2023-07-26 | 2023-09-08 | 华南师范大学 | Methods to enrich epileptiform discharges between epileptic seizures and predict pathogenic lesions |
| CN116712089B (en)* | 2023-07-26 | 2024-03-22 | 华南师范大学 | Methods to enrich epileptiform discharges between epileptic seizures and predict pathogenic lesions |
| CN117958777A (en)* | 2024-01-16 | 2024-05-03 | 中国科学院自动化研究所 | Non-invasive blood pressure detection system, method, electronic device and storage medium |
| CN118203334A (en)* | 2024-03-19 | 2024-06-18 | 中南大学 | A method and system for intelligent identification of multiple abnormal EEG patterns |
| Publication number | Publication date |
|---|---|
| CN114931362B (en) | 2025-04-18 |
| Publication | Publication Date | Title |
|---|---|---|
| Burrello et al. | Hyperdimensional computing with local binary patterns: One-shot learning of seizure onset and identification of ictogenic brain regions using short-time iEEG recordings | |
| CN114931362B (en) | Method, system and storage medium for epileptic wave detection across patients based on difference matrix | |
| CH716863B1 (en) | Method for building a depression detection classification model based on channel selection of multichannel electroencephalography. | |
| Huang et al. | Automatic epileptic seizure detection via attention-based CNN-BiRNN | |
| Jiang et al. | Sleep stage classification using covariance features of multi-channel physiological signals on Riemannian manifolds | |
| CN115054266B (en) | A neural signal processing method, device, equipment and storage medium | |
| Goen | Classification of EMG signals for assessment of neuromuscular disorders | |
| Song et al. | Optimization of epilepsy detection method based on dynamic EEG channel screening | |
| Ali et al. | Epileptic seizure detection using CHB-MIT dataset: The overlooked perspectives | |
| CN116584893A (en) | Epileptic signal detection method based on channel selection time convolution network | |
| Paisarnsrisomsuk et al. | Improved deep learning classification of human sleep stages | |
| Zhao et al. | Seizure onset zone classification based on imbalanced iEEG with data augmentation | |
| Liu et al. | Automated Machine Learning for Epileptic Seizure Detection Based on EEG Signals. | |
| Ulhaq et al. | Epilepsy seizures classification with EEG signals: A machine learning approach | |
| CN119564205B (en) | A depressive disorder recognition system based on multimodal domain adaptation | |
| Zhou et al. | A new method based on CEEMD combined with iterative feature reduction for aided diagnosis of epileptic EEG | |
| Giri et al. | Combining generative and discriminative neural networks for sleep stages classification | |
| Kosar et al. | Classification of long-term EEG recordings | |
| Rasheed et al. | Adaptive certainty-based classification for decomposition of EMG signals | |
| Pawar et al. | Diagnosis and classification of epileptic seizure a neurological disorder using electroencephalography | |
| CN115486858A (en) | Self-adaptive brain area electroencephalogram artifact detection method based on multi-classifier fusion | |
| Rakshit et al. | Assessing ambiguity of spike detection by thresholding | |
| El Saadi et al. | Informed under-sampling for enhancing patient specific epileptic seizure detection | |
| Vasil’eva et al. | Long-term recording of single neurons and criteria for assessment | |
| Hussein | Scalp and intracranial EEG quantitative analysis: robust detection and prediction of epileptic seizures |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| TA01 | Transfer of patent application right | Effective date of registration:20221026 Address after:310058 Yuhang Tang Road, Xihu District, Hangzhou, Zhejiang 866 Applicant after:ZHEJIANG University Applicant after:Noel Industry University Research Technology (Guangzhou) Co.,Ltd. Address before:310058 Yuhang Tang Road, Xihu District, Hangzhou, Zhejiang 866 Applicant before:ZHEJIANG University | |
| TA01 | Transfer of patent application right | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |