A neonatal convulsion detection system based on improved elastic net algorithm
By improving the elastic network algorithm and signal processing technology, and combining it with the support vector machine model, the real-time and accuracy problems of neonatal seizure detection were solved, and efficient and accurate neonatal seizure detection was achieved.
Patent Information
- Application Number
- CN202211023401.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-25
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-08-25
AI Technical Summary
Existing technologies are difficult to detect neonatal seizures efficiently and in real time. In particular, because neonatal seizures occur over a wide area, multi-channel EEG detection is time-consuming and detrimental to model accuracy and real-time performance. Furthermore, conventional EEG signals are not suitable for detecting neonatal seizures.
An improved elastic network algorithm is used, which combines signal processing, feature extraction and classification modules. Neonatal EEG signals are processed through filtering, envelope detection and sliding window techniques, and seizure detection is performed using a support vector machine model.
It enables efficient and accurate automatic detection of neonatal seizures, reduces data dimensionality, improves model accuracy and real-time performance, and assists doctors in timely diagnosis.
Smart Images

Figure QLYQS_1 
Figure QLYQS_3 
Figure QLYQS_4
Abstract
Description
Technical Field
[0001] This invention belongs to the field of neonatal seizure detection technology, specifically relating to a neonatal seizure detection system based on an improved elastic network algorithm. Background Technology
[0002] In recent years, the rate of neurological disabilities among critically ill newborns in neonatal intensive care units has remained high. Brain injury is a common neurological disorder, and seizures are a significant manifestation of neonatal brain injury. Seizure detection requires a wide detection range and high real-time accuracy; a difference of just a few hours in detection time can lead to drastically different treatment outcomes. Therefore, timely detection and treatment of seizures are crucial for the healthy growth of newborns. Clinically, electroencephalography (EEG) is commonly used to assess a patient's brain function. EEG detection involves placing electrodes on the patient's head to acquire brain electrical signals in real time, thereby mapping the patient's brain function status. In EEG detection, the pathway formed between two electrodes is called the brain electrical channel. Most brain disease detection relies on only one or a few channels. However, neonatal seizures cover a wide area, requiring the detection of multiple channels. This results in a significant time and manpower consumption for real-time manual interpretation of multi-channel EEGs, hindering timely detection of neonatal seizures. Therefore, automated detection of neonatal seizures is necessary. Using machine learning methods to achieve automated detection of neonatal seizures is a feasible solution.
[0003] Compared to other brain disorders, neonatal seizures occur at unpredictable locations. Therefore, multi-channel EEG signals need to be collected during EEG testing, resulting in high-dimensional EEG data. This is detrimental to both model accuracy and real-time performance. Therefore, dimensionality reduction is necessary for this high-dimensional seizure data. Dimensionality reduction in machine learning is known as feature selection. The Elastic Net algorithm is a classic embedded feature selection algorithm that uses regression to reflect the impact of feature combinations on the outcome, making it widely used by researchers. However, the Elastic Net algorithm fails to consider the impact of individual features on the outcome, leading to some individual features not being prioritized during feature selection.
[0004] Furthermore, conventional EEG signals are not suitable for detecting neonatal seizures because this detection requires long-term monitoring, and the high sampling frequency of EEG signals makes interpretation difficult for doctors. Amplitude integrated EEG (aEEG) is a simplified form of EEG that allows for long-term monitoring of brain function, providing convenience for neonatal seizure detection. aEEG signals are compressed in both frequency and amplitude from the EEG signal, allowing clinicians to efficiently interpret the EEG. Since the detection task has high real-time requirements, the frequency compression method is also applicable to machine learning models; however, amplitude characteristics are crucial for distinguishing seizures from normal states, so amplitude compression is not necessary for machine learning models. Addressing these issues, efficiently utilizing machine learning models for automated seizure detection presents a significant challenge. Summary of the Invention
[0005] To overcome the above problems, this invention provides a neonatal seizure detection system based on an improved elastic network algorithm. By combining a machine learning model, the system analyzes the neonatal electroencephalogram (EEG) signals to assist doctors in accurately and efficiently detecting seizures.
[0006] This invention is achieved through the following technical solution:
[0007] A neonatal seizure detection system based on an improved elastic net algorithm includes a signal processing module, a feature extraction module, a feature selection module, and a classification module;
[0008] The signal processing module is used to process neonatal EEG data. This module filters out signals in non-critical frequency bands from the neonatal EEG data using filtering; it highlights the amplitude characteristics of the signal using envelope detection; and it uses a sliding window to extract the maximum and minimum values within the window to achieve frequency compression. Specifically, it includes the following five steps:
[0009] Step 1. Obtain a segment of neonatal EEG detection data X, which includes z rows, each row as a sample, and corresponding to n columns of feature data, where z = m·f, f is the original frequency of the EEG signal, and m is the duration of the selected EEG signal;
[0010] Step 2. Use a fourth-order Butterworth filter to filter each column of the data X from 2Hz to 15Hz to obtain the filtered signal, denoted as K(t);
[0011] Step 3. Use Hilbert transform to extract the envelope of each column of the filtered signal K(t) to obtain the envelope-extracted signal X. HT (t), the formula is as follows:
[0012]
[0013] In the above formula, τ is the independent variable;
[0014] Step 4. Extract data from the envelope of each column of the signal using a non-overlapping sliding window with a length of one second. The extracted content is the maximum and minimum values of each column of the envelope-extracted signal within the one-second window. The f data in each sliding window correspond to a new row of samples. The maximum and minimum values extracted from the corresponding column of each new row of samples are used as the two columns of features of the corresponding new sample. A total of m rows and 2n columns of data are obtained. This data is used as the final output data of the signal processing module.
[0015] The feature extraction module extracts features from the output information of the signal processing module. The feature extraction module performs secondary compression of the data frequency by using a sliding window to truncate the data, and extracts features by calculating the statistical parameters of each column of data in the sliding window. This process consists of the following four steps:
[0016] Step 1. Divide each column of the final output data of the signal processing module into a non-overlapping sliding window with a length of six seconds;
[0017] Step 2. Extract features from the data in each segmented window. The extracted features include: maximum value, minimum value, mean, standard deviation, variance, total variance, kurtosis, skewness, root mean square, and cusp value, totaling 10 features. The 6 data points in each sliding window correspond to a new sample. The 10 features extracted from each window are used as the feature columns of the corresponding new sample to obtain the feature extraction result of the current sliding window.
[0018] Step 3. Repeat steps 1-2 to complete the feature extraction for each sliding window, and obtain... Data with 20n rows and 20n columns, denoted as data X. m / 6,20n This data serves as the final output of the feature extraction module;
[0019] The feature selection module selects features from the final output data of the feature extraction module that are of the same type as the features selected internally, based on the feature types filtered out internally, and deletes other features of different types in each feature column to obtain the input data of the classification module.
[0020] The classification module uses a support vector machine (SVM) model to classify the input data of the classification module, which is output by the feature selection module, and determines and outputs whether each sample corresponds to a seizure moment.
[0021] The feature selection module filters feature types according to the following steps:
[0022] Step 1: Select a segment of neonatal EEG data, manually label each sample in the data to indicate whether it is the time of a seizure, mark the row where a seizure occurs as 1, and mark the row where no seizure occurs as 0, forming a column of labeled data Y. Add the original data to the column of labeled data Y to form the labeled training dataset.
[0023] Step 2: Input the labeled training dataset into the signal processing module. The signal processing module processes the data in the labeled training dataset, excluding the label data Y, sequentially according to steps 1-4 of the module. The label data Y is processed as follows:
[0024] The label data Y is processed by a non-overlapping sliding window with a length of one second. Each sliding window contains f′ labels, where f′ is numerically equal to the original frequency f. If more than 20% of the f′ labels are 1, the time corresponding to the current window is considered to be the time of a seizure, and the label of the current window is recorded as 1. Conversely, if less than or equal to 20% of the f′ labels are 1, the time corresponding to the current window is considered not to be the time of a seizure, and the label of the current window is recorded as 0. The output label Y′ after processing by the signal processing module is obtained.
[0025] Step 3: The feature extraction module processes the output data (excluding the label data Y) from the labeled training dataset processed by the signal processing module in Step 2 according to Steps 1-3 of this module, obtaining the output data X processed by the feature extraction module. m / 6,20n Meanwhile, the feature extraction module processes the output label Y′ of the signal processing module using a non-overlapping sliding window with a length of six seconds. Each sliding window has 6 labels. If any one or more of the 6 labels are 1, then the time corresponding to the current window is considered to be the time of the seizure, and the label of the current window is recorded as 1; otherwise, if all 6 labels are 0, then the time corresponding to the current window is considered not to be the time of the seizure, and the label of the current window is recorded as 0, thus obtaining the final output label Y″ with m rows and 1 column.
[0026] Step 4: The feature selection module uses an elastic net algorithm based on Relief to select features from the data obtained in Step 3, resulting in the desired types of features. The specific details are as follows:
[0027] Step 4.1, calculate the output data X according to the following formula. m / 6,20n The Euclidean distance d between each sample and other samples i,j :
[0028]
[0029] The Euclidean distance matrix is obtained as follows:
[0030] Where i and j represent the i-th sample and the j-th sample, x i,k x represents the value of the k-th feature on the i-th sample, 1≤k≤20n. j,k This represents the value of the k-th feature on the j-th sample;
[0031] Step 4.2. Define samples with the same label as samples of the same class, and samples with different labels as samples of different classes, and then from... From the given samples, one sample is randomly selected. Then, from other samples of the same class, N samples are found to have the closest Euclidean distance to this sample; these N samples form the set NH. From other samples of different classes, N samples are found to have the closest Euclidean distance to this sample; these N samples form the set NM. The weight of each feature in each sample is calculated using the following formula:
[0032]
[0033] Among them, P k W represents the k-th feature. i (P k ) represents the weight of the k-th feature in the i-th sample, x i Representing the i-th sample, NH(x) i ) represents sample x i The NH set, NM(x i ) represents sample x i The NM set;
[0034] Step 4.3. Using the following formula, sum the weights of the k-th feature across all samples to obtain the relief weight W(P) of the k-th feature. k ):
[0035]
[0036] After calculating all feature weights according to the above formula, the Relief weights are obtained.
[0037]
[0038] Step 4.4. Calculate the feature importance score for each feature using the Relief-based improved Elastic Net algorithm. The objective function of the improved Elastic Net algorithm is as follows:
[0039]
[0040] In the above formula, To score the importance of the feature to be determined, E is a row vector of length 2n with a value of 1; 20nIt is an identity matrix of size 2n×2n; r and λ are fixed parameters, ||·||1 represents calculating the 1-norm; ||·||2 represents calculating the 2-norm;
[0041] Step 4.5: Score the importance of the obtained features. Sort the features from largest to smallest, select the top v features according to the sorting order as the feature selection module's filter categories, and record them;
[0042] Step 4.6, the feature extraction module extracts data from the output data X. m / 6,20n The system selects and retains the v features of the same type as the v features recorded in each feature column, and deletes the other features of different types in each feature column, thus obtaining the input training data X for the classification module. m / 6,v .
[0043] The training process of the Support Vector Machine (SVM) model in the classification module is as follows:
[0044] Input training data X m / 6,v The input and output labels Y″ are used as the input and output data of the Support Vector Machine (SVM) model, respectively, for training. The linear SVM model is as follows:
[0045]
[0046]
[0047] In the formula, ω = (ω1; ω2; ...; ω v ) is the normal vector, which determines the direction of the hyperplane; C is the penalty coefficient for the error term, and C = 1; For sample X i The corresponding slack variable takes values in the range [0,1]; X i Input training data X m / 6,v The i-th sample in; y i For sample X i The corresponding label; b is the classification hyperplane bias term; st represents the constraint condition, and T represents the transpose.
[0048] The beneficial effects of this invention are:
[0049] This invention employs signal processing methods to process neonatal seizure EEG signals to highlight the amplitude characteristics of the signals; it uses an elastic net algorithm based on Relief to reduce the dimensionality of the processed signals, improving model accuracy while reducing data dimensionality, thus enabling effective detection of neonatal seizures and assisting doctors in assessing the condition. The model has a certain degree of accuracy and generalization. Detailed Implementation
[0050] The present invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit the invention.
[0051] Example 1
[0052] A neonatal seizure detection system based on an improved elastic net algorithm includes a signal processing module, a feature extraction module, a feature selection module, and a classification module;
[0053] The signal processing module is used to process neonatal EEG data. This module filters out signals in non-critical frequency bands from the neonatal EEG data using filtering; it highlights the amplitude characteristics of the signal using envelope detection; and it uses a sliding window to extract the maximum and minimum values within the window to achieve frequency compression. Specifically, it includes the following five steps:
[0054] Step 1. Obtain a segment of neonatal EEG detection data X, which includes z rows, each row as a sample, and corresponding to n columns of feature data, where z = m·f, f is the original frequency of the EEG signal, m is the duration of the selected EEG signal, and n is also the number of channels of the EEG signal;
[0055] Step 2. Use a fourth-order Butterworth filter to filter each column of the data X from 2Hz to 15Hz to obtain the filtered signal, denoted as K(t); t represents that K(t) is a time-dependent quantity, where t is time.
[0056] Step 3. Use the Hilbert transform to extract the envelope of each column of the filtered signal K(t) obtained in Step 2, to obtain the envelope-extracted signal X. HT (t), the formula is as follows:
[0057]
[0058] In the above formula, τ is the independent variable, and K(τ) is the expression of K(t) in the integral form where τ is the independent variable;
[0059] Step 4. Extract data from the signal obtained in Step 3 after extracting the envelope of each column using a non-overlapping sliding window with a length of one second. The extracted content is the maximum and minimum values of each column in the signal after envelope extraction within the 1-second window. The f data in each sliding window correspond to a new row of samples (there are m rows of new samples in total). The maximum and minimum values extracted from the corresponding column of each new sample are used as the two columns of features of the corresponding new sample. A total of m rows and 2n columns of data are obtained, which are used as the final output data of the signal processing module.
[0060] The maximum value forms the upper boundary data of the corresponding column, and the minimum value forms the lower boundary data of the corresponding column. The new data formed by the upper and lower boundary data extracted from each column is used as the final output data of the signal processing module.
[0061] The feature extraction module extracts features from the output information of the signal processing module. The feature extraction module performs secondary compression of the data frequency by truncating data through a sliding window, and extracts features by calculating some statistical parameters of each column of data in the sliding window. The process consists of the following four steps:
[0062] Step 1. Divide each column of the final output data of the signal processing module into a non-overlapping sliding window with a length of six seconds;
[0063] Step 2. Extract features from the data in each segmented window. The extracted features include: maximum value, minimum value, mean, standard deviation, variance, total variance, kurtosis, skewness, root mean square, and cusp value, totaling 10 features. The 6 data points in each sliding window correspond to a new sample. The 10 features extracted from each window are used as the feature columns of the corresponding new sample to obtain the feature extraction result of the current sliding window.
[0064] Step 3. Repeat steps 1-2 to complete the feature extraction for each sliding window, and combine the obtained data to obtain... Data with 20n rows and 20n columns, denoted as data X. m / 6,20n This data serves as the final output of the feature extraction module;
[0065] The feature selection module selects features from the final output data of the feature extraction module that are of the same type as the features selected internally, based on the feature types filtered out internally, and retains them. It also deletes other features of different types from each feature column, thus obtaining the input data for the classification module; the number of rows remains unchanged.
[0066] The classification module uses a support vector machine (SVM) model to classify the input data of the classification module, which is output by the feature selection module, and determines and outputs whether each sample corresponds to a seizure moment.
[0067] The feature selection module filters feature types according to the following steps:
[0068] Step 1: Select a segment of neonatal EEG data, manually label each sample in the data to indicate whether it is the time of a seizure, mark the row where a seizure occurs as 1, and mark the row where no seizure occurs as 0, forming a column of labeled data Y. Add the original data to the column of labeled data Y to form the labeled training dataset.
[0069] Step 2: Input the labeled training dataset into the signal processing module. The signal processing module processes the data in the labeled training dataset, excluding the label data Y, sequentially according to steps 1-4 of the module. The label data Y is processed as follows:
[0070] The label data Y is processed by a non-overlapping sliding window with a length of one second. Each sliding window contains f′ labels, where f′ is numerically equal to the original frequency f of the signal. If more than 20% of the f′ labels are 1, the time corresponding to the current window (i.e., the new sample) is considered to be the time of a seizure, and the label of the current window is recorded as 1. Conversely, if less than or equal to 20% of the f′ labels are 1, the time corresponding to the current window is considered not to be the time of a seizure, and the label of the current window is recorded as 0. The output label Y′ after processing by the signal processing module is obtained.
[0071] Step 3: The feature extraction module processes the output data (excluding the label data Y) from the labeled training dataset processed by the signal processing module in Step 2 according to Steps 1-3 of this module, obtaining the output data X processed by the feature extraction module. m / 6,20n Meanwhile, the feature extraction module processes the output label Y′ of the signal processing module using a non-overlapping sliding window with a length of six seconds. Each sliding window has 6 labels. If any one or more of the 6 labels are 1, then the time corresponding to the current window is considered to be the time of the seizure, and the label of the current window is recorded as 1; otherwise, if all 6 labels are 0, then the time corresponding to the current window is considered not to be the time of the seizure, and the label of the current window is recorded as 0, thus obtaining the final output label Y″ with m rows and 1 column.
[0072] Step 4: The feature selection module uses an elastic net algorithm based on Relief to select features from the data obtained in Step 3, resulting in the desired types of features. The specific details are as follows:
[0073] Step 4.1: Calculate the sample set, i.e., the output data X, according to the following formula. m / 6,20n The Euclidean distance d between each sample and other samples i,j :
[0074]
[0075] The Euclidean distance matrix is obtained as follows:
[0076] Where i and j represent the i-th sample and the j-th sample, x i,k x represents the value of the k-th feature on the i-th sample, 1≤k≤20n. j,k This represents the value of the k-th feature on the j-th sample;
[0077] Step 2. Define samples with the same label as samples of the same class, and samples with different labels as samples of different classes, and then from... From the given samples, one sample is randomly selected. Then, from other samples of the same class, N samples are found to have the closest Euclidean distance to this sample; these N samples form the set NH. From other samples of different classes, N samples are found to have the closest Euclidean distance to this sample; these N samples form the set NM. The weight of each feature in each sample is calculated using the following formula:
[0078]
[0079] Among them, P k W represents the k-th feature. i (P k ) represents the weight of the k-th feature in the i-th sample, x i Representing the i-th sample, NH(x) i ) represents sample x i The NH set, NM(x i ) represents sample x i The NM set;
[0080] Step 3. According to the following formula, sum the weights of the k-th feature in all samples to obtain the relief weight W(P) of the k-th feature. k ):
[0081]
[0082] After calculating all feature weights according to the above formula, the Relief weights are obtained.
[0083]
[0084] Step 4. Calculate the final weight, i.e., the feature importance score, for each feature using the Relief-based improved Elastic Net algorithm. The objective function of the improved Elastic Net algorithm is as follows:
[0085]
[0086] In the above formula, Y″ represents the labels of the training set; X m / 6,20n For training set data; The target to be optimized, i.e., the final feature weights to be determined, is the feature importance score. E is a row vector of length 2n with a value of 1; 20n It is an identity matrix of size 2n×2n; Right now All terms in the equation take absolute values; r and λ are fixed parameters; ||·||1 represents calculating the 1-norm; ||·||2 represents calculating the 2-norm.
[0087] Step 5: Score the importance of the obtained features. Sort the features from largest to smallest, select the top v features according to the sorting order as the feature selection module's filter categories, and record them;
[0088] Step 6, the feature extraction module extracts data from the output data X. m / 6,20n In the process, features of the same type as v features in each feature column are selected and retained, while other features of different types in each feature column are deleted (the number of rows remains unchanged), resulting in the input training data X for the classification module. m / 6,v .
[0089] The training process of the Support Vector Machine (SVM) model in the classification module is as follows:
[0090] Input training data X m / 6,v The input and output labels Y″ are used as the input and output data of the Support Vector Machine (SVM) model, respectively, for training. The linear SVM model is as follows:
[0091]
[0092]
[0093] In the formula, ω = (ω1; ω2; ...; ω v The normal vector (C) determines the direction of the hyperplane; C is the penalty coefficient for misclassified samples. A larger C results in a greater penalty for misclassified samples, leading to higher accuracy on training samples but lower generalization ability, meaning lower classification accuracy on test data. Conversely, decreasing C allows for some misclassified samples in the training dataset. In this invention, C = 1. For sample X i The corresponding slack variable takes values in the range [0, 1]; X i Input training data X m / 6,v The i-th sample in; y i For sample X i The corresponding label is one for each sample; b is the classification hyperplane bias term; st represents the constraint condition; and T represents the transpose.
[0094] Example 2
[0095] A neonatal seizure detection system based on an improved elastic net algorithm includes a signal processing module, a feature extraction module, a feature selection module, and a classification module.
[0096] The signal processing module is used to process neonatal EEG data. This module filters out signals in non-critical frequency bands using filtering; highlights the amplitude characteristics of the signal using envelope detection; and achieves frequency compression by using a sliding window to extract the maximum and minimum values within the window.
[0097] 1. Select a segment of neonatal seizure to detect EEG signal X° m·f,n As training data, Y m·f As a label. Where, X° m·f,m The data X° represents m·f rows and n columns; f is the original frequency of the EEG signal; m is the duration of the selected EEG signal (in seconds); n is the number of channels in the EEG signal; Y is the label of the selected signal, manually labeled by professionals. Y corresponds one-to-one with X. If Y... i =0, which means there was no seizure at time i; if Y = 0, it means there was no seizure at time i. i =1 indicates that a seizure occurred at time i. In this embodiment, the selected EEG signal has a duration of 14400 seconds, a frequency of 256Hz, and 12 channels, meaning the original training data is X°. 14400×256,12 Y 14400×256 .
[0098] 2. Use a fourth-order Butterworth filter to process the j-th channel data X° of the above signal. m,f,j Perform a 2Hz-15Hz filter to obtain the filtered signal X. b 14400×256,j .
[0099] 3. Apply the Hilbert transform to signal X b 14400×256,j Envelope detection is performed to obtain the signal.
[0100] 4. Use a non-overlapping sliding window of one second to process the signal. Data extraction is performed, extracting the maximum and minimum values of the envelope within a 1-second window. The maximum value forms the upper boundary data of channel j. The minimum value forms the lower boundary data of channel j.
[0101] 5. Repeat steps 2-4 a total of 12 times, and transfer the signal X°. 14400×256,12 All channels have been processed. The upper and lower boundary data obtained from each repetition are horizontally merged to form the processed signal data X. 14400,24 .
[0102] Using a non-overlapping sliding window of length one second to check label Y 14400×256Data processing is performed. Each sliding window contains 256 labels. If more than 51 of the 256 labels are 1, the time corresponding to the current window is considered to be the time of a seizure attack, and is recorded as 1; conversely, if fewer than 50 labels are 1, the time corresponding to the current window is considered not to be the time of a seizure attack, and is recorded as 0. The final result is the new label data y. 14400 X 14400,24 and y 14000 This refers to the training data after it has been processed by the signal processing module.
[0103] The feature extraction module processes the above data X. 14400,24 Feature extraction is performed by using a sliding window to truncate the data and perform secondary compression of data frequencies; features are extracted by calculating statistical parameters for each column of data in the sliding window. The feature extraction module consists of four steps:
[0104] 1. Apply a non-overlapping sliding window of length six seconds to the data X. 14400,24 Let X be the data taken by the k-th sliding window. k 6,24 .
[0105] 2. Regarding X k 6,24 For each column of data, feature extraction is performed. The extracted features include the maximum, minimum, mean, standard deviation, variance, total variance, kurtosis, skewness, root mean square, and cusp value, totaling 10 features. These 10 features from each column are then horizontally merged into a single row to obtain the feature extraction result X for the data within the k-th sliding window. k 1,240 .
[0106] 3. Repeat steps 1-2 to complete data X. 14400,24 The entire feature extraction process is performed to obtain the feature-extracted data X. 2400,240 .
[0107] 4. Use a non-overlapping sliding window of length six seconds to apply the label y 14400 The process involves processing each sliding window with six labels. If all six labels contain a value of 1, the current time is considered the time of a seizure and is recorded as 1; conversely, if all six labels contain a value of 0, the current time is considered the time of no seizure and is recorded as 0. This results in new label data y. 2400 X 2400,240 and y 2400 This refers to the training data after processing by the feature extraction module.
[0108] The feature selection module is mainly responsible for dimensionality reduction of the training data. The data contains 240 features. The feature selection module uses an elastic network algorithm based on Relief to select features from the data. This module consists of four steps:
[0109] 1. First, calculate the sample set X according to the following formula. 2400,240 The Euclidean distance between each sample and all other samples:
[0110]
[0111] The Euclidean distance matrix is obtained as follows:
[0112]
[0113] Where, d 1,2 This represents the Euclidean distance between the first and second samples.
[0114] 2. Randomly select one sample from 2400 samples. Then, find the three samples from the same class that have the closest Euclidean distance to this sample; these three samples form the NH set. Similarly, find the three samples from different classes that have the closest Euclidean distance to this sample; these three samples form the NM set. Then, calculate the weight of each feature in each sample using the following formula:
[0115]
[0116] Among them, W i (P j S represents the weight of the l-th feature in the i-th sample. t It is a sample taken from the NH set or the NM set.
[0117] 3. Repeat steps 1-2 a total of 2400 times, ensuring that each randomly selected sample in step 2 has not been selected before. The final weight of the l-th feature is obtained by summing the weights of the l-th feature in each sample according to the following formula:
[0118]
[0119] After calculating all feature weights according to the above formula, we can obtain...
[0120]
[0121] 4. Calculate the final weight of each feature using the Relief-based improved Elastic Net algorithm, where the objective function of the improved Elastic Net algorithm is as follows:
[0122]
[0123] In the above formula, Y represents the label of the training set, i.e., the output y of the feature extraction module. 2400 X represents the training set data, i.e., the output X of the feature extraction module. 2400,240 ; For the target to be optimized, c1, c2, ..., c 240 These represent the weights of features 1, 2, ..., 240, respectively; W(P) is the result obtained in step 3. E is a row vector of length 240 with a value of 1. 240 It is an identity matrix of size 240×240; r and λ are fixed parameters; in this embodiment, r = 0.5 and λ = 10.
[0124] In this embodiment, step four uses the coordinate descent method to solve the objective function.
[0125] The classification module primarily trains the classification model. First, it uses the feature importance scores obtained from the feature selection module. Sort the features and denote the feature combination consisting of the first 10 features in the sort as P = (p1, p2, p3, ..., p...). 10 ), in data X 2400,240 The data corresponding to the features contained in P are selected to form the final training data X. 2400,10 Using training data X 2400,10 With tag y 2400 The Support Vector Machine (SVM) model is trained to obtain the final trained classification model. When using the model, the test EEG data is sequentially processed through the data processing module and the feature extraction module to form the test data X. test,240 The data corresponding to the features contained in P are selected from the test data to form the final test data X. test,10 The trained Support Vector Machine (SVM) model is used to classify the test data to obtain the final test result y. test y test Each classification result corresponds to the patient's seizure occurrence within 6 seconds. If a classification result is 1, it means that the patient had a seizure within the corresponding 6 seconds; if it is 0, it means that the patient did not have a seizure within the corresponding 6 seconds.
[0126] This invention helps detect seizures in newborns in the neonatal intensive care unit in real time by processing and classifying neonatal EEG signals. Related studies have validated these methods on clinical case datasets, demonstrating strong generalization and reliability. The neonatal seizure detection method based on an improved elastic net algorithm achieves data sampling by compressing the EEG signal frequency twice, reducing data volume and ensuring real-time model performance. Envelope detection highlights the amplitude information of the data, ensuring that the frequency-compressed data retains the amplitude characteristics of the original data. By combining the Relief algorithm and the elastic net algorithm, the improved algorithm combines the advantages of the elastic net algorithm (low computational cost and high efficiency) and the Relief algorithm (strong fault tolerance), ensuring diverse feature selection and identifying features strongly correlated with seizures. Ultimately, this method achieves efficient and accurate detection of neonatal seizures.
[0127] The preferred embodiments of the present invention have been described in detail above. However, the scope of protection of the present invention is not limited to the specific details in the above embodiments. Within the scope of the technical concept of the present invention, any person skilled in the art can make equivalent substitutions or changes based on the technical solution and inventive concept of the present invention within the scope of the technology disclosed in the present invention. These simple modifications are all within the scope of protection of the present invention.
[0128] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not describe the various possible combinations separately.
[0129] Furthermore, various different embodiments of the present invention can be combined in any way, as long as they do not violate the spirit of the present invention, they should also be regarded as the content disclosed by the present invention.
Claims
1. A neonatal seizure detection system based on an improved elastic network algorithm, characterized in that... It includes a signal processing module, a feature extraction module, a feature selection module, and a classification module; The signal processing module is used to process neonatal EEG detection data. This module filters out signals in non-key frequency bands from the neonatal EEG detection data through filtering; highlights the amplitude characteristics of the signal through envelope detection; and extracts the maximum and minimum values within the window to achieve frequency compression by using a sliding window to truncate the signal. Specifically, it includes the following five steps: Step 1. Obtain a segment of neonatal EEG detection data X, which includes z rows, each row as a sample, and corresponding to n columns of feature data, where z = m·f, f is the original frequency of the EEG signal, and m is the duration of the selected EEG signal; Step 2. Use a fourth-order Butterworth filter to filter each column of the data X from 2Hz to 15Hz to obtain the filtered signal, denoted as K(t); Step 3. Use Hilbert transform to extract the envelope of each column of the filtered signal K(t) to obtain the envelope-extracted signal X. HT (t), the formula is as follows: In the above formula, τ is the independent variable; Step 4. Extract data from the envelope of each column of the signal using a non-overlapping sliding window with a length of one second. The extracted content is the maximum and minimum values of each column of the envelope-extracted signal within the one-second window. The f data in each sliding window correspond to a new row of samples. The maximum and minimum values extracted from the corresponding column of each new row of samples are used as the two columns of features of the corresponding new sample. A total of m rows and 2n columns of data are obtained. This data is used as the final output data of the signal processing module. The feature extraction module extracts features from the output information of the signal processing module. The feature extraction module performs secondary compression of data frequency by truncating data through a sliding window, and extracts features by calculating the statistical parameters of each column of data in the sliding window. It consists of the following four steps: Step 1. Divide each column of the final output data of the signal processing module into a non-overlapping sliding window with a length of six seconds; Step 2. Extract features from the data in each segmented window. The extracted features include: maximum value, minimum value, mean value, standard deviation, variance, total variance, kurtosis, skewness, root mean square, and cusp value, totaling 10 features. In each sliding window, 6 data points correspond to a new sample. The 10 features extracted from each window are used as the feature column of the corresponding new sample to obtain the feature extraction result of the current sliding window. Step 3. Repeat steps 1-2 to complete the feature extraction for each sliding window, and obtain... Data with 20n rows and 20n columns, denoted as data X. m / 6,20n This data serves as the final output of the feature extraction module; The feature selection module selects features from the final output data of the feature extraction module that are of the same type as the features selected internally, based on the feature types filtered out internally, and deletes other features of different types in each feature column to obtain the input data of the classification module. The classification module uses a support vector machine (SVM) model to classify the input data of the classification module, which is output by the feature selection module, and determines and outputs whether each sample corresponds to a seizure moment.
2. The neonatal seizure detection system based on an improved elastic network algorithm according to claim 1, characterized in that... The feature selection module filters feature types according to the following steps: Step 1: Select a segment of neonatal EEG data, manually label each sample in the data to indicate whether it is the time of a seizure, mark the row where a seizure occurs as 1, and mark the row where no seizure occurs as 0, forming a column of labeled data Y. Add the original data to the column of labeled data Y to form the labeled training dataset. Step 2: Input the labeled training dataset into the signal processing module. The signal processing module processes the data in the labeled training dataset, excluding the label data Y, sequentially according to steps 1-4 of the module. The label data Y is processed as follows: The label data Y is processed by a non-overlapping sliding window with a length of one second. Each sliding window contains f labels, where f is numerically equal to the original frequency f. If more than 20% of the f labels are 1, the time corresponding to the current window is considered to be the time of a seizure, and the label of the current window is recorded as 1. Conversely, if less than or equal to 20% of the f labels are 1, the time corresponding to the current window is considered not to be the time of a seizure, and the label of the current window is recorded as 0. The output label Y after processing by the signal processing module is obtained. Step 3: The feature extraction module processes the output data (excluding the label data Y) from the labeled training dataset processed by the signal processing module in Step 2 according to Steps 1-3 of this module, obtaining the output data X processed by the feature extraction module. m / 6,20n Meanwhile, the feature extraction module processes the output label Y of the signal processing module using a non-overlapping sliding window with a length of six seconds. Each sliding window has 6 labels. If any one or more of the 6 labels are 1, then the time corresponding to the current window is considered to be the time of the seizure, and the label of the current window is recorded as 1; otherwise, if all 6 labels are 0, then the time corresponding to the current window is considered not to be the time of the seizure, and the label of the current window is recorded as 0, thus obtaining the final output label Y with m rows and 1 column. Step 4: The feature selection module uses an elastic net algorithm based on Relief to select features from the data obtained in Step 3, resulting in the desired types of features. The specific details are as follows: Step 4.1, calculate the output data X according to the following formula. m / 6,20n The Euclidean distance d between each sample and other samples i,j : The Euclidean distance matrix is obtained as follows: Where i and j represent the i-th sample and the j-th sample, x i,k x represents the value of the k-th feature on the i-th sample, 1≤k≤20n. j,k This represents the value of the k-th feature on the j-th sample; Step 2. Define samples with the same label as samples of the same class, and samples with different labels as samples of different classes, and then from... From the given samples, one sample is randomly selected. Then, from other samples of the same class, N samples are found to have the closest Euclidean distance to this sample; these N samples form the set NH. From other samples of different classes, N samples are found to have the closest Euclidean distance to this sample; these N samples form the set NM. The weight of each feature in each sample is calculated using the following formula: Among them, P k W represents the k-th feature. i (P k ) represents the weight of the k-th feature in the i-th sample, x i Representing the i-th sample, NH(x) i ) represents sample x i The NH set, NM(x i ) represents sample x i The NM set; Step 3. According to the following formula, sum the weights of the k-th feature in all samples to obtain the relief weight W(P) of the k-th feature. k ): After calculating all feature weights according to the above formula, the Relief weights are obtained. Step 4. Calculate the feature importance score for each feature using the Relief-based improved Elastic Net algorithm. The objective function of the improved Elastic Net algorithm is as follows: In the above formula, To score the importance of the feature to be determined, E is a row vector of length 2n with a value of 1; 20n It is an identity matrix of size 2n×2n; r and λ are fixed parameters, ||·||1 represents calculating the 1-norm; ||·||2 represents calculating the 2-norm; Step 5: Score the importance of the obtained features. Sort the features from largest to smallest, select the top v features according to the sorting order as the feature selection module's filter categories, and record them; Step 6, the feature extraction module extracts data from the output data X. m / 6,20n The system selects and retains the v features of the same type as the v features recorded in each feature column, and deletes the other features of different types in each feature column, thus obtaining the input training data X for the classification module. m / 6,v .
3. A neonatal seizure detection system based on an improved elastic network algorithm according to claim 2, characterized in that... The training process of the Support Vector Machine (SVM) model in the classification module is as follows: Input training data X m / 6,v The input and output labels Y are used as the input and output data of the Support Vector Machine (SVM) model, respectively, for training. The linear SVM model is as follows: In the formula, ω = (ω1; ω2; ...; ω v ) is the normal vector, which determines the direction of the hyperplane; C is the penalty coefficient for the error term, and C = 1; For sample X i The corresponding slack variable takes values in the range [0, 1]; X i Input training data X m / 6,v The i-th sample in; y i For sample X i Corresponding tags; b is the classification hyperplane bias term; st represents the constraint condition, and T represents the transpose.