A Multi-Resolution Sleep Stage Classification Method Based on Dynamic Adaptive Kernel Graph Neural Network
The multi-resolution sleep stage classification method using dynamic adaptive kernel graph neural network solves the problems of insufficient signal information utilization and predefined feature vector limitations in existing technologies by utilizing multi-resolution signal components and supervised contrastive learning, thus achieving more efficient and accurate sleep stage classification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-17
- Publication Date
- 2026-04-03
AI Technical Summary
Existing sleep stage classification methods cannot effectively utilize high and low frequency signal information in polysomnography, and graph neural network-based methods are limited by predefined feature vectors, resulting in poor generalization and affecting classification accuracy.
A dynamic adaptive kernel graph neural network is adopted to obtain multi-resolution signal components through four-layer discrete wavelet decomposition, and feature extraction is combined with box plots. Adaptive kernel graph convolution and bidirectional gated recurrent units are used to model the transition rules between sleep stages. The signal information is integrated through supervised contrastive learning to achieve dynamic graph embedding representation and classification.
It improves the accuracy and efficiency of sleep stage classification, reduces the reliance on feature engineering, makes full use of the temporal characteristics and channel relationships of the signal, and enhances the model's generalization ability and classification accuracy.
Smart Images

Figure CN116439672B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, specifically a multi-resolution sleep stage classification method based on a dynamic adaptive kernel graph neural network. Background Technology
[0002] Sleep is one of the most important physiological activities for humans, and good sleep is crucial for maintaining stable brain function and overall physical and mental health. Studies have shown that sleep disorders are a contributing factor to various diseases, including cardiovascular disease, obesity, depression, and anxiety, making them a prominent threat to human health. Sleep staging is a vital tool for diagnosing sleep disorders and forms the basis of such diagnoses. The accuracy and convenience of sleep stage classification methods are key factors affecting diagnostic quality.
[0003] Sleep stage classification refers to the division of sleep stages into five categories based on polysomnography (PSG) records and sleep stage classification criteria: rapid eye movement (REM), non-rapid eye movement (N1), N2, N3, and wakefulness (W). Manual sleep stage classification is not only tedious, time-consuming, and costly, but the results are also susceptible to the subjectivity of sleep specialists. Automated sleep stage classification, on the other hand, can significantly improve the efficiency of traditional sleep stage classification and avoid the subjective influence of manual classification, thus possessing significant clinical value.
[0004] Polysomnography records sleep signals containing rich sleep information. High-frequency signals contain more detailed information, while low-frequency signals contain more trend information. Fully utilizing this information can effectively improve the accuracy of sleep stage classification. However, existing research has rarely focused on this point. The few methods that use wavelet transform to decompose the signal into high- and low-frequency signals at various levels simply extract features from the decomposed high- and low-frequency signals and then simply integrate them, without conducting deeper analysis and processing of the high- and low-frequency signals.
[0005] Polysomnography (PSG) includes electroencephalograms (EEG), electromyograms (EMG), electrooculograms (EOG), and electrocardiograms (ECG) at different locations, and these different sampling channels are interconnected. Existing methods can be broadly categorized into three types: methods based on traditional machine learning, methods based on deep learning, and methods based on graph neural networks. Traditional machine learning methods, such as Random Forest (RF) and Support Vector Machine (SVM), have a major limitation: their classification accuracy is heavily influenced by feature engineering. This requires engineers to possess extensive related knowledge, hindering the application of automated sleep stage classification methods. Deep learning methods can, to some extent, overcome the limitation of traditional machine learning methods requiring prior knowledge. However, like traditional machine learning methods, these deep learning methods also cannot model the connections between different channels, resulting in the loss of some useful information. Because graph data structures can simultaneously represent node information and edge information between nodes, graph data is undoubtedly the most suitable data structure for sleep stage classification. Most existing graph neural network-based methods are implemented using Chebyshev graph convolution. In Chebyshev graph convolution, the maximum value of the eigenvector needs to be predefined. This predefined method limits the generalization of Chebyshev graph convolution, making it difficult to find the optimal graph kernel. Summary of the Invention
[0006] The purpose of this invention is to provide a multi-resolution sleep stage classification method based on a dynamic adaptive kernel graph neural network to solve the problems mentioned in the background art.
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] A multi-resolution sleep stage classification method based on a dynamic adaptive kernel graph neural network includes the following steps:
[0009] 1) Discrete wavelet decomposition: The original physiological signal is decomposed into five components, namely, the first four layers of high-frequency components and the fourth layer of low-frequency components, through four-layer discrete wavelet decomposition. Each component signal is then processed separately.
[0010] 2) Feature extraction: Features are extracted based on box plots to obtain the feature matrix;
[0011] 3) Construction of the sleep stage graph: Based on the correlation of features between different nodes, the adjacency matrix is calculated using the Gaussian kernel function. The feature matrix and the adjacency matrix together constitute the sleep stage graph.
[0012] 4) Dynamic adaptive kernel graph neural network: It uses adaptive kernel graph convolution to aggregate information between nodes and uses two layers of bidirectional gated recurrent units to model short-term and long-term sleep time series respectively, so as to learn the transition rules between sleep stages and obtain the embedded representation of sleep stages.
[0013] 5) Classification: After obtaining the embedding representations of each component, the embedding representations of each component are concatenated and classified using a fully connected layer. The cross-entropy loss of the classification is obtained by the difference between the predicted label and the true label.
[0014] 6) Supervised contrastive learning: Supervised contrastive learning is used to learn the similarities and differences between two components, and the supervised contrastive learning loss between these two components is obtained. Then, all the supervised contrastive losses are summed to obtain the final contrastive learning loss. Finally, the cross-entropy loss and contrastive learning loss are used to jointly optimize the model.
[0015] Based on the above technical solutions, the present invention also provides the following optional technical solutions:
[0016] In one alternative approach: the four-level discrete wavelet decomposition in step 1) is implemented using the Malat algorithm. The Malat algorithm filters and downsamples the discrete signal using a high-pass filter and a low-pass filter, respectively, to obtain the high-frequency signal and the low-frequency signal; then, the low-frequency signal is subjected to high-pass and low-pass filtering and downsampling. The high-pass / low-pass operation at level α is defined as follows:
[0017]
[0018] Where Q represents the discrete signal length, K represents the filter length, low is the low-pass filter, and high is the high-pass filter, the original signal S is decomposed into S0 through discrete wavelet decomposition. CD1 S CD2 S CD3 S CD4 and S CA4 .
[0019] In one alternative approach: In step 2), the box plot selects the maximum, minimum, upper boundary, lower boundary, upper quartile, lower quartile, median, mean, and standard deviation of the signal from different sleep stages as features for a single-channel signal S over a time segment. n n∈(0,N), where N is the number of nodes, i.e., the number of sampling channels. The feature vector X of this node is composed of the above nine feature values. n The feature matrix X of this time segment is composed of the feature vectors of each node.
[0020] In one alternative approach: In step 3), the connections between nodes are determined by the correlation of node features. The basic adjacency matrix A1 is calculated based on the Gaussian kernel function. The basic adjacency matrix A1 is multiplied by the weight W1 so that the adjacency matrix can be adaptively adjusted by data-driven means. The most suitable adjacency matrix A is found for each graph structure. The feature matrix X and the adjacency matrix A together constitute the sleep stage graph. A sleep stage graph is constructed for each time segment, and the sleep signal sequence is converted into a graph sequence.
[0021] In one alternative: In step 4), a static graph encoder is used to generate a graph-level embedding representation for each sleep stage graph, and these embedding representations are passed into a sequential decoder in chronological order.
[0022] In one alternative approach: In step 5), the embedded representations of each signal component are concatenated to integrate the multi-resolution signal, and then a fully connected layer is used to classify the concatenated signal; the fully connected layer projects the concatenated signal into a five-dimensional space, corresponding to the probability of the current sleep segment belonging to each sleep stage; the cross-entropy loss between the predicted label and the true label is calculated, and the cross-entropy loss is calculated as follows:
[0023]
[0024] Where C is the number of categories, and y is the true label. is the predicted label, and L represents the number of samples.
[0025] In one alternative approach: In step 6), the supervised contrastive learning process between the two components is as follows: A certain time segment in the time series of a signal component is set as the anchor. Then, other signal components in this time segment, as well as other time segments in the same sleep stage as this signal component, are considered positive samples. This contrastive learning process maximizes the similarity of positive samples and minimizes the similarity of negative samples by minimizing the supervised contrastive learning loss. The supervised contrastive learning loss function is calculated as follows:
[0026]
[0027] L Contrastive_Learning =L Component (H CD1 H CD2 )+L Component (H CD1 H CD3 )+…+L Component (H CD4 H CA4 )
[0028] Where j∈J≡{1…2L} is the set of all samples of the time series of the two signal components, P is the set of positive samples, and 0(j)≡J\{j}.
[0029] In one alternative approach: the model is jointly optimized using cross-entropy loss and supervised contrastive learning loss, with the loss function calculated as follows: L = L Cross_Entropy +λL Contrastive_Learning .
[0030] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0031] 1. This invention can perform discrete wavelet decomposition on sleep signals to obtain multi-resolution sleep signal components, and integrate the multi-resolution signals after obtaining the embedded representation of each signal component.
[0032] 2. This invention uses a dynamic adaptive kernel graph neural network to generate an embedded representation for each signal component. The adaptive kernel graph neural network overcomes the limitations of predefined kernels and adaptively finds the optimal kernel; the two-layer recurrent neural network models short-term and long-term sequences respectively, fully utilizing the temporal characteristics of sleep signals.
[0033] 3. This invention uses supervised contrastive learning to learn the similarity between different signal components, further integrating multi-resolution information. Attached Figure Description
[0034] Figure 1 This is a flowchart of the overall process of the method of the present invention.
[0035] Figure 2 This is a flowchart of the dynamic adaptive kernel graph neural network of the present invention.
[0036] Figure 3 This is a flowchart illustrating the classification process of the present invention.
[0037] Figure 4 This is a flowchart illustrating the overall process of supervised comparative learning in this invention.
[0038] Figure 5 This is a flowchart of the supervised comparison learning process of the present invention.
[0039] Figure 6 This is the prediction index of the model in this invention.
[0040] Figure 7 This is a comparison chart of the predicted classification results and the actual classification results of this invention. Detailed Implementation
[0041] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. The embodiments listed herein are merely illustrative and not intended to limit the scope of the invention. Any obvious modifications or alterations made to this invention do not depart from the spirit and scope of the invention.
[0042] Physiological signals, as a typical non-stationary signal, often contain more trend information in their low-frequency components and more detailed information in their high-frequency components. Based on this, this invention uses four-level discrete wavelet decomposition to decompose the original physiological signal into five components: 1-4 levels of high-frequency components and 4 levels of low-frequency components. Each component signal is then processed separately.
[0043] Since the signal distributions differ significantly across sleep stages, this invention extracts features from boxplots to obtain a feature matrix. After feature extraction, an adjacency matrix is calculated based on the correlation between features of different nodes using a Gaussian kernel function. The feature matrix and the adjacency matrix together constitute the sleep stage graph. To fully utilize the correlations between channels and adaptively find the optimal kernel for the sleep stage graph, this invention uses adaptive kernel graph convolution to aggregate information between nodes.
[0044] To ensure full utilization of the temporality of time series information, a two-layer bidirectional gated recurrent unit (BiGRU) is used to model short-term and long-term sleep time series respectively, in order to learn the transition rules between sleep stages and obtain the embedded representation of sleep stages.
[0045] After obtaining the embedding representations of each component, the embedding representations of each component are first concatenated and classified using a fully connected layer. The cross-entropy loss for classification is obtained by the difference between the predicted label and the true label. Then, supervised contrastive learning is used to learn the similarities and differences between two components, obtaining the supervised contrastive learning loss between these two components. Finally, all supervised contrastive losses are summed to obtain the final contrastive learning loss. Finally, the cross-entropy loss and contrastive learning loss are jointly used to optimize the model.
[0046] In one embodiment, as shown in the appendix Figure 1 As shown, a multi-resolution sleep stage classification method based on a dynamic adaptive kernel graph neural network is presented. The specific steps of this method are as follows:
[0047] 1. Discrete wavelet decomposition
[0048] Wavelet transform is a widely used signal processing method that can obtain information in both the time and frequency domains. Frequency domain information can be obtained by scaling the wavelet, and time domain information can be obtained by translating the wavelet. Wavelet transform decomposes the original signal into wavelet coefficients, which reflect the correlation between the wavelet and local signals. This invention uses the Malat algorithm to implement a four-level discrete wavelet transform. The algorithm filters and downsamples the discrete signal using high-pass and low-pass filters respectively to obtain high-frequency and low-frequency signals. Then, the low-frequency signal is again subjected to high-pass and low-pass filtering and downsampling. The high-pass / low-pass operation at level α is defined as follows:
[0049]
[0050] Where Q represents the discrete signal length, K represents the filter length, low is the low-pass filter, and high is the high-pass filter. The original signal S is decomposed into S0 using discrete wavelet decomposition. CD1 S CD2 S CD3 S CD4 S CA4 .
[0051] 2. Feature Extraction
[0052] Because signal distributions differ significantly across sleep stages, this invention uses box plots to select the maximum, minimum, upper boundary, lower boundary, upper quartile, lower quartile, median, mean, and standard deviation as features. For a single-channel signal S over a given time segment... n n∈(0,N), where N is the number of nodes, i.e., the number of sampling channels. The feature vector X of this node is composed of the above nine feature values. n The feature matrix X of this time segment is composed of the feature vectors of each node.
[0053] 3. Construction of Sleep Stage Map
[0054] After obtaining the feature matrix, this method determines the connections between nodes based on the correlation of node features. First, as shown in Equation (2), we calculate the basic adjacency matrix A1 based on the Gaussian kernel function. Because the predefined adjacency matrix has poor generalization performance, as shown in Equation (3), we multiply the basic adjacency matrix A1 by the weight W1, so that the adjacency matrix can be adaptively adjusted by data-driven means to find the most suitable adjacency matrix A for each graph structure. The feature matrix X and the adjacency matrix A together constitute the sleep stage graph. We construct a sleep stage graph for each time segment, converting the sleep signal sequence into a graph sequence.
[0055]
[0056] A = Softmax(A1W1) (3)
[0057] 4. Dynamic Adaptive Kernel Graph Neural Network
[0058] Dynamic graphs are graphs that change over time. Sleep signals, as a classic time-series signal, correspond to different sleep stage graphs for different sleep periods. Since we construct a sleep stage graph for each time segment, this graph is discrete rather than continuous. For discrete-time dynamic graphs, a static graph encoder is first used to generate graph-level embedding representations for each graph, and then these embedding representations are fed into a sequential decoder in chronological order. The static graph encoder is based on a graph neural network, which follows a message-passing pattern to aggregate neighborhood information and generate embedding representations for it. In discrete static graphs, time information is not explicitly used, but rather revealed through changes in the graph along the time dimension. By sorting a series of static graph embeddings and processing them as sequential data, time information can be learned by the sequence decoder. This method uses gated recurrent units to implement the sequence decoder function. Therefore, the processing of dynamic graphs is divided into two steps: an adaptive kernel graph neural network and a two-layer recurrent neural network. The overall structure of the dynamic adaptive kernel graph neural network is as follows: Figure 2 As shown.
[0059] (1) Adaptive kernel graph neural network
[0060] Existing widely used graph neural networks such as ChebNet, GCN, and GAT all use fixed graph kernels (e.g., adjacency matrices, Laplacian matrices, or their variants), which limits their generalization to different graphs. Adaptive kernel graph neural networks are a data-driven graph kernel learning mechanism that learns the optimal threshold between high-frequency and low-frequency signals by adaptively adjusting the balance between all-pass and low-pass filters by modifying the maximum eigenvalue of the graph Laplacian matrix, thus alleviating the generalization problem. The adaptive kernel graph convolution is defined as follows:
[0061] F = A * XW2 (4)
[0062]
[0063]
[0064] Where X is the feature matrix, W is the learnable weights, and A * It is an adaptive graph kernel. Formulas (5) and (6) are the calculation methods for the adaptive graph kernel. Here, is a learnable parameter, and D is the degree matrix. After adaptive kernel graph convolution, a static graph-level embedding representation of the current time segment is obtained.
[0065] (2) Two-layer recurrent neural network
[0066] To capture the rich temporal information of sleep sequences, this method uses Bidirectional Gated Recurrent Units (BiGRUs) to model short-term and long-term sequences. GRUs are a variant of LSTM networks that are simpler and more efficient than LSTM networks, capable of recording long-term information and avoiding the vanishing and exploding gradient problems. We use short-term BiGRUs to aggregate short-term temporal information from several time segments before and after the current time segment, and long-term BiGRUs to obtain temporal information from the entire night's sleep data.
[0067] 5. Classification
[0068] After obtaining the embedding representations of each signal component, this method concatenates these representations to integrate the multi-resolution signal. Then, a fully connected layer is used to classify the concatenated signal. This fully connected layer projects the concatenated signal into a five-dimensional space, corresponding to the probability that the current sleep segment belongs to each sleep stage (W stage, N1 stage, N2 stage, N3 stage, REM stage). The cross-entropy loss between the predicted label and the true label is then calculated. The cross-entropy loss is calculated as follows:
[0069]
[0070] Where C is the number of categories, and y is the true label. This refers to the predicted label, where L represents the number of samples. The classification process is as follows: Figure 3 As shown.
[0071] 6. Supervised and comparative learning
[0072] To further learn the similarities and differences between various signal components and signals from the same sleep stage, this method uses supervised contrastive learning to analyze multi-resolution signals. The overall process of supervised contrastive learning for multi-resolution signals is as follows: Figure 4 As shown.
[0073] This method calculates the supervised contrastive learning loss between each pair of signal components separately, and then sums them as the overall supervised contrastive learning loss. The supervised contrastive learning process between two components is shown in Figure (5).
[0074] If a specific time segment in a signal component's time series is designated as the anchor, then other signal components within that time segment, as well as other time segments in the same sleep stage as that time segment, are considered positive samples. The contrastive learning process maximizes the similarity of positive samples and minimizes the similarity of negative samples by minimizing the supervised contrastive learning loss. The supervised contrastive learning loss function is calculated as follows:
[0075]
[0076] L Contrastive_Learning =L Component (H CD1 H CD2 )+L Component (H CD1 H CD3 )+…+L Component (H CD4 H CA4 )
[0077] Where j∈J≡{1…2L} is the set of all samples of the time series of the two signal components, P is the set of positive samples, and 0(j)≡J\{j}.
[0078] 7. Loss Function
[0079] This method uses cross-entropy loss and supervised contrastive learning loss to jointly optimize the model. The loss function is calculated as follows: L = L Cross_Entropy +λL Contrastive_Learning .
[0080] This invention has significant implications for computer-aided sleep diagnosis. It not only replaces time-consuming manual sleep stage classification by doctors, shortening the classification time, but also controls errors to a certain extent, ensuring both real-time performance and accuracy. Furthermore, in tests on the publicly available ISRUC-S3 sleep dataset, the accuracy of this invention outperforms existing sleep stage classification models.
[0081] The above method is used for sleep stage classification in the ISRUC-S3 dataset.
[0082] The ISRUC-S3 dataset is a publicly available sleep dataset that records overnight PSG data from 10 subjects across 11 sampling channels, including EEG, EEG, EMG, and ECG. The overnight sleep data was segmented into 30-second segments for sleep stage classification. In this implementation, a 10-fold cross-validation method was used. Each fold used overnight sleep data from 9 subjects as the training set and overnight sleep data from 1 subject as the validation set. Training was stopped after 200 epochs. The final model's prediction metrics are attached. Figure 6 As shown, the predicted classification results are compared with the actual classification results. Figure 7 As shown.
[0083] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.
Claims
1. A multi-resolution sleep stage classification method based on a dynamic adaptive kernel graph neural network, characterized in that, Includes the following steps: 1) Discrete wavelet decomposition: The original physiological signal is decomposed into five components, namely, the first four layers of high-frequency components and the fourth layer of low-frequency components, through four-layer discrete wavelet decomposition. Each component signal is then processed separately. 2) Feature extraction: Features are extracted based on box plots to obtain the feature matrix; 3) Construction of the sleep stage graph: Based on the correlation of features between different nodes, the adjacency matrix is calculated using the Gaussian kernel function. The feature matrix and the adjacency matrix together constitute the sleep stage graph. 4) Dynamic adaptive kernel graph neural network: It uses adaptive kernel graph convolution to aggregate information between nodes and uses two layers of bidirectional gated recurrent units to model short-term and long-term sleep time series respectively, so as to learn the transition rules between sleep stages and obtain the embedded representation of sleep stages. 5) Classification: After obtaining the embedding representations of each component, the embedding representations of each component are concatenated and classified using a fully connected layer. The cross-entropy loss of the classification is obtained by the difference between the predicted label and the true label. 6) Supervised contrastive learning: Supervised contrastive learning is used to learn the similarities and differences between two components, and the supervised contrastive learning loss between these two components is obtained. Then, all the supervised contrastive losses are summed to obtain the final contrastive learning loss. Finally, the cross-entropy loss and contrastive learning loss are used to jointly optimize the model.
2. The sleep stage classification method according to claim 1, characterized in that, In step 1), the four-level discrete wavelet decomposition is implemented using the Malat algorithm. The Malat algorithm filters and downsamples the discrete signal using high-pass and low-pass filters respectively to obtain high-frequency and low-frequency signals. Then, the low-frequency signal is subjected to high-pass and low-pass filtering and downsampling. The high-pass / low-pass operation at level α is defined as follows: Where Q represents the discrete signal length, K represents the filter length, low is the low-pass filter, and high is the high-pass filter, the original signal S is decomposed into S0 through discrete wavelet decomposition. CD1 S CD2 S CD3 S CD4 and S CA4 .
3. The sleep stage classification method according to claim 1, characterized in that, In step 2), the box plot selects the maximum, minimum, upper boundary, lower boundary, upper quartile, lower quartile, median, mean, and standard deviation of the signal in different sleep stages as features for a single-channel signal S of a time segment. n n∈(0,N), where N is the number of nodes, i.e., the number of sampling channels. The feature vector X of this node is composed of the above nine feature values. n The feature matrix X of this time segment is composed of the feature vectors of each node.
4. The sleep stage classification method according to claim 3, characterized in that, In step 3), the connections between nodes are determined by the correlation of node features. The basic adjacency matrix A1 is calculated based on the Gaussian kernel function. The basic adjacency matrix A1 is multiplied by the weight W1 so that the adjacency matrix can be adaptively adjusted by data-driven means. The most suitable adjacency matrix A is found for each graph structure. The feature matrix X and the adjacency matrix A together constitute the sleep stage graph. A sleep stage graph is constructed for each time segment, and the sleep signal sequence is converted into a graph sequence.
5. The sleep stage classification method according to claim 1, characterized in that, In step 4), a static graph encoder is used to generate a graph-level embedding representation for each sleep stage graph, and these embedding representations are passed into the sequential decoder in chronological order.
6. The sleep stage classification method according to claim 5, characterized in that, In step 5), the embedded representations of each signal component are concatenated to integrate the multi-resolution signal, and then a fully connected layer is used to classify the concatenated signal. The fully connected layer projects the concatenated signal into a five-dimensional space, corresponding to the probability of the current sleep segment belonging to each sleep stage. The cross-entropy loss between the predicted label and the true label is calculated. The cross-entropy loss is calculated as follows: Where C is the number of categories, and y is the true label. is the predicted label, and L represents the number of samples.
7. The sleep stage classification method according to claim 1, characterized in that, In step 6), the supervised contrastive learning process between the two components is as follows: A certain time segment in the time series of a signal component is set as the anchor. Then, other signal components in this time segment, as well as other time segments in the same sleep stage as this signal component, are considered positive samples. The contrastive learning process maximizes the similarity of positive samples and minimizes the similarity of negative samples by minimizing the supervised contrastive learning loss. The supervised contrastive learning loss function is calculated as follows: L Contrastive_Learning = L Component (H CD1 ,H CD2 )+L Component (H CD1 ,H CD3 )+…+L Component (H CD4 ,H CA4 ) Where j∈J≡{1…2L} is the set of all samples of the time series of the two signal components, P is the set of positive samples, and 0(j)≡J\{j}.
8. The sleep stage classification method according to claim 7, characterized in that, In step 6), the model is optimized using both cross-entropy loss and supervised contrastive learning loss. The loss function is calculated as follows: L = L Cross_Entropy +λL Contrastive_Learning .