[go: up one dir, main page]

CN117122288B - Epilepsy EEG signal early warning method and device based on anchored convolutional network - Google Patents

Epilepsy EEG signal early warning method and device based on anchored convolutional network Download PDF

Info

Publication number
CN117122288B
CN117122288B CN202311158706.6A CN202311158706A CN117122288B CN 117122288 B CN117122288 B CN 117122288B CN 202311158706 A CN202311158706 A CN 202311158706A CN 117122288 B CN117122288 B CN 117122288B
Authority
CN
China
Prior art keywords
data
model
convolutional network
anchored
acn
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311158706.6A
Other languages
Chinese (zh)
Other versions
CN117122288A (en
Inventor
王彬
饶宋辉
牛焱
相洁
李丹丹
李颖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Taiyuan University of Technology
Original Assignee
Taiyuan University of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Taiyuan University of Technology filed Critical Taiyuan University of Technology
Priority to CN202311158706.6A priority Critical patent/CN117122288B/en
Publication of CN117122288A publication Critical patent/CN117122288A/en
Application granted granted Critical
Publication of CN117122288B publication Critical patent/CN117122288B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/40Detecting, measuring or recording for evaluating the nervous system
    • A61B5/4076Diagnosing or monitoring particular conditions of the nervous system
    • A61B5/4094Diagnosing or monitoring seizure diseases, e.g. epilepsy
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/369Electroencephalography [EEG]
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/369Electroencephalography [EEG]
    • A61B5/372Analysis of electroencephalograms
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7235Details of waveform analysis
    • A61B5/7264Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems
    • A61B5/7267Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems involving training the classification device
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/74Details of notification to user or communication with user or patient; User input means
    • A61B5/746Alarms related to a physiological condition, e.g. details of setting alarm thresholds or avoiding false alarms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent

Landscapes

  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Biomedical Technology (AREA)
  • Surgery (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Artificial Intelligence (AREA)
  • Medical Informatics (AREA)
  • Pathology (AREA)
  • Veterinary Medicine (AREA)
  • Public Health (AREA)
  • Animal Behavior & Ethology (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Evolutionary Computation (AREA)
  • Neurology (AREA)
  • Physiology (AREA)
  • Psychiatry (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Psychology (AREA)
  • Computational Linguistics (AREA)
  • Neurosurgery (AREA)
  • Signal Processing (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Fuzzy Systems (AREA)
  • Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)

Abstract

本发明提供了一种基于锚定卷积网络的癫痫脑电信号预警方法及装置,属于信号处理技术领域;解决了由于难以区分发作间期和发作前期数据的特征导致预测灵敏度不高或预测时间不长的问题;包括如下步骤:癫痫脑电信号采集;对采集的癫痫脑电信号进行预处理,并且对预处理后的脑电信号进行数据选取,构建锚定卷积网络ACN模型,具体如下:将输入ACN模型的数据放入膨胀因果卷积网络中;然后进行参数重写归一化;然后采用激活函数加速模型训练;然后进行随机失活;最后对整体进行一个残差连接;重复上述操作3次称为锚定块,将多个锚定块连接后形成锚定卷积网络ACN;对锚定卷积网络ACN模型进行训练并测试;癫痫脑电信号预警;本发明应用于癫痫发作前期预测。

The present invention provides an epilepsy electroencephalogram (ECG) signal early warning method and device based on an anchored convolutional network, belonging to the technical field of signal processing; the method solves the problem that the prediction sensitivity is not high or the prediction time is not long due to the difficulty in distinguishing the characteristics of interictal and preictal data; the method comprises the following steps: epilepsy electroencephalogram (ECG) signal acquisition; preprocessing the acquired epilepsy electroencephalogram (ECG) signal, and data selection of the preprocessed EEG signal, and constructing an anchored convolutional network (ACN) model, specifically as follows: putting the data input into the ACN model into an expanded causal convolutional network; then performing parameter rewriting normalization; then using an activation function to accelerate model training; then performing random inactivation; finally performing a residual connection on the whole; repeating the above operation three times is called an anchor block, and connecting multiple anchor blocks to form an anchored convolutional network (ACN); training and testing the anchored convolutional network (ACN) model; epilepsy electroencephalogram (ECG) signal early warning; the present invention is applied to the pre-epilepsy attack prediction.

Description

基于锚定卷积网络的癫痫脑电信号预警方法及装置Epilepsy EEG signal early warning method and device based on anchored convolutional network

技术领域Technical Field

本发明提供了一种基于锚定卷积网络的癫痫脑电信号预警方法及装置,属于脑电信号处理技术领域。The present invention provides an epilepsy electroencephalogram (EEG) signal early warning method and device based on an anchored convolutional network, belonging to the technical field of EEG signal processing.

背景技术Background Art

癫痫是世界上最常见的神经系统疾病之一。如今,脑电信号是癫痫诊疗的重要依据,主要根据医生的肉眼对脑电信号进行诊断。大多数研究是判断癫痫患者是否癫痫,即对发作间期与发作期的脑电信号的分类,癫痫发作检测有助于医生准确诊断,但是不能够预测到将来是否癫痫发作以及多长时间后发作,患者癫痫发作时很难进行及时的防护措施,不能让癫痫患者免受癫痫发作的后果。Epilepsy is one of the most common neurological diseases in the world. Nowadays, EEG signals are an important basis for the diagnosis and treatment of epilepsy, and the diagnosis is mainly based on the doctor's naked eye. Most studies are to determine whether an epileptic patient has epilepsy, that is, to classify the EEG signals between the interictal period and the ictal period. Epilepsy seizure detection helps doctors make accurate diagnoses, but it cannot predict whether an epileptic seizure will occur in the future and how long it will take for the seizure to occur. It is difficult for patients to take timely protective measures when they have an epileptic seizure, and epileptic patients cannot be protected from the consequences of epileptic seizures.

预测即将发生的癫痫发作对于挽救癫痫患者的生命至关重要,少数技术开始对癫痫进行预测,通过对患者的发作间期和发作前期的脑电信号分类来进行预测,但是由于发作间期和发作前期数据特征区别度不大,具有较强的相似性,尤其发作前期时间越长,发作前期与发作间期就越相似,所以导致现有技术普遍存在预测灵敏度低或预测时间短等问题,实际应用价值不高。因此,一个可以抓住发作间期与发作前期之间的区别,来实现高的预测灵敏度和长的预测时间的癫痫脑电信号预警技术十分重要,在患者发作前期及时预警,能够让病人、监护人和医护人员可以做充分地防护措施,有效保障癫痫病人的生命安全。Predicting an impending epileptic seizure is crucial to saving the lives of epilepsy patients. A few technologies have begun to predict epilepsy by classifying the patient's interictal and preictal EEG signals. However, since the data features of the interictal and preictal periods are not very different and have strong similarities, especially the longer the preictal period, the more similar the preictal and interictal periods are. Therefore, existing technologies generally have problems such as low prediction sensitivity or short prediction time, and the actual application value is not high. Therefore, an epilepsy EEG signal warning technology that can grasp the difference between the interictal period and the preictal period to achieve high prediction sensitivity and long prediction time is very important. Timely warning before the patient's seizure can enable patients, guardians and medical staff to take adequate protective measures and effectively protect the lives of epilepsy patients.

随着深度学习的广泛应用,在癫痫发作的分类和预测上面也显示了巨大的前景,然而大部分深度学习模型需要大量的数据进行训练,而癫痫发作数据采集时间长、发作时间不确定等问题,导致可用的癫痫发作数据并不多,而且深度学习模型普遍训练时间长,占用资源大等问题,然而对于癫痫发作的实时预警来说,需要占用资源少,运行时间短的模型来实际运用。With the widespread application of deep learning, it has also shown great prospects in the classification and prediction of epileptic seizures. However, most deep learning models require a large amount of data for training. The long time it takes to collect epileptic seizure data and the uncertainty of the seizure time result in a small amount of available epileptic seizure data. In addition, deep learning models generally take a long time to train and occupy a lot of resources. However, for real-time early warning of epileptic seizures, models that occupy less resources and have a shorter running time are needed for practical use.

发明内容Summary of the invention

本发明为了解决现有技术难以区分发作间期和发作前期数据的特征,从而导致普遍预测灵敏度不高或者预测时间不长的问题,提出了一种基于锚定卷积网络的癫痫脑电信号预警方法及装置。In order to solve the problem that the prior art is difficult to distinguish the characteristics of interictal and preictal data, resulting in generally low prediction sensitivity or short prediction time, the present invention proposes an epilepsy EEG signal early warning method and device based on an anchored convolutional network.

为了解决上述技术问题,本发明采用的技术方案为:一种基于锚定卷积网络的癫痫脑电信号预警方法,包括如下步骤:In order to solve the above technical problems, the technical solution adopted by the present invention is: an epilepsy EEG signal early warning method based on an anchored convolutional network, comprising the following steps:

步骤一:癫痫脑电信号采集;Step 1: Epilepsy EEG signal collection;

步骤二:对采集的癫痫脑电信号进行预处理,并且对预处理后的脑电信号进行数据选取,得到训练数据集;Step 2: preprocessing the collected epileptic EEG signals, and selecting data from the preprocessed EEG signals to obtain a training data set;

步骤三:构建锚定卷积网络ACN模型,具体如下:Step 3: Construct the anchored convolutional network ACN model, as follows:

(1)将输入ACN模型的数据放入膨胀因果卷积网络中,更好的有效学习到前面的输入数据的信息;(1) The data input into the ACN model is put into the dilated causal convolutional network to better and more effectively learn the information of the previous input data;

(2)然后进行参数重写归一化;(2) Then the parameters are rewritten and normalized;

(3)然后采用激活函数加速模型训练;(3) Then use the activation function to accelerate model training;

(4)然后进行随机失活;(4) Then random dropout is performed;

(5)最后对整体进行一个残差连接;(5) Finally, a residual connection is performed on the whole;

(6)步骤(1)-(5)重复3次称为锚定块,将多个锚定块连接后形成锚定卷积网络ACN;(6) Steps (1)-(5) are repeated three times and are called anchor blocks. Multiple anchor blocks are connected to form an anchor convolutional network (ACN).

步骤四:对锚定卷积网络ACN模型进行训练并测试,采用步骤二中处理后的脑电信号进行ACN模型训练,将部分训练数据和待测试数据共同输入至训练好的ACN模型中,输出待测试数据的发作间期和发作前期的预测标签数组;Step 4: Train and test the anchored convolutional network ACN model. Use the EEG signal processed in step 2 to train the ACN model. Input part of the training data and the test data into the trained ACN model, and output the prediction label array of the interictal and preictal period of the test data.

步骤五:癫痫脑电信号预警:对ACN模型输出的预测标签数组采用多层滑动窗口预测算法得到预警结果,当预警结果大于多层滑动窗口预测阈值时,认为是一次癫痫发作前期预警,若发作预测范围点处于发作前设定时间内,则认为是一次正确预警,否则是一次错误预警。Step 5: Epilepsy EEG signal warning: A multi-layer sliding window prediction algorithm is used to obtain the warning result for the predicted label array output by the ACN model. When the warning result is greater than the multi-layer sliding window prediction threshold, it is considered to be an early warning of epileptic seizure. If the seizure prediction range point is within the set time before the seizure, it is considered to be a correct warning, otherwise it is a wrong warning.

所述步骤二中对采集的癫痫脑电信号进行预处理的步骤如下:The steps of preprocessing the collected epileptic EEG signals in step 2 are as follows:

首先对脑电信号进行4-32Hz低通滤波处理,以去除脑电信号中的高频噪声;First, the EEG signal is processed by 4-32Hz low-pass filtering to remove high-frequency noise in the EEG signal;

其次对脑电信号进行60Hz陷波滤波处理,以去除脑电信号中的工频干扰;Secondly, the EEG signal is processed by 60Hz notch filtering to remove the power frequency interference in the EEG signal;

最后通过滑动窗口方式对滤波后的脑电信号进行样本熵的特征提取。Finally, the sample entropy feature extraction of the filtered EEG signal is performed through a sliding window method.

所述步骤二中对处理后的脑电信号进行数据选取的过程如下:The process of data selection of the processed EEG signal in step 2 is as follows:

将特征提取后脑电信号的发作间期和发作前期数据统一截取为设定时长的数据段,且截取的数据段中要求每个病人有2次及以上的发作前期数据数据段和2次及以上的发作间期数据段,并统计符合上述数据段划分的脑电信号中癫痫发作次数和脑电信号的总时间,得到发作前期数据样本和发作间期数据样本。After feature extraction, the interictal and preictal data of the EEG signal are uniformly intercepted into data segments of set duration. Each patient is required to have 2 or more preictal data segments and 2 or more interictal data segments in the intercepted data segments. The number of epileptic seizures and the total time of the EEG signal that conforms to the above data segment division are counted to obtain preictal data samples and interictal data samples.

发作前期数据的截取规则为:截取癫痫发作前2小时的数据且要求每个病人有2次及以上的2小时时长的发作前期数据;The interception rules for preictal data are as follows: intercept the data 2 hours before the epileptic seizure and require each patient to have 2 or more preictal data of 2 hours;

发作间期数据的截取规则为:截取与癫痫发作期间隔4小时及以上的其中2小时数据且要求每个病人有2次及以上的2小时时长的发作间期数据。The interception rule of interictal data is: intercept 2 hours of data from the epileptic seizure period that is 4 hours or more apart, and each patient is required to have 2 or more interictal data of 2 hours in length.

所述膨胀因果卷积网络包括输入层、三个隐藏层和输出层,引入了膨胀因子,通过膨胀因子对输入数据进行分隔取用。The dilated causal convolutional network includes an input layer, three hidden layers and an output layer, and introduces a dilation factor, through which input data is separated and taken.

所述步骤四中对锚定卷积网络ACN模型进行训练的过程如下:The process of training the anchored convolutional network ACN model in step 4 is as follows:

每个患者的脑电信号经过数据处理之后,每个患者有n个发作间期和n个发作前期,每次随机选取1个发作间期和1个发作前期数据段作为测试集,剩下的发作间期和发作前期数据段作为训练集,将训练集带入锚定卷积网络,其中按照发作间期数据在前,发作前期数据在后的方式训练,采用交叉熵作为损失函数,计算ACN模型的预测输出与标签的误差,通过误差的反向传播与随机梯度下降算法更新网络中每一层的参数。After data processing of the EEG signals of each patient, each patient has n interictal periods and n preictal periods. Each time, one interictal period and one preictal period data segment are randomly selected as the test set, and the remaining interictal period and preictal period data segments are used as the training set. The training set is brought into the anchored convolutional network, where the training is carried out in the manner of interictal data first and preictal data later. The cross entropy is used as the loss function, and the error between the predicted output and the label of the ACN model is calculated. The parameters of each layer in the network are updated through the back propagation of the error and the stochastic gradient descent algorithm.

所述步骤四中对测试数据进行预测的过程如下:The process of predicting the test data in step 4 is as follows:

在测试阶段,先将部分训练数据输入ACN模型中,然后再放入真正需要测试的数据,在测试数据里面,前面会放入训练数据来进行辅助预测,重复多次实验,最终将真正测试的数据上的平均结果作为最终结果。During the testing phase, part of the training data is first input into the ACN model, and then the data that actually needs to be tested is put in. In the test data, the training data is put in front to assist in prediction. The experiment is repeated many times, and finally the average result on the actual test data is taken as the final result.

一种基于锚定卷积网络的癫痫脑电信号预警装置,包括:An epilepsy EEG signal early warning device based on an anchored convolutional network, comprising:

采集装置,用于采集癫痫患者的脑电信号的原始数据;An acquisition device for acquiring raw data of electroencephalogram signals of epileptic patients;

处理器,所述处理器通过导线与采集装置相连接,所述处理器包括数据处理模块、模型分析模块、模型预警模块;A processor, the processor is connected to the acquisition device through a wire, and the processor includes a data processing module, a model analysis module, and a model early warning module;

所述数据处理模块用于将采集装置所采集的原始脑电信号数据进行低通滤波、陷波滤波的预处理,然后通过滑动窗口进行样本熵的特征提取;The data processing module is used to pre-process the raw EEG signal data collected by the collection device by low-pass filtering and notch filtering, and then extract the features of sample entropy through a sliding window;

所述模型分析模块内部存储有锚定卷积网络ACN模型,用于将数据处理模块的特征提取后的数据放入ACN模型中进行训练与测试,最后输出测试数据的预测标签数组;The model analysis module internally stores an anchored convolutional network (ACN) model, which is used to put the data extracted from the feature processing module into the ACN model for training and testing, and finally output the predicted label array of the test data;

所述模型预警模块用于将模型分析模块的预测标签数组放入多层滑动窗口中,当认为是发作前期数据时,发出警报信息;The model warning module is used to put the prediction label array of the model analysis module into a multi-layer sliding window, and issue an alarm message when it is considered to be pre-seizure data;

所述警报装置用于接收模型预警模块中的警报信息,当收到警报信息,则发出声音和震动。The alarm device is used to receive the alarm information in the model early warning module, and emits sound and vibration when receiving the alarm information.

所述锚定卷积网络ACN模型包括多个连接的锚定块,所述锚定块内部有三个相连的处理网络,每个处理网络包括相连的膨胀因果卷积网络、参数归一化层、激活函数、随机失活以及一个整体的残差连接。The anchored convolutional network (ACN) model includes multiple connected anchor blocks, each of which has three connected processing networks, each of which includes a connected dilated causal convolutional network, a parameter normalization layer, an activation function, random inactivation, and an overall residual connection.

本发明相对于现有技术具备的有益效果为:The beneficial effects of the present invention compared with the prior art are as follows:

1、本发明结合了样本熵方法,可以很好地筛选出有效的信息量特征,使ACN模型可以更好地抓住其特征,提高了癫痫的发作间期和发作前期的预测灵敏度,并且样本熵可以处理部分数据缺失的情况,从而避免数据在计算样本熵时出现偏差。1. The present invention combines the sample entropy method, which can well screen out effective information features, so that the ACN model can better grasp its characteristics, improve the prediction sensitivity of the interictal and preictal periods of epilepsy, and the sample entropy can handle the situation where some data is missing, thereby avoiding data deviation when calculating the sample entropy.

2、本发明提出的锚定卷积网络(ACN)是一种全新的深度学习模型,该模型依赖于一定的数据形式,当训练数据形式和测试数据形式一致时,有良好的预测效果,当测试数据依赖一定的训练数据时,则需要测试的数据的预测效果更好,实验结果表明,在癫痫发作前期的预测上,ACN模型的表现优于现有最先进的方法,并且ACN模型需要的数据量小,所以其模型占用资源少,运行速度快,可以更好地实现癫痫的实时快速预警,并且给实时预测癫痫发作的可穿戴设备提供新的方法。2. The anchored convolutional network (ACN) proposed in the present invention is a new deep learning model, which depends on a certain data form. When the training data form is consistent with the test data form, it has a good prediction effect. When the test data depends on certain training data, the prediction effect of the test data is better. The experimental results show that in the prediction of the early stage of epileptic seizures, the performance of the ACN model is better than the most advanced existing methods, and the ACN model requires a small amount of data, so its model occupies less resources and runs faster, which can better realize the real-time rapid warning of epilepsy, and provide a new method for wearable devices for real-time prediction of epileptic seizures.

3、本发明的多层滑动窗口预测算法,通过二层滑动窗口重叠使用,可以更好地提高癫痫预测的灵敏度以及降低癫痫的误报率,最终得出癫痫的发作预测范围,实验结果表明,可以预警到的发作预测范围优于使用相同数据集中最长的发作预测范围。3. The multi-layer sliding window prediction algorithm of the present invention can better improve the sensitivity of epilepsy prediction and reduce the false alarm rate of epilepsy by overlapping the two-layer sliding windows, and finally derive the prediction range of epilepsy onset. The experimental results show that the prediction range of onset that can be warned is better than the longest prediction range of onset in the same data set.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

下面结合附图对本发明做进一步说明:The present invention will be further described below in conjunction with the accompanying drawings:

图1为本发明方法的流程图;Fig. 1 is a flow chart of the method of the present invention;

图2为本发明装置的结构示意图;FIG2 is a schematic diagram of the structure of the device of the present invention;

图3为本发明提出的锚定卷积网络的结构示意图;FIG3 is a schematic diagram of the structure of the anchored convolutional network proposed in the present invention;

图4为本发明提出的膨胀因果卷积网络的结构示意图;FIG4 is a schematic diagram of the structure of the dilated causal convolutional network proposed in the present invention;

图5为本发明提出的锚定卷积网络模型的训练与测试示意图。FIG5 is a schematic diagram of training and testing of the anchored convolutional network model proposed in the present invention.

具体实施方式DETAILED DESCRIPTION

如图1至图5所示,本发明提供了一种基于锚定卷积网络的癫痫脑电信号预警方法,通过采集装置获取癫痫患者的脑电信号(EEG)并进行滤波的初步预处理,然后运用样本熵进行特征提取,将发作间期以及发作前期的数据带入锚定卷积网络(ACN)中,最后通过多层滑动窗口预测算法,预测出癫痫病人将要癫痫发作的时间,处理器将预警结果传递给警报装置,通过警报装置发出警报,实现对患者的癫痫预警。具体实现的步骤如下。As shown in Figures 1 to 5, the present invention provides an epilepsy EEG signal warning method based on an anchored convolutional network, which obtains the EEG signal (EEG) of an epileptic patient through an acquisition device and performs preliminary preprocessing of filtering, then uses sample entropy to extract features, and brings the data of the interictal period and the pre-ictal period into the anchored convolutional network (ACN), and finally predicts the time when the epileptic patient will have an epileptic seizure through a multi-layer sliding window prediction algorithm, and the processor transmits the warning result to the alarm device, and the alarm device sends an alarm to realize the epilepsy warning for the patient. The specific implementation steps are as follows.

步骤一:脑电信号数据采集:Step 1: EEG signal data collection:

本发明实施例中的脑电信号数据采用在波士顿儿童医院进行监测采集的公开的CHB-MIT数据集,其采样频率为256Hz,分辨率为16位,这些记录使用了国际10-20系统的脑电图电极位置和命名。The EEG signal data in the embodiment of the present invention adopts the public CHB-MIT data set collected by monitoring at Boston Children's Hospital, with a sampling frequency of 256 Hz and a resolution of 16 bits. These records use the EEG electrode positions and naming of the international 10-20 system.

步骤二:脑电信号数据处理,具体包括:Step 2: EEG signal data processing, including:

(1)低通滤波:对脑电信号进行4-32Hz低通滤波处理,以去除脑电信号中的高频噪声。(1) Low-pass filtering: The EEG signal is processed by a 4-32 Hz low-pass filter to remove high-frequency noise in the EEG signal.

(2)去除工频干扰:对脑电信号进行60Hz陷波滤波处理,以去除脑电信号中的工频干扰,这样使得脑电信号更加纯净,癫痫发作的预测效果更好。(2) Removing power frequency interference: The EEG signal is processed with a 60 Hz notch filter to remove the power frequency interference in the EEG signal, which makes the EEG signal purer and has a better prediction effect on epileptic seizures.

(3)样本熵特征提取:为了进一步对癫痫预测,使用了样本熵的方法对脑电信号进行特征提取,样本熵是强大的信息量度量的方法,可以很好的筛选出有效的信息量特征,从而提高癫痫预测预测的准确性,并且样本熵可以处理部分数据缺失的情况,从而避免数据在计算样本熵时出现偏差。(3) Sample entropy feature extraction: In order to further predict epilepsy, the sample entropy method is used to extract features from EEG signals. Sample entropy is a powerful method for measuring the amount of information, which can well screen out effective information features, thereby improving the accuracy of epilepsy prediction. Sample entropy can also handle the situation where some data is missing, thereby avoiding data deviation when calculating sample entropy.

对于样本熵的特征提取,采用滑动窗口进行,滑动窗口大小为5秒钟的数据段,滑动窗口步长为1秒钟的数据段,假设存在数据为N个,组成的时间序列X=[x(n),n=1,2,…,N],样本熵表达式为:For the feature extraction of sample entropy, a sliding window is used. The sliding window size is a 5-second data segment, and the sliding window step is a 1-second data segment. Assuming that there are N data, the time series X=[x(n),n=1,2,…,N], the sample entropy expression is:

上式中:m为嵌入维数,r表示相似容限,Cm(r)表示两个序列在相似容限下匹配m个点的概率,Cm+1(r)表示两个序列在相似容限下匹配m+1个点的概率。In the above formula: m is the embedding dimension, r represents the similarity tolerance, Cm (r) represents the probability that two sequences match m points under the similarity tolerance, and Cm+1 (r) represents the probability that two sequences match m+1 points under the similarity tolerance.

(4)数据选取:选取癫痫发作前期数据(发作前2小时)且要求每个病人有2次及以上的发作前期数据。选取癫痫发作间期数据(与发作期间隔4小时及以上),且要求每个病人有2次及以上的发作间期数据。(4) Data selection: Select pre-ictal data (2 hours before the onset) and require each patient to have 2 or more pre-ictal data. Select interictal data (4 hours or more between the onset and the onset) and require each patient to have 2 or more interictal data.

具体可以将特征提取后的发作间期和发作前期数据统一截取为2小时的数据段,即2小时的发作前期数据和2小时的发作间期数据,共44次癫痫发作记录,总时间为176小时,完成了对13名癫痫患者的脑电信号处理,得到发作前期头皮脑电信号数据样本317592个,发作间期头皮脑电信号数据样本317592个,每个数据样本即为1个数据段也即1秒的头皮脑电信号数据。Specifically, the interictal and preictal data after feature extraction can be uniformly intercepted into 2-hour data segments, that is, 2 hours of preictal data and 2 hours of interictal data, with a total of 44 epileptic seizure records and a total time of 176 hours. The EEG signal processing of 13 epilepsy patients was completed, and 317,592 preictal scalp EEG signal data samples and 317,592 interictal scalp EEG signal data samples were obtained. Each data sample is 1 data segment, that is, 1 second of scalp EEG signal data.

步骤三:构建锚定卷积网络(ACN):本发明中的ACN的结构如图3所示,具体如下:Step 3: Constructing an anchored convolutional network (ACN): The structure of the ACN in the present invention is shown in FIG3 , and is specifically as follows:

(1)膨胀因果卷积网络(1) Dilated Causal Convolutional Network

在锚定块中的卷积功能由膨胀因果卷积网络实现,膨胀因果卷积网络引入了膨胀因子,通过膨胀因子对输入数据进行分隔取用,这样增大了网络感受野,当锚定块数增加时,可以学习到更长的历史数据信息。The convolution function in the anchor block is implemented by the dilated causal convolutional network. The dilated causal convolutional network introduces a dilation factor, which separates the input data and increases the network receptive field. When the number of anchor blocks increases, longer historical data information can be learned.

膨胀因果卷积网络拥有更大的感受野,可以更好地有效学习到前面的输入数据的信息,因为膨胀因果卷积的参数少,所以降低了模型的复杂度和计算成本,同时因为也是因果卷积,它不会看到未来的数据,所以不会产生信息泄露的问题。The dilated causal convolutional network has a larger receptive field and can better and more effectively learn the information of the previous input data. Because the dilated causal convolution has fewer parameters, it reduces the complexity and computational cost of the model. At the same time, because it is also a causal convolution, it will not see future data, so there will be no information leakage problem.

设输入序列X∈RN,过滤器f:{0,...,k-1}→R,则膨胀因果卷积网络F定义为:Suppose the input sequence X∈RN , filter f:{0,...,k-1}→R, then the dilated causal convolutional network F is defined as:

其中*d表示为膨胀因果卷积算子,d为膨胀因子,k为过滤器大小,s为输入序列的长度,f(i)表示第i个过滤器,膨胀因果卷积网络在图4中展现。Where * d represents the dilated causal convolution operator, d is the dilation factor, k is the filter size, s is the length of the input sequence, f(i) represents the i-th filter, and the dilated causal convolution network is shown in Figure 4.

(2)参数重写归一化(Weight Norm,WN)(2) Parameter rewriting normalization (Weight Norm, WN)

在梯度回传的时候,可以使梯度自稳定,其WN公式为:When the gradient is returned, the gradient can be made self-stabilized, and its WN formula is:

其中g为标量,其大小等于WN的模长,表示与WN同方向的单元向量,v表示向量,||v||表示v向量的欧几里德范数。Where g is a scalar whose magnitude is equal to the modulus of WN. represents a unit vector in the same direction as WN, v represents a vector, and ||v|| represents the Euclidean norm of the v vector.

(3)激活函数(ReLu)(3) Activation function (ReLu)

增强了模型的非线性能力,使模型可以更好地拟合非线性函数,同时加速了模型训练速度,也减少了模型的参数,其定义为:The nonlinear ability of the model is enhanced, so that the model can better fit the nonlinear function, while accelerating the model training speed and reducing the model parameters. It is defined as:

上式中:x表示经过参数重写归一化之后的输入数据。In the above formula: x represents the input data after parameter rewriting and normalization.

(4)随机失活(Dropout)(4) Dropout

可以比较有效地缓解过拟合的发生,在一定程度上达到正则化的效果,增强了模型泛化能力。It can effectively alleviate the occurrence of overfitting, achieve the effect of regularization to a certain extent, and enhance the generalization ability of the model.

(5)残差连接(5) Residual Connection

一个锚定块里面有一个残差,残差通过跨层连接来传递梯度信息,从而解决了深层神经网络中的梯度消失和梯度爆炸问题,促进了模型的训练和优化,且因为网络的优化过程中可以利用之前层的参数直接与当前层的参数相加,从而加速了模型的收敛速度,减少了训练时间和资源的消耗,提升网络的表示能力,并减少过拟合的风险。其公式为:An anchor block contains a residual, which transmits gradient information through cross-layer connections, thereby solving the gradient vanishing and gradient exploding problems in deep neural networks, promoting model training and optimization, and because the parameters of the previous layer can be directly added to the parameters of the current layer during network optimization, the convergence speed of the model is accelerated, the training time and resource consumption are reduced, the network's representation ability is improved, and the risk of overfitting is reduced. The formula is:

y=F(x)+x(5);y=F(x)+x(5);

上式中:x是膨胀因果卷积网络的输入数据,F(x)是经过膨胀因果卷积网络、参数重写归一化、激活函数、随机失活处理后的输出数据,y是残差连接后的输出数据。In the above formula: x is the input data of the dilated causal convolutional network, F(x) is the output data after the dilated causal convolutional network, parameter rewriting normalization, activation function, and random inactivation processing, and y is the output data after residual connection.

(6)锚定块(6) Anchor Block

(1)-(5)步骤重复3次称为锚定块,多个这样的锚定块,称之为锚定卷积网络(ACN)。Steps (1)-(5) are repeated three times and are called an anchor block. Multiple such anchor blocks are called an anchored convolutional network (ACN).

设定锚定块的个数为n,ACN模型的层数等于锚定块的块数,第k层的膨胀因子为2k,这样可以更加合理的学习到更多的往前数据信息,经过不断的实验参数调整,确定ACN模型的锚定块的个数为4。The number of anchor blocks is set to n, the number of layers of the ACN model is equal to the number of anchor blocks, and the expansion factor of the kth layer is 2 k . This allows more forward data information to be learned more reasonably. After continuous experimental parameter adjustment, the number of anchor blocks of the ACN model is determined to be 4.

步骤四:锚定卷积网络模型训练及测试Step 4: Anchored Convolutional Network Model Training and Testing

每个患者的脑电信号经过数据处理之后,每个患者有n个发作间期和n个发作前期,每次随机选取1个发作间期和1个发作前期数据段作为测试集,剩下的发作间期和发作前期数据段作为训练集,将训练集带入锚定卷积网络,其中按照发作间期数据在前,发作前期数据在后的方式训练,采用交叉熵(Cross Entropy,CE)作为损失函数,计算模型的预测输出与标签的误差,通过误差的反向传播与随机梯度下降算法更新网络中每一层的参数。After data processing of the EEG signals of each patient, each patient has n interictal periods and n preictal periods. Each time, one interictal period and one preictal period data segment are randomly selected as the test set, and the remaining interictal period and preictal period data segments are used as the training set. The training set is brought into the anchored convolutional network, where the training is carried out in the manner of interictal data first and preictal data later. Cross Entropy (CE) is used as the loss function to calculate the error between the predicted output of the model and the label, and the parameters of each layer in the network are updated through the back propagation of the error and the stochastic gradient descent algorithm.

本发明首次提出锚定卷积网络的思想,当前数据的预测可以学习到往前数据的特征,来进一步辅助预测,即在测试阶段,先将部分训练数据放入,然后再放入真正需要测试的数据,因此,在测试数据里面,前面会放入训练数据来进行辅助预测,重复多次实验,最终在真正测试的数据上的平均结果作为最终结果。This invention proposes the idea of anchoring convolutional networks for the first time. The prediction of current data can learn the characteristics of previous data to further assist prediction. That is, in the test phase, part of the training data is put in first, and then the data that really needs to be tested is put in. Therefore, in the test data, the training data will be put in front to assist prediction. The experiments are repeated many times, and the average result on the real test data is taken as the final result.

锚定块设定为4块,训练轮数设定为14次,过滤器大小为18,过滤器数量为80,随机失活因子为0.02,学习速率为0.001,每8轮学习速率乘以0.1,每个患者有n个发作间期和n个发作前期的2小时数据段,每次随机选取1个发作间期和1个发作前期数据段作为测试集,对于测试集的数据预测,其中部分训练数据在前,采用滑动窗口方法,设定滑动窗口大小为40min数据段,滑动步的大小为13min数据段,以此方式将测试数据在后,则每个单位数据段有3次预测结果,统计哪种预测结果次数多,便取该结果为最终预测结果,重复3次实验,最终在测试数据上的平均结果作为最终结果。最后输出结果为ACN模型将真正的测试数据的发作间期和发作前期预测标签数组,ACN模型的训练与测试示意图在图5中展现。The anchor block is set to 4, the number of training rounds is set to 14, the filter size is 18, the number of filters is 80, the random inactivation factor is 0.02, the learning rate is 0.001, and the learning rate is multiplied by 0.1 every 8 rounds. Each patient has n interictal and n preictal 2-hour data segments. Each time, 1 interictal and 1 preictal data segment are randomly selected as the test set. For the data prediction of the test set, some training data are in the front, and the sliding window method is used. The sliding window size is set to 40min data segment and the sliding step size is 13min data segment. In this way, the test data is in the back, and each unit data segment has 3 prediction results. The result with the most predictions is counted and the result is taken as the final prediction result. Repeat the experiment 3 times, and the average result on the test data is taken as the final result. The final output result is the ACN model predicting the label array of the interictal and preictal periods of the real test data. The training and testing diagram of the ACN model is shown in Figure 5.

步骤五:脑电信号数据预警Step 5: EEG signal data warning

用训练好的锚定卷积网络(ACN)在测试集上测试,对输出的预测标签数组采用多层滑动窗口预测算法,得到预警结果,当预警结果大于多层滑动窗口预测阈值时,认为是一次癫痫发作前期预警。若发作预测范围点处于发作前2小时内,则认为是一次正确预警,否则是一次错误预警。The trained anchored convolutional network (ACN) was tested on the test set, and the multi-layer sliding window prediction algorithm was used on the output prediction label array to obtain the warning result. When the warning result is greater than the multi-layer sliding window prediction threshold, it is considered to be an early warning of epileptic seizure. If the seizure prediction range point is within 2 hours before the seizure, it is considered to be a correct warning, otherwise it is a wrong warning.

具体为:将ACN模型预测标签的120秒数据作为一小段,其中当120秒数据段中有大于等于90秒数据段判断为发作前期预测标签时,那么便认为该120秒数据段都为发作前期数据;当这种连续的120秒数据段作为一小段的五段,其中有大于等于四段数据段均判断为发作前期预测标签时,那么便认为这一大段都为发作前期数据,则系统发出警报。若发作预测范围点处于发作前2小时内,则认为是一次正确预警,否则是一次错误预警。癫痫预测采用灵敏度(SEN)、每小时误报率(FPR/h)、发作预测范围(SPH)来评估ACN模型对癫痫预测的效果。Specifically: the 120-second data of the ACN model prediction label is taken as a small segment. When there are more than or equal to 90 seconds of data segments in the 120-second data segment that are judged as pre-ictal prediction labels, then the 120-second data segment is considered to be pre-ictal data; when there are five segments of this continuous 120-second data segment as a small segment, and more than or equal to four data segments are judged as pre-ictal prediction labels, then this large segment is considered to be pre-ictal data, and the system will issue an alarm. If the seizure prediction range point is within 2 hours before the onset, it is considered to be a correct warning, otherwise it is a wrong warning. Epilepsy prediction uses sensitivity (SEN), false alarm rate per hour (FPR/h), and seizure prediction range (SPH) to evaluate the effect of the ACN model on epilepsy prediction.

其中灵敏度(SEN),即正确预警次数占总发作次数的百分比。定义灵敏度为:The sensitivity (SEN) is the percentage of correct warning times to the total number of attacks. The sensitivity is defined as:

上式中:n为正确预警次数,N为发作总次数。In the above formula: n is the number of correct warnings, and N is the total number of attacks.

误报率(FPR),每小时误报率是单位时间内癫痫预警算法误报的次数,单位是次/h。定义每小时误报率为:False alarm rate (FPR), the hourly false alarm rate is the number of false alarms of the epilepsy warning algorithm per unit time, the unit is times/h. The definition of hourly false alarm rate is:

上式中t是误报次数,T是脑电信号总时长(单位/h)。In the above formula, t is the number of false alarms, and T is the total duration of the EEG signal (unit/h).

发作预测范围(SPH),SPH被定义为开始预警和癫痫发作之间的时间间隔。Seizure prediction horizon (SPH), SPH is defined as the time interval between the onset of warning and epileptic seizure.

使用上述数据进行患者的癫痫预警,实验结果显示平均癫痫预测的灵敏度(SEN)为92.31%,每小时误报率(FPR/h)为0.15,发作预测范围(SPH)为103.36分钟。从13名癫痫患者脑电信号上的预警结果可以看出,本发明提出的ACN模型具有高预警灵敏度和较低误报率以及长的发作预测范围。The above data is used to warn patients about epilepsy. The experimental results show that the average sensitivity of epilepsy prediction (SEN) is 92.31%, the false alarm rate per hour (FPR/h) is 0.15, and the seizure prediction range (SPH) is 103.36 minutes. It can be seen from the warning results of EEG signals of 13 epilepsy patients that the ACN model proposed in the present invention has high warning sensitivity, low false alarm rate and long seizure prediction range.

将本发明的方法与国内外最先进的方法进行了对比,其对比结果如下表1所示。从表1中可以看出,与其他方法相比,本发明提出的基于锚定卷积网络(ACN)的癫痫脑电信号预警方法具有预警灵敏度高、发作预测范围长等优势。The method of the present invention is compared with the most advanced methods at home and abroad, and the comparison results are shown in Table 1. As can be seen from Table 1, compared with other methods, the epilepsy EEG signal early warning method based on anchored convolutional network (ACN) proposed in the present invention has the advantages of high early warning sensitivity and long seizure prediction range.

表1CHB-MIT数据集的不同方法癫痫预警结果对比。Table 1 Comparison of epilepsy warning results of different methods on CHB-MIT dataset.

本发明还提出了一种基于锚定卷积网络(ACN)的癫痫脑电信号预警方装置,装置包括:The present invention also proposes an epilepsy EEG signal early warning device based on an anchored convolutional network (ACN), the device comprising:

采集装置,用于采集癫痫患者的脑电信号的原始数据;An acquisition device for acquiring raw data of electroencephalogram signals of epileptic patients;

处理器,处理器通过导线与采集装置相连接,处理器包括数据处理模块、模型分析模块、模型预警模块;A processor, the processor is connected to the acquisition device through a wire, and the processor includes a data processing module, a model analysis module, and a model early warning module;

数据处理模块用于将采集装置所采集的原始脑电信号数据进行低通滤波、陷波滤波的预处理,然后通过滑动窗口进行样本熵的特征提取;The data processing module is used to pre-process the raw EEG signal data collected by the acquisition device by low-pass filtering and notch filtering, and then extract the features of sample entropy through a sliding window;

模型分析模块用于将数据处理模块的特征提取后的数据放入ACN模型中进行训练与测试,最后输出测试数据的预警预测结果;The model analysis module is used to put the data extracted from the data processing module into the ACN model for training and testing, and finally output the early warning prediction results of the test data;

模型预警模块用于将模型分析模块的预警预测结果放入多层滑动窗口预警中,当认为是发作前期数据时,发出警报信息;The model warning module is used to put the warning prediction results of the model analysis module into the multi-layer sliding window warning, and when it is considered to be pre-onset data, an alarm message is issued;

警报装置用于接收模型预警模块中的警报信息,当收到警报信息,则发出声音和震动。The alarm device is used to receive the alarm information in the model early warning module, and when the alarm information is received, it will make a sound and vibrate.

本发明提出的基于锚定卷积网络(ACN)的癫痫脑电信号预警方法及装置,将采集的癫痫患者的脑电信号进行滤波处理,然后运用样本熵进行特征提取,筛选出有效的信息特征,便于后面的模型可以更好的抓住其特征,然后使用ACN模型进行癫痫发作间期和发作前期的预测,由于样本熵与ACN模型有效结合,使得其预测效果好,预警的灵敏度显著提高,最后通过多层滑动窗口算法,得出良好的发作预测范围以及较低的误报率。The epilepsy EEG signal warning method and device based on anchored convolutional network (ACN) proposed in the present invention filters the collected EEG signals of epilepsy patients, then uses sample entropy to extract features and screens out effective information features so that the subsequent model can better grasp its features, and then uses the ACN model to predict the epileptic seizure interval and pre-seizure period. Due to the effective combination of sample entropy and the ACN model, the prediction effect is good and the sensitivity of the warning is significantly improved. Finally, a good seizure prediction range and a low false alarm rate are obtained through a multi-layer sliding window algorithm.

在本发明的实施例中,采用公开的CHB-MIT数据集上的包含13名癫痫患者的脑电信号数据,共44次癫痫发作的记录,采集数据的总时长176小时,包含发作前期数据样本317592个,发作间期数据样本317592个。在癫痫脑电信号数据集上测试本发明的方法,平均癫痫预测的灵敏度(SEN)为92.31%,每小时误报率(FPR/h)为0.15,发作预测范围(SPH)为103.36分钟,在癫痫发作预测方面优于现有的癫痫预警方法,实现了癫痫发作的准确快速预警且有长的发作预测范围,能够让病人、监护人和医护人员可以做充分地防护措施,有效保障癫痫病人的生命安全。In an embodiment of the present invention, the EEG signal data of 13 epilepsy patients on the public CHB-MIT data set is used, with a total of 44 epileptic seizure records, a total data collection time of 176 hours, including 317,592 pre-seizure data samples and 317,592 inter-seizure data samples. The method of the present invention is tested on the epilepsy EEG signal data set, and the average sensitivity (SEN) of epilepsy prediction is 92.31%, the false alarm rate per hour (FPR/h) is 0.15, and the seizure prediction range (SPH) is 103.36 minutes. It is superior to the existing epilepsy warning method in terms of epilepsy seizure prediction, and realizes accurate and rapid warning of epilepsy seizures and has a long seizure prediction range, which enables patients, guardians and medical staff to take adequate protective measures and effectively protect the life safety of epilepsy patients.

最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims (9)

1.一种基于锚定卷积网络的癫痫脑电信号预警方法,其特征在于:包括如下步骤:1. An epilepsy EEG signal early warning method based on an anchored convolutional network, characterized in that it comprises the following steps: 步骤一:癫痫脑电信号采集;Step 1: Epilepsy EEG signal collection; 步骤二:对采集的癫痫脑电信号进行预处理,并且对预处理后的脑电信号进行数据选取,得到训练数据集;Step 2: preprocessing the collected epileptic EEG signals, and selecting data from the preprocessed EEG signals to obtain a training data set; 步骤三:构建锚定卷积网络ACN模型,具体如下:Step 3: Construct the anchored convolutional network ACN model, as follows: (1)将输入ACN模型的数据放入膨胀因果卷积网络中,更好的有效学习到前面输入数据的信息;(1) Put the data input into the ACN model into the dilated causal convolutional network to better and more effectively learn the information of the previous input data; (2)然后进行参数权重归一化;(2) Then the parameter weights are normalized; (3)然后采用激活函数加速模型训练;(3) Then use the activation function to accelerate model training; (4)然后进行随机失活;(4) Then perform random dropout; (5)最后对整体进行一个残差连接;(5) Finally, a residual connection is performed on the whole; (6)步骤(1)-(5)重复3次称为锚定块,将多个锚定块连接后形成锚定卷积网络ACN;(6) Steps (1)-(5) are repeated three times and are called anchor blocks. Multiple anchor blocks are connected to form an anchor convolutional network (ACN). 步骤四:对锚定卷积网络ACN模型进行训练并测试,采用步骤二中处理后的脑电信号进行ACN模型训练,将部分训练数据和待测试数据共同输入至训练好的ACN模型中,输出待测试数据的发作间期和发作前期的预测标签数组;Step 4: Train and test the anchored convolutional network ACN model. Use the EEG signal processed in step 2 to train the ACN model. Input part of the training data and the test data into the trained ACN model, and output the prediction label array of the interictal and preictal period of the test data. 步骤五:癫痫脑电信号预警:对ACN模型输出的预测标签数组采用多层滑动窗口预测算法得到预警结果,当预警结果大于多层滑动窗口预测阈值时,认为是一次癫痫发作前预警,若发作预测范围点处于发作前设定时间内,则认为是一次正确预警,否则是一次错误预警。Step 5: Epilepsy EEG signal warning: A multi-layer sliding window prediction algorithm is used to obtain the warning result for the prediction label array output by the ACN model. When the warning result is greater than the multi-layer sliding window prediction threshold, it is considered to be a warning before an epileptic seizure. If the seizure prediction range point is within the set time before the seizure, it is considered to be a correct warning, otherwise it is a wrong warning. 2.根据权利要求1所述的一种基于锚定卷积网络的癫痫脑电信号预警方法,其特征在于:所述步骤二中对采集的癫痫脑电信号进行预处理的步骤如下:2. According to the method for early warning of epilepsy EEG signals based on anchored convolutional networks in claim 1, it is characterized in that: the step of preprocessing the collected epilepsy EEG signals in step 2 is as follows: 首先对脑电信号进行4-32Hz低通滤波处理,以去除脑电信号中的高频噪声;First, the EEG signal is processed by 4-32Hz low-pass filtering to remove high-frequency noise in the EEG signal; 其次对脑电信号进行60Hz陷波滤波处理,以去除脑电信号中的工频干扰;Secondly, the EEG signal is processed by 60Hz notch filtering to remove the power frequency interference in the EEG signal; 最后通过滑动窗口方式对滤波后的脑电信号进行样本熵的特征提取。Finally, the sample entropy feature extraction of the filtered EEG signal is performed through a sliding window method. 3.根据权利要求2所述的一种基于锚定卷积网络的癫痫脑电信号预警方法,其特征在于:所述步骤二中对处理后的脑电信号进行数据选取的过程如下:3. According to the method for early warning of epilepsy EEG signals based on anchored convolutional networks in claim 2, it is characterized in that: the process of data selection of the processed EEG signals in step 2 is as follows: 将特征提取后脑电信号的发作间期和发作前期数据统一截取为设定时长的数据段,且截取的数据段中要求每个病人有2次及以上的发作前期数据数据段和2次及以上的发作间期数据段,并统计符合上述数据段划分的脑电信号中癫痫发作次数和脑电信号的总时间,得到发作前期数据样本和发作间期数据样本。After feature extraction, the interictal and preictal data of the EEG signal are uniformly intercepted into data segments of set duration. Each patient is required to have 2 or more preictal data segments and 2 or more interictal data segments in the intercepted data segments. The number of epileptic seizures and the total time of the EEG signal that conforms to the above data segment division are counted to obtain preictal data samples and interictal data samples. 4.根据权利要求3所述的一种基于锚定卷积网络的癫痫脑电信号预警方法,其特征在于:发作前期数据的截取规则为:截取癫痫发作前2小时的数据且要求每个病人有2次及以上的至少2小时时长的发作前期数据;4. The epilepsy EEG signal early warning method based on anchored convolutional network according to claim 3 is characterized in that: the interception rule of pre-ictal data is: intercept the data 2 hours before the epileptic seizure and require each patient to have 2 or more pre-ictal data of at least 2 hours in length; 发作间期数据的截取规则为:截取与癫痫发作期间隔4小时及以上的其中2小时数据且要求每个病人有2次及以上的至少2小时时长的发作间期数据。The interception rule of interictal data is: intercept 2 hours of data from the epileptic seizure period that is 4 hours or more apart, and require each patient to have 2 or more interictal data of at least 2 hours in length. 5.根据权利要求4所述的一种基于锚定卷积网络的癫痫脑电信号预警方法,其特征在于:所述膨胀因果卷积网络包括输入层、三个隐藏层和输出层,引入了膨胀因子,通过膨胀因子对输入数据进行分隔取用。5. According to claim 4, an epilepsy EEG signal warning method based on an anchored convolutional network is characterized in that: the dilated causal convolutional network includes an input layer, three hidden layers and an output layer, and an expansion factor is introduced to separate and use the input data. 6.根据权利要求4所述的一种基于锚定卷积网络的癫痫脑电信号预警方法,其特征在于:所述步骤四中对锚定卷积网络ACN模型进行训练的过程如下:6. According to the method for early warning of epilepsy EEG signals based on anchored convolutional network in claim 4, it is characterized in that: the process of training the anchored convolutional network ACN model in step 4 is as follows: 每个患者的脑电信号经过数据处理之后,每个患者有n个发作间期和n个发作前期,每次随机选取1个发作间期和1个发作前期数据段作为测试集,剩下的发作间期和发作前期数据段作为训练集,将训练集带入锚定卷积网络,其中按照发作间期数据在前,发作前期数据在后的方式训练,采用交叉熵作为损失函数,计算ACN模型的预测输出与标签的误差,通过误差的反向传播与随机梯度下降算法更新网络中每一层的参数。After data processing of the EEG signals of each patient, each patient has n interictal periods and n preictal periods. Each time, one interictal period and one preictal period data segment are randomly selected as the test set, and the remaining interictal period and preictal period data segments are used as the training set. The training set is brought into the anchored convolutional network, where the training is carried out in the manner of interictal data first and preictal data later. The cross entropy is used as the loss function, and the error between the predicted output and the label of the ACN model is calculated. The parameters of each layer in the network are updated through the back propagation of the error and the stochastic gradient descent algorithm. 7.根据权利要求6所述的一种基于锚定卷积网络的癫痫脑电信号预警方法,其特征在于:所述步骤四中对测试数据进行预测的过程如下:7. The epilepsy EEG signal early warning method based on anchored convolutional network according to claim 6, characterized in that: the process of predicting the test data in step 4 is as follows: 在测试阶段,先将部分训练数据输入ACN模型中,然后再放入真正需要测试的数据,在测试数据里面,前面会放入训练数据来进行辅助预测,重复多次实验,最终将真正测试的数据上的平均结果作为最终结果。During the testing phase, part of the training data is first input into the ACN model, and then the data that actually needs to be tested is put in. In the test data, the training data is put in front to assist in prediction. The experiment is repeated many times, and finally the average result on the actual test data is taken as the final result. 8.一种用于实现如权利要求1-7任一项所述的基于锚定卷积网络的癫痫脑电信号预警方法的预警装置,其特征在于:包括:8. An early warning device for implementing the epilepsy EEG signal early warning method based on an anchored convolutional network as described in any one of claims 1 to 7, characterized in that it comprises: 采集装置,用于采集癫痫患者的脑电信号的原始数据;An acquisition device for acquiring raw data of electroencephalogram signals of epileptic patients; 处理器,所述处理器通过导线与采集装置相连接,所述处理器包括数据处理模块、模型分析模块、模型预警模块;A processor, the processor is connected to the acquisition device through a wire, and the processor includes a data processing module, a model analysis module, and a model early warning module; 所述数据处理模块用于将采集装置所采集的原始脑电信号数据进行低通滤波、陷波滤波的预处理,然后通过滑动窗口进行样本熵的特征提取;The data processing module is used to pre-process the raw EEG signal data collected by the collection device by low-pass filtering and notch filtering, and then extract the features of sample entropy through a sliding window; 所述模型分析模块内部存储有锚定卷积网络ACN模型,用于将数据处理模块的特征提取后的数据放入ACN模型中进行训练与测试,最后输出测试数据的预测标签数组;The model analysis module internally stores an anchored convolutional network (ACN) model, which is used to put the data extracted from the feature processing module into the ACN model for training and testing, and finally output the predicted label array of the test data; 所述模型预警模块用于将模型分析模块的预测标签数组放入多层滑动窗口中,当认为是发作前期数据时,发出警报信息;The model warning module is used to put the prediction label array of the model analysis module into a multi-layer sliding window, and issue an alarm message when it is considered to be pre-seizure data; 所述警报装置用于接收模型预警模块中的警报信息,当收到警报信息,则发出声音和震动。The alarm device is used to receive the alarm information in the model early warning module, and emits sound and vibration when receiving the alarm information. 9.根据权利要求8所述的预警装置,其特征在于:所述锚定卷积网络ACN模型包括多个连接的锚定块,所述锚定块内部有三个相连的处理网络,每个处理网络包括相连的膨胀因果卷积网络、权重归一化层、激活函数、随机失活以及一个整体的残差连接。9. The early warning device according to claim 8 is characterized in that: the anchored convolutional network (ACN) model includes multiple connected anchor blocks, each of which has three connected processing networks, each processing network includes a connected dilated causal convolutional network, a weight normalization layer, an activation function, random inactivation and an overall residual connection.
CN202311158706.6A 2023-09-08 2023-09-08 Epilepsy EEG signal early warning method and device based on anchored convolutional network Active CN117122288B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311158706.6A CN117122288B (en) 2023-09-08 2023-09-08 Epilepsy EEG signal early warning method and device based on anchored convolutional network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311158706.6A CN117122288B (en) 2023-09-08 2023-09-08 Epilepsy EEG signal early warning method and device based on anchored convolutional network

Publications (2)

Publication Number Publication Date
CN117122288A CN117122288A (en) 2023-11-28
CN117122288B true CN117122288B (en) 2024-10-18

Family

ID=88858137

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311158706.6A Active CN117122288B (en) 2023-09-08 2023-09-08 Epilepsy EEG signal early warning method and device based on anchored convolutional network

Country Status (1)

Country Link
CN (1) CN117122288B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114118361A (en) * 2021-10-29 2022-03-01 北京宇航系统工程研究所 Situation assessment method based on deep learning parameter anchoring
KR20230040630A (en) * 2021-09-16 2023-03-23 고려대학교 산학협력단 Method and apparatus for diagnosing epilepsy based on deep learning

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SI2531501T1 (en) * 2010-02-03 2014-04-30 Takeda Pharmaceutical Company Limited Apoptosis signal-regulating kinase 1 inhibitors
US20170185909A1 (en) * 2013-10-24 2017-06-29 Aon Benfield, Inc. Systems and methods for performing real-time convolution calculations of matrices indicating amounts of exposure
AU2018100318A4 (en) * 2018-03-14 2018-04-26 Li, Shuhan Mr A method of generating raw music audio based on dilated causal convolution network
CN110390351B (en) * 2019-06-24 2020-07-24 浙江大学 A three-dimensional automatic localization system for epileptogenic foci based on deep learning
CN112168167B (en) * 2020-09-25 2022-05-03 北京大学 Method and electronic device for detecting single auditory evoked signal in magnetoencephalography
CN113033284B (en) * 2020-12-22 2022-10-25 迪比(重庆)智能科技研究院有限公司 Vehicle real-time overload detection method based on convolutional neural network
CN112800928B (en) * 2021-01-25 2024-04-09 北京工业大学 Epileptic seizure prediction method of global self-attention residual error network integrating channel and spectrum characteristics
CN113786204B (en) * 2021-09-03 2023-10-03 北京航空航天大学 Epileptic intracranial brain electrical signal early warning method based on deep convolution attention network
CN115730703A (en) * 2022-10-31 2023-03-03 福州大学 Power load prediction method based on DTCN (time delay tolerant network) model of deep cross time convolutional network
CN115813410A (en) * 2022-12-12 2023-03-21 河南大学 Electroencephalogram depression identification method based on improved time sequence convolution network
CN116019461B (en) * 2023-03-01 2024-06-28 厦门大学 Epileptic type detection method combining eye movement and electroencephalogram

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20230040630A (en) * 2021-09-16 2023-03-23 고려대학교 산학협력단 Method and apparatus for diagnosing epilepsy based on deep learning
CN114118361A (en) * 2021-10-29 2022-03-01 北京宇航系统工程研究所 Situation assessment method based on deep learning parameter anchoring

Also Published As

Publication number Publication date
CN117122288A (en) 2023-11-28

Similar Documents

Publication Publication Date Title
Rasheed et al. A generative model to synthesize EEG data for epileptic seizure prediction
CN113786204B (en) Epileptic intracranial brain electrical signal early warning method based on deep convolution attention network
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
EP3777674A1 (en) Time series data learning and analyzing method using artificial intelligence
Boon et al. Paroxysmal atrial fibrillation prediction method with shorter HRV sequences
CN114615924B (en) System and method for seizure detection based on electroencephalogram (EEG) nonlinear variation
Tarassenko et al. Identification of inter-ictal spikes in the EEG using neural network analysis
Li et al. Patient-specific seizure prediction from electroencephalogram signal via multichannel feedback capsule network
Yu et al. Epileptic seizure prediction using deep neural networks via transfer learning and multi-feature fusion
US20190378617A1 (en) Detecting abnormalities in ecg signals
CN112800928B (en) Epileptic seizure prediction method of global self-attention residual error network integrating channel and spectrum characteristics
KR102141185B1 (en) A system of detecting epileptic seizure waveform based on coefficient in multi-frequency bands from electroencephalogram signals, using feature extraction method with probabilistic model and machine learning
Jana et al. Epileptic seizure prediction from EEG signals using DenseNet
CN113995419A (en) A risk prediction system for atrial fibrillation based on heartbeat rhythm signal and its application
Wang et al. Dual-modal information bottleneck network for seizure detection
JP2025011123A (en) Seizure detection system and method based on changes in electroencephalography (EEG) nonlinearity
CN117877734A (en) Mental disorder patient risk level judging system
Pascual et al. Synthetic epileptic brain activities using generative adversarial networks
CN114711790B (en) Newborn electroconvulsive type determination method, newborn electroconvulsive type determination device, newborn electroconvulsive type determination equipment and storage medium
CN117122288B (en) Epilepsy EEG signal early warning method and device based on anchored convolutional network
Shankar et al. Epilepsy Detection Using Embedded Machine Learning
Benfenati et al. Biseizure: Bert-inspired seizure data representation to improve epilepsy monitoring
Wang et al. Epileptic seizures prediction based on unsupervised learning for feature extraction
CN116910642A (en) Information classification method, device, equipment and computer readable storage medium
CN112022149B (en) Atrial fibrillation detection method based on electrocardiosignals

Legal Events

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
GR01 Patent grant
GR01 Patent grant