Data processing method, device and system of sleep staging algorithm based on BCG signal
Through the sleep staging algorithm based on BCG signals, the fiber optic sensor mattress and PSG equipment are used to collect signals, combined with feature extraction and screening algorithms to generate accurate sleep staging reports, which solves the comfort and accuracy problems of existing equipment and improves the accuracy of sleep monitoring.
Patent Information
- Application Number
- CN202510868652.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-10-10
AI Technical Summary
Existing sleep monitoring equipment has poor comfort. Contact-type equipment causes discomfort and has large data errors, while non-contact equipment is expensive and susceptible to interference, resulting in low test result accuracy.
A sleep staging algorithm based on BCG signals is adopted. The BCG signals are collected using a fiber optic sensor mattress system, combined with PSG equipment to collect sleep staging signals. Feature extraction and screening are performed through data processing equipment. Filtered correlation deletion, L1 regularized logistic regression and random forest algorithms are used to generate a sleep staging model and output a report.
It improves the accuracy and reliability of sleep staging, and solves the problems of low test accuracy caused by the poor comfort of traditional equipment and the susceptibility of non-contact equipment to interference.
Smart Images

Figure CN120753629A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical technology applications, and in particular to a data processing method, device and system for a sleep staging algorithm based on BCG signals. Background Art
[0002] The existing sleep monitoring equipment is mainly divided into: contact and non-contact, among which,
[0003] Contact sensors need to be attached to human skin to monitor physiological signals. For example, in a polysomnography device, subjects need to wear multiple sensors connected by wires during sleep monitoring. The electrodes are pressed tightly against the subject's skin, which not only causes significant discomfort and a sense of restraint to the subject, but also affects the validity of the data.
[0004] In the existing non-contact detection technology, sleep monitoring devices that use cameras to measure body movement are used to estimate sleep stages. However, since these devices have difficulty detecting weak rapid eye movement (REM) sleep, they can only classify sleep into three stages: wakefulness, light sleep, and deep sleep. In addition, another non-contact sleep monitoring system uses 64 impact sensors arranged in a matrix to provide comprehensive health status from real-time to long-term sleep quality, breathing, heart rate, body movement, blood oxygen, etc. However, the equally spaced sensors increase costs and may cause discomfort to users.
[0005] Obviously, the contact-type sleep monitoring devices in the existing technology may cause users to feel uncomfortable during use, and the interference caused by the user's instinctive reaction to the discomfort may cause errors in the collected data or signals; and non-contact sleep monitoring devices not only monitor a wide range of data, but also have the problem of high design and / or manufacturing costs.
[0006] Currently, there is no effective solution to the problems of poor comfort of traditional sleep monitoring equipment and susceptibility of existing non-contact technology to interference, which leads to low accuracy of test results. Summary of the Invention
[0007] The purpose of the present invention is to address the deficiencies in the existing technology and provide a data processing method, device and system for a sleep staging algorithm based on BCG signals, so as to solve the technical problems of low test accuracy caused by the poor comfort of traditional sleep monitoring equipment and the susceptibility of existing non-contact technology to interference.
[0008] To achieve the above object, the technical solution adopted by the present invention is:
[0009] The present invention provides a data processing system for a sleep staging algorithm based on a BCG signal, comprising: a fiber optic sensor mattress system, a PSG device, and a data processing device, wherein the fiber optic sensor mattress system has a built-in Mach-Zehnder fiber interferometer for collecting BCG signals of a user while sleeping and transmitting the BCG signals to the data processing device; the PSG device is used to collect sleep staging signals of the user while sleeping and transmit the sleep staging signals to the data processing device; the data processing device is connected to the fiber optic sensor mattress system and the PSG device, respectively, for receiving the BCG signals and the sleep staging signals, generating a data set according to the BCG signals, extracting feature data from the BCG signals in the data set, and obtaining HRV feature data. , BRV feature data and CPC feature data; the feature set is sequentially screened using filtered correlation deletion, L1 regularized logistic regression and random forest algorithm to obtain a feature set after feature screening; the feature set after feature screening is feature standardized to obtain a feature-standardized feature set; the feature-standardized feature set is divided into a training set and a test set according to the proportion, and the set is input into the sleep staging model for training to obtain the sleep staging test results, and the sleep staging model is evaluated with accuracy, F1-score, AUC and Kappa coefficient as dimensions. If the evaluation passes and is verified by comparison with the sleep staging signal, a converged sleep staging model is obtained; the sleep staging report is output through the sleep staging model.
[0010] Optionally, the fiber optic sensor mattress system includes: a fiber optic sensor mattress and a main control board, wherein the fiber optic sensor mattress is used to obtain the BCG signal of the user when sleeping; the main control board is connected to the fiber optic sensor mattress and is used to transmit the BCG signal to the data processing equipment.
[0011] Optionally, the fiber optic sensor mattress includes: a laser, a 1×2 coupler, a sensing arm, a reference arm, a 3×3 coupler and a photodiode group, wherein the laser is used to emit light; the input end of the 1×2 coupler is connected to the laser, and the output end of the 1×2 coupler is connected to the input end of the sensing arm and the reference arm, for receiving light and dividing the light into two paths, the first path of light is transmitted to the sensing arm, and the second path of light is transmitted to the reference arm; the output ends of the sensing arm and the reference arm are respectively connected to the input end of the 3×3 coupler, for transmitting the first path of light and the second path of light to the 3×3 coupler; in the case where the photodiode group includes: a first photodiode, a second photodiode and a third photodiode, the output end of the 3×3 coupler is respectively connected to the input end of the first photodiode, the input end of the second photodiode and the input end of the third photodiode, for transmitting the first path of light and the second path of light to the 3×3 coupler. The second light path is coupled to obtain a first sub-path light, a second sub-path light, and a third sub-path light, and the first sub-path light is sent to a first photodiode, the second sub-path light is sent to a second photodiode, and the third sub-path light is sent to a third photodiode; the output ends of the first photodiode, the output ends of the second photodiode, and the output ends of the third photodiode are connected to a main control board, and are used to convert the first sub-path light, the second sub-path light, and the third sub-path light into electrical signals to obtain BCG signals, and send the BCG signals to the main control board; the optical fiber sensor mattress is also used when a user lies on the optical fiber sensor mattress, the user's body vibration will act on the sensing arm, causing a change in the optical path difference between the sensing arm and the reference arm, and the phase difference between the first light path and the second light path output by the sensing arm and the reference arm changes, causing a change in the intensity of the interference light, and a BCG signal is obtained according to the change in light intensity.
[0012] Further, optionally, the main control board includes: a fiber optic sensor interface, a power interface, a microcontroller unit and a communication module, wherein the input end of the fiber optic sensor interface is connected to the output end of the fiber optic sensor mattress, and the output end of the fiber optic sensor interface is connected to the input end of the microcontroller unit, for receiving the BCG signal and transmitting the BCG signal to the microcontroller unit; the output end of the microcontroller unit is connected to the input end of the communication module, for preprocessing the BCG signal according to a specific frequency through a bandpass filter to obtain a preprocessed BCG signal; the output end of the communication module is connected to the data processing device, for transmitting the preprocessed BCG signal to the data processing device; the power interface is respectively connected to the fiber optic sensor interface, the microcontroller unit and the communication module, for powering the fiber optic sensor interface, the microcontroller unit and the communication module.
[0013] Optionally, the data processing device is also used to extract the heart beat interval sequence from the BCG signal, perform feature extraction on the heart beat interval sequence according to the time domain, frequency domain and nonlinear dynamic characteristics to obtain HRV feature data; extract the respiratory interval from the BCG signal, perform feature extraction on the respiratory interval according to the time domain and frequency domain to obtain BRV feature data; obtain CPC feature data based on the fast Fourier transform frequency domain analysis according to the heart beat interval sequence and the respiratory interval; generate a feature set based on the HRV feature data, BRV feature data and CPC feature data.
[0014] Optionally, the data processing device is also used to perform Pearson correlation coefficient analysis on the feature set and construct a feature correlation matrix. If the correlation between two feature data is greater than a threshold, they are deleted through filtering correlation to retain the feature data with the highest value; the feature data with the highest value are subjected to L1 regularized logistic regression, and an L1 norm penalty term is added to the loss function to compress the coefficients of unimportant feature data to zero, thereby obtaining L1 regularized feature data; the L1 regularized feature data are evaluated for importance through a random forest algorithm to obtain an importance ranking result; and the feature set is determined based on the importance ranking result.
[0015] The present invention provides a data processing method for a sleep staging algorithm based on BCG signals, which is applied to a data processing system for a sleep staging algorithm based on BCG signals. The method comprises: receiving a BCG signal sent by a fiber optic sensor mattress system, and receiving a sleep staging signal sent by a PSG device; generating a data set according to the BCG signal, and extracting feature data of the BCG signal in the data set to obtain a feature set consisting of HRV feature data, BRV feature data, and CPC feature data; sequentially performing feature screening on the feature set using filtered correlation deletion, L1 regularized logistic regression, and a random forest algorithm to obtain a feature set after feature screening; performing feature standardization on the feature set after feature screening to obtain a feature-standardized feature set; dividing the feature-standardized feature set into a training set and a test set according to a ratio, inputting the set into a sleep staging model for training, obtaining a sleep staging test result, and evaluating the sleep staging model using accuracy, F1-score, AUC, and Kappa coefficient as dimensions. If the evaluation passes and verification is passed by comparison with the sleep staging signal, a converged sleep staging model is obtained; and outputting a sleep staging report through the sleep staging model.
[0016] Optionally, a data set is generated based on the BCG signal, and feature data is extracted from the BCG signal in the data set to obtain a feature set consisting of HRV feature data, BRV feature data and CPC feature data, including: extracting the heartbeat interval sequence from the BCG signal, performing feature extraction on the heartbeat interval sequence according to the time domain, frequency domain and nonlinear dynamic characteristics to obtain HRV feature data; extracting the respiratory interval from the BCG signal, performing feature extraction on the respiratory interval according to the time domain and frequency domain to obtain BRV feature data; obtaining CPC feature data based on the heartbeat interval sequence and the respiratory interval, performing fast Fourier transform frequency domain analysis; generating a feature set based on the HRV feature data, BRV feature data and CPC feature data.
[0017] Optionally, the feature set is sequentially subjected to feature screening using filtered correlation deletion, L1 regularized logistic regression, and random forest algorithm, and the feature set obtained after feature screening includes: performing Pearson correlation coefficient analysis on the feature set, constructing a feature correlation matrix, and if the correlation between two feature data is greater than a threshold, performing filtered correlation deletion to retain the feature data with the highest value; performing L1 regularized logistic regression on the retained feature data with the L1 norm penalty term added to the loss function to compress the coefficients of unimportant feature data to zero, and obtaining L1 regularized feature data; performing importance evaluation on the L1 regularized feature data using the random forest algorithm to obtain an importance ranking result; and determining the feature set based on the importance ranking result.
[0018] Optionally, feature standardization is performed on the feature set after feature screening to obtain the feature-standardized feature set, which includes: subtracting the mean of each feature from the value of each feature in the feature set after feature screening to obtain a difference; and dividing the difference by the standard deviation of the corresponding feature to obtain the feature-standardized feature set.
[0019] The present invention adopts the above technical solution, by receiving BCG signals sent by the optical fiber sensor mattress system and receiving sleep staging signals sent by the PSG device; generating a data set based on the BCG signals, and extracting feature data of the BCG signals in the data set to obtain a feature set consisting of HRV feature data, BRV feature data, and CPC feature data; sequentially using filtered correlation deletion, L1 regularized logistic regression, and random forest algorithm to perform feature screening on the feature set to obtain a feature set after feature screening; performing feature standardization on the feature set after feature screening to obtain a feature-standardized feature set; dividing the feature-standardized feature set into a training set and a test set according to a ratio, inputting the set into a sleep staging model for training, obtaining sleep staging test results, and evaluating the sleep staging model based on accuracy, F1-score, AUC, and Kappa coefficient. If the evaluation passes and is verified by comparison with the sleep staging signal, a converged sleep staging model is obtained; outputting a sleep staging report through the sleep staging model, compared with the existing technology, has the following technical effects: improving the accuracy and reliability of sleep staging. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a schematic diagram of a data processing system for a sleep staging algorithm based on BCG signals according to a first embodiment of the present invention;
[0021] Figure 2 2 is a schematic diagram of data processing in a data processing system for a sleep staging algorithm based on BCG signals according to a first embodiment of the present invention;
[0022] Figure 3 1 is a circuit diagram of a fiber Mach-Zehnder interferometer in a data processing system for a sleep staging algorithm based on BCG signals according to a first embodiment of the present invention;
[0023] Figure 4 2 is a schematic diagram of data transmission in a data processing system for a sleep staging algorithm based on BCG signals according to a first embodiment of the present invention;
[0024] Figure 5 2 is a schematic diagram of the change of 5-minute RR interval over time in a data processing system of a sleep staging algorithm based on BCG signals according to the first embodiment of the present invention;
[0025] Figure 6 2 is a schematic diagram of feature engineering in a data processing system for a sleep staging algorithm based on BCG signals according to the first embodiment of the present invention;
[0026] Figure 7 2 is a schematic diagram of feature correlation after BCG-PSG dataset screening in a data processing system for a sleep staging algorithm based on BCG signals according to the first embodiment of the present invention;
[0027] Figure 8 2 is a schematic diagram of a confusion matrix in a data processing system for a sleep staging algorithm based on BCG signals according to a first embodiment of the present invention;
[0028] Figure 9 4 is a flow chart of a data processing method for a sleep staging algorithm based on BCG signals according to a second embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the present application is described and illustrated below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely used to explain this application and are not intended to limit this application. Based on the embodiments provided in this application, all other embodiments obtained by those of ordinary skill in the art without making any creative efforts are within the scope of protection of this application.
[0030] Obviously, the drawings described below are merely examples or embodiments of the present application. Those skilled in the art can, without inventive effort, apply the present application to other similar scenarios based on these drawings. Furthermore, it is also understood that, although the effort involved in such a development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this application, changes in design, manufacturing, or production based on the technical content disclosed in this application are merely conventional technical means and should not be construed as an insufficiency of the content disclosed in this application.
[0031] References to "embodiments" in this application mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it refer to independent or alternative embodiments that are mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described in this application may be combined with other embodiments unless there is a conflict.
[0032] Unless otherwise defined, the technical or scientific terms used in this application should have the ordinary meaning understood by a person of ordinary skill in the technical field to which this application belongs. The words "a", "an", "a", "the" and the like used in this application do not indicate a limit on quantity and may indicate the singular or plural. The terms "include", "comprise", "have" and any variations thereof used in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or units (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units that are inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The words "multiple" / "several" used in this application refer to two or more. "And / or" describes the association relationship between associated objects, indicating that three relationships can exist. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, or B exists alone. The character " / " generally indicates that the objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific order for the objects.
[0033] Example 1
[0034] An exemplary embodiment of the present invention is as follows Figure 1 As shown, Figure 1 2 is a schematic diagram of a data processing system for a sleep staging algorithm based on a BCG signal according to a first embodiment of the present invention. The data processing system for a sleep staging algorithm based on a BCG signal provided in this embodiment of the present application includes:
[0035] The optical fiber sensor mattress system 12, the PSG device 14 and the data processing device 16, wherein the optical fiber sensor mattress system 12 has a built-in Mach-Zehnder optical fiber interferometer for collecting the BCG signal of the user when sleeping and transmitting the BCG signal to the data processing device 16; the PSG device 14 is used to collect the sleep stage signal of the user when sleeping and send the sleep stage signal to the data processing device 16; the data processing device 16 is connected to the optical fiber sensor mattress system 12 and the PSG device 14 respectively, for receiving the BCG signal and the sleep stage signal, generating a data set according to the BCG signal, extracting feature data of the BCG signal in the data set, and obtaining HRV feature data and BRV feature data. The sleep staging model is constructed by using the sleep staging data and the CPC feature data as the dimensions; the feature set is sequentially screened using the filtered correlation deletion, L1 regularized logistic regression and random forest algorithm to obtain the feature set after feature screening; the feature set after feature screening is feature standardized to obtain the feature standardized feature set; the feature standardized feature set is divided into a training set and a test set according to the proportion, and the set is input into the sleep staging model for training to obtain the sleep staging test results, and the sleep staging model is evaluated with accuracy, F1-score, AUC and Kappa coefficient as the dimensions. If the evaluation passes and is verified by comparison with the sleep staging signal, a converged sleep staging model is obtained; the sleep staging report is output through the sleep staging model.
[0036] Specifically, such as Figure 2 As shown, Figure 2 This is a schematic diagram of data processing in a data processing system for a sleep staging algorithm based on BCG signals according to Example 1 of the present invention. The data processing system for a sleep staging algorithm based on BCG signals, provided in this embodiment of the application, synchronously collects sleep data using a fiber optic sensor mattress system 12 and a PSG device 14, establishing a dataset that provides a foundation for subsequent research. Secondly, during signal preprocessing, the collected sleep signals undergo preprocessing, including filtering to remove high-frequency noise, separating and extracting respiratory and heartbeat signals, and removing baseline drift to improve signal quality. Next, during feature extraction and feature engineering, the RR interval is extracted from the preprocessed signals to extract time-domain, frequency-domain, and nonlinear features of HRV, time-domain and frequency-domain features of BRV signals, and CPC features. Feature selection and importance ranking are performed using filtered correlation removal, L1-regularized logistic regression, and a random forest algorithm. Finally, during classification algorithm evaluation, a machine learning classification algorithm is selected, and multi-dimensional metrics are used to comprehensively evaluate the model's performance. Finally, during the sleep staging method testing process, the performance of the machine learning model based on multi-feature fusion was optimized through a feature increment strategy, gradually increasing the number of features to determine the optimal feature combination, thereby improving the model accuracy.
[0037] Optionally, the fiber optic sensor mattress system 12 includes: a fiber optic sensor mattress and a main control board, wherein the fiber optic sensor mattress is used to obtain the BCG signal of the user when sleeping; the main control board is connected to the fiber optic sensor mattress and is used to transmit the BCG signal to the data processing device 16.
[0038] Optionally, the fiber optic sensor mattress includes: a laser, a 1×2 coupler, a sensing arm, a reference arm, a 3×3 coupler and a photodiode group, wherein the laser is used to emit light; the input end of the 1×2 coupler is connected to the laser, and the output end of the 1×2 coupler is connected to the input end of the sensing arm and the reference arm, for receiving light and dividing the light into two paths, the first path of light is transmitted to the sensing arm, and the second path of light is transmitted to the reference arm; the output ends of the sensing arm and the reference arm are respectively connected to the input end of the 3×3 coupler, for transmitting the first path of light and the second path of light to the 3×3 coupler; in the case where the photodiode group includes: a first photodiode, a second photodiode and a third photodiode, the output end of the 3×3 coupler is respectively connected to the input end of the first photodiode, the input end of the second photodiode and the input end of the third photodiode, for transmitting the first path of light and the second path of light to the 3×3 coupler. The second light path is coupled to obtain a first sub-path light, a second sub-path light, and a third sub-path light, and the first sub-path light is sent to a first photodiode, the second sub-path light is sent to a second photodiode, and the third sub-path light is sent to a third photodiode; the output ends of the first photodiode, the output ends of the second photodiode, and the output ends of the third photodiode are connected to a main control board, and are used to convert the first sub-path light, the second sub-path light, and the third sub-path light into electrical signals to obtain BCG signals, and send the BCG signals to the main control board; the optical fiber sensor mattress is also used when a user lies on the optical fiber sensor mattress, the user's body vibration will act on the sensing arm, causing a change in the optical path difference between the sensing arm and the reference arm, and the phase difference between the first light path and the second light path output by the sensing arm and the reference arm changes, causing a change in the intensity of the interference light, and a BCG signal is obtained according to the change in light intensity.
[0039] Further, optionally, the main control board includes: an optical fiber sensor interface, a power supply interface, a microcontroller unit and a communication module, wherein the input end of the optical fiber sensor interface is connected to the output end of the optical fiber sensor mattress, and the output end of the optical fiber sensor interface is connected to the input end of the microcontroller unit, for receiving the BCG signal and transmitting the BCG signal to the microcontroller unit; the output end of the microcontroller unit is connected to the input end of the communication module, for preprocessing the BCG signal according to a specific frequency through a bandpass filter to obtain a preprocessed BCG signal; the output end of the communication module is connected to the data processing device 16, for transmitting the preprocessed BCG signal to the data processing device 16; the power supply interface is respectively connected to the optical fiber sensor interface, the microcontroller unit and the communication module, for powering the optical fiber sensor interface, the microcontroller unit and the communication module.
[0040] Specifically, such as Figure 3 As shown, Figure 3 1 is a circuit diagram of a fiber Mach-Zehnder interferometer in a data processing system for a sleep staging algorithm based on BCG signals according to a first embodiment of the present invention.
[0041] The fiber optic sensor mattress system in the embodiment of the present application is composed of an MZI-BCG sensor pad (i.e., the fiber optic sensor mattress in the embodiment of the present application) and a main control board. The MZI-BCG sensor is composed of a fiber optic sensor and acrylic material. The main control board includes an MZI-BCG sensor interface (i.e., the fiber optic sensor interface in the embodiment of the present application), a power interface, an STM32 microcontroller unit (MCU) (i.e., the microcontroller unit in the embodiment of the present application) and a wifi module for transmitting data (i.e., the communication module in the embodiment of the present application). The core of the MZI-BCG sensor mattress in the embodiment of the present application is a fiber Mach-Zehnder interferometer (MZI), which consists of a 1×2 coupler (in Figure 3 Coupler) and 3×3 coupler (in Figure 3 In the figure, it is represented as 3×3Coupler). Figure 3 Lens) through the laser (in Figure 3 Laser is injected into the 1×2 coupler of Mach-Zehnder interferometer (MZI) and then passes through the sensing arm (in Figure 3 Signal arm) and reference arm (in Figure 3 After the interference light is split into three signals, which are detected by three photodiodes (in Figure 3 When a user (i.e., the user in the embodiment of the present application) lies on a mattress with an embedded Mach-Zehnder interferometer sensor, sleep-related signals are monitored by detecting tiny changes in the optical fiber caused by human body vibration. The system has a sampling rate of 1000Hz, capable of capturing signal changes with extremely high temporal resolution; its sensitivity reaches 0.01m / s 2 , which can accurately sense the micro-vibration signals generated by the chest and back. In this way, it can effectively record biomechanical signals closely related to human cardiopulmonary activity, providing key data for subsequent in-depth analysis of the dynamic changes of cardiopulmonary related indicators during sleep.
[0042] When the user lies on the mattress, the micro-vibration signal generated by the body is transferred to the embedded MZI, changing the output light intensity and converting the optical signal into an electrical signal, from which the BCG signal is obtained.
[0043] In this embodiment of the present application, a fiber-optic sensor-based sleep monitoring system is constructed to collect physiological signals related to micro-vibrations of the human body, such as heartbeat, breathing, and cardiopulmonary coupling. Using the fiber-optic sensor mattress system and clinical data (i.e., the sleep staging signals collected by the PSG device in this embodiment of the present application), a medical-grade professional device, polysomnography (PSG), is used to synchronously collect sleep data with the fiber-optic sensor mattress system. By integrating the fiber-optic sensor mattress system with the PSG sleep staging label data, a sleep dataset (i.e., the dataset in this embodiment of the present application) is constructed for model training.
[0044] as well as,
[0045] The mixed signal collected by the fiber optic sensor mattress system is preprocessed. First, the original signal is filtered through a 10Hz zero-phase-shift low-pass filter to remove high-frequency noise while retaining the low-frequency components in the signal. A band-pass filter is designed and applied to effectively separate and extract the breathing and heartbeat signals from the signal, and the averaging method is used to remove the signal baseline drift.
[0046] Optionally, the data processing device 16 is also used to extract the heart beat interval sequence from the BCG signal, perform feature extraction on the heart beat interval sequence according to the time domain, frequency domain and nonlinear dynamic characteristics to obtain HRV feature data; extract the respiratory interval from the BCG signal, perform feature extraction on the respiratory interval according to the time domain and frequency domain to obtain BRV feature data; obtain CPC feature data based on the fast Fourier transform frequency domain analysis according to the heart beat interval sequence and the respiratory interval; generate a feature set based on the HRV feature data, BRV feature data and CPC feature data.
[0047] Specifically, such as Figure 4 As shown, Figure 4 Schematic diagram of data transmission in a data processing system for a sleep staging algorithm based on BCG signals according to the first embodiment of the present invention, wherein the optical fiber sensor mattress system 12 and the PSG device 14 ( Figure 4 Not shown) and data processing equipment 16 ( Figure 4 In the figure, the cloud is shown. In addition, any terminal with data processing capabilities may be applied to the data processing system of the sleep staging algorithm based on BCG signals provided in the embodiment of the present application, such as a computer, a server, a server cluster, etc., to achieve data transmission through a network connection.
[0048] In summary, the present embodiment, based on BCG signal feature extraction, deeply mines multidimensional features from the BCG signal, including time domain, frequency domain, and nonlinear dynamic characteristics, generating a total of 49 candidate features. These 49 candidate features reflect the activity status of the human body's physiological systems, such as the heart and lungs, during sleep from different perspectives, providing rich data information for the construction of sleep monitoring models.
[0049] The feature set consisting of HRV feature data, BRV feature data, and CPC feature data obtained in this embodiment of the application is specifically as follows:
[0050] First, extraction of HRV feature data:
[0051] Heart rate variability (HRV) is an important indicator for measuring the functional state of the autonomic nervous system. The dynamic changes in HRV characteristic data during sleep can reflect the neural regulation characteristics of different sleep stages.
[0052] Sympathetic and parasympathetic nervous system activity fluctuates periodically during the sleep cycle, resulting in significant differences in HRV profiles across different sleep stages. During NREM sleep, particularly deep sleep stage N3, parasympathetic nervous system activity is heightened, leading to significant increases in HRV indices (such as RMSSD and HF power). During REM sleep, sympathetic nervous system activity is stimulated, leading to a relative decrease in HRV, manifested by an increase in the LF / HF ratio. This alternating pattern of autonomic nervous system activity reflects the physiological rhythms of sleep and contributes to the restorative nature of sleep.
[0053] BCG signals can provide similar results to ECG (i.e., sleep staging signals collected by PSG devices) in HRV analysis, supporting BCG as a viable alternative to long-term heart rate monitoring. The HRV characteristic data in the embodiments of this application is an important physiological indicator reflecting the dynamic balance of the sympathetic and parasympathetic nerves of the autonomic nervous system by analyzing the fluctuation characteristics of the RR interval wave interval in the BCG signal.
[0054] The method for extracting HRV feature data in the embodiment of the present application is based on calculating the HRV index based on the RR interval of a 5-minute time window, and segmenting and labeling with a 30-second sliding window. Figure 5 As shown, Figure 5 This is a schematic diagram of the change in RR interval over time over 5 minutes in a data processing system for a sleep staging algorithm based on BCG signals according to Example 1 of the present invention. In this embodiment of the application, a sliding window method is used to extract HRV features. The HRV features of each 30-second segment are calculated based on the RR interval data within 150 seconds before and after the center (a total of 5 minutes) to improve the stability and temporal continuity of the features. Although feature extraction involves contextual information before and after, the sleep stage label of the segment still corresponds to the 30-second segment itself, ensuring temporal consistency between the features and the labels.
[0055] The time domain analysis of heart rate variability calculates the RR interval of each heartbeat to obtain a series of characteristic indicators to represent the variability. The main time domain features include: Mean_RR and Med_RR represent the mean and median of the RR interval respectively, SDNN represents the standard deviation of the RR interval, which measures the overall volatility of HRV, RMSSD_RR is the root mean square of the difference between consecutive RR intervals, SDSD_RR is the standard deviation of the difference between consecutive RR intervals, ARV_RR is the average value of the absolute difference between adjacent RR intervals, reflecting the short-term changes in the RR interval, and pNN50 is the proportion of the total intervals in which the difference between two adjacent RR intervals is greater than 50ms. The above indicators reflect the differences between adjacent RR intervals. The embodiment of the present application extracts a total of 8 features from the time domain of HRV feature data, as shown in Table 1.
[0056] Table 1
[0057]
[0058] Frequency domain analysis of HRV evaluates autonomic nervous activity by calculating the energy distribution of RR intervals in different frequency bands. High frequency (0.15-0.4Hz) reflects vagus nerve function and is closely related to breathing; low frequency (0.0033-0.14Hz) is related to sympathetic nerves and blood pressure regulation; and very low frequency is related to chronic physiological processes such as body temperature regulation. The ratio of low-frequency to high-frequency power can reflect the level of sympathetic tension. The embodiment of the present application extracts 5 eigenvalues from the frequency domain, as shown in Table 2:
[0059] Table 2
[0060]
[0061] It is difficult to fully characterize HRV characteristics by using only time domain or frequency domain features. Therefore, the introduction of nonlinear analysis methods helps to reveal its dynamic complexity in depth. The present embodiment extracts five eigenvalues from nonlinearity, as shown in Table 3:
[0062] Table 3
[0063]
[0064] Second, extraction of BRV feature data:
[0065] During sleep, respiratory activity is regulated by the central nervous system, and its variability shows a clear sleep-stage dependency. BRV characteristic data show significant differences across sleep stages. During NREM, respiratory rhythms are relatively regular and less variable, while during REM, respiratory variability is higher, reflecting increased sympathetic nervous system activity and instability in respiratory regulation.
[0066] The BRV feature data extraction method in the embodiment of the present application includes time domain features and frequency domain features. In the time domain features, by statistically analyzing the time interval of each respiratory cycle in the respiratory signal waveform, the average respiratory cycle, standard deviation, coefficient of variation, etc. are extracted to describe the stability and variation of the respiratory rhythm. The embodiment of the present application extracts 6 eigenvalues from the time domain, as shown in Table 4:
[0067] Table 4
[0068]
[0069] In terms of frequency domain characteristics, the main frequency analysis focuses on the main frequency components of the respiratory signal, usually 0.1-0.3Hz corresponds to the normal respiratory frequency range. During sleep, the main frequency will drift as the sleep stage changes. In sleep staging applications, BRV feature data can be used for the accurate detection of apnea and hypopnea events, which is crucial for the diagnosis of diseases such as sleep apnea hypopnea syndrome. At the same time, in the REM period, by quantifying respiratory irregularities, the sleep stage can be judged more accurately, providing strong support for the accurate division of sleep stages. The embodiment of the present application extracted 5 eigenvalues from the frequency domain, as shown in Table 5 below:
[0070] Table 5
[0071]
[0072] Third, extraction of CPC feature data:
[0073] There is a certain coupling relationship between ECG signals and respiratory activity. This coupling is typically enhanced during deep sleep, while during wakefulness, light sleep, or certain pathological conditions, the coupling characteristics between the two change, exhibiting different patterns. From a physiological perspective, respiratory sinus arrhythmia (RSA) exists between heart rate and respiration, and the coupling strength and phase relationship vary significantly across different sleep stages. CPC feature data analysis provides a new perspective for exploring the physiological mechanisms of sleep. The main feature extraction methods include frequency domain analysis, phase synchronization analysis, and multi-scale entropy analysis.
[0074] This embodiment of the application constructs a sliding window-based cardiopulmonary coupling feature extraction framework based on the Fast Fourier Transform (FFT) frequency domain analysis method. The input data includes a preprocessed RR interval sequence and respiratory signal. The specific steps are as follows:
[0075] First, the median absolute deviation (MAD) method was used to detect outliers in the input RR interval data and respiratory signals, and linear interpolation was used to correct them. Subsequently, the data was captured using a sliding window method (with a window length of 5 minutes and a step size of 30 seconds). Both types of signals were uniformly resampled to a 1000Hz sampling rate using pchip interpolation to obtain time-aligned, equally spaced signals.
[0076] Then, after removing the trend term, the Welch method was used to estimate the power spectral density (P xx With P yy ), and calculate the cross power spectrum P of the two xy From this, we can obtain the coherence spectrum (Coherence) and the cardiopulmonary coupling spectrum CPC(f), and the calculation formula is as follows:
[0077]
[0078] The CPC spectrum reflects the coupling strength between the heart and lungs at different frequencies. Frequency domain indicators such as band integrated power, peak power, and peak frequency were then calculated in three frequency bands (very low frequency (VLF): 0-0.01Hz, low frequency (LF): 0.01-0.1Hz, and high frequency (HF): 0.1-0.4Hz). Distribution parameters such as the dominant frequency, center of gravity frequency, median frequency, and bandwidth of the spectrum were also extracted, along with statistical features such as standard deviation, skewness, and kurtosis. A total of 19 features were extracted, as shown in Table 6:
[0079] Table 6
[0080]
[0081] As shown above, the fiber optic sensor mattress system and PSG equipment are used to collect sleep-related signals. Signal preprocessing includes low-pass filtering, band-pass filtering, and peak detection to extract effective heartbeat and respiratory features. Experimental verification shows good measurement consistency between the fiber optic sensor mattress system and the PSG equipment. This fiber optic sensor mattress system provides reliable data support for subsequent sleep staging analysis and cardiopulmonary function research.
[0082] It should be noted that the above examples in the embodiments of the present application are described with reference to the most preferred examples, and are based on the data processing system for implementing the sleep staging algorithm based on BCG signals provided in the embodiments of the present application, without any specific limitation.
[0083] In the embodiments of the present application, the feature set after feature screening is normalized. In the process of obtaining the normalized feature set, the feature set after feature screening is normalized using the Z-score method using StandardScaler. That is, for each feature, the mean of each feature is subtracted from its value, and the resulting difference is then divided by the standard deviation of each feature. The result is that the feature is converted into a distribution with a mean of 0 and a standard deviation of 1. The Z-score method in StandardScaler is a functional module in Python software.
[0084] Data features often have different numerical ranges and units (dimensions), which will cause many machine learning models (especially those based on distance or gradient) to favor features with large numerical values. The data processing system of the sleep staging algorithm based on BCG signals in the embodiment of the present application performs feature normalization on the feature set after feature screening in order to eliminate these scale differences, ensure that all features are treated "fairly", and improve model performance.
[0085] Optionally, the data processing device 16 is also used to perform Pearson correlation coefficient analysis on the feature set and construct a feature correlation matrix. If the correlation between two feature data is greater than a threshold, they are deleted through filtering correlation to retain the feature data with the highest value; the feature data with the highest value are subjected to L1 regularized logistic regression, and an L1 norm penalty term is added to the loss function to compress the coefficients of unimportant feature data to zero, thereby obtaining L1 regularized feature data; the L1 regularized feature data are evaluated for importance through a random forest algorithm to obtain an importance ranking result; and the feature set is determined based on the importance ranking result.
[0086] Specifically, such as Figure 6 As shown, Figure 6 This is a schematic diagram of feature engineering in a data processing system of a sleep staging algorithm based on BCG signals according to Example 1 of the present invention. In order to reduce the redundancy between features and improve the generalization ability of the classification model, a filtering method is first used for preliminary screening. Specifically, a Pearson correlation coefficient analysis is performed on all features, a feature correlation matrix is constructed, and a threshold is set to 0.8 (i.e., the threshold in the embodiment of the present application). When the correlation between two features exceeds the threshold, only one feature with a clearer physiological significance or higher modeling value (i.e., the highest value in the embodiment of the present application) is retained, thereby eliminating redundant features and reducing the impact of multicollinearity on model performance.
[0087] To ensure the effectiveness of features after correlation filtering, this embodiment of the application introduces L1 regularized logistic regression to further screen and optimize the remaining features. L1 regularized logistic regression is an embedded feature selection method that adds an L1 norm penalty term to the loss function to compress the coefficients of unimportant features to zero, achieving feature selection and dimensionality compression. This improves the sparsity, generalization ability, and interpretability of the model, making it suitable for high-dimensional data and able to partially capture the interactions between features.
[0088] After completing the preliminary dimensionality reduction, the embodiment of the present application further uses a random forest classifier to evaluate the importance of features. As an integrated learning method, random forest has powerful nonlinear modeling capabilities and high robustness. Its feature importance evaluation mechanism is based on the contribution of the feature to the improvement of model purity (such as Gini impurity or information gain) at the split node, or its impact on the model prediction accuracy, thereby effectively sorting the importance of the features. Compared with linear models, random forests can better capture high-order interactions between features, further improving the comprehensiveness and stability of feature evaluation.
[0089] In a preferred example:
[0090] (1) Correlation screening results:
[0091] The BCG-PSG dataset retains 21 features from 49 eigenvalues, including SampEn; in the cardiopulmonary coupling frequency feature, the original CPC_MF is replaced with the more intuitive CPC_PF. The Pearson correlation coefficients between specific features are as follows: Figure 7 As shown, Figure 7 3 is a schematic diagram of feature correlation after BCG-PSG data set screening in a data processing system of a sleep staging algorithm based on BCG signals according to embodiment 1 of the present invention.
[0092] (2) Regularization results: In the two-stage task of the BCG-PSG dataset, the features removed include CPC_VLFP, CPC_VLFPF, and CPC_LFPF. These cardiopulmonary coupling spectrum features may have limited recognition in the coarse-grained division of wakefulness and sleep states, or lack sufficient stability. In the three-stage task, the removal of CPC_VLFPF and CPC_HFPF shows that although most of the coupling spectrum features are retained, the peak information of specific frequency bands has limited value in distinguishing wakefulness, light sleep, and deep sleep states. In the four-stage task, the removal of CPC_VLFPF and CPC_LFPF continues the trend of weakening the low-frequency and very low-frequency peak frequency features. With the increase of classification granularity, the discriminative ability of features is required to be more detailed, and these peak-type features are greatly affected by the ambiguity of sleep stage transitions. Therefore, they show high uncertainty in the segmentation task and are eventually eliminated by the L1 regularization mechanism. In the embodiment of the present application, the two stages correspond to the wakefulness period and the sleep period; the three stages correspond to the wakefulness period (W), rapid eye movement (REM), and non-rapid eye movement (NREM); the four stages correspond to the wakefulness period (W), rapid eye movement, light sleep, and deep sleep;
[0093] Among them, the importance scores of the top 5 eigenvalues after L1 regularization of the BCG-PSG dataset are shown in Table 7:
[0094] Table 7
[0095]
[0096] Table 7 shows that after L1 regularization, the models in the BCG-PSG dataset highly relied on cardiopulmonary coupling features in all phases. In phase two, high-frequency coupling features CPC_HFP and CPC_HFPF were the most important, reflecting their core role in discriminating between wakefulness and sleep. In phase three, CPC_BW and CPC_HFP maintained their leading position, while the nonlinear features SampEn and spectral peak CPC_PF increased in importance, indicating a stronger need for joint modeling of coupling strength and system complexity. In phase four, CPC_HFPF and CPC_PF significantly led the way, while low-frequency coupling (CPC_VLFP) and complexity features (SD2 / SD1) ranked highly, indicating an increased reliance on multi-band coupling and dynamic complexity information for high-resolution sleep recognition.
[0097] (3) Random Forest Feature Importance Ranking Results: Random Forest's feature importance ranking results for different sleep staging tasks in the BCG-PSG dataset are shown in Table 8. A comparative analysis reveals that Mean_RR ranks high across all tasks, demonstrating high stability and being one of the most critical HRV features. Furthermore, pNN50 and Mean_BR also consistently maintain high importance scores in the classification task, demonstrating their broad applicability and robustness across different tasks and data sources.
[0098] Table 8
[0099]
[0100] The BCG-PSG dataset shows a more balanced feature ranking. In addition to HRV and respiration features, complexity features such as SampEn and ApEn rose significantly in the third and fourth stage tasks, reflecting the importance of signal complexity in sleep state discrimination under high-quality PSG annotation. Furthermore, frequency-domain energy features such as heart_TP and resp_TP ranked highly in the BCG-PSG dataset, demonstrating their ability to capture rhythmic changes in autonomic nervous system activity in PSG.
[0101] In summary, BCG-PSG focuses more on the description capability of signal complexity and frequency domain power.
[0102] It should be noted that the heart rate interval is extracted from the preprocessed BCG signal, and the time domain, frequency domain and nonlinear characteristics of HRV are calculated based on the sequence; the respiratory interval is extracted from the respiratory signal, the BRV sequence is constructed, and its time domain and frequency domain characteristics are calculated; as well as the CPC feature data. After the calculated feature set is standardized, the training set and the test set are divided based on the stratified sampling method. In the embodiment of the present application, feature engineering is used to select feature values. The specific process includes applying filtered correlation deletion, L1 regularized logistic regression and random forest algorithm to the training set in sequence for feature selection and importance ranking.
[0103] In the embodiment of the present application, the sleep staging model can be an XGBoost model or a LightGBM model;
[0104] In order to explore the optimal parameter combination of the model and thus improve the prediction effect of the model, the grid search cross validation (GridSearchCV) technology can be used. GridSearchCV is a parameter optimization method based on cross validation. It exhaustively searches all possible combinations within the specified parameter range and uses cross validation to evaluate the performance of each combination to find the best hyperparameter configuration.
[0105] Specifically, the steps are as follows:
[0106] (1) Parameter range setting: When using GridSearchCV, it is necessary to first determine the parameters to be optimized and their possible value intervals. For example, in the XGBoost algorithm, the parameter range can be set as learning_rate between 0.1, 0.01, 0.001, max_depth between 3, 5, 7, and subsample between 0.8, 0.9, 1.0. In this way, GridSearchCV can comprehensively explore different combinations of these parameters to determine the optimal combination of hyperparameters.
[0107] (2) Cross-validation: GridSearchCV uses cross-validation to measure the performance of each parameter combination, and K-fold cross-validation is commonly used. The process is as follows: divide the dataset into K non-overlapping subsets of similar size; each time use K-1 subsets as training data and the remaining 1 subset as test data; train the model on the training data and evaluate it on the test data to obtain the performance indicator of the model in this fold; repeat the above steps K times, each time changing a different test subset; finally, take the average of the K results as the performance indicator of the model. In this paper, to improve computational efficiency, the embodiment of the present application uses 3-fold cross-validation to evaluate the performance of the model. This method controls the computational cost while ensuring the robustness and reliability of the validation process.
[0108] (3) Parameter combination traversal: GridSearchCV will try all possible combinations of parameters in the range and perform cross-validation evaluation on each parameter combination to obtain the performance indicators of the model under different parameter combinations, such as accuracy, F1-score, etc.
[0109] (4) Optimal parameter determination: According to the results of GridSearchCV cross-validation, select the best parameter combination as the final parameter of the model, which is usually the combination that makes the performance indicator optimal in the entire parameter range.
[0110] Through this method, GridSearchCV conducts a thorough search in the parameter space to determine the optimal parameter combination that can enhance the performance and generalization ability of the model. However, since it must exhaust all possible parameter combinations, when the number of parameters is large or the size of the dataset is large, the computational cost may increase significantly, resulting in a corresponding increase in the required time.
[0111] In Python, GridSearchCV is often used in conjunction with the Scikit-learn library. Scikit-learn provides the GridSearchCV class, which makes grid search and cross-validation easy. Simply pass the model, parameter range, and scoring criteria to the GridSearchCV object and call its fit method to perform cross-validation within the parameter range. For each parameter combination, GridSearchCV performs cross-validation, calculates model performance metrics, and averages these metrics as the performance evaluation result for that parameter combination.
[0112] In the embodiment of this application, the model parameter setting is based on the XGBoost model or the LightGBM model as an example:
[0113] (1) Model parameter setting of XGBoost model:
[0114] The hyperparameters of the XGBoost algorithm are crucial to model performance and generalization. Key hyperparameters include the number of spanning trees (n_estimators), the learning rate (eta or learning_rate), the maximum tree depth (max_depth), the minimum sample weight for leaf nodes (min_child_weight), the subsample ratio (subsample), the column sampling ratio (colsample_bytree), gamma (minimum split loss), reg_alpha (L1 regularization), and reg_lambda (L2 regularization). These hyperparameters optimize model performance by controlling model complexity, overfitting risk, and training speed. For example, increasing the number of spanning trees improves expressiveness but may lead to overfitting; lowering the learning rate helps generalization but requires more iterations; limiting the maximum tree depth prevents overfitting; and adjusting the minimum sample weight for leaf nodes, subsamples, and column sampling ratios introduces randomness, reduces the risk of overfitting, and improves robustness. Table 9 shows the hyperparameter settings:
[0115] Table 9
[0116]
[0117] LightGBM is also based on a gradient boosting framework, but it uses a histogram approximation algorithm and a leaf node depth-based growth strategy to improve training speed and resource utilization. Its hyperparameters are similar to those of XGBoost, but it performs better when processing large-scale datasets. Unique hyperparameters include the number of histogram buckets (num_leaves) and feature fraction (feature_fraction), which give it advantages in large-scale datasets and high-dimensional data scenarios, such as e-commerce recommendation systems and financial risk analysis. The hyperparameter settings are shown in Table 10:
[0118] Table 10
[0119]
[0120] For tasks involving large datasets and high-dimensional features, both XGBoost and LightGBM offer excellent performance, but LightGBM may have advantages in terms of training speed and memory usage. Therefore, in practical applications, you can choose the most suitable algorithm based on the specific requirements of the task and the characteristics of the data, and further optimize model performance by properly adjusting its hyperparameters.
[0121] The main classification metrics of the sleep staging model in this embodiment are sensitivity, specificity, and accuracy. For the sleep staging classification problem, the true categories of the sleep staging test data set and the categories predicted by the sleep staging model classifier can be combined to classify them into true positive examples (TP), false positive examples (FP), true negative examples (TN), and false negative examples (FN).
[0122] Confusion matrix: Taking the binary stage as an example, the corresponding confusion matrix is as follows Figure 8 As shown, Figure 8 1 is a schematic diagram of a confusion matrix in a data processing system of a sleep staging algorithm based on BCG signals according to the first embodiment of the present invention. TP is the number of correctly predicted sleep states as sleep states, FP is the number of incorrectly predicted sleep states as wake states, FN is the number of incorrectly predicted wake states as sleep states, and TN is the number of correctly predicted wake states as wake states.
[0123] The confusion matrix can intuitively represent the correspondence between predictions and true categories, but its complexity increases significantly in multi-classification scenarios. To more intuitively present model performance, the confusion matrix is often converted into a series of core metrics: accuracy (Acc), precision (Precision), recall (Recall), F1-score, and Kappa coefficient, to comprehensively and concisely evaluate the performance of the classification model.
[0124] Accuracy (Acc) refers to the proportion of correct sleep and wakefulness predictions to the total data, and is calculated as follows:
[0125]
[0126] Precision refers to the ratio of actual sleep among all predicted sleep, and is calculated as follows:
[0127]
[0128] Recall refers to the proportion of correct sleep predictions to all correct predictions, also known as the true class rate, and is calculated as follows:
[0129]
[0130] F1-score takes into account the model's precision and recall, and is calculated by calculating the harmonic mean of the two. The calculation of F1-score is as follows:
[0131]
[0132] The Kappa coefficient (Cohen's Kappa coefficient) is used to measure the consistency between the classification model prediction results and the actual labels. It is particularly suitable for correcting the evaluation of random consistency in multi-classification tasks. The calculation is as follows:
[0133]
[0134] where p o is the observed consistency (i.e., the proportion of correct model predictions), p e To calculate the expected consistency (i.e. the probability of predicting the correct answer in a random situation), we use the marginal distribution of the confusion matrix as follows:
[0135]
[0136]
[0137] The Kappa coefficient ranges from -1 to 1, with the following meanings: K = 1 indicates perfect agreement, with the double evaluations completely consistent with the true state; K = 0 indicates agreement consistent with random chance; and K < 0 indicates agreement below random chance. Therefore, the Kappa coefficient is important in evaluating the performance of classification models. Compared to accuracy, the Kappa coefficient better reflects a model's performance when dealing with class imbalance. Table 11 shows the range of Kappa coefficients K > 0 and the corresponding agreement level.
[0138] Table 11
[0139]
[0140] This embodiment of the application uses a feature importance ranking approach to gradually introduce features, evaluating the changes in classification performance of each model under different feature subsets. This method can be used to observe the model's dependence on key features, the limit of feature dimension on performance improvement, and the feature utilization efficiency of different models.
[0141] The embodiment of the present application analyzes the advantages and disadvantages of machine learning algorithms, combines the characteristics of experimental data sets, and considers the flexible response to the gradual increase in data complexity. During the model training process, a grid search cross-validation method is used to tune the hyperparameters. By systematically exploring the hyperparameter space, the optimal hyperparameter combination is found. The optimized model is evaluated using a test set to ensure its generalization ability on unseen data and further optimize the model's predictive performance. In terms of model evaluation, multi-dimensional indicators such as confusion matrix, accuracy, precision, recall rate, and F1-score are used to comprehensively measure the performance of the classification model to ensure the comprehensiveness and reliability of the evaluation results.
[0142] This embodiment of the application constructs a contactless sleep staging model based on BCG signals acquired by a fiber optic sensor mattress system. It systematically optimizes model performance using a feature-incrementing strategy. Results show that this strategy significantly improves both classification accuracy and computational efficiency. By gradually introducing discriminative features for the classification task, it effectively avoids the interference of redundant information on the model training process, enhancing the model's generalization and stability.
[0143] In the examples of this application, the LightGBM model demonstrated optimal performance across all sleep staging tasks, achieving the highest classification accuracy and fast training speed, making it suitable for large-scale data processing. XGBoost followed closely behind, also demonstrating high accuracy and good robustness.
[0144] In summary, combining the BCG signals collected by the fiber optic sensor mattress system with the feature increment strategy can effectively screen out the optimal feature subset and matching classification model, providing solid technical support for building a high-performance and efficient non-contact sleep staging system, which has good application prospects and promotion value.
[0145] The sleep staging signal collected by the PSG device is used as a basis for training the sleep staging model of the BCG, the accuracy of the BCG signal sleep staging is compared with the result of the PSG sleep staging, and the F1-score, AUC and Kappa coefficient and other dimensional indicators also meet the comparison requirements, so that the data processing system of the sleep staging algorithm based on the BCG signal in the embodiment of the application is more simple, practical and reliable.
[0146] The above technical scheme is adopted, the BCG signal sent by the optical fiber sensor mattress system is received, and the sleep staging signal sent by the PSG device is received; a data set is generated according to the BCG signal, and feature data extraction is performed on the BCG signal in the data set to obtain a feature set composed of HRV feature data, BRV feature data and CPC feature data; the feature set is sequentially subjected to feature screening using a filtering correlation deletion, an L1 regularization logistic regression and a random forest algorithm to obtain a feature set after feature screening; the feature set after feature screening is subjected to feature standardization to obtain a feature set after feature standardization; the feature set after feature standardization is divided into a training set and a test set according to a proportion, is input into a sleep staging model for training, sleep staging test results are obtained, and the sleep staging model is evaluated in terms of accuracy, F1-score, AUC and Kappa coefficient, if the evaluation passes and the comparison and verification with the sleep staging signal pass, a converged sleep staging model is obtained; the sleep staging report is output through the sleep staging model, and compared with the prior art, the following technical effects are obtained: the accuracy and reliability of sleep staging are improved.
[0147] Embodiment 2
[0148] An illustrative embodiment of the application is shown in Figure 9 Figure 9 is a flowchart of a data processing method of a sleep staging algorithm based on a BCG signal according to Embodiment Two of the application, applied to the data processing system of the sleep staging algorithm based on the BCG signal in Embodiment 1, the data processing method of the sleep staging algorithm based on the BCG signal provided in the embodiment of the application includes:
[0149] Step S900, receiving the BCG signal sent by the optical fiber sensor mattress system, and receiving the sleep staging signal sent by the PSG device;
[0150] Step S902, generating a data set according to the BCG signal, and performing feature data extraction on the BCG signal in the data set to obtain a feature set composed of HRV feature data, BRV feature data and CPC feature data;
[0151] Optionally, in step S902, a data set is generated based on the BCG signal, and feature data is extracted from the BCG signal in the data set to obtain a feature set consisting of HRV feature data, BRV feature data and CPC feature data, including: extracting the heartbeat interval sequence from the BCG signal, performing feature extraction on the heartbeat interval sequence according to the time domain, frequency domain and nonlinear dynamic characteristics to obtain HRV feature data; extracting the respiratory interval from the BCG signal, performing feature extraction on the respiratory interval according to the time domain and frequency domain to obtain BRV feature data; obtaining CPC feature data based on the fast Fourier transform frequency domain analysis based on the heartbeat interval sequence and the respiratory interval; generating a feature set based on the HRV feature data, BRV feature data and CPC feature data.
[0152] Step S904: filtering the feature set using filtering correlation deletion, L1 regularized logistic regression, and random forest algorithm in sequence to obtain a feature set after feature filtering;
[0153] Optionally, in step S904, the feature set is sequentially subjected to filtering-type correlation deletion, L1 regularized logistic regression, and random forest algorithm for feature screening, and the feature set obtained after feature screening includes: performing Pearson correlation coefficient analysis on the feature set, constructing a feature correlation matrix, and if the correlation between two feature data is greater than a threshold, performing filtering-type correlation deletion to retain the feature data with the highest value; performing L1 regularized logistic regression on the feature data with the highest value, adding an L1 norm penalty term to the loss function, compressing the coefficients of unimportant feature data to zero, and obtaining L1 regularized feature data; performing importance evaluation on the L1 regularized feature data through the random forest algorithm to obtain an importance ranking result; and determining the feature set based on the importance ranking result.
[0154] Step S906, performing feature standardization on the feature set after feature screening to obtain a feature-standardized feature set;
[0155] Optionally, in step S906, feature standardization is performed on the feature set after feature screening to obtain the feature-standardized feature set, which includes: subtracting the mean of each feature from the value of each feature in the feature set after feature screening to obtain the difference; and dividing the difference by the standard deviation of the corresponding feature to obtain the feature-standardized feature set.
[0156] Specifically, in the embodiments of the present application, the feature set after feature screening is normalized. In the process of obtaining the normalized feature set, the feature set after feature screening is normalized using the Z-score method using StandardScaler. That is, for each feature, the mean of each feature is subtracted from its value, and the resulting difference is then divided by the standard deviation of each feature. The result is that the feature is converted into a distribution with a mean of 0 and a standard deviation of 1. The Z-score method in StandardScaler is a functional module in Python software.
[0157] Data features often have different numerical ranges and units (dimensions), which will cause many machine learning models (especially those based on distance or gradient) to favor features with large numerical values. The data processing method of the sleep staging algorithm based on BCG signals in the embodiment of the present application performs feature normalization on the feature set after feature screening in order to eliminate these scale differences, ensure that all features are treated "fairly", and improve model performance.
[0158] In step S908, the standardized feature set is divided into a training set and a test set based on the ratio. The feature set is input into the sleep staging model for training to obtain the sleep staging test results. The sleep staging model is evaluated based on the accuracy, F1-score, AUC, and Kappa coefficient. If the evaluation passes and is verified by the sleep staging signal, a converged sleep staging model is obtained. The sleep staging model is used to output a sleep staging report.
[0159] In the embodiment of the present application, the ratio can be 80% and 20%, that is, 80% of the feature values in the feature set of feature standardization are divided into the training set, and 20% of the feature values in the feature set of feature standardization are divided into the test set. It should be noted that the ratio in the embodiment of the present application is only used as an example to illustrate the above example, and is based on the data processing method for implementing the sleep staging algorithm based on BCG signals provided in the embodiment of the present application, and is not specifically limited.
[0160] The present invention adopts the above technical solution, receives BCG signals sent by the optical fiber sensor mattress system, and receives sleep staging signals sent by the PSG device; generates a data set based on the BCG signals, and extracts feature data of the BCG signals in the data set to obtain a feature set consisting of HRV feature data, BRV feature data, and CPC feature data; sequentially uses filtered correlation deletion, L1 regularized logistic regression, and random forest algorithm to perform feature screening on the feature set to obtain a feature set after feature screening; performs feature standardization on the feature set after feature screening to obtain a feature-standardized feature set; divides the feature-standardized feature set and the sleep staging signal into a training set and a test set according to a ratio, inputs the set into a sleep staging model for training, obtains sleep staging test results, and evaluates the sleep staging model using accuracy, F1-score, AUC, and Kappa coefficient as dimensions. If the evaluation passes and is verified by comparison with the sleep staging signal, a converged sleep staging model is obtained; and outputs a sleep staging report through the sleep staging model. Compared with the existing technology, the present invention has the following technical effects: improving the accuracy and reliability of sleep staging.
[0161] The above description is only a preferred embodiment of the present invention and does not limit the implementation mode and protection scope of the present invention. For those skilled in the art, it should be aware that all solutions obtained by equivalent substitutions and obvious changes made using the description and illustrations of the present invention should be included in the protection scope of the present invention.
Claims
1. A data processing system for a sleep staging algorithm based on BCG signals, characterized in that: include: Fiber optic sensor mattress system, PSG equipment and data processing equipment, among which, The optical fiber sensor mattress system has a built-in Mach-Zehnder optical fiber interferometer for collecting BCG signals of the user while sleeping and transmitting the BCG signals to the data processing device; The PSG device is used to collect a sleep stage signal of the user while sleeping, and send the sleep stage signal to the data processing device; The data processing device is connected to the fiber optic sensor mattress system and the PSG device, respectively, and is used to receive the BCG signal and the sleep staging signal, generate a data set based on the BCG signal, extract feature data of the BCG signal in the data set, and obtain a feature set consisting of HRV feature data, BRV feature data, and CPC feature data; perform feature screening on the feature set using filtered correlation deletion, L1 regularized logistic regression, and random forest algorithm in sequence to obtain the feature set after feature screening; perform feature standardization on the feature set after feature screening to obtain the feature-standardized feature set; divide the feature-standardized feature set into a training set and a test set according to a ratio, input the set into a sleep staging model for training, obtain a sleep staging test result, and evaluate the sleep staging model based on accuracy, F1-score, AUC, and Kappa coefficient. If the evaluation passes and is verified by comparison with the sleep staging signal, a converged sleep staging model is obtained; and a sleep staging report is output through the sleep staging model.
2. The data processing system for the sleep staging algorithm based on BCG signals according to claim 1, characterized in that: The optical fiber sensor mattress system includes: an optical fiber sensor mattress and a main control board, wherein: The optical fiber sensor mattress is used to obtain the BCG signal of the user when sleeping; The main control board is connected to the optical fiber sensor mattress and is used to transmit the BCG signal to the data processing device.
3. The data processing system for the sleep staging algorithm based on BCG signals according to claim 2, characterized in that: The optical fiber sensor mattress includes: a laser, a 1×2 coupler, a sensing arm, a reference arm, a 3×3 coupler and a photodiode group, wherein: The laser is used to emit light; The input end of the 1×2 coupler is connected to the laser, and the output end of the 1×2 coupler is connected to the input ends of the sensing arm and the reference arm, for receiving the light and splitting the light into two paths, with the first path of light being transmitted to the sensing arm and the second path of light being transmitted to the reference arm; The output ends of the sensing arm and the reference arm are respectively connected to the input ends of the 3×3 coupler, so as to transmit the first light and the second light to the 3×3 coupler; In a case where the photodiode group includes: a first photodiode, a second photodiode, and a third photodiode, the output end of the 3×3 coupler is connected to the input end of the first photodiode, the input end of the second photodiode, and the input end of the third photodiode, respectively, to couple the first light path and the second light path to obtain a first sub-path of light, a second sub-path of light, and a third sub-path of light, and send the first sub-path of light to the first photodiode, send the second sub-path of light to the second photodiode, and send the third sub-path of light to the third photodiode; The output end of the first photodiode, the output end of the second photodiode, and the output end of the third photodiode are connected to the main control board, and are used to convert the first sub-path light, the second sub-path light, and the third sub-path light into electrical signals to obtain the BCG signal, and send the BCG signal to the main control board; The fiber optic sensor mattress is also used to: when the user lies on the fiber optic sensor mattress, the user's body vibration will act on the sensor arm, causing a change in the optical path difference between the sensor arm and the reference arm. The change in the phase difference between the first light and the second light output by the sensor arm and the reference arm causes a change in the intensity of the interference light, and the BCG signal is obtained based on the change in the light intensity.
4. The data processing system for the sleep staging algorithm based on BCG signals according to claim 3, characterized in that: The main control board includes: an optical fiber sensor interface, a power supply interface, a microcontroller unit and a communication module, wherein: The input end of the optical fiber sensor interface is connected to the output end of the optical fiber sensor mattress, and the output end of the optical fiber sensor interface is connected to the input end of the microcontroller unit, for receiving the BCG signal and transmitting the BCG signal to the microcontroller unit; The output end of the microcontroller unit is connected to the input end of the communication module, and is used to pre-process the BCG signal according to a specific frequency through a band-pass filter to obtain the pre-processed BCG signal; The output end of the communication module is connected to the data processing device, and is used to transmit the pre-processed BCG signal to the data processing device; The power supply interface is connected to the optical fiber sensor interface, the microcontroller unit and the communication module respectively, and is used to supply power to the optical fiber sensor interface, the microcontroller unit and the communication module.
5. The data processing system for the sleep staging algorithm based on BCG signals according to claim 4, characterized in that: The data processing device is also used to extract a heartbeat interval sequence from the BCG signal, perform feature extraction on the heartbeat interval sequence according to time domain, frequency domain and nonlinear dynamic characteristics to obtain the HRV feature data; extract respiratory intervals from the BCG signal, perform feature extraction on the respiratory intervals according to time domain and frequency domain to obtain the BRV feature data; obtain the CPC feature data based on the fast Fourier transform frequency domain analysis according to the heartbeat interval sequence and the respiratory interval; and generate the feature set based on the HRV feature data, the BRV feature data and the CPC feature data.
6. The data processing system for the sleep staging algorithm based on BCG signals according to claim 5, characterized in that: The data processing device is also used to perform Pearson correlation coefficient analysis on the feature set and construct a feature correlation matrix. If the correlation between two feature data is greater than a threshold, the feature data with the highest value is deleted through the filtering correlation to retain the feature data with the highest value; the feature data with the highest value is subjected to L1 regularized logistic regression, and an L1 norm penalty term is added to the loss function to compress the coefficients of unimportant feature data to zero, thereby obtaining L1 regularized feature data; the L1 regularized feature data is evaluated for importance through the random forest algorithm to obtain an importance ranking result; and the feature set is determined based on the importance ranking result.
7. A data processing method for a sleep staging algorithm based on BCG signals, characterized in that: The data processing system used for the BCG signal-based sleep staging algorithm includes: Receive BCG signals sent by the fiber optic sensor mattress system, and receive sleep stage signals sent by the PSG device; generating a data set according to the BCG signal, and extracting feature data of the BCG signal in the data set to obtain a feature set consisting of HRV feature data, BRV feature data, and CPC feature data; Performing feature screening on the feature set using filtered correlation deletion, L1 regularized logistic regression, and random forest algorithm in sequence to obtain the feature set after feature screening; Performing feature standardization on the feature set after feature screening to obtain the feature-standardized feature set; The standardized feature set is divided into a training set and a test set according to a ratio, and the sleep staging model is input into the training set to obtain the sleep staging test results. The sleep staging model is evaluated based on the accuracy, F1-score, AUC, and Kappa coefficient. If the evaluation passes and the comparison with the sleep staging signal passes, the converged sleep staging model is obtained; A sleep staging report is outputted using the sleep staging model.
8. The data processing method for the sleep staging algorithm based on BCG signals according to claim 7, characterized in that: Generating a data set based on the BCG signal and extracting feature data of the BCG signal in the data set to obtain a feature set consisting of HRV feature data, BRV feature data, and CPC feature data includes: Extracting a heartbeat interval sequence from the BCG signal, performing feature extraction on the heartbeat interval sequence according to time domain, frequency domain and nonlinear dynamic characteristics to obtain the HRV feature data; Extracting respiratory intervals from the BCG signal, performing feature extraction on the respiratory intervals according to the time domain and the frequency domain to obtain the BRV feature data; According to the heartbeat interval sequence and the respiratory interval, the CPC feature data is obtained based on fast Fourier transform frequency domain analysis; The feature set is generated based on the HRV feature data, the BRV feature data, and the CPC feature data.
9. The data processing method for the sleep staging algorithm based on BCG signals according to claim 8, characterized in that: The feature set is sequentially subjected to feature screening using filtered correlation deletion, L1 regularized logistic regression, and random forest algorithm, and the feature set obtained after feature screening includes: Performing a Pearson correlation coefficient analysis on the feature set to construct a feature correlation matrix. If the correlation between two feature data is greater than a threshold, the feature data is deleted through the filtering correlation method to retain the feature data with the highest value. Performing L1 regularized logistic regression on the feature data with the highest value, adding an L1 norm penalty term to the loss function, compressing the coefficients of unimportant feature data to zero, and obtaining L1 regularized feature data; The L1 regularized feature data is evaluated for importance using the random forest algorithm to obtain an importance ranking result; The feature set is determined based on the ranking result of the importance.
10. The data processing method for the sleep staging algorithm based on BCG signals according to claim 9, characterized in that: The step of performing feature standardization on the feature set after feature screening to obtain the feature-standardized feature set includes: Subtracting the mean of each feature from the value of each feature in the feature set after feature screening to obtain a difference; The difference is divided by the standard deviation of the corresponding feature to obtain the feature-standardized feature set.