Non-contact sleep staging method and equipment

Vital sign data is obtained through radar equipment, combined with fast Fourier transform and Gauss Newton's algorithm to calculate the respiratory frequency and heartbeat frequency, a two-branch structure sleep stage prediction model was constructed, and the timing and frequency domain characteristics were processed using BiLSTM and attention mechanisms, which solved the problem of insufficient sleep signal recognition caused by one-sided features in the existing technology, and achieved high-precision non-contact sleep monitoring.

CN120345870AActive Publication Date: 2025-07-22TIANJIN JIANJUN TECH CO LTD

Patent Information

Application Number
CN202510838840.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-07-22
Estimated Expiration
2045-06-23

AI Technical Summary

Technical Problem

The features extracted by the existing non-contact sleep monitoring methods are relatively one-sided, resulting in insufficient recognition of multi-stage sleep signals and the inability to accurately generate sleep staging results.

Method used

Vital sign data, including heart rate, respiratory rate, respiratory energy and reflex intensity, were obtained through radar equipment, and the respiratory rate and heartbeat frequency were calculated using fast Fourier transform and Gaussian Newton algorithm to construct a sleep stage prediction model with a dual-branch structure. Combining BiLSTM and attention mechanism to process timing and frequency domain characteristics, an adaptive iterative decomposition algorithm was used to filter out noise interference.

Benefits of technology

It significantly improves the ability to recognize multi-stage sleep signals, accurately generates sleep staging results, reduces human contact, improves monitoring comfort and accuracy, and can view sleep status in real time on the mobile phone.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120345870A_ABST
    Figure CN120345870A_ABST
Patent Text Reader

Abstract

The invention discloses a non-contact sleep staging method and equipment. The non-contact sleep staging method comprises the steps that radar equipment is placed at a designated position and powered on; processing the echo signal of the radar equipment to obtain vital sign data; sending the vital sign data to a cloud server for storage; exporting the vital sign data and processing the vital sign data into time sequence features and frequency domain features; constructing a sleep staging prediction model, inputting the time sequence features and the frequency domain features into the sleep staging prediction model, carrying out feature learning and outputting a sleep staging prediction value, simultaneously modeling the time sequence and frequency domain features by the sleep staging prediction model through a double-branch structure, capturing a time sequence dependency relationship by using BiLSTM, and determining a sleep staging prediction result; attention of the attention mechanism enhancement model on time sequence information and frequency domain information in the sequence; the method has the advantages that complementary fusion of time-frequency information is realized, the recognition capability and model generalization performance of multi-stage sleep signals are remarkably improved, and sleep staging results are accurately generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of non-contact sleep monitoring, and particularly relates to a non-contact sleep staging method and device. Background Art

[0002] Sleep is crucial for maintaining the physiological and mental health of the human body. Currently, the gold standard for monitoring sleep quality is the polysomnography (PSG) monitor, which can collect multiple physiological signals including electromyogram, electroencephalogram, electrocardiogram, and electrooculogram. Its advantage is high accuracy, but the disadvantage is high monitoring cost. When actually measuring, multiple wires are connected to the body, making it impossible to conduct long-term sleep monitoring. Subsequently, a method of using a watch sensor to sense the minute activities of the human body to monitor sleep emerged. However, the data obtained only by relying on the acceleration sensor and heart rate sensor is limited, making it difficult to comprehensively and accurately reflect different stages of sleep. Moreover, it still needs to be worn, which is very unfriendly to people with sensitive skin.

[0003] In recent years, millimeter-wave radar has stood out with its unique advantages. Millimeter-wave radar performs non-contact measurements and has the advantages of ensuring comfort, not infringing on privacy, and continuous monitoring. Artificial intelligence has demonstrated excellent performance in many fields, especially deep learning algorithms, which have brought revolutionary breakthroughs to data processing and pattern recognition. The organic integration of millimeter-wave radar and deep learning has opened up a new path for non-contact sleep monitoring. When using millimeter-wave radar to collect vital sign data during sleep monitoring, the sleep posture and body movements of the human body will cause data mutations. Therefore, the radar signal processing algorithm needs to be optimized accordingly to improve the accuracy of vital sign monitoring during sleep. The sleep staging method and device based on radar signals disclosed in Patent Publication No. CN118490182A predicts the sleep staging result based on the spectrogram energy signal of the radar signal using a CNN network and an attention mechanism. However, when obtaining the spectrogram energy signal of the radar signal, a band-pass filter is used to filter the signal, which cannot eliminate the influence of random interference. Moreover, there are many convolutional layers, and multi-scale feature extraction and residual connection are required, resulting in high resource consumption and high requirements for hardware. The non-contact sleep staging recognition and structure analysis method and system disclosed in Patent Publication No. CN119418952A divides the thoracic physiological motion signal into several sleep segments and uses a combined model of CRNN and NCRF for sleep staging prediction. However, when using radar to extract the thoracic physiological motion signal of the human body, the specific signal processing process for clutter interference filtering is not clear. At the same time, the model structure is large, with higher requirements for hardware, and the data volume is large, making annotation difficult, requiring professional knowledge and a large amount of time. The non-contact sleep staging method and device based on millimeter-wave radar disclosed in Patent Publication No. CN118806236A performs digital signal technology processing on the radar signal, extracts the heart rate and heart rate characteristics, and inputs them into a deep learning model for sleep staging prediction. However, only the heart rate characteristics are extracted, and the data features are single, which will lead to a decrease in prediction accuracy and poor continuity.

[0004] A non-contact sleep monitoring device and sleep staging method based on ultra-wideband radar disclosed in Chinese Patent Publication No. CN109480787A has a simple structure, and the data features include respiratory rate, heart rate, and statistical parameters of respiratory rate and heart rate over a period of time. Thus, on the one hand, the above-mentioned resource cost problem is solved, and on the other hand, the problem of single data features mentioned above is solved. However, this patent application uses a host computer to perform DC component removal and Fourier transform on the radar echo data, and distinguishes the body movement state through frequency-domain waveform analysis. Therefore, it only processes the frequency-domain features, and the extracted features are relatively one-sided. The machine learning process steps and methods are not clear, and the influence of random interference is not solved, resulting in insufficient recognition ability for multi-stage sleep signals. Summary of the Invention

[0005] The technical problem to be solved by the present invention is that the features extracted by the non-contact sleep monitoring method in the prior art are relatively one-sided, resulting in insufficient recognition ability for multi-stage sleep signals and unable to accurately generate sleep stage results.

[0006] The present invention solves the above technical problems through the following technical means: A non-contact sleep staging method, including: S1. Place the radar device at a specified position and power it on; S2. Process the echo signal of the radar device to obtain vital sign data; the vital sign data includes heart rate, respiratory rate, respiratory energy, reflection intensity, and the time corresponding to this data; obtain the phase signal containing heartbeat and respiration and the reflection intensity from the echo signal of the radar device; separate the respiration and heartbeat signals from the phase signal and calculate the respiratory energy; for the respiration and heartbeat signals, use the fast Fourier transform to convert the signal from the time domain to the frequency domain, and then use the Gauss-Newton algorithm and the centroid algorithm to find the respiratory frequency and heartbeat frequency, and further calculate the respiratory rate and heart rate; S3. Send the vital sign data to the cloud server for storage; S4. Export the vital sign data and process it into time series features and frequency domain features; S5. Construct a sleep staging prediction model. The time series features and frequency domain features are input into the sleep staging prediction model. The sleep staging prediction model processes the time series features and frequency domain features using the same branch structure, splices the obtained results, and then inputs the spliced result into the feedforward layer for processing to output the final sleep staging prediction result; among them, the processing process of the branch structure is: the features are input into the BiLSTM model and the first fully connected layer, and the output results of the two are connected by residual connection, and then layer normalization operation and regularization operation are performed to obtain the first layer residual result, where the regularization operation randomly discards neurons with a preset ratio; the first layer residual result is input into the attention mechanism and dimension expansion is performed, the result after dimension expansion is connected with the first layer residual result by residual connection, matrix addition is performed, and layer normalization and regularization processing are performed to obtain the second layer residual result, and the second layer residual result is dimension-reduced as the processing result of the branch structure.

[0007] Further, S1 includes: The subject lies flat on the bed, place the radar device at a preset distance directly above the human head, turn on the power and start the machine, perform device network configuration, and adjust the angle between it and the bed board so that the front of the radar device is in a straight line with the person's chest.

[0008] Further, S2 includes: Set the respective thresholds for the reflection intensity and respiratory energy. When both the reflection intensity and respiratory energy are greater than their respective thresholds, it is determined that the radar device detects a human target, otherwise it is no one.

[0009] Furthermore, obtaining the phase signal and reflection intensity containing heartbeat and respiration from the echo signal of the slave radar device includes: Amplify, mix, and perform analog-to-digital conversion on the echo signal of the radar device to form a coherent signal containing heartbeat and respiration. Extract the maximum amplitude from the coherent signal. The maximum amplitude extraction is to extract the energy peak of a single-frame signal from the coherent signal and directly use it as the reflection intensity. Extract the phase of each frame of the coherent signal using the arctangent function, and arrange the phases extracted from each frame in chronological order to form a phase signal.

[0010] Furthermore, separating the respiration and heartbeat signals from the phase signal and calculating the respiration energy includes: Calculate the autocorrelation function based on the phase signal, and perform Fourier transform on the autocorrelation function to obtain its autocorrelation spectrum , sort all the peak points within the autocorrelation spectrum range from largest to smallest in amplitude, set the autocorrelation threshold to one-tenth of the maximum amplitude, identify the peak points greater than the autocorrelation threshold as valid peak points, and record the center frequencies of the valid peak points; the phase signal decomposition is based on the center frequencies of the valid peak points and the bandwidths of the signal components corresponding to each center frequency to decompose the phase signal into signal components with the number of valid peak points; initially, a set of frequency influence degrees is given, use the frequency influence degrees to adjust the bandwidths of each signal component, decompose the phase signal, calculate the sum of the bandwidths of all signal components after being adjusted by the frequency influence degrees, the objective function is to minimize the sum of the bandwidths of all signal components after being adjusted by the frequency influence degrees, the constraints of the decomposition process include that the sum of all frequency influence degrees is equal to 1 and the difference between the sum of the decomposed signal components and the phase signal is less than the decomposition threshold; update the frequency influence degrees, continue the next decomposition, calculate the sum of the bandwidths of all signal components after being adjusted by the frequency influence degrees in the next time, and iterate continuously until the iteration times are reached or the difference between the sum of the decomposed signal components and the phase signal is less than the decomposition threshold, then stop the update, select the frequency influence degree grouping situation when the objective function value is the smallest to adjust the bandwidths of the signal components and decompose the phase signal into signal components with the number of valid peak points; Select the signal components with frequencies within the breathing signal frequency range from the decomposed signal components as the breathing signal, and select the signal components with frequencies within the heartbeat signal frequency range from the decomposed signal components as the heartbeat signal; if there are multiple signal components with frequencies within the breathing signal frequency range or the heartbeat signal frequency range, then calculate the energy proportion of each signal component with frequencies within the entire breathing signal frequency range or the heartbeat signal frequency range in the autocorrelation spectrum of the phase signal, and select the signal component with the highest energy proportion within the breathing signal frequency range as the breathing signal, and select the signal component with the highest energy proportion within the heartbeat signal frequency range as the heartbeat signal; perform weighted fusion on the current breathing signal and the breathing signal obtained from the previous processing to obtain the breathing energy; among them, the method for calculating the energy proportion is based on the frequency of the signal component as the center, find the left frequency point when its amplitude drops to half of the peak and the right frequency point , then the frequency band width of the signal component is , integrate within the frequency band width for , obtain the frequency band energy of the signal component, and the energy of the entire breathing frequency range or heartbeat frequency range is calculated in the same way as above, so as to compare the frequency band energy of the signal component with the energy of the breathing frequency range to obtain the energy proportion of each signal component with frequencies within the entire breathing signal frequency range; compare the frequency band energy of the signal component with the energy of the heartbeat frequency range to obtain the energy proportion of each signal component with frequencies within the entire heartbeat signal frequency range.

[0011] Furthermore, the objective function is ; the expression of the constraint condition in the decomposition process is ; in the formula, is the number of effective peak points, represents the center frequency of the th effective peak point, , is the th frequency influence degree, is the signal component corresponding to the fth center frequency, m is the sampling point within the interval [0, M - 1], M is the length of the phase signal, is 's analytic signal, , represents the Hilbert transform, j is the imaginary unit, is the first-order forward difference and , is the decomposition threshold, represents the square of the L2 norm; is the phase signal, is the symbol of the constraint condition, is the The bandwidth of a signal component is the difference result between the sum of the decomposed signal components and the phase signal.

[0012] Furthermore, for the respiration and heartbeat signals, after converting the signals from the time domain to the frequency domain using the fast Fourier transform, the Gaussian-Newton algorithm and the centroid algorithm are used to find the respiration frequency and the heartbeat frequency, and then the respiration rate and the heart rate are calculated, including: The processing procedures for the respiration signal and the heartbeat signal are the same. Both are to estimate the power spectral density of the signal using the periodogram method after performing the fast Fourier transform on the signal, fit the power spectral density using the Gaussian-Newton algorithm. After obtaining the fitting curve, find two peak points with the largest and the second largest amplitudes on the fitting curve as candidate peak points, and calculate the centroid for the neighborhood of each candidate peak point; calculate the distance between each candidate peak point and its centroid position, and select the candidate peak point with a small distance from the centroid position as the final peak point; multiply the peak frequencies corresponding to the final peak points found from the power spectral density of the respiration signal and the power spectral density of the heartbeat signal by 60 to obtain the respiration rate and the heart rate.

[0013] Further, S4 includes: Input the time in the vital sign data into the biological clock simulation function to generate the corresponding biological clock simulation time feature. Take a set of vital sign data values every second, read out the vital sign data, and perform window processing on the vital sign data with a preset step size. Each window contains the data of the first n seconds and the next n seconds before the current moment. Each column of the window is vital sign data of different types, and each row is the time corresponding to various vital sign data; directly calculate the mean and variance for each column feature of the window to generate time series features, and perform discrete Fourier transform on the data of the window and then calculate the mean and variance for each column feature of the window to generate frequency domain features; where the formula of the biological clock simulation function is , is the biological clock simulation time feature, A is the amplitude, is the period, is the number of minutes exceeding the bedtime point, is the phase.

[0014] Further, the feedforward layer uses the second fully connected layer to integrate the information of the two branch structures, then uses the GELU activation function for non-linear transformation, then discards neurons with a preset ratio using regularization operation, and finally maps the remaining neurons to the third fully connected layer to obtain the sleep stage prediction result.

[0015] Furthermore, the processing procedure of the attention mechanism is as follows: S541: Generate the query vector Q and the key vector K

[0016]

[0017] Among them, are the first weight matrix and the second weight matrix respectively, and H is the residual result of the first layer; S542: Calculate the basic attention score based on the query vector Q and the key vector K

[0018]

[0019] Among them, D is the feature dimension, is the third weight matrix; S543: Generate a gating signal , and obtain a scalar gating signal by taking the average of the gating signal in the feature dimension

[0020]

[0021]

[0022] Among them, represents the th feature dimension, is the fourth weight matrix, is the bias vector, represents the sigmoid activation function; S544: Calculate the attention weight

[0023]

[0024] Among them, represents the dot product, represents taking on the first dimension of

[0025] S545: Weightedly aggregate the residual result of the first layer to obtain the result of the attention mechanism

[0026]

[0027] Among them, t represents the t-th moment, represents the time step, that is, the window length for window processing of the vital sign data.

[0028] Furthermore, the sleep stage prediction result corresponds to five sleep states, namely awake, light sleep, deep sleep, rapid eye movement, and none.

[0029] Further, the non-contact sleep staging method further includes: S6. Display the five sleep states of wakefulness, light sleep, deep sleep, REM sleep, and no person on the mobile phone.

[0030] The present invention also provides a non-contact sleep staging device, including a processor and a memory. The memory stores computer program instructions that can be executed by the processor. When the processor executes the computer program instructions, the method steps described above are implemented.

[0031] The advantages of the present invention are as follows: (1) The present invention exports and processes the vital sign data into time series features and frequency domain features, and inputs them into two branch structures of the sleep staging prediction model respectively. By simultaneously modeling the time series and frequency domain features through the dual-branch structure, using BiLSTM to capture the time series dependence relationship, and the attention mechanism to enhance the model's attention to the time series information and frequency domain information in the sequence, the complementary fusion of time-frequency information is realized, significantly improving the recognition ability of multi-stage sleep signals and the generalization performance of the model, and generating relatively accurate sleep staging results; in addition, the Gaussian-Newton algorithm is adopted to effectively reduce noise interference and improve the spectral resolution, and then the centroid algorithm is used to more accurately identify the peaks in the spectrum, so as to accurately calculate the respiratory rate and heart rate, so that the collected vital sign data is more accurate, further improving the accuracy of the sleep staging results.

[0032] (2) The present invention monitors the vital signs in a non-contact manner, reducing the contact between people and the device. Without feeling, it can obtain high-precision vital sign data such as heart rate, respiratory rate, respiratory energy, and reflection intensity. On this basis, the vital sign data is preprocessed to generate time series features and frequency domain features. The sleep staging prediction model simultaneously models the time series and frequency domain features through a dual-branch structure, uses BiLSTM to capture the time series dependence relationship, the attention mechanism enhances the model's attention to the key time series information or frequency domain information in the sequence, the residual connection and layer normalization ensure the stable transmission and efficient training of information, and integrates multi-dimensional information through feature fusion to improve the model's discrimination ability for sleep stages. It can quickly and accurately generate sleep staging results without contact and can be viewed at any time on the mobile phone, which helps to understand the body's sleep situation.

[0033] (3) The present invention sets the threshold of the reflection intensity and the threshold of the respiratory energy, and compares the size relationship between the monitored data and the threshold. When both the reflection intensity and the respiratory energy are greater than the corresponding thresholds, the potential target is identified as a human target. Therefore, through the above method, it is possible to quickly and conveniently distinguish whether there is a human target, improving the accuracy of non-contact detection.

[0034] (4)In the present invention, the time data in the vital sign data is Beijing time, while the sampling moment is required in actual applications. Therefore, the time data is processed through a biological clock simulation function to obtain the biological clock simulation time characteristics, which is convenient for subsequent calculation of time series characteristics and frequency domain characteristics using windows.

[0035] (5)In the present invention, the time series characteristics and frequency domain characteristics are respectively input into the first fully connected layer for feature mapping, and a residual connection is made with the output of the BiLSTM model to alleviate the problem of gradient disappearance in the deep model. Then, layer normalization and regularization are performed. The normalization operation is carried out on a single sample in a batch. It calculates the mean and variance of the sample in the feature dimension for normalization, improves the training stability, and accelerates convergence. Regularization is a technique to prevent overfitting. During the training process, a preset proportion of neurons are randomly discarded, which can increase the stability and generalization ability of the model.

[0036] (6)In the present invention, the feedforward layer uses the second fully connected layer to integrate the information of the two feature channels, extract high-order features, and then uses the GELU activation function for non-linear transformation to increase the model's expression ability. Then, regularization is performed to discard a preset proportion of neurons to increase the stability and generalization ability of the model. Finally, the sleep staging result is obtained.

[0037] (7)Aiming at the problem that the method of extracting features in the prior art mentioned in the background art has poor ability to cope with random interference, the present invention realizes dynamic signal separation by designing an adaptive iterative decomposition algorithm, suppresses the random interference caused by turning over body movements, analyzes the frequency characteristics of the signal using the autocorrelation function and Fourier transform, and obtains the center frequency of the effective peak points in the spectrum. The frequency influence degree is adaptively modified according to the obtained center frequency to minimize the sum of the bandwidths of the frequency components of each effective peak point. After the iteration is completed, the optimal frequency influence degree is used to decompose the phase signal, and the respiration signal and heartbeat signal are selected from the decomposed signals according to the typical frequency ranges of respiration and heartbeat. This method improves the ability to cope with random interference during sleep monitoring, ensures that the separated respiration and heartbeat signals only contain the most important physiological information, and eliminates the influence of noise signals inside and outside the frequency band in the signal. The Gaussian-Newton algorithm is used to fit the spectrum, effectively reducing noise interference and improving the spectrum resolution. Then, the centroid algorithm is used to calculate the centroid position of the peak points of the fitted spectrum, and the final peak points are selected by comparing the distances between the candidate peak points and the centroid position, which can more accurately identify the peak points in the spectrum, and thus accurately calculate the respiration rate and heart rate.

[0038] After the traditional filter sets the passband, noise signals and spurious signals within the frequency band will be retained together with the physiological signals. If a high-order filter is used, it can filter out the frequencies of noise signals with a large frequency difference from the physiological signals within the frequency band, but it cannot filter out the frequencies of spurious signals around the physiological signal frequencies. The adaptive iterative decomposition algorithm designed by the present invention identifies all significant frequency components (including the frequency components of noise signals, spurious signals, and physiological signals) through autocorrelation spectrum analysis, decomposes them into independent signal components, and then eliminates the noise components and spurious components with small energy ratios through frequency band energy ratio screening, thus separating the pure physiological signals. Description of the Drawings

[0039] Figure 1 It is a schematic structural diagram of a non-contact sleep staging device in a non-contact sleep staging method disclosed in Embodiment 1 of the present invention; Figure 2 It is a flowchart of the operation of a non-contact sleep staging method disclosed in Embodiment 1 of the present invention; Figure 3 It is a flowchart of radar signal processing in a non-contact sleep staging method disclosed in Embodiment 1 of the present invention; Figure 4(a) is a power spectral density fitting curve of the respiratory signal in a non-contact sleep staging method disclosed in Embodiment 1 of the present invention, and Figure 4(b) is a power spectral density fitting curve of the heartbeat signal in a non-contact sleep staging method disclosed in Embodiment 1 of the present invention; Figure 5 It is a structural diagram of the DualResAtt-BiLSTM model in a non-contact sleep staging method disclosed in Embodiment 1 of the present invention; Figure 6 It is a schematic diagram of the BiLSTM network structure in a non-contact sleep staging method disclosed in Embodiment 1 of the present invention; Figure 7 It is a confusion matrix diagram of the prediction results in a non-contact sleep staging method disclosed in Embodiment 1 of the present invention; Figure 8(a) is a schematic diagram of the true label of sleep staging in a non-contact sleep staging method disclosed in Embodiment 1 of the present invention, and Figure 8(b) is a schematic diagram of the prediction results in a non-contact sleep staging method disclosed in Embodiment 1 of the present invention; Figure 9 It is a diagram showing the effect on the mobile terminal in a non-contact sleep staging method disclosed in Embodiment 1 of the present invention. Detailed Embodiments

[0040] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.

[0041] Embodiment 1 As Figure 1 shown, Embodiment 1 of the present invention provides a non-contact sleep staging method. The subject lies flat on the bed, and the radar device is located above the head. The radar device emits a continuous wave (FMCW) signal and receives the echo signal, processes the echo signal to generate vital sign data, and sends the data to the cloud server for storage through WiFi. The mobile terminal presents and displays it to the user by calling the interface API.

[0042] As Figure 2 shown is the flowchart of the working process of a non-contact sleep staging method provided by the present invention, which specifically includes the following steps: S1. The subject lies flat on the bed, places the radar device 0.8 - 1 m directly above the human head, turns on the power and the device, performs device network configuration, and adjusts the angle between it and the bed board so that the front of the radar device and the person's chest are in a straight line, which is more conducive to obtaining accurate vital sign data.

[0043] S2. In this embodiment, the radar device is a millimeter-wave radar. When the millimeter-wave radar performs non-contact vital sign monitoring, it is necessary to convert the radar signal into vital sign data such as heart rate, respiration, and respiration energy. The specific process is as Figure 3 shown and includes the following sub-steps: S21. Signal preprocessing includes using a low-noise amplifier to amplify the signal received by the antenna of the millimeter-wave radar, suppressing noise while increasing the signal strength, mixing the amplified signal with the local oscillator signal through a mixer, then down-converting it to the intermediate frequency, using an ADC analog-to-digital converter to perform analog-to-digital conversion on the intermediate frequency signal to form a coherent signal containing physiological information such as heartbeat and respiration, extracting the maximum amplitude of the coherent signal. The maximum amplitude reflects the target reflection intensity maxValue. The maximum amplitude extraction is to extract the energy peak of a single-frame signal from the coherent signal and directly use it as the reflection intensity. Use the arctangent function to extract the phase from consecutive multi-frame coherent signals, and arrange the phases extracted from each frame in chronological order to form a phase signal.

[0044] S22. Calculate the autocorrelation function based on the phase signal, and perform a Fourier transform on the autocorrelation function to obtain its autocorrelation spectrum , the spectrum contains the frequency distribution information of the signal. Sort all the peak points within the spectrum range of the autocorrelation spectrum in descending order of amplitude. Set the autocorrelation threshold to one-tenth of the maximum amplitude. Identify the peak points greater than the autocorrelation threshold as valid peak points and record the center frequencies of the valid peak points. Among them, the periodicity of the autocorrelation function can reflect the frequency characteristics of the signal. The formula of the autocorrelation function is as follows:

[0045] Among them, is the delay time, representing the time interval between two sampling points, is the phase signal, m is the sampling point within the interval [0, M - 1], and M is the length of the phase signal.

[0046] S23. According to the center frequencies of all valid peak points in the phase signal, the adaptive iterative decomposition algorithm adaptively modifies the frequency influence degree in each iteration process. The objective function is to minimize the sum of the bandwidths of the frequency components of each valid peak point. After the iteration is completed, the input phase signal is decomposed into multiple signal components with determined center frequencies using the optimal frequency influence degree. The specific steps of the adaptive iterative decomposition algorithm are as follows: There are N valid peak points, and the center frequency of the th valid peak point is (f = 1, 2,..., N), the th frequency influence degree is , and the signal component corresponding to the fth center frequency is . The expressions of the objective function and the constraint conditions of the decomposition process are:

[0047] In the formula, the formula in the first row is the objective function, and the formulas in the second row are the two constraint conditions. is the analytic signal, , represents the Hilbert transform, j is the imaginary unit, is the first-order forward difference and , is the decomposition threshold, represents the square of the L2 norm; is the symbol of the constraint condition, is the th bandwidth of the signal component, is the difference result between the sum of the decomposed signal components and the phase signal.

[0048] When the maximum number of iterations is reached or the difference between the sum of the decomposed signal components and the phase signal is less than the decomposition threshold, select the frequency influence degree that minimizes the sum of the bandwidths of all signal components after being adjusted by the frequency influence degree to decompose the phase signal. Among the obtained N signal components, there are respiratory signals, heartbeat signals, and noise signals. According to the respiratory signal frequency range (0.1 - 0.5 Hz) and the heartbeat signal frequency range (0.8 - 2 Hz), select the signal components with frequencies within the respiratory signal frequency range from the N decomposed signal components as respiratory signals, and select the signal components with frequencies within the heartbeat signal frequency range from the N decomposed signal components as heartbeat signals. If there are multiple signal components with frequencies within the respiratory signal frequency range or the heartbeat signal frequency range, calculate the energy proportion of the frequencies of each signal component within the entire respiratory signal frequency range or heartbeat signal frequency range in the autocorrelation spectrum of the phase signal, and select the signal with the highest energy proportion within the respiratory signal frequency range as the respiratory signal, and select the signal with the highest energy proportion within the heartbeat signal frequency range as the heartbeat signal. Among them, the second and third harmonics of the respiratory signal frequency will appear within the heartbeat signal frequency range, so first select the respiratory signal and filter out the multiple harmonics of the respiratory signal frequency existing within the heartbeat signal frequency range. For example, first find the frequency of the respiratory signal. Suppose the respiratory signal frequency is 0.4 Hz, then the second respiratory harmonic is 0.8 Hz, and the third respiratory harmonic is 1.2 Hz, both within the heartbeat signal frequency range. Then, identify the signal frequencies of 0.8 Hz and 1.2 Hz as respiratory harmonic signals, and exclude these two signal frequencies when selecting the heartbeat signal.

[0049] The above method for calculating the energy proportion is based on the frequency of the signal component as the center, find the left frequency point and the right frequency point when its amplitude drops to half of the peak value. Then the frequency band width of the signal component is . Integrate within the frequency band width to obtain the frequency band energy of the signal component. The energy of the entire respiratory frequency range or heartbeat frequency range is calculated in the same way as above, that is, integrate within the respiratory frequency range to obtain the energy of the respiratory frequency range, and integrate within the heartbeat frequency range to obtain the energy of the heartbeat frequency range. Thus, compare the frequency band energy of the signal component with the energy of the respiratory frequency range to obtain the energy proportion of the frequencies of each signal component within the entire respiratory signal frequency range; compare the frequency band energy of the signal component with the energy of the heartbeat frequency range to obtain the energy proportion of the frequencies of each signal component within the entire heartbeat signal frequency range.

[0050] After obtaining the respiratory signal and the heartbeat signal through the adaptive iterative decomposition method, the respiratory energy respiratory is calculated based on the respiratory signal, and the formula is as follows:

[0051] where is the exponential smoothing coefficient, which is used to control the degree of trust in the latest respiratory waveform data is the current respiratory signal waveform data is the respiratory signal waveform data after the previous exponential smoothing process

[0052] S24. After obtaining the respiratory signal and the heartbeat signal through the adaptive iterative decomposition method, the extraction methods of the respiratory rate and the heart rate are the same. Both are to perform a fast Fourier transform on the separated signal and then use the periodogram method to estimate the power spectral density of the signal. The Gauss-Newton algorithm uses the superposition of multiple Gaussian functions to fit the power spectral density. Through continuous iteration, when the change amount of the parameters between two adjacent iterations is less than the preset threshold of 0.1, it is considered that the parameters converge, and the fitting curve is obtained. Figure 4 (a) is the power spectral density fitting curve of the respiratory signal, and Figure 4 (b) is the power spectral density fitting curve of the heartbeat signal. After obtaining the fitting curve, the centroid algorithm is used to determine the final peak point by calculating the centroid position of the spectrum. Find the two peak points with the largest and the second largest amplitudes on the fitting curve as candidate peak points, calculate the centroid for the neighborhood of each candidate peak point, calculate the distance between each candidate peak point and its centroid position, and select the candidate peak point with a small distance from the centroid position as the final peak point. The peak frequencies corresponding to the final peak points found in the power spectral density of the respiratory signal and the power spectral density of the heartbeat signal are multiplied by 60 to obtain the respiratory rate and the heart rate. The relevant formula process is as follows: Perform a fast Fourier transform on the separated signal and then use the periodogram method to estimate the power spectral density of the signal , is the frequency index. The spectrum obtained by the periodogram method may have problems such as noise interference and insufficient resolution. Therefore, the Gauss-Newton algorithm is further used to fit the spectrum to improve the accuracy of respiratory and heart rate estimation. The Gauss-Newton algorithm constructs a nonlinear least squares model and uses the gradient information of the Gaussian objective function to gradually adjust the model parameters to continuously reduce the error between the fitted spectrum and the actual spectrum, thereby improving the accuracy and reliability of spectrum analysis. The Gauss-Newton algorithm uses the superposition of multiple Gaussian functions to fit the spectrum:

[0053] In the formula is the frequency point of the spectrum obtained by the periodogram method, which is the independent variable. During the iterative calculation process, the frequency points of the spectrum obtained by the periodogram method are traversed is the amplitude of the g-th Gaussian function is the center frequency of the g-th Gaussian function, is the standard deviation, is the number of Gaussian functions, are the parameters to be fitted.

[0054] The Gaussian objective function is the sum of the squares of the errors between the fitted spectrum and the actual spectrum:

[0055] where, is the -th frequency index of the spectrum obtained by the periodogram method, is the number of frequency indices, is the -th frequency point of the spectrum obtained by the periodogram method.

[0056] The iterative formula of the Gauss-Newton algorithm is:

[0057] where, is the obtained in the (h + 1)-th iteration, is the partial derivative of, is the in the h-th iteration, represents the transpose of the matrix, represents the inverse of the matrix, represents the fitted spectrum obtained in the h-th iteration, is the simplified representation of the power spectral density, and the Jacobian matrix is the partial derivative matrix of the Gaussian objective function with respect to the parameter . Traverse the frequency points of the spectrum obtained by the periodogram method, execute the above process, and iterate continuously. When the change in the parameters between two adjacent iterations is less than the preset threshold of 0.1, it is considered that the parameters converge, and the fitted spectrum is obtained.

[0058] After obtaining the fitted curve through the Gauss-Newton algorithm, the centroid algorithm is used to determine the final peak point by calculating the centroid position of the spectrum, which can avoid the interference of the spectrum sidelobes caused by the posture and improve the accuracy of frequency estimation. Find the two peak points with the largest and the second largest amplitudes on the fitted curve as the candidate peak points, and calculate the centroid for the neighborhood of each candidate peak point. The calculation formula is:

[0059] where, is the r-th candidate peak point, is the neighborhood frequency width. Calculate the distance between each candidate peak point and its centroid position, and select the candidate peak point with a small distance from the centroid position as the final peak point. Multiply the peak frequencies corresponding to the final peak points found in the respiration spectrum and the heartbeat spectrum by 60 to obtain the respiration rate and the heart rate.

[0060] The above process obtains the phase signal containing physiological information such as heartbeat and respiration from the original echo signal through a preprocessing step, realizes dynamic signal separation by designing an adaptive iterative decomposition algorithm, and suppresses the noise interference caused by turning body movements. First, analyze the frequency characteristics of the signal using the autocorrelation function and Fourier transform to obtain the central frequencies of the effective peak points in the spectrum. Adaptively modify the frequency influence degree according to the obtained central frequencies to minimize the sum of the bandwidths of the frequency components of each effective peak point. After the iteration is completed, decompose the phase signal using the optimal frequency influence degree, and select the respiration signal and the heartbeat signal from the decomposed signals according to the typical frequency ranges of respiration and heartbeat. This method improves the accuracy of signal separation, ensures that the separated respiration and heartbeat signals only contain the most important physiological information, and eliminates the influence of noise signals inside and outside the frequency band in the signal. Fit the spectrum using the Gauss-Newton algorithm, construct a nonlinear least-squares model, and adjust the parameters using gradient information to effectively reduce noise interference and improve the spectrum resolution. Then use the centroid algorithm to calculate the centroid position of the peak point of the fitted spectrum, and select the final peak point by comparing the distance between the candidate peak point and the centroid position, which can more accurately identify the peak in the spectrum, thereby accurately calculating the respiration rate and the heart rate.

[0061] In this embodiment, set the reflection intensity threshold to 50000000, and the threshold of the respiration energy respiratory to 0.12. Compare the size relationship between the monitoring data and the thresholds. When both the reflection intensity and the respiration energy respiratory are greater than the corresponding thresholds, it is determined that the potential target is a human target. Otherwise, it is determined that there is no human target in the radar monitoring range, and the values of the respiration rate and the heart rate are set to 0.

[0062] S3. The radar device uses the emqx middleware to send the vital sign data including the heart rate heartRate, the respiration rate breathRate, the respiration energy respiratory, the reflection intensity maxValue, and the time times (China Beijing time UTC+8) corresponding to this data to the time series database of the cloud server for storage, instead of a relational database such as MySQL. Because the characteristics of time series data are different from those of relational data, and the data flow is huge, a time series database needs to be used. And according to the database name, device code (the unique identifier of the device), data name, corresponding time, etc., each vital sign data of each person is stored separately according to the time node, which is more helpful for future query and acquisition.

[0063] S4. Four testers will be selected, including 2 male testers and 2 female testers, with a male-to-female ratio of 1:1. The device will be placed 0.8 - 1 m above the head of the bed to collect sleep data. At the same time, a sleep monitoring device will be worn to annotate the sleep state at the same moment. Data will be collected for 20 days for model training, validation, and testing.

[0064] The sleep data stored in the cloud server will be used to obtain the vital sign data of a certain person on a certain night for sleep prediction through the corresponding device database name, device code, and timestamp, and exported as a.CSV file. Each person's data for each day will be saved as a.CSV file. Sleep data with insufficient sleep data, power outages or network disconnections, and relatively weak data signals due to too far sleep positions will be excluded, and the data for each night will be manually annotated. The dataset will be divided into a training set, a validation set, and a testing set at a ratio of 4:1:1. An example of the annotated.CSV data is shown in Table 1.

[0065] Table 1 Example table of sleep data collected by radar

[0066] In Table 1, heartRate is the heart rate, breathRate is the respiratory rate, respiratory is the respiratory energy (to judge the strength of breathing), maxValue is the reflection intensity (to judge whether there is someone), label is the value to be annotated: 0 -> awake, 1 -> light sleep, 2 -> deep sleep, 3 -> eye movement, 4 -> no one. Normal sleep staging only includes the first four, but the radar is a fixed-point device, so the state of 4 -> no one is added.

[0067] Perform a biological clock-like function processing on the "Times" column in Table 1. The function is as follows:

[0068] Among them, A is the amplitude, representing the size of the peak value of the cosine value, cos is the cosine function, 2π represents a complete cycle change, is the period, representing the time required for one cycle (unit: minute), and its value is the total number of minutes calculated by the difference between the falling asleep time and the waking up time. In this way, the biological clock-like function of each person is different and has self-adaptability. is the number of minutes beyond the falling asleep time point. is the phase, representing the offset, with an initial value of 0. In actual applications, the phase can be set as needed.

[0069] Read the dataset and convert it into vital sign data in one-second groups. For heartRate, breaRate, respiratory, maxValue, Perform window processing. For example, the window data at time t is equal to the data list from [t - 30s, t + 30s], and the corresponding label is the label at time t. In this way, the input features contain both historical information and future information, which can more accurately predict the sleep label. Calculate the mean and variance for each column feature of the window to generate time series features. Then perform discrete Fourier transform (DFT) on the window data features, which can more effectively capture the global dependence relationship and energy compression characteristics in time series data. On this basis, calculate the mean and variance for each column feature of the window to generate frequency domain features. Finally, use the time series features and frequency domain features as the inputs for the two branches of the sleep staging prediction model (hereinafter referred to as DualResAtt-BiLSTM).

[0070] The above mean and variance incorporate the central tendency and distribution characteristics of the data into the feature set for model prediction, which helps to improve the prediction accuracy. The mathematical formulas for the mean and variance are as follows:

[0071]

[0072] Among them, represents the average value of the th type of feature in the window, takes values from 0 to 4 corresponding to the five features of heartRate, breaRate, respiratory, maxValue, and represents the number of data in the window. In this embodiment, the number of data in the window is 60, corresponding to the data from [t - 30s, t + 30s], is the sample variance of the th type in the window, that is, the unbiased estimate using as the denominator. represents the data value at the th moment of the th type of feature in the window.

[0073] S5. The overall process structure of the model DualResAtt-BiLSTM is as shown in Figure 5As shown, it mainly consists of a Bidirectional Long Short-Term Memory Network (BiLSTM), an Attention mechanism, a Linear layer, Layer Normalization, Dropout regularization, and a FeedForward layer. The processed temporal features and frequency domain features are input into the DualResAtt-BiLSTM model, where the batch size parameter is 64, the learning rate parameter is 0.001, the dimension of the input data is 5, the number of classes in the classification task is 5, and the random dropout ratio is 0.2.

[0074] S51. Concatenate the results obtained by performing the same processing on both the temporal features and the frequency domain features, and then input the concatenated result into the FeedForward layer for processing to output the final result. The processing procedures for the temporal features and the frequency domain features are the same. The following provides a detailed introduction to the processing procedures for both. Combining Figure 6 , the temporal features and the frequency domain features are respectively input into their corresponding BiLSTM models to learn the context information of the sleep features from two directions (forward and backward) of the sequence. The BiLSTM model structure is as Figure 6 shown. The input data needs to pass through a bidirectional LSTM, and the two results are processed to obtain . In the forward propagation layer, it is calculated once in the forward direction from time 1 to time t, and the output of the forward hidden layer at time t is saved . Figure 6 In , it represents the forward LSTM layer, u is the activation function sigmoid, to are all weight coefficients. The mathematical formula for this step is as follows:

[0075] In the backward propagation layer, it is calculated once in the backward direction from time t to time 1, and the output of the backward hidden layer at each time is saved. represents the backward LSTM layer. is the output of the backward hidden layer at time t. The mathematical formula for this step is as follows:

[0076] Finally, at each time, the outputs of the forward layer and the backward layer at the corresponding time are calculated to obtain the final result . This output combines the sequence information of the bidirectional inputs. The mathematical formula for this step is as follows:

[0077] S52. Input the temporal features and frequency domain features into the first fully connected layer for feature mapping respectively, so that their output dimensions are the same as those of the BiLSTM output, and make a residual connection with the BiLSTM output to alleviate the gradient disappearance problem in the deep model.

[0078] S53. Perform layer normalization and regularization operations on the output of S52. The normalization operation is performed on a single sample in a batch. It normalizes by calculating the mean and variance of the sample in the feature dimension, improving the training stability and accelerating convergence. Regularization is a technique to prevent overfitting. During training, 20% of the neurons are randomly discarded, which can increase the stability and generalization ability of the model. The layer normalization and regularization do not change the output shape, and the first layer of residual results are obtained.

[0079] S54. Input the first layer of residual results into the attention mechanism. It is a method that mimics the human visual and cognitive systems. It allows the neural network to focus on the relevant parts when processing the input data, performs weighted processing on the input data, and enables the model to automatically focus on the most relevant parts of the input sequence, so as to better understand and process the input sleep data. The attention mechanism of the present invention adopts the self-designed Gated Dynamic Attention (GDA), and the calculation formula is as follows: S541: Generate the query vector Q and the key vector K

[0080]

[0081] Among them, are the first weight matrix and the second weight matrix respectively, and H is the first layer of residual results; S542: Calculate the basic attention score based on the query vector Q and the key vector K

[0082]

[0083] Among them, D is the feature dimension, is the third weight matrix; S543: Generate the gating signal , and obtain the scalar gating signal by taking the average of the gating signal in the feature dimension

[0084]

[0085]

[0086] Among them, is the fourth weight matrix, is the bias vector, represents the sigmoid activation function; S544: Calculate the attention weights

[0087]

[0088] Among them, represents the dot product, represents the first dimension of

[0089] S545: Weighted aggregation of the first-layer residual results to obtain the result of the attention mechanism

[0090]

[0091] Among them, represents the time step, that is, the window length for window processing of the vital sign data.

[0092] S55. Expand the dimension of the result of the attention mechanism and broadcast it along the time step to make the output dimension consistent, and perform residual connection with the first-layer residual result, perform matrix addition, and perform layer normalization and regularization processing. The proportion of neurons discarded by regularization is still 20% to obtain the second-layer residual result.

[0093] S56. Reduce the dimension of the second-layer residual results obtained from the two branches, splice the dimension-reduced results of the two branches, and input the result into the feed-forward layer. First, use the second fully connected layer to integrate the information of the two feature channels, extract high-order features, then use the GELU activation function for non-linear transformation to increase the model's expression ability, then regularize and discard 20% of the neurons, and finally map it to the output space through the third fully connected layer to obtain the sleep staging result. The five states of sleep staging are 0 -> awake, 1 -> light sleep, 2 -> deep sleep, 3 -> REM, 4 -> no one, and find the mode of this time segment as the sleep state of this time segment.

[0094] The loss function used by the model is the cross-entropy loss function (Cross - Entropy Loss), and the optimizer uses the Adam (Adaptive Moment Estimation) optimization algorithm to optimize the parameters.

[0095] The cross-entropy loss function can measure the difference between the probability distribution predicted by the model and the probability distribution of the true label.

[0096]

[0097] Among them, represents the number of samples, C represents the number of categories, is the -th sample belonging to the -th class's true probability, is the probability that the model predicts the -th sample belongs to the -th class.

[0098] The Adam adaptive learning rate optimization algorithm combines the advantages of the AdaGrad and RMSProp algorithms. The Adam optimizer maintains two moving averages for each parameter: the first-moment estimate (mean) and the second-moment estimate (uncentered variance), and adaptively adjusts the learning rate of each parameter based on these estimates.

[0099] As Figure 7 shown is the confusion matrix of the prediction results. Among them, the horizontal axis is the predicted label, and the vertical axis is the true label. According to Figure 7 the data in it, the accuracy of sleep stage prediction can be calculated to be 89.4%. Among them, the accuracy of wakefulness is 97.63%, the accuracy of light sleep is 92.48%, the accuracy of deep sleep is 87.09%, the accuracy of REM sleep is 74.43%, and the accuracy of no person is 98.01%. It can be concluded that the sleep stage classification method based on radar signals and deep learning has relatively high accuracy for wakefulness and no person predictions. The analysis believes that when there is a person and there is overall movement, the radar returns a relatively large signal value. When there is no person, the heart rate and respiration become 0, and such distinct feature values are helpful for the model's learning. However, the prediction accuracy for light sleep, deep sleep, and REM sleep is relatively low. The analysis believes that there are many objective variable factors, such as the height of the radar device from the person's head, the sleeping posture of the person lying down, the size of the bed, the distance of rolling over during sleep, etc., which will all affect the accuracy of the prediction effect.

[0100] Figure 8 (a) is a schematic diagram of the true labels of sleep stages, and Figure 8 (b) is a schematic diagram of the prediction results of the present invention. There are only a few differences in the trends between the two. It can be seen that the method proposed by the present invention has a good prediction effect on sleep stage classification. Among them, the abscissa is the sample number, and data is collected once per second, so the sample number also corresponds to the sampling time.

[0101] S6. Finally, return the prediction results and the corresponding timestamps to the front end for interface rendering and effect display. As Figure 9 shown is the mobile phone display of the 5-class results of the sleep stage prediction by this model. Figure 9 It not only shows the states of wakefulness, light sleep, deep sleep, REM sleep, but also shows the state of no person, and calculates the proportion of each state and the number of body movements. Such an intuitive display is more helpful for people to understand their own sleep states.

[0102] Through the above technical solutions, the present invention performs non-contact monitoring of vital signs, reduces the contact between people and devices, and can obtain high-precision vital sign data such as heart rate, respiratory rate, respiratory energy, and reflection intensity without any perception. On this basis, the vital sign data is preprocessed to generate time series features and frequency domain features. The DualResAtt-BiLSTM model simultaneously models the time series and frequency domain features through a dual-branch structure, uses BiLSTM to capture the time series dependence relationship, and the attention mechanism enhances the model's attention to the key time series information or frequency domain information in the sequence. The residual connection and layer normalization ensure the stable transmission of information and efficient training. By feature fusion, multi-dimensional information is integrated to improve the model's ability to discriminate sleep stages, and can quickly and accurately generate sleep staging results without contact, and can be viewed at any time on the mobile phone, which helps to understand the body's sleep situation.

[0103] Embodiment 2 Embodiment 2 of the present invention further provides a non-contact sleep staging device, including a processor and a memory. The memory stores computer program instructions that can be executed by the processor. When the processor executes the computer program instructions, the method steps described in Embodiment 1 are implemented.

[0104] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A non-contact sleep staging method, characterized in that, Including: S1. Place the radar device at a designated position and power it on; S2. Process the echo signal of the radar device to obtain vital sign data; the vital sign data includes heart rate, respiratory rate, respiratory energy, reflection intensity, and the time corresponding to this data; Obtain the phase signal containing heartbeat and respiration and the reflection intensity from the echo signal of the radar device; separate the respiration and heartbeat signals from the phase signal and calculate the respiratory energy; for the respiration and heartbeat signals, use the fast Fourier transform to convert the signals from the time domain to the frequency domain, and then use the Gauss-Newton algorithm and the centroid algorithm to find the respiratory frequency and heartbeat frequency, and further calculate the respiratory rate and heart rate; S3. Send the vital sign data to the cloud server for storage; S4. Export the vital sign data and process it into time series features and frequency domain features; S5. Build a sleep stage prediction model. The time series features and frequency domain features are input into the sleep stage prediction model. The sleep stage prediction model processes the time series features and frequency domain features using the same branch structure, splices the obtained results, and then inputs the spliced result into the feedforward layer for processing to output the final sleep stage prediction result; among them, the processing process of the branch structure is: the features are input into the BiLSTM model and the first fully connected layer. After the output results of the two are connected by residual, layer normalization operation and regularization operation are performed to obtain the first layer residual result. Among them, the regularization operation randomly discards neurons with a preset ratio; the first layer residual result is input into the attention mechanism and dimension expansion is performed. The result after dimension expansion is connected with the first layer residual result by residual, matrix addition is performed, and layer normalization and regularization processing are performed to obtain the second layer residual result. The second layer residual result is subjected to dimension reduction processing as the processing result of the branch structure.

2. The non-contact sleep staging method according to claim 1, characterized in that The obtaining of the phase signal containing heartbeat and respiration and the reflection intensity from the echo signal of the radar device includes: Amplify, mix, and perform analog-to-digital conversion on the echo signal of the radar device to form a coherent signal containing heartbeat and respiration. Perform maximum amplitude extraction on the coherent signal. The maximum amplitude extraction is to extract the energy peak of a single frame signal from the coherent signal and directly use it as the reflection intensity; use the arctangent function to extract the phase of each frame of coherent signal, and arrange the phases extracted from each frame in chronological order to form a phase signal.

3. The non-contact sleep staging method according to claim 1, wherein, The separating of the respiration and heartbeat signals from the phase signal and the calculation of the respiratory energy include: Calculate the autocorrelation function according to the phase signal, and perform a Fourier transform on the autocorrelation function to obtain its autocorrelation spectrum , sort all the peak points within the autocorrelation spectrum in descending order of amplitude, set the autocorrelation threshold to one-tenth of the maximum amplitude, identify the peak points greater than the autocorrelation threshold as valid peak points, and record the center frequencies of the valid peak points; the phase signal decomposition is based on the center frequencies of the valid peak points and the bandwidths of the signal components corresponding to each center frequency to decompose the phase signal into the number of signal components equal to the number of valid peak points; initially, a set of frequency influence degrees is given, use the frequency influence degrees to adjust the bandwidths of each signal component, decompose the phase signal, calculate the sum of the bandwidths of all signal components after being adjusted by the frequency influence degrees, the objective function is to minimize the sum of the bandwidths of all signal components after being adjusted by the frequency influence degrees, and the constraints in the decomposition process include that the sum of all frequency influence degrees is equal to 1 and the difference between the sum of the decomposed signal components and the phase signal is less than the threshold; update the frequency influence degrees, continue the next decomposition, calculate the sum of the bandwidths of all signal components after being adjusted by the frequency influence degrees in the next time, and iterate continuously until the iteration times are reached or the difference between the sum of the decomposed signal components and the phase signal is less than the decomposition threshold, then stop the update, select the grouping situation of the frequency influence degrees when the objective function value is the smallest to adjust the bandwidths of the signal components and decompose the phase signal into the number of signal components equal to the number of valid peak points; Select the signal components with frequencies within the breathing signal frequency range from the decomposed signal components as the breathing signal, and select the signal components with frequencies within the heartbeat signal frequency range from the decomposed signal components as the heartbeat signal; if there are multiple signal components with frequencies within the breathing signal frequency range or the heartbeat signal frequency range, calculate the energy proportion of the frequencies of each signal component within the entire breathing signal frequency range or heartbeat signal frequency range respectively in the autocorrelation spectrum of the phase signal, and select the signal component with the highest energy proportion within the breathing signal frequency range as the breathing signal, and select the signal component with the highest energy proportion within the heartbeat signal frequency range as the heartbeat signal; perform weighted fusion on the current breathing signal and the breathing signal obtained from the previous processing to obtain the breathing energy; among them, the method for calculating the energy proportion is based on the frequency of the signal component as the center, find the left frequency point when its amplitude drops to half of the peak and the right frequency point, then the frequency band width of the signal component is , integrate within the frequency band width to obtain the frequency band energy of the signal component. The energy of the entire breathing frequency range or heartbeat frequency range is calculated in the same way as above, so as to compare the frequency band energy of the signal component with the energy of the breathing frequency range to obtain the energy proportion of the frequencies of each signal component within the entire breathing signal frequency range; compare the frequency band energy of the signal component with the energy of the heartbeat frequency range to obtain the energy proportion of the frequencies of each signal component within the entire heartbeat signal frequency range.

4. The non-contact sleep staging method according to claim 3, wherein The objective function is ; The expression of the constraint conditions for the decomposition process is ; where is the number of effective peak points, represents the center frequency of the th effective peak point, , is the frequency influence degree of the th, is the signal component corresponding to the fth center frequency, m is the sampling point within the interval [0, M - 1], M is the phase signal length, is 's analytic signal, , represents the Hilbert transform, j is the imaginary unit, is the first-order forward difference and , is the decomposition threshold, represents the square of the L2 norm; is the phase signal, is the sign of the constraint condition, is the bandwidth of the th signal component, is the difference result between the sum of the decomposed signal components and the phase signal.

5. The non-contact sleep staging method according to claim 1, characterized in that For the respiration and heartbeat signals, using the fast Fourier transform to convert the signals from the time domain to the frequency domain and then using the Gauss-Newton algorithm and the centroid algorithm to find the respiratory frequency and heartbeat frequency, and further calculating the respiratory rate and heart rate, includes: The processing procedures for the respiration signal and the heartbeat signal are the same. That is, after performing a fast Fourier transform on the signal, the periodogram method is used to estimate the power spectral density of the signal. The Gaussian-Newton algorithm is used to fit the power spectral density. After obtaining the fitting curve, the two peak points with the largest and the second largest amplitudes are found on the fitting curve as candidate peak points, and the centroid is calculated in the neighborhood of each candidate peak point; the distance between each candidate peak point and its centroid position is calculated, and the candidate peak point with a small distance from the centroid position is selected as the final peak point; the peak frequencies corresponding to the final peak points found from the power spectral density of the respiration signal and the power spectral density of the heartbeat signal are multiplied by 60 to obtain the respiration rate and the heart rate.

6. The non-contact sleep staging method according to claim 1, wherein S4 includes: Input the time in the vital sign data into the biological clock-like function to generate corresponding biological clock-like time features. Read a set of vital sign data values every second. Read out the vital sign data and perform window processing on the vital sign data with a preset step size. Each window contains the data of the previous n seconds and the next n seconds of the current moment. Each column of the window is vital sign data of different types, and each row is the time corresponding to various vital sign data. Calculate the mean and variance directly for each column feature of the window to generate time series features. After performing discrete Fourier transform on the data of the window, calculate the mean and variance for each column feature of the window again to generate frequency domain features. Among them, the formula of the biological clock-like function is , is the biological clock-like time feature, A is the amplitude, is the period, is the number of minutes exceeding the bedtime point, is the phase.

7. The non-contact sleep staging method according to claim 1, characterized in that The feed-forward layer uses the second fully connected layer to integrate the information of the two branch structures, then uses the GELU activation function for non-linear transformation, then uses a regularization operation to discard a preset proportion of neurons, and finally maps the remaining neurons to the third fully connected layer to obtain the sleep stage prediction result.

8. A non-contact sleep staging method according to claim 1, characterized in that The processing procedure of the attention mechanism is as follows: S541: Generate the query vector Q and the key vector K Among them, are the first weight matrix and the second weight matrix respectively, and H is the residual result of the first layer; S542: Calculate the basic attention score based on the query vector Q and the key vector K where D is the feature dimension, is the third weight matrix; S543: Generate a gating signal , and obtain a scalar gating signal by averaging the gating signal in the feature dimension Among them, represents the th feature dimension, is the fourth weight matrix, is the bias vector, represents the sigmoid activation function; S544: Calculate attention weights Among them, represents the dot product, represents taking for the first dimension of S545: Weighted aggregation of the first-layer residual results to obtain the result of the attention mechanism where t represents the time at moment t, represents the time step, that is, the window length for window processing of the vital sign data.

9. A non-contact sleep staging device, characterized in that, It includes a processor and a memory. The memory stores computer program instructions that can be executed by the processor. When the processor executes the computer program instructions, the method steps described in any one of claims 1-8 are implemented.

Citation Information

Patent Citations

  • Noncontact sleep monitoring device based no ultrawide-band radar and noncontact sleep staging method based on ultrawide-band radar

    CN109480787A

  • Sleep staging method and device based on radar signal

    CN118490182A

  • Non-contact sleep staging identification and structural analysis method and system

    CN119418952A

  • Method for determining large-plastic bending section profile curve of thin-walled pipe

    CN108332681A

  • Apnea detection model training method based on time domain and frequency domain generative adversarial network

    CN114841217A

Cited By

  • Indoor temperature adjusting method and system based on sleep habit analysis

    CN120744394A