Epilepsia intracranial electroencephalogram early warning method based on deep convolution attention network

文档序号:385983 发布日期:2021-12-14 浏览:9次 中文

阅读说明:本技术 基于深度卷积注意力网络的癫痫颅内脑电信号预警方法 (Epilepsia intracranial electroencephalogram early warning method based on deep convolution attention network ) 是由 李阳 郭亮晖 遇涛 于 2021-09-03 设计创作,主要内容包括:本发明提供了一种基于深度卷积注意力网络的癫痫颅内脑电信号预警方法,通过采集癫痫患者丘脑前核(Anterior Nucleus of the Thalamus,ANT)处的颅内脑电信号(Intracranial electroencephalography,iEEG)信号进行分析,提取并融合了颅内脑电信号的多尺度时序特征和多频谱特征,同时采取了注意力机制,关注癫痫发作期颅内脑电信号最显著特征,使得本网络的预警准确率有明显提高。在本发明的一个实施例中,在包含5名癫痫患者的颅内脑电信号数据集上进行验证,其中单个病人的平均癫痫预警准确率(Sensitivity,Sn)可达95.0%,每小时误报次率(False Predicting Rate,FPR)小于0.15,在预警效果和模型泛化能力上均优于现有的癫痫预警方法,实现了癫痫的准确快速预警,对临床癫痫疾病的诊断与神经调控具有重要意义。(The invention provides an epilepsia Intracranial electroencephalogram (iEEG) signal early warning method based on a deep convolution attention network, which comprises the steps of collecting an Intracranial electroencephalogram (iEEG) signal at an Antethalamic Nucleus (ANT) of an epilepsia patient for analysis, extracting and fusing multi-scale time sequence characteristics and multi-spectrum characteristics of the Intracranial electroencephalogram signal, and adopting an attention mechanism to pay attention to the most obvious characteristics of the Intracranial electroencephalogram signal in an epilepsia attack period, so that the early warning accuracy of the network is obviously improved. In one embodiment of the invention, the verification is carried out on an intracranial electroencephalogram data set containing 5 epileptics, wherein the average epileptic early warning accuracy (Sn) of a single patient can reach 95.0%, the False alarm Rate (FPR) per hour is less than 0.15, the early warning effect and the model generalization capability are superior to those of the existing epileptic early warning method, the accurate and rapid epileptic early warning is realized, and the method has important significance for the diagnosis and the neural regulation of clinical epileptic diseases.)

1. An epilepsy intracranial electroencephalogram early warning method based on a deep convolution attention network is characterized by comprising the following steps:

step 1, intracranial electroencephalogram signal acquisition:

(1) data of Intracranial electroencephalography (iegc) of 5 epileptics, the number of electrodes is 128 leads, and the sampling frequency is 1024Hz, were clinically collected.

(2) For each patient, pre-seizure data (30 minutes prior to seizure) was collected and recorded for more than 2 times.

(3) For each patient, inter-seizure data (spaced more than 2 hours from the episode period) was collected and 1 hour of inter-seizure data was recorded at each episode.

(4) The intracranial brain electrical signal data set comprises data of 16 epileptic seizures in total, the total time of the collected signals is 20 hours, 2880 intracranial brain electrical signal samples in the early stage of the seizure are contained, and 11520 intracranial brain electrical signal samples in the interval of the seizure are contained.

Step 2, intracranial electroencephalogram signal preprocessing:

(1) and (3) carrying out channel selection on the intracranial electroencephalogram signals, and selecting single-channel intracranial electroencephalogram signals corresponding to thalamic nuclei (ANT) according to the position marks of the implanted electrodes of the patient.

(2) And applying low-pass filtering of 0-64Hz to the signal to remove high-frequency noise in the signal.

(3) And applying notch filtering to the signal to remove power frequency interference in the signal.

(4) The signal is resampled at 256 Hz.

(5) And (3) dividing the signals into data, and dividing the early-onset intracranial electroencephalogram signals and the inter-onset intracranial electroencephalogram signals into signal segments respectively by adopting a sliding window. The sliding window length is set to 5 seconds with zero overlap. Each signal segment contains 1280(5s × 256Hz) sample points.

And 3, constructing a deep convolution attention network:

(1) the channel mapping layer performs time sequence convolution, Batch Normalization (BN) and residual connection operation on the input intracranial electroencephalogram signal segment, and adaptively constructs the optimal representation for subsequent frequency spectrum and time analysis.

(2) The multi-spectrum convolution layer fuses frequency domain analysis and an end-to-end deep learning model, adopts 5 layers of wavelet convolution to form the multi-spectrum convolution layer, and extracts the characteristics delta, theta, alpha, beta and gamma of each frequency band of the intracranial electroencephalogram signal.

(3) The multi-scale time sequence convolution layer adopts 5 independent time sequence convolution layers, each layer comprises different receptive field time sequence convolution, batch normalization and an exponential linear unit, and important multi-scale time sequence characteristics t of the intracranial electroencephalogram signals in the epileptic stage are extracted1、t2、t3、t4、t5

(4) The grouping convolution attention layer improves the quality of the extracted frequency spectrum characteristic and the time sequence characteristic by using an attention mechanism, effectively realizes the characteristic fusion, greatly reduces the calculation complexity by grouping convolution, and obtains 5 groups of characteristic outputs:and inputting the data into a classification layer for classification.

(5) Five sets of features of classification layer to packet convolution attention layer outputAnd performing global pooling, feature splicing and full connection of time dimension, and finally outputting a secondary classification result, namely the probability of the intracranial electroencephalogram signal segment belonging to the early stage of the attack and the interval of the attack.

Step 4, training a neural network model:

and (4) training the intracranial electroencephalogram data of each patient by adopting a leave-one-out method. In addition, the error between the predicted output of the model and the label is calculated by using Cross Entropy (CE) as a loss function, and the parameters of each layer in the network are updated through the back propagation of the error and a random gradient descent algorithm. Repeatedly training the model until the accuracy begins to decrease or the training times is more than 50, and stopping training;

step 5, testing and evaluating the network model:

test data and labels are input, output results are analyzed, and the classification effect of the model is tested by adopting the Area Under the ROC Curve (AUC), the early warning accuracy (Sn), the hourly False alarm Rate (FPR) and the p value.

2. The deep convolutional attention network-based intracranial Epileptic Electroencephalogram (EEG) signal early warning method for epilepsy according to claim 1, which comprises the following steps:

in the step 1, when an epileptic is selected, ethical authentication is required, namely, the epileptic meeting is approved, and meanwhile, an informed consent is required to be signed for a sample. In addition, the collection time problem also needs to be considered, the collection time of each patient is about 3-10 hours, the experiment period is long, and the workload of collecting the experiment samples is large.

3. The deep convolutional attention network-based intracranial Epileptic Electroencephalogram (EEG) signal early warning method for epilepsy according to claim 1, which comprises the following steps:

in said step 2, Deep electrical Stimulation (DBS) of the thalamic pronuclei can normalize the unbalanced process of human Brain excitation and inhibition in the epileptic network due to central connectivity of the thalamic pronuclei and potential role in the transmission of epileptic activity. Therefore, the collection and analysis of the intracranial brain electrical signals at the anterior thalamic nucleus are helpful for better understanding the potential mechanism of epileptic seizure, and have profound significance for the prediction and regulation of epilepsia. In addition, when the prediction effect is ensured, if the number of used channels is reduced, the calculation complexity can be effectively reduced, the difficulty of electrode implantation is reduced, and the pain of a patient is relieved. In the project, a single-channel signal corresponding to the anterior thalamic nucleus is selected according to an implanted electrode position mark of a patient to predict epilepsy.

4. The deep convolutional attention network-based intracranial Epileptic Electroencephalogram (EEG) signal early warning method for epilepsy according to claim 1, which comprises the following steps:

in the step 4, the data of n attacks of each patient are trained by a leave-one-out method, namely, intracranial electroencephalogram data of 1 attack is selected as a test set each time, the remaining data of n-1 attacks are selected as a training set, the experiment is repeated for n times, and finally the average result on the test set is used as a final result.

5. The deep convolutional attention network-based intracranial Epileptic Electroencephalogram (EEG) signal early warning method for epilepsy according to claim 1, which comprises the following steps:

in the step 5, a trained deep convolution attention network is used for testing on the test set, and the output prediction probability is subjected to sliding average by adopting a window with the length of 60 seconds to obtain a smooth prediction probability. And considering the time point when the smooth prediction probability is greater than the early warning threshold value 0.6 as an epilepsy early warning. If the early warning time point is within 15 minutes before the onset to 30 seconds before the onset, the early warning is considered to be a correct early warning, otherwise, the early warning is an error early warning.

Technical Field

The invention provides an epilepsia Intracranial electroencephalogram (iEEG) feature extraction method based on a deep convolutional attention network, provides a new analysis approach for clinical real-time epilepsia early warning, and belongs to the technical field of signal processing and pattern recognition.

Background

Epilepsy is a common neurological disorder disease, and more than forty million patients in the world are affected by epilepsy, so that the epilepsy seriously harms human health. At present, electroencephalogram signals are important basis for epileptic diagnosis and treatment, and visual detection is mainly carried out by observing electroencephalograms of patients by doctors. However, diagnosis of epilepsy by visual inspection is highly subjective, burdens on doctors are heavy, and it is difficult for patients to regulate epilepsy in a timely manner when they have seizures. Therefore, the individual epilepsy electroencephalogram signal early warning technology is very important, the efficiency of epilepsy diagnosis can be improved, and timely warning is carried out in the early stage of the epileptic seizure so as to intervene, regulate and inhibit the epileptic seizure in time.

The epilepsy early warning technology aims at analyzing Electroencephalogram (EGG) of an epileptic, and accurately distinguishing the electroencephalogram in the early stage of a seizure from the electroencephalogram in the interval of the seizure, so that the aim of epilepsy early warning is fulfilled. Previously, most studies first extracted electroencephalogram features from the time domain or frequency domain. However, extracting features in a fixed manner may be affected by factors such as non-stationarity of the brain electrical signal, low signal-to-noise ratio, and heterogeneity between patients, such that the effectiveness of these predefined features for EEG identification is reduced. In recent years, with the rapid development of deep learning, a Convolutional Neural Network (CNN) has achieved a certain application effect in many fields such as image and natural language processing, and many studies begin to adopt a deep learning method to perform automatic epilepsy early warning. Epileptic seizures are the result of the EEG of epileptic patients in brain space and time evolution, most researches are undertaken to extract the space-time characteristics of EEG, but because convolution has the limitation of local receptive field, the traditional CNN can only capture the space characteristics of a small range between channels, and the wide interaction between the channels caused by epilepsia is ignored. In addition, the conventional CNN is essentially equivalent to a low-pass filter, ignoring high frequency components of the signal, so that the neural network learns only part of the spectral features of the EEG, destroying the non-stationarity of the EEG. To make up for the deficiencies of conventional CNNs in feature extraction, some studies have started to study multiflow network structures. However, these methods combine multiple-domain analysis blindly, which often results in redundant information of the obtained features and failure to obtain the most discriminative features. In general, recent deep learning methods rarely perform simultaneous spectrum and time analysis on EEG, and lack adaptive selection of important features when introducing multi-domain features, and still need to be improved on epilepsy early warning effect.

In epilepsy early warning, although both devices and algorithms have evolved well, reliable epilepsy early warning algorithms remain computationally challenging. Although EEG signals have been widely used in epilepsy diagnosis, they are highly susceptible to various bioelectrical noises, and it is a major challenge to accurately analyze and interpret brain activity by excluding the influence of noises on EEG signals. Recently, stereotactic Electroencephalography (SEEG) is widely used, and is commonly used for recording epileptic seizure intervals and seizure activities in the existing diagnosis and treatment technology, and can directly capture intracranial electroencephalogram signals and determine epileptogenic areas in complex cases, wherein the signal-to-noise ratio of the electroencephalogram signals is obviously higher than that of EEG signals on the scalp. In addition, SEEG collects signals in various intracranial Brain regions through Deep electrodes, wherein the Anterior thalamic Nucleus (ANT) is considered as a potential Deep electrical Stimulation (DBS) target due to the pivotal connectivity and potential role in the transmission of epileptic activity, and can normalize the unbalanced process of human Brain excitation and inhibition in epileptic networks (Schulze-Bonhage A. Brain Stimulation as a neuroanatomical approach thermal. Seizure 2017; 44: 169-75.). Therefore, the collection and analysis of intracranial brain electrical signals at the anterior thalamic nucleus helps to better understand the potential mechanism of seizures, and has profound significance in the prediction and regulation of seizures (Yu T, Wang x.high-frequency stimulation of anti nuclear of thramus de synthonies epidemic network in humans. brain, 2018).

The invention provides an epilepsia intracranial electroencephalogram early warning method based on a deep convolution Attention network, which comprises the steps of collecting an intracranial electroencephalogram signal at the anterior thalamic nucleus of an epileptic patient for analysis, combining a frequency domain analysis method with an end-to-end deep learning method, extracting and fusing multi-scale time sequence characteristics and multi-spectrum characteristics of the intracranial electroencephalogram signal, and simultaneously adopting an Attention mechanism (Attention) to pay Attention to the most obvious characteristics of the intracranial electroencephalogram signal in an epileptic seizure period, so that the early warning accuracy of the network is obviously improved, and more accurate classification marks (classification of epileptic seizure intervals and epileptic seizure prophase) can be provided for supervised learning while the instantaneity is ensured. In one embodiment of the invention, an intracranial electroencephalogram data set containing 5 epileptic patients is acquired, the data set contains signals of 16 epileptic seizures in total, the total time of the acquired signals is 20 hours, 2880 samples of intracranial electroencephalograms in early stages of seizures are included, and 11520 samples of intracranial electroencephalograms in inter-seizure stages are included. When the method is tested on an intracranial electroencephalogram signal data set of epilepsy, the average epilepsy early warning accuracy (Sn) of a single patient can reach 95.0%, the False Prediction Rate (FPR) per hour is less than 0.15, the early warning effect and the model generalization capability are superior to those of the existing epilepsy early warning method, accurate and rapid epilepsy early warning is realized, and the method has important significance for diagnosis and neural regulation of clinical epilepsy.

Disclosure of Invention

The invention provides an epilepsia intracranial electroencephalogram early warning method based on a deep convolution attention network. In the data acquisition process of 5 epileptic patients, intracranial electroencephalogram signal data of the early epileptic seizure and the inter-seizure period of each patient are recorded. The acquired signals are preprocessed and divided into signal segments, the signal segments are used as input of a neural network, a network model is trained, epileptic seizure condition prediction (early seizure and inter-seizure) of a single patient is achieved, and meanwhile result comparison is conducted. The method has the advantages that the acquired data of 5 epileptics have excellent early warning effect, and the model has good generalization capability.

In order to achieve the purpose, the invention provides an epilepsia intracranial electroencephalogram signal early warning method based on a deep convolution attention network, which comprises the following steps:

1. collecting intracranial brain electrical signals:

(1) the method is characterized in that intracranial electroencephalogram data of 5 epileptics are clinically collected, the number of electrodes is 128 leads, and the sampling frequency is 1024 Hz.

(2) For each patient, pre-seizure data (30 minutes prior to seizure) was collected and recorded for more than 2 times.

(3) For each patient, inter-seizure data (spaced more than 2 hours from the episode period) was collected and 1 hour of inter-seizure data was recorded at each episode.

(4) The intracranial electroencephalogram signal data set for epilepsy comprises data of 16 epileptic seizures in total, the total time of the collected signals is 20 hours, 2880 samples of intracranial electroencephalograms in early stages of seizures are contained, and 11520 samples of the intracranial electroencephalograms in inter-seizure stages are contained.

2. Preprocessing intracranial brain electrical signals:

(1) and (3) carrying out channel selection on the intracranial electroencephalogram signals, and selecting single-channel signals corresponding to the anterior thalamic nucleus according to the position marks of the implanted electrodes of the patient.

(2) And applying low-pass filtering of 0-64Hz to the signal to remove high-frequency noise in the signal.

(3) And applying notch filtering to the signal to remove power frequency interference in the signal.

(4) The signal is resampled at 256 Hz.

(5) And (3) dividing the signals into data, and dividing the early-onset intracranial electroencephalogram signals and the inter-onset intracranial electroencephalogram signals into signal segments respectively by adopting a sliding window. The sliding window length is set to 5 seconds with zero overlap. Each signal segment contains 1280(5s × 256Hz) sample points.

3. Constructing a deep convolution attention network:

(1) the channel mapping layer performs time sequence convolution, Batch Normalization (BN) and residual connection operation on the input intracranial electroencephalogram signal segment, and adaptively constructs the optimal representation for subsequent frequency spectrum and time analysis.

(2) The multi-spectrum convolution layer fuses frequency domain analysis and an end-to-end deep learning model, adopts 5 layers of wavelet convolution to form the multi-spectrum convolution layer, and extracts the characteristics delta, theta, alpha, beta and gamma of each frequency band of the intracranial electroencephalogram signal.

(3) The multi-scale time sequence convolution layer adopts 5 independent time sequence convolution layers, each layer comprises different receptive field time sequence convolution, batch normalization and an exponential linear unit, and important multi-scale time sequence characteristics t of the intracranial electroencephalogram signals in the epileptic stage are extracted1、t2、t3、t4、t5

(4) The grouping convolution attention layer improves the quality of the extracted frequency spectrum characteristic and the time sequence characteristic by using an attention mechanism, effectively realizes the characteristic fusion, greatly reduces the calculation complexity by grouping convolution, and obtains 5 groups of characteristic outputs:and inputting the data into a classification layer for classification.

(5) Five sets of features of classification layer to packet convolution attention layer outputAnd performing global pooling, feature splicing and full connection of time dimension, and finally outputting a secondary classification result, namely the probability of the intracranial electroencephalogram signal segment belonging to the early stage of the attack and the interval of the attack.

4. Training a neural network model:

and (4) training the intracranial electroencephalogram data of each patient by adopting a leave-one-out method. In addition, the error between the predicted output of the model and the label is calculated by using Cross Entropy (CE) as a loss function, and the parameters of each layer in the network are updated through the back propagation of the error and a random gradient descent algorithm. Repeatedly training the model until the accuracy begins to decrease or the training times is more than 50, and stopping training;

5. testing and evaluating the network model:

test data and labels are input, output results are analyzed, and the classification effect of the model is tested by adopting the Area Under the ROC Curve (AUC), the early warning accuracy (Sn), the hourly False alarm Rate (FPR) and the p value.

The epilepsy intracranial electroencephalogram early warning method based on the deep convolution attention network has the advantages that:

1. intracranial brain signals at the anterior thalamic nucleus of 5 epileptics are collected to predict epilepsy, the total time of the collected signals is 20 hours, and the samples comprise 2880 intracranial brain signal samples at the early stage of seizure and 11520 intracranial brain signal samples at the interval of seizure. Compared with the use of scalp EEG signals, the signal-to-noise ratio of the intracranial EEG signals is high, and the epilepsy prediction result is accurate. In addition, thalamic nucleus single channel signals were selected for prediction of epilepsy based on central connectivity of the thalamic nucleus and potential role in the spread of epileptic activity.

2. The invention provides a deep convolution attention network, does not need to manually extract electroencephalogram characteristics, adopts an attention mechanism, focuses on the most obvious characteristics of intracranial electroencephalograms in epileptic attack periods, can extract effective characteristics of signals, accurately classifies the intracranial electroencephalograms in epileptics, and has high early warning accuracy and low false alarm rate.

3. The method has low model complexity, adopts single-channel intracranial electroencephalogram signals for prediction, has high calculation speed, and can realize real-time and quick early warning of the epilepsy.

Drawings

Fig. 1 is a flow chart of a method of epilepsy warning according to an embodiment of the present invention;

FIG. 2(a) is a diagram of a multi-spectral convolutional layer structure, FIG. 2(b) is a diagram of a multi-scale time-sequential convolutional layer structure, and FIG. 2(c) is a diagram of a block-convolutional attention layer structure;

3(a) -3(b) are diagrams of network-output probability of epilepsy early warning for early warning of two epileptic seizures of patient 3, respectively;

fig. 4 shows a diagram of the early warning time points output for each episode prediction for 5 patients.

Detailed Description

The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.

According to one embodiment of the invention, an epilepsy early warning method based on intracranial electroencephalogram signals of a patient is provided. Intracranial brain signals of an epileptic at an interval of attack and an early stage of attack are collected, a deep convolution attention network is constructed, and epileptic early warning of the epileptic is achieved.

The following specifically describes a flow of an epileptic intracranial electroencephalogram signal early warning method based on a deep convolution attention network, which comprises the following steps:

1. collecting intracranial brain electrical signals:

(1) early preparation

The epileptic selection process comprises the following steps: through ethical authentication, namely the examination and approval of the theory, the sample needs to sign an informed consent. In addition, the collection time problem also needs to be considered, the collection time of each patient is about 3-10 hours, the experiment period is long, and the workload of collecting the experiment samples is large. In the project, 5 epileptics are selected as collection objects.

(2) Signal acquisition

The intracranial electroencephalogram signals of 5 epileptics, the number of electrodes is 128, and the sampling frequency is 1024Hz, are clinically collected. For each patient, collecting data (30 minutes before seizure) before epileptic seizure, and recording more than 2 times of data before seizure; inter-episode data (spaced more than 2 hours from the episode period) was collected and 1 hour of inter-episode data was recorded at each episode. The intracranial electroencephalogram signal data set for epilepsy comprises signals of 16 epileptic seizures in total, the total time of the collected signals is 20 hours, 2880 samples of intracranial electroencephalograms in early stages of seizures are contained, and 11520 samples of the intracranial electroencephalograms in inter-seizure stages are contained.

(3) Time of onset marker

At each seizure, the time points of onset and end of each seizure are recorded to separate the pre-seizure and inter-seizure data.

2. Preprocessing intracranial brain electrical signals:

(1) channel selection

Due to the central connectivity of the thalamic nucleus and potential role in the transmission of epileptic activity, DBS on the thalamic nucleus can normalize the unbalanced process of human brain excitation and inhibition in the epileptic network. Therefore, the collection and analysis of the intracranial brain electrical signals at the anterior thalamic nucleus are helpful for better understanding the potential mechanism of epileptic seizure, and have profound significance for the prediction and regulation of epilepsia. In addition, when the prediction effect is ensured, if the number of used channels is reduced, the calculation complexity can be effectively reduced, the difficulty of electrode implantation is reduced, and the pain of a patient is relieved. Therefore, in the project, according to the implanted electrode position mark of the patient, a single-channel signal corresponding to the anterior thalamic nucleus is selected for epilepsy prediction.

(2) Low pass filtering

And (3) applying low-pass filtering of 0-64Hz to the signal to remove high-frequency noise.

(3) Removing power frequency interference

And a notch filter (60Hz, 120Hz, 180Hz, 240Hz, 300Hz, 360Hz, 420Hz and 480Hz) is adopted to remove the power frequency interference in the signal.

(4) Resampling

The signals are uniformly resampled to 256Hz, so that the sampling rate of all patient data is uniform, the consistency of the length of input data of a neural network is ensured, and all patient data can be trained by adopting a uniform network model.

(5) Data partitioning

In the electroencephalogram signal classification algorithm based on deep learning, signals are generally divided into segments of 2 s-5 s as training and testing data according to different sampling frequencies of the signals. In the project, data division is carried out on intracranial electroencephalograms, and sliding windows are adopted to divide the intracranial electroencephalograms in the early period of onset and the intracranial electroencephalograms in the interval of onset into signal segments respectively. The sliding window length is set to 5s, zero overlap, and each signal segment is obtained to contain 1280(5s × 256Hz) sample points.

We completed the intracranial brain signals pretreatment of 5 epileptics, including signals of 16 epileptic seizures in total, the total time of the collected signals was 20 hours, including 2880 intracranial brain signal samples in the early stage of seizures and 11520 intracranial brain signal samples in the inter-seizure period. The seizure data for each patient are collated in Table 1.

TABLE 1 introduction of intracranial electroencephalogram signal data set for epilepsy

3. Constructing a deep convolution attention network: the structure of the convolutional neural network in the present invention is shown in fig. 1, and specifically as follows:

(1) symbol definition

Defining an epileptic intracranial electroencephalogram signal data set as Di={(x1,y1),…,(xN,yN) N is the total number of intracranial electroencephalogram signal segments; x is the number ofi∈RE×TIs an intracranial electroencephalogram signal segment, comprises E channels, has the length of T and the sampling frequency of si

(2) Channel mapping layer

In order to adaptively construct the best characterization for subsequent spectral and temporal analysis, the intracranial brain electrical signals are first input into a channel mapping layer, which comprises a series of time-series convolution and batch normalization operations. For an input two-dimensional signal x, the convolution at x (i, j) is defined as:

where w is the convolution kernel and m, n are the convolution kernel sizes, respectively. In this item, the convolution kernel size of all timing convolution layers is set to 1 × 3, the step size is 1, and the padding is 1, which ensures that the length of the output signature map is the same as the length of the input signal. The channel mapping layer comprises three layers of time sequence convolution, and residual error connection is adopted to avoid gradient disappearance and accelerate convergence. Aiming at inputting intracranial electroencephalogram signal segment XiThe entire channel mapping layer can be represented as:

whereinWhich represents the concatenation of the residuals,indicating a splicing operation. Thus, the channel mapping layer first maps the intracranial brain electrical signal segments of size 1 × 1 × 1280 into a set of 8 × 1 × 1280 time series representations. The channel mapping layer does not contain an activation function, outputs a dynamic subband matrix through continuous time sequence convolution and residual connection,the size is 9 × 1 × 1280. Compared with the application of spectrum time analysis at the beginning of a model, the dynamic subband matrix provides the representation of the intracranial electroencephalogram signals under different scales for a subsequent network. The structure of the channel mapping layer is shown in fig. 1.

(3) Multi-spectrum convolution layer

In order to fuse the frequency domain analysis with the end-to-end deep learning model, a multi-spectrum block is formed by multilayer wavelet convolution, and the characteristics of each frequency band of the intracranial electroencephalogram are extracted. Characterizing x an inputCEA Wavelet Convolution layer (Wavelet Convolution, WaveConv) is defined as:

whereinSplicing operation g and h are a pair of wavelet convolution kernels; r and s represent the convolution kernel size kernel step size; n is the EEG signal segment length; y isAAnd yDApproximate wavelet coefficients and fine wavelet coefficients, respectively; x is the number ofpIs the output of the periodic filling.

In order to obtain wavelet coefficients of 5 corresponding clinical frequency bands, namely 0-4Hz (delta frequency band), 4-8Hz (theta frequency band), 8-12Hz (alpha frequency band), 13-30Hz (beta frequency band) and 30-50Hz (gamma frequency band), the number of layers L of wavelet convolution is determined by the adopted frequency:from siL is 5 layers for 256 Hz. For the selection of wavelet kernels, the multi-besiest fourth order wavelet (Daubechies order-4, Db4) has good orthogonality and efficient filter implementation, and previous studies have shown that the Db4 wavelet is useful for spectral feature extraction due to its high correlation coefficient with brain signals. In addition, considering that the Db4 wavelet does not contain parameters to be learned,the model complexity can be reduced, so the project selects Db4 as the wavelet convolution kernel. To keep pace with the order of the Db4 filter, the WaveConv step size and kernel size are set to 2 and 8, respectively. The multi-spectrum convolution layer outputs the spectral feature maps of the intracranial brain signals corresponding to 5 frequency bands, and the sizes of the spectral feature maps are 9 multiplied by 1 multiplied by 80 (delta), 9 multiplied by 11 multiplied by 280 (theta), 9 multiplied by 1 multiplied by 160 (alpha), 9 multiplied by 1 multiplied by 320 (multiplied by 0) and 9 multiplied by 1 multiplied by 640 (gamma), respectively. The structure of the multi-spectral convolutional layer is shown in FIG. 2 (a).

(4) Multi-scale time sequential convolutional layer

Considering the heterogeneity among patients and the non-stationarity of the intracranial brain electrical signals, the intracranial brain electrical signals in epileptic period contain important multi-scale time sequence characteristics. Therefore, 5 independent time sequence convolution layers are adopted, and each layer comprises different receptive field time sequence convolution, batch normalization and an Exponential Linear Unit (ELU) to extract the multi-scale time sequence characteristics of the intracranial electroencephalogram. For a one-dimensional signal x, the ELU is calculated as:

where alpha is a learnable parameter. Characterizing x an inputCEDefining a timing convolutional layer as:

ti=ELU(BN(Conv(xCE))) (6)

wherein t isiFor the features obtained after each layer of time series convolution, i ∈ {1,2,3,4,5 }.

In order to realize time-series convolution of a plurality of receptive fields, the sizes of 5 convolution kernels are set to be respectivelyWhereinWhereinIs a rounded down function. Taking into account the input signal to adopt the frequency siIs 256Hz, canK is calculated to be 32, i.e., 5 convolution kernels are respectively set to 32,32,16,8, 4. The multi-scale time sequence convolution layer outputs a time sequence characteristic diagram of the intracranial brain electrical signal corresponding to 5 scales, and the sizes of the time sequence characteristic diagram are respectively 9 multiplied by 1 multiplied by 80 (t)1),9×1×80(t2),9×1×160(t3),9×1×320(t4,),9×1×640(t5). The structure of the multi-scale time-sequential convolutional layer is shown in FIG. 2 (b).

(5) Grouping convolutional attention layers

From the two feature extraction layers, the network captures multi-spectral features (delta, theta, alpha, beta, gamma) and multi-scale time sequence features (t) respectively1,t2,t3,t4,t5). Splicing the multi-scale time sequence characteristics with the multi-spectrum characteristics to obtain 5 groups of mixed characteristics:whereinIndicating a splicing operation. The sizes of the spliced features are 18 multiplied by 1 multiplied by 80, 18 multiplied by 1 multiplied by 160, 18 multiplied by 1 multiplied by 320 and 18 multiplied by 1 multiplied by 640 respectively. The structure of the packet convolution attention layer is shown in fig. 2 (c).

Although rich features are helpful for electroencephalogram decoding, if the above-mentioned mixed features are directly used for classification, information redundancy is usually caused, and decoding performance is poor. Therefore, a grouping convolution attention layer is designed, the quality of the extracted multi-domain features is improved by using an attention mechanism, feature fusion is effectively realized, and the calculation complexity is greatly reduced by grouping convolution. The grouped convolution attention layer consists of group convolution, attention mechanism, batch normalization and ELU operation. For a set of mixed featuresThe packet convolution attention layer is calculated by the following formula:

wherein GConv (·) represents a packet convolution, and in this term, a convolution with a packet 2 is adopted to perform convolution on the input mixed features U, V respectively;a feature map representing the output; attn (-) represents the attention mechanism.

For the grouped convolved feature maps, the attention mechanism recalibrates the features by performing a "compaction" operation that aggregates the feature maps across the time dimension to produce descriptors. Specifically, to take advantage of channel correlation, the compression operation first performs a global average pooling of the input feature maps to compress the global information for the purpose of generating channel statistical features. Second, after extracting the channel-related information from the compression operation, a subsequent "stimulus" operation is applied to exploit the channel correlation. This is achieved by two successive fully connected layers and a softmax function. The generated channel information is then applied to the input features by multiplication of the channel weights and the feature maps. For the input profile x, the attention mechanism is calculated by:

where T is the length of the time dimension of the input feature, W1And W2Respectively, the first layer and the second layer are fully connected, and S (-) represents a softmax function. To 5 groups of mixed featuresRespectively inputting the data into 4 layers of continuous grouping convolution attention layers to obtain 5 groups of characteristic outputs:the sizes are 64 × 1 × 2, 64 × 1 × 7, 64 × 1 × 12, and 64 × 1 × 32, respectively. The outputs of the 5 branches are input into a classification layer for classification.

(6) A classification layer

For five groups of characteristics output by the grouping and convolution attention layer, global pooling is firstly carried out in a time dimension, and the 5 groups of characteristic graphs after pooling are all 64 multiplied by 1. The classification layer then splices 5 sets of feature maps and compresses the excess dimensions to obtain a feature vector of length 320. Inputting the feature vectors into two continuous full-connection layers, wherein the size of the full-connection layers is set to be 64 and 2 respectively, and finally outputting two classification results, namely, inputting the probability of encephalic electroencephalogram signal segments belonging to the early stage of onset and the interval of onset. The structure of the classification layer is shown in fig. 1.

4. Training neural network model

In machine learning and deep learning, Cross-Entropy (CE) is commonly used to measure the difference between two probability distributions and measure the difference between the distribution learned by the model and the true distribution. In the project, a CE training network is adopted, n times of attack data of each patient are trained by a leave-one-out method, namely encephalic electroencephalogram signal data of 1 attack is selected as a test set each time, the rest n-1 times of attack data are selected as a training set, n times of experiments are repeated, and finally an average result on the test set is used as a final result. In each training, when the iterative training is carried out for 50 times or the accuracy begins to decline, the training is stopped, and the model is saved.

5. Testing and evaluating network models

And testing on the test set by using the trained deep convolution attention network, and performing sliding average on the output prediction probability by using a window with the length of 60 seconds to obtain the smooth prediction probability. And considering the time point when the smooth prediction probability is greater than the early warning threshold value 0.6 as an epilepsy early warning. If the early warning time point is within 15 minutes before the onset to 30 seconds before the onset, the early warning is considered to be a correct early warning, otherwise, the early warning is an error early warning. The classification effect of the model is tested by adopting the Area Under the ROC Curve (AUC), the early warning accuracy (Sn), the hourly False alarm Rate (FPR) and the p value. Fig. 3(a) -3(b) show the early warning probability maps of the prediction of 2 episodes for patient 3. Fig. 4 shows the early warning time points output for each patient's prediction for each episode.

(a) Area under ROC curve

The ROC curve is a curve drawn by taking the false positive rate and the true positive rate as horizontal and vertical coordinates respectively according to a series of two classification modes. By means of the ROC curve, AUC values can be calculated, and classification performances of different methods can be compared. The closer to the upper left corner the ROC curve corresponds to a larger AUC value, representing better classification performance.

(b) Early warning accuracy rate

The early warning accuracy, also called sensitivity, is the percentage of the number of correct early warnings in the total number of attacks. Defining early warning accuracy rate:

where N is the number of correct forewarning events and N is the total number of epileptic seizures.

(c) Rate of false alarms per hour

The false alarm rate per hour is the false alarm frequency of the epilepsy early warning algorithm in unit time, and the unit is times/h. Defining the rate of false alarms per hour:

wherein T is the number of false alarms, and T is the total duration (unit/h) of the intracranial electroencephalogram signal.

(d) p value

The p-value measures the improvement of the algorithm over the random predictor. For different epilepsy early warning methods, the sensitivity of the algorithm and the early warning time ratio rhowWill generally be different. RhowThe ratio of the time spent in the pre-warning by the finger algorithm to the total time. If an algorithm has better sensitivity, but the early warning time is longer, the algorithm effect cannot be better. To weigh the sensitivity versus the early warning time ratio for the performance of the algorithm, the increase in sensitivity of the algorithm relative to the stochastic predictor can be calculated as follows:

wherein tau iswIs the duration of the early warning, i.e. after one early warning, if tau iswIf epileptic seizure exists in the time, the epileptic seizure is considered as a correct early warning, and tau is selected in the itemw=15min;τw0Is an early warning interval, i.e. the early warning time point and the attack time point are at least ensured to have tauw0The interval of time is considered as a correct early warning, and tau is selected in the projectw0= 30s;λwIs a poisson's ratio parameter, calculated by the following formula:

to evaluate the improvement of the algorithm over the stochastic predictor, assuming that the algorithm successfully identified N of the N episodes on a certain patient, the p-value can be calculated:

and (3) carrying out epilepsy early warning on a single patient by using the obtained data set, sequentially training the models, and finally obtaining early warning results as shown in a table 2. As can be seen from the early warning results on the intracranial electroencephalogram signals of 5 patients with epilepsy, the network model provided by the invention has higher early warning accuracy and lower false alarm rate. In addition, data of 15 minutes before the onset and 30 minutes before the onset are respectively selected as the prophase of the onset, a neural network is trained, and finally obtained early warning results are shown in table 2. The comparison result shows that the early warning accuracy can be higher by training by taking the 15 minutes before the attack as the data at the early stage of the attack.

TABLE 2 epilepsy early warning result table for single patient

The project selects two Deep learning algorithms aiming at electroencephalogram signal classification as comparison methods, and the Deep Convolutional networks (R.T. Schirrrmester, J.T. Springberg, Deep learning with a connected neural network for EEG decoding and visualization,2017), Convolutional neural networks (N.D. troung, A.D. Nguyen, connected neural network for section prediction using intra-cerebral arterial evaluation and visualization, 2018) based on Short-time Fourier Transform (STFT), and experiments are carried out on intracranial electroencephalogram signal data sets. When the two comparison methods are used for epilepsy early warning, the experimental steps are consistent with the deep convolution attention network provided by the project, and the comparison result of the average epilepsy early warning effect is listed in table 3. It can be seen from the table that, compared with other deep learning methods, the epilepsia intracranial electroencephalogram signal early warning method based on the deep convolution attention network provided by the invention has the advantages of high early warning accuracy, low false alarm rate, good real-time performance and the like, is a research hotspot in the fields of epilepsia early warning, biological feature recognition, artificial intelligence and the like, and has wide application prospects in clinical epilepsia diagnosis and treatment. The epilepsia intracranial electroencephalogram signal early warning method based on the deep convolution attention network realizes the fusion of multiple characteristics, has high accuracy, and has great significance when being expanded to be used in other fields such as disease, health monitoring and the like.

TABLE 3 comparison of epilepsy early warning average results for different methods

The depth convolution attention network-based epilepsia intracranial electroencephalogram signal early warning method provided by the invention is described in detail above, but obviously, the scope of the invention is not limited thereto. Various modifications of the above described embodiments are within the scope of the invention without departing from the scope of protection as defined by the appended claims.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于卷积网络和长短期记忆网络的二便预警系统及方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!