Sleep cycle alternating pattern detection method and device based on time-frequency domain correlation features

By constructing a CAP detection framework and combining it with time-frequency domain feature extraction and fusion, the problem of insufficient CAP detection accuracy in existing technologies is solved, and accurate identification of phase A and phase B as well as phase A subtypes in CAP sequences is achieved, thereby improving detection accuracy.

CN116725553BActive Publication Date: 2025-10-10WUHAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310587185.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-19
Publication Date
2025-10-10
Estimated Expiration
2043-05-19

AI Technical Summary

Technical Problem

Existing CAP detection methods based on waveform features have difficulty in accurately extracting multiple EEG features, resulting in insufficient detection accuracy. In particular, the performance bottleneck is obvious when distinguishing phase A from phase B and the various subtypes of phase A in CAP sequences.

Method used

A CAP detection framework is constructed. The deep signal waveform features are extracted through the morphological feature learning module, the signal frequency domain features are extracted through the frequency domain feature calculation module, and the two features are fused through the time-frequency feature fusion and evolution correlation module. The model is trained using the training data, and finally the trained framework is used for detection.

Benefits of technology

The accuracy of CAP sequence detection was improved, especially in distinguishing the various subtypes of phase A, which enhanced the performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116725553B_ABST
    Figure CN116725553B_ABST
Patent Text Reader

Abstract

The application discloses a sleep cycle alternating pattern (CAP) detection method and device based on time-frequency domain correlation characteristics, takes single-channel electroencephalogram signal as the data basis for CAP detection, synchronously extracts time domain shape characteristics and frequency domain distribution characteristics of the signal, and captures macroscopic conversion mode of the characteristic state to realize recognition of the CAP. The method comprises the following three stages: (1) time domain shape characteristic learning: sub-band of complete electroencephalogram signal is extracted, and bidirectional gate cycle unit is used to embed shallow signal fluctuation relationship, and one-dimensional convolutional neural network is used to extract shape characteristics after segmentation; (2) frequency domain characteristic calculation: power spectral density of the electroencephalogram segment is calculated after segmentation, and kurtosis and skewness are used to measure distribution characteristics of the power spectral density; (3) characteristic fusion and macroscopic evolution representation: after time-frequency domain characteristics are fused, the bidirectional gate cycle unit is used again to capture macroscopic dependence and conversion relationship between phases of the CAP; finally, the CAP phase corresponding to each second in the input signal is determined based on the extracted characteristics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a sleep cycle alternation pattern detection method and device based on time-frequency domain correlation features. Background Art

[0002] The cyclic alternating pattern (CAP) is a periodic pattern of EEG changes that occurs during non-rapid eye movement (NREM) sleep. It represents sleep instability and disruption, and can be recorded via electroencephalography (EEG). Studies have shown that CAP is associated with primary insomnia, sleep-disordered breathing, epilepsy, depression, and other conditions. Because it can be detected in EEG in both adults and children, it is a sensitive tool for investigating sleep disorders throughout the lifespan.

[0003] CAP is characterized by a series of short-lived EEG events that appear at intervals and clearly stand out from the background. Each CAP cycle consists of a phase A and a phase B, where phase A is the EEG discharge that stands out from the background and phase B is a background segment that does not exceed 60 seconds. Phase A can also be further divided into three subtypes based on different frequency distributions. The composition of the CAP sequence reflects the degree of sleep arousal and cortical activation. In medicine, indicators such as the duration of the CAP sequence and its proportion in the non-rapid eye movement period, the proportion of each subtype of phase A, and the average duration of phase A / B are often analyzed. This helps to understand the quality and structure of a patient's sleep and assists in the diagnosis of diseases. Therefore, accurate identification of phases A, B, and each subtype of phase A in the CAP sequence is the key to the CAP recognition model. However, precisely because phase A includes a variety of EEG characteristic waves with waveform diversity, and the morphological characteristics of the subtypes of phase A divided by frequency distribution are not significantly different, existing CAP detection methods based on waveform features still face the problems of difficult extraction of typical features and insufficient detection accuracy. Summary of the Invention

[0004] The purpose of the present invention is to provide a sleep cycle alternation pattern detection method and device based on time-frequency domain correlation features, so as to solve the technical problem of low detection accuracy in the prior art.

[0005] In order to solve the above technical problems, the technical solution of the present invention is:

[0006] A first aspect provides a sleep cycle alternation pattern detection method based on time-frequency domain correlation features, comprising:

[0007] S1: Collect the EEG signals of the subjects during the non-rapid eye movement sleep period and use them as the original EEG signals;

[0008] S2: Preprocess the collected raw EEG signals and annotate the CAP phase category for each second in the segment. CAP phase categories include phase A and phase B. Phase A includes three subtypes, and phase B is the background.

[0009] S3: Construct a CAP detection framework, which includes a morphological feature learning module for extracting deep signal waveform features, a frequency domain feature calculation module for extracting signal frequency domain features, and a time-frequency feature fusion and evolution correlation module for fusing deep signal waveform features with signal frequency domain features.

[0010] S4: Obtain training data from the preprocessed and annotated data, and use the training data to train the CAP detection framework;

[0011] S5: Use the trained CAP detection framework to detect the EEG signal to be recognized.

[0012] In one embodiment, step S1 includes:

[0013] A 10-20 scalp electroencephalogram (EEG) was used to collect EEG signals during the non-rapid eye movement (NREM) sleep phase of the subjects.

[0014] In one embodiment, step S2 includes:

[0015] S2.1: Downsample the collected EEG signals to 100 Hz based on the polyphase filtering algorithm, and then apply a 0.3-30 Hz bandpass filter to the downsampled EEG signals;

[0016] S2.2: Normalize each channel of the EEG signal obtained in step S2.1 using RobustScaler;

[0017] S2.3: Segment and label the EEG signal obtained in step S2.2. Each segment is 30 seconds long, and the subtypes of phase A or phase B in the CAP sequence corresponding to each second in the segment are labeled second by second.

[0018] In one embodiment, in the CAP detection framework constructed in step S3, the morphological feature learning module is composed of sub-band extraction, bidirectional gated recurrent unit GRU, and convolutional neural network CNN in sequence, wherein the sub-band extraction is used to band-pass filter the original input single-channel sequence according to the frequency bands of 0.3-4.5Hz, 4.5-12Hz, and 12-30Hz, and the original input single-channel sequence signal is decomposed into a three-channel time series with low, medium, and high frequency band information; then the bidirectional gated recurrent unit is used to process the above-mentioned three-channel time series to associate the shallow fluctuation characteristics of the signal; finally, the hidden layer output of the aforementioned bidirectional gated recurrent unit is segmented second by second, and the same one-dimensional convolutional neural network is applied to each second segment for morphological feature learning to obtain a morphological feature vector as the extracted deep signal waveform feature.

[0019] In one embodiment, in the CAP detection framework constructed in step S3, the frequency domain feature calculation module uses power spectral density to explicitly calculate the frequency domain features of the EEG signal, specifically including: calculating the power spectral density of each second segment of the initial input EEG signal, intercepting the 1-30Hz interval of the power spectral density and using the spectral kurtosis, spectral skewness, variance and mean to measure the distribution characteristics of the power spectral density; at the same time, retaining the original power spectral density information, and performing sliding averaging with a window width and step size of 3Hz; finally, the power spectral density of each second signal segment and the kurtosis, skewness, variance and mean of the power spectral density together constitute a one-dimensional feature vector, which serves as the extracted signal frequency domain feature.

[0020] In one embodiment, in the CAP detection framework constructed in step S3, the feature fusion and evolution association module splices the one-dimensional time domain feature vector and the frequency domain feature vector corresponding to each second segment along the feature dimension to form a fused feature vector of the two, and the fused feature vector constitutes a high-dimensional time series in the time dimension; for a time series composed of a feature vector, the feature fusion and evolution association module again applies the bidirectional GRU to capture the evolution of its macroscopic features, and finally classifies the implicit state of each output node. The classifier for classification uses a multi-layer perceptron network, and the output classification result is the category of the CAP sequence corresponding to each second time segment in the original input signal, including three subtypes A1, A2, and A3 and phase B.

[0021] In an implementation, in the training process of step S4, the brain electrical signals of the subject are input into the model in the form of a single channel, one segment per 30s, and the labels are softened, specifically, for the sample labels of the regions before and after the phase conversion, the confidence belonging to the labeled category in the One-hot encoding is adjusted to 0.7, and the confidence belonging to the category corresponding to the adjacent segment is adjusted to 0.3; the classification adopts a weighted cross-entropy to calculate the classification loss and perform back propagation.

[0022] Based on the same inventive concept, the second aspect of the present application provides a sleep cycle alternation mode detection device based on time-frequency domain correlation features, comprising:

[0023] A data acquisition module is configured to acquire brain electrical signals of a subject in a non-rapid eye movement sleep period as raw brain electrical signals.

[0024] A preprocessing module is configured to preprocess the acquired raw brain electrical signals and label the CAP phase category to which each second in a segment belongs, wherein the CAP phase category includes A phase and B phase, the A phase includes three subtypes, and the B phase is background.

[0025] A detection framework modeling module is configured to model a CAP detection framework, wherein the CAP detection framework includes a morphological feature learning module for extracting deep signal waveform features, a frequency domain feature calculation module for extracting signal frequency domain features, and a time-frequency feature fusion and evolution correlation module for fusing the deep signal waveform features and the signal frequency domain features.

[0026] A training module is configured to obtain training data from the data after preprocessing and labeling, and train the CAP detection framework using the training data.

[0027] A detection module is configured to detect the brain electrical signals to be identified using the trained CAP detection framework.

[0028] Based on the same inventive concept, the third aspect of the present application provides a computer readable storage medium having a computer program stored thereon, wherein the program is executed to implement the method of the first aspect.

[0029] Based on the same inventive concept, the fourth aspect of the present application provides a computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of the first aspect when executing the program.

[0030] Compared with the prior art, the present application has the following advantages and beneficial technical effects:

[0031] The present invention provides a sleep cycle alternation pattern detection method based on time-frequency domain correlation features, which constructs a CAP detection framework. The deep signal waveform features can be extracted through the morphological feature learning module, the signal frequency domain features can be extracted through the spatial feature learning module, and the above two features can be fused through the feature fusion and evolution correlation module. After the CAP detection framework is trained with the training data, the CAP phase annotation of the signal data to be identified can be achieved using the trained CAP detection framework. Compared with the existing deep learning detection model of the sleep cycle alternation pattern, the present invention strengthens the characterization of frequency domain features, and through the fusion of time-frequency domain features and the characterization of the macro-evolution of features, the model has outstanding performance in distinguishing the A and B phases in the CAP sequence, especially the subtypes of the A phase with weak time domain feature differences and different frequency distribution characteristics, thereby improving the accuracy of detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0033] Figure 1 It is a schematic diagram of the structure of the CAP detection framework constructed in the implementation of the present invention. DETAILED DESCRIPTION

[0034] CAP is a type of periodic EEG fluctuation that occurs during non-rapid eye movement (NREM) sleep. It typically consists of a series of short EEG bursts (phase A) that stand out from the background, alternating with background EEG (phase B). Accurate identification of phase A in CAP and its precise subdivision into phase A subtypes (A1, A2, and A3) are crucial for the clinical analysis of sleep disorders. Numerous studies have explored CAP signal detection through feature engineering or deep learning methods. Most of these methods manually or automatically extract time-domain or frequency-domain features from EEG signals, enabling the detection of phase A and its subtypes that stand out from the background in CAP sequences. However, compared with other EEG microstructures, the CAP sequence has no clear morphological definition. Its phase A specifically includes various EEG activities such as K complex waves, delta bursts, and multiphasic wave bursts. The subdivision of the three subtypes of phase A is an empirical classification based on the proportion of high and low frequencies in phase A. Therefore, algorithms that rely on partial signal statistical features or deep features of some dimensions may be limited by the representation ability of the algorithm and face performance bottlenecks when distinguishing phase A from phase B in the CAP sequence, especially when subdividing the three subtypes of phase A.

[0035] Based on this, the present invention proposes to extract the time-frequency domain features of EEG signals separately, and capture their conversion patterns in the macroscopic state at the same time, so as to realize the labeling of the input longer EEG segments as phase A and phase B second by second, and has the ability to further subdivide the subtypes of phase A.

[0036] The main inventive concepts of the present invention are as follows:

[0037] Using single-channel EEG signals as the data basis for CAP detection, a detection framework was designed that integrates EEG signal time-domain morphological features with frequency-domain features. First, a bidirectional GRU was used to embed shallow temporal dependencies, and a multi-layer one-dimensional convolutional network was used independently for each segment to extract time-domain morphological features. The power spectral density of each segment was then calculated as its frequency-domain feature. Finally, the two were concatenated and a bidirectional GRU was applied again to capture the macroscopic state transitions between them. A multi-layer perceptron was used to classify the deep features corresponding to each second segment extracted by the aforementioned network, ultimately achieving classification of the three subtypes of phase A and phase B of the cyclic alternating pattern in sleep EEG.

[0038] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0039] Example 1

[0040] The present invention provides a sleep cycle alternation pattern detection method based on time-frequency domain correlation features, comprising:

[0041] S1: Collect the EEG signals of the subjects during the non-rapid eye movement sleep period and use them as the original EEG signals;

[0042] S2: Preprocess the collected raw EEG signals and annotate the CAP phase category for each second in the segment. CAP phase categories include phase A and phase B. Phase A includes three subtypes, and phase B is the background.

[0043] S3: Construct a CAP detection framework, which includes a morphological feature learning module for extracting deep signal waveform features, a frequency domain feature calculation module for extracting signal frequency domain features, and a time-frequency feature fusion and evolution correlation module for fusing deep signal waveform features with signal frequency domain features.

[0044] S4: Obtain training data from the preprocessed and annotated data, and use the training data to train the CAP detection framework;

[0045] S5: Use the trained CAP detection framework to detect the EEG signal to be recognized.

[0046] Specifically, the sleep cycle alternation pattern consists of phase A, which contains a variety of abnormal EEG microstructures, and phase B, which is similar to the background signal. At the same time, phase A can be further divided into three subtypes according to its frequency distribution. This makes the identification of phase A and its subtypes in the CAP sequence face the problem of diverse features and blurred feature differences. Therefore, in addition to distinguishing phase A from phase B based on time domain morphological features, it is also necessary to introduce frequency domain features to achieve the subdivision of each subtype of phase A. Based on this, the present invention designs a detection framework based on time-frequency domain correlation features to achieve the phase of the CAP sequence to which the input EEG signal belongs, which is labeled second by second.

[0047] See Figure 1 , which is a schematic diagram of the structure of the CAP detection framework constructed in the implementation of the present invention. The framework mainly includes the following three stages or modules:

[0048] (1) Time domain morphological feature extraction: extract the sub-bands of the complete EEG signal and use a bidirectional gated recurrent unit to embed its shallow signal fluctuation relationship, and then use a one-dimensional convolutional neural network to extract its morphological features in segments; (2) Frequency domain feature calculation: calculate the power spectrum density of the EEG segment in segments, and use indicators such as kurtosis and skewness to measure the distribution characteristics of the power spectrum density; (3) Feature fusion and macro-evolution association: after fusing the time and frequency domain features, apply the bidirectional gated recurrent unit again to capture the macro-dependence and conversion relationship between the CAP phases; finally, based on the extracted features, determine the CAP phase corresponding to each second in the input signal.

[0049] In one embodiment, step S1 includes:

[0050] A 10-20 scalp electroencephalogram (EEG) was used to collect EEG signals during the non-rapid eye movement (NREM) sleep phase of the subjects.

[0051] In one embodiment, step S2 includes:

[0052] S2.1: Downsample the collected EEG signals to 100 Hz based on the polyphase filtering algorithm, and then apply a 0.3-30 Hz bandpass filter to the downsampled EEG signals;

[0053] S2.2: Normalize each channel of the EEG signal obtained in step S2.1 using RobustScaler;

[0054] S2.3: Segment and label the EEG signal obtained in step S2.2. Each segment is 30 seconds long, and the subtypes of phase A or phase B in the CAP sequence corresponding to each second in the segment are labeled second by second.

[0055] Specifically, compared with other normalization methods, the RobustScaler algorithm scales the signal according to the range between the first quartile and the third quartile of the original signal, and is more robust to interference from outliers.

[0056] During the specific implementation process, the collected EEG signals are first divided into sleep stages, retaining only the non-rapid eye movement sleep stage; then this part is downsampled and bandpass filtered, and the signal of each lead channel is normalized using the RobustScaler algorithm.

[0057] The signal was then cut into 30-second segments to obtain samples of 3000 (30-second * 100-Hz) length, and one-hot coding was used to mark the CAP phase (A1, A2, A3, or B) corresponding to each second in the segment. Since the length of the background part in the EEG signal is much longer than the length of the A phase of the CAP sequence, in order to appropriately reduce the quantitative difference between the two, only half of the pure background segments in the interval from the first A phase to the last A phase in each lead channel signal were randomly retained.

[0058] In one embodiment, in the CAP detection framework constructed in step S3, the morphological feature learning module is composed of sub-band extraction, bidirectional gated recurrent unit GRU, and convolutional neural network CNN in sequence, wherein the sub-band extraction is used to band-pass filter the original input single-channel sequence according to the frequency bands of 0.3-4.5Hz, 4.5-12Hz, and 12-30Hz, and the original input single-channel sequence signal is decomposed into a three-channel time series with low, medium, and high frequency band information; then the bidirectional gated recurrent unit is used to process the above-mentioned three-channel time series to associate the shallow fluctuation characteristics of the signal; finally, the hidden layer output of the aforementioned bidirectional gated recurrent unit is segmented second by second, and the same one-dimensional convolutional neural network is applied to each second segment for morphological feature learning to obtain a morphological feature vector as the extracted deep signal waveform feature.

[0059] Specifically, after bandpass filtering the raw EEG signal, a multi-channel signal with a dimension of [3,3000] is obtained. The resulting three-channel signal is then processed using a bidirectional GRU. Due to the long duration and high sampling rate of the input signal segments, a unidirectional GRU can only extract temporally dependent features along the temporal direction. This results in limited global evolutionary information received by the early part of the input sequence, and may cause some early features to be obscured during transmission. The bidirectional GRU, on the other hand, considers temporal information in both the forward and backward directions, ensuring that every node in the signal receives sufficient global temporal dependency information, thereby improving the model's representational capabilities. Finally, the hidden layer output of the bidirectional GRU network is segmented second by second, and the same one-dimensional convolutional neural network is applied to each second-by-second segment for feature extraction. The goal is to extract deep features from each sub-segment of the long EEG signal sequence, which is embedded with early shallow temporal dependencies, and ultimately output the features of each second-by-second segment as a one-dimensional feature vector. The detailed network structure parameters of the morphological feature learning module are shown in Table 1.

[0060] Table 1 Network parameters for time domain feature extraction

[0061]

[0062] In one embodiment, in the CAP detection framework constructed in step S3, the frequency domain feature calculation module uses power spectral density (PSD) to explicitly calculate the frequency domain features of the EEG signal, specifically including: calculating the power spectral density of each second segment of the initial input EEG signal, intercepting the 1-30Hz interval of the power spectral density and using the spectral kurtosis, spectral skewness, variance and mean to measure the distribution characteristics of the power spectral density; at the same time, the frequency domain feature calculation module retains the original power spectral density information, and performs sliding averaging with a window width and step size of 3Hz; finally, the power spectral density of each second signal segment and the kurtosis, skewness, variance and mean of the power spectral density together constitute a one-dimensional feature vector, which is used as the extracted signal frequency domain feature.

[0063] Specifically, the A phase and the B phase in the CAP sequence have large differences in both time domain waveform and frequency domain energy, but the differences in the time domain waveform of the three subtypes in phase A are significantly weakened. In medicine, the classification of each subtype mainly depends on the difference in frequency domain characteristics. Therefore, in order to enhance the characterization capability of frequency domain features, the frequency domain feature calculation module in this embodiment uses power spectral density (PSD) to explicitly calculate the frequency domain features of the EEG signal: the power spectral density of the signal is estimated using the periodogram method. The calculation formula of the periodogram method is as shown in formula (1), where, Represents the estimated value of the power spectral density, X(k) represents the result of calculating the discrete Fourier transform of the signal sequence of length N, and k represents the discrete frequency.

[0064]

[0065] After calculating the power spectral density of each second of the initial input EEG signal, this module intercepts the 1-30Hz range of the power spectral density. Since the three subtypes in phase A are divided according to the different proportions of high-voltage, low-frequency slow waves (representing EEG synchronization) and low-amplitude fast rhythms (representing EEG desynchronization) in phase A, this framework further explicitly uses kurtosis, skewness, variance and mean to measure the distribution characteristics of the power spectral density. Among them, spectral kurtosis is an indicator that describes the degree of peak state of the signal spectrum distribution, reflecting the steepness of the single-peak power spectral density. The calculation of kurtosis β is as shown in formula (2); spectral skewness is an indicator that describes the degree of unevenness of the signal spectrum distribution. The calculation of skewness γ is as shown in formula (3), where f i represents the i-th frequency point, Represents the average value of all frequency points, P(f i ) represents the power spectrum density value at the i-th frequency point, and N represents the total number of frequency points.

[0066]

[0067]

[0068] This framework also retains the original power spectral density information and performs a sliding average with a 3Hz window width and step size, thereby reducing the feature dimensionality of the power spectral density and improving the model's robustness to subtle changes in frequency domain features. Ultimately, the power spectral density of each second of the signal segment and its kurtosis, skewness, variance, and mean together form a one-dimensional feature vector of length 14.

[0069] In one embodiment, in the CAP detection framework constructed in step S3, the feature fusion and evolution association module splices the one-dimensional time domain feature vector and the frequency domain feature vector corresponding to each second segment along the feature dimension to form a fused feature vector of the two, and the fused feature vector constitutes a high-dimensional time series in the time dimension; for a time series composed of a feature vector, the feature fusion and evolution association module again applies the bidirectional GRU to capture the evolution of its macroscopic features, and finally classifies the implicit state of each output node. The classifier for classification uses a multi-layer perceptron network, and the output classification result is the category of the CAP sequence corresponding to each second time segment in the original input signal, including three subtypes A1, A2, and A3 and phase B.

[0070] Specifically, compared with the bidirectional GRU used by the morphological feature learning module, the current macro evolution representation module extracts the sampling frequency of the object is lower and the feature embedding degree is deeper, which is intended to capture the evolution of its macro semantic features and strive to directly correspond to the classification result of each segment. The detailed network structure parameters of the feature fusion and evolution association module are shown in Table 2.

[0071] Table 2 Network parameters of time-frequency feature fusion and evolution association part

[0072]

[0073] In an embodiment, in the training process of step S4, the electroencephalogram of the subject is input into the model in the form of a single channel every 30s as a segment, and the label is softened. Specifically, for the sample labels of the regions before and after phase conversion, the confidence belonging to the labeled category in the One-hot encoding is adjusted to 0.7, and the confidence belonging to the category corresponding to the adjacent segment is adjusted to 0.3. Classification uses weighted cross-entropy to calculate the classification loss and performs back propagation.

[0074] Specifically, the label is "softened" to avoid interference from the ambiguous features of the CAP sequence phase conversion interval during training.

[0075] The classification uses weighted cross-entropy to calculate the classification loss and performs back propagation, and the weight ratio is w A1 : w A2 : w A3 : w B = 5:5:5:1, aiming to increase the loss weight of the A phase sample with less sample number. The calculation formula of the classification loss L is as formula (4), wherein N' represents the sample number, C represents the category number, w j represents the weight of the jth category, y ij represents the label probability of whether the ith sample belongs to the jth category, p ij represents the prediction probability of the ith sample belonging to the jth category.

[0076]

[0077] In the detection process, the sample to be classified is input into the model to obtain the confidence of each second segment belonging to each phase in the CAP sequence, and the category corresponding to the maximum confidence is taken as the detection result.

[0078] The method provided by the application is described below through specific embodiments.

[0079] Step 1: Data acquisition, which refers to using a scalp electroencephalograph to collect the electroencephalogram of the subject in a sleep state, and performing sleep staging to retain the signal of the non-rapid eye movement period of sleep.

[0080] Step 2: Data preprocessing involves preprocessing the collected data set and annotating the CAP sequence phases. The collected EEG data is resampled to 100 Hz, bandpass filtered within the 0.3-30 Hz range, and the signal for each channel is normalized using the RobustScaler algorithm. The signal is then clipped into 30-second segments, and the CAP phase corresponding to each second in the segment is annotated using one-hot encoding.

[0081] Step 3: Construct CAP sequence detection framework;

[0082] (3.1) To extract the morphological features contained in the signal, this example designs a morphological feature extraction module consisting of a bidirectional GRU and a convolutional neural network. First, the 0.3-4.5Hz, 4.5-12Hz, and 12-30Hz subbands are extracted from the 30s input segment. Then, a bidirectional GRU is used to embed the three-channel signal composed of these frequency bands into shallow signal fluctuation features. Because the framework's final classification is in seconds, a convolutional neural network is then used to extract deep morphological features on a second-by-second basis.

[0083] (3.2) In order to extract the frequency domain features contained in the signal, this embodiment designs a frequency domain feature calculation module based on the statistical characteristics of the signal. The power spectrum density is calculated for each second of the original signal, and the distribution characteristics of the power spectrum density are measured using the mean, variance, spectral kurtosis, and spectral skewness, which are used as the frequency domain features of each second segment.

[0084] (3.3) To achieve the fusion of morphological and frequency domain features and capture the macroevolution of features, this embodiment designs a feature fusion and evolution association module based on a bidirectional GRU and a multi-layer perceptron. By concatenating the one-dimensional time domain feature vector and frequency domain feature vector corresponding to each second segment along the feature dimension, a fused feature vector is constructed. The bidirectional GRU is then applied again to capture the evolution of its macrofeatures. Finally, a multi-layer perceptron network is used to classify the three subtypes A1, A2, and A3 and phase B (four categories) of the CAP sequence corresponding to each second time segment in the original input signal.

[0085] Step 4: Use the training data to train the CAP sequence detection framework;

[0086] The CAP detection framework was trained using the training data. To avoid model bias caused by imbalanced training samples, weighted cross entropy was used as the loss function and the classification weights of each subtype of phase A were appropriately increased.

[0087] Step 5: Use the trained CAP sequence detection framework to detect the data to be identified.

[0088] To validate the effectiveness of this example, we used data from the same dataset that had not been used for training, performing the same preprocessing and cropping, and obtaining a series of unrecognized data. This unrecognized data was then fed into the detection framework to obtain the final recognition results. Furthermore, this example suggests that cropping the original signal by 30 seconds with a 50% overlap, retaining only the central 15 seconds of each segment for each prediction, can help mitigate the impact of feature loss caused by edge truncation on model performance.

[0089] Compared with the prior art, the present invention has the following beneficial effects:

[0090] (1) This paper proposes a new CAP sequence detection scheme that achieves better overall results in this recognition task than similar methods, and is expected to reduce the workload of experts in this tedious task;

[0091] (2) The present invention enhances the signal characterization capability by capturing the time-domain and frequency-domain features of the CAP sequence, especially making the model more effective in distinguishing the various subtypes of phase A in the CAP sequence.

[0092] Example 2

[0093] Based on the same inventive concept, the present invention discloses a sleep cycle alternation pattern detection device based on time-frequency domain correlation features, comprising:

[0094] A data acquisition module is used to collect the EEG signals of the subjects during the non-rapid eye movement sleep period and use them as raw EEG signals;

[0095] The preprocessing module is used to preprocess the collected raw EEG signals and mark the CAP phase category of each second in the segment. The CAP phase category includes phase A and phase B. Phase A includes three subtypes, and phase B is the background.

[0096] A detection framework construction module is used to construct a CAP detection framework. The CAP detection framework includes a morphological feature learning module for extracting deep signal waveform features, a frequency domain feature calculation module for extracting signal frequency domain features, and a time-frequency feature fusion and evolution correlation module for fusing deep signal waveform features with signal frequency domain features.

[0097] The training module is used to obtain training data from the preprocessed and labeled data and use the training data to train the CAP detection framework;

[0098] The detection module is used to detect the EEG signal to be identified using the trained CAP detection framework.

[0099] Since the device introduced in the embodiment two of the present application is the device used in the implementation of the sleep cycle alternating pattern detection method based on time-frequency domain correlation characteristics in the embodiment one of the present application, the specific structure and deformation of the device can be understood by those skilled in the art based on the method introduced in the embodiment one of the present application, and thus will not be described here again. Any device used in the method in the embodiment one of the present application belongs to the scope of the present application.

[0100] Embodiment three

[0101] Based on the same inventive concept, the present application further provides a computer readable storage medium, which stores a computer program, and the program is executed to realize the method as described in the embodiment one.

[0102] Since the computer readable storage medium introduced in the embodiment three of the present application is the computer readable storage medium used in the implementation of the sleep cycle alternating pattern detection method based on time-frequency domain correlation characteristics in the embodiment one of the present application, the specific structure and deformation of the computer readable storage medium can be understood by those skilled in the art based on the method introduced in the embodiment one of the present application, and thus will not be described here again. Any computer readable storage medium used in the method in the embodiment one of the present application belongs to the scope of the present application.

[0103] Embodiment four

[0104] Based on the same inventive concept, the present application further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor realizes the method in the embodiment one when executing the program.

[0105] Since the computer device introduced in the embodiment four of the present application is the computer device used in the implementation of the sleep cycle alternating pattern detection method based on time-frequency domain correlation characteristics in the embodiment one of the present application, the specific structure and deformation of the computer device can be understood by those skilled in the art based on the method introduced in the embodiment one of the present application, and thus will not be described here again. Any computer device used in the method in the embodiment one of the present application belongs to the scope of the present application.

[0106] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt a computer program product in the form of being implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.

[0107] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other processing device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other processing device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions of the flowchart block(s) or step(s) of the flowchart block(s). Figure 1 one or more functions specified by any one or more of the flowchart block(s) or step(s) of the flowchart block(s). Figure 1 one or more functions specified by any one or more of the flowchart block(s) or step(s) of the flowchart block(s).

[0108] While the preferred embodiments of the application have been described, additional variations and modifications can be made to the preferred embodiments by those of skill in the art once they have the benefit of the present disclosure. Therefore, the appended claims are intended to encompass within their scope all possible variations and modifications of the preferred embodiments. It is apparent that those skilled in the art can modify and adapt the preferred embodiments of the present application in various ways without departing from the spirit and scope of the present application. Therefore, it is intended that the present application encompass all such modifications and variations as fall within the scope of the present claims and their equivalents.

Claims

1. A sleep cycle alternation pattern detection method based on time-frequency domain correlation features, characterized in that: include: S1: Collect the EEG signals of the subjects during the non-rapid eye movement sleep period and use them as the original EEG signals; S2: Preprocess the collected raw EEG signals and annotate the CAP phase category for each second in the segment. CAP phase categories include phase A and phase B. Phase A includes three subtypes, and phase B is the background. S3: Construct a CAP detection framework. The CAP detection framework includes a morphological feature learning module for extracting deep signal waveform features, a frequency domain feature calculation module for extracting signal frequency domain features, and a time-frequency feature fusion and evolution association module for fusing deep signal waveform features with signal frequency domain features. In the constructed CAP detection framework, the morphological feature learning module is composed of sub-band extraction, bidirectional gated recurrent unit GRU, and convolutional neural network CNN in sequence. Sub-band extraction is used to convert the original input single channel sequence into 0.3-4.5Hz, 4.5-12Hz, and 12-3 The 0Hz frequency band is band-pass filtered, and the original input single-channel sequence signal is decomposed into a three-channel time series with low, medium and high frequency band information; then the three-channel time series is processed using a bidirectional gated recurrent unit to associate the shallow fluctuation characteristics of the signal; finally, the hidden layer output of the aforementioned bidirectional gated recurrent unit is segmented second by second, and the same one-dimensional convolutional neural network is applied to each second segment for morphological feature learning to obtain the morphological feature vector as the extracted deep signal waveform feature; the frequency domain feature calculation module uses power spectral density to explicitly calculate the frequency domain features of the EEG signal, which has The system includes: calculating the power spectrum density of each second segment of the initial input EEG signal, intercepting the 1-30Hz interval of the power spectrum density and using the spectrum kurtosis, spectrum skewness, variance and mean to measure the distribution characteristics of the power spectrum density; retaining the original power spectrum density information, and performing sliding average with a window width and step size of 3Hz; finally, the power spectrum density of each second signal segment and the power spectrum density kurtosis, skewness, variance and mean together constitute a one-dimensional feature vector as the extracted signal frequency domain feature; the feature fusion and evolution association module converts the one-dimensional feature vector corresponding to each second segment into a one-dimensional feature vector. The dimensional time domain feature vector and the frequency domain feature vector are spliced ​​along the feature dimension to form a fusion feature vector of the two. The fusion feature vector forms a high-dimensional time series in the time dimension. For a time series composed of a feature vector, the feature fusion and evolution association module again applies a bidirectional GRU to capture the evolution of its macroscopic features. Finally, the implicit state of each output node is finally classified. The classification classifier uses a multi-layer perceptron network. The output classification result is the category of the CAP sequence corresponding to each second time segment in the original input signal, including three subtypes A1, A2, and A3 and phase B. S4: Obtain training data from the preprocessed and labeled data, and use the training data to train the CAP detection framework. During the training process of the CAP detection framework, the subject's EEG signal is input into the model in a single-channel segment every 30 seconds, and the labels are softened. Specifically, for the sample labels in the area before and after the phase transition, the confidence level of the one-hot encoding belonging to the labeled category is adjusted to 0.7, and the confidence level of the one-hot encoding belonging to the category corresponding to the adjacent segment is adjusted to 0.

3. Classification uses weighted cross entropy to calculate the classification loss and perform backpropagation. S5: Use the trained CAP detection framework to detect the EEG signal to be recognized.

2. The sleep cycle alternation pattern detection method based on time-frequency domain correlation features according to claim 1, characterized in that: Step S1 includes: A 10-20 scalp electroencephalogram (EEG) was used to collect EEG signals during the non-rapid eye movement (NREM) sleep phase of the subjects.

3. The sleep cycle alternation pattern detection method based on time-frequency domain correlation features according to claim 1, characterized in that: Step S2 includes: S2.1: Downsample the collected EEG signals to 100 Hz based on the polyphase filtering algorithm, and then apply a 0.3-30 Hz bandpass filter to the downsampled EEG signals; S2.2: Normalize each channel of the EEG signal obtained in step S2.1 using RobustScaler; S2.3: Segment and label the EEG signal obtained in step S2.

2. Each segment is 30 seconds long, and the subtypes of phase A or phase B in the CAP sequence corresponding to each second in the segment are labeled second by second.

4. A sleep cycle alternation pattern detection device based on time-frequency domain correlation features, characterized in that: include: A data acquisition module is used to collect the EEG signals of the subjects during the non-rapid eye movement sleep period and use them as raw EEG signals; The preprocessing module is used to preprocess the collected raw EEG signals and mark the CAP phase category of each second in the segment. The CAP phase category includes phase A and phase B. Phase A includes three subtypes, and phase B is the background. The detection framework construction module is used to construct the CAP detection framework. The CAP detection framework includes a morphological feature learning module for extracting deep signal waveform features, a frequency domain feature calculation module for extracting signal frequency domain features, and a time-frequency feature fusion and evolution association module for fusing deep signal waveform features with signal frequency domain features. In the constructed CAP detection framework, the morphological feature learning module is composed of sub-band extraction, bidirectional gated recurrent unit GRU, and convolutional neural network CNN in sequence. Sub-band extraction is used to convert the original input single channel sequence into 0.3-4.5Hz, 4.5-12H The original input single-channel sequence signal is decomposed into a three-channel time series with low, medium and high frequency band information. The three-channel time series is then processed using a bidirectional gated recurrent unit to correlate the shallow fluctuation characteristics of the signal. Finally, the hidden layer output of the aforementioned bidirectional gated recurrent unit is segmented second by second, and the same one-dimensional convolutional neural network is applied to each second segment for morphological feature learning to obtain the morphological feature vector as the extracted deep signal waveform feature. The frequency domain feature calculation module uses the power spectral density to explicitly calculate the frequency domain of the EEG signal. The features specifically include: calculating the power spectral density of each second segment of the initial input EEG signal, intercepting the 1-30Hz interval of the power spectral density and using the spectrum kurtosis, spectrum skewness, variance and mean to measure the distribution characteristics of the power spectral density; retaining the original power spectral density information, and performing sliding average with a window width and step size of 3Hz; finally, the power spectral density and power spectral density kurtosis, skewness, variance and mean of each second signal segment together constitute a one-dimensional feature vector as the extracted signal frequency domain feature; the feature fusion and evolution association module converts the corresponding frequency domain of each second segment into a one-dimensional feature vector. The one-dimensional time domain feature vector and frequency domain feature vector are spliced ​​along the feature dimension to form a fusion feature vector of the two. The fusion feature vector forms a high-dimensional time series in the time dimension. For a time series composed of a feature vector, the feature fusion and evolution association module again applies a bidirectional GRU to capture the evolution of its macroscopic features. Finally, the implicit state of each output node is finally classified. The classification classifier uses a multi-layer perceptron network. The output classification result is the category of the CAP sequence corresponding to each second time segment in the original input signal, including three subtypes A1, A2, and A3 and phase B. The training module is used to obtain training data from the preprocessed and labeled data and use the training data to train the CAP detection framework. During the CAP detection framework training process, the subject's EEG signal is input into the model in a single-channel segment every 30 seconds, and the labels are softened. Specifically, for the sample labels in the area before and after the phase transition, the confidence level of the one-hot encoding belonging to the labeled category is adjusted to 0.7, and the confidence level of the one-hot encoding belonging to the category corresponding to the adjacent segment is adjusted to 0.

3. Classification uses weighted cross entropy to calculate the classification loss and perform backpropagation. The detection module is used to detect the EEG signal to be identified using the trained CAP detection framework.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed, the method according to any one of claims 1 to 3 is implemented.

6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Algorithm for automatically staging sleep

    CN111631688A

  • Sleep staging method based on deep residual Mask-CCNN

    CN112294342A