Epileptic seizure signal detection method based on fuzzy clustering and long-short term memory network

Through the combination of fuzzy clustering and long-term memory networks, the use of watches to collect physiological signals is solved, and the problems of large size and low detection performance of epilepsy detection equipment in the prior art are achieved, portable and efficient epilepsy seizure monitoring are achieved, and detection is improved accuracy and practicality.

CN118902392AActive Publication Date: 2024-11-08XI AN JIAOTONG UNIV

Patent Information

Application Number
CN202410977726.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-11-08
Estimated Expiration
2044-07-22

AI Technical Summary

Technical Problem

The existing epileptic seizure detection methods have problems such as large equipment size, inconvenience, insufficient computing speed and battery life, and the signal is easily disturbed, resulting in low detection performance and difficult to achieve efficient and accurate epileptic seizure monitoring.

Method used

Using epileptic seizure signal detection method based on fuzzy clustering and long-term memory networks, acceleration, angular velocity and surface electromyography signals are collected through watch devices, data segmentation, filtering, feature extraction and fuzzy C-mean clustering are performed, and combined with LSTM model Classification, reduce algorithm complexity and improve real-time.

Benefits of technology

It realizes fast and accurate epilepsy detection, improves the accuracy and practicality of the detection, reduces the size and calculation needs of the equipment, enhances the model's ability to generalize new data, and is suitable for monitoring epilepsy patients in daily life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118902392A_ABST
    Figure CN118902392A_ABST
Patent Text Reader

Abstract

The invention discloses an epileptic seizure signal detection method based on fuzzy clustering and a long-short term memory network, and the method comprises the steps: carrying out the collection and preprocessing of a physiological signal, carrying out the feature extraction, dividing a sample into a non-seizure period sample and a potential seizure period sample through fuzzy C-means clustering FCM, reconstructing the potential seizure period sample, inputting an LSTM model, and carrying out the training, estimating the attack probability of the sample in the potential attack period according to the trained LSTM model; according to the method, two-stage classifiers are used, and through screening of motion states, the algorithm complexity is reduced, and the algorithm real-time performance is improved; meanwhile, the fuzzy C-means clustering and the long and short term memory network are combined, the time sequence information utilization rate is increased, the algorithm performance is effectively improved, the epileptic seizure can be quickly and accurately judged, and the accuracy and practicability of epileptic seizure detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of machine learning and pattern recognition, and particularly relates to an epileptic seizure signal detection method based on fuzzy clustering and long short-term memory network, which combines fuzzy C-means clustering and long short-term memory network algorithms to improve the accuracy and efficiency of epileptic seizure signal detection. Background Art

[0002] Epilepsy is a relatively common neurological disease that affects approximately 50 million people worldwide. The main feature of epilepsy is the sudden, repeated and unexpected abnormal discharge of neurons, which leads to transient brain dysfunction. This disorder may manifest as sensory disturbances, loss of consciousness, limb twitching, or even complete loss of consciousness and body rigidity and twitching, the so-called "grand mal seizure". The frequency and severity of epileptic seizures greatly affect the patient's quality of life.

[0003] At present, the epilepsy attack signal detection method based on EEG signals has relatively strict requirements on the signal acquisition effect. It requires the guidance of professionals during acquisition, is difficult to carry out outside the hospital, and the cost is relatively high. EEG equipment is large and difficult to carry, making it difficult to monitor epilepsy patients in daily life. In addition, EEG signals are easily interfered by external signals. Using EEG signals alone often results in signal misjudgment and low detection performance.

[0004] The epilepsy signal detection method based on ECG signals also faces the problem of difficult signal acquisition, and ECG signals are easily disturbed by other intense activities, with poor stability, and the results have relatively large errors. Therefore, the existing solutions have relatively high requirements on the computing speed and endurance of hardware devices, which also limits the miniaturization of the equipment.

[0005] The patent application with patent number CN202410322510.4 discloses a real-time detection system for single-channel EEG signals of epilepsy patients. The system measures the first slope of the EEG signal in the time domain space and compares the first slope with the standard slope to obtain a first comparison result; performs a fast Fourier transform on the EEG signal to be measured in the measurement time window to obtain the corresponding frequency domain information; uses a power processing module to obtain the first power of the EEG signal to be measured in the measurement time window, and compares the first power with the standard power to obtain a second comparison result; and marks the EEG signal to be measured in the measurement time window according to the second comparison result. The first disadvantage is that a large EEG device is used for epilepsy detection, which is not conducive to the patient's carrying in daily life; the second is that the system only uses basic signal processing and feature extraction, and compares with the standard slope, and does not have a universal epilepsy detection function.

[0006] The patent application with patent number CN201910967804.1 discloses an epilepsy EEG prediction method based on convolution and recurrent neural network combined with time multi-scale. The EEG signals of N-lead epilepsy patients are divided into inter-period and pre-period data according to the distance from the seizure period, and the sliding window segmentation is performed, and the pre-period samples are added. The inter-period samples have no overlap. After that, the pre-processed samples are decomposed into three layers of wavelet packets to obtain the wavelet coefficients of eight frequency bands, and then reconstructed back to the time domain signal of the corresponding frequency band, and the correlation coefficient between electrodes is extracted as the feature matrix and input into the convolution network. The epilepsy EEG signal with high-level representation of the data is learned through the continuous fusion of convolution kernel data. However, the disadvantages of this technology are that the first is that there is no balance between seizure and non-seizure samples, which may cause the model to have a preference for non-seizure samples. The second is that only frequency domain features are used during model training, and the high-level representation of time domain features is lost, which may cause the model training accuracy to be low. The third is that there is no channel selection, and all the data of N-lead epilepsy patients' EEG signals are used as input to the model. The training time of the model is long and the hardware requirements of the computer are high.

[0007] There is currently no effective solution to the problem of low epileptic seizure detection performance in related technologies. Therefore, it is of great clinical significance to develop an accurate, efficient and easy-to-implement epileptic seizure signal detection method. Summary of the invention

[0008] In order to overcome the defects of the above-mentioned existing epileptic seizure detection algorithms and better meet the current requirements of high real-time, portability and low cost of acquisition equipment, the present invention provides an epileptic seizure signal detection method based on fuzzy clustering and long short-term memory network. By analyzing physiological signals, a two-level classifier is used. By screening the motion state, the algorithm complexity is reduced and the real-time performance of the algorithm is improved. At the same time, fuzzy C-means clustering and long short-term memory network are combined to improve the utilization rate of temporal information, effectively improve the algorithm performance, and can quickly and accurately determine epileptic seizures, so as to improve the accuracy and practicality of epileptic seizure detection.

[0009] To achieve the above object, the technical solution of the present invention is as follows:

[0010] The epileptic seizure signal detection method based on fuzzy clustering and long short-term memory network comprises the following steps:

[0011] Step 1: Data collection and preprocessing: Use a wristwatch device with an accelerometer, a gyroscope and a surface electromyography sensor to continuously collect the user's acceleration signal, angular velocity signal and surface electromyography signal, segment the original data, evaluate the signal quality through threshold detection of the electromyography signal mean range, and use a digital filter to filter and denoise;

[0012] Step 2: Feature extraction: Extract features from samples with qualified signal quality assessment, obtain feature values ​​from samples with unqualified signal quality through linear interpolation, and perform data normalization;

[0013] Step 3: Fuzzy C-means clustering FCM: Input the features extracted from each sample into the fuzzy C-means clustering FCM model, perform motion pattern recognition on the sample, and divide the sample into non-seizure period samples and potential seizure period samples. The seizure probability of non-seizure period samples is zero, while the potential seizure period samples need further analysis to determine the seizure probability;

[0014] Step 4: Long short-term memory network LSTM classification; reconstruct the potential seizure period samples according to the output of the FCM model in step 3, input them into the LSTM model for training, and estimate the seizure probability of the potential seizure period samples according to the trained LSTM model;

[0015] Step 5: Post-processing and seizure judgment; forward mean filtering is performed on the sample seizure probability output by the FCM model and the LSTM model. If 9 consecutive sample outputs exceed the pre-defined threshold, it is regarded as an epileptic seizure event; if multiple seizure events occur within 5 minutes, they are regarded as the same epileptic seizure event.

[0016] In step 1, the wristwatch device is a wearable physiological signal collection device worn on the wrist, and collects physiological signals through semi-embedded electrodes in contact with the skin;

[0017] The collected acceleration, angular velocity, and surface electromyography signals all include the attack state and the non-attack state. The collection time is t, the unit is s, the number of collection groups is l, and the sampling frequency is f. s , the unit is Hz, that is, the time series has a total of t×l×f s Duration of acceleration, angular velocity, and surface electromyographic signals;

[0018] In the process of data collection, acceleration, angular velocity, and surface electromyography signals correspond to different sampling frequencies f s .

[0019] In step 1, the specific process of data preprocessing is as follows:

[0020] (1) Data segmentation

[0021] First, the data is divided into X-second data segments as samples, 4≤X≤8, and the data is segmented using an X-second sliding time window with an overlap of X-1 seconds. The overlap rate between the latter sample and the previous sample is maintained at 80% to 90%.

[0022] (2) Signal quality assessment

[0023] The signal quality is evaluated using the mean range. The mean range of the sample is defined as the difference between the maximum and minimum values ​​of the average signal value per second within the sample time window. The calculation formula is:

[0024] RM=max(x)-min(x)

[0025] Among them, x represents the vector composed of the mean value of the electromyographic signal every second;

[0026] When the mean value of the electromyographic signal of the sample exceeds 70 μV, the sample signal quality is considered unqualified; otherwise, the sample signal quality is considered qualified;

[0027] (3) Digital filtering

[0028] For the acceleration and angular velocity signals, a Butterworth filter is used to perform 0.5Hz high-pass filtering and 15Hz low-pass filtering to remove interference signals;

[0029] The surface electromyography signal was subjected to 10 Hz high-pass filtering using a Butterworth filter to remove low-frequency interference, and a 49-51 Hz notch process was performed.

[0030] The specific process of feature extraction and normalization in step 2 is as follows:

[0031] (1) Feature extraction

[0032] Extract amplitude features and frequency features from acceleration, angular velocity and surface electromyography signals. Amplitude features include average amplitude, root mean square, standard deviation, energy, quartile, standard deviation, interquartile range, kurtosis coefficient, skewness coefficient, histogram frequency, waveform length, Jerk, SD2, and number of zero crossings; frequency features include relative power, median frequency, average frequency, quantile frequency, peak frequency, maximum power spectrum density, and power spectrum standard deviation.

[0033] (2) Normalization

[0034] Normalize all features by zscore.

[0035] Among them, X norm represents the normalized features, X represents the original features, represents the feature mean, and σ(X) represents the feature standard deviation.

[0036] The specific process of step three is:

[0037] (3.1) Dataset division

[0038] Randomly divide the entire data set into N data subsets of equal size, 1≤N≤10; select one of the data subsets as the test set and the other N-1 data subsets as the training set. Repeat this process at least five times to ensure that each subset is used as a test set once;

[0039] (3.2) Training set sampling

[0040] For each training set, systematic sampling is used to divide the training set into M training subsets. The indexes of the starting samples are 1, 2, ..., M, respectively, and the training subsets D1, D2, ..., D M

[0041] (3.3) Feature Importance Ranking

[0042] For each training subset, calculate the Laplacian score and rank the feature importance;

[0043] (3.3.1) Construct a 10-nearest neighbor graph. The specific steps are as follows:

[0044] First, calculate the Euclidean distance between all sample points in the training subset:

[0045]

[0046] Among them, n represents the length of the sample feature sequence;

[0047] Then, determine the nearest domain. For each data point, find the 10 other data points closest to it as its nearest neighbors. Finally, construct the similarity matrix S. ij , calculate the data point x based on the Euclidean distance between data points i and x j The similarity between:

[0048]

[0049] (3.3.2) Calculate the Laplacian score LS(f r ), the specific process is as follows:

[0050] First, calculate the degree matrix D ii :

[0051]

[0052] Then, construct the Laplacian matrix L:

[0053] L=D–S

[0054] Finally, the Laplacian score LS(f r ):

[0055] Define f r =[x 1r ,x 2r ,…,x mr ],make

[0056]

[0057] (3.3.3) Rank the features by importance;

[0058] For each feature, the Laplacian score LS(f r ) Sort the features from small to large. The position of the feature in the sorted feature sequence is defined as the rank of the feature, that is, the rank ranges from 1 to 71. The smaller the rank of the feature, the more important the feature.

[0059] (3.4) Grid search the number of clusters C and the number of features K;

[0060] (3.4.1) Initialization: Set the fuzzy coefficient m of FCM to between 1 and 2;

[0061] (3.4.2) Iteration: Perform grid search on the number of clusters C and the number of features K on each data subset, sort the features of acceleration and angular velocity from large to small according to feature importance, and train the FCM model in the parcel feature selection with the first K features as the feature subset and C as the number of clusters;

[0062] (3.4.3) Evaluation: The silhouette coefficient of all samples is used as the evaluation index of the FCM model;

[0063] First, calculate the silhouette coefficient s(i) for each sample:

[0064]

[0065] Where a(i) is the average distance from data point i to other points in its cluster:

[0066]

[0067] b(i) is the average distance from data point i to all points in its nearest other clusters:

[0068]

[0069] Then, calculate the silhouette coefficient for all samples:

[0070]

[0071] (3.4.4) Determine the optimal parameters: When the average value of the silhouette coefficient of the M training subsets reaches the maximum value, the corresponding number of clusters C and the number of features K are optimal. The optimal feature subset is the set of the first K features with the largest average importance among the M training subsets.

[0072] (3.5) Training FCM model

[0073] According to the optimal subset and the number of clusters, the FCM model is trained and tested to determine which clusters may correspond to epileptic seizure signals. The specific process is as follows: the clusters are arranged from small to large according to the distance from the cluster center to the origin. The clusters are represented as G1, G2..., among which G1 is regarded as a non-seizure sample and other clusters are regarded as potential non-seizure samples.

[0074] The step 4 is specifically:

[0075] (4.1) Reconstructing the LSTM training set

[0076] On the entire training set, the LSTM model is trained according to the feature selection and parameter selection results of FCM. The input of LSTM is all K features of s consecutive samples.

[0077] First, for each sample except G1, the sample and the previous s-1 consecutive samples form an LSTM sample, and the corresponding sample label is the label of the last sample;

[0078] Then, according to the clustering result of the sth sample in the LSTM sample, the LSTM sample is divided into C-1 training sets;

[0079] (4.2) Training LSTM model

[0080] For these C-1 LSTM training sets, LSTM models are trained separately to obtain C-1 LSTM models. The specific structure of the LSTM model is as follows:

[0081] Input layer: The input of the LSTM model is a s*K time series with a sequence length of s and a feature dimension of K. The feature extraction results in a 1*K feature sequence. Therefore, when the feature sequence of a sample is passed through the FCM model and input into the LSTM network, the current sample and its previous s-1 samples are concatenated into one LSTM sample. The sample label is the label of the current sample and has nothing to do with the labels of the previous s-1 samples.

[0082] LSTM layer: contains multiple hidden layer units, and then outputs as a sequence;

[0083] Dropout layer: In order to prevent overfitting, the dropout layer is introduced, and the dropout rate is set to 0-0.5;

[0084] The LSTM layer after the Dropout layer contains multiple hidden layer units and only outputs the predicted value at the last moment.

[0085] Fully connected layer: contains multiple neurons;

[0086] Activation function: The activation function selects the softmax function:

[0087]

[0088] Where i is 1 or 2; when i = 1, σ(z) i represents the probability that the sample is a non-attack sample; when i = 2, σ(z) i represents the probability that the sample is an attack sample; z j represents the input vector;

[0089] Output layer: LSTM outputs the probability that the sample is a non-attack sample or an attack sample, and only the probability of the attack sample is selected for output;

[0090] During LSTM training, the batch size is set to 2 N , select the cross entropy loss function as the cost function, use the Adam optimizer, set the learning rate to 0.000001~0.01, set the number of iterations to 20~100, and stop the iteration when the validation set loss is higher than the minimum loss for q consecutive iterations, where q is 20% of the number of iterations;

[0091] (4.3) Testing the LSTM model

[0092] For each test set, the potential seizure samples are reconstructed and input into the corresponding LSTM model for testing to estimate the seizure probability of the potential seizure samples in the test set.

[0093] The step five is specifically as follows:

[0094] (5.1) Mean filtering

[0095] Smooth all outputs using a 6-point forward mean filter:

[0096]

[0097] Among them, y i Represents the probability of onset after processing, which is the average of the probability of onset of the current sample output by the model and the probability of onset of the previous five samples;

[0098] (5.2) Criteria for judging seizure events

[0099] If 9 consecutive sample outputs exceed the predefined threshold, it is considered an attack event;

[0100] If multiple seizure events occurred within 5 minutes, they were considered as the same seizure event.

[0101] Compared with the prior art, the present invention has the following advantages:

[0102] (1) In step 1 of the present invention, a wristwatch device is used to collect physiological signals, thereby realizing non-invasive seizure detection and improving patient comfort and device convenience.

[0103] (2) In step 3, clustering is used for data preprocessing to improve algorithm efficiency: Fuzzy C-means clustering can effectively identify and process uncertainty and ambiguity in data by providing the membership of each data point to multiple clusters. This preprocessing reduces the complexity of data that needs to be processed by the subsequent LSTM classifier, especially making boundary decisions more accurate and effective.

[0104] (3) In steps 3 and 4, a two-layer classifier model was built to improve classification accuracy: by first performing fuzzy C-means clustering, the LSTM classifier can model key features more accurately, especially on the feature vectors formed by the cluster centers. This not only improves the classification accuracy, but also enhances the model's ability to generalize to new data.

[0105] In summary, the present invention uses a two-level classifier through the analysis of physiological signals, and reduces the algorithm complexity and improves the real-time performance of the algorithm by screening the motion state; at the same time, it combines fuzzy C-means clustering and long short-term memory network to improve the utilization rate of temporal information, effectively improves the algorithm performance, and can quickly and accurately determine epileptic seizures, so as to improve the accuracy and practicality of epileptic seizure detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0106] Figure 1 This is a flow chart of the algorithm used in the present invention.

[0107] Figure 2 This is the physiological signal acquisition wristwatch device and internal sensor spatial coordinate system used in the experiment.

[0108] Figure 3 is the electromyographic signal waveform and its signal quality evaluation result, where: Figure 3 (a) is the electromyographic signal disturbed by motion artifacts. Figure 3 (b) in the figure is the signal quality evaluation result of the electromyographic signal.

[0109] Figure 4 To preprocess the acceleration, angular velocity, electromyographic signal waveform and power spectrum before and after, Figure 4 (a) in the figure is the waveform of the signal before and after preprocessing. Figure 4 (b) in the figure is the power spectrum of the signal before and after preprocessing.

[0110] Figure 5 is the LTSM network structure used.

[0111] Figure 6 Figure 2 is the algorithm post-processing and seizure detection strategy, where the solid red line represents the sample seizure probability curve after mean filtering, the dotted red line represents the seizure probability threshold, and the arrow indicates that a seizure event is detected. DETAILED DESCRIPTION

[0112] The process and advantages of the present invention will be described in detail below with reference to the accompanying drawings.

[0113] The specific experiment of the present invention is carried out under the Windows 10 (64-bit) operating system, and the overall operating environment is based on Matlab R2020b.

[0114] Reference Figure 2 During the experiment, the watch device used was the independently developed Biovital epilepsy watch, with patent application number 202321390683.7; the detailed description of the device is as follows: The Biovital epilepsy watch is a wearable device that monitors and alarms epileptic seizures by collecting multimodal biological signals from the wrist. It collects wrist acceleration, angular velocity, surface electromyography, etc., which can effectively reflect the biological markers of epileptic seizures, and trains the fusion analysis algorithm model of the three modal data, thereby realizing the monitoring, alarm and quantitative evaluation of epilepsy.

[0115] Reference Figure 1 , an epileptic seizure signal detection method based on fuzzy clustering and long short-term memory network, comprising the following steps:

[0116] Step 1: Data collection and preprocessing: Use a wristwatch device with an accelerometer, a gyroscope and a surface electromyography sensor to continuously collect the user's acceleration signal, angular velocity signal and surface electromyography signal, segment the original data, evaluate the signal quality through threshold detection of the electromyography signal mean range, and use a digital filter to filter and denoise;

[0117] Step 2: Feature extraction: Extract features from samples with qualified signal quality assessment, obtain feature values ​​from samples with unqualified signal quality through linear interpolation, and perform data normalization;

[0118] Step 3: Fuzzy C-means clustering FCM: Input the features extracted from each sample into the fuzzy C-means clustering FCM model, perform motion pattern recognition on the sample, and divide the sample into non-seizure period samples and potential seizure period samples. The seizure probability of non-seizure period samples is zero, while the potential seizure period samples need further analysis to determine the seizure probability;

[0119] Step 4: Long short-term memory network LSTM classification; reconstruct the potential seizure period samples according to the output of the FCM model in step 3, and input them into the LSTM model for training, and estimate the seizure probability of the potential seizure period samples according to the trained LSTM model.

[0120] Step 5: Post-processing and seizure judgment; perform 6-dimensional forward mean filtering on the sample seizure probability output by the FCM model and LSTM model. If 9 consecutive sample outputs exceed the pre-defined threshold, it is considered an attack event; if multiple seizure events occur within 5 minutes, they are considered to be the same attack event.

[0121] In step 1, the wristwatch device is a wearable physiological signal collection device worn on the wrist, and collects physiological signals through semi-embedded electrodes in contact with the skin;

[0122] The collected acceleration, angular velocity, and surface electromyography signals all include the attack state and the non-attack state. The collection time is t, the unit is s, the number of collection groups is l, and the sampling frequency is f. s , the unit is Hz, that is, the time series has a total of t×l×f s Acceleration, angular velocity, and surface electromyography signals of duration.

[0123] In the process of data collection, the acceleration, angular velocity, and surface electromyography signal modal signals correspond to different sampling frequencies f s ,The accelerometer and gyroscope sampling frequency used in this device is 50Hz, and the surface electromyography sampling frequency is 200Hz.

[0124] Taking the acceleration signal as an example, the collected acceleration signal is expressed as Where l represents the number of groups of accelerometer data collected, there are as many groups as there are people, t×f s represents the total length of the time series of the acquired acceleration signal, where x n (l) represents the acceleration signal at the nth index, which is a single number.

[0125] In step 1, the specific process of data preprocessing is as follows:

[0126] (1) Data segmentation

[0127] First, the data is segmented into 6-second data segments as samples, maintaining an 83% overlap rate with the previous sample, that is, a 6-second sliding time window with an overlap of 5 seconds is used for data segmentation.

[0128] (2) Signal quality assessment

[0129] Since the original signal of this method comes from the semi-embedded electrode in the watch device, when the watch is worn too loosely, there is a large gap between the electrode and the skin, and the electrical signal generated by muscle activity cannot be transmitted to the electrode sheet, resulting in a decrease in the signal-to-noise ratio of the electromyographic signal, which is not conducive to subsequent analysis. Therefore, before data analysis, the quality of the collected electromyographic signals needs to be evaluated. When abnormal signals caused by wearing the watch too loosely are detected, the subjects need to be reminded to adjust the watch wearing status, and this part of the data will not be counted in the epileptic seizure detection.

[0130] Comparing the EMG signals collected when the watch is worn too loosely with the normal EMG signals, it can be found that when the watch is worn too loosely, the average EMG amplitude of the signal decreases. Therefore, the mean range is used to evaluate the signal quality. The mean range of the sample is defined as the difference between the maximum and minimum values ​​of the average signal value per second in the sample time window. The calculation formula is:

[0131] RM=max(x)-min(x)

[0132] Among them, x represents the vector composed of the mean value of the electromyographic signal every second;

[0133] refer to Figure 3 When the mean value of the electromyographic signal of the sample exceeds 70 μV, the sample signal quality is considered to be unqualified; otherwise, the sample signal quality is considered to be qualified.

[0134] (3) Digital filtering

[0135] refer to Figure 4 , respectively perform digital filtering preprocessing on the acceleration, angular velocity and electromyography signals.

[0136] For the acceleration and angular velocity signals, a Butterworth filter is used to perform 0.5 Hz high-pass filtering and 15 Hz low-pass filtering to remove interference signals.

[0137] The surface electromyography signal was subjected to 10 Hz high-pass filtering using a Butterworth filter to remove low-frequency interference, and a 49-51 Hz notch process was performed.

[0138] The specific process of feature extraction and normalization in step 2 is as follows:

[0139] (1) Feature extraction

[0140] 71 amplitude features and frequency features were extracted from acceleration, angular velocity and surface electromyography signals. The amplitude features included mean amplitude, root mean square, standard deviation, energy, quartile, standard deviation, interquartile range, kurtosis coefficient, skewness coefficient, histogram frequency, waveform length, Jerk, SD2, and number of zero crossings; the frequency features included relative power, median frequency, mean frequency, quantile frequency, peak frequency, maximum power spectral density, and power spectrum standard deviation.

[0141] (2) Normalization

[0142] Normalize all features by zscore and convert them to the same scale for subsequent analysis;

[0143]

[0144] Among them, X norm represents the normalized features, X represents the original features, represents the feature mean, and σ(X) represents the feature standard deviation.

[0145] In the step three, the feature importance is first sorted according to the Laplacian score; then the optimal number of clusters and the optimal feature subset of fuzzy C-means clustering (FCM) are determined through grid search; finally, the FCM model is established to recognize the motion patterns of the samples, divide the samples into different motion patterns, and determine the non-seizure samples and potential seizure samples.

[0146] This method uses five-fold cross validation for model training and evaluation. In the training set, the data set is randomly divided multiple times and the average is taken to reduce the randomness of the model performance evaluation, enhance the generalization ability of the model, and provide more reliable performance estimation and adaptability. The specific process is:

[0147] (3.1) Dataset division

[0148] The entire data set is randomly divided into 5 subsets of equal size;

[0149] Select one of the subsets as the test set and the other four subsets as the training set. This process is repeated five times to ensure that each subset is used as the test set once.

[0150] Parameter adjustment and model training are performed on the training set, and the trained model is evaluated on the test set.

[0151] (3.2) Training set sampling

[0152] For each training set, 10:1 systematic sampling is used to divide the training set into 10 subsets, with the indexes of the starting samples being 1, 2, …, 10, respectively, to obtain subsets D1, D2, …, D10.

[0153] Systematic sampling can effectively reduce evaluation errors caused by sample selection bias, and can reduce computational costs by reducing the size of the training set when dealing with very large data sets.

[0154] (3.3) Feature Importance Ranking

[0155] For each subset Dn, calculate the Laplacian score and rank the feature importance;

[0156] a. Build a 10-nearest neighbor graph. The specific steps are as follows:

[0157] First, calculate the Euclidean distance between all sample points in the subset:

[0158]

[0159] Among them, n represents the length of the sample feature sequence.

[0160] Then, determine the nearest domain. For each data point, find the 10 other data points closest to it as its nearest neighbors. Finally, construct the similarity matrix S. ij , calculate the data point x based on the Euclidean distance between data points i and x j The similarity between:

[0161]

[0162] b. Calculate the Laplacian score LS(f r ), the specific process is as follows:

[0163] First, calculate the degree matrix D ii :

[0164]

[0165] Then, construct the Laplacian matrix L:

[0166]

[0167] Finally, the Laplacian score LS(f r ):

[0168] Define f r =[x 1r ,x 2r ,…,x mr ],make

[0169]

[0170] c. Sort the features by importance;

[0171] For each feature, the Laplacian score LS(f r ) Sort the features from small to large. The position of the feature in the sorted feature sequence is defined as the rank of the feature, that is, the rank ranges from 1 to 71. The smaller the rank of the feature, the more important the feature.

[0172] (3.4) Grid search: number of clusters C and number of features K.

[0173] a. Initialization: Set the fuzzy coefficient m of FCM to 1.2.

[0174] b. Iterate and perform grid search on the number of clusters C (2, 3, 4, 5 respectively) and the number of features K (1, 2, 3, 4, 5, 6 respectively) on each data set. Arrange the 50 features of acceleration and angular velocity in descending order of feature importance. In the parcel feature selection, take the first K features as the feature subset and C as the number of clusters to train the FCM model.

[0175] c. Evaluation, using the silhouette coefficient of all samples as the evaluation index of the FCM model;

[0176] First, calculate the silhouette coefficient s(i) for each sample:

[0177]

[0178] Among them, a(i) is the average distance (cohesion) from data point i to other points in its cluster:

[0179]

[0180] b(i) is the average distance (separation) from data point i to all points in its nearest other clusters:

[0181]

[0182] Then, calculate the silhouette coefficient for all samples:

[0183]

[0184] (d) Determine the optimal parameters. When the average value of the silhouette coefficient of the 10 subsets reaches the maximum value, the corresponding number of clusters C and number of features K are optimal. The optimal feature subset is the set of the top K features with the largest average importance among the 10 subsets.

[0185] (3.5) Training FCM model

[0186] According to the optimal subset and the number of clusters, the FCM model is trained and tested to determine which clusters may correspond to epileptic seizures. The specific process is as follows: the clusters are arranged from small to large according to the distance from the cluster center to the origin. The clusters are represented as G1, G2, etc., among which G1 is regarded as a non-seizure sample and other clusters are regarded as potential non-seizure samples.

[0187] In the step 4, firstly, the potential seizure period samples are reconstructed according to the FCM results of the training set to obtain the LSTM training set; then the LSTM model is trained; finally, the seizure probability of the potential seizure period samples in the test set is estimated according to the trained LSTM model; specifically:

[0188] (4.1) Reconstructing the LSTM training set

[0189] On the entire training set, the LSTM model is trained according to the feature selection and parameter selection results of FCM, and the input of LSTM is all the features of 6 consecutive samples.

[0190] First, for each sample except G1, the sample and the five consecutive samples before it constitute an LSTM sample, and the corresponding sample label is the label of the last sample.

[0191] Then, according to the clustering result of the 6th sample in the LSTM sample, the LSTM samples are divided into C-1 training sets.

[0192] (4.2) Training LSTM model

[0193] For these C-1 LSTM training sets, train the LSTM model separately to obtain C-1 LSTM models.

[0194] The LSTM model structure is as follows Figure 5 As shown, the details are as follows:

[0195] Input layer: The input of the LSTM model is a 6*71 time series with a sequence length of 6 and a feature dimension of 71; and the feature extraction obtains a 1*71 feature sequence. Therefore, when the feature sequence of the sample is passed through the FCM model and input into the LSTM network, the current sample and its previous 5 samples are concatenated into one LSTM sample, and the sample label is the label of the current sample, which is independent of the labels of the previous 5 samples.

[0196] LSTM layer: contains 100 hidden layer units and outputs a sequence;

[0197] Dropout layer: In order to prevent overfitting, the dropout layer is introduced and the dropout rate is set to 0.2;

[0198] The LSTM layer after the Dropout layer contains 50 hidden units and only outputs the prediction value at the last moment.

[0199] Fully connected layer: contains 2 neurons;

[0200] Activation function: The activation function selects the softmax function:

[0201]

[0202] Among them, σ(z) i represents the probability that the sample is an attack sample (i=2) and the probability that the sample is a non-attack sample (i=1), and zj represents the input vector.

[0203] Output layer: LSTM outputs the probability that the sample is a non-seizure sample or a seizure sample. This method only chooses to output the probability of the seizure sample.

[0204] During LSTM training, the batch size was set to 1000, the cross entropy loss function was selected as the cost function, the Adam optimizer was used, the learning rate was 0.001, the maximum number of iterations was 50, and the iteration was stopped when the validation set loss was higher than the minimum loss for 10 consecutive iterations.

[0205] (4.3) Testing the LSTM model

[0206] For each test set, the potential seizure samples are reconstructed and input into the corresponding LSTM model for testing to estimate the seizure probability of the potential seizure samples in the test set.

[0207] The step five can refer to Figure 6 , specifically:

[0208] (5.1) Mean filtering

[0209] Use 6-point forward mean filtering to smooth all outputs and suppress noise interference;

[0210]

[0211] Among them, y i Represents the probability of onset after processing, which is the average of the probability of onset of the current sample output by the model and the probability of onset of the previous five samples.

[0212] (5.2) Criteria for judging seizure events

[0213] If 9 consecutive sample outputs exceed the pre-defined threshold, it is considered an attack event.

[0214] If multiple seizure events occurred within 5 minutes, they were considered as the same seizure event.

[0215] Model evaluation of the present invention

[0216] The results of the epileptic seizure detection algorithm are compared with the actual labels to evaluate the performance of the model. If the algorithm detects a seizure event during the seizure period, the seizure is considered to be detected, that is, a true positive event (True Positive, TP). If the algorithm does not detect a seizure event during the seizure period, the seizure is considered to be undetected, that is, a false negative event (False Negative, FN). If the algorithm detects a seizure event outside this time period, it is considered an erroneously detected seizure, that is, a false positive event (False Positive, FP). The selected evaluation indicators include:

[0217] Sensitivity (SEN): The proportion of true positive events to all seizure events.

[0218]

[0219] False detection rate (FDR): False detection rate (FDR): defined as the average number of false positive events per 24 hours.

[0220]

[0221] SF: A comprehensive indicator of sensitivity and false positive rate.

[0222]

[0223] in, Indicates the false positive rate after processing. When the original false positive rate is higher than 1 / 24h, its value is 1, otherwise it is the same as the original false positive rate value.

[0224] Detection delay: The difference between the time when the model detects a seizure event and the time when the seizure begins, in seconds.

[0225] As shown in Table 1, this is the five-fold cross-validation result of the epileptic seizure detection algorithm. It can be seen from the table that the total sensitivity is 98.33%; at the same time, the average false alarm rate within 24 hours is only 2.14%, that is, only 2 patients out of every 100 patients have false alarms within 24 hours; at the same time, the detection delay time is only about 30 seconds, indicating that the patient's epileptic seizure can be quickly detected in a short time to generate an alarm effect, indicating that the present invention has the advantages of high sensitivity, low false detection rate, low delay time, etc., and can quickly and accurately determine epileptic seizures.

[0226] Table 1 Five-fold cross validation results of epileptic seizure detection algorithm

[0227] Test Set SEN FDR / 24h SF Detection delay time / s 1 1.0000 0.0000 1.0000 34±14 2 1.0000 0.0000 1.0000 32±12 3 1.0000 0.0363 0.9820 31±12 4 1.0000 0.0658 0.9677 34±18 5 0.9167 0.0000 0.9592 27±11 overall 0.9833 0.0214 0.9810 31±14 。

Claims

1. A method for detecting epileptic seizure signals based on fuzzy clustering and long short-term memory network, characterized in that: The following steps are involved: Step 1: Data collection and preprocessing; A wristwatch device with an accelerometer, a gyroscope and a surface electromyography sensor is used to continuously collect acceleration signals, angular velocity signals and surface electromyography signals of the user, segment the raw data, evaluate the signal quality through threshold detection of the mean range of the electromyography signal, and use a digital filter to filter and remove noise; Step 2: Feature extraction: Extract features from samples with qualified signal quality assessment, obtain feature values ​​from samples with unqualified signal quality through linear interpolation, and perform data normalization; Step 3: Fuzzy C-means clustering FCM; The features extracted from each sample are input into the fuzzy C-means clustering FCM model to perform motion pattern recognition on the samples, and the samples are divided into non-seizure samples and potential seizure samples. The seizure probability of non-seizure samples is zero, while the potential seizure samples need further analysis to determine the seizure probability. Step 4: Long short-term memory network LSTM classification; reconstruct the potential seizure period samples according to the output of the FCM model in step 3, input them into the LSTM model for training, and estimate the seizure probability of the potential seizure period samples according to the trained LSTM model; Step 5: Post-processing and seizure judgment: forward mean filtering is performed on the sample seizure probability output by the FCM model and the LSTM model. If 9 consecutive sample outputs exceed the pre-defined threshold, it is considered an epileptic seizure event; If multiple seizure events occurred within 5 minutes, they were considered as the same epileptic seizure event.

2. The epileptic seizure signal detection method based on fuzzy clustering and long short-term memory network according to claim 1, characterized in that: In step 1, the wristwatch device is a wearable physiological signal collection device worn on the wrist, and collects physiological signals through semi-embedded electrodes in contact with the skin; The collected acceleration, angular velocity, and surface electromyography signals all include the attack state and the non-attack state. The collection time is t, the unit is s, the number of collection groups is l, and the sampling frequency is f. s , the unit is Hz, that is, the time series has a total of t×l×f s Duration of acceleration, angular velocity, and surface electromyographic signals; In the process of data collection, acceleration, angular velocity, and surface electromyography signals correspond to different sampling frequencies f s .

3. The epileptic seizure signal detection method based on fuzzy clustering and long short-term memory network according to claim 1, characterized in that: In step 1, the specific process of data preprocessing is as follows: (1) Data segmentation First, the data is divided into X-second data segments as samples, 4≤X≤8, and the data is segmented using an X-second sliding time window with an overlap of X-1 seconds. The overlap rate between the latter sample and the previous sample is maintained at 80% to 90%. (2) Signal quality assessment The signal quality is evaluated using the mean range. The mean range of the sample is defined as the difference between the maximum and minimum values ​​of the average signal value per second within the sample time window. The calculation formula is: RM=max(x)-min(x) Among them, x represents the vector composed of the mean value of the electromyographic signal every second; When the mean value of the electromyographic signal of the sample exceeds 70 μV, the sample signal quality is considered unqualified; otherwise, the sample signal quality is considered qualified; (3) Digital filtering For the acceleration and angular velocity signals, a Butterworth filter is used to perform 0.5Hz high-pass filtering and 15Hz low-pass filtering to remove interference signals; The surface electromyography signal was subjected to 10 Hz high-pass filtering using a Butterworth filter to remove low-frequency interference, and a 49-51 Hz notch process was performed.

4. The epileptic seizure signal detection method based on fuzzy clustering and long short-term memory network according to claim 1, characterized in that: The specific process of feature extraction and normalization in step 2 is as follows: (1) Feature extraction Extract amplitude features and frequency features from acceleration, angular velocity and surface electromyography signals. Amplitude features include average amplitude, root mean square, standard deviation, energy, quartile, standard deviation, interquartile range, kurtosis coefficient, skewness coefficient, histogram frequency, waveform length, Jerk, SD2, and number of zero crossings; frequency features include relative power, median frequency, average frequency, quantile frequency, peak frequency, maximum power spectrum density, and power spectrum standard deviation. (2) Normalization Normalize all features by zscore. Among them, X norm represents the normalized features, X represents the original features, represents the feature mean, and σ(X) represents the feature standard deviation.

5. The epileptic seizure signal detection method based on fuzzy clustering and long short-term memory network according to claim 1, characterized in that: The specific process of step three is: (3.1) Dataset division Randomly divide the entire data set into N data subsets of equal size, 1≤N≤10; select one of the data subsets as the test set and the other N-1 data subsets as the training set. Repeat this process at least five times to ensure that each subset is used as a test set once; (3.2) Training set sampling For each training set, systematic sampling is used to divide the training set into M training subsets. The indexes of the starting samples are 1, 2, ..., M, respectively, and the training subsets D1, D2, ..., D M (3.3) Feature Importance Ranking For each training subset, calculate the Laplacian score and rank the feature importance; (3.3.1) Construct a 10-nearest neighbor graph. The specific steps are as follows: First, calculate the Euclidean distance between all sample points in the training subset: Among them, n represents the length of the sample feature sequence; Then, determine the nearest domain. For each data point, find the 10 other data points closest to it as its nearest neighbors. Finally, construct the similarity matrix S. ij , calculate the data point x based on the Euclidean distance between data points i and x j The similarity between: (3.3.2) Calculate the Laplacian score LS(f r ), the specific process is as follows: First, calculate the degree matrix D ii : Then, construct the Laplacian matrix L: L=Ds Finally, the Laplacian score LS(f r ): Define f r =[x 1r ,x 2r ,…,x mr ],make (3.3.3) Rank the features by importance; For each feature, the Laplacian score LS(f r ) Sort the features from small to large. The position of the feature in the sorted feature sequence is defined as the rank of the feature, that is, the rank ranges from 1 to 71. The smaller the rank of the feature, the more important the feature. (3.4) Grid search the number of clusters C and the number of features K; (3.4.1) Initialization: Set the fuzzy coefficient m of FCM to between 1 and 2; (3.4.2) Iteration: Perform grid search on the number of clusters C and the number of features K on each data subset, sort the features of acceleration and angular velocity from large to small according to feature importance, and train the FCM model in the parcel feature selection with the first K features as the feature subset and C as the number of clusters; (3.4.3) Evaluation: The silhouette coefficient of all samples is used as the evaluation index of the FCM model; First, calculate the silhouette coefficient s(i) for each sample: Where a(i) is the average distance from data point i to other points in its cluster: b(i) is the average distance from data point i to all points in its nearest cluster: Then, calculate the silhouette coefficient for all samples: (3.4.4) Determine the optimal parameters: When the average value of the silhouette coefficient of the M training subsets reaches the maximum value, the corresponding number of clusters C and the number of features K are optimal. The optimal feature subset is the set of the first K features with the largest average importance among the M training subsets. (3.5) Training FCM model According to the optimal subset and the number of clusters, the FCM model is trained and tested to determine which clusters may correspond to epileptic seizure signals. The specific process is as follows: the clusters are arranged from small to large according to the distance from the cluster center to the origin. The clusters are represented as G1, G2..., where G1 is regarded as a non-seizure sample and other clusters are regarded as potential non-seizure samples.

6. The epileptic seizure signal detection method based on fuzzy clustering and long short-term memory network according to claim 1, characterized in that: The step 4 is specifically: (4.1) Reconstructing the LSTM training set On the entire training set, the LSTM model is trained according to the feature selection and parameter selection results of FCM. The input of LSTM is all K features of s consecutive samples. First, for each sample except G1, the sample and the previous s-1 consecutive samples form an LSTM sample, and the corresponding sample label is the label of the last sample; Then, according to the clustering result of the sth sample in the LSTM sample, the LSTM sample is divided into C-1 training sets; (4.2) Training LSTM model For these C-1 LSTM training sets, LSTM models are trained separately to obtain C-1 LSTM models. The specific structure of the LSTM model is as follows: Input layer: The input of the LSTM model is a s*K time series with a sequence length of s and a feature dimension of K. The feature extraction results in a 1*K feature sequence. Therefore, when the feature sequence of a sample is passed through the FCM model and input into the LSTM network, the current sample and its previous s-1 samples are concatenated into one LSTM sample. The sample label is the label of the current sample and has nothing to do with the labels of the previous s-1 samples. LSTM layer: contains multiple hidden layer units, and then outputs as a sequence; Dropout layer: In order to prevent overfitting, the dropout layer is introduced, and the dropout rate is set to 0-0.5; The LSTM layer after the Dropout layer contains multiple hidden layer units and only outputs the predicted value at the last moment. Fully connected layer: contains multiple neurons; Activation function: The activation function selects the softmax function: Where i is 1 or 2; when i = 1, σ(z) i represents the probability that the sample is a non-attack sample; when i = 2, σ(z) i represents the probability that the sample is an attack sample; z j Input vector. Output layer: LSTM outputs the probability of the sample being a non-attack sample and an attack sample, and only the probability of the attack sample is selected for output; During LSTM training, the batch size is set to 2 N , select the cross entropy loss function as the cost function, use the Adam optimizer, set the learning rate to 0.000001~0.01, set the number of iterations to 20~100, and stop the iteration when the validation set loss is higher than the minimum loss for q consecutive iterations, where q is 20% of the number of iterations; (4.3) Testing the LSTM model For each test set, the potential seizure samples are reconstructed and input into the corresponding LSTM model for testing to estimate the seizure probability of the potential seizure samples in the test set.

7. The epileptic seizure signal detection method based on fuzzy clustering and long short-term memory network according to claim 1, characterized in that: The step five is specifically as follows: (5.1) Mean filtering Smooth all outputs using a 6-point forward mean filter: Among them, y i represents the probability of seizure after processing, which is the average of the probability of seizure of the current sample output by the model and the probability of seizure of the previous five samples; (5.2) Criteria for judging seizure events If 9 consecutive sample outputs exceed the predefined threshold, it is considered an attack event; If multiple seizure events occurred within 5 minutes, they were considered as the same seizure event.

Citation Information

Patent Citations

  • Prediction method for improving LSTM based on fuzzy clustering algorithm

    CN110348608A

  • Epileptic seizure time period detection system and method based on multi-modal information

    CN113907707A

  • Short-term wind power prediction method and device

    CN114298130A

  • Electroencephalopathy attack signal detection method based on convolutional neural network and long-short term memory

    CN114699093A

  • Epileptic seizure prediction analysis method based on BI-LSTM network

    CN115500790A

Cited By

  • Method and device for identifying modal continuity of multi-modal oscillation data

    CN120705622A