Method for constructing sleep staging system based on self-attention mechanism and single-lead electrocardiogram signal, and sleep staging system
By introducing a self-attention mechanism in the sleep staging system, combining deep neural networks and single-lead ECG signals, the problem of ignoring the internal information correlation of sleep fragments in the prior art is solved, and higher sleep staging accuracy and low-load sleep monitoring are achieved.
Patent Information
- Application Number
- CN202210856900.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-20
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2042-07-20
AI Technical Summary
The existing sleep staging scheme based on artificial neural networks has the problem of ignoring the correlation of internal information of sleep fragments, resulting in low accuracy of sleep staging.
A deep neural network based on self-attention mechanism is adopted, combined with a single-lead electrocardiogram signal, spatial features are extracted through the CNN module, the Bi-GRU module extracts temporal features, and the self-attention mechanism module captures the internal information correlation of fragments, realizing automatic feature extraction and classification.
It improves the accuracy of sleep staging, enhances the model's ability to extract the timing characteristics of ECG signals, and meets the low-load sleep staging needs.
Smart Images

Figure CN115336973B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of sleep monitoring, and particularly relates to a method for constructing a sleep staging system based on a self-attention mechanism and single-lead electrocardiogram signals, and a sleep staging system. Background Art
[0002] One-third of a person's life is spent sleeping. The sleep process is very complex and is very important for the body's self-repair. Along with the gradual acceleration of the modern life rhythm, various pressures are affecting people's sleep states. Many people have problems with sleep pattern disorders and are troubled by difficulties in falling asleep and daytime sleepiness. Research has confirmed that lack of sleep can lead to various health problems, thus triggering various diseases, such as Alzheimer's disease, diabetes, etc. There are also cases where cancer occurs due to poor sleep conditions.
[0003] Research shows that there are certain periodic change rules in the human sleep process. Through the monitoring and analysis of electroencephalogram and eye movement during the human sleep process, people have studied the periodic change process of sleep and proposed the rules for human sleep staging, classifying sleep.
[0004] Accurate sleep staging can help people correctly understand their own sleep structure and further improve or enhance their sleep quality. Sleep staging is an important step in the diagnosis of sleep-related diseases. Clinically, sleep staging can assist doctors in analyzing and diagnosing sleep diseases and can also track and monitor the treatment effects of patients. Therefore, the research on sleep monitoring and sleep staging is of great significance.
[0005] In the medical sleep field, polysomnography is the "gold standard" for sleep monitoring research. Sleep experts divide sleep segments based on multi-channel bioelectrical signals such as electroencephalogram, electrooculogram, electromyogram, blood oxygen saturation, electrocardiogram (ECG), oronasal airflow, and thoracic and abdominal respiratory movements obtained by a polysomnograph to achieve sleep staging. Although polysomnography has high accuracy, it is cumbersome, time-consuming, and has low comfort. The research on low-load sleep staging schemes has important practical significance.
[0006] Research shows that the ECG signal, which can reflect the human body's autonomic nervous system, can better reflect the sleep state. With the continuous development of wearable physiological parameter monitoring devices, low-load sleep staging schemes are mostly based on ECG signals, respiratory signals, and ECG-derived signals such as instantaneous heart rate sequences. Implementing sleep staging based on manual marking or traditional machine learning methods is complex and inefficient. With the in-depth research of deep learning algorithms, deep neural networks have been widely used in sleep staging research, deeply extracting the coarse-grained and fine-grained features of signals, and using algorithms such as end-to-end convolutional neural networks, long short-term memory networks, and gated recurrent units to achieve automatic sleep staging. Deep neural networks have improved the sleep staging results due to their powerful ability to extract complex features and usually have higher classification accuracy, but there are still problems of ignoring the internal information correlation within segments. Summary of the Invention
[0007] The object of the present invention is to address the problem of ignoring the internal information correlation within sleep segments in the existing sleep staging schemes based on artificial neural networks, and to propose a method for constructing a sleep staging system and a sleep staging system based on the self-attention mechanism. This system can capture the internal correlation information within ECG signal segments, realize automatic feature extraction and classification, and meet the low-load sleep staging requirements.
[0008] The technical solution of the present invention is implemented as follows:
[0009] In one aspect of the embodiment, a method for constructing a sleep staging system based on the self-attention mechanism and single-lead ECG signals of the present application is as follows:
[0010] Construct a sleep staging system including a deep neural network, where the deep neural network includes a CNN module, a Bi-GRU module, a self-attention mechanism (SA) module, a BN module, and a fully connected layer connected in series in sequence;
[0011] Filter and zero-mean normalize the ECG signals with sleep staging labels, and segment them according to the sleep staging criteria. Multiple data segments form a training data set;
[0012] Use the training data set to train the deep neural network to complete the construction of the automatic sleep staging system.
[0013] Further, the deep neural network of the present invention includes 4 CNN modules, and the 4 CNN modules are connected in series in sequence. The deep neural network includes 2 Bi-GRU modules, and the 2 Bi-GRU modules are connected in series in sequence.
[0014] Further, the output vector of the SA module of the present invention is h i :
[0015]
[0016]
[0017] Among them, d k is the dimension of the key vector, is the input vector, q i is an element of the query vector sequence Q, k i is an element of the key vector sequence K, v j is an element of the value vector sequence V;
[0018] Q = W Q X
[0019] K = W K X
[0020] V = W V X
[0021] Among them, X represents the input vector of the SA module, W Q , W K and W V are parameter matrices to be learned respectively.
[0022] Furthermore, the sleep staging system of the present invention further includes a preprocessing module, which is connected to the input end of the deep neural network and is used to filter and zero-mean normalize the collected ECG signals, and segment the normalized data.
[0023] Furthermore, the output of the fully connected layer of the present invention is the probability distribution of the sleep staging stages, and the sleep staging stages include 4, namely: wakefulness period, rapid eye movement period, light sleep stage, and deep sleep stage.
[0024] On the other hand, an embodiment of the present application provides a sleep staging system based on self-attention mechanism and single-lead ECG signals, including: the system includes a physiological parameter monitoring device, an ECG preprocessing module, a CNN module, a Bi-GRU module, an SA module, and a sleep staging result output module;
[0025] The physiological parameter monitoring device is used to obtain single-lead ECG signals and input them into the CNN module;
[0026] The CNN module unit obtains the spatial features of the ECG signals;
[0027] The Bi-GRU module unit captures the internal correlation of the spatial features extracted by the CNN module, that is, captures the time features of the ECG signals;
[0028] The SA module unit scores the importance of the time features of the ECG signals output by each unit of the Bi-GRU at each moment, captures the internal information correlation of the segment, and outputs the corresponding feature vector;
[0029] The sleep staging result output unit includes a BN module and a fully connected layer, and outputs the probability distribution of the sleep staging based on the feature vector output by the SA module.
[0030] Furthermore, the output vector of the SA module of the present invention is h i :
[0031]
[0032]
[0033] Among them, d k is the key vector dimension, is the input vector, q i is the element of the query vector sequence Q, k i is the element of the key vector sequence K, v j is the element of the value vector sequence V;
[0034] Q=W Q X
[0035] K=W K X
[0036] V=W V X
[0037] Among them, X represents the input vector of the SA module, W Q , W K and W V The parameter matrices respectively.
[0038] Beneficial effects:
[0039] First, the present invention introduces the SA module to score the output importance of each Bi-GRU unit at each moment in a long sequence and capture the internal information correlation of the fragment. The Bi-GRU extracts the previous and next correlation characteristics of the sequence, but cannot highlight important information in the long sequence. The introduction of the scaled dot product SA module makes up for this shortcoming, automatically captures the correlation information within the long sequence, and enhances the model's ability to extract the timing features of the ECG signal.
[0040] Second, compared with the dot product model, the SA module of the present invention has an additional square root of the K dimension to play a regulatory role, so that the gradient has a more stable gradient during the training process.
[0041] Third, this application utilizes the powerful feature extraction capability of the Bi-GRU module to capture the internal correlation of features and obtain the temporal characteristics of ECG signals. The Bi-GRU network processes the ECG signals at the front and back ends through completely independent GRUs in two directions, and can deeply explore the bidirectional temporal structure information.
[0042] Fourth, the algorithm model constructed in this application is mainly composed of 4 convolutional CNN modules, 2 Bi-GRU modules, and 1 SA module. After using the one-dimensional CNN module to extract the spatial features of the ECG signal, the Bi-GRU module extracts the information related to the front and back of the sequence, and the SA module weights the importance of the output of the Bi-GRU at each moment to extract the relevant information of each unit of the sequence. This application deeply mines the time, space, and internal correlation features of the ECG signal, and realizes end-to-end automatic sleep staging based on the single-lead ECG signal, improving the accuracy of sleep staging. Description of the Drawings
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0044] Figure 1 It is a flowchart of the implementation of the automatic sleep staging method based on the self-attention mechanism and single-lead electrocardiogram signal of the present invention;
[0045] Figure 2 It is a flowchart of the algorithm model of the present invention;
[0046] Figure 3 It is a structural diagram of the Bi-GRU network of the present invention;
[0047] Figure 4 It is a structural diagram of the scaled dot-product attention mechanism of the present invention. Detailed Embodiments
[0048] The following will describe the embodiments of the present invention in detail with reference to the drawings.
[0049] It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other; and, based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present disclosure.
[0050] It should be noted that the following description relates to various aspects of embodiments within the scope of the appended claims. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on this disclosure, those skilled in the art should understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement a device and / or practice a method. Additionally, this device can be implemented and this method can be practiced using other structures and / or functionality in addition to one or more of the aspects described herein.
[0051] Aiming at the problem of ignoring the internal information correlation within sleep segments in the existing sleep staging scheme based on artificial neural networks, the present invention proposes an automatic sleep staging method based on self-attention mechanism and single-lead electrocardiogram (ECG) signals, which captures the internal correlation information of segments, realizes automatic feature extraction and classification, and meets the low-load sleep staging requirements.
[0052] A method for constructing a sleep staging system based on self-attention mechanism and single-lead ECG signals according to an embodiment of the present application has the following specific process:
[0053] Step 1: Construct a deep neural network;
[0054] As Figure 2 shown, construct a sleep staging system including a deep neural network, where the deep neural network includes a CNN module, a Bi-GRU module, a self-attention mechanism (SA) module, a BN module, and a fully connected layer connected in series in sequence;
[0055] In this embodiment, a deep neural network with 4 CNN modules 3, 2 Bi-GRU modules 4, and 1 SA module 5 is adopted, as Figure 2 shown; among them, the CNN module is used to extract the spatial feature sequence of the ECG signal, the Bi-GRU module is used to extract the information related to the front and back of the output sequence of the ECG module, that is, the temporal feature of the ECG signal, and the SA module is used to weight the importance of the temporal feature sequence output by each Bi-GRU unit at each moment to extract the relevant information of each unit of the sequence.
[0056] The key difference of the sleep staging method based on artificial neural network in this application is that the SA module unit 5 is adopted, which captures the internal temporal information and importance degree of the segment on the basis of the ECG segment features extracted by the traditional CNN structure, extracts features more fully, realizes automatic feature extraction and classification, and meets the low-load sleep staging requirements.
[0057] In the embodiments of this application, the CNN module and the Bi-GRU module adopted both use existing technologies. For the convenience of understanding, a brief description is given as follows:
[0058] (1) CNN module: Use a one-dimensional convolutional neural network as a feature extractor to obtain the spatial features of the ECG signal.
[0059] Each CNN module contains two convolutional layers (Convolution, Conv), and each convolutional layer uses a convolutional kernel with a size of 5 and a dimension of 12. Zero-padding is used to keep the size of the input feature map unchanged. A max-pooling layer (Max-Pooling) is used to reduce the feature dimension, improve the robustness of the extracted features, and alleviate overfitting. The pooling window for the model to perform max-pooling is a 3*3 matrix. During execution, the input is split into 3*3 regions, and the maximum element value in the region is output.
[0060] A dropout layer is connected after the last CNN module to turn off some neurons and their connections during the forward pass of the network, so as to improve the learning ability of the neurons and prevent overfitting.
[0061] A randomly generated probability vector r is introduced, which follows a Bernoulli distribution with parameter p. In the model, p is selected as 20%, that is, a parameter vector containing only 0 and 1 is randomly generated, and the neurons stop working with a probability value of 0.2.
[0062] (2) Bi-GRU module: It has strong feature extraction ability, captures the internal correlation of features, and obtains the temporal features of the ECG signal.
[0063] The Bi-GRU module contains two Bi-GRU layers, and the Bi-GRU structure is as Figure 3 shown. Each Bi-GRU layer contains forward and backward GRUs, and each GRU includes 12 memory units, extracting the front and back correlation information of the ECG sequence. The GRU network avoids the long-term dependence problem by adjusting the update gate to control the proportion of historical information in the new information, and has the ability to remember long-term information. The Bi-GRU module processes the ECG signals at both ends through two completely independent GRUs in different directions, deeply mining the bidirectional temporal structure information.
[0064] The final output h i ′ is jointly determined by the output h i f of the forward GRU and the output h i b of the backward GRU, and is calculated by the following formula (1), where "[]" represents the concatenation of two vectors, and σ is the activation function.
[0065] h i ′ = σ[hi f , h i b (1)
[0066] (3) SA module: Score the importance of the output of each moment unit of Bi - GRU in the long sequence to capture the internal information correlation of the segment.
[0067] Bi - GRU extracts the forward and backward correlation features of the sequence, but it cannot highlight important information in the long sequence. The introduction of the SA module makes up for this shortcoming, automatically captures the internal correlation information of the long sequence, and enhances the model's ability to extract the temporal features of ECG signals.
[0068] The SA (attention mechanism) model can be macroscopically understood as a mapping from a query (Query, Q) to a series of key - value (Key - Value, K - V) pairs. Essentially, it is a weighted sum of the Vs of the source data elements, and Q and K are used to calculate the weight coefficients for the corresponding Vs. For the self - attention mechanism, the three matrices of the query vector sequence Q, the key vector sequence K, and the value vector sequence V all come from the same input, and the signal has the same dimension before and after passing through the self - attention mechanism.
[0069] Calculate the weight coefficients according to Q and K. To prevent the dot - product result between Q and K from being too large and causing the softmax function to enter the region without gradient, the model adopts the scaled dot - product attention model, and the structure is as Figure 4 shown. It divides by the square root of the K dimension more than the dot - product model to play a regulating role, making the training process have a more stable gradient. Use the softmax function to normalize its result into a probability distribution, and then multiply by the matrix V to obtain the weighted sum representation.
[0070] Use X = [x1, x2, …, x n to represent N input information, and Q, K, and V are obtained through the linear transformations shown in equations (2) - (4), where W Q , W K and W V are learnable parameter matrices respectively, and the output sequence is H = [h1, h2, …, h n with the same length as the input X.
[0071] Q = W Q X (2)
[0072] K = W K X (3)
[0073] V = W V X (4)
[0074] The output vector h iThe calculation is as shown in Equation (5). Where i, j ∈ [1, N], which are the positions of the output and input vector sequences; s(k i , q i ) is the attention scoring function, and d k is the dimension of the key vector, which is 24 in the model.
[0075]
[0076]
[0077] Batch Normalization (BN) is introduced at the end of the deep neural network, which enables the model to have a faster training and convergence speed, and also alleviates the overfitting problem to a certain extent.
[0078] After BN, the output result is unfolded and fed into the Dense layer. The output of the Dense layer is the probability distribution of various sleep categories.
[0079] The sleep staging phases include wakefulness, rapid eye movement (REM) phase, and non-rapid eye movement phase (including S1, S2, S3, and S4 stages). In this specification, the sleep stages are classified into four categories. Therefore, S1 and S2 are combined and labeled as the light sleep stage, and S3 and S4 are combined and labeled as the deep sleep stage. That is, the sleep stages in this application include wakefulness, REM, light sleep stage, and deep sleep stage.
[0080] Step 2: Filter and zero-mean normalize the ECG signals with sleep staging labels, and segment the normalized data according to the sleep staging criteria. Multiple non-overlapping data segments form the training dataset;
[0081] In this embodiment, according to the sleep staging criteria, the normalized ECG data is divided into a segment every 30s to form multiple non-overlapping segment sets, and then the data in the segment sets is further divided into the training dataset according to a certain ratio.
[0082] In this embodiment, the training dataset can be constructed by the subject wearing a physiological parameter monitoring device to collect the single-lead ECG signals during the subject's sleep and the sleep staging labels with the same time stamp.
[0083] In this embodiment, after preprocessing the data in the dataset, it is segmented into non-overlapping training sets and test sets. 70% of the data is used for training, and 30% of the data is used for testing.
[0084] Step 3: Train the deep neural network with the training dataset to complete the construction of the automatic sleep staging system.
[0085] An embodiment of the present application provides a sleep staging system based on self-attention mechanism and single-lead electrocardiogram (ECG) signals, as Figure 1 shown. The system includes a physiological parameter monitoring device 1, an ECG preprocessing module 2, a CNN module 3, a Bi-GRU module 4, an SA module 5, and a sleep staging result output module 6. Among them,
[0086] The physiological parameter monitoring device 1 is used to obtain single-lead ECG signals and sleep staging labels with the same time stamp to construct a data set;
[0087] In this embodiment, the physiological parameter monitoring device can be a portable wearable device, such as a wearable bracelet, etc. During data collection, the device is worn on the corresponding part of the subject's body, and single-lead ECG signals of the subject are collected during the subject's sleep.
[0088] The ECG preprocessing unit 2 is used to filter and zero-mean normalize the collected ECG signals; the normalized data is segmented.
[0089] The CNN module unit 3, as a feature extractor, obtains the spatial features of the ECG signals;
[0090] The Bi-GRU module unit 4 captures the internal correlation of the spatial features extracted by the CNN module, that is, captures the time features of the ECG signals;
[0091] The SA module unit 5 scores the importance of the time features of the ECG signals output by each Bi-GRU unit at each moment, and captures the internal information correlation of the segment;
[0092] The sleep staging result output unit 6 is used to output the final sleep staging result.
[0093] The effects of the embodiment of the present application are as follows:
[0094] First, the algorithm model constructed in the present application is mainly composed of 4 Convolutional Neural Networks (CNN) modules, 2 Bidirectional Gated Recurrent Unit (Bi-GRU) modules, and 1 Self-Attention (SA) module. After using the one-dimensional CNN module to extract the spatial features of the ECG signals, the Bi-GRU module extracts the information related to the front and back of the sequence, and the SA module weights the importance of the output of each Bi-GRU at each moment to extract the relevant information of each unit of the sequence. The present application deeply excavates the time, space, and internal correlation features of the ECG signals, and realizes end-to-end automatic sleep staging based on single-lead ECG signals, improving the accuracy of sleep staging.
[0095] Second, this application utilizes the Bi-GRU module: It has a powerful feature extraction ability, captures the internal correlation of features, and obtains the temporal features of the ECG signal. The Bi-GRU network processes the ECG signals at both ends through two completely independent GRUs in different directions, and deeply explores the bidirectional temporal structure information.
[0096] Third, this application utilizes the SA module: It scores the importance of the output of each time unit of the Bi-GRU in a long sequence, and captures the internal information correlation of the segment. The Bi-GRU extracts the forward and backward correlation features of the sequence, but it cannot highlight important information in a long sequence. The introduction of the scaled dot-product self-attention module makes up for this shortcoming, automatically captures the internal correlation information of the long sequence, and enhances the model's ability to extract the temporal features of the ECG signal.
[0097] Example:
[0098] Dataset: The experimental data uses the Sleep Heart Health Study (SHHS) database provided by the sleep data website (website: https: / / www.sleepdata.org). The data in this database was collected by the Sleep Heart Health Coordination Center of Johns Hopkins University at different times, and it contains two datasets, SHHS1 and SHHS2. The ECG was sampled at 125 Hz in SHHS1 and at 250 Hz in SHHS2. The above datasets are labeled with six sleep stages, including wake, REM, S1, S2, S3, and S4 stages. The study classifies the sleep stages into four categories, so S1 and S2 are combined and labeled as the Light Sleep stage, and S3 and S4 are combined and labeled as the Deep Sleep stage. Data from 100 subjects in SHHS2 was randomly selected for a non-independent subjects study.
[0099] Test results: The multi-class cross-entropy function is used as the loss function to achieve four-class classification of sleep segments. 70% of the sleep dataset is used for training, 30% for testing, the learning rate is set to 0.0001, the batch size is set to 128, and the number of epochs is set to 500. After multiple rounds of iteration, the accuracy and loss values gradually converge and tend to be stable.
[0100] The comparison of the overall classification results of the algorithm of the present invention, the CNN-BiGRU model without SA, and several machine learning model algorithms is shown in Table 1. The deep neural network algorithm based on the self-attention mechanism proposed in the present invention has improved in terms of the overall classification accuracy (Accuracy, Acc), precision (Precision, P), recall (Recall, R), F1 value (F1-Score), and correlation coefficient (Kappa) for sleep staging based on single-lead electrocardiogram signals compared to other classification algorithms. The four-classification accuracy and Kappa coefficient are 81.54% and 0.66 respectively, which are better than the sleep staging results of the machine learning algorithm based on artificial traditional features, verifying the effectiveness of the proposed model.
[0101] Table 1 Comparison of overall sleep staging results
[0102]
[0103] In summary, the above are only the preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for constructing a sleep staging system based on self-attention mechanism and single-lead electrocardiogram signals, characterized in that, The specific process is as follows: Construct a sleep staging system including a deep neural network, where the deep neural network includes a CNN module, a Bi-GRU module, a self-attention mechanism SA module, a BN module, and a fully connected layer connected in series in sequence; Filter and zero-mean normalize the ECG signals with sleep staging labels, and segment them according to the sleep staging criteria. Multiple data segments constitute the training dataset; Use the training dataset to train the deep neural network to complete the construction of the automatic sleep staging system; The deep neural network includes 4 CNN modules, and the 4 CNN modules are connected in series in sequence. The deep neural network includes 2 Bi-GRU modules, and the 2 Bi-GRU modules are connected in series in sequence; The output vector of the SA module is h i : Among them, d k is the key vector dimension, is the input vector, q i is an element of the query vector sequence Q, k i is an element of the key vector sequence K, v j is an element of the value vector sequence V; Q = W Q X K = W K X V = W V X Among them, X represents the input vector of the SA module, and W Q , W K and W V are parameter matrices to be learned respectively.
2. The method for constructing a sleep staging system based on the self-attention mechanism and single-lead electrocardiogram signals according to claim 1, wherein The sleep staging system further includes a preprocessing module, which is connected to the input end of the deep neural network and is used to filter and zero-mean normalize the collected ECG signals, and segment the normalized data.
3. The method for constructing a sleep staging system based on a self-attention mechanism and single-lead electrocardiogram signals according to claim 1, wherein The output of the fully connected layer is the probability distribution of the sleep staging stages. The sleep staging stages include 4, namely: wakefulness period, rapid eye movement period, light sleep stage, and deep sleep stage.
4. A sleep staging system based on self-attention mechanism and single-lead electrocardiogram signals, characterized in that, Including: The system includes a physiological parameter monitoring device, an ECG preprocessing module, a CNN module, a Bi-GRU module, an SA module, and a sleep staging result output module; The physiological parameter monitoring device is used to obtain single-lead ECG signals and input them into the CNN module; The CNN module unit obtains the spatial features of the ECG signals; The Bi-GRU module unit captures the internal correlation of the spatial features extracted by the CNN module, that is, captures the temporal features of the ECG signals; The SA module unit scores the importance of the temporal features of the ECG signals output by each moment unit of the Bi-GRU, captures the internal information correlation of the segment, and outputs the corresponding feature vector; The sleep staging result output unit includes a BN module and a fully connected layer, and outputs the probability distribution of sleep staging based on the feature vector output by the SA module; The output vector of the SA module is h i : Among them, d k is the key vector dimension, is the input vector, q i is an element of the query vector sequence Q, k i is an element of the key vector sequence K, v j is an element of the value vector sequence V; Q = W Q X K = W K X V = W V X Among them, X represents the input vector of the SA module, and W Q , W K and W V are parameter matrices respectively.
Citation Information
Patent Citations
Sleep staging method based on deep residual Mask-CCNN
CN112294342A
Automatic sleep staging and migration method based on deep neural network
CN112869711A