Sleep staging system based on multi-threshold neighborhood extreme value pattern statistics
By combining time-domain, frequency-domain, and labeled signal location features, and employing a multi-threshold neighborhood extremum pattern statistical sleep staging system, the problem of low accuracy in single-channel EEG signal automatic sleep staging systems is solved, achieving efficient sleep stage classification.
Patent Information
- Application Number
- CN202411922704.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-12-25
AI Technical Summary
Existing automatic sleep staging systems based on single-channel EEG signals are not very accurate, and current technologies are insufficient to effectively improve classification performance.
A sleep staging system based on multi-threshold neighborhood extreme value pattern statistics is adopted. By combining time domain, frequency domain and labeled signal location features, the system improves classification accuracy through EEG signal acquisition, preprocessing, multi-threshold neighborhood extreme value feature extraction, gray wolf optimization and random forest classifier.
This technology enables efficient and automatic sleep staging of single-channel EEG signals, improving classification accuracy and efficiency and solving the problem of low accuracy in existing technologies.
Smart Images

Figure CN119924774B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of feature extraction and detection, and relates to a sleep staging system based on multi-threshold neighborhood extreme value pattern statistics. Background Technology
[0002] Accurate sleep stage classification is a prerequisite for assessing sleep quality. Currently, polysomnography (PSG) is considered the gold standard for assessing sleep quality. It involves simultaneously recording electroencephalograms (EEG), electromyography (EMG), electrocardiograms (ECG), and electrooculograms (EOG) during sleep quality assessment. Sleep specialists then reconstruct the hypnosis map by visually observing physiological signals for 30 seconds. Two popular gold standards for sleep staging are the Rechtschaffen & Kales (R&K) system and the 2007 American Academy of Sleep Medicine (AASM) guidelines, which are used to analyze sleep recordings. In particular, PSG or single-channel EEG recordings are typically divided into 30-second segments, each of which is manually examined by a sleep specialist and then divided into one of five stages: wake (W), rapid eye movement (REM), and three non-REM stages (N1, N2, and N3).
[0003] The sleep staging process typically involves signal acquisition, signal preprocessing, feature extraction, feature selection, and classification model learning and evaluation. The quality of the features directly determines the classification and detection results; therefore, feature extraction and feature selection are crucial. Research using symbolic analysis for time series data analysis in sleep staging studies is receiving increasing attention. Symbolic analysis offers advantages such as improved discovery efficiency, reduced sensitivity to measurement noise, and the ability to distinguish between specific and general models. Each point in a time series is closely related to time, resulting in high-dimensional features. Before processing the time series, it is usually necessary to modify it using representation methods. One of the basic methods of time series symbolic analysis is Symbolic Aggregate Approximation (SAX). SAX has the advantages of computational simplicity, high efficiency, and allowing dimensionality reduction. Different data are mapped to the same dimension through SAX, and each value in that dimension has the same practical meaning. This allows for simple and effective data fusion. It provides a comprehensive description of the dynamic system by transforming it into a new representation space that retains the most important temporal information, assigning symbols corresponding to the system state, and extracting valuable information from this new space. As a mathematical tool, it is an effective means of assessing the complexity or irregularity of biomedical records. However, existing automated sleep staging systems based on single-channel EEG signals suffer from technical problems related to low accuracy.
[0004] Therefore, it is necessary to propose a solution to address the technical problems existing in the current technology, given its technical deficiencies. Summary of the Invention
[0005] To address the problems existing in the prior art, this invention proposes a sleep staging system based on multi-threshold neighborhood polar pattern statistics. By combining the location features of the time domain, frequency domain, and labeled signals, the system improves classification performance and enhances accuracy.
[0006] In order to solve the technical problems existing in the prior art, the technical solution of the present invention is as follows:
[0007] A sleep staging system based on Multi-Threshold Neighborhood Extreme Pattern Statistical (SMNE) includes an EEG signal acquisition unit, a signal preprocessor, a SMNE feature extractor, a gray wolf optimizer, and a random forest classifier.
[0008] The EEG signal acquisition device is used to acquire single-channel EEG signals (Fpz-Cz channels), i.e., raw EEG data;
[0009] The signal preprocessor is used to receive the raw EEG data from the EEG signal acquisition device and perform data preprocessing, including filtering and data enhancement of the single-channel EEG signal; wherein, the acquired raw EEG data is bandpass filtered from 0.5Hz to 40Hz and the processed EEG signal is segmented into segments; in the data enhancement, the signal-to-noise ratio data enhancement is performed on the specified segments according to the duration of the segment annotation.
[0010] The multi-threshold neighborhood extremum feature extractor is used to extract multi-threshold neighborhood extremum features from the preprocessed signal. First, the extremum of the data segment after data augmentation is calculated. Then, the neighborhood difference of the extremum is calculated, and the difference is labeled with five states. The SMNE code is obtained by analyzing the multi-mode encoding of the states.
[0011] The Grey Wolf optimizer determines the optimal thresholds for signal-to-noise ratio enhancement and SMNE feature extraction through multiple iterations.
[0012] Random forest classifiers are used to classify the best subset of input features and obtain the final classification result.
[0013] As a further improvement, the EEG signal acquisition device uses dry electrodes to collect EEG signals and transmits the data to the receiving device via a Bluetooth module.
[0014] As a further improvement, the time span of each EEG signal segment is 30 seconds.
[0015] As a further improvement, a signal preprocessor is used to filter out interference components in the EEG signal and eliminate the problem of uneven data in the EEG signal.
[0016] As a further improvement, data augmentation optimizes the physiological characteristic of uneven fragmentation in EEG signals. The steps are as follows:
[0017] S1: Filtering the acquired EEG signals;
[0018] S2: Based on S1, the filtered signal is shifted backward to obtain a new 30s segment;
[0019] S3: Based on S2, mark adjacent segments with the same sleep stage as set segments;
[0020] S4: Based on S3, calculate the signal-to-noise ratio of the ensemble segments and take the absolute value to obtain the data-enhanced segments;
[0021] S5: Combine the extracted new segments with the original data set as preprocessed signal segments.
[0022] As a further improvement, the SMNE feature extraction uses pattern variation statistics of extreme values to accurately classify sleep signals. The steps are as follows:
[0023] S10: Extract local extrema: including location information and amplitude information.
[0024] S20: Based on S10, sort the extreme values obtained, determine the number and distribution of the five states, and ensure that each extreme value is labeled with a state.
[0025] S30: Based on S20, perform multi-threshold encoding on the pattern changes between the labeled state neighborhoods;
[0026] S40: Based on S30, the obtained threshold code is input into the five weight values and weighted to obtain the polymorphic code.
[0027] S50: The extracted polymorphic codes, location features, and frequency domain features are used as the total feature set of SMNE.
[0028] As a further improvement, the obtained feature subset is fed into a random forest classifier for classification. A 10x cross-validation method is used to divide the EEG signals into training and test sets. An optimal sleep stage prediction model is built based on the training set data, distinguishing between W, REM, and N1, N2, and N3 data, and calculating accuracy, F1 score, sensitivity, and kappa value.
[0029] Compared with the prior art, the present invention has the following technical effects:
[0030] (1) This invention can collect EEG signals in real time and is small in size, making it possible to use professional sleep EEG staging at home.
[0031] (2) The EEG signal was processed by signal overlap and joint signal-to-noise ratio data enhancement algorithm, which solved the problem of imbalanced sample data;
[0032] (3) SMNE feature is a novel time-domain feature for automatic sleep staging based on changes in sleep EEG signal patterns. This feature can effectively track and reproduce the pattern changes of EEG signals in different sleep stages by encoding and quantifying local extrema.
[0033] (4) By combining the time domain, frequency domain and location characteristics of the labeled signal, the classification performance can be improved and the accuracy can be enhanced. Attached Figure Description
[0034] Figure 1 This is a block diagram illustrating the principle of a sleep staging system based on multi-threshold neighborhood extreme value pattern statistics.
[0035] Figure 2 This is a flowchart of the sleep staging system based on multi-threshold neighborhood extreme value pattern statistics in an embodiment of the present invention for predicting the onset of sleep episodes.
[0036] Figure 3 A four-step diagram illustrating the creation of statistical feature vectors for multi-threshold neighborhood extreme value patterns.
[0037] Figure 4 For the statistical weight layer (w3,:) of the multi-threshold neighborhood extreme mode, there are samples of all possible modes in the five states. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0039] Conversely, this invention encompasses any substitutions, modifications, equivalent methods, and solutions made within the spirit and scope of the invention as defined in the claims. Furthermore, to provide a better understanding of the invention, certain specific details are described in detail below. However, those skilled in the art will fully understand the invention even without these detailed descriptions.
[0040] Accurate sleep stage classification is a prerequisite for assessing sleep quality. According to the 2007 American Academy of Sleep Medicine guidelines, single-channel EEG recordings are typically divided into 30-second segments, each manually examined by a sleep specialist, and then classified into one of five stages: wakefulness, REM (Rapid Eye Movement) stage, and three non-REM (Non-Rapid Eye Movement) stages.
[0041] To improve the accuracy of sleep staging, this invention proposes a sleep staging system based on multi-threshold neighborhood extreme value pattern statistics. (See [link to relevant documentation]). Figure 1 The diagram shown illustrates its principle, which includes an EEG signal acquisition unit, a signal preprocessor, a multi-threshold neighborhood extreme value feature extractor, a gray wolf optimizer, and a random forest classifier.
[0042] The EEG signal acquisition device is used to acquire single-channel EEG signals, i.e., raw EEG data;
[0043] The signal preprocessor is used to receive the raw EEG data from the EEG signal acquisition device and perform data preprocessing, including filtering and data enhancement of the single-channel EEG signal; wherein, the acquired raw EEG data is subjected to 0.5Hz to 40Hz bandpass filtering and the processed EEG signal is segmented into segments; in the data enhancement, the signal-to-noise ratio data enhancement is performed on the specified segments according to the duration of the segment annotation;
[0044] The multi-threshold neighborhood extreme value feature extractor is used to extract multi-threshold neighborhood extreme value features from the signal preprocessed by the signal preprocessor. First, the extreme values of the data segments after data augmentation are calculated. Then, the neighborhood difference of the extreme values is calculated, and the difference is labeled with five states. By analyzing the multi-mode encoding of the states, the statistical total feature set of multi-threshold neighborhood extreme value patterns is obtained.
[0045] The gray wolf optimizer is connected to the multi-threshold neighborhood extreme value feature extractor to determine the signal-to-noise ratio enhancement and multi-threshold neighborhood extreme value pattern statistical features through multiple iterations to extract the optimal threshold;
[0046] Random forest classifiers are used to classify the best subset of input features to obtain the final classification result.
[0047] In the aforementioned technical solution, symbolic techniques such as multi-threshold neighborhood extreme value pattern statistics are used to compare and track the dynamics of sleep EEG signals at different sleep stages. One of the main advantages of multi-threshold neighborhood extreme value pattern statistics is its ability to detect changes in EEG signals during transitions between sleep stages, employing a method of symbol assignment to dynamic patterns found in single-channel EEG signals. This method enables the detection of changes in EEG signals during transitions between sleep stages, making trend detection and quantification of changes possible, thus improving the efficiency of sleep disorder analysis.
[0048] In the above technical solutions, classification is required after feature extraction. However, setting different threshold values in signal-to-noise ratio enhancement and polymorphic coding may reduce the classification performance of the model. Therefore, an optimizer is considered to determine the optimal threshold. This invention uses the Grey Wolf optimizer to obtain the optimal threshold, and experiments show that it has better classification performance.
[0049] This invention employs the above-mentioned technical solution and for the first time uses encoded time-domain features for automatic sleep stage classification, effectively improving the accuracy of automatic sleep staging systems based on single-channel EEG signals and solving the sleep stage classification problem.
[0050] See Figure 2 The image shows a sleep staging algorithm based on multi-threshold neighborhood extreme value pattern statistics proposed in this invention. The signal preprocessor receives the raw EEG data from the EEG signal acquisition device and performs data preprocessing. The data processing procedure is as follows:
[0051] S1: Perform a 0.5Hz to 40Hz bandpass filter on the acquired raw EEG data and segment the processed EEG signal into segments.
[0052] S2: Signal shifting, shifting the filtered signal five sampling points backward to obtain a new 30s segment x. i+1 The same sleep period was marked as the old signal;
[0053] S3: In the newly obtained shifted signal, neighboring segments with the same sleep stage are marked as signal enhancement set segments, and signal enhancement set segments are overlaid. A starting point p is randomly selected, and the subsequent 30 seconds are used as a data enhancement segment for signal-to-noise ratio enhancement, marked as x. i+2 ;
[0054] S4: Calculate the signal-to-noise ratio of the ensemble segments and take the absolute value to obtain the data-augmented segments;
[0055] The signal-to-noise ratio is calculated using the following formula:
[0056]
[0057] Where P signal It is the power of the signal, P noise It is the power of the noise, log10 represents the logarithm to base 10, A signal A represents the amplitude of the signal. noise This represents the amplitude of the noise. Therefore, this formula can be used to label EEG signals for which signal-to-noise ratio (SNR) performance needs to be improved. If the calculated SNR of this segment is lower than the preset threshold s1 obtained by GWO, its absolute value is assigned as the enhancement value, resulting in a new 30s segment x. i+3 .
[0058] S5: Combine the extracted new segments with the original data set as preprocessed signal segments.
[0059] A multi-threshold neighborhood extremum time-domain feature extractor extracts features from single-channel EEG signals at different sleep stages. The data processing procedure is as follows:
[0060] S10: Extracting local extrema: This includes location information labelE(t) and magnitude information E(t). The extraction method is shown in Algorithm 1 below:
[0061]
[0062] Furthermore, the obtained information is used to calculate the extreme value difference and the positional difference, where D represents the difference between two extreme values. The formula for adjacent ranges is:
[0063]
[0064] Since the poles were labeled with location information in the preceding text, a domain difference P can be constructed using these location labels to capture the changes in pole positions between domains. The formula for calculating the location difference P can be expressed as:
[0065]
[0066] P reflects the temporal variation of the poles and focuses on the intensity and overall trend of these variations.
[0067] S20: Based on S10, using the extreme values E obtained in the initial step, arrange each extreme value E by order of magnitude to form a histogram, thereby obtaining an estimate of the global amplitude distribution. The specific process of partitioning is as follows: Figure 3 As shown.
[0068] S30: Building upon S20, this invention defines five modes when quantizing the difference threshold, representing different modes of two adjacent symbols in the S(t) state. This invention utilizes GWO to obtain the thresholds b1 and b2 for judging the state, and the domain difference corresponding to each element in the five sub-matrices of state S is shown below:
[0069]
[0070] However, some dynamic patterns in EEG signals do not occur in real life. Figure 4 All possible patterns are listed in the document.
[0071] S40: Based on S30, the five states obtained are weighted and multi-state encoded to obtain SMNE features. Due to the close relationship between EEG signals, the weight calculation is divided into 5 weight layers ω. n (n = 1:5), such as Figure 3 As shown. The ω1 weighted layer consists of a single multi-threshold code with a weight of 0.001. ω2 consists of two multi-threshold codes, the latter with a weight of 0.001 and the former with a weight of 0.01. This continues, forming five weighted layers. These five layers were obtained experimentally, combining efficiency and accuracy. This weighting method can reconstruct and predict the signal pattern at each extreme point as clearly as possible, playing a crucial role in determining sleep patterns. Specific possible signal patterns are as follows... Figure 4 As shown.
[0072] S50: The extracted polymorphic codes, location features, and frequency domain features are used as the total feature set of SMNE.
[0073] Traditional spectrum analysis involves performing Fourier transforms on the signal to achieve the analysis objective. In this method, the root mean square frequency (RMSF) is used as the feature extracted in the frequency domain. Frequency domain analysis examines the signal's characteristics from a frequency perspective. In signal analysis, time domain analysis and frequency domain analysis complement each other. The RMSF extraction method is shown below:
[0074] First, consider the input signal sequence x. iPerform an n-point Discrete Fourier Transform (DFT) and calculate according to Equation 6:
[0075]
[0076] Where F(f) is the output with frequency f. It is the rotation factor, which can be obtained from Equation 7:
[0077]
[0078] Where N is x i The length of the signal is then used to extract the root mean square frequency, obtained from Equation 8:
[0079]
[0080] The Gray Wolf Optimizer (GWO) is used to determine the optimal threshold through multiple iterations. The GWO mimics the hunting behavior of gray wolves in nature, with the pack consisting of four levels: α wolves, β wolves, δ wolves, and ω wolves. β wolves support α wolves in hunting prey. δ wolves occupy the third level of dominance. The remaining wolves are called ω wolves, and they are completely dominated by α, β, and δ wolves. Once prey is spotted, β and δ wolves, under the command of α wolves, surround and attack the prey. A wolf's position within the pack can be represented by thresholds s1, b1, and b2, as shown in Equation 9:
[0081] W(i w ,j w )=(s1(i w ,j w ),b1(i w ,j w ),b2(i w ,j w (9)
[0082] Where s1, b1, and b2 represent the thresholds for SNR and SMNE features, respectively, i w ∈{1,2,...,I max}, I max It is the maximum number of iterations, while j w ∈{1,2,...,N max}, N max It refers to the number of wolves within the pack.
[0083]
[0084] At the start of GWO, individual feature values are typically generated through random initialization, and the fitness value of each individual population is calculated based on the fitness function. Since the combination of s1, b1, and b2 affects detection accuracy, the detection accuracy of the SMNE algorithm is used as the fitness function to evaluate the convergence factor performance, as follows:
[0085] Equation 10 yields:
[0086]
[0087] Where N t (i w ,j w ) and N m (i w ,j w The numbers ACC and ACC represent the number of correct sleep stages and the number of incorrect sleep stages detected at that location, respectively. Then, the highest ACC value is selected as the fitness value.
[0088] Random forest classifiers are used to classify the best subset of input features and obtain the final classification result.
[0089] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A sleep staging system based on multi-threshold neighborhood extreme value pattern statistics, characterized in that, It includes an EEG signal acquisition unit, a signal preprocessor, a multi-threshold neighborhood extreme value feature extractor, a gray wolf optimizer, and a random forest classifier, among which... The EEG signal acquisition device is used to acquire single-channel EEG signals, i.e., raw EEG data; The signal preprocessor is used to receive the raw EEG data from the EEG signal acquisition device and perform data preprocessing, including filtering and data enhancement of the single-channel EEG signal; wherein, the acquired raw EEG data is bandpass filtered from 0.5 Hz to 40 Hz and the processed EEG signal is segmented into segments; in the data enhancement, the signal-to-noise ratio data enhancement is performed on the specified segments according to the duration of the segment annotation; The multi-threshold neighborhood extreme value feature extractor is used to extract multi-threshold neighborhood extreme value features from the signal preprocessed by the signal preprocessor. First, the extreme values of the data segments after data augmentation are calculated. Then, the neighborhood difference of the extreme values is calculated, and the difference is labeled with five states. By analyzing the multi-mode encoding of the states, the statistical total feature set of multi-threshold neighborhood extreme value patterns is obtained. The gray wolf optimizer is connected to the multi-threshold neighborhood extreme value feature extractor to determine the signal-to-noise ratio enhancement and multi-threshold neighborhood extreme value pattern statistical features through multiple iterations to extract the optimal threshold; Random forest classifiers are used to classify the best subset of input features to obtain the final classification result; A multi-threshold neighborhood extreme value feature extractor extracts multi-threshold neighborhood extreme value features and extracts pattern change statistics of extreme values to accurately classify sleep signals. The processing procedure is as follows: S10: Extract local extrema: including location information and amplitude information; S20: Based on S10, sort the extreme values obtained, determine the number and distribution of the five states, and ensure that each extreme value is labeled with a state; S30: Based on S20, perform multi-threshold encoding on the pattern changes between the labeled state neighborhoods; S40: Based on S30, the obtained threshold code is input into the five weight values and weighted to obtain the polymorphic code; S50: The extracted polymorphic codes, positional features, and frequency domain features are used as the total feature set of the multi-threshold neighborhood extreme value pattern statistics.
2. The sleep staging system based on multi-threshold neighborhood extreme value pattern statistics according to claim 1, characterized in that, The EEG signal acquisition device uses dry electrodes to collect EEG signals and transmits the data to the receiving device via Bluetooth module, where it is filtered.
3. The sleep staging system based on multi-threshold neighborhood extreme value pattern statistics according to claim 2, characterized in that, Each EEG signal segment spans 30 seconds.
4. The sleep staging system based on multi-threshold neighborhood extreme value pattern statistics according to claim 3, characterized in that, The signal preprocessor obtains a set of preprocessed segments, which are used to filter out low-frequency and high-frequency interference components in the EEG signal and to optimize the physiological characteristics of the uneven number of segments in the EEG signal using data augmentation.
5. The sleep staging system based on multi-threshold neighborhood extreme value pattern statistics according to claim 3, characterized in that, The data preprocessor performs the following process: S1: Filter the acquired EEG signals; S2: Based on S1, the filtered signal is shifted backward to obtain a new 30s segment; S3: Based on S2, neighboring segments with the same sleep stage are marked as set segments; S4: Based on S3, calculate the signal-to-noise ratio of the ensemble segments and take the absolute value to obtain the data-enhanced segments; S5: Combine the extracted new segments with the original data set as preprocessed signal segments.
6. The sleep staging system based on multi-threshold neighborhood extreme value pattern statistics according to claim 1, characterized in that, The obtained feature subset is input into a random forest classifier for classification, where a 10x cross-validation method is used to divide the EEG signal into a training set and a test set.
Citation Information
Patent Citations
COG (Chip-On-Glass) offset detection method based on extreme value difference statistical characteristic
CN104952081A
Industrial Internet of Things high-frequency data compression method based on time sequence segmentation and clustering
CN115459782A