Automatic sleep staging method and device for single-lead electrocardiogram

Through the processing of single-lead electrocardiogram signals, including short-term Fourier transform and heart rate variability feature extraction, input to the sleep stage classification model for classification identification, it solves the problem of difficulty in collecting polysomnography and EEG in the existing technology, realizes automatic sleep staging in daily life, reduces the difficulty of collection and memory requirements, and achieves efficient detection results.

CN119498779APending Publication Date: 2025-02-25SHENZHEN POLYTECHNIC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411549799.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In the prior art, physiological signals such as polysomnography and electroencephalography are difficult to collect in daily life, and most sleep staging methods cannot be applied to daily monitoring.

Method used

A single-lead electrocardiogram signal is used to obtain the electrocardiogram segment, perform short-term Fourier transformation and heart rate variability feature extraction, and input the sleep stage classification model for classification and identification to achieve automatic sleep staging.

Benefits of technology

It reduces the difficulty of signal acquisition and the memory requirements of the deployment platform, realizes automatic sleep installment in daily life, makes up for the insufficient information contained in the ECG signal, and achieves advanced detection levels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119498779A_ABST
    Figure CN119498779A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of physiological signal processing, and discloses an automatic sleep staging method and device for a single-lead electrocardiogram. The method specifically comprises the following steps: acquiring an electrocardiogram segment of a current sleep stage based on an electrocardiosignal, wherein the electrocardiosignal can be collected at home; performing short-time Fourier transform on the electrocardiogram segments to obtain a time-frequency graph; and acquiring heart rate variability characteristics of the electrocardiogram segments. And inputting the electrocardiogram segment, the time-frequency graph and the heart rate variability characteristics into a sleep stage classification model, and performing classification and identification of the sleep stage. Sleep staging can be realized only by using the electrocardiosignal, and only the electrocardiosignal at the current stage needs to be processed, so that the difficulty of signal acquisition and the requirement of a deployment platform on a memory are reduced. Besides, the sleep stage is judged on the basis of electrocardiogram segments, time-frequency diagrams and heart rate variability characteristics, the problem that information contained in electrocardiosignals is insufficient is solved to a certain extent, and daily detection can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of physiological signal processing, and in particular to an automatic sleep staging method and device for a single-lead electrocardiogram. Background Art

[0002] Sleep is a basic physiological need that is influenced by the interaction between the homeostatic system and the circadian rhythm system. Generally speaking, humans spend 1 / 3 of their lives sleeping, but with the increase of social pressure, sleep-related diseases and disorders are affecting more and more people in modern society. What is more noteworthy is that the public ignores sleep problems. The latest survey shows that 85.37% of the patients with sleep problems surveyed said they have never sought help from a doctor.

[0003] Modern medicine has discovered that violations of rhythm often lead to diabetes, cardiovascular diseases, etc. At the same time, this rhythm disorder is closely related to emotional diseases such as depression and sleep disorders. Diseases such as rhythm disorders and sleep apnea will be reflected in special sleep structures, so when diagnosing, trained sleep experts are often required to perform sleep staging based on polysomnography to further diagnose the disease. This work takes a lot of time and is easily affected by the subjective factors of the physician. At the same time, professional institutions such as hospitals cannot meet the daily monitoring of a large number of people due to limited throughput. In view of the above reasons, it is of great significance to develop a method for automatic sleep staging based on easily collected physiological signals.

[0004] The current gold standard for sleep rules is the five-stage classification (N3RW) established by the American Academy of Sleep Medicine (AASM), which divides sleep into five stages: N3, N2, N1, Rapid Eye Movement (REM), and wakefulness. Other common methods include combining N2 and N1 into light sleep and defining N3 as four stages of deep sleep (DLRW), classifying N3, N2, and N1 into three stages of non-rapid eye movement (NREM) (NRW), and two stages (SW) that only distinguish between sleep and wakefulness. Each rule has different applicable scenarios. The five-stage classification can be used for clinical diagnosis, the three-stage and four-stage classification can be used for daily monitoring, and the two-stage classification can be used for the diagnosis of obstructive sleep apnea hypopnea syndrome.

[0005] The current automatic sleep staging method mainly uses deep learning models to extract high-dimensional features and then automatically staging sleep. Different algorithms target different physiological signals. The main signals currently used include: 1) Polysomnography: Polysomnography is widely used because it is the gold standard for sleep staging and contains rich information. However, it cannot be used in daily life because of its difficulty in acquisition and too many leads affecting sleep comfort, so it is often used in clinical practice. 2) Electroencephalogram: Since the number of leads required to acquire an electroencephalogram is much less than that of a polysomnogram and the electroencephalogram has obvious characteristics at different sleep stages, many methods choose to develop algorithms based on electroencephalograms. However, when acquiring an electroencephalogram, it is necessary to use conductive paste or saline to moisten the hair, which will cause discomfort during sleep and is not suitable for long-term monitoring. Summary of the invention

[0006] The present application provides an automatic sleep staging method for a single-lead electrocardiogram to solve the problem in the prior art that physiological signals such as polysomnograms and electroencephalograms are difficult to collect in daily life and most existing sleep staging methods cannot be applied to daily monitoring.

[0007] Correspondingly, the present application also provides an automatic sleep staging device for a single-lead electrocardiogram, an electronic device, and a computer-readable storage medium to ensure the implementation and application of the above method.

[0008] In order to solve the above technical problems, the present application discloses an automatic sleep staging method for a single-lead electrocardiogram, the method comprising:

[0009] Based on the ECG signal, obtain the ECG segment of the current sleep stage;

[0010] Perform short-time Fourier transform on the ECG segments to obtain time-frequency diagrams;

[0011] Obtaining heart rate variability characteristics of electrocardiogram segments;

[0012] Input the electrocardiogram segments, time-frequency diagrams and heart rate variability features into the sleep stage classification model to classify and identify the sleep stages;

[0013] Among them, the sleep stage classification model is built based on multi-layer perceptron, convolutional neural network and long short-term memory network.

[0014] Preferably, obtaining an electrocardiogram segment of the current sleep stage based on the electrocardiogram signal includes:

[0015] Use filters to remove noise from ECG signals;

[0016] The denoised ECG signals were segmented into multiple 30-second segments according to the sleep staging rules developed by AASM;

[0017] Determine the ECG segment of the current sleep stage from multiple 30-second segments.

[0018] Preferably, the heart rate variability features include time domain features and frequency domain features;

[0019] The time domain features include the mean heart beat interval, the standard deviation of the heart beat interval, and the percentage of RR intervals greater than 50ms;

[0020] Frequency domain features include low frequency energy, high frequency energy, total power, and high-to-low frequency power ratio.

[0021] Preferably, obtaining the heart rate variability feature of the electrocardiogram segment includes:

[0022] The frequency domain characteristics of heart rate variability are obtained through the Lomb-Scargle algorithm;

[0023] The R wave of the electrocardiogram segment was located by Pan-Tompkins algorithm, and the RR was analyzed by statistical analysis. i The differences between the intervals are used to obtain the time domain characteristics of heart rate variability.

[0024] Preferably, the R wave of the electrocardiogram segment is located by the Pan-Tompkins algorithm, and the RR is analyzed by statistical analysis. i The differences between the intervals are used to obtain the time domain characteristics of heart rate variability, including:

[0025] Perform R wave enhancement and R wave decision processing on the ECG segment to achieve R wave positioning;

[0026] Based on R wave positioning, RR was analyzed by statistical analysis i The difference between the intervals is used to obtain the time domain characteristics of heart rate variability;

[0027] Among them, the R wave decision processing methods include sliding average window, R wave detection, backtracking mechanism, and R wave positioning in sequence; the backtracking mechanism is set so that the normal R wave amplitude is not lower than the threshold.

[0028] Preferably, the sleep stage classification model includes a first network module corresponding to the electrocardiogram segment, a second network module corresponding to the time-frequency graph, and a third network module corresponding to the heart rate variability feature;

[0029] The first network module includes one-dimensional convolution, long short-term memory network, maximum pooling layer and linear layer;

[0030] The second network module includes a two-dimensional convolutional layer, a maximum pooling layer, and a linear layer;

[0031] The third network module includes a multilayer perceptron consisting of three linear layers and a ReLU activation function.

[0032] Preferably, the sleep stage classification model uses a Focal Loss loss function to calculate the loss value.

[0033] The present application also discloses an automatic sleep staging device for a single-lead electrocardiogram, the device comprising:

[0034] A data acquisition module, used for acquiring an electrocardiogram segment of the current sleep stage based on the electrocardiogram signal;

[0035] A data processing module is used to perform short-time Fourier transform on the electrocardiogram segments to obtain a time-frequency diagram;

[0036] The data processing module is also used to obtain the heart rate variability characteristics of the electrocardiogram segment;

[0037] A classification and recognition module is used to input the electrocardiogram segments, time-frequency diagrams and heart rate variability features into the sleep stage classification model to classify and recognize the sleep stages;

[0038] Among them, the sleep stage classification model is built based on multi-layer perceptron, convolutional neural network and long short-term memory network.

[0039] The present application also discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, one or more methods described in the present application are implemented.

[0040] The present application also discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, one or more methods described in the present application are implemented.

[0041] In the present application, an ECG segment of the current sleep stage is obtained based on the ECG signal, wherein the ECG signal can be collected at home. The ECG segment is subjected to a short-time Fourier transform to obtain a time-frequency diagram; and the heart rate variability characteristics of the ECG segment are obtained. The ECG segment, the time-frequency diagram, and the heart rate variability characteristics are input into a sleep stage classification model to classify and identify the sleep stage. In the present application, sleep staging can be achieved using only ECG signals, and only the ECG signal of the current stage needs to be processed, which not only reduces the difficulty of signal acquisition, but also reduces the memory requirements of the deployment platform. In addition, the present application uses a sleep stage classification model to jointly judge the sleep stage based on the ECG segments, the time-frequency diagram, and the heart rate variability characteristics, which to a certain extent makes up for the problem of insufficient information contained in the ECG signal, and has achieved an advanced level in verification, which can meet daily detection.

[0042] Additional aspects and advantages of the present application will be given in the following description, which will become apparent from the following description, or will be understood through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0044] Figure 1 A flow chart of an automatic sleep staging method for a single-lead electrocardiogram provided in an embodiment of the present application;

[0045] Figure 2 A flowchart of automatic sleep staging based on electrocardiogram provided in an embodiment of the present application;

[0046] Figure 3 A structural diagram of a sleep stage classification model provided in an embodiment of the present application;

[0047] Figure 4 A flow chart of the Pan-Tompkins algorithm provided in the embodiment of the present application;

[0048] Figure 5 A schematic diagram of the structure of an automatic sleep staging device for a single-lead electrocardiogram provided in an embodiment of the present application;

[0049] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.

[0051] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0052] Those skilled in the art will appreciate that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the field to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.

[0053] The solution provided in the embodiments of the present application can be executed by any electronic device, such as a terminal device or a server, wherein the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application does not limit this. With regard to the technical problems existing in the prior art, the automatic sleep staging method and device for a single-lead electrocardiogram provided in this application is intended to solve at least one of the technical problems of the prior art.

[0054] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0055] With the development of radio frequency (RF) vital sign sensing technology, ECG and respiratory signals can now be collected through radar or WIFI. These methods do not require physical connection with the monitoring target and therefore do not cause discomfort. Currently, there are few methods that use them alone for sleep staging, because although they contain less physiological information than polysomnography and electroencephalography, their information is sufficient for daily testing.

[0056] The present application embodiment provides a possible implementation method, such as Figure 1 As shown, a flowchart of an automatic sleep staging method for a single-lead electrocardiogram is provided, and the scheme can be executed by any electronic device, and optionally, can be executed on a server or a terminal device.

[0057] like Figure 1 As shown in , the method may include the following steps:

[0058] Step 101: Obtain an electrocardiogram segment of the current sleep stage based on the electrocardiogram signal.

[0059] Among them, ECG signals can be collected at home, so the method of sleep staging based on ECG signals can be more easily deployed in systems such as smart homes to achieve long-term monitoring of sleep. Unlike other methods that require the construction of a direct relationship between multiple sleep stages for judgment, the embodiment of the present application only needs to process the ECG segment of the current sleep stage, which can reduce the difficulty of signal collection and the memory requirements of the deployment platform.

[0060] Step 102: Perform short-time Fourier transform on the electrocardiogram segment to obtain a time-frequency diagram.

[0061] The frequency of the ECG signal often changes over time in terms of its statistical characteristics. Therefore, a single description of time or frequency is not sufficient to provide a comprehensive analysis of the ECG signal. Therefore, the embodiment of the present application obtains the time-frequency diagram of the ECG signal by short-time Fourier transform (STFT) to obtain the characteristics of the frequency and phase of the local signal changing over time.

[0062] Step 103: Acquire the heart rate variability characteristics of the electrocardiogram segment.

[0063] Step 104: input the electrocardiogram segments, the time-frequency diagram and the heart rate variability features into a sleep stage classification model to classify and identify the sleep stages.

[0064] The sleep stage classification model is built based on a multi-layer perceptron, a convolutional neural network (CNN) and a long short-term memory (LSTM). LSTM can maintain the global time domain information of the ECG signal, and when used in conjunction with CNN, LSTM can associate the time series of convolutional features, overcoming the limitations of small receptive fields and weak mutual information.

[0065] In an embodiment of the present application, features of different perspectives are extracted through a sleep stage classification model, and finally different weights are assigned to features of different perspectives through attention mechanism learning. After splicing, they are input into a classification network to achieve classification and recognition of sleep stages.

[0066] In an embodiment of the present application, an ECG segment of the current sleep stage is obtained based on an ECG signal, wherein the ECG signal can be collected at home. A short-time Fourier transform is performed on the ECG segment to obtain a time-frequency diagram; and the heart rate variability characteristics of the ECG segment are obtained. The ECG segment, the time-frequency diagram, and the heart rate variability characteristics are input into a sleep stage classification model to classify and identify the sleep stage. In the present application, sleep staging can be achieved using only ECG signals, and only the ECG signal of the current stage needs to be processed, which not only reduces the difficulty of signal acquisition, but also reduces the memory requirements of the deployment platform. In addition, the embodiment of the present application uses a sleep stage classification model to jointly judge the sleep stage based on the ECG segment, the time-frequency diagram, and the heart rate variability characteristics, which to a certain extent makes up for the problem of insufficient information contained in the ECG signal, and has achieved an advanced level in verification, which can meet daily detection.

[0067] In an optional embodiment, obtaining an electrocardiogram segment of the current sleep stage based on the electrocardiogram signal includes:

[0068] Use filters to remove noise from ECG signals;

[0069] The denoised ECG signals were segmented into multiple 30-second segments according to the sleep staging rules developed by AASM;

[0070] Determine the ECG segment of the current sleep stage from multiple 30-second segments.

[0071] For example, Figure 2 As shown, in the embodiment of the present application, a filter is first used to filter the ECG signal to reduce the influence of power frequency interference, myoelectric noise, baseline drift and other noises, and then the denoised ECG signal is divided into 30-second segments according to the sleep staging rules formulated by AASM, and then the ECG segment of the current sleep stage is selected for subsequent processing. The reason for selecting 30 seconds as the segment length is that the gold standard of the current sleep staging rules defines the duration of a sleep stage as 30 seconds.

[0072] In terms of filter selection, the embodiment of the present application uses a bandpass filter and a notch filter. The bandpass filter is composed of two third-order Butterworth filters: a high-pass filter with a cutoff frequency of 0.5Hz and a low-pass filter with a cutoff frequency of 70Hz. The notch filter is mainly used to suppress power frequency interference and can be divided into two types: one is 50Hz power frequency noise, with a frequency band range of 49Hz to 51Hz; the other is 60Hz power frequency noise, with a frequency band range of 59Hz to 61Hz.

[0073] In an optional embodiment, if Figure 2 As shown, the electrocardiogram segments are short-time Fourier transformed to obtain the time-frequency diagram. The specific implementation process is as follows:

[0074] The electrocardiogram segments are divided into several time windows by short-time Fourier transform, and the signal of each window is called a frame. Each frame signal can be considered as a stationary signal. The signal of each window is Fourier transformed separately to obtain the spectrum of the time window. Finally, the spectrum of each time window is arranged in chronological order to form a time-frequency diagram, which shows the change of the frequency of the signal over time. The short-time Fourier transform parameters designed in the embodiment of the present application are that the length of each time window is 256 sampling points, the overlapping length between windows is 128 sampling points, and the Hanning window is selected in the window function to smooth the signal. When performing Fourier transform in the time window, 512 points are used for calculation.

[0075] In an optional embodiment, the heart rate variability feature includes a time domain feature and a frequency domain feature;

[0076] The time domain features include the mean heart beat interval, the standard deviation of the heart beat interval, and the percentage of RR intervals greater than 50ms;

[0077] Frequency domain features include low frequency energy, high frequency energy, total power, and high-to-low frequency power ratio.

[0078] In an optional embodiment, if Figure 2 As shown, the heart rate variability characteristics of the electrocardiogram segment are obtained, including:

[0079] The frequency domain characteristics of heart rate variability are obtained through the Lomb-Scargle algorithm;

[0080] The R wave of the electrocardiogram segment was located by Pan-Tompkins algorithm, and the RR was analyzed by statistical analysis. i The differences between the intervals are used to obtain the time domain characteristics of heart rate variability.

[0081] ECG signals often show volatility in the time domain, and it is incomplete to analyze them only on a time scale. Therefore, the embodiment of the present application obtains the frequency domain characteristics of heart rate variability through the Lomb-Scargle method. The core of this method is to analyze the spectral characteristics of time series data by fitting sine waves. Specifically, it represents the signal as a combination of sine functions and calculates the similarity between the signal and these sine functions, thereby accurately determining the frequency components of the signal. Exemplarily, the specific steps are as follows:

[0082] a) Define the frequency range to be searched [f min ,f max ] and frequency resolution f res For ECG signals, a heart rate of 30 beats per minute covers the physiological heart rate range of almost all humans, so the present application embodiment will minSet to 0.5Hz, which also corresponds to the cutoff frequency of the filter. According to the Nyquist theorem, the highest frequency cannot exceed half of the sampling rate. The sampling rate of the present embodiment of the application when collecting ECG signals is 128Hz, the Nyquist frequency is 68Hz, and the main components of the ECG signals are concentrated within 40Hz, so the present embodiment of the application sets f max Set to 40Hz. Frequency resolution f res Mainly according to the time period setting, the time period T in the embodiment of the present application is 30 seconds. We can calculate f res =0.033Hz.

[0083] b) Calculate the power spectrum. For each frequency f, calculate its power spectrum P(f). The specific formula is (1), w i is the weight parameter, is the weighted average of the observed values, y i is the time t i For the observation result of the ECG signal, ω=2πf, τ is the time delay, and its calculation formula is formula (3), which can be derived according to formula (2).

[0084]

[0085] c) Find peaks in the calculated power spectrum to correspond to possible periodic signals in the data. The location of the peak corresponds to the period of the signal, and the height is used to determine the significance of the periodic signal.

[0086] d) Significance verification: used to determine whether the signal is a real periodic component rather than random noise. In the embodiment of the present application, the significance level is set to 0.05, and the maximum power value detected is calculated. If the p value is lower than the preset 0.05, the periodic signal is considered significant.

[0087] The frequency domain features and their details selected in the embodiment of this application are shown in Table 1:

[0088] Table 1 Frequency domain characteristics of heart rate variability and their physiological significance

[0089]

[0090]

[0091] In an optional embodiment, the R wave is located on the electrocardiogram segment by using the Pan-Tompkins algorithm, and the RR is statistically analyzed. i The differences between the intervals are used to obtain the time domain characteristics of heart rate variability, including:

[0092] Perform R wave enhancement and R wave decision processing on the ECG segment to achieve R wave positioning;

[0093] Based on R wave positioning, RR was analyzed by statistical analysis i The difference between the intervals is used to obtain the time domain characteristics of heart rate variability;

[0094] Among them, the R wave decision processing methods include sliding average window, R wave detection, backtracking mechanism, and R wave positioning in sequence; the backtracking mechanism is set so that the normal R wave amplitude is not lower than the threshold.

[0095] The Pan-Tompkins algorithm is an adaptive QRS complex wave detection algorithm developed by Pan and Tompkins et al. in 1985. It mainly includes two parts: R wave enhancement and R wave decision. The algorithm flow is as follows: Figure 4 As shown in the figure, the electrocardiogram (ECG) signal undergoes R wave enhancement and R wave decision, and finally realizes R wave positioning. The R wave enhancement process is to filter and reduce noise on the ECG signal, and then further highlight the slope of the QRS wave through differential operation, which helps to strengthen the characteristics of the QRS wave. Squaring the differentiated signal can more obviously enhance the visibility of the QRS wave.

[0096] The process of performing R wave decision processing on the signal after R wave enhancement processing is to smooth the signal by applying a sliding average window, and then detect the R wave position through R wave detection and backtracking mechanism. The embodiment of the present application introduces a backtracking mechanism when using the Pan-Tompkins algorithm: the normal R wave amplitude should not be lower than the threshold. Specifically, the threshold is set to 60% of the average amplitude, that is, the normal R wave amplitude should not be lower than 60% of the average amplitude. The accuracy of R wave decision can be improved by the backtracking mechanism. The backtracking mechanism of the embodiment of the present application effectively avoids the problem of false R waves at the beginning and end of the signal caused by the 30-second time window splitting the signal.

[0097] RR i The difference between the intervals is the difference between adjacent R waves. In the present embodiment, the RR is statistically analyzed. i The differences between the intervals are finally used to obtain the time domain characteristics of heart rate variability.

[0098] The time domain features of heart rate variability selected in the embodiment of the present application are shown in Table 2:

[0099] Table 2 Time domain characteristics of heart rate variability and their physiological significance

[0100]

[0101]

[0102] In an optional embodiment, the sleep stage classification model includes a first network module corresponding to the electrocardiogram segment, a second network module corresponding to the time-frequency graph, and a third network module corresponding to the heart rate variability feature;

[0103] The first network module includes one-dimensional convolution, long short-term memory network, maximum pooling layer and linear layer;

[0104] The second network module includes a two-dimensional convolutional layer, a maximum pooling layer, and a linear layer;

[0105] The third network module includes a multilayer perceptron consisting of three linear layers and a ReLU activation function, wherein there are two activation functions, which are respectively set after the first two linear layers.

[0106] like Figure 2 and Figure 3 As shown, Model A represents the first network model, Model B represents the second network model, and Model C represents the third network model. In the embodiment of the present application, the original signal (i.e., the electrocardiogram segment of the current sleep stage), the time-frequency diagram, and the heart rate variability features are respectively input into Model A, Model B, and Model C to extract the corresponding features.

[0107] Among them, Model A combines Convolutional Neural Networks (CNN) with Long Short-Term Memory (LSTM). After the output is connected and transformed through the linear layer, Model A combines one-dimensional convolution and LSTM, and reduces the amount of calculation through the maximum pooling layer (max-pooling). After the convolution layer extracts deep features, the LSTM further analyzes the time information of these features and effectively extracts time domain features. Finally, the number of features is converted to 64 through the linear layer (FC).

[0108] Model B consists of four 2D convolutional layers and two maximum pooling layers, and finally converts the number of features to 64 through two linear layers.

[0109] Model C is composed of a multi-layer perceptron (MLP) consisting of three linear layers. Since the heart rate variability parameters are derived from medical knowledge and are highly correlated with sleep stages, Model C does not need to be very complex to extract the required features. Finally, the number of features is converted to 5.

[0110] The ECG segments, time-frequency graphs, and heart rate variability parameters correspond to Model A, Model B, and Model C, respectively. Each input is processed independently by a different network without interfering with each other. The tensor shapes of their final outputs are feature tensors of (n, 64), (n, 64), and (n, 5), where n is the batch size.

[0111] In the embodiment of the present application, the sleep stage classification model uses the Focal Loss loss function to calculate the loss value.

[0112] In order to enhance the nonlinear fitting ability of the model, the ReLU activation function is added after all convolutional layers and other linear layers except the last linear layer of the model. In the selection of loss function, the embodiment of the present application does not select the cross entropy loss function commonly used in the classification algorithm but selects Focal Loss to solve the problem of overfitting caused by uneven sleep stages. The formula of Focal Loss is shown in Formula 4, (1-p t ) γ is the modulation factor, γ≥0 is an adjustable parameter (set to 3 in this method), p t is the predicted probability that the sample belongs to this category.

[0113] FL(p t )=-(1-p t ) γ log(p t )#(4)

[0114] In the embodiment of the present application, in order to eliminate the influence of the dimensions of the outputs of the three network modules on the results, a batch normalization layer (BN layer) is provided at the end of each module for normalization processing, and the data is limited to [0, 1].

[0115] The output of each model reflects the features related to the sleep stage from different perspectives. In the end, directly connecting them for judgment cannot correctly reflect the contribution of each model to the result. Therefore, the embodiment of the present application designs an attention layer to achieve self-learning of the weight of each model output. The tensor lengths of the three model outputs are 64, 64, and 5 respectively. The embodiment of the present application sets the FC layer and the normalized exponential function (softmax function) after the attention layer, and introduces three linear transformation matrices at the attention layer. and The output of the model and Mapped to a unified dimension, i.e. and Using a learnable weight matrix To calculate the weight score of each model output. After the attention layer outputs the weighted fusion features, an FC layer is used to reduce the dimension, that is, through a learnable parameter matrix Reduce out to Where n is the batch size, d is the uniform dimension of the design, and i is the number of sleep stages specified in the selected sleep rule. For example, when the five-stage standard is selected, i = 5. Finally, these scores are converted into weights through the softmax function, which ensures that their sum is 1. The attention weights output by Model A, Model B, and Model C are α A , α B and α C , the final output is out, and its calculation formula is as follows:

[0116]

[0117]

[0118] out=α A A out +α B B out +α C C out #(8)

[0119] Based on the above scheme, the embodiment of the present application uses four different evaluation indicators to evaluate the performance of the proposed method under different sleep staging rules. The rules include five-stage sleep (N3RW), four-stage sleep (DLRW), three-stage sleep (NRW) and two-stage sleep (SW). The indicators include accuracy (Acc), precision (Pre), recall (Recall) and F1 score. The definitions of these indicators are as follows:

[0120]

[0121] Among them, TP is the positive sample predicted by the model as the positive class, TN is the negative sample predicted by the model as the negative class, FP is the negative sample predicted by the model as the positive class, and FN is the positive sample predicted by the model as the negative class.

[0122] The database selected for the test is the St. Vincents University Hospital / University College Dublin Sleep Apnea Database, which is available for download on the PhysioNet website. The experimental results are shown in Table 3:

[0123] Table 3 Experimental results

[0124]

[0125] It can be seen from Table 3 that the model has achieved good results under various standards and can meet the monitoring needs in daily life. At the same time, in order to verify the advancement of the model, the present embodiment selected the research results of the current algorithm for electrocardiogram sleep staging for comparison, and the results are shown in Table 4:

[0126] Table 4 Comparison of related methods and this method

[0127]

[0128]

[0129] Among them, Qiao Li is the method used in the corresponding literature of “Li Q, Li Q, Liu C, Shashikumar SP, Nemati S, Clifford GD. Deep learning in the cross-time frequency domain for sleep staging from a single-lead electrocardiogram. Physiol Meas. 2018 Dec 21; 39(12): 124005”;

[0130] A. Rahimi is the method used in the corresponding literature of “A. Rahimi, A. Safari and M. Mohebbi, Sleep Stage Classification Based on ECG-Derived Respiration and Heart Rate Variability of Single-Lead ECG Signal[M]. 2019 26th National and 4th International Iranian Conference on Biomedical Engineering(ICBME), Tehran, Iran, 2019, pp.158-163”;

[0131] Surantha, N is the method used in the corresponding literature of "Surantha, N., Lesmana, TF&Isa, SMSleep stage classification using extreme learning machine and particle swarm optimization[J]. healthcare big data. J Big Data 8, 14(2021)";

[0132] Tang M is the method used in the corresponding literature of “Tang M, Zhang Z, He Z, et al. Deep adaptation network for subject-specific sleep stage classification based on a single-lead ECG[J]. Biomedical Signal Processing and Control, 2022, 75: 103548-”;

[0133] I.Choi is the method used in the corresponding literature of “I.Choi and W.Sung, Single-Channel Ecg-Based Sleep Stage Classification With End-To-End Trainable Deep Neural Networks[M].2023 45thAnnual International Conference of the IEEE Engineering in Medicine&BiologySociety(EMBC),Sydney,Australia,2023,pp.1-4,”.

[0134] According to the results in Table 4, it can be seen that the method in the embodiment of the present application has achieved the best results. At the same time, since the samplers of the UCDDB database selected by the method in the embodiment of the present application are all suspected of suffering from obstructive sleep apnea, central sleep apnea or primary snoring, these diseases will cause more complex physiological signals, disordered sleep structure and other problems, so they have a greater impact on the model extraction features. Therefore, the method in the embodiment of the present application is more suitable for patients with sleep disorders to a certain extent.

[0135] In order to verify the effectiveness of the electrocardiogram in the sleep staging task, the present embodiment selected multiple models that were also tested in the UCDDB database for comparison. The staging standard was N3RW. The comparison results are shown in Table 5:

[0136] Table 5 Comparison of classification accuracy with other models on the UCDDB dataset

[0137]

[0138] For the random forest method, please refer to the corresponding literature of “Memar P, Faradji F (2018) A novel multi-class EEG-based sleep stage classification system. IEEE Trans Neural Syst RehabilEng 26(1): 84–95”;

[0139] For details of the “convolutional neural network + attention mechanism” method, please refer to the corresponding literature “Zhu TQ, Luo W, Yu F (2020) Convolution-and attention-based neural network for automated sleep stage classification. Int J Environ Res Public Health 17(11):4152”;

[0140] For details about the “multi-layer perceptron + long short-term memory network” method, please refer to the corresponding literature of “Dong H, Supratak A, Pan W et al (2018) Mixed neural network approach for temporal sleep stage classification. IEEE Trans Neural Syst Rehabil Eng 26 (2): 324–333”;

[0141] For details about the method of “convolutional neural network + long short-term memory network”, please refer to the corresponding literature of “Supratak A, Dong H, Wu C et al (2017) DeepSleepNet: a model for automatic sleep stage scoring based on rawsingle-channel EEG. IEEE Trans Neural Syst Rehabil Eng 25(11): 1998–200818”;

[0142] For details on the method of “convolutional neural network + gated recurrent unit attention mechanism”, please refer to the corresponding literature of “YuanY, Xun GX, MaFL et al (2018) MuVAN: a multi-view attention network for multivariate temporal data. In: Proceedings of the 18th IEEE international conference on data mining, Singapore, pp 717–72620”;

[0143] For details on the method of “gated recurrent unit attention mechanism + gated recurrent unit”, please refer to the corresponding literature of “Phan H, Andreotti F, Cooray N et al (2019) SeqSleepNet: end-to-end hierarchical recurrent neural network for sequence-to sequence automatic sleep staging. IEEE Trans Neural Syst Rehabil Eng 27(3): 400–410”.

[0144] It can be seen from Table 5 that the model proposed in the embodiment of the present application has achieved the second-best staging accuracy, and is significantly better than the other five staging models. Compared with other methods, it can be concluded that compared with electroencephalogram and polysomnography, single-lead electrocardiogram can also achieve good results. Considering that the model in the embodiment of the present application is designed for a single-lead signal, the experimental results obtained by the proposed model are satisfactory.

[0145] After experimental verification, the embodiment of the present application can achieve advanced results in the sleep staging task. At the same time, the embodiment of the present application only requires a single-lead electrocardiogram to complete the monitoring of the sleep state, and is more suitable for deployment in related scenarios for daily monitoring. It is convenient for users to monitor their own sleep state and adjust their sleep conditions, lifestyle, etc. to improve sleep quality. It can also alert people with severe sleep disorders to seek medical treatment in time.

[0146] Based on the same principle as the method provided in the embodiment of the present application, the embodiment of the present application also provides an automatic sleep staging device for a single-lead electrocardiogram, such as Figure 5 As shown, the device comprises:

[0147] The data acquisition module 501 is used to acquire the electrocardiogram segment of the current sleep stage based on the electrocardiogram signal;

[0148] The data processing module 502 is used to perform short-time Fourier transform on the electrocardiogram segments to obtain a time-frequency diagram;

[0149] The data processing module 502 is also used to obtain the heart rate variability characteristics of the electrocardiogram segment;

[0150] The classification and recognition module 503 is used to input the electrocardiogram segments, the time-frequency diagram and the heart rate variability features into the sleep stage classification model to classify and recognize the sleep stage;

[0151] Among them, the sleep stage classification model is built based on multi-layer perceptron, convolutional neural network and long short-term memory network.

[0152] In an embodiment of the present application, an ECG segment of the current sleep stage is obtained based on an ECG signal, wherein the ECG signal can be collected at home. A short-time Fourier transform is performed on the ECG segment to obtain a time-frequency diagram; and the heart rate variability characteristics of the ECG segment are obtained. The ECG segment, the time-frequency diagram, and the heart rate variability characteristics are input into a sleep stage classification model to classify and identify the sleep stage. In the present application, sleep staging can be achieved using only ECG signals, and only the ECG signal of the current stage needs to be processed, which not only reduces the difficulty of signal acquisition, but also reduces the memory requirements of the deployment platform. In addition, the embodiment of the present application uses a sleep stage classification model to jointly judge the sleep stage based on the ECG segment, the time-frequency diagram, and the heart rate variability characteristics, which to a certain extent makes up for the problem of insufficient information contained in the ECG signal, and has achieved an advanced level in verification, which can meet daily detection.

[0153] The automatic sleep staging device for single-lead electrocardiogram provided in the embodiment of the present application can achieve Figures 1 to 4 To avoid repetition, the various processes implemented in the method embodiment are not described here.

[0154] The automatic sleep staging device for a single-lead electrocardiogram in the embodiments of the present application can execute the automatic sleep staging method for a single-lead electrocardiogram provided in the embodiments of the present application, and the implementation principle is similar. The actions performed by each module and unit in the automatic sleep staging device for a single-lead electrocardiogram in each embodiment of the present application correspond to the steps in the automatic sleep staging method for a single-lead electrocardiogram in each embodiment of the present application. For the detailed functional description of each module of the automatic sleep staging device for a single-lead electrocardiogram, please refer to the description of the corresponding automatic sleep staging method for a single-lead electrocardiogram shown in the previous text, which will not be repeated here.

[0155] Based on the same principle as the method shown in the embodiment of the present application, the embodiment of the present application also provides an electronic device, which may include but is not limited to: a processor and a memory; a memory for storing a computer program; a processor for executing the automatic sleep staging method for a single-lead electrocardiogram shown in any optional embodiment of the present application by calling a computer program. Compared with the prior art, the automatic sleep staging method for a single-lead electrocardiogram provided by the present application can achieve sleep staging using only electrocardiogram signals, and only needs to process the electrocardiogram signals of the current stage, which not only reduces the difficulty of signal acquisition, but also reduces the memory requirements of the deployment platform. In addition, the embodiment of the present application uses a sleep stage classification model to jointly judge the sleep stage based on electrocardiogram segments, time-frequency diagrams and heart rate variability characteristics, which to a certain extent makes up for the problem of insufficient information contained in the electrocardiogram signal, and has achieved an advanced level in verification, which can meet daily detection.

[0156] In an optional embodiment, an electronic device is also provided, such as Figure 6 As shown, Figure 6 The electronic device 600 shown may be a server, including: a processor 601 and a memory 603. The processor 601 and the memory 603 are connected, such as through a bus 602. Optionally, the electronic device 600 may further include a transceiver 604. It should be noted that in actual applications, the transceiver 604 is not limited to one, and the structure of the electronic device 600 does not constitute a limitation on the embodiments of the present application.

[0157] Processor 601 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 601 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0158] The bus 602 may include a path to transmit information between the above components. The bus 602 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 602 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0159] The memory 603 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.

[0160] The memory 603 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 601. The processor 601 is used to execute the application code stored in the memory 603 to implement the contents shown in the above method embodiment.

[0161] Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0162] The server provided in this application can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected by wired or wireless communication, and this application does not limit this.

[0163] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding content in the aforementioned method embodiment.

[0164] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0165] It should be noted that the computer-readable storage medium mentioned above in the present application can also be a computer-readable signal medium or a combination of a computer-readable storage medium and a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0166] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0167] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0168] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the automatic sleep staging method and apparatus for a single-lead electrocardiogram provided in the above-mentioned various optional implementations.

[0169] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0170] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0171] The modules involved in the embodiments of the present application may be implemented by software or hardware. The name of the module does not limit the module itself in some cases. For example, the data acquisition module may also be described as "a data acquisition module for acquiring an electrocardiogram segment of the current sleep stage based on an electrocardiogram".

[0172] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.

Claims

1. An automatic sleep staging method for a single-lead electrocardiogram, characterized in that: The method comprises: Based on the ECG signal, obtain the ECG segment of the current sleep stage; Performing short-time Fourier transform on the electrocardiogram segment to obtain a time-frequency diagram; Acquiring heart rate variability characteristics of the electrocardiogram segment; Inputting the electrocardiogram segment, the time-frequency diagram and the heart rate variability feature into a sleep stage classification model to classify and identify the sleep stage; Among them, the sleep stage classification model is constructed based on a multi-layer perceptron, a convolutional neural network and a long short-term memory network.

2. The automatic sleep staging method for single-lead electrocardiogram according to claim 1, characterized in that: The step of obtaining an electrocardiogram segment of the current sleep stage based on the electrocardiogram signal includes: Using a filter to remove noise from the electrocardiogram signal; The denoised ECG signals were segmented into multiple 30-second segments according to the sleep staging rules developed by AASM; Determine the ECG segment of the current sleep stage from multiple 30-second segments.

3. The automatic sleep staging method for single-lead electrocardiogram according to claim 1, characterized in that: The heart rate variability characteristics include time domain characteristics and frequency domain characteristics; The time domain features include the mean heart beat interval, the standard deviation of the heart beat interval, and the percentage of RR intervals greater than 50 ms in the whole; The frequency domain features include low frequency energy, high frequency energy, total power and high and low frequency power ratio.

4. The automatic sleep staging method for single-lead electrocardiogram according to claim 3, characterized in that: The step of obtaining the heart rate variability feature of the electrocardiogram segment includes: The frequency domain characteristics of heart rate variability are obtained through the Lomb-Scargle algorithm; The R wave of the electrocardiogram segment was located by Pan-Tompkins algorithm, and the RR was analyzed by statistical analysis. i The differences between the intervals are used to obtain the time domain characteristics of heart rate variability.

5. The automatic sleep staging method for single-lead electrocardiogram according to claim 4, characterized in that: The Pan-Tompkins algorithm is used to locate the R wave of the electrocardiogram segment, and the RR is analyzed by statistical analysis. i The differences between the intervals are used to obtain the time domain characteristics of heart rate variability, including: Performing R wave enhancement processing and R wave decision processing on the electrocardiogram segment to achieve R wave positioning; Based on the R wave positioning, RR was statistically analyzed i The difference between the intervals is used to obtain the time domain characteristics of heart rate variability; Among them, the R wave decision processing method includes sliding average window, R wave detection, backtracking mechanism, and R wave positioning in sequence; the backtracking mechanism is set to ensure that the normal R wave amplitude is not lower than a threshold.

6. The automatic sleep staging method for single-lead electrocardiogram according to claim 1, characterized in that: The sleep stage classification model includes a first network module corresponding to the electrocardiogram segment, a second network module corresponding to the time-frequency graph, and a third network module corresponding to the heart rate variability feature; The first network module includes a one-dimensional convolution, a long short-term memory network, a maximum pooling layer and a linear layer; The second network module includes a two-dimensional convolutional layer, a maximum pooling layer and a linear layer; The third network module includes a multilayer perceptron consisting of three linear layers and a Relu activation function.

7. The automatic sleep staging method for single-lead electrocardiogram according to claim 1, characterized in that: The sleep stage classification model uses the Focal Loss loss function to calculate the loss value.

8. An automatic sleep staging device for a single-lead electrocardiogram, characterized in that: The device comprises: A data acquisition module, used for acquiring an electrocardiogram segment of the current sleep stage based on the electrocardiogram signal; A data processing module, used for performing short-time Fourier transform on the electrocardiogram segments to obtain a time-frequency graph; The data processing module is also used to obtain the heart rate variability characteristics of the electrocardiogram segment; A classification and recognition module, used for inputting the electrocardiogram segment, the time-frequency diagram and the heart rate variability feature into a sleep stage classification model to perform classification and recognition of sleep stages; Among them, the sleep stage classification model is constructed based on a multi-layer perceptron, a convolutional neural network and a long short-term memory network.

9. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Sleep staging system construction method based on self-attention mechanism and single-lead electrocardiosignal and sleep staging system

    CN115336973A

  • Sleep stage classification method based on multi-view features

    CN118094307A