An offline sleep slow wave detection system
By constructing a Gabor function dictionary similar to the slow wave pattern of sleep and combining it with an improved matching pursuit algorithm, efficient and accurate slow wave detection of sleep is achieved, solving the problems of high cost and low accuracy of traditional methods, and making it suitable for a variety of populations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIDIAN UNIV
- Filing Date
- 2023-06-15
- Publication Date
- 2026-04-14
AI Technical Summary
Traditional slow-wave sleep detection methods rely on manual labeling, which is costly and prone to errors. Existing automatic detection algorithms have low accuracy, are difficult to apply to low-amplitude EEG signals, and suffer from narrowband distortion.
The study employs a sleep EEG acquisition module, a data transmission module, and a data processing and visualization module, combined with an improved matching tracking algorithm. By constructing a Gabor function dictionary that resembles the slow wave pattern of sleep, it detects slow waves in sleep EEG signals.
It reduces labor costs, improves the efficiency and accuracy of slow-wave sleep detection, is suitable for people with lower amplitude, has a wider range of applications, and the system is highly portable.
Smart Images

Figure CN116763255B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of slow-wave sleep detection, specifically relating to an offline slow-wave sleep detection system. Background Technology
[0002] During sleep, slow-wave sleep is one of the greatest neural processes. The proportion of slow-wave sleep in normal adults is about 20%-25%. It can help the body relieve the fatigue of the day, reorganize the brain's memory, and clear metabolic waste, thus protecting our brain health. It is an important sleep stage to ensure sleep quality, and slow-wave sleep is the most important marker of the slow-wave sleep stage, playing a decisive role in its many functions.
[0003] Slow waves are an important signal during sleep and a key indicator of sleep quality. Parameters such as the frequency and amplitude of slow waves can reflect sleep depth and quality, thus slow wave detection can be used to assess sleep quality. Furthermore, there is a relationship between slow waves and mental illnesses; detecting slow waves can aid in the diagnosis and treatment of mental disorders. Additionally, the amplitude and density of slow waves are related to the occurrence of stroke; detecting slow waves can assess stroke risk and help in stroke prevention and diagnosis. Therefore, slow wave detection has broad application value and significance.
[0004] Traditional slow-wave sleep detection algorithms rely on sleep experts who visually observe and manually label sleep EEG signals. While this method is relatively accurate, it is time-consuming and labor-intensive, making it a costly task. Furthermore, due to the influence of expert subjectivity, the detection results are subject to error and lack robustness.
[0005] Currently, commercially available offline automatic slow-wave sleep detection algorithms can be categorized into one type. For example, Chinese patent CN113907709A uses a method that first filters the EEG signal to the delta band (0.3-4Hz), then identifies zero-crossing points, peaks, and troughs in the EEG signal, and detects slow waves using amplitude and duration standards. However, this method suffers from narrowband distortion, resulting in low accuracy in slow-wave detection and a tendency for false positives and false negatives. Furthermore, because this algorithm is based on a rigid amplitude standard, it is not suitable for populations with low EEG signal amplitude, such as the elderly and patients with mental illnesses. Summary of the Invention
[0006] To address the aforementioned problems in the existing technology, this invention provides an offline slow-wave sleep detection system. The technical problem to be solved by this invention is achieved through the following technical solution:
[0007] An offline slow-wave sleep detection system includes: a sleep EEG acquisition module, a data transmission module, and a data processing and visualization module, wherein...
[0008] The sleep EEG acquisition module is used to acquire and store the sleep EEG signals of the target, and transmit them to the data processing and visualization module via the data transmission module.
[0009] The data processing and visualization module is used to process the received sleep EEG signals, select specific sleep EEG signals from the processed sleep EEG signals, and detect slow waves in the specific sleep EEG signals according to an improved matching tracking algorithm based on a pre-built dictionary; wherein, the basis functions of the pre-built dictionary are restricted to preset functions similar to the slow wave morphology of sleep.
[0010] In one embodiment of the present invention, the process of the sleep EEG acquisition module acquiring and storing the sleep EEG signal of the target includes:
[0011] Based on a preset sampling rate, the raw sleep EEG signal of the target is acquired using electrode wires and multiple preset acquisition channels determined based on the 10-20 system. The multiple preset acquisition channels include multiple channels for EEG, electrooculography, and electromyography.
[0012] The original sleep EEG signal is amplified and noise-reduced, and the resulting sleep EEG signal is stored.
[0013] In one embodiment of the present invention, the plurality of preset acquisition channels determined based on the 10-20 system include:
[0014] C3, C4, FP1, and FP2 in the EEG channels; EOG1 and EOG2 in the EOG channels; and CHINZ and CHIN1 in the EMG channels.
[0015] In one embodiment of the present invention, the process by which the data processing and visualization module processes the received sleep EEG signals includes:
[0016] Using the filtering module in the data processing and visualization module, the received sleep EEG signal is filtered using a preset filter to obtain the filtered sleep EEG signal. The sleep EEG signals of the EEG channel, the EOG channel and the EMG channel are filtered using their respective corresponding frequency ranges.
[0017] Using the artifact processing module in the data processing and visualization module, artifacts in the filtered sleep EEG signal are detected and marked based on a preset artifact processing algorithm to obtain the artifact-processed sleep EEG signal.
[0018] Using the stage segmentation module in the data processing and visualization module, the artifact-processed sleep EEG signals are divided into epochs, and a pre-trained classification model is used to classify the sleep EEG signals of each epoch into sleep stages, resulting in sleep EEG signals of each epoch carrying sleep stage labels as processed sleep EEG signals; wherein, the sleep stages include wake, N1, N2, N3 and rem, a total of five stages; the classification model is constructed based on machine learning methods and is trained on sample sleep EEG signals with sleep stage labels.
[0019] In one embodiment of the present invention, the preset artifact processing algorithm includes an artifact processing algorithm based on the Potato algorithm;
[0020] Accordingly, the detection and labeling of artifacts in the filtered sleep EEG signal based on a preset artifact processing algorithm to obtain the artifact-processed sleep EEG signal includes:
[0021] Step a1: Use a data window of a preset size to segment the filtered sleep EEG signal to obtain the window data corresponding to the current iteration;
[0022] Step a2: Calculate the covariance matrix of the window data corresponding to the current iteration;
[0023] Step a3: Based on the Potato algorithm, the covariance matrix corresponding to the current iteration, and the input reference covariance matrix, calculate the reference covariance matrix corresponding to the current iteration; wherein, for the first iteration, the input reference covariance matrix is the covariance matrix corresponding to the first iteration, and for any iteration starting from the second iteration, the input reference covariance matrix is the latest reference covariance matrix obtained after the previous iteration.
[0024] Step a4: Based on the joint eigenvalues of the covariance matrix and the reference covariance matrix corresponding to the current iteration, calculate the Euclidean distance corresponding to the current iteration to characterize the distance between the corresponding covariance matrix and the reference covariance matrix in the current iteration.
[0025] Step a5: Determine the artifact threshold to be used in the current iteration based on the currently obtained Euclidean distance set;
[0026] Step a6: Determine whether the Euclidean distance corresponding to the current iteration is greater than the artifact threshold used in the current iteration; if not, proceed to step a7; if yes, proceed to step a8.
[0027] Step a7: Mark the window data corresponding to the current iteration as non-artifacts, use the reference covariance matrix corresponding to the current iteration as the latest reference covariance matrix obtained after the current iteration, and add the Euclidean distance corresponding to the current iteration to the currently obtained Euclidean distance set to complete the update of the reference covariance matrix and the Euclidean distance set, and execute step a2 for the next window data.
[0028] Step a8: Mark the window data corresponding to the current iteration as an artifact, do not update the reference covariance matrix and the Euclidean distance set, and execute step a2 for the next window data.
[0029] In one embodiment of the present invention, determining the artifact threshold used in the current iteration based on the currently obtained Euclidean distance set includes:
[0030] Calculate the mean and standard deviation of all Euclidean distances in the currently obtained set of Euclidean distances;
[0031] The sum of twice the standard deviation and the average value is determined as the artifact threshold to be used in the current iteration.
[0032] In one embodiment of the present invention, the step of selecting a specific sleep EEG signal from the processed sleep EEG signal and detecting slow waves in the specific sleep EEG signal according to an improved matching pursuit algorithm based on a pre-built dictionary includes:
[0033] Using the slow wave detection module in the data processing and visualization module, the sleep EEG signals marked as non-artifacts and labeled as N2 and N3 in the processed sleep EEG signals are identified as specific sleep EEG signals.
[0034] Slow waves in the specific sleep EEG signal are detected using an improved matching pursuit algorithm based on a pre-built dictionary.
[0035] In one embodiment of the present invention, the dictionary construction process includes:
[0036] The basis functions of the dictionary are restricted to Gabor functions that resemble the morphology of slow-wave sleep, and their standard formula is: Where K(γ) represents the normalization coefficient; Y = {u,ω,s,φ}; u represents the center position of the Gabor function; ω represents the angular frequency of the Gabor function; s represents the scale parameter of the Gabor function; φ represents the phase parameter of the Gabor function;
[0037] The parameters of the Gabor function are set using the characteristics of slow-wave sleep, where the parameters of the Gabor function include Y.
[0038] In one embodiment of the present invention, setting the parameters of the Gabor function using the characteristics of slow sleep waves includes:
[0039] set up As the angular frequency of the Gabor function, where F s The sampling rate is f, which is determined according to the frequency range of standard sleep slow waves as f∈[0.5,2]Hz, and the step size is set to 0.1Hz;
[0040] Each sleep slow wave is detected as a separate time period, and one sleep slow wave represents only one oscillation. Therefore, the scaling parameter of the Gabor function is set as follows:
[0041] For each frequency value, choose a separate value for ω(f) and s(f) to ensure that the exponential component of the Gabor function and the frequency of the cosine function are compatible;
[0042] Set phase parameters And the step size is To ensure that the positive and negative oscillation amplitudes of the Gabor function are large enough to capture the negative and positive deflections of the slow wave sleep signal;
[0043] To ensure that the center position of the Gabor function matches the zero point between the negative and positive deflections of sleep slow waves, the formula is used. Calculate the center position of the Gabor function; where z represents the position from negative to positive zero in the signal.
[0044] In one embodiment of the present invention, the step of using the slow wave detection module in the data processing and visualization module to detect slow waves in the specific sleep EEG signal according to an improved matching pursuit algorithm based on a pre-built dictionary includes:
[0045] Step b1: Receive the specific sleep EEG signal using a sliding window of preset duration and perform filtering to obtain the current window signal;
[0046] Step b2: Detect all zero-crossing points in the current window signal and select the zero-crossing points that change from negative to positive as candidate points;
[0047] Step b3: For each candidate point obtained, calculate the frequency f of the negative to positive zero crossover point within a preset time length near that candidate point. zero ;
[0048] Step b4, determine f zero Is it greater than a given threshold? If yes, proceed to step b5; otherwise, proceed to step b6.
[0049] Step b5: Remove the candidate point;
[0050] Step b6: Determine the candidate point as a retained candidate point;
[0051] Step b7: For each retained candidate point obtained from the current window signal, the matching pursuit algorithm and the dictionary are used for processing to select the atom with the largest scalar product as the atom that best matches the current residual signal, and the current residual signal is updated using the obtained largest scalar product;
[0052] Step b8: Determine whether the obtained maximum scalar product is greater than the preset scalar product threshold; if not, proceed to step b9; if yes, proceed to step b10.
[0053] Step b9: Determine that the candidate point to be retained is not a slow wave, execute step b7, and after the candidate points to be retained obtained from the current window signal have been traversed, execute step b1;
[0054] Step b10: Add the reserved candidate point to the candidate slow wave list, execute step b7, and after the reserved candidate points obtained from the current window signal have been traversed, execute step b1;
[0055] Step b11: Filter the signal near each reserved candidate point in the candidate slow wave list to a preset frequency range, set the start point of the slow wave to the first zero-crossing point from positive to negative before the reserved candidate point, set the end point to the first zero-crossing point after the reserved candidate point, and determine whether its duration is within the preset duration. If so, determine the corresponding waveform as a slow wave.
[0056] The beneficial effects of this invention are:
[0057] The offline slow-wave sleep detection system provided in this invention includes a sleep EEG acquisition module, a data transmission module, and a data processing and visualization module. It possesses a complete set of analytical algorithms for sleep EEG acquisition, storage, transmission, data processing, and slow-wave detection. The system is highly portable, avoiding the limitations of high cost and demanding location requirements of traditional PSG devices. It can complete sleep EEG acquisition and slow-wave detection with minimal impact on sleep. The system proposes an improved matching pursuit algorithm for slow-wave detection. This algorithm constructs a dictionary by restricting the basis functions to preset functions similar to the slow-wave morphology of sleep waves. This dictionary is then combined with the traditional matching pursuit algorithm to complete sleep slow-wave detection. This detection algorithm utilizes the shape of slow waves, significantly reducing labor costs while maintaining high efficiency, accuracy, and reliability. Because the detection process relies on waveform rather than rigid amplitude indicators, it is also suitable for individuals with lower amplitude, thus having a wider range of applications. Attached Figure Description
[0058] Figure 1This is a schematic diagram of an offline slow-wave sleep detection system provided in an embodiment of the present invention;
[0059] Figure 2 This is a schematic diagram of an offline slow-wave sleep detection system provided in an embodiment of the present invention;
[0060] Figure 3 This is a schematic diagram of the data processing and visualization module according to an embodiment of the present invention;
[0061] Figure 4 This is a schematic diagram of the classification process of the classification model in an embodiment of the present invention;
[0062] Figure 5 This is a standard waveform diagram for slow waves;
[0063] Figure 6 This is a dictionary diagram of an embodiment of the present invention;
[0064] Figure 7 This is a schematic diagram of the slow-wave detection process according to an embodiment of the present invention. Detailed Implementation
[0065] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0066] like Figure 1 As shown, the offline slow-wave sleep detection system provided in this embodiment of the invention may include:
[0067] The system includes a sleep EEG acquisition module, a data transmission module, and a data processing and visualization module.
[0068] The sleep EEG acquisition module is used to acquire and store the sleep EEG signals of the target, and transmit them to the data processing and visualization module via the data transmission module.
[0069] The data processing and visualization module is used to process the received sleep EEG signals, select specific sleep EEG signals from the processed sleep EEG signals, and detect slow waves in the specific sleep EEG signals according to an improved matching tracking algorithm based on a pre-built dictionary; wherein, the basis functions of the pre-built dictionary are restricted to preset functions similar to the slow wave morphology of sleep.
[0070] The following sections describe each module individually. For optional implementation methods, please refer to [link to documentation / reference]. Figure 2The diagram illustrates an architecture of an offline slow-wave sleep detection system.
[0071] (1) Sleep EEG Acquisition Module
[0072] The target to be tested may include humans and other animals; the sleep EEG acquisition module can acquire the EEG signals generated by the target during the sleep stage based on any existing virtual EEG positioning system, such as the 10-10 system, the 10-20 system, and the 64-lead system, etc., without specific limitations.
[0073] In one optional implementation, a 10-20 system can be used. Specifically, the process of the sleep EEG acquisition module acquiring and storing the sleep EEG signals of the target includes:
[0074] 1) Based on the preset sampling rate, the original sleep EEG signal of the target to be tested is acquired using electrode wires and multiple preset acquisition channels determined based on the 10-20 system. The multiple preset acquisition channels include multiple channels of EEG, EEG and EMG.
[0075] In this embodiment of the invention, electrodes can be set at multiple locations on the skull of the target area, located by a 10-20 system, respectively, for electroencephalography (EEG), electrooculography (EOG), and electromyography (EMG). Sleep EEG signals from the corresponding channels at each location are acquired using electrode lines at a preset sampling rate, and the obtained sleep EEG signals from all channels are used as the raw sleep EEG signal. The multiple locations for EEG, EOG, and EMG, as well as the preset sampling rate, can be selected as needed and are not specifically limited herein.
[0076] For example, in one optional implementation, the multiple preset acquisition channels determined based on the 10-20 system include:
[0077] C3, C4, FP1, and FP2 in the EEG channels; EOG1 and EOG2 in the EOG channels; and CHINZ and CHIN1 in the EMG channels.
[0078] For example, the sleep EEG acquisition module in this embodiment of the invention can be implemented based on an acquisition board. For instance, in one optional implementation, the acquisition board can be built based on the ADS1299 chip, with a total of 10 interfaces, including 8 acquisition channels. The sampling rate can be 250Hz. The acquisition channels are: EEG: C3, C4, FP1, FP2; EOG1 (representing left eye EEG) and EOG2 (representing right eye EEG); and CHINZ and CHIN1 (representing electromyography).
[0079] For details regarding the acquisition channels of the 10-20 system, please refer to the relevant content of the 10-20 system; further explanation is not provided here. Of course, the multiple preset acquisition channels in this embodiment are not limited to those described above.
[0080] 2) The original sleep EEG signal is amplified and noise-reduced, and the resulting sleep EEG signal is stored.
[0081] Using the acquisition board example described above, its internal components may include amplifiers and filtering modules for amplification and noise reduction, respectively. The specific types of these components are not limited here. The resulting sleep EEG signals, after amplification and noise reduction, can be stored on an SD card within the acquisition board, and so on.
[0082] (2) Data transmission module
[0083] In this embodiment of the invention, the data transmission module can be a mobile device, such as a mobile phone. The data transmission module can receive sleep EEG signals sent by the sleep EEG acquisition module and transmit them to the data processing and visualization module via Bluetooth or other means.
[0084] Alternatively, the data transmission module can also be integrated into the sleep EEG acquisition module, which is also reasonable.
[0085] (3) Data Processing and Visualization Module
[0086] In one alternative implementation, please refer to Figure 3 The schematic diagram of the data processing and visualization module shown can include a filtering module, an artifact processing module, a stage division module, and a slow wave detection module.
[0087] The filtering module, artifact removal module, and stage division module in the data processing and visualization module work together to process the received sleep EEG signals.
[0088] In one optional implementation, the process by which the data processing and visualization module processes the received sleep EEG signals includes:
[0089] 1) Using the filtering module in the data processing and visualization module, the received sleep EEG signal is filtered by a preset filter to obtain the filtered sleep EEG signal, wherein the sleep EEG signals of the EEG channel, the EOG channel and the EMG channel are filtered by their respective corresponding frequency ranges.
[0090] The preset filters may include Butterworth filters, etc. The filtering frequency ranges corresponding to the sleep EEG signals of the EEG channel, EEG channel, and EMG channel can also be reasonably selected as needed, and there are no restrictions here.
[0091] For example, the filtering module can use a fifth-order Butterworth filter to filter the sleep EEG signals of each input channel. The filtering frequency range of the EEG signals can be 0.5 to 35 Hz, the filtering range of the electrooculogram (EOG) signals can be 0.05 to 35 Hz, and the filtering range of the electromyogram (EMG) signals can be 10 to 100 Hz.
[0092] 2) Using the artifact processing module in the data processing and visualization module, artifacts in the filtered sleep EEG signal are detected and marked based on a preset artifact processing algorithm to obtain the artifact-processed sleep EEG signal.
[0093] Artifact removal can mark irrelevant interference data to improve the accuracy of subsequent sleep stage segmentation and slow wave waveform detection.
[0094] This invention can employ any existing artifact processing algorithm, without limitation. For example, in one optional embodiment, the preset artifact processing algorithm includes an improved version based on the Potato algorithm. The Potato algorithm is a distance-based clustering algorithm that uses Riemannian geometry to calculate the distance between covariance matrices. It can cluster similar covariance matrices into a single class, thereby obtaining a reference covariance matrix. The Potato algorithm can improve the accuracy and robustness of noise detection and has high applicability and reliability for processing multi-channel physiological signal data.
[0095] Taking the Potato algorithm-based artifact processing algorithm as an example, in one optional implementation, the detection and labeling of artifacts in the filtered sleep EEG signal based on the preset artifact processing algorithm to obtain the artifact-processed sleep EEG signal may include:
[0096] Step a1: Use a data window of a preset size to segment the filtered sleep EEG signal to obtain the window data corresponding to the current iteration;
[0097] The preset size of the data window can be set according to the required size of the data to be cut, such as 5 seconds.
[0098] It is understood that the filtered sleep EEG signals slide into the data window in chronological order. When the amount of incoming data reaches the preset size of the data window, a data segmentation is performed to obtain one window of data. Therefore, as the filtered sleep EEG signals continuously enter the data window, several window data points can be segmented. In this embodiment of the invention, one window of data corresponds to one iteration. The following explanation uses the window data corresponding to the current iteration as an example to illustrate the subsequent steps.
[0099] Step a2: Calculate the covariance matrix of the window data corresponding to the current iteration;
[0100] Specifically, let E be the matrix corresponding to the filtered sleep EEG signal of the (x+1)th data window. x+1 The formula for calculating its covariance matrix is:
[0101]
[0102] Where, ∑ x+1 Let represent the covariance matrix of the data for the (x+1)th data window in the current iteration. For multi-channel signal data, the covariance matrix is a symmetric positive definite matrix that describes the relationship between different channels; N represents the data length of the filtered sleep EEG signal for the (x+1)th data window; E x+1 T E represents x+1 The transpose of .
[0103] Step a3: Based on the Potato algorithm, the covariance matrix corresponding to the current iteration, and the input reference covariance matrix, calculate the reference covariance matrix corresponding to the current iteration;
[0104] This step uses the Potato algorithm to cluster the covariance matrices of all data windows, grouping similar covariance matrices into one class to obtain a reference covariance matrix. It also employs an iterative clustering approach, adaptively adjusting the reference covariance matrix in different iterations.
[0105] The formula for calculating the reference covariance matrix corresponding to the current iteration is:
[0106]
[0107] in, This represents the reference covariance matrix corresponding to the current iteration; Represents the input reference covariance matrix; ∑ x+1 This represents the covariance matrix of the window data corresponding to the current iteration.
[0108] For the first iteration, the input reference covariance matrix is the covariance matrix corresponding to the first iteration. For any iteration starting from the second iteration, the input reference covariance matrix is the latest reference covariance matrix obtained after the previous iteration.
[0109] Step a4: Based on the joint eigenvalues of the covariance matrix and the reference covariance matrix corresponding to the current iteration, calculate the Euclidean distance corresponding to the current iteration to characterize the distance between the corresponding covariance matrix and the reference covariance matrix in the current iteration.
[0110] For the covariance matrix of the window data corresponding to the current iteration, this step uses a Riemannian geometry algorithm to calculate its distance to the corresponding reference covariance matrix. Specifically, calculating the distance between two covariance matrices requires performing a logarithmic transformation on the eigenvalues of the covariance matrices, and then calculating the Euclidean distance between the eigenvalues. Therefore, this step first calculates the joint eigenvalue λ of the covariance matrix corresponding to the current iteration and the reference covariance matrix. i , it is The i-th eigenvalue, therefore, for the window data corresponding to the current iteration, there are multiple λ values. i .
[0111] Then, the Euclidean distance is calculated using the following formula:
[0112]
[0113] Where, d x+1 This represents the Euclidean distance corresponding to the current iteration.
[0114] Step a5: Determine the artifact threshold to be used in the current iteration based on the currently obtained Euclidean distance set;
[0115] The Euclidean distance set contains the Euclidean distances calculated for each non-artifact window of data. For the first iteration, the current Euclidean distance set is the set of Euclidean distances corresponding to all data windows, assuming that all data are non-artifacts. For each iteration starting from the second iteration, the current Euclidean distance set is the Euclidean distance set most recently determined in the previous iteration. Please refer to the relevant description below for understanding this point.
[0116] In one optional implementation, determining the artifact threshold for the current iteration based on the currently obtained Euclidean distance set includes:
[0117] 1) Calculate the mean and standard deviation of all Euclidean distances in the currently obtained set of Euclidean distances;
[0118] Specifically, the mean can be represented as μ, and the standard deviation can be represented as σ.
[0119] 2) The sum of twice the standard deviation and the average value is determined as the artifact threshold to be used in the current iteration.
[0120] The artifact threshold used in the current iteration can be expressed as th x+1 ,th x+1 =μ+2σ.
[0121] Step a6: Determine whether the Euclidean distance corresponding to the current iteration is greater than the artifact threshold used in the current iteration; if not, proceed to step a7; if yes, proceed to step a8.
[0122] Specifically, this step is to determine whether d exists. x+1 >th x+1 .
[0123] Step a7: Mark the window data corresponding to the current iteration as non-artifacts, use the reference covariance matrix corresponding to the current iteration as the latest reference covariance matrix obtained after the current iteration, and add the Euclidean distance corresponding to the current iteration to the currently obtained Euclidean distance set to complete the update of the reference covariance matrix and the Euclidean distance set, and execute step a2 for the next window data.
[0124] If d x+1 ≤th x+1 The window data corresponding to the current iteration is marked as non-artifact, and the reference covariance matrix corresponding to the current iteration is used as the latest reference covariance matrix obtained after the current iteration, which is then used as the input reference covariance matrix for the next iteration. Simultaneously, the Euclidean distance corresponding to the current iteration is added to the currently obtained Euclidean distance set, so that the Euclidean distance set obtained in the next iteration contains that Euclidean distance.
[0125] Step a8: Mark the window data corresponding to the current iteration as an artifact, do not update the reference covariance matrix and the Euclidean distance set, and execute step a2 for the next window data.
[0126] If d x+1 >th x+1 The window data corresponding to the current iteration is marked as an artifact, and the reference covariance matrix is not updated; that is, the reference covariance matrix calculated for the current iteration is not used as the input reference covariance matrix for the next iteration. Simultaneously, the Euclidean distance set is not updated; that is, the Euclidean distance corresponding to the current iteration is not added to the Euclidean distance set.
[0127] It is understood that after obtaining each window data in the embodiments of the present invention, covariance matrix calculation, reference covariance matrix calculation, Euclidean distance calculation, artifact threshold determination, Euclidean distance judgment, and artifact / non-artifact labeling are performed, and then the above processing process is performed again for the next window data obtained in step a1.
[0128] 3) Using the stage division module in the data processing and visualization module, the sleep EEG signal after artifact processing is divided into epochs, and the sleep EEG signal of each epoch is classified into sleep stages using the pre-trained classification model, so as to obtain the sleep EEG signal of each epoch carrying the sleep stage label as the processed sleep EEG signal.
[0129] The epoch division can be completed according to a set duration, such as 30 seconds, and the specific duration can be selected as needed. There are no restrictions here.
[0130] Specifically, according to the sleep stage classification standards established by the American Academy of Sleep Medicine (AASM), sleep stages can be divided into five stages: wake, N1, N2, N3, and REM (rapid eye movement). N1, N2, and N3 together, or all of them, belong to the NREM (non-rapid eye movement) stage. For details, please refer to the relevant technical explanations. Therefore, in this embodiment of the invention, the sleep stages include five stages: wake, N1, N2, N3, and REM.
[0131] The classification model is built based on machine learning methods and is trained on sample sleep EEG signals with sleep stage labels. These sample sleep EEG signals are acquired using a sleep EEG acquisition module, then processed by a filtering module and an artifact removal module. The sleep stages are known; for example, the sleep stage classification labels can be implemented using methods such as manual labeling or other algorithmic labeling.
[0132] This classification model can be implemented using existing neural network models. For example, in one possible implementation, the structure of the classification model can be built by embedding multiple Support Vector Machines (SVMs) into a decision tree framework to achieve multi-class classification. The classification process of this model can be found in [link to relevant documentation]. Figure 4 understand, Figure 4 This is a schematic diagram illustrating the classification process of a classification model as an example in an embodiment of the present invention.
[0133] First, for example, the constructed classification model can be trained and tested using data from the public dataset MASS. Specifically, 80% of the data in the dataset can be used for training, and the remaining 20% can be used for testing to verify the model's classification effectiveness. The training process for the classification model can be implemented based on the training process of existing machine learning models or neural network models, which will not be described in detail here.
[0134] Figure 4 In this context, EEG, EOG, and EMG data refer to the sleep EEG signals input into the classification model.
[0135] The feature extraction and dimensionality reduction section refers to the extraction of 102 features for each sleep stage, including time-domain features, frequency-domain features, and nonlinear features. After extracting all features, the feature space was reduced to 32 features by removing outlier features (outlier features are those whose values are twice as high as the standard deviation of all values of the same feature in the same class) and features that were not significant enough in the standard t-test in the statistical analysis.
[0136] In the feature subset selection part, a standard forward process selection method is used to find a small feature subset in the high-dimensional feature space that has a significant impact on model performance. Specifically, this forward process selection method is applied to each node of the decision tree to select the best feature subset for each SVM. Once the decision tree has set the optimal parameters and data features for each SVM, the sleep data can be divided into stages to obtain the predicted sleep stage labels.
[0137] The classification model achieved an average accuracy of 80.77% using 10-fold cross-validation, and an average accuracy of 80.49% on the test set. This demonstrates that the classification model has good accuracy in classifying sleep stages.
[0138] The above-described classification model is merely an optional example and is not intended to limit the classification model of the embodiments of the present invention. The classification model of the embodiments of the present invention can be implemented using any model capable of classifying sleep stages of sleep EEG signals, and no specific form is limited here.
[0139] The slow wave detection module within the data processing and visualization module can function as follows: processing received sleep EEG signals, selecting specific sleep EEG signals from the processed signals, and detecting slow waves in the specific sleep EEG signals using an improved matching tracking algorithm based on a pre-built dictionary. It also includes visualizing the detected slow wave data or information, such as displaying it in a mobile app.
[0140] In one optional implementation, the step of selecting a specific sleep EEG signal from the processed sleep EEG signal and detecting slow waves in the specific sleep EEG signal according to an improved matching pursuit algorithm based on a pre-built dictionary includes:
[0141] i) Using the slow wave detection module in the data processing and visualization module, the sleep EEG signals marked as non-artifacts and labeled as N2 and N3 in the processed sleep EEG signals are identified as specific sleep EEG signals.
[0142] Slow-wave sleep (SWS) refers to stage N3 sleep, a deep sleep stage characterized by low-frequency, high-amplitude slow waves on the EEG. While some slow waves also occur in stage N2, they are less abundant than in stage N3. Therefore, slow-wave detection primarily targets stage N3 sleep, but stage N2 slow waves are also used as supplementary references. Thus, this embodiment of the invention only uses processed sleep EEG signals marked as non-artifacts and labeled with sleep stages N2 and N3 as specific sleep EEG signals for slow-wave detection.
[0143] It is understandable that the processed sleep EEG signals input to the slow-wave detection module all contain non-artifact / artifact markers and sleep stage labels. Therefore, the slow-wave detection module only needs to check the markers and sleep stage labels in the processed sleep EEG signals input. Signals that meet the above requirements are identified as specific sleep EEG signals for further processing.
[0144] ii) Detect slow waves in the specific sleep EEG signal using an improved matching pursuit algorithm based on a pre-built dictionary.
[0145] The Matched Pursuit (MPP) algorithm is a commonly used signal processing algorithm, primarily used to extract target signals from noisy backgrounds. The basic idea of the MPP algorithm is to convolve the target signal with a set of filters to obtain a filtered output signal. Then, by analyzing the filtered output signal, relevant features of the target signal are extracted, enabling functions such as signal detection, recognition, and localization.
[0146] In this embodiment of the invention, the slow-wave detection module improves the matching pursuit algorithm by selecting a more accurate dictionary, forming an improved matching pursuit algorithm. This algorithm identifies and extracts sleep slow waves from the sleep EEG signals input to the slow-wave detection module. This improved matching pursuit algorithm significantly improves computational efficiency while ensuring detection accuracy. The core idea of this improved matching pursuit algorithm is to approximate the signal through linear combinations of atoms in the constructed dictionary; therefore, one of the core aspects of this improved matching pursuit algorithm is the selection of the dictionary.
[0147] To facilitate understanding of the improved matching and tracking algorithm proposed in this embodiment of the invention, the dictionary construction process will be explained first.
[0148] In this embodiment of the invention, the basis functions of the pre-constructed dictionary are restricted to preset functions similar to the slow-wave morphology of sleep. These preset functions can be selected appropriately as needed. For example, the preset functions may include Gabor functions, etc.
[0149] Taking the Gabor function as an example, in one optional implementation, the dictionary construction process includes:
[0150] 1) Restrict the basis functions of the dictionary to Gabor functions with morphology similar to slow waves during sleep, the standard formula of which is:
[0151] Where K(γ) represents the normalization coefficient; Y = {u,ω,s,φ}; u represents the center position of the Gabor function; ω represents the angular frequency of the Gabor function; s represents the scale parameter of the Gabor function; φ represents the phase parameter of the Gabor function;
[0152] Specifically, the dictionary in this embodiment of the invention uses a set of Gabor functions. These basis functions can provide optimal time-frequency resolution. Using Gabor functions, it is easy to obtain basis functions similar to the typical waveform of slow waves, and they can reproduce most of the basic morphological characteristics of sleep slow waves. The standard waveform of slow waves is as follows: Figure 5 As shown in the figure, the horizontal axis represents time in seconds (sec); the vertical axis represents voltage in microvolts (μV); A, B, C, D, and E represent the corresponding distances; negative peak represents a negative peak value; positive peak represents a positive peak value; mid-crossing represents a zero-crossing point; and Start and End represent the start and end points of the waveform, respectively.
[0153] 2) The parameters of the Gabor function are set using the characteristics of slow sleep waves, where the parameters of the Gabor function include Y.
[0154] Because the basis functions of the dictionary are restricted to Gabor functions that are similar in shape to slow sleep waves, it is necessary to use the characteristics of slow sleep waves to set the parameters Y = {u, ω, s, φ}, etc.
[0155] In one optional implementation, setting the parameters of the Gabor function using the characteristics of slow sleep waves includes:
[0156] (1) Setting As the angular frequency of the Gabor function, where F s The sampling rate is f, which is determined according to the frequency range of standard sleep slow waves as f∈[0.5,2]Hz, and the step size is set to 0.1Hz;
[0157] Specifically, since the frequency of standard sleep slow waves is between 0.5 and 2 Hz, therefore... f∈[0.5,2]Hz, with a step size of 0.1Hz, is used as the frequency of the Gabor function.
[0158] (2) Each sleep slow wave is detected as a separate time period, and one sleep slow wave represents only one oscillation. Therefore, the scaling parameter of the Gabor function is set as follows:
[0159] Specifically, the idea behind this guideline is to ensure that the Gabor function has a duration of one oscillation period at the frequency of sleep slow waves. In other words, the Gabor function should be able to capture the entire oscillation of sleep slow waves within its duration. By setting the scaling parameter s in this way, it can be ensured that the Gabor function has an appropriate duration to capture sleep slow waves.
[0160] (3) For each frequency value, choose a separate value for ω(f) and s(f) to ensure that the exponential component of the Gabor function and the frequency of the cosine function are compatible;
[0161] Specifically, embodiments of the present invention also require ensuring that the frequencies of the exponential component and the cosine function of the Gabor function are compatible. For each frequency value, a separate value for ω(f) and s(f) needs to be selected. This is because the Gabor function contains two important parts: the exponential component and the cosine function. The exponential component, often referred to as the Gaussian envelope, controls the time and frequency characteristics of the Gabor function, while the cosine function controls its phase characteristics. By adjusting the parameters of the Gabor function, the frequencies of its exponential component and cosine function are made compatible.
[0162] (4) Set phase parameters And the step size is To ensure that the positive and negative oscillation amplitudes of the Gabor function are large enough to capture the negative and positive deflections of the slow wave sleep signal;
[0163] Specifically, in sleep slow-wave signals, negative and positive deflections occur; that is, the signal first deflects downwards and then upwards. To ensure that the Gabor function can capture these two deflections, this embodiment of the invention requires setting appropriate phase parameters. In the slow-wave detection module, the phase parameter φ is fixed at... and Between, that is: And let the step size be By limiting the phase of the Gabor function within this range, it can be ensured that the positive and negative oscillation amplitudes of the Gabor function are large enough to capture the negative and positive deflections of sleep slow wave signals.
[0164] (5) To ensure that the center position of the Gabor function matches the zero point between the negative and positive deflections of sleep slow waves, the formula is used. Calculate the center position of the Gabor function;
[0165] Specifically, in sleep slow-wave signals, sleep slow waves typically appear at the zero-crossing position between the negative and positive deflections of the signal. Therefore, embodiments of the present invention aim for the Gabor function to have the same negative to positive zero-crossing position to better capture sleep slow-wave signals. Thus, in sleep slow-wave detection, the above formula can be used to calculate the center position of the Gabor function. Here, z represents the negative to positive zero-crossing position in the signal; ω(f) is the angular frequency of the Gabor function; and φ is the phase parameter of the Gabor function. This formula ensures that the center position of the Gabor function matches the zero-crossing position between the negative and positive deflections of the sleep slow wave. Since sleep slow-wave signals only appear at the zero-crossing position between the negative and positive deflections of the signal, embodiments of the present invention only need to consider the negative to positive zero-crossing position of the signal as candidate points.
[0166] In summary, by selecting appropriate Gabor function parameters and calculating the center position of the Gabor function, this invention can construct a dictionary matrix containing only those similar to the slow-wave morphology of sleep, thereby improving the accuracy and efficiency of slow-wave sleep detection. The final dictionary image is shown below. Figure 6 As shown.
[0167] The above describes the dictionary construction process of this invention. The improved matching pursuit algorithm of this invention is implemented using the traditional matching pursuit algorithm and this dictionary. The improved matching pursuit algorithm will be described next.
[0168] In one optional implementation, the step of using the slow-wave detection module in the data processing and visualization module to detect slow waves in the specific sleep EEG signal according to an improved matching pursuit algorithm based on a pre-built dictionary includes:
[0169] Step b1: Receive the specific sleep EEG signal using a sliding window of preset duration and perform filtering to obtain the current window signal;
[0170] The preset duration and the filter used for filtering can be selected as needed and are not restricted here. For example, the preset duration can be 30 seconds, and the filter can be a Butterworth filter, etc.
[0171] Here is an example of this step: Set the sliding window to 30 seconds and the overlap to 2 seconds, and receive the specific sleep EEG signal; then use a 5th-order Butterworth bandpass filter to bandpass filter the received specific sleep EEG signal, with a filtering range of 0.5-35Hz. The overlap function allows signals at the edges of the window to also be detected.
[0172] Step b2: Detect all zero-crossing points in the current window signal and select the zero-crossing points that change from negative to positive as candidate points;
[0173] Step b3: For each candidate point obtained, calculate the frequency f of the negative to positive zero crossover point within a preset time length near that candidate point. zero ;
[0174] The preset time length can be 2 seconds, etc., and is not limited here. Taking this as an example, f zero The calculation process can be as follows: f is obtained by calculating the ratio of the number of all candidate points appearing in the vicinity of the candidate point within 2 seconds to the length of the 2-second data. zero .
[0175] Step b4, determine f zero Is it greater than a given threshold? If yes, proceed to step b5; otherwise, proceed to step b6.
[0176] Because f zero The magnitude of this value reflects whether there is a slow oscillation signal near the current candidate point. If too many zero-crossing points appear in a short period of time, it is considered that there is no slow wave and it needs to be excluded. Therefore, if this value is greater than a given threshold, the candidate point is removed.
[0177] The given threshold can be 4, etc., and there is no restriction here.
[0178] Step b5: Remove the candidate point;
[0179] Step b6: Determine the candidate point as a retained candidate point;
[0180] Step b7: For each retained candidate point obtained from the current window signal, the matching pursuit algorithm and the dictionary are used for processing to select the atom with the largest scalar product as the atom that best matches the current residual signal, and the current residual signal is updated using the obtained largest scalar product;
[0181] For each retained candidate point, the process of using the matching pursuit algorithm and the previously defined dictionary, i.e., processing with the improved matching pursuit algorithm, is as follows:
[0182] First, iterate through all the atoms in the dictionary. For each atom in the dictionary, compare it with the current residual signal R. n (y) Perform dot product (inner product), i.e., calculate scalar product |<ω i ,R n (y)>|, where ω i R represents atoms in a dictionary. n (y) represents the current residual signal. In this step, we need to find a scalar product |<ω. i ,R n(y)>|maximizes the atom, in other words, finding the atom that best matches the current residual signal. At this point, the maximum scalar product k = |<ω can be obtained. n ,R n (y)>|. The atom with the largest scalar product is selected as the atom that best matches the current residual signal. The residual signal refers to the difference between the input and predicted signals; for details, please refer to the matching pursuit algorithm explanation, which will not be elaborated upon here.
[0183] To perform subsequent iterations, the residual signal needs to be updated. Specifically, the found atom ω... n Multiply it by its corresponding scalar product k, and then from the current residual signal ω n Subtract this product from the result. This will give you the new residual signal:
[0184] R n+1 (y)=R n (y)- <R n (y),ω n >ω n
[0185] Repeat the above process until the condition of the minimum residual energy threshold is met. This condition refers to the stopping condition of this iterative process. During the iteration, the lower the residual, the better the match. When the residual energy falls below a certain threshold, the iteration stops.
[0186] Please refer to the matching pursuit algorithm for details on this step; it will not be explained in detail here.
[0187] Step b8: Determine whether the obtained maximum scalar product is greater than the preset scalar product threshold; if not, proceed to step b9; if yes, proceed to step b10.
[0188] The preset scalar product threshold can be set as needed, such as 40, and there is no restriction here.
[0189] Step b9: Determine that the candidate point to be retained is not a slow wave, execute step b7, and after the candidate points to be retained obtained from the current window signal have been traversed, execute step b1;
[0190] If the obtained maximum scalar product is less than or equal to a preset scalar product threshold, it is determined that the waveform of the candidate point does not represent a slow sleep wave. Therefore, the candidate point is not a slow wave, and step b7 can be executed to determine the next candidate point obtained from the current window signal. Furthermore, if the candidate points obtained from the current window signal have been traversed, step b1 is executed to obtain the next window signal for processing after step b1.
[0191] Step b10: Add the reserved candidate point to the candidate slow wave list, execute step b7, and after the reserved candidate points obtained from the current window signal have been traversed, execute step b1;
[0192] If the maximum scalar product obtained is greater than a preset scalar product threshold, the candidate point to be retained is added to the candidate slow wave list. Then, step b7 can be executed to determine the next candidate point to be retained from the current window signal. Similarly, if the candidate points to be retained from the current window signal have been traversed, step b1 is executed to obtain the next window signal for processing after step b1.
[0193] Step b11: Filter the signal near each reserved candidate point in the candidate slow wave list to a preset frequency range, set the start point of the slow wave to the first zero-crossing point from positive to negative before the reserved candidate point, set the end point to the first zero-crossing point after the reserved candidate point, and determine whether its duration is within the preset duration. If so, determine the corresponding waveform as a slow wave.
[0194] This step involves slow-wave extraction and verification. The preset frequency range and preset duration can be set as needed; for example, the preset frequency range can be 0.5–4 Hz, and the preset duration can be 0.5–2 seconds.
[0195] The slow-wave detection process in this embodiment of the invention can be found in [reference needed]. Figure 7 I understand, and I will not repeat the explanation here.
[0196] The offline slow-wave sleep detection system provided in this invention includes a sleep EEG acquisition module, a data transmission module, and a data processing and visualization module. It possesses a complete set of analytical algorithms for sleep EEG acquisition, storage, transmission, data processing, and slow-wave detection. The system is highly portable, avoiding the limitations of high cost and demanding location requirements of traditional PSG devices. It can complete sleep EEG acquisition and slow-wave detection with minimal impact on sleep. The system proposes an improved matching pursuit algorithm for slow-wave detection. This algorithm constructs a dictionary by restricting the basis functions to preset functions similar to the slow-wave morphology of sleep waves. This dictionary is then combined with the traditional matching pursuit algorithm to complete sleep slow-wave detection. This detection algorithm utilizes the shape of slow waves, significantly reducing labor costs while maintaining high efficiency, accuracy, and reliability. Because the detection process relies on waveform rather than rigid amplitude indicators, it is also suitable for individuals with lower amplitude, thus having a wider range of applications.
[0197] In one optional implementation, the data processing and visualization module may further include a sleep quality assessment module.
[0198] The sleep quality assessment module can calculate parameters related to sleep quality and sleep structure based on the sleep staging results from the previous stage segmentation module. Sleep quality parameters may include total sleep time, sleep efficiency, sleep latency, and number of awakenings. Sleep structure parameters include the sleep time of each sleep stage and the sleep percentage of each stage. This module also calculates slow-wave-related parameters based on the slow-wave detection results from the previous module, including slow-wave duration, slow-wave frequency, slow-wave density, slow-wave peak value, and slow-wave slope. Simultaneously, the sleep quality assessment module can comprehensively evaluate the overall sleep quality throughout the night and provide a final sleep score based on the weighted values of these parameters, thus providing users with a comprehensive sleep health analysis. The specific weighted calculation and sleep scoring methods can be designed as needed and are not specifically limited here. Furthermore, all parameters and results throughout the entire process can be visualized and displayed on the mobile app.
[0199] As can be seen, the solution provided by the embodiments of the present invention can further realize sleep quality assessment, which can help improve sleep quality and expand other applications related to sleep quality.
[0200] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. An offline slow-wave sleep detection system, characterized in that, Slow wave identification applicable to low slow wave amplitude conditions includes: The sleep EEG acquisition module is used to acquire and store the sleep EEG signals of the target, and transmit them to the data processing and visualization module via the data transmission module. The data processing and visualization module filters the received sleep EEG signals to obtain filtered sleep EEG signals, with the EEG, Eoptometry, and EMG channels using their respective filtering frequency ranges. Then, an artifact detection algorithm based on the Potato algorithm is used to detect and label artifacts, resulting in artifact-processed sleep EEG signals. Next, epochs are divided, and a pre-trained classification model using multiple support vector machines embedded in a decision tree framework is used to classify the sleep EEG signals of each epoch into sleep stages, obtaining sleep EEG signals of each epoch carrying sleep stage labels as processed sleep EEG signals. The sleep stages include five stages: wake, N1, N2, N3, and rem. The process of obtaining artifact-processed sleep EEG signals includes: Step a1: Use a data window of a preset size to segment the filtered sleep EEG signal to obtain the window data corresponding to the current iteration; Step a2: Calculate the covariance matrix of the window data corresponding to the current iteration; Step a3: Based on the Potato algorithm, the covariance matrix corresponding to the current iteration, and the input reference covariance matrix, calculate the reference covariance matrix corresponding to the current iteration; Step a4: Calculate the Euclidean distance for the current iteration based on the joint eigenvalues of the covariance matrix and the reference covariance matrix corresponding to the current iteration. Step a5: Calculate the average and standard deviation of all Euclidean distances in the currently obtained Euclidean distance set; the sum of twice the standard deviation and the average is determined as the artifact threshold to be used in the current iteration. Step a6: Determine whether the Euclidean distance corresponding to the current iteration is greater than the artifact threshold used in the current iteration; if not, proceed to step a7; if yes, proceed to step a8. Step a7: Mark the window data corresponding to the current iteration as non-artifacts, update the reference covariance matrix and Euclidean distance set, and execute step a2 for the next window data; Step a8: Mark the window data corresponding to the current iteration as an artifact, do not update the reference covariance matrix and Euclidean distance set, and execute step a2 for the next window data; The data processing and visualization module is further used to identify sleep EEG signals marked as non-artifacts and labeled with sleep stages N2 and N3 as specific sleep EEG signals in the processed sleep EEG signals; and to detect slow waves in these signals using an improved matching pursuit algorithm based on a pre-built dictionary. The detection process includes: step b1, receiving the specific sleep EEG signals using a sliding window of a preset duration and performing filtering to obtain the current window signal; step b2, detecting all zero-crossing points in the current window signal and identifying zero-crossing points that change from negative to positive as candidate points; and step b3, for each candidate point, calculating the ratio of the number of all candidate points appearing within 2 seconds near that candidate point to the length of the 2-second data to obtain the frequency of the negative-to-positive zero-crossing point. Step b4, determine Is it greater than a given threshold? If yes, proceed to step b5; if no, proceed to step b6. Step b5: Remove the candidate point. Step b6: Determine the candidate point as a retained candidate point. Step b7: For each retained candidate point obtained from the current window signal, process it using the matching pursuit algorithm and the dictionary, select the atom with the largest scalar product as the atom that best matches the current residual signal, and update the current residual signal using the obtained largest scalar product, adopting the method of updating the residual by retaining candidate points. Step b8: Determine whether the obtained largest scalar product is greater than a preset scalar product threshold. If no, proceed to step b9; if yes, proceed to step b10. Step b9: Determine the retained candidate point. If the candidate point is not a slow wave, proceed to step b7, and after the traversal of the reserved candidate points obtained from the current window signal is completed, proceed to step b1; Step b10, add the reserved candidate point to the candidate slow wave list, proceed to step b7, and after the traversal of the reserved candidate points obtained from the current window signal is completed, proceed to step b1; Step b11, filter the signal near each reserved candidate point in the candidate slow wave list to a preset frequency range, set the start point of the slow wave to the first zero-crossing point from positive to negative before the reserved candidate point, set the end point to the first zero-crossing point after the reserved candidate point, and determine whether its duration is within the preset duration range. If so, the corresponding waveform is determined to be a slow wave.
2. The offline slow-wave sleep detection system according to claim 1, characterized in that, The process by which the sleep EEG acquisition module acquires and stores the sleep EEG signals of the target being tested includes: Based on a preset sampling rate, the raw sleep EEG signal of the target is acquired using electrode wires and multiple preset acquisition channels determined based on the 10-20 system. The multiple preset acquisition channels include multiple channels for EEG, electrooculography, and electromyography. The original sleep EEG signal is amplified and noise-reduced, and the resulting sleep EEG signal is stored.
3. The offline slow-wave sleep detection system according to claim 2, characterized in that, The multiple preset acquisition channels determined based on the 10-20 system include: C3, C4, FP1, and FP2 in the EEG channels; EOG1 and EOG2 in the EOG channels; and CHINZ and CHIN1 in the EMG channels.
4. The offline slow-wave sleep detection system according to claim 1, characterized in that, The dictionary construction process includes: The basis functions of the dictionary are restricted to Gabor functions that resemble the morphology of slow-wave sleep, and their standard formula is: Among them, Represents the normalization coefficient; ; Indicates the center position of the Gabor function; This represents the angular frequency of the Gabor function; The scaling parameter of the Gabor function; This represents the phase parameter of the Gabor function; The parameters of the Gabor function are set using the characteristics of slow-wave sleep. The parameters of the Gabor function include... .
5. The offline slow-wave sleep detection system according to claim 4, characterized in that, The method of setting the parameters of the Gabor function using the characteristics of slow sleep waves includes: set up As the angular frequency of the Gabor function, where Indicates the sampling rate. Based on the frequency range of standard sleep slow waves, it is determined to be... Hz, and the step size is set to 0.1Hz; Each sleep slow wave is detected as a separate time period, and one sleep slow wave represents only one oscillation. Therefore, the scaling parameter of the Gabor function is set as follows: ; For each frequency value, select a single and The value of is to ensure that the exponential component of the Gabor function and the frequency of the cosine function are compatible; Set phase parameters And the step size is This is to ensure that the positive and negative oscillation amplitudes of the Gabor function are large enough to capture the negative and positive deflections of the sleep slow wave signal; To ensure that the center position of the Gabor function matches the zero point between the negative and positive deflections of sleep slow waves, the formula is used. Calculate the center position of the Gabor function; where z represents the position from negative to positive zero in the signal.
Citation Information
Patent Citations
Portable sleep monitoring system based on ear EEG
CN113907709A