Sleep stage classification method and device, computer equipment and readable storage medium
Through the characteristic extraction and fusion of the multi -lead sleep monitoring signal, the problem of insufficient category accuracy in the existing technology in the existing technologies has been solved, and higher classification accuracy and more comprehensive sleep feature capture are achieved.
Patent Information
- Application Number
- CN202411499129.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-01-24
AI Technical Summary
The accuracy of the prior art still has room for improvement in sleep stage classification.
By obtaining multi -guided sleep monitoring signals, each single -guide signal characteristics are determined, according to these characteristics, obtaining the characteristics of the multi -lead signal signal, and adjusting the characteristic weight through the degree of correlation, and finally determine the category of the sleep phase based on the fusion features.
Improve the accuracy of the sleeping phase, make full use of the various signal characteristics in the multi -guided sleep monitoring signal, reduce subjective errors, and provide auxiliary tools for doctors.
Smart Images

Figure CN119357746A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a sleep stage classification method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] Sleep affects every aspect of daily activities. Good sleep quality often leads to better physical condition; interrupted sleep time can lead to some sleep disorders, such as insomnia, lack of sleep or apnea. In order to better analyze sleep quality, sleep monitoring and sleep stage classification can be performed.
[0003] Among the related technologies, automatic sleep staging is mainly performed through traditional machine learning methods, such as Naive Bayes, Support Vector Machine and Random Forest. As deep learning methods are widely used, relevant personnel have also begun to build classification models based on neural network architectures for sleep staging. These classification models are mainly based on some lead signals in PSG (Polysomnography) signals to determine sleep staging.
[0004] However, the inventors found in practice that the accuracy of sleep stage classification using the above method still has much room for improvement. Summary of the invention
[0005] Based on this, it is necessary to provide a sleep stage classification method, apparatus, computer device, computer-readable storage medium and computer program product that can improve the accuracy of sleep stage classification in response to the above technical problems.
[0006] In a first aspect, the present application provides a sleep stage classification method, comprising:
[0007] Acquire multi-lead sleep monitoring signals;
[0008] Respectively determining the single-lead signal characteristics of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal;
[0009] Obtaining a multi-lead signal feature sequence according to the single-lead signal feature, and obtaining a multi-lead fusion feature according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result;
[0010] A sleep stage classification result is determined according to the multi-lead fusion features.
[0011] In one embodiment, the step of respectively determining the single-lead signal characteristics of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal comprises:
[0012] Respectively determining the frequency spectrum distribution characteristics of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal;
[0013] Determining at least one target frequency band distribution range related to the sleep stage type in the single-lead sleep monitoring signal according to the frequency spectrum distribution characteristics;
[0014] Inputting the single-lead sleep monitoring signal into at least one signal processing branch; the signal processing branch is provided with a convolution kernel whose size matches the target frequency band distribution range, and the sizes of the convolution kernels on different signal processing branches are different;
[0015] The single-lead sleep monitoring signal is convolved by the convolution kernel on each of the signal processing branches to obtain the convolution results of each of the signal processing branches, and the single-lead signal feature is determined according to each of the convolution results.
[0016] In one embodiment, the size of the convolution kernel is determined by the following steps:
[0017] Acquire the target frequency band distribution range related to the sleep stage type in the single-lead sleep monitoring signal;
[0018] For each of the target frequency band distribution ranges, a signal period corresponding to the target frequency band distribution range is determined, and a selected size is determined according to the signal period and the signal capture range corresponding to various candidate sizes of the convolution kernel.
[0019] In one embodiment, obtaining the multi-lead fusion feature according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result includes:
[0020] Determining a feature weight corresponding to each signal feature in the multi-lead signal feature sequence according to a correlation between each signal feature in the multi-lead signal feature sequence and a sleep stage classification result;
[0021] According to the feature weight corresponding to each signal feature in the multi-lead signal feature sequence, the multi-lead signal feature sequence is adjusted to obtain an adjusted multi-lead signal feature sequence;
[0022] The adjusted multi-lead signal feature sequence and the multi-lead signal feature sequence are fused, and a multi-lead fusion feature is determined according to the fusion result.
[0023] In one of the embodiments, before the step of determining the feature weight corresponding to each signal feature in the multi-lead signal feature sequence according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result, the step further includes:
[0024] Segmenting the multi-lead signal feature sequence according to the position codes corresponding to the signal features in the multi-lead signal feature sequence to obtain a plurality of subsequences in a time sequence;
[0025] Based on the dependency relationship and context relationship between the plurality of subsequences, determining the autocorrelation between each subsequence and each of the subsequences;
[0026] The correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result is determined according to the autocorrelation of each subsequence.
[0027] In one embodiment, the sleep stage classification result is determined by a classifier according to the multi-lead fusion features, and the classifier is trained by the following steps:
[0028] Inputting the sample multi-lead fusion features corresponding to the sample multi-lead sleep monitoring signal into the classifier to be trained to obtain the classification probability of each of the multiple sleep stages;
[0029] Determine a classification loss value for each sleep stage according to the sleep stage classification label corresponding to the sample multi-lead sleep monitoring signal and the classification probability of each of the sleep stages;
[0030] Determining a loss weight for each of the sleep stages; the loss weight is negatively correlated with the distribution range of the sleep stages;
[0031] Determining a target loss value according to the loss weight of each of the sleep stages and the classification loss value of each of the sleep stages;
[0032] The parameters of the classifier are adjusted according to the target loss value until the training end condition is met to obtain the trained classifier.
[0033] In one embodiment, the fusing of the plurality of single-lead signal features comprises:
[0034] Perform multiple feature extractions on at least two of the single-lead signal features, and obtain a multi-lead signal feature sequence based on the result of the last feature extraction output; wherein, for feature extractions other than the first feature extraction, the input of the current feature extraction is obtained based on the result of the last feature extraction output.
[0035] In a second aspect, the present application also provides a sleep stage classification device, comprising:
[0036] A multi-lead signal acquisition module, used to acquire multi-lead sleep monitoring signals;
[0037] A single-lead feature extraction module, used to respectively determine the single-lead signal features of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal;
[0038] A multi-lead feature extraction and fusion module, used to obtain a multi-lead signal feature sequence according to the single-lead signal feature, and obtain a multi-lead fusion feature according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result;
[0039] A classification module is used to determine a sleep stage classification result according to the multi-lead fusion features.
[0040] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0041] Acquire multi-lead sleep monitoring signals;
[0042] Respectively determining the single-lead signal characteristics of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal;
[0043] Obtaining a multi-lead signal feature sequence according to the single-lead signal feature, and obtaining a multi-lead fusion feature according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result;
[0044] A sleep stage classification result is determined according to the multi-lead fusion features.
[0045] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0046] Acquire multi-lead sleep monitoring signals;
[0047] Respectively determining the single-lead signal characteristics of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal;
[0048] Obtaining a multi-lead signal feature sequence according to the single-lead signal feature, and obtaining a multi-lead fusion feature according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result;
[0049] A sleep stage classification result is determined according to the multi-lead fusion features.
[0050] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0051] Acquire multi-lead sleep monitoring signals;
[0052] Respectively determining the single-lead signal characteristics of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal;
[0053] Obtaining a multi-lead signal feature sequence according to the single-lead signal feature, and obtaining a multi-lead fusion feature according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result;
[0054] A sleep stage classification result is determined according to the multi-lead fusion features.
[0055] The sleep stage classification method, device, computer equipment, computer-readable storage medium and computer program product can respectively determine the single-lead signal features of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal after obtaining the multi-lead sleep monitoring signal; then, obtain the multi-lead signal feature sequence according to the single-lead signal features, and obtain the multi-lead fusion feature according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result; and then determine the sleep stage classification result according to the multi-lead fusion feature. In this embodiment, on the one hand, feature extraction can be performed on each single-lead sleep monitoring signal respectively, which can fully consider the differences in signal distribution modes of different lead sleep monitoring signals, and use different methods to extract key features differentially, so that the extracted single-lead signal features can more accurately reflect the characteristics of the single-lead sleep monitoring signal; on the other hand, by obtaining the multi-lead fusion feature according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result, it is helpful to obtain features with high correlation with the classification result from multiple signal features of the multi-lead sleep monitoring signal, so that this embodiment can effectively improve the classification accuracy of the sleep stage. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 is a flowchart of a sleep stage classification method in one embodiment;
[0058] Figure 2 is a flow chart of another sleep stage classification method in one embodiment;
[0059] Figure 3 A schematic flow chart of steps for constructing a sleep monitoring system in one embodiment;
[0060] Figure 4 A pre-experimental classification confusion matrix diagram in one embodiment;
[0061] Figure 5 is a structural block diagram of a sleep stage classification device in one embodiment;
[0062] Figure 6 The figure is a diagram of the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0064] In one embodiment, Figure 1 As shown, a sleep stage classification method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0065] S101, obtaining a multi-lead sleep monitoring signal.
[0066] The multi-lead sleep monitoring signal may be obtained by simultaneously monitoring multiple physiological indicators of the target object during the target object's sleep process, and the sleep process may refer to the process from the beginning of sleep to the end of sleep.
[0067] In some embodiments, the multi-lead sleep monitoring signal may be a PSG signal, in which case the multi-lead sleep monitoring signal may include an electroencephalogram (EEG), an electro-oculogram (EOG), an electromyogram (EMG), and an electrocardiogram (ECG). In traditional sleep stage classification, the PSG signal is divided into segments of a preset length, such as a 30-second segment, and each segment is manually checked by a sleep expert and classified into one of five stages, namely, the wake stage (W), the rapid eye movement stage (REM), and three non-rapid eye movement stages (N1, N2, and N3). The manual classification process is often very detailed, tedious, and time-consuming.
[0068] S102, determining the single-lead signal characteristics of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal.
[0069] The multi-lead sleep monitoring signal includes multiple single-lead sleep monitoring signals, such as EEG signals, EOG signals, EMG signals and ECG signals, which together constitute the multi-lead sleep monitoring signal.
[0070] When using PSG signals to classify sleep stages, although there are usually multiple lead signals in the PSG data set, most previous methods still only use a single lead for analysis. For example, some related technologies only model the EEG signal. Although this method helps to simplify the model structure and reduce the training cost, it ignores the information of other leads and does not fully consider the supplementary role of multi-channel data on global features, which limits the comprehensive understanding of the entire sleep process of the target object. In some other related technologies, although improvements have been made and EEG signals and EOG signals are used for staging, they still only use part of the PSG signal for processing and fail to make full use of the PSG signal; in addition, the inventors also found that this technology uses the same feature extractor to extract features from EEG signals and EOG signals at the same time, that is, the feature extraction process of multiple signals shares the same feature extraction parameters, ignoring the differences between different types of signals, which may have a negative impact on the accuracy of sleep stage classification.
[0071] In this regard, in this embodiment, after obtaining the multi-lead sleep monitoring signal, feature extraction can be performed on each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal to obtain the single-lead signal features of each single-lead sleep monitoring signal.
[0072] In some exemplary embodiments, for each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal, feature extraction may be performed on the single-lead sleep monitoring signal according to the signal distribution characteristics of the single-lead sleep monitoring signal to obtain the single-lead signal features.
[0073] In some exemplary embodiments, for multiple single-lead sleep monitoring signals, a parallel training method can be used in advance to obtain the signal feature extractors corresponding to the multiple single-lead sleep monitoring signals, that is, multiple single-lead feature extractors can be obtained by parallel training, so that for each single-lead sleep monitoring signal, the signal feature extractor corresponding to the single-lead sleep monitoring signal can perform feature extraction on the single-lead sleep monitoring signal to obtain the single-lead signal feature.
[0074] In this embodiment, on the one hand, it is possible to make full use of various signals in the multi-lead sleep monitoring signal, which helps to fully understand the entire sleep process from multiple dimensions based on multiple single-lead sleep monitoring signals, and improve the model's classification performance for sleep stages; on the other hand, by extracting features for each single-lead sleep monitoring signal separately, it is possible to fully consider the differences in signal distribution methods of different lead sleep monitoring signals, and use different methods to extract key features in a differentiated manner, so that the extracted single-lead signal features can more accurately reflect the characteristics of the single-lead sleep monitoring signal, which helps to improve classification accuracy. In addition, when using a single-lead feature extractor to extract single-lead signal features, since the signal extraction method of the single-lead feature extractor can match the input single-lead sleep monitoring signal, it also helps to improve the model running speed and reduce the difficulty of model training.
[0075] In some embodiments, when a single-lead sleep monitoring signal includes two or more channel signals, a feature extractor can also be designed separately for each channel. These feature extractors can include a variety of networks for timing signal feature extraction, which may include but are not limited to one or more network combinations of the following algorithms: Transformer and its variants, Usleep network, Utime network, Resnet-LSTM network, etc.
[0076] S103, obtaining a multi-lead signal feature sequence according to the single-lead signal feature, and obtaining a multi-lead fusion feature according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result.
[0077] In this step, part or all of the acquired single-lead signal features may be fused to obtain a multi-lead signal feature sequence. For example, at least two of all the extracted single-lead signal features may be fused, and the fusion result may be used as a multi-lead fusion feature.
[0078] In some optional embodiments, in the stage of fusion of multiple single-lead signal features, different fusion methods can be selected according to the relationship between tasks and data, which can include but are not limited to cascade fusion, weighted fusion, attention fusion or graph convolution fusion. Then, further feature processing can be performed on the multi-lead signal feature sequence.
[0079] Specifically, the multi-lead signal feature sequence obtained after fusion will include a variety of rich signal features, among which some signal features have a higher correlation with sleep stage classification, while some signal features may have a lower correlation or even no correlation with sleep stage classification. If all signal features in the multi-lead signal feature sequence are analyzed and processed in the same way, it will interfere with the accuracy of sleep stage classification.
[0080] In this regard, in this embodiment, the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result can be determined, and the multi-lead signal feature sequence is differentially processed (such as differential feature adjustment) according to the determined correlations, and the multi-lead fusion feature is obtained according to the processed multi-lead signal feature sequence. In some examples, the above processing can be performed using a feature encoder, for example, the fused multi-lead signal feature sequence can be input into the feature encoder to obtain the multi-lead fusion feature outputted by the feature encoder.
[0081] As a result, in the subsequent classification process, more attention can be paid to signal features with higher correlation in the multi-lead signal feature sequence, and less attention can be paid to signal features with lower correlation, so that more attention can be paid to signal features related to sleep stage classification, thereby improving the accuracy of sleep stage classification.
[0082] S104, determining a sleep stage classification result according to the multi-lead fusion features.
[0083] After obtaining the multi-lead fusion features, the sleep stage classification result can be determined by analyzing the multi-lead fusion features. In some exemplary embodiments, the multi-lead fusion features can be input into a classifier, and the classifier determines the sleep stage corresponding to the multi-lead sleep monitoring signal according to the multi-lead fusion features, and outputs the sleep stage classification result.
[0084] In the above sleep stage classification method, after obtaining the multi-lead sleep monitoring signal, the single-lead signal features of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal can be determined respectively; then, a multi-lead signal feature sequence is obtained according to the single-lead signal features, and a multi-lead fusion feature is obtained according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result; and then the sleep stage classification result is determined according to the multi-lead fusion feature. In this embodiment, on the one hand, feature extraction can be performed on each single-lead sleep monitoring signal respectively, and the differences in signal distribution modes of different lead sleep monitoring signals can be fully considered, and key features can be extracted differentially using different methods, so that the extracted single-lead signal features can more accurately reflect the characteristics of the single-lead sleep monitoring signal; on the other hand, by obtaining the multi-lead fusion feature according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result, it is helpful to obtain features with high correlation with the classification result from multiple signal features of the multi-lead sleep monitoring signal, so that this embodiment can effectively improve the classification accuracy of the sleep stage.
[0085] In addition, the above-mentioned sleep stage classification method can achieve more accurate automatic sleep staging, reduce subjective errors, and provide doctors with powerful auxiliary tools to reduce their workload.
[0086] In one embodiment, in step S102, determining the single-lead signal features of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal may include the following steps:
[0087] Determine the frequency spectrum distribution characteristics of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal respectively; determine at least one target frequency band distribution range related to the sleep stage type in the single-lead sleep monitoring signal according to the frequency spectrum distribution characteristics; input the single-lead sleep monitoring signal into at least one signal processing branch; the signal processing branch is provided with a convolution kernel whose size matches the target frequency band distribution range, and the sizes of the convolution kernels on different signal processing branches are different; perform convolution processing on the single-lead sleep monitoring signal through the convolution kernels on each signal processing branch to obtain the convolution results of each signal processing branch, and determine the single-lead signal characteristics according to each convolution result.
[0088] In practical applications, each single-lead sleep monitoring signal has corresponding signal distribution characteristics, such as spectrum distribution characteristics. Considering that the signal spectrum ranges of different sleep stages are different, and there are differences in frequency band distribution between different lead types, when extracting the single-lead signal features of each single-lead sleep monitoring signal (for example, using the single-lead feature extractor corresponding to each single-lead sleep monitoring signal to extract features), a convolution kernel of a specified size can be set, and the size matches the target frequency band distribution range related to the sleep stage type in the single-lead sleep monitoring signal, and then the convolution kernel is used to perform convolution processing on the input single-lead sleep monitoring signal, and the single-lead signal features are obtained according to the convolution result. For example, in practical applications, EEG signals contribute more to the classification of sleep stage types N2 and N3, and EOG signals contribute more to the classification of sleep stage types N1 and REM. Among them, the frequency bands most related to N2 and N3 are k complex waves and spindle waves, and the frequency band most related to N1 is slow waves. That is, in each single-lead sleep monitoring signal, the information related to the sleep stage type is distributed in a specific frequency band range. By setting the convolution kernel size to match the target frequency band distribution range, the signal features of different frequency band distributions related to sleep classification types in multimodal sleep monitoring signals can be captured differentially, thereby improving the classification accuracy of sleep stages.
[0089] Specifically, the spectrum distribution characteristics of the single-lead sleep monitoring signal can be determined, and by analyzing the frequency band spectrum characteristics, one or more frequency band distribution ranges related to the sleep stage type, that is, at least one target frequency band distribution range can be determined. Exemplarily, a spectrum graph of the single-lead sleep monitoring signal can be obtained, and by analyzing the spectrum graph, a main frequency band related to the sleep stage type can be determined, and then the upper and lower bounds of the main frequency band are combined to obtain the target frequency band distribution range.
[0090] In the case where there may be one or more target frequency band distribution ranges in the same single-lead sleep monitoring signal, this embodiment may set one or more signal processing branches. In some examples, the number of signal processing branches may match the number of target frequency band distributions. For example, if there are two target frequency band distribution ranges, two signal processing branches may be set. Each signal branch is provided with a convolution kernel whose size matches the target frequency band distribution range, and the sizes of the convolution kernels on different signal processing branches are different.
[0091] Furthermore, after obtaining the single-lead sleep monitoring signal, the same single-lead sleep monitoring signal can be input into each signal processing branch of the single-lead feature extractor respectively, and the single-lead sleep monitoring signal is convolved by the convolution kernel on each signal processing branch. In this way, the single-lead feature extractor can adaptively capture the signal features in different frequency bands in the single-lead sleep monitoring signal.
[0092] Then, the single-lead signal feature can be determined based on the convolution results output by each signal processing branch. In one embodiment, after obtaining the convolution results of each signal processing branch, the convolution results of each signal processing branch can be fused and input into the residual module for processing, and the single-lead signal feature is obtained based on the processing results output by the residual module. By processing the convolution results of multiple signal processing branches in combination with the residual module, common information can be extracted from the convolution results obtained from multiple signal processing branches, and the difference information of different signal processing branches can be retained, while reducing redundant and repeated content while maintaining specific information, thereby improving the feature extraction quality of single-lead signal features.
[0093] In one embodiment, the size of the convolution kernel used can be determined by the following steps:
[0094] Obtain a target frequency band distribution range associated with the sleep stage type in a single-lead sleep monitoring signal; for each target frequency band distribution range, determine a signal period corresponding to the target frequency band distribution range, and determine a selected size based on the signal period and the signal capture range corresponding to various candidate sizes of the convolution kernel.
[0095] In some embodiments, when a single-lead feature extractor is used to obtain single-lead signal features, the size of the convolution kernel on each signal processing branch in the single-lead feature extractor can be determined through the above steps.
[0096] Specifically, the target frequency band distribution range related to the sleep stage type in the single-lead sleep monitoring signal can be determined first. If there are multiple key target frequency band distribution ranges in the single-lead sleep monitoring signal, each target frequency band distribution range can be obtained. For example, EEG signals contribute more to the classification of sleep stage types N2 and N3, and EOG signals contribute more to the classification of sleep stage types N1 and REM. Among them, the frequency bands most relevant to N2 and N3 are k-complex waves and spindle waves, and the frequency band most relevant to N1 is slow waves. In this embodiment, the size of the convolution kernel can be designed based on the distribution of these frequency bands that meet preset conditions (such as the highest correlation) with the sleep stage type.
[0097] For each target frequency band distribution range obtained, the frequency corresponding to the single-lead sleep monitoring signal in the target frequency band distribution range can be determined, for example, the main frequency component of the target frequency band distribution range is determined, and then the signal period is determined based on the frequency, so that the time scale of the complete signal within one cycle in the target frequency band distribution range can be determined according to the signal period.
[0098] On the other hand, the signal capture range of the convolution kernel under various candidate sizes can be predetermined, where the signal capture range can be understood as the duration of the signal that the convolution kernel can capture under the corresponding candidate size. For example, a large-sized convolution kernel (such as kernel size = 400) can capture a 4-second window time series, while a smaller-sized convolution kernel (such as kernel size = 50) can capture a 0.5-second window time series.
[0099] Furthermore, based on the signal capture range corresponding to various candidate sizes of the convolution kernel and the signal period corresponding to the target frequency band distribution, the size that matches the main frequency component related to the sleep stage type can be determined as the selected size. For example, the size that the signal capture range can cover the signal period can be selected.
[0100] In this embodiment, by determining the signal period corresponding to the target frequency band distribution range and determining the selected size according to the signal period and the signal capture range corresponding to various candidate sizes of the convolution kernel, different frequency band features of different leads can be effectively extracted. By adopting convolution kernels of different sizes, it is beneficial to capture features at different time scales and adapt to signals of various lead types and different sleep-related frequency bands.
[0101] Taking the PSG dataset with a sampling rate of 100 Hz (i.e., 100 time units are sampled in one second) as an example, the rationality of the selection of convolution kernel size in different signal processing branches is demonstrated. First, a large-sized convolution kernel (such as kernel size = 400) can capture a time series of a 4-second window, thereby capturing the entire cycle of a sinusoidal signal as low as 0.25 Hz (T=1 / F), which corresponds to the δ band. Second, for a smaller-sized convolution kernel (such as kernel size = 50), each convolution kernel window can capture 50 samples, corresponding to a window size of 0.5 seconds, so it will be able to capture the entire cycle of a sinusoidal signal as low as ∼2Hz, which corresponds to the ∝ band and the θ band, which is beneficial for the model to distinguish between the W stage and the REM stage during sleep.
[0102] In order to enable those skilled in the art to better understand the above steps, the embodiment of the present application is illustrated below by using an example, but it should be understood that the embodiment of the present application is not limited to this.
[0103] like Figure 2 As shown, an exemplary architecture of a sleep stage classification model is shown, and the sleep stage classification model includes three processing parts: single-lead feature extraction, multi-lead feature fusion, and classification. Among them, the single-lead feature extraction part can set multiple feature extractors (that is, multiple single-lead feature extractors). In this example, corresponding feature extractors are set for EEG signals, EMG signals, and EOG signals, respectively. Each feature extractor can include two signal processing branches, and each signal processing branch includes a convolution layer (Conv), a maximum pooling layer (MaxPooling), and a dropout layer (Dropout).
[0104] Specifically, the structure of the feature extractor can be as follows Figure 2 As shown in the enlarged structure on the right, each branch consists of three one-dimensional convolution operations (Conv1D) and two maximum pooling layers, where each convolution layer includes a batch normalization layer and uses Gaussian error linear unit (GELU) as the activation function. To reduce overfitting, a dropout layer is applied after the maximum pooling layer in both branches and after the two branches are connected in series. Finally, the ResidualSE (Squeeze & Excitation) Block is used to model the interdependence between features and adaptively select the most discriminative features.
[0105] Assume that the given multi-lead PSG training data is of size N , ) is the first A data set, that is, a single-lead sleep monitoring signal, which has channels, representing the number of leads, in this example, .in , , represents the input obtained from the EEG or EOG period, T is the sleep duration, in this example T is 30 seconds, F is the sampling frequency; at the same time, it has a label ,in , representing the five categories of sleep stages. The feature map after the dual-branch multi-resolution convolutional network (MRCNN) becomes . Then, you can Apply two convolution operations so that and There are two Next, adaptive average pooling is used to compress the global spatial information. Zoom out to in yes middle Then apply two full connections layers to exploit the aggregate information. Specifically, the first layer is followed by a activation function to perform dimensionality reduction, and the second layer is followed by a smooth The activation function is used to perform dimensionality reduction, as shown in the following formula:
[0106]
[0107] in They are Activation function, Represents two Then, the feature map according to Scaling is performed as shown in the following formula:
[0108]
[0109] in refers to and In addition, a shortcut connection is added to this module to convert the original input Combined with the enhanced features learned from the residual block, the final output single-lead signal features are:
[0110]
[0111] In one embodiment, in step S103, obtaining a multi-lead signal feature sequence according to a single-lead signal feature may include the following steps:
[0112] Perform multiple feature extractions on at least two single-lead signal features, and obtain a multi-lead signal feature sequence based on the result of the last feature extraction output; wherein, for feature extractions other than the first feature extraction, the input of the current feature extraction is obtained based on the result of the last feature extraction output.
[0113] In the related technologies, although it involves using monitoring signals from multiple leads to determine sleep stages, the classification accuracy has not been significantly improved. The inventors found that in these technologies, they only simply connect the features of monitoring signals from different leads, resulting in the information contained in multiple leads not being fully utilized.
[0114] In this regard, in this embodiment, by performing a cascade operation on at least two single-lead signal features, effective information therein can be fully extracted while fusing multiple single-lead signal features to obtain a multi-lead signal feature sequence.
[0115] In some embodiments, a plurality of cascaded feature extractors may be set in the sleep stage classification model. For the sake of distinction, each feature extractor in the cascade is also referred to as a cascaded feature extractor. The plurality of cascaded feature extractors may be set in Figure 2 The multi-lead feature fusion part shown ( Figure 2 not shown).
[0116] After obtaining at least two single-lead signal features, the at least two single-lead signal features can be forward fused. Specifically, after splicing at least two single-lead signal features, they can be input into the first cascade feature extractor, and then multiple cascade feature extractors cascaded in sequence perform feature extraction on the input features. The input features of the first cascade feature extractor can be the spliced multiple single-lead signal features, and the input features of each cascade feature extractor after the first cascade feature extractor are the output features of the previous cascade feature extractor. Thus, forward fusion of multiple single-lead signal features is achieved.
[0117] In this embodiment, by cascading multiple single-lead signal features, information from different leads can be integrated, so that the model can better understand and capture the correlation and complexity between multi-lead features, thereby making full use of the obtained single-lead joint features (that is, features jointly constituted by multiple single-lead signal features) to construct a deeper and more information-rich joint feature representation.
[0118] In some embodiments, different PSG channels may contain a large amount of similar information. In order to reduce the overfitting of the model, a Dropout layer can be used to process the information feature sequence obtained by forward fusion, that is, the information feature sequence is input into the Dropout layer, and the features output by the Dropout layer are then input into the feature encoder.
[0119] In one embodiment, in step S103, obtaining a multi-lead fusion feature according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result may include the following steps:
[0120] S1031, determining a feature weight corresponding to each signal feature in the multi-lead signal feature sequence according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result.
[0121] In practical applications, after obtaining a multi-lead signal feature sequence, the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result can be determined, and the feature weight corresponding to each signal feature can be determined based on the correlation, wherein the feature weight can be positively correlated with the correlation, that is, the higher the correlation between the signal feature and the sleep stage classification result, the larger the feature weight of the signal feature can be.
[0122] S1032, adjusting the multi-lead signal feature sequence according to the feature weight corresponding to each signal feature in the multi-lead signal feature sequence to obtain an adjusted multi-lead signal feature sequence.
[0123] After obtaining the feature weight corresponding to each signal feature, the multi-lead signal feature sequence can be adjusted according to each feature weight. Specifically, for each signal feature in the multi-lead signal feature sequence, the feature weight of the signal feature can be multiplied by the signal feature to obtain a processing result, and the adjusted multi-lead signal feature sequence can be obtained according to the processing results of each signal feature.
[0124] S1033, fusing the adjusted multi-lead signal feature sequence and the multi-lead signal feature sequence, and determining a multi-lead fusion feature according to the fusion result.
[0125] After obtaining the adjusted multi-lead signal feature sequence, the adjusted multi-lead signal feature sequence can be residually connected with the multi-lead signal feature sequence before adjustment. Figure 2 As shown, the multi-lead signal feature sequence output by the normalization layer (Layer Norm) can be input into the encoder (Transformer Encoder) of the transformer model to obtain the adjusted multi-lead signal feature sequence, and then the adjusted multi-lead signal feature sequence and the multi-lead signal feature sequence before input can be connected to obtain the multi-lead fusion feature.
[0126] In this embodiment, on the one hand, the sleep stage classification model can automatically determine which fused features are more important to the final classification result, and then dynamically allocate feature weights according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result; on the other hand, by using residual connections to fuse the adjusted multi-lead signal feature sequence with the multi-lead signal feature sequence before adjustment, the model retains the unique features of each lead to a certain extent, combines the commonalities and differences between the leads, and fully mines the features most relevant to sleep staging, thereby improving the performance of the model.
[0127] In one embodiment, before the step of determining the attention weight corresponding to each signal feature in the multi-lead signal feature sequence according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result, the step further includes:
[0128] According to the position codes corresponding to the signal features in the multi-lead signal feature sequence, the multi-lead signal feature sequence is segmented to obtain multiple subsequences with a time sequence; based on the dependency relationship and context relationship between the multiple subsequences, the autocorrelation of each subsequence with each of the subsequences is determined; according to the autocorrelation of each subsequence, the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result is determined.
[0129] Some related technologies involve using the self-attention mechanism in Transformer to process sleep monitoring signals, but are limited to the processing of single lead data. At the same time, although these methods use the self-attention mechanism in Transformer, the inventors found that it ignores the time series relationship between signal features, which may be critical in sleep staging tasks because the sleep process is time-dependent.
[0130] For this purpose, position embedding can be used in combination with Transformer. In this embodiment, corresponding position encoding can be set for multiple or all signal features in the multi-lead signal feature sequence, and the order of position encoding can be determined according to the time sequence of the signal features. After obtaining the multi-lead signal feature sequence, the entire multi-lead signal feature sequence can be divided into multiple subsequences with a time sequence according to the position encoding.
[0131] Afterwards, the feature encoder can analyze multiple subsequences, learn the morphological features of the sequence from the multi-lead signal feature sequence, determine the long-distance dependencies and contextual relationships between multiple subsequences, and thus determine the importance and relevance of each subsequence to other subsequences, and obtain the autocorrelation of each subsequence with each other subsequence. Among them, the autocorrelation can characterize the degree of correlation between a subsequence and each other subsequence. If the autocorrelation is high, the content in the subsequence has a strong correlation with multiple subsequences. If the autocorrelation is low, the content in the subsequence has a weak correlation with multiple subsequences. Then, the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result can be determined based on the autocorrelation of each subsequence. Among them, the higher the autocorrelation, the higher the correlation between the subsequence and the sleep stage classification result, and the higher the correlation between the signal feature in the subsequence and the sleep stage classification result.
[0132] In this embodiment, on the one hand, the multi-lead signal feature sequence can be segmented according to the position coding, which can more effectively capture the position information of the elements (i.e., signal features) in the multi-lead signal feature sequence, accurately segment the sequence, and help distinguish the features of different time steps, ensuring that the model can correctly capture the temporal correlation between features, and facilitate the subsequent capture of the time series relationship between signal features; on the other hand, by determining the autocorrelation based on the dependency and contextual relationship between subsequences and obtaining the corresponding correlation degree, the model can be allowed to dynamically allocate feature weights based on the relationship between the positions of each signal feature in the multi-lead signal feature sequence, thereby increasing the focus on important signal features and improving the accuracy of sleep stage classification.
[0133] In addition, the present application combines the convolution module with the Transformer to achieve simultaneous extraction of single-lead feature extraction and multi-lead feature fusion in the same framework, which can make full use of the similarities and differences between different lead features, learn the common semantic features of multi-lead sleep monitoring signals, and then map the fused tensor of the common semantic features to the sleep stage for sleep stage classification. Compared with variants that only use one lead as input or use a simple feature fusion strategy, it can effectively improve the sleep staging performance and obtain higher classification performance; at the same time, compared with using the "encoder-decoder" framework, this embodiment can reduce the complexity and computational requirements of the model by only using the encoder in the Transformer framework to obtain multi-lead fusion features, making the model easier to train and deploy.
[0134] In one embodiment, the sleep stage classification result is determined by a classifier based on multi-lead fusion features, for example, the classification result is obtained by a classifier in a sleep stage classification model. The classifier can be trained by the following steps:
[0135] The sample multi-lead fusion features corresponding to the sample multi-lead sleep monitoring signal are input into the classifier to be trained to obtain the classification probabilities of multiple sleep stages; the classification loss value of each sleep stage is determined according to the sleep stage classification labels corresponding to the sample multi-lead sleep monitoring signal and the classification probabilities of multiple sleep stages; the loss weight of each sleep stage is determined; the loss weight is negatively correlated with the distribution range of the sleep stage; the target loss value is determined according to the loss weight of each sleep stage and the classification loss value of each sleep stage; the parameters of the classifier are adjusted according to the target loss value until the training end conditions are met to obtain a trained classifier.
[0136] Specifically, a multi-lead sleep monitoring signal for training a sleep stage classification model can be obtained. For ease of distinction, the signal used in training is called a sample multi-lead sleep monitoring signal. The sleep stage classification model includes a classifier. Each sample multi-lead sleep monitoring signal can be set with a corresponding sleep stage classification label, which can be a manually labeled probability that the sample multi-lead sleep monitoring signal corresponds to various sleep stages. In one example, the classifier structure can include a fully connected layer and normalization layers (such as layer) to process the features processed by the multi-channel feature fusion block. During model training, Optimizer as optimization algorithm.
[0137] During the training process, the sample multi-lead sleep monitoring signal can be subjected to single-lead feature extraction and multi-lead feature fusion to obtain the sample multi-lead fusion feature corresponding to the sample multi-lead sleep monitoring signal. The specific processing process can be the same as the processing process of the multi-lead sleep detection signal. Then, the sample multi-lead fusion feature can be input into the classifier to be trained to obtain the classification probability of each of the multiple sleep stages output by the classifier.
[0138] For each sleep stage, the labeled classification probability of the sleep stage can be determined according to the sleep stage classification label, and the classification loss value of the sleep stage can be determined according to the probability difference between the labeled classification probability and the classification probability output by the classifier for the sleep stage. In this way, the classification loss values of different sleep stages can be obtained.
[0139] When processing sleep stage data, we often face the problem of data imbalance. For example, in multiple samples, stage W is more widely distributed, while N1 and N2 are more limited. This often causes the sleep stage classification model to over-learn most cases (such as stage W), thereby reducing the performance of N1 and N2.
[0140] In this regard, in this embodiment, the loss weight set for each sleep stage can be determined in advance according to the distribution range of each sleep stage (such as the sample distribution range). The loss weight is negatively correlated with the distribution range of the sleep stage, that is, the wider the distribution range of the sleep stage, the smaller the loss weight, and the narrower the distribution range, the larger the loss weight. Then, according to the loss weight of each sleep stage and the classification loss value of each sleep stage, the target loss value can be determined. For example, the loss weight of each sleep stage and the classification loss value of each sleep stage can be weighted to obtain the target loss value. Subsequently, the parameters of the classifier can be adjusted according to the target loss value, and the above steps are repeated until the training end condition is met to obtain a trained classifier.
[0141] In this embodiment, by introducing a class-aware loss function, the loss weight is negatively correlated with the distribution range of the sleep stages. The target loss value is determined based on the loss weight and classification loss value of each sleep stage. This helps to balance the training losses between different sleep stage categories, assigning larger weights to small distributions and smaller weights to large distributions, thereby more effectively improving the performance of the model on less common sleep stage categories such as N1 and N2, effectively solving the data imbalance problem, and further improving the classification performance of the model.
[0142] In order to enable those skilled in the art to better understand the above steps, the present application is illustrated below by an example, but it should be understood that the embodiments of the present application are not limited to this.
[0143] like Figure 3 As shown, image acquisition can be performed, and multi-lead PSG data can be collected and preprocessed. In this example, each multi-lead PSG data contains a total of 32 channels of information to adapt to the screening and diagnosis of various sleep-related diseases, and the sampling frequency is 200 Hz. The present application considers 6 EEG channels (F3-A2, F4-A1, C3-A2, C4-A1, O1-A2, O2-A1) that are highly related to sleep staging, 2 EOG channels (LOC-A2, ROC-A2) and 1 EMG (Chin chin electromyography) channel. Therefore, the present application builds a model for different types of multiple channel data. In fact, in clinical practice, more channel lead information may be concerned about sleep staging, and the model in the invention is still applicable without too much adjustment. In particular, in the data preprocessing stage, the present application resamples the data to 100 Hz. In addition, in order to effectively alleviate category imbalance, in some embodiments, attention can be paid to only the 30-minute wakefulness period before and after the sleep period.
[0144] Taking the 380 multi-lead PSG data obtained as an example, it can be divided into training set, validation set and test set. The sleep stage classification model designed above is verified on the 30-case validation set. The following table 1 and Figure 4 The pre-experiment classification confusion matrix plot shows the pre-experiment results of this example.
[0145] Table 1 Preliminary experimental classification results in the embodiments of the present invention
[0146]
[0147] This example uses five common indicators of classification tasks to evaluate the performance of various sleep stage classification models, including recall, precision, F1, average accuracy (ACC) and macro F1 score (MF1). True positive rate of class ( ), false positive rate( )、True Negative Rate( ) and false negative rate , the overall accuracy ACC and MF1 are defined as follows:
[0148]
[0149]
[0150] After obtaining multi-lead PSG data, the automatic sleep classification model (i.e., sleep stage classification model) can be trained, wherein the feature extractor based on the multi-resolution convolutional neural network, i.e., the single-lead feature extractor, can first independently extract the features of each modal lead to obtain the single-lead signal features. Then, multiple single-lead signal features can be forward fused, and the Transformer encoder can model the importance of multiple features to the classification results to obtain multi-lead fusion features, which can then be automatically classified by the classifier.
[0151] In view of the good performance achieved on the test set, it can be known that the method proposed in this application has achieved a more efficient sleep stage classification effect. This application can also be integrated into an efficient sleep monitoring system based on the optimal model combined with servers, storage, etc., which can be deployed on the hospital's server to support doctors in labeling complex PSG data in clinical practice. By integrating a multi-channel PSG data processing model, the system does not only rely on a single recording channel, but makes full use of the information of multi-channel data to capture the patient's sleep characteristics more comprehensively and accurately.
[0152] In one embodiment, in order to further improve the usability of the system, an intelligent feedback mechanism is introduced to enable doctors to understand the basis of model decisions. This mechanism generates an interpretable report for each sleep stage prediction through model interpretation technology, highlighting the key features and basis of the model in each time segment, thereby helping doctors understand the decision-making process of the model.
[0153] In one embodiment, the sleep monitoring system of the present application also implements a dynamic learning and updating mechanism to adapt to individual changes in patients and different sleep conditions. The sleep monitoring system will finely mark each model decision error fragment marked by the doctor, and record the number of doctor modifications to determine the specific type of decision error. These detailed annotation information will be used to adjust the weight of the model and update the sleep stage classification model at a preset frequency, so that it can better learn and correct specific types of errors, thereby improving overall performance. The knowledge learned from the doctor's feedback is transferred to the model using the transfer learning method. By performing transfer learning under different patients and sleep conditions, the model can better adapt to the new data distribution, improve generalization performance, and avoid forgetting existing knowledge. This flexible learning mechanism helps to alleviate the performance degradation of the system under different patients and different sleep conditions, providing more reliable and stable support for clinical practice. At the same time, it can provide more comprehensive analysis and optimize the network model in real time to adapt to new data and situations. This loop feedback mechanism helps to continuously improve the performance and robustness of the model, making it more suitable for use in clinical practice, which is of great significance for improving the sleep state of the target object.
[0154] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0155] Based on the same inventive concept, the embodiment of the present application also provides a sleep stage classification device for implementing the sleep stage classification method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more sleep stage classification device embodiments provided below can refer to the limitations on the sleep stage classification method above, and will not be repeated here.
[0156] In an exemplary embodiment, Figure 5 As shown, a sleep stage classification device is provided, comprising:
[0157] A multi-lead signal acquisition module 501 is used to acquire multi-lead sleep monitoring signals;
[0158] A single-lead feature extraction module 502, used to respectively determine the single-lead signal features of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal;
[0159] A multi-lead feature extraction and fusion module 503 is used to obtain a multi-lead signal feature sequence according to the single-lead signal feature, and obtain a multi-lead fusion feature according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result;
[0160] The classification module 504 is used to determine the sleep stage classification result according to the multi-lead fusion features.
[0161] In one embodiment, the single-lead feature extraction module 502 is used to:
[0162] Respectively determining the frequency spectrum distribution characteristics of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal;
[0163] Determining at least one target frequency band distribution range related to the sleep stage type in the single-lead sleep monitoring signal according to the frequency spectrum distribution characteristics;
[0164] Inputting the single-lead sleep monitoring signal into at least one signal processing branch; the signal processing branch is provided with a convolution kernel whose size matches the target frequency band distribution range, and the sizes of the convolution kernels on different signal processing branches are different;
[0165] The single-lead sleep monitoring signal is convolved by the convolution kernel on each of the signal processing branches to obtain the convolution results of each of the signal processing branches, and the single-lead signal feature is determined according to each of the convolution results.
[0166] In one embodiment, the device further includes a convolution kernel size determination module, wherein the convolution kernel size determination module is used to:
[0167] Acquire the target frequency band distribution range related to the sleep stage type in the single-lead sleep monitoring signal;
[0168] For each of the target frequency band distribution ranges, a signal period corresponding to the target frequency band distribution range is determined, and a selected size is determined according to the signal period and the signal capture range corresponding to various candidate sizes of the convolution kernel.
[0169] In one embodiment, the multi-lead feature extraction and fusion module 503 is used to:
[0170] Determining a feature weight corresponding to each signal feature in the multi-lead signal feature sequence according to a correlation between each signal feature in the multi-lead signal feature sequence and a sleep stage classification result;
[0171] According to the feature weight corresponding to each signal feature in the multi-lead signal feature sequence, the multi-lead signal feature sequence is adjusted to obtain an adjusted multi-lead signal feature sequence;
[0172] The adjusted multi-lead signal feature sequence and the multi-lead signal feature sequence are fused, and a multi-lead fusion feature is determined according to the fusion result.
[0173] In one embodiment, the multi-lead feature extraction and fusion module 503 is used to:
[0174] Segmenting the multi-lead signal feature sequence according to the position codes corresponding to the signal features in the multi-lead signal feature sequence to obtain a plurality of subsequences in a time sequence;
[0175] Based on the dependency relationship and context relationship between the plurality of subsequences, determining the autocorrelation between each subsequence and each of the subsequences;
[0176] The correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result is determined according to the autocorrelation of each subsequence.
[0177] In one embodiment, the sleep stage classification result is determined by a classifier according to the multi-lead fusion feature, and the device further includes a classifier training module, wherein the classifier training module is used to:
[0178] Inputting the sample multi-lead fusion features corresponding to the sample multi-lead sleep monitoring signal into the classifier to be trained to obtain the classification probability of each of the multiple sleep stages;
[0179] Determine a classification loss value for each sleep stage according to the sleep stage classification label corresponding to the sample multi-lead sleep monitoring signal and the classification probability of each of the sleep stages;
[0180] Determining a loss weight for each of the sleep stages; the loss weight is negatively correlated with the distribution range of the sleep stages;
[0181] Determining a target loss value according to the loss weight of each of the sleep stages and the classification loss value of each of the sleep stages;
[0182] The parameters of the classifier are adjusted according to the target loss value until the training end condition is met to obtain the trained classifier.
[0183] In one embodiment, the multi-lead feature extraction and fusion module 503 is used to:
[0184] Perform multiple feature extractions on at least two of the single-lead signal features, and obtain a multi-lead signal feature sequence based on the result of the last feature extraction output; wherein, for feature extractions other than the first feature extraction, the input of the current feature extraction is obtained based on the result of the last feature extraction output.
[0185] Each module in the sleep stage classification device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0186] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store multi-lead sleep monitoring data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a sleep stage classification method is implemented.
[0187] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0188] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0189] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0190] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0191] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0192] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0193] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0194] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A sleep stage classification method, characterized in that: The method comprises: Acquire multi-lead sleep monitoring signals; Respectively determining the single-lead signal characteristics of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal; Obtaining a multi-lead signal feature sequence according to the single-lead signal feature, and obtaining a multi-lead fusion feature according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result; A sleep stage classification result is determined according to the multi-lead fusion features.
2. The method according to claim 1, characterized in that The step of respectively determining the single-lead signal features of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal comprises: Respectively determining the frequency spectrum distribution characteristics of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal; Determining at least one target frequency band distribution range related to the sleep stage type in the single-lead sleep monitoring signal according to the frequency spectrum distribution characteristics; Inputting the single-lead sleep monitoring signal into at least one signal processing branch; the signal processing branch is provided with a convolution kernel whose size matches the target frequency band distribution range, and the sizes of the convolution kernels on different signal processing branches are different; The single-lead sleep monitoring signal is convolved by the convolution kernel on each of the signal processing branches to obtain the convolution results of each of the signal processing branches, and the single-lead signal feature is determined according to each of the convolution results.
3. The method according to claim 2, characterized in that The size of the convolution kernel is determined by the following steps: Acquire the target frequency band distribution range related to the sleep stage type in the single-lead sleep monitoring signal; For each of the target frequency band distribution ranges, a signal period corresponding to the target frequency band distribution range is determined, and a selected size is determined according to the signal period and the signal capture range corresponding to various candidate sizes of the convolution kernel.
4. The method according to claim 1, characterized in that The step of obtaining a multi-lead fusion feature according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result includes: Determining a feature weight corresponding to each signal feature in the multi-lead signal feature sequence according to a correlation between each signal feature in the multi-lead signal feature sequence and a sleep stage classification result; According to the feature weight corresponding to each signal feature in the multi-lead signal feature sequence, the multi-lead signal feature sequence is adjusted to obtain an adjusted multi-lead signal feature sequence; The adjusted multi-lead signal feature sequence and the multi-lead signal feature sequence are fused, and a multi-lead fusion feature is determined according to the fusion result.
5. The method according to claim 4, characterized in that Before the step of determining the feature weight corresponding to each signal feature in the multi-lead signal feature sequence according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result, the step further includes: Segmenting the multi-lead signal feature sequence according to the position codes corresponding to the signal features in the multi-lead signal feature sequence to obtain a plurality of subsequences in a time sequence; Based on the dependency relationship and context relationship between the plurality of subsequences, determining the autocorrelation between each subsequence and each of the subsequences; The correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result is determined according to the autocorrelation of each subsequence.
6. The method according to claim 1, characterized in that The sleep stage classification result is determined by a classifier according to the multi-lead fusion features, and the classifier is trained through the following steps: Inputting the sample multi-lead fusion features corresponding to the sample multi-lead sleep monitoring signal into the classifier to be trained to obtain the classification probability of each of the multiple sleep stages; Determine a classification loss value for each sleep stage according to the sleep stage classification label corresponding to the sample multi-lead sleep monitoring signal and the classification probability of each of the sleep stages; Determining a loss weight for each of the sleep stages; the loss weight is negatively correlated with the distribution range of the sleep stages; Determining a target loss value according to the loss weight of each of the sleep stages and the classification loss value of each of the sleep stages; The parameters of the classifier are adjusted according to the target loss value until the training end condition is met to obtain the trained classifier.
7. The method according to any one of claims 1 to 6, characterized in that The step of obtaining a multi-lead signal feature sequence according to the single-lead signal feature comprises: Perform multiple feature extractions on at least two of the single-lead signal features, and obtain a multi-lead signal feature sequence based on the result of the last feature extraction output; wherein, for feature extractions other than the first feature extraction, the input of the current feature extraction is obtained based on the result of the last feature extraction output.
8. A sleep stage classification device, characterized in that: The device comprises: A multi-lead signal acquisition module, used to acquire multi-lead sleep monitoring signals; A single-lead feature extraction module, used to respectively determine the single-lead signal features of each single-lead sleep monitoring signal in the multi-lead sleep monitoring signal; A multi-lead feature extraction and fusion module, used to obtain a multi-lead signal feature sequence according to the single-lead signal feature, and obtain a multi-lead fusion feature according to the correlation between each signal feature in the multi-lead signal feature sequence and the sleep stage classification result; A classification module is used to determine a sleep stage classification result according to the multi-lead fusion features.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Electrocardiosignal atrial fibrillation detection system and method and electronic equipment
CN121040922A