An epilepsy prediction system based on feature channel fusion and deep learning
By combining feature channel fusion and deep learning, and utilizing t-SNE and short-time Fourier transform with a deep residual shrinking neural network, the problems of excessive dimensionality and high feature information aliasing in epilepsy prediction are solved, thereby improving the accuracy of epilepsy prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-07
- Publication Date
- 2026-03-17
AI Technical Summary
Existing epilepsy prediction methods suffer from excessive dimensionality and high aliasing of feature information, resulting in low prediction accuracy.
We employ a feature channel fusion and deep learning approach. We use the nonlinear dimensionality reduction algorithm t-SNE to fuse feature channels, combine it with short-time Fourier transform to extract time-frequency domain features, and use a deep residual shrinking neural network with soft thresholding denoising and attention mechanism for classification.
It effectively improved the accuracy of epilepsy prediction, reduced the impact of redundant information, and increased the recognition rate.
Smart Images

Figure CN114569141B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of cognitive neuroscience and information technology, and in particular relates to an epilepsy prediction system based on feature channel fusion and deep learning. Background Technology
[0002] Epilepsy is a chronic neurological disorder characterized by sudden, abnormal brain reactions and recurring episodes, caused by abnormal activity of neurons in the brain. These seizures, resulting from excessive neuronal discharge, are often accompanied by disturbances in motor, sensory, emotional, or mental function. Once a seizure occurs, the brain ceases to function normally, manifesting as fainting, loss of balance, convulsions, muscle contractions, loss of consciousness, and altered intuition. For anyone with epilepsy, seizures significantly impact all aspects of life for the patient and their family, and can even be life-threatening. For centuries, fear, misunderstanding, discrimination, and social stigma have surrounded epilepsy. Today, this stigma persists in many countries and can affect the quality of life for those with the disease and their families. Approximately 50 million people worldwide suffer from epilepsy, making it one of the most common neurological disorders globally. Nearly 80% of those with epilepsy live in low- and middle-income countries, and most do not receive the treatment they need. With proper diagnosis and treatment, up to 70% of people with epilepsy can be free from the burden of this disease.
[0003] Epileptic seizures are controllable. Currently, antiepileptic drugs are quite effective in controlling seizures, a boon for most patients with chronic epilepsy. For epilepsy that significantly impacts a patient's life, surgical removal of the epileptic focus is possible; however, this surgery carries significant risks. Due to the complexity of the brain, the lesion may affect other bodily functions, and accurate localization of the lesion cannot be guaranteed. Therefore, early prediction of epilepsy is a prerequisite for seizure control. Early prediction allows patients to take preventative treatment to control seizures and effectively prevents them from engaging in potentially life-threatening activities during seizures. Early prediction of epilepsy is of great significance to patients and their families, as well as to medical professionals. Currently, various screening techniques for epilepsy are available, such as magnetic resonance imaging (MRI), electroencephalography (EEG), and positron emission tomography (PET). Among these, EEG is a convenient and inexpensive method that can continuously capture the electrical activity and hidden features of neurological diseases. EEG recordings are divided into two types: intracranial EEG (iEEG) and scalp EEG (sEEG). Currently, non-invasive scalp EEG recording has significant advantages and is more readily accepted by people. Therefore, scalp EEG recording is the most widely used method for epilepsy detection and prediction.
[0004] With the rapid development of computer technology and advancements in our understanding of fundamental biology, researchers are increasingly drawn to the use of data mining, machine learning, and deep learning techniques for data analysis and signal processing in healthcare, medical practice, and biomedical engineering. These techniques detect and predict data for application in relevant fields. While current understanding lacks a convincing explanation and comprehensive evidence for the origins of epileptic seizures, some early studies suggest that seemingly unpredictable seizures may be predictable, and with continuous improvements in electroencephalography (EEG) recording, EEG-based epilepsy prediction techniques are becoming increasingly prevalent. Summary of the Invention
[0005] Purpose of the Invention: The purpose of this invention is to propose a method for epilepsy prediction based on feature channel fusion and deep learning. This method effectively solves the problems of excessive dimensionality and high feature information aliasing in previous epilepsy prediction methods. In terms of recognition rate, this method has advantages over traditional direct classification after feature extraction, and can effectively improve the accuracy of epilepsy prediction.
[0006] Technical Solution: This invention proposes an epilepsy prediction system based on feature channel fusion and deep learning. The system includes the following modules:
[0007] Data acquisition module: Collects and acquires electrical activity data from continuous electroencephalogram (EEG) recordings of epilepsy patients, filters the epilepsy data, and uses all the filtered electrical activity data to construct the original dataset;
[0008] Preprocessing module: The raw dataset of acquired EEG signals is preprocessed to remove interference caused by equipment and environment during EEG signal acquisition. The preprocessing steps are filtering, channel selection, removal of power frequency interference, removal of artifacts, and re-reference.
[0009] Dataset construction module: Based on the start and end times of epileptic seizures in the collected signals, the defined epileptic interictal period and preictal data are extracted from the preprocessed dataset to construct an epilepsy prediction dataset;
[0010] Segmentation module: A 30-second sliding window is used to segment the data after it has been processed by the dataset assembly module. During the sliding process, each segment is required to overlap by 50%.
[0011] Channel fusion module: The nonlinear dimensionality reduction algorithm t-SNE is used to perform feature channel fusion on the segmented data from the channel dimension;
[0012] Sample feature module: Short-time Fourier transform is used to extract time and frequency domain information from each segment of data after feature channel fusion, and the EEG signals of each segment are converted into a two-dimensional time-frequency tensor composed of frequency axis and time axis to form the sample features to be trained;
[0013] Training module: Construct a deep residual shrinking neural network with different thresholds for each channel as a classifier. Use the network's soft thresholding denoising and attention mechanism to train the classifier using the generated sample features.
[0014] Recognition module: The pre-trained classifier is used to classify and recognize the EEG signals to be recognized, and the recognition results are obtained.
[0015] Preferably, in the data acquisition module, the screening of epilepsy data includes the following steps:
[0016] (1.1) Only patients with fewer than 10 seizures per day were considered for the prediction task;
[0017] (1.2) For an attack that occurs less than 30 minutes after the previous attack, it and the previous attack are considered as one attack, and the start time of the previous attack is taken as the start time of this attack.
[0018] Electrical activity data from continuous electroencephalogram (EEG) recordings of epilepsy patients should include at least 24 hours of recording data, with the times of seizure onset and end marked.
[0019] Preferably, in the preprocessing module, the preprocessing step is performed using the EEGLAB plugin of MATLAB software, as follows:
[0020] (2.1) Filtering: Use an FIR filter to filter out frequencies above 500Hz;
[0021] (2.2) Channel filtering: Remove channels with duplicate names and channels with null values greater than the threshold;
[0022] (2.3) Remove power frequency interference: Use a filter to remove power frequency interference of a preset specific frequency;
[0023] (2.4) Artifact removal: Independent component analysis is used to remove signals from the collected EEG signals that originate from other electrical activities in the environment or body;
[0024] (2.5) Re-reference: The whole brain average reference is used. The average value of all data in the whole brain is used as the reference data. The potential of all electrodes is subtracted from the reference data to obtain a new potential difference, which is used as the new electrode data.
[0025] The processed EEG recording dataset is X(t), with an EEG recording duration of t, a sampling frequency of f, and a number of channels of q.
[0026] Preferably, the dataset building module has the following functions:
[0027] The interictal period is defined as the time between 4 hours before the current epileptic seizure and 4 hours after the end of the previous epileptic seizure. The preictal period is defined as the 30-minute time between 35 minutes and 5 minutes before the epileptic seizure.
[0028] An epilepsy prediction dataset is constructed by extracting defined interictal and preictal data from the preprocessed dataset. This dataset consists of two parts: interictal data X(t1), with a total duration of t1, and preictal data X(t2), with a total duration of t2. The data sampling frequency is f and the number of channels is q.
[0029] Preferably, the segmentation processing module has the following specific functions:
[0030] Interictal data X(t1), with a total duration of t1, is segmented using a 30s sliding window. The overlap between the preceding and following segments is 50%, generating a total of N1 = 2(t1 / 30) - 1 segments of data with a duration of 30s and q channels. The size of a single segment is q × 30f.
[0031] The pre-ictal data X(t2) has a total duration of t2. A 30-second sliding window is used to segment the pre-ictal data with a total duration of t2. The overlap between the previous segment and the next segment is 50%. A total of N2 = 2(t2 / 30)-1 segments of data with a duration of 30 seconds and q channels are generated. The size of a single segment is q×30f.
[0032] Preferably, the specific functions of the channel fusion module are as follows:
[0033] Select a sample from the processed segmented data, with a size of q×30f, where q is the number of channels, f is the sampling frequency, and 30f represents the number of sampling points in 30 seconds;
[0034] Let the channels be the set of all samples in a high-dimensional space, defined as X = {x1, x2, ..., x}. q}, in observing any two samples x in a high-dimensional space i and x j Similarity conditional probability p j|i and p i|j They are represented as follows:
[0035]
[0036]
[0037] Where ||.|| denotes the vector 2-norm, σ i and σ j They are respectively based on data point x i and x jIf the variance of the Gaussian distribution centered at the center is given, then the joint probability p in the high-dimensional space is... ij Represented as:
[0038]
[0039] Let the simulated data points in the low-dimensional space be represented as {y1, y2, ..., y...} n}, any two simulated data points y in low-dimensional space i and y j The joint probability distribution q between them ij It can be represented as:
[0040]
[0041] KL divergence is used to represent the accuracy of the simulation of data points in a higher-dimensional space corresponding to simulated points in a lower-dimensional space. KL divergence is expressed as:
[0042]
[0043] Where P is the joint probability distribution of the high-dimensional observation space, and Q is the joint probability distribution of the low-dimensional embedding space;
[0044] To obtain the optimal low-dimensional data simulation points, gradient descent is used for optimization to obtain the minimum KL divergence, as shown in the following expression:
[0045]
[0046] Minimizing the above equation yields the optimal low-dimensional simulation data points, i.e., the result {y1,y2,…,y}. n This completes the feature channel fusion from the number of channels q to n; the segmented data is then fused from the channel dimension, that is, all q channels are merged into one channel, thus completing the feature channel fusion.
[0047] Preferably, the specific functions of the sample feature module are as follows:
[0048] The time-frequency energy density value is calculated by multiplying the original signal f(t) with a segmented processing time of 30 seconds using a time window function g(tu), performing a Fourier transform, and continuously shifting the result. The method is as follows:
[0049]
[0050] In the formula, f(t) is the original signal with a duration of 30s, g(tu) is the window function, u represents the center of the window in the window function, that is, the windowing and translation operations are performed based on u in the time domain, S(ω,u) is the time-frequency energy density value, where ω represents the frequency domain and u represents the time domain. The window function is represented by a rectangular window g(n), and its expression is as follows:
[0051]
[0052] Where N is the length of the window, the sampling frequency is set to f, n is the number of sampling points, and the value of n is the product of the sampling frequency f and the duration t; during the translation process, the rectangular window is set to overlap with the previous window by 50%;
[0053] The above operations are performed on the data f(t) of each channel of the processed signal segment. A two-dimensional time-frequency tensor of size (f / 2+1)×59 is generated for each signal segment. A time-frequency tensor matrix T1 of size N1×(f / 2+1)×59 is generated for the interictal period after processing, and a time-frequency tensor matrix T2 of size N2×(f / 2+1)×59 is generated for the preictal period. These form the sample features T=[T1,T2] to be trained.
[0054] Preferably, the specific functions of the training module are as follows:
[0055] (8.1) Load the sample features into the convolutional layer of the deep residual shrinking network, perform two-dimensional convolution on it, and denote the output features as A;
[0056] (8.2) Input feature A into the first residual shrinking unit, and then pass through the BN layer for batch normalization, the ReLU layer with ReLU activation function, the two-dimensional convolutional layer (Conv_2d), and the max pooling layer to output feature B. Feature B then passes through the BN layer for batch normalization, the ReLU layer with ReLU activation function, the two-dimensional convolutional layer, and the max pooling layer to output feature C. Calculate the absolute value of C to obtain feature D. After passing through the global average pooling layer (GAP), feature D is obtained as a global average pooling and average feature map. The global average pooling and average feature map is then batch-processed through the BN layer and the ReLU layer and input into two fully connected layers to obtain scaling parameters. The scaling parameters are normalized to between 0 and 1 using the Sigmoid function. The normalized scaling parameters are multiplied by the average value of feature D to obtain the threshold τ.
[0057] Soft thresholding is performed on feature C using a threshold; soft thresholding sets features within the threshold interval [-τ, τ] to 0, and the soft thresholding formula is expressed as:
[0058]
[0059] Where x represents the input feature C, y represents the output feature, and τ represents the threshold;
[0060] The feature after soft thresholding is denoted as E. The feature C is added element by element to the original feature A, and the output is F.
[0061] (8.3) Input the feature F into the second and third layer residual shrinkage units, iterate the process described in (8.2), and output the feature as G;
[0062] (8.4) The features G output by the three residual shrinking units are batch-normalized through BN and ReLU layers to transform the value distribution of each feature into a standard normal distribution with a mean of 0 and a variance of 1. Then, after max pooling, the feature is input into a fully connected layer with an output dimension of 2 for classification, yielding the classification result. The output fully connected layer uses the sigmoid function to convert the data x passed from the previous layer into probabilities. Used for classification, a value less than 0.5 is labeled 0, otherwise a value of 1. The expression is:
[0063]
[0064] Preferably, the specific functions of the recognition module are as follows:
[0065] The EEG signal to be identified is processed through a data acquisition module, a preprocessing module, a dataset assembly module, a segmentation module, a channel fusion module, and a sample feature module to form sample features. These sample features are then input into a trained classifier for classification and recognition to obtain the final recognition result.
[0066]
[0067] If the identification result is pre-seizure, it indicates that the patient with this segment of EEG signal to be identified will have an epileptic seizure within 30 minutes.
[0068] Beneficial effects: Compared with the prior art, the technical solution of the present invention has the following beneficial technical effects:
[0069] This invention proposes a novel solution for epilepsy prediction by fusing feature channels from multidimensional electroencephalograms (EEGs) and extracting the fused time-frequency domain features based on short-time Fourier transform (SFT). This effectively avoids the drawbacks of previous prediction methods, such as excessive dimensionality and high feature information aliasing. Furthermore, to address redundant information, a deep residual contraction neural network with soft-threshold denoising and attention mechanisms is introduced for the first time for epilepsy signal prediction. This reduces the impact of redundant information during training, significantly improving the accuracy of epilepsy prediction. Experimental results on epilepsy patient sample data show that the nonlinear dimensionality reduction algorithm t-SNE can effectively map interictal and preictal channel feature data from high-dimensional to low-dimensional, effectively solving the problems of excessive dimensionality and high feature information aliasing. The extracted feature vectors show good classification results in the deep residual contraction neural network with soft-threshold denoising and attention mechanisms. Attached Figure Description
[0070] Figure 1The proposed epilepsy prediction process framework based on feature channel fusion and deep learning is illustrated in the diagram below.
[0071] Figure 2 The soft threshold function and its derivative in a deep residual shrinking neural network;
[0072] Figure 3 This is a structural diagram of the residual shrinkage unit used in the design;
[0073] Figure 4 The diagram shows the deep residual shrinking neural network structure used in the design. Detailed Implementation
[0074] To make the objectives, technical solutions, and advantages of this invention clearer, the embodiments of this invention will be further described in detail below with reference to the accompanying drawings.
[0075] This invention proposes an epilepsy prediction system based on feature channel fusion and deep learning, which includes the following modules:
[0076] Data acquisition module: Collects and acquires electrical activity data from continuous electroencephalogram (EEG) recordings of epilepsy patients, filters the epilepsy data, and uses all the filtered electrical activity data to construct the original dataset;
[0077] Preprocessing module: The raw dataset of acquired EEG signals is preprocessed to remove interference caused by equipment and environment during EEG signal acquisition. The preprocessing steps are filtering, channel selection, removal of power frequency interference, removal of artifacts, and re-reference.
[0078] Dataset construction module: Based on the start and end times of epileptic seizures in the collected signals, the defined epileptic interictal period and preictal data are extracted from the preprocessed dataset to construct an epilepsy prediction dataset;
[0079] Segmentation module: A 30-second sliding window is used to segment the data after it has been processed by the dataset assembly module. During the sliding process, each segment is required to overlap by 50%.
[0080] Channel fusion module: The nonlinear dimensionality reduction algorithm t-SNE is used to perform feature channel fusion on the segmented data from the channel dimension;
[0081] Sample feature module: Short-time Fourier transform is used to extract time and frequency domain information from each segment of data after feature channel fusion, and the EEG signals of each segment are converted into a two-dimensional time-frequency tensor composed of frequency axis and time axis to form the sample features to be trained;
[0082] Training module: Construct a deep residual shrinking neural network with different thresholds for each channel as a classifier. Use the network's soft thresholding denoising and attention mechanism to train the classifier using the generated sample features.
[0083] Recognition module: The pre-trained classifier is used to classify and recognize the EEG signals to be recognized, and the recognition results are obtained.
[0084] Preferably, in the data acquisition module, the screening of epilepsy data includes the following steps:
[0085] (1.1) Only patients with fewer than 10 seizures per day were considered for the prediction task;
[0086] (1.2) For an attack that occurs less than 30 minutes after the previous attack, it and the previous attack are considered as one attack, and the start time of the previous attack is taken as the start time of this attack.
[0087] Electrical activity data from continuous electroencephalogram (EEG) recordings of epilepsy patients should include at least 24 hours of recording data, with the times of seizure onset and end marked.
[0088] Preferably, in the preprocessing module, the preprocessing step is performed using the EEGLAB plugin of MATLAB software, as follows:
[0089] (2.1) Filtering: Use an FIR filter to filter out frequencies above 500Hz;
[0090] (2.2) Channel filtering: Remove channels with duplicate names and channels with null values greater than the threshold;
[0091] (2.3) Remove power frequency interference: Use a filter to remove power frequency interference of a preset specific frequency;
[0092] (2.4) Artifact removal: Independent component analysis is used to remove signals from the collected EEG signals that originate from other electrical activities in the environment or body;
[0093] (2.5) Re-reference: The whole brain average reference is used. The average value of all data in the whole brain is used as the reference data. The potential of all electrodes is subtracted from the reference data to obtain a new potential difference, which is used as the new electrode data.
[0094] The processed EEG recording dataset is X(t), with an EEG recording duration of t, a sampling frequency of f, and a number of channels of q.
[0095] Preferably, the dataset building module has the following functions:
[0096] The interictal period is defined as the time between 4 hours before the current epileptic seizure and 4 hours after the end of the previous epileptic seizure. The preictal period is defined as the 30-minute time between 35 minutes and 5 minutes before the epileptic seizure.
[0097] An epilepsy prediction dataset is constructed by extracting defined interictal and preictal data from the preprocessed dataset. This dataset consists of two parts: interictal data X(t1), with a total duration of t1, and preictal data X(t2), with a total duration of t2. The data sampling frequency is f and the number of channels is q.
[0098] Preferably, the segmentation processing module has the following specific functions:
[0099] Interictal data X(t1), with a total duration of t1, is segmented using a 30s sliding window. The overlap between the preceding and following segments is 50%, generating a total of N1 = 2(t1 / 30) - 1 segments of data with a duration of 30s and q channels. The size of a single segment is q × 30f.
[0100] The pre-ictal data X(t2) has a total duration of t2. A 30-second sliding window is used to segment the pre-ictal data with a total duration of t2. The overlap between the previous segment and the next segment is 50%. A total of N2 = 2(t2 / 30)-1 segments of data with a duration of 30 seconds and q channels are generated. The size of a single segment is q×30f.
[0101] Preferably, the specific functions of the channel fusion module are as follows:
[0102] Select a sample from the processed segmented data, with a size of q×30f, where q is the number of channels, f is the sampling frequency, and 30f represents the number of sampling points in 30 seconds;
[0103] Let the channels be the set of all samples in a high-dimensional space, defined as X = {x1, x2, ..., x}. q}, in observing any two samples x in a high-dimensional space i and x j Similarity conditional probability p j|i and p i|j They are represented as follows:
[0104]
[0105]
[0106] Where ||.|| denotes the vector 2-norm, σ i and σ j They are respectively based on data point x i and x j If the variance of the Gaussian distribution centered at the center is given, then the joint probability p in the high-dimensional space is... ij Represented as:
[0107]
[0108] Let the simulated data points in the low-dimensional space be represented as {y1, y2, ..., y...} n}, any two simulated data points y in low-dimensional space i and y j The joint probability distribution q between them ij It can be represented as:
[0109]
[0110] KL divergence is used to represent the accuracy of the simulation of data points in a higher-dimensional space corresponding to simulated points in a lower-dimensional space. KL divergence is expressed as:
[0111]
[0112] Where P is the joint probability distribution of the high-dimensional observation space, and Q is the joint probability distribution of the low-dimensional embedding space;
[0113] To obtain the optimal low-dimensional data simulation points, gradient descent is used for optimization to obtain the minimum KL divergence, as shown in the following expression:
[0114]
[0115] Minimizing the above equation yields the optimal low-dimensional simulation data points, i.e., the result {y1,y2,…,y}. n This completes the feature channel fusion from the number of channels q to n; the segmented data is then fused from the channel dimension, that is, all q channels are merged into one channel, thus completing the feature channel fusion.
[0116] Preferably, the specific functions of the sample feature module are as follows:
[0117] The time-frequency energy density value is calculated by multiplying the original signal f(t) with a segmented processing time of 30 seconds using a time window function g(tu), performing a Fourier transform, and continuously shifting the result. The method is as follows:
[0118]
[0119] In the formula, f(t) is the original signal with a duration of 30s, g(tu) is the window function, u represents the center of the window in the window function, that is, the windowing and translation operations are performed based on u in the time domain, S(ω,u) is the time-frequency energy density value, where ω represents the frequency domain and u represents the time domain. The window function is represented by a rectangular window g(n), and its expression is as follows:
[0120]
[0121] Where N is the length of the window, the sampling frequency is set to f, n is the number of sampling points, and the value of n is the product of the sampling frequency f and the duration t; during the translation process, the rectangular window is set to overlap with the previous window by 50%;
[0122] The above operations are performed on the data f(t) of each channel of the processed signal segment. A two-dimensional time-frequency tensor of size (f / 2+1)×59 is generated for each signal segment. A time-frequency tensor matrix T1 of size N1×(f / 2+1)×59 is generated for the interictal period after processing, and a time-frequency tensor matrix T2 of size N2×(f / 2+1)×59 is generated for the preictal period. These form the sample features T=[T1,T2] to be trained.
[0123] Preferably, the specific functions of the training module are as follows:
[0124] (8.1) Load the sample features into the convolutional layer of the deep residual shrinking network, perform two-dimensional convolution on it, and denote the output features as A;
[0125] (8.2) Input feature A into the first residual shrinking unit, and then pass through the BN layer for batch normalization, the ReLU layer with ReLU activation function, the two-dimensional convolutional layer (Conv_2d), and the max pooling layer to output feature B. Feature B then passes through the BN layer for batch normalization, the ReLU layer with ReLU activation function, the two-dimensional convolutional layer, and the max pooling layer to output feature C. Calculate the absolute value of C to obtain feature D. After passing through the global average pooling layer (GAP), feature D is obtained as a global average pooling and average feature map. The global average pooling and average feature map is then batch-processed through the BN layer and the ReLU layer and input into two fully connected layers to obtain scaling parameters. The scaling parameters are normalized to between 0 and 1 using the Sigmoid function. The normalized scaling parameters are multiplied by the average value of feature D to obtain the threshold τ.
[0126] Soft thresholding is performed on feature C using a threshold; soft thresholding sets features within the threshold interval [-τ, τ] to 0, and the soft thresholding formula is expressed as:
[0127]
[0128] Where x represents the input feature C, y represents the output feature, and τ represents the threshold;
[0129] The feature after soft thresholding is denoted as E. The feature C is added element by element to the original feature A, and the output is F.
[0130] (8.3) Input the feature F into the second and third layer residual shrinkage units, iterate the process described in (8.2), and output the feature as G;
[0131] (8.4) The features G output by the three residual shrinking units are batch-normalized through BN and ReLU layers to transform the value distribution of each feature into a standard normal distribution with a mean of 0 and a variance of 1. Then, after max pooling, the feature is input into a fully connected layer with an output dimension of 2 for classification, yielding the classification result. The output fully connected layer uses the sigmoid function to convert the data x passed from the previous layer into probabilities. Used for classification, a value less than 0.5 is labeled 0, otherwise a value of 1. The expression is:
[0132]
[0133] Preferably, the specific functions of the recognition module are as follows:
[0134] The EEG signal to be identified is processed through a data acquisition module, a preprocessing module, a dataset assembly module, a segmentation module, a channel fusion module, and a sample feature module to form sample features. These sample features are then input into a trained classifier for classification and recognition to obtain the final recognition result.
[0135]
[0136] If the identification result is pre-seizure, it indicates that the patient with this segment of EEG signal to be identified will have an epileptic seizure within 30 minutes.
[0137] Figure 1 This is a flowchart of the epilepsy prediction process based on feature channel fusion and deep learning proposed in this invention, which mainly includes the following steps:
[0138] Step 1) Collect and obtain electrical activity data from continuous electroencephalogram (EEG) recordings of epilepsy patients, filter the epilepsy data based on practical application significance, and use all the filtered electrical activity data to construct the original dataset.
[0139] Step 2) Preprocess the raw EEG signal dataset acquired in Step 1) to remove interference caused by equipment and environment during EEG signal acquisition. The preprocessing steps are filtering, channel filtering, power frequency interference removal, artifact removal, and re-reference.
[0140] Step 3) Referring to the epileptic seizure start and end times of the acquired signals in Step 1), extract the defined epileptic interictal period and preictal data from the preprocessed dataset in Step 2 to construct an epileptic prediction dataset.
[0141] Step 4) Use a 30-second sliding window to segment the data processed in Step 3), requiring 50% overlap between segments during the sliding process;
[0142] Step 5) The nonlinear dimensionality reduction algorithm t-SNE is used to perform feature channel fusion on the data segments after the segmentation process in Step 4) from the channel dimension;
[0143] Step 6) Short-time Fourier transform is used to extract time and frequency domain information from each segment of data after feature channel fusion in step 5), and the EEG signals of each segment are converted into a two-dimensional time-frequency tensor composed of frequency axis and time axis to form the sample features to be trained.
[0144] Step 7) Construct a deep residual shrinking neural network with different thresholds for each channel as a classifier. Use the network's unique soft thresholding denoising and attention mechanism, and use the sample features generated in Step 6) to complete the training of the classifier. Figure 2 This refers to the soft threshold function and its derivative in a deep residual shrinking neural network. Figure 3 This is a structural diagram of the residual shrinkage unit used in the design;
[0145] Figure 4 The diagram shows the deep residual shrinking neural network architecture used in the design, where DRSN_Block represents... Figure 3 The residual shrinkage unit.
[0146] Step 8) Use the classifier trained in Step 7) to classify and identify the EEG signal to be identified, and obtain the identification result. For the EEG signal to be identified, first perform the relevant operations in Steps 5) and 6) to extract relevant time-frequency domain features, and then use the trained classifier to classify and identify it, obtaining the final identification result:
[0147]
[0148] If the identification result is pre-seizure, it indicates that the patient with this segment of EEG signal to be identified will have an epileptic seizure within 30 minutes.
Claims
1. A seizure prediction system based on feature channel fusion and deep learning, characterized in that, The system comprises the following modules: Data acquisition module: collect the electrical activity data of continuous electroencephalogram records of epilepsy patients, screen the epilepsy data, and use all the screened electrical activity data to build an original data set; Preprocessing module: preprocess the collected electroencephalogram signal original data set, remove the interference of equipment and environment on the signal during the electroencephalogram signal collection process, and the preprocessing steps are in turn filtering, channel screening, removing power frequency interference, removing artifacts, and re-referencing; Data set building module: refer to the onset and offset time of the collected signal of epilepsy seizure, and build an epilepsy prediction data set from the preprocessed data set by intercepting the defined interictal period and preictal period data; Segmentation processing module: segment the data processed by the data set building module using a 30s sliding window, and require a 50% overlap between segments during the sliding process; Channel fusion module: use the nonlinear dimension reduction algorithm t-SNE to perform feature channel fusion on each segment of data after segmentation processing from the channel dimension; Sample feature module: use short-time Fourier transform to extract time domain and frequency domain information from each segment of data after feature channel fusion, convert each segment of electroencephalogram signal into a two-dimensional time-frequency tensor composed of frequency axis and time axis, and form a sample feature to be trained; Training module: build a deep residual shrinkage neural network with different thresholds for each channel as a classifier, use the network's soft threshold denoising and attention mechanism, and use the generated sample features to complete the training of the classifier; Recognition module: use the trained classifier to classify and recognize the electroencephalogram signal to be recognized, and obtain the recognition result; The segmentation processing module has the following specific functions: Interictal period data X(t1), total duration t1, segment the interictal period data with a total duration of t1 using a 30s sliding window, the overlap between the previous segment and the next segment is 50%, and the total number of 30s, q channel segment data is generated N1=2(t1 / 30)-1; the size of a single segment data is q*30f; Preictal period data X(t2), total duration t2, segment the preictal period data with a total duration of t2 using a 30s sliding window, the overlap between the previous segment and the next segment is 50%, and the total number of 30s, q channel segment data is generated N2=2(t2 / 30)-1; the size of a single segment data is q*30f; The channel fusion module has the following specific functions: Select a segment of processed segmented data, which has a size of q*30f, where q is the number of channels and f is the sampling frequency, and 30f represents the number of sampling points for 30s; The set of channels as samples in high-dimensional space is X = {x1, x2,..., xN}, where xi is a channel. q The conditional probability p i and p j are respectively expressed as: j|i and i|j where ||.|| denotes the vector 2-norm, σ i and σ j are the variances of the Gaussian distributions centered at data points x i and x j , respectively, then the joint distribution probability p ij in high-dimensional space is expressed as: Let the analog data points in the low-dimensional space be represented as {y1, y2, …, y n}, and the joint distribution probability q i between any two analog data points y j and y ij in the low-dimensional space can be represented as: Use KL divergence to represent the simulation correctness of the analog points in the low-dimensional space corresponding to the data points in the high-dimensional space, and the KL divergence is represented as: Where P is the joint probability distribution of the high-dimensional observation space, and Q is the joint probability distribution of the low-dimensional embedding space; In order to obtain the best low-dimensional data simulation point, use gradient descent method for optimization to obtain the minimum KL divergence, and the specific expression is as follows: The optimal low-dimensional simulation data points are obtained by minimizing the above formula, that is, the result {y1, y2, …, y n} is obtained, and thus the feature channel fusion from the channel number q to n is completed; the channel fusion operation is performed on the segmented data from the channel dimension, that is, all q channels are fused into one channel, and the fusion of the feature channel is completed.
2. The seizure prediction system based on feature channel fusion and deep learning according to claim 1, characterized in that, In the data acquisition module, the steps for screening the epilepsy data include: (1.1) Only consider patients with less than 10 seizures per day to perform the prediction task; (1.2) For the seizure whose time interval to the previous seizure is less than 30 minutes, it and the previous seizure are regarded as one seizure, and the seizure onset time of the previous seizure is taken as the seizure onset time of this seizure; The electroencephalogram data recorded by the continuous electroencephalogram of the epilepsy patient should at least contain the recording data of the patient for 24 hours, and the time when the epilepsy starts and ends is marked.
3. The seizure prediction system based on feature channel fusion and deep learning according to claim 2, characterized in that, In the preprocessing module, the preprocessing step is performed using the EEGLAB plug-in of MATLAB software, and the method is as follows: (2.1) Filtering: using FIR filter to filter out frequencies above 500 Hz; (2.2) Channel screening: removing channels with duplicate names and channels with empty values greater than a threshold value; (2.3) Removing power frequency interference: using a filter to remove power frequency interference of a predetermined specific frequency; (2.4) Removing artifacts: using independent component analysis to remove signals from the environment or other electrical activities in the body in the collected electroencephalogram signals; (2.5) Re-reference: using whole brain average reference, taking the average value of all data of the whole brain as reference data, and re-difference the potential of all electrodes with the reference data to obtain new potential difference as new electrode data; Wherein, the processed electroencephalogram recording data set is X(t), the electroencephalogram recording time length is t, the sampling frequency is f, and the channel number is q.
4. The seizure prediction system based on feature channel fusion and deep learning according to claim 3, characterized in that, The functions of the data set construction module are as follows: The interictal period of epilepsy is defined as the period between 4 hours before the current seizure and 4 hours after the end of the last seizure, and the preictal period is defined as the period of 30 minutes between 35 minutes and 5 minutes before the seizure; The defined interictal period and preictal period data set is constructed from the preprocessed data set to construct the epilepsy prediction data set, which includes two parts: interictal period data X(t1) with a total time length of t1, preictal period data X(t2) with a total time length of t2, data sampling frequency f, and channel number q.
5. The seizure prediction system based on feature channel fusion and deep learning according to claim 1, wherein, The specific functions of the sample feature module are as follows: The time window function g(t-u) is multiplied by the original signal f(t) with a length of 30s after segmentation processing, and the time-frequency energy density value is calculated after Fourier transform and continuous translation, and the method is as follows: In the formula, f(t) is the original signal with a length of 30s, g(t-u) is the window function, u represents the center of the window in the window function, that is, the windowing and translation operation is performed according to the time domain u, S(ω, u) is the time-frequency energy density value, wherein ω represents the frequency domain, u represents the time domain, and the window function adopts a rectangular window g(n) represented by the following expression: In the formula, f(t) is the original signal with a length of 30s, g(t-u) is the window function, u represents the center of the window in the window function, that is, the windowing and translation operation is performed according to the time domain u, S(ω, u) is the time-frequency energy density value, wherein ω represents the frequency domain, u represents the time domain, and the window function adopts a rectangular window g(n) represented by the following expression: Wherein, N is the length of the window, set the sampling frequency f, n is the number of sampling points, and the value of n is the product of the sampling frequency f and the time length t; Set the rectangular window to overlap the previous window by 50% during the translation process; Each channel data f(t) of each processed signal is respectively operated as above, a two-dimensional time-frequency tensor with a size of (f / 2+1) * 59 is generated for each signal, a time-frequency tensor matrix T1 with a size of N1 * (f / 2+1) * 59 is generated after processing the interictal period, a time-frequency tensor matrix T2 with a size of N2 * (f / 2+1) * 59 is generated before the ictal period, and a sample feature T = [T1, T2] is formed for training.
6. The seizure prediction system based on feature channel fusion and deep learning according to claim 5, wherein, The specific functions of the training module are as follows: (8.1) Load the sample feature into the convolution layer of the residual shrinkage network, and output the feature A after two-dimensional convolution processing; (8.2) Input the feature A into the first layer of the residual shrinkage unit, and output the feature B after batch normalization processing of the feature by the BN layer, the ReLU layer composed of the Relu activation function, the two-dimensional convolution layer and the maximum pooling layer; The feature B is sequentially processed by the BN layer, the RE LU layer composed of the Relu activation function, the two-dimensional convolution layer and the maximum pooling layer, and the feature C is output; The absolute value of C is obtained to obtain the feature D; The feature map of global mean pooling and average is obtained after the global mean pooling layer, and the feature map of global mean pooling and average is input into two fully connected layers after batch processing by the BN layer and the ReLU layer to obtain the scaling parameter, which is normalized to between 0 and 1 by the Sigmoid function, and the average value of the feature D is multiplied by the normalized scaling parameter as the threshold τ; The threshold is used for soft thresholding of the feature C; The soft thresholding formula is represented as: Wherein, x represents the input feature, i.e. C, y represents the output feature, and τ represents the threshold; The feature E after soft thresholding is recorded as E, and the feature C is added to the original feature A element by element to output F; (8.3) Input the feature F into the second layer and the third layer of the residual shrinkage unit, and iterate the process of (8.2), and output the feature G; (8.4) The features G output by the three-layer residual shrinkage unit are batch normalized by BN layer and ReLU layer, the value distribution of each feature is converted into standard normal distribution with mean of 0 and variance of 1, then it is input into a fully connected layer with output dimension of 2 for classification after maximum pooling, and the classification result is obtained; the output fully connected layer converts the data x passed from the previous layer by the sigmoid function into probability For classification, less than 0.5 label is 0, otherwise label is 1, and the expression is:
7. The seizure prediction system based on feature channel fusion and deep learning according to claim 6, characterized in that, The specific functions of the recognition module are as follows: The sample feature obtained after the electroencephalogram to be identified is processed by the data acquisition module, the preprocessing module, the data set construction module, the segmentation processing module, the channel fusion module and the sample feature module, and the sample feature is input into the trained classifier for classification and recognition to obtain the final recognition result: If the recognition result is the ictal period, it indicates that the patient with this segment of electroencephalogram to be identified will have a seizure within 30 minutes.
Citation Information
Patent Citations
New crown diagnosis system based on deep convolutional neural network and multi-instance learning
CN112150442A
Epileptic seizure prediction method of global self-attention residual network fusing channel and spectrum features
CN112800928A