Blood oxygen and heart rate monitoring system and method based on PPG signals and motion data
Through a multi-module system and deep learning model combining PPG signals and motion data, the motion state recognition and signal interference suppression of wearable devices in dynamic motion states is solved, high-precision blood oxygen and heart rate monitoring is achieved, and application scenarios are expanded.
Patent Information
- Application Number
- CN202510376829.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-03-28
Smart Images

Figure CN119896478B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical fields of medical health and intelligent wearable devices, and particularly to a blood oxygen and heart rate monitoring system and method based on PPG signals and motion data. Background Art
[0002] In recent years, the application of wearable devices in health detection and sports management has gradually become popular. Particularly, significant progress has been made in the real-time detection of physiological indicators such as blood oxygen and heart rate. However, most of the wearable devices on the market are mainly for health monitoring under static or simple motion conditions and fail to fully combine the dynamic motion state information of users, which poses challenges to the comprehensive practicality and multi-scenario adaptability of the devices. In the prior art, wearable devices have the following problems in the field of dynamic health monitoring: 1. Lack of motion state recognition function. Most wearable devices on the market focus on the detection of a single physiological indicator and fail to effectively recognize the motion state by combining motion sensor data. The motion state information is of great significance for interpreting the dynamic changes of physiological signals. 2. Insufficient signal interference suppression ability. The interference of motion artifacts and dynamic environmental noise on PPG (photoplethysmogram) signals has not been effectively solved, resulting in a decrease in the accuracy of blood oxygen and heart rate measurements. 3. Limited application scenarios. Due to the lack of adaptability to the motion state of existing devices, their application scenarios are mainly concentrated in static or low-intensity activities and cannot meet the health monitoring needs of users in dynamic scenarios such as sports and fitness. Based on the above deficiencies, this application provides a blood oxygen and heart rate monitoring system and method based on PPG signals and motion data. Summary of the Invention
[0003] In order to realize the motion state recognition function of wearable devices, improve the signal interference suppression ability, and broaden the application scenarios, this application provides a blood oxygen and heart rate monitoring system and method based on PPG signals and motion data.
[0004] In the first aspect, the blood oxygen and heart rate monitoring system based on PPG signals and motion data provided by this application adopts the following technical solutions:
[0005] A blood oxygen and heart rate monitoring system based on PPG signals and motion data, comprising:
[0006] A PPG signal acquisition module for acquiring red light, infrared light, and green light PPG signals;
[0007] A motion sensor module for acquiring the acceleration signal and angular velocity signal of the user;
[0008] A signal preprocessing module for denoising, removing baseline drift, and adaptive filtering to ensure signal quality;
[0009] A dynamic signal segmentation and quality assessment module for signal segmentation processing and evaluating signal quality through the peak-to-valley ratio and autocorrelation coefficient;
[0010] An oxygen saturation calculation module for calculating oxygen saturation based on an improved oxygen algorithm, high-quality red light, and infrared light PPG signals;
[0011] A heart rate calculation module for accurately detecting heart rate based on an improved heart rate algorithm, high-quality green light PPG signals, and motion state;
[0012] A motion state recognition module for recognizing the motion state of the human body based on a deep learning model, acceleration, and angular velocity data;
[0013] An adaptive Kalman filter module for smoothing blood oxygen and heart rate data through Kalman filtering to optimize real-time monitoring data;
[0014] An output display module for real-time displaying the results of oxygen saturation, heart rate, and motion state.
[0015] In a second aspect, the blood oxygen and heart rate monitoring method based on PPG signals and motion data provided by this application adopts the following technical solutions: It includes the following steps:
[0016] S1: Acquisition of PPG signals and motion data;
[0017] S2: Signal preprocessing;
[0018] S3: Improved calculation of oxygen saturation;
[0019] S4: Improved heart rate detection algorithm;
[0020] S5: Motion state recognition;
[0021] S6: Result output.
[0022] Preferably, the step S1: Acquisition of PPG signals and motion data includes:
[0023] S11: Acquisition of PPG signals, real-time acquisition of red light, infrared light, and green light PPG signals through sensors;
[0024] S12: Acquisition of motion data, using a three-axis accelerometer and gyroscope to obtain acceleration data and angular velocity data ;
[0025] S13: Data segmentation, sliding the collected data with 200 points, the window length is 800 points, and the sampling rate is 100Hz to obtain the segmented data , and 。
[0026] Preferably, the step S2: signal preprocessing includes:
[0027] S21: removing jumps from the PPG signal. By using an algorithm for removing discontinuity points, the jump noise between data frames is removed to ensure data continuity between data frames, thereby obtaining a continuous PPG signal and the corresponding acceleration and angular velocity data 、;
[0028] S22: removing baseline drift. By collecting the least squares method and fourth-order polynomial fitting, the baseline drift of the PPG signal is removed to obtain , and the formula is as follows: A(i, j) = ;
[0029] where i = [1:800], which is the length of the data frame; j = [1:4]; A(i, j) represents the jth power of i, which is a fourth-order polynomial matrix: coeff = ;
[0030] where represents the transpose of A, represents the inverse matrix of, and coeff is a 1×5 matrix coefficient; = coeff ;
[0031] S23: signal validity detection. For the newly collected 200-point data [601:800] in , judge the number of points exceeding the upper and lower thresholds ( and ). If the number of points exceeds a certain number P, then use the 200-point data of [401:600] to replace the 200-point data of [601:800], and obtain the output waveform marked as ; ;
[0032] S24: band-pass filtering. Perform band-pass filtering (0.8 - 3.5 Hz) on the PPG signal, acceleration, and angular velocity data respectively, and perform Z-Score normalization on the PPG signal to obtain data 、 、 , and the Z-Score normalization is as shown in the formula:
[0033] ;
[0034] where x is the original data point, μ is the mean of the data set; σ is the standard deviation of the data set; z is the result after normalization;
[0035] S25: Motion artifact removal. Based on the obtained and , use the least mean square algorithm for time-domain adaptive filtering. The input of the filter at the sampling point is as shown in the formula:
[0036] ;
[0037] where is the 3-axis acceleration signal of the accelerometer, is the 3-axis angular velocity signal of the gyroscope;
[0038] According to the input signal estimate the artifact signal , and remove these artifacts from the target signal . At the th sampling, the estimated artifact signal output by the filter is:
[0039] ;
[0040] where is the weight vector of the adaptive filter, and the net target signal output by the filter is: ;
[0041] The filter updates the filter weights through the error , ; ;
[0042] where is the step size parameter, which controls the speed of weight update. Repeat the above steps until the error converges to obtain the signal with motion artifacts removed, and thus obtain the PPG signal with motion artifacts removed;
[0043] S26: Downsampling. Downsample , and to 25 Hz to obtain the data .
[0044] Preferably, the step S3: Improved blood oxygen saturation calculation includes:
[0045] S31: Signal quality assessment. By calculating the peak-to-valley ratio and autocorrelation coefficient from the data of the red light part and the infrared light part in the signal , select high-quality signals for subsequent blood oxygen saturation calculation, peak-to-valley ratio is defined as:
[0046] ;
[0047] where is the peak value, is the valley value, calculate the average value of all peak-valley pairs as the peak-to-valley ratio of the overall signal:
[0048] ;
[0049] where is the number of peak-valley pairs detected within the window, is the peak-to-valley ratio of the th peak-valley pair;
[0050] Autocorrelation coefficient is as shown in the formula:
[0051] ;
[0052] ;
[0053] where, is the autocorrelation value of the signal at the time delay , represents the value of the PPG signal at the time point , is the total number of samples of the signal, ranges from 0 to , find the first significant main peak of the autocorrelation coefficient , when the PPG signal in the sliding window satisfies > and > , retain this segment of the signal, and are the set peak-to-valley ratio threshold and autocorrelation coefficient threshold respectively;
[0054] S32: Blood oxygen saturation calculation, based on the PPG signal, measure the ratio of oxygenated hemoglobin to reduced hemoglobin by using the absorption difference of light with different wavelengths passing through tissues, and calculate the blood perfusion rate of the red light data and the infrared light data ratio, the blood perfusion rate and the infrared light data are respectively as shown in the formula:
[0055] ;
[0056] ;
[0057] Among them, is the signal amplitude in the red light data, is the signal amplitude in the red light data, is the signal amplitude in the infrared light data, is the signal amplitude in the infrared light data;
[0058] Set the ratio of the red light perfusion rate to the infrared light perfusion rate as , The calculation formula of
[0059] ;
[0060] Through the gold standard blood oxygen measurement device, a deoxygenation experiment is carried out on the functional relationship between blood oxygen saturation and . For the blood oxygen saturation values and the corresponding values in the experimental data, the functional relationship between blood oxygen saturation and is obtained by fitting; if the functional polynomial of blood oxygen saturation and fitted by the experiment is a first-degree polynomial, then the reference formula for this first-degree polynomial:
[0061] ;
[0062] Among them, , are the coefficients of the first-degree polynomial to be fitted;
[0063] If the functional polynomial of blood oxygen saturation and values fitted by the experiment is a second-degree polynomial, then the reference formula for this second-degree polynomial:
[0064] ;
[0065] Among them, , , are the coefficients of the second-degree polynomial to be fitted;
[0066] S33: Blood oxygen saturation weighted calculation. In the sliding window, based on the peak valleys corresponding to each red light and infrared light, calculate the preliminary blood oxygen saturation , and use the historical blood oxygen saturation The initial calculated value is weighted to obtain the comprehensive blood oxygen saturation within the current window. , and the weighting formula is as follows:
[0067] ;
[0068] where represents the number of peak-valley pairs within the sliding window, is the adjustment parameter used to control the attenuation rate of the weight;
[0069] S34: Blood oxygen saturation smoothing processing. The calculated blood oxygen saturation is smoothed using adaptive Kalman filtering. Combining historical blood oxygen saturation data, the consistency of the time series is improved, and the process noise covariance and the observation noise covariance are dynamically adjusted to adapt to the uncertainties under different measurement conditions; Kalman filtering first performs parameter initialization, setting the initial blood oxygen estimation value as the initial measurement value of the system . The filtering process includes prediction and update. In the prediction step, based on the previous estimated value , the current blood oxygen prediction value and its covariance are calculated, that is:
[0070] ;
[0071] ;
[0072] where is the state transition matrix that describes the evolution of the system state. In the model of smooth change of blood oxygen saturation, is set to , indicating that there is no significant jump between the current blood oxygen saturation and the blood oxygen saturation at the previous moment. is the process noise covariance that reflects the uncertainty of the system. The residual is calculated through the current measurement value :
[0073] = ;
[0074] where is the observation matrix used to map the predicted state to the observation space and compare it with the current measurement value . In the model of smooth change of blood oxygen saturation, is set to ;
[0075] In the update step, first calculate the Kalman gain :
[0076] = ;
[0077] where, is the observation noise covariance, reflecting measurement uncertainty. Based on the Kalman gain, update the estimated blood oxygen saturation and covariance :
[0078] ;
[0079] ;
[0080] Dynamically update and by monitoring the estimated error and residual changes:
[0081] ;
[0082] ;
[0083] where, and are adjustment factors used to dynamically adjust the changes in process noise and observation noise.
[0084] Preferably, step S4: the improved heart rate detection algorithm includes:
[0085] S41: Signal frequency domain transformation. Perform 1024-point FFT transformation on the green light part data and acceleration data to intercept the spectrum data within [0.8 - 3.5] Hz, and perform maximum normalization on the acceleration data, restricting the value to the range of [0, 1] to obtain and ;
[0086] S42: Frame motion state calibration. Use the sum of squares mean of the three-axis acceleration data to compare with the thresholds and . Where, > . If > then determine that the current frame is a motion frame and calibrate the state weight = a; if < < Then calibrate the current frame as a micro-motion frame, and its state weight = b; If < Then calibrate the current frame as a relatively static frame, and its state weight = c, where 0 < a < b < c < 1, and a + b + c = 1, 、 The values of are calibrated by the user according to the accelerometer, The calculation formula of is as follows:
[0087] ;
[0088] Among them, ACCX, ACCY, and ACCZ are respectively The x, y, and z direction vectors of;
[0089] S43: Use double-layer frequency-domain Wiener filtering to further filter out the motion artifacts in the PPG signal in the frequency domain through the motion state characterized by the accelerometer. The process of Wiener filtering is as follows: First, calculate the Spectrum mean of the first N frames, and perform maximum normalization to obtain , and calculate the first-layer Wiener filtering weight :
[0090] = 1 - ( ) ;
[0091] Among them, Represents point division, calculate the second-layer Wiener filtering weight :
[0092] = ( );
[0093] For And The parts with weights less than 0 in are clamped to -1, and two filtering outputs are obtained using the two weights respectively:
[0094] = ;
[0095] =;
[0096] Among them, Represents dot product. For the above two filtering outputs, weighted fusion is performed according to the standard deviation to obtain the filtering output Of the current frame:
[0097] = ;
[0098] Among them, and are respectively and 's standard deviations. Subsequently, maximum normalization is performed on to obtain ;
[0099] S44: Joint adaptive weighted filtering, where the spectrum of the historical M frames is weighted according to three weights: Gaussian weight, state weight, and concentration weight;
[0100] Gaussian weight: Starting from the current data frame, generate the Gaussian weights of the previous M data frames. The Gaussian weight symbol is , where 1 < < M;
[0101] State weight: Use the corresponding to the historical M frames as the state weight, where 1 < < M;
[0102] Concentration weight: Use the peak concentration corresponding to the historical M frames as the concentration weight, where 1 < < M;
[0103] Among them, the peak concentration is obtained by summing the differences between the highest peak of the spectrum and its first 10 peaks . The highest peak needs to be excluded, and 2 < < 10. The calculation formula for the peak concentration of each data frame is as follows: ;
[0104] ;
[0105] Among them, the peak concentration is used to characterize the cleanliness of the spectrum signal. In the case of a single peak, the peak concentration is the highest, and the more artifact peaks, the lower the peak concentration;
[0106] The final combined weight of the historical M frames is determined using the product of the above three weights: = × × ;
[0107] Based on this weight, the weighted sum of the of the historical M frames is obtained to get ;
[0108] = × ;
[0109] S45: Piecewise function weighting. First, obtain the × of the historical K data frames. Among them, K, find the largest three × corresponding to the highest peak indices in the respective spectra of the data frames, denoted as Among them, Take the mean of these three indices to obtain As shown in the formula:
[0110] ;
[0111] is a piecewise function. Based on this piecewise function, assign weights to each point in the obtained spectrum. Suppose there are N points in this spectrum, that is, 1 < < N, then the formula is as follows:
[0112] ;
[0113] Based on this weight, perform weighted calculation on to obtain The formula is as follows:
[0114] ;
[0115] Among them, is the index of the point on the spectrum and ; N, where N is the total number of points on the spectrum;
[0116] S46: Adaptive heart rate search. Set an adaptive variable Among them,
[0117] ;
[0118] Among them is the current frame, represents the historical frames. The of the starting frame uses 20 as the initial value and adaptively takes values subsequently. is the heart rate value of the corresponding frame;
[0119] Set the adaptive search interval and :
[0120] ( );
[0121] ( );
[0122] Among them is the spectral resolution, and the expression is as follows:
[0123] ;
[0124] Among them, H represents the signal frequency adopted under PPG, F represents the number of Fourier points, and the obtained represents that the heart rate interval mapped by the unit index interval in the spectrum is , and based on this interval, the heart rate value corresponding to the index of each point in the spectrum can be obtained, and thus a is generated, that is, a heart rate lookup table mapped according to the spectrum index, which is used to subsequently find the corresponding heart rate according to the index of the highest peak found;
[0125] When the search interval , exceeds the spectral range of , clamping is performed, and then the highest peak index , is searched in the interval , that is: ;
[0126] = ;
[0127] After obtaining the index, it can be mapped to the heart rate:
[0128] ;
[0129] S47: Heart rate post-processing, calculating a linear prediction value using the R heart rate data obtained from the past R data frames, and using the above and to perform weighting to obtain , and the formula is as follows:
[0130] ;
[0131] Among them, is the heart rate weighting value;
[0132] Perform frame difference heart rate discrimination, and limit the possible large range jumps through the difference between the current heart rate and the previous frame heart rate , and the final heart rate is as follows:
[0133] ;
[0134] Among them, 、 should be valued according to the actual situation.
[0135] Preferably, the step S5: motion state recognition includes:
[0136] S51: Data preprocessing and feature extraction,
[0137] Original dataset construction: Transfer and to the server via Bluetooth, and label the data with the motion state according to the motion state when the data is collected, so as to construct the original dataset;
[0138] Data loading: Load the three-axis acceleration and angular velocity data from the original dataset, and extract the motion state labels;
[0139] Label encoding: Use to encode the motion state labels into integer form and convert them into one-hot encoding ;
[0140] Time series sliding window: Use the sliding window technique to slice the data, generate time series input features, and retain the context information in the time series;
[0141] Normalization: Normalize the sliced data to ensure that the input feature ranges are consistent and reduce the influence of noise;
[0142] S52: Data division, randomly shuffle the dataset, and divide it into training set, validation set and test set according to the ratio of 、 、 to ensure the generalization ability of the model, 、 、 The values of are 0.8, 0.1, 0.1;
[0143] S53: Model design and construction,
[0144] Input layer: Receive the multi-dimensional time series input of the three-axis acceleration and angular velocity data;
[0145] Convolution layer: Extract local spatio-temporal features and enhance the model's perception ability of short-time change patterns;
[0146] Pooling layer: Reduce the data dimension through the max pooling operation to extract important features and reduce the computational amount at the same time;
[0147] Bidirectional Layer: By bidirectionally capturing the forward and backward dependencies of the time series, enhancing the model's learning ability for long-term dependence patterns;
[0148] Attention mechanism: Highlighting the features of key time steps through the multi-head attention layer, improving the model's classification ability for motion states;
[0149] Fully connected layer: Classifying the features output by the attention layer and mapping the results to the probability distributions of various motion states;
[0150] S54: Model training and optimization,
[0151] Loss function: Select as the loss function for multi-classification tasks;
[0152] Optimizer: Using the Adam optimizer to converge quickly and avoid local optima;
[0153] Evaluation metrics: Using accuracy, precision, recall, and F1-score as the main evaluation metrics to monitor the model performance in real time;
[0154] S55: Model evaluation and testing,
[0155] Prediction classification: Predicting the motion state categories in the test set through the trained model and outputting the prediction results;
[0156] Accuracy calculation: Comparing the prediction results with the true labels, calculating the model classification accuracy, and verifying its performance on the test set;
[0157] S56: Actual effect. Through the model combining CNN, BiLSTM, and attention mechanism, classifying complex motion patterns, achieving high-precision classification of various motion states for the motion state monitoring requirements of multiple scenarios.
[0158] Preferably, in step S6: Result output, the device displays the blood oxygen saturation and heart rate after smoothing processing, and at the same time transmits them to the server together with and data through Bluetooth. The server classifies the and data sent over for motion states and transmits them back to the device through Bluetooth for display. At the same time, it uploads the blood oxygen saturation, heart rate, and motion states to the web page side, APP side, etc. for users to use.
[0159] In summary, the present application includes at least one of the following beneficial technical effects:
[0160] 1. This application significantly improves the measurement accuracy and robustness of blood oxygen saturation through adaptive filtering, dynamic signal segmentation and quality assessment, weighted fusion, and adaptive Kalman filtering techniques. The improved algorithm can effectively suppress motion artifacts in a moving state, screen out high-quality PPG signals for calculation, and perform weighted summation and Kalman filtering smoothing processing on historical data to reduce noise interference, ensuring the continuity and stability of blood oxygen saturation data, and is applicable to complex dynamic scenarios;
[0161] 2. This application proposes a double-layer frequency-domain Wiener filtering, adaptive search interval and smoothing processing method, combined with motion state calibration and multi-weight fusion, which improves the accuracy and dynamic adaptability of heart rate detection, and solves the problem of large heart rate recognition errors of traditional methods in a moving scenario;
[0162] 3. This application realizes real-time monitoring and accurate classification of the human body's motion state through a model combining CNN, BiLSTM, and attention mechanism, improves the comprehensiveness and practicality of health monitoring, and expands the application scenarios of wearable devices;
[0163] 4. This application combines PPG signals and motion sensing data, and through filtering and noise suppression techniques, effectively removes motion artifacts and environmental noise, ensuring the high quality and high accuracy of blood oxygen saturation and heart rate detection, and is particularly suitable for the health monitoring needs in a dynamic motion environment. Description of the Drawings
[0164] Figure 1 is the flowchart of the blood oxygen and heart rate monitoring system based on PPG signals and motion data in the embodiment of this application.
[0165] Figure 2 is the structural schematic diagram of the blood oxygen and heart rate monitoring system based on PPG signals and motion data in the embodiment of this application.
[0166] Figure 3 is the flowchart of the blood oxygen and heart rate monitoring method based on PPG signals and motion data in the embodiment of this application.
[0167] Figure 4 is the schematic diagram of removing signal jumps in PPG signals in the embodiment of this application.
[0168] Figure 5 is the schematic diagram of removing baseline drift in PPG signals in the embodiment of this application.
[0169] Figure 6 、 Figure 7 is the signal comparison diagram before and after band-pass filtering and motion artifacts of PPG signals in the embodiment of this application.
[0170] Figure 8It is a schematic diagram of the AC and DC values of the PPG signal in the embodiment of the present application.
[0171] Figure 9 It is the effect diagram of adaptive Kalman filtering in the actual blood oxygen saturation measurement in the embodiment of the present application.
[0172] Figure 10 It is a schematic diagram of the Gaussian weight in the embodiment of the present application.
[0173] Figure 11 It is in the embodiment of the present application Schematic diagram of the piecewise function.
[0174] Figure 12 It is a comparison diagram of the heart rate algorithm of the present application and the ordinary heart rate algorithm.
[0175] Explanation of reference numerals: 1. PPG signal acquisition module; 2. Motion sensor module; 3. Signal preprocessing module; 4. Dynamic signal segmentation and quality evaluation module; 5. Blood oxygen saturation calculation module; 6. Heart rate calculation module; 7. Motion state recognition module; 8. Adaptive Kalman filtering module; 9. Output display module. Detailed implementation manners
[0176] The following further elaborates on the present application in conjunction with the attached Figures 1-12 drawings.
[0177] The embodiment of the present application discloses a blood oxygen and heart rate monitoring system based on PPG signals and motion data. Referring to Figure 1 , it includes
[0178] PPG signal acquisition module 1 for acquiring red light, infrared light and green light PPG signals;
[0179] Motion sensor module 2 for acquiring the acceleration signal and angular velocity signal of the user;
[0180] Signal preprocessing module 3 for denoising, removing baseline drift and adaptive filtering to ensure signal quality;
[0181] Dynamic signal segmentation and quality evaluation module 4 for signal segmentation processing and evaluating signal quality through the peak-valley ratio and autocorrelation coefficient;
[0182] Blood oxygen saturation calculation module 5 for calculating blood oxygen saturation according to the improved blood oxygen algorithm and high-quality red light and infrared light PPG signals;
[0183] Heart rate calculation module 6 for accurately detecting heart rate according to the improved heart rate algorithm, high-quality green light PPG signal and motion state;
[0184] A motion state recognition module 7 for recognizing the motion state of the human body based on a deep learning model, acceleration, and angular velocity data;
[0185] An adaptive Kalman filter module 8 for smoothing blood oxygen and heart rate data through Kalman filtering to optimize real-time monitoring data;
[0186] An output display module 9 for real-time displaying the blood oxygen saturation, heart rate, and motion state results.
[0187] The embodiment of the present application also discloses a blood oxygen and heart rate monitoring system based on PPG signals and motion data, including the following steps:
[0188] S1: Acquisition of PPG signals and motion data;
[0189] S11: Acquisition of PPG signals, real-time acquisition of red light, infrared light, and green light PPG signals through a sensor;
[0190] S12: Acquisition of motion data, using a three-axis accelerometer and a gyroscope to obtain acceleration data and angular velocity data ;
[0191] S13: Data segmentation, sliding the collected data by 200 points, with a window length of 800 points and a sampling rate of 100 Hz, to obtain the segmented data , and .
[0192] S2: Signal preprocessing;
[0193] S21: Removal of jumps in PPG signals, removing the jump noise between data frames through an algorithm for removing discontinuous points, ensuring data continuity between data frames, thereby obtaining a continuous PPG signal as Figure 4 shown and the corresponding acceleration and angular velocity data ; , ;
[0194] S22: Removal of baseline drift, collecting the least squares method and fourth-order polynomial fitting to remove the baseline drift of the PPG signal, obtaining , and the formula is as follows, which has a better baseline removal effect compared to the traditional median filtering method: A(i, j) = ;
[0195] where i = [1:800], which is the length of the data frame; j = [1:4]; A(i, j) represents the jth power of i, which is a fourth-order polynomial matrix: coeff = ;
[0196] wherein represents the transpose of A, represents the inverse matrix of, and coeff is a 1×5 matrix coefficient; =coeff ;
[0197] The baseline effect is removed as shown in Figure 5 ;
[0198] S23: Signal valid detection. For the newly acquired 200-point data [601∶800] in , judge the number of points exceeding the upper and lower thresholds ( and ). If the number of points exceeds a certain number P, then use the point data of [401∶600] to replace the 200-point data of [601∶800] to ensure that the data of each frame is within a reasonable range, and obtain the output waveform marked as ;
[0199] ;
[0200] S24: Band-pass filtering. Perform band-pass filtering (0.8 - 3.5 Hz) on the PPG signal, acceleration, and angular velocity data respectively, and perform Z-Score normalization on the PPG signal to obtain the data , , . The Z-Score normalization is as shown in the formula: ;
[0201] where x is the original data point, μ is the mean of the data set; σ is the standard deviation of the data set; z is the result after normalization; The role of using Z-Score normalization: Adjust the data to a zero-mean normal distribution. Z-Score normalization is less sensitive to outliers. If the values of some points in the data are much larger or smaller than other data points (i.e., outliers), the overall impact of these outliers on the data set will be relatively reduced after normalization;
[0202] S25: Motion artifact removal. Based on the obtained and , use the least mean square (LMS) algorithm for time-domain adaptive filtering. The input of the filter at the sampling point is as shown in the formula: ;
[0203] wherein, is the 3-axis acceleration signal of the accelerometer, is the 3-axis angular velocity signal of the gyroscope;
[0204] The purpose of the LMS adaptive filter is to estimate the artifact signal according to the input signal and remove these artifacts from the target signal . At the th sampling, the filter outputs the estimated artifact signal as: ; ;
[0205] where is the weight vector of the adaptive filter, and the net target signal output by the filter (i.e., the signal after removing the artifacts) is: ;
[0206] The filter updates the filter weights through the error ;
[0207] ;
[0208] ;
[0209] where is the step size parameter that controls the speed of weight update. Repeat the above steps until the error converges to obtain the signal with motion artifacts removed. Thus, the PPG signal with motion artifacts removed is obtained;
[0210] The comparison of the signals before and after band - pass filtering and motion artifact is as Figure 6 and Figure 7 shown:
[0211] S26: Downsampling, downsample , and to 25 Hz to obtain the data and .
[0212] S3: Improved blood oxygen saturation calculation;
[0213] S31: Signal quality assessment, by calculating the peak - to - valley ratio and autocorrelation coefficient from the data of the red - light part and the infrared - light part in the signal, select high - quality signals for subsequent blood oxygen saturation calculation. The peak - to - valley ratio represents the amplitude change of the signal and reflects the intensity of the PPG signal. A larger peak - to - valley ratio indicates obvious pulse fluctuations in the signal, which is helpful for subsequent blood oxygen calculation. For a pair of peak and valley, the peak - to - valley ratio is: ; ;
[0214] where is the peak value, is the trough value. For all the peaks and troughs within a sliding window, calculate the average value of all the peaks and troughs as the peak-to-valley ratio of the overall signal: ;
[0215] where is the number of peak-to-valley pairs detected within the window, is the th peak-to-valley ratio of the peak-to-valley pair;
[0216] The PPG signal is a periodic signal. Therefore, the autocorrelation coefficient can help evaluate the stability and periodic consistency of the signal. The autocorrelation coefficient is as shown in the formula: ; ;
[0217] where, is the autocorrelation value of the signal at the time delay , represents the value of the PPG signal at the time point , is the total number of samples of the signal, ranges from 0 to . Within this range, find the first significant main peak of the autocorrelation coefficient . The more obvious and closer to 1 the main peak is, the stronger the periodicity and better the quality of the signal. Thus, when the PPG signal in the sliding window satisfies > and > , retain this segment of the signal, and are the set peak-to-valley ratio threshold and autocorrelation coefficient threshold respectively;
[0218] S32: Calculation of blood oxygen saturation ( ), based on the PPG signal, measure the ratio of oxyhemoglobin (HbO2) to reduced hemoglobin (Hb) by using the absorption difference of light with different wavelengths when passing through tissues. That is, according to the Beer-Lambert law, irradiate human tissues with red light and infrared light, and calculate the blood oxygen saturation through the electrical signal obtained by converting the reflected light intensity signal. During the process of calculating the blood oxygen saturation, calculate the blood perfusion rate of the red light data and of the infrared light data and of the infrared light data are as shown in the formula respectively:
[0219] ;
[0220] ;
[0221] Among them, is the signal amplitude in the red light data, is the signal amplitude in the red light data, is the signal amplitude in the infrared light data, is the signal amplitude in the infrared light data; The signal and the value of the signal are as Figure 8 shown:
[0222] Set the ratio of the red light perfusion rate to the infrared light perfusion rate as , The calculation formula of is as shown in the formula:
[0223] Conduct a deoxygenation experiment on the functional relationship between blood oxygen saturation and through a gold standard blood oxygen measurement device. For the blood oxygen saturation values and the corresponding values in the experimental data, fit to obtain the functional relationship between blood oxygen saturation and ; If the functional polynomial of blood oxygen saturation and fitted by the experiment is a first-degree polynomial, then the reference formula for this first-degree polynomial: ;
[0224] Among them, , are the coefficients of the first-degree polynomial to be fitted;
[0225] If the functional polynomial of blood oxygen saturation and values fitted by the experiment is a second-degree polynomial, then the reference formula for this second-degree polynomial: ;
[0226] Among them, , , are the coefficients of the second-degree polynomial to be fitted. Based on the fitted formula, the corresponding blood oxygen saturation can be calculated according to the value;
[0227] S33: Oxygen saturation weighted calculation. In the sliding window, based on the peak and valley corresponding to each red light and infrared light, calculate the preliminary oxygen saturation. , and use the historical oxygen saturation to perform weighted processing on the preliminary calculated value to obtain the comprehensive oxygen saturation within the current window. , and the weighting formula is as follows: ;
[0228] where, represents the number of peak-valley pairs within the sliding window, is an adjustment parameter used to control the attenuation rate of the weight;
[0229] S34: Oxygen saturation smoothing processing. Use adaptive Kalman filtering to smooth the calculated oxygen saturation, combine historical oxygen saturation data, and improve the consistency of the time series. This method adaptively copes with the uncertainty under different measurement conditions by dynamically adjusting the process noise covariance and the observation noise covariance . First, perform parameter initialization for the Kalman filter. Set the initial oxygen estimation value as the initial measurement value of the system, and set the initial covariance to a relatively large value to reflect a relatively high initial uncertainty. The initial process noise covariance is usually set to a relatively small value, indicating a relatively small system fluctuation. The initial observation noise covariance is usually set to a relatively large value, indicating a relatively high uncertainty in the initial measurement. Next, the filtering process includes prediction and update. In the prediction step, based on the previous estimated value , calculate the current oxygen saturation prediction value and its covariance , that is:
[0230] ;
[0231] ;
[0232] where, is the state transition matrix, which describes the evolution of the system state. In the model where the oxygen saturation changes smoothly, is set to , indicating that there is no significant jump between the current oxygen saturation and the oxygen saturation at the previous moment. is the process noise covariance, which reflects the uncertainty of the system. Calculate the residual through the current measurement value : = ;
[0233] Among them, is the observation matrix, which is used to map the predicted state to the observation space and compare it with the current measurement value . In the model where the blood oxygen saturation changes smoothly, is set to ;
[0234] In the update step, first calculate the Kalman gain : = ;
[0235] Among them, is the observation noise covariance, which reflects the measurement uncertainty. Based on the Kalman gain, update the estimated blood oxygen saturation and the covariance :
[0236] ;
[0237] ;
[0238] Dynamically update and by monitoring the estimation error and the change of the residual:
[0239] ;
[0240] ;
[0241] Among them, and are adjustment factors, which are used to dynamically adjust the changes of the process noise and the observation noise.
[0242] The adaptive Kalman filter can automatically adjust the noise covariance according to the changes of the real-time measurement environment, optimize the filtering effect, ensure the continuity and accuracy of the blood oxygen saturation estimation, reduce the measurement noise interference, and enhance the time series smoothness. Its effect in the actual blood oxygen saturation measurement is as Figure 9 shown, where the squares represent the true values, the triangles represent the blood oxygen saturation calculated by the ordinary algorithm, and the circles represent the blood oxygen saturation calculated by the optimized algorithm. By comparison, the blood oxygen saturation calculated by the optimized algorithm is closer to the true value, while the result obtained by the ordinary algorithm shows larger fluctuations;
[0243] S4: Improved heart rate detection algorithm;
[0244] S41: Signal frequency domain transformation, for the green light part of data and the acceleration data Perform a 1024-point FFT transformation, intercept the spectrum data within [0.8 - 3.5] Hz, and perform maximum normalization on the acceleration data, restricting the values to the range of [0, 1] to obtain and ;
[0245] S42: Frame motion state calibration, using the mean of the sum of squares of the three-axis acceleration data compared with the threshold and where, > If > then determine that the current frame is a motion frame and calibrate the state weight of the current frame = a; If < < then calibrate the current frame as a micro-motion frame, and its state weight = b; If < then calibrate the current frame as a relatively stationary frame, and its state weight = c, where 0 < a < b < c < 1, and a + b + c = 1, 、 The values of are calibrated by the user according to the accelerometer used, The calculation formula of is as follows: ;
[0246] where ACCX, ACCY, and ACCZ are respectively the x, y, and z direction vectors;
[0247] S43: Since the scene for heart rate measurement is usually a motion scene, the movement of the user's body or arm will cause more motion artifacts in the signal. Therefore, use double-layer frequency-domain Wiener filtering to further filter out the motion artifacts in the PPG signal in the frequency domain through the motion state characterized by the accelerometer. The process of Wiener filtering is as follows: First, calculate the spectral mean of the first N frames of and perform maximum normalization to obtain , and calculate the weight of the first-layer Wiener filter : = 1 - ( ) ;
[0248] where, represents point division, calculate the weight of the second-layer Wiener filter : = ( );
[0249] For and the part with a weight less than 0 in it, the clamping is set to -1, and two filtering outputs are obtained using two weights respectively: = ; = ;
[0250] Among them, represents dot product. For the above two filtering outputs, weighted fusion is performed according to the standard deviation to obtain the filtering output of the current frame : = ;
[0251] Among them, and are respectively and 's standard deviations. Subsequently, maximum normalization is performed on to obtain ;
[0252] S44: Joint adaptive weighted filtering. For the spectra of the historical M frames, they are weighted according to three weights: Gaussian weight, state weight, and concentration weight, so as to ensure accurate heart rate calculation whether in a chaotic motion state or a regular periodic motion;
[0253] Gaussian weight: Starting from the current data frame, generate the Gaussian weights of the previous M data frames. The newer the frame, the greater the weight, so as to ensure that the newer frames have a greater weight to meet the real-time performance of the heart rate calculation result. The Gaussian weight symbol is , where 1 < < M, and the Gaussian weights of the data frames are as shown in Figure 10 :
[0254] State weight: Use the corresponding to the historical M frames as the state weight, where 1 < < M;
[0255] Concentration weight: Use the peak concentration corresponding to the historical M frames as the concentration weight, where 1 < < M;
[0256] Among them, the peak concentration is obtained by summing the differences between the highest peak of the spectrum and its previous 10 peaks . The highest peak needs to be excluded, and 2 < < 10, the peak concentration formula for each data frame is as follows:
[0257] ;
[0258] Among them, the peak concentration is used to characterize the cleanliness of the spectrum signal. The peak concentration is the highest in the case of a single peak, and the more artifact peaks there are, the lower the peak concentration;
[0259] The final combined weight of the historical M frames is determined using the product of the above three weights: = × × ;
[0260] Based on this weight, the of the historical M frames is weighted and summed to obtain ; = × ;
[0261] The introduction of the state weight and the concentration weight can increase the weight ratio of the frames with fewer spectrum artifact peaks and less body or arm movement. For example, if the current frame is in a stationary state, both the state weight and the concentration weight are high, and finally the weight of this frame is high; if the current frame is in a chaotic motion state, both the state weight and the concentration weight are very small, and finally the proportion is small; if the current frame is in a periodic motion state (periodically swinging the arm), the state weight is small and the peak concentration weight is high, and finally the product of the two weights will also be small, which ensures the accuracy of heart rate calculation whether in a chaotic motion state or a regular periodic motion;
[0262] S45: Piecewise function weighting. First, obtain the × of the historical K data frames, where K, find the three largest × corresponding to the highest peak indices in the respective spectra of the data frames, denoted as , where , take the average of these three indices to obtain As shown in the formula: ;
[0263] is a piecewise function, and the graph of the piecewise function is as Figure 11 shown:
[0264] Based on this piecewise function, for each point in the obtained Perform distribution. Assume there are N points in this spectrum, that is, 1 < < N, then the formula is as follows:
[0265] ;
[0266] Based on this weight, perform weighted calculation on to obtain , and the formula is as follows:
[0267] ;
[0268] Among them, is the index of the point on the spectrum and , N, where N is the total number of points on the spectrum;
[0269] represents the average value of the peak subscripts corresponding to the highest 3 frames, that is, the average value of the subscripts corresponding to the highest peaks of the three data frames without chaotic motion and without periodic motion mentioned above. Using as the peak index of the piecewise function can ensure that peaks near the index have a greater chance of being selected during the search, thereby further ensuring the accuracy of heart rate search;
[0270] S46: Adaptive heart rate search. Set an adaptive variable , among which,
[0271] ;
[0272] Among them is the current frame, represents the historical frame. The of the starting frame uses 20 as the initial value and adaptively takes values subsequently, is the heart rate value of the corresponding frame;
[0273] Set the adaptive search interval and : ( ); ( );
[0274] Among them is the spectrum resolution, and the expression is as follows: ;
[0275] Among them, H represents the signal frequency adopted under PPG, F represents the number of Fourier points, and the obtained The heart rate interval size representing the unit index interval mapping in the spectrum is , based on this interval, the heart rate value corresponding to the index of each point in the spectrum can be obtained, and thus a is generated, that is, a heart rate lookup table mapped according to the spectrum index, which is used to subsequently find the corresponding heart rate according to the index of the highest peak found;
[0276] Here, The larger it is, the greater the heart rate jump in the previous few frames, indicating that it may be in a motion state. At this time, it can be seen from the above formula that the search interval will become smaller; similarly, when is small, it means that the heart rate has not changed much in the previous few frames and the person is in a resting state. At this time, the search interval can be safely increased. The adaptive interval search ensures that even when the search interval is reduced during the motion state and increased after switching to the resting state, avoiding incorrect searches;
[0277] In addition, when the search interval , exceeds the spectrum range, clamping is performed, and then the search is performed in the interval , for the index of the highest peak , that is: = ;
[0278] After obtaining the index, it can be mapped to the heart rate: ;
[0279] S47: Heart rate post-processing, calculating a linear prediction value using the R heart rate data obtained from the past R data frames, and using the above and to perform weighting to obtain , and the formula is as follows: ;
[0280] Among them, is the heart rate weighting value;
[0281] Frame difference heart rate discrimination is performed to prevent excessive heart rate jumps. The difference between the current heart rate and the heart rate of the previous frame is used to limit possible large-scale jumps. The final heart rate is as follows: ;
[0282] Among them, , Values should be taken according to the actual situation. Generally speaking, the increase in human heart rate changes faster than the decrease in heart rate, but always within a reasonable range. Using frame difference heart rate discrimination ensures that the increase in heart rate within 2 seconds does not exceed 5 bpm, while the decrease in heart rate does not exceed 3 bpm, preventing misjudgment in measurement.
[0283] The comparison of the effects of the optimized heart rate algorithm and the ordinary heart rate algorithm is as Figure 12 shown. It can be seen that the optimized algorithm can calculate the user's heart rate more accurately, especially in the case of rapid heart rate changes;
[0284] S5: Motion state recognition. Through the triaxial acceleration and gyroscope data, a deep learning model based on CNN, bidirectional LSTM (BiLSTM), and multi-head attention mechanism is constructed to classify the human motion state, including various motions such as stationary, sitting, turning over, walking, going up and down stairs, running, cycling, playing basketball, etc. The specific implementation steps of the model are as follows:
[0285] S51: Data preprocessing and feature extraction,
[0286] Construction of the original dataset: and are transmitted to the server via Bluetooth, and motion state labels are assigned to the data according to the motion state when the data is collected, thus constructing the original dataset;
[0287] Data loading: Load the triaxial acceleration and angular velocity data from the original dataset and extract the motion state labels;
[0288] Label encoding: Use to encode the motion state labels into integer form and convert them into one-hot encoding ;
[0289] Time series sliding window: Use the sliding window technique to slice the data, generate time series input features, and retain the context information in the time series;
[0290] Normalization: Normalize the sliced data to ensure that the input feature ranges are consistent and reduce the influence of noise;
[0291] S52: Data division. Randomly shuffle the dataset and divide it into a training set, a validation set, and a test set according to the , , ratio to ensure the generalization ability of the model. The , , values are 0.8, 0.1, 0.1;
[0292] S53: Model design and construction,
[0293] Input layer: Receives the multi-dimensional time series input of triaxial acceleration and angular velocity data;
[0294] Convolutional layer: Extracts local spatio-temporal features and enhances the model's perception ability of short-time change patterns;
[0295] Pooling layer: Through the max pooling operation Reduces the data dimension, extracts important features, and at the same time reduces the computational amount;
[0296] Bidirectional layer: Captures the forward and backward dependencies of the time series through bidirectional and enhances the model's learning ability of long-time dependence patterns;
[0297] Attention mechanism: Highlights the features of key time steps through the multi-head attention layer and improves the model's classification ability for motion states;
[0298] Fully connected layer: Classifies the features output by the attention layer and maps the results to the probability distributions of each motion state;
[0299] S54: Model training and optimization,
[0300] Loss function: Selects as the loss function for multi-classification tasks;
[0301] Optimizer: Adopts the Adam optimizer, which converges quickly and avoids local optimal solutions;
[0302] Evaluation metrics: Uses accuracy, precision, recall, and F1-score as the main evaluation metrics to monitor the model performance in real time;
[0303] S55: Model evaluation and testing,
[0304] Prediction classification: Predicts the motion state categories in the test set through the trained model and outputs the prediction results;
[0305] Accuracy calculation: Compares the prediction results with the true labels, calculates the classification accuracy of the model, and verifies its performance on the test set;
[0306] S56: Actual effect, through the model combining CNN, BiLSTM, and attention mechanism, classifies complex motion patterns, achieving high-precision classification of multiple motion states for the motion state monitoring requirements in multiple scenarios.
[0307] S6: Result output, displays the blood oxygen saturation and heart rate of the device after smoothing processing, and at the same time compares with and The data is transmitted to the server via Bluetooth, and the server classifies the and transmitted data according to the motion state, and then transmits it back to the device via Bluetooth for display. At the same time, the blood oxygen saturation, heart rate, and motion state are uploaded to the web side, APP side, etc. for users to use.
[0308] In the specific implementation process, the following steps are included:
[0309] Step 1: Blood oxygen detection method based on PPG signal and motion sensing data
[0310] 1. Equipment and materials
[0311] Hardware equipment: including red light (600nm) and infrared light (940nm) PPG sensors for collecting photoplethysmogram signals; three-axis accelerometer and three-axis gyroscope for collecting motion sensing data;
[0312] Control module: embedded microcontroller (such as STM32) for signal acquisition, processing and transmission;
[0313] Software environment: MATLAB or Python programming environment for algorithm development and testing;
[0314] 2. Experimental process
[0315] Data acquisition: Wear the device on the user's wrist to collect red light and infrared light PPG signals, as well as three-axis acceleration and angular velocity data in real time. The sampling rate is set to 100Hz, the sliding window is set to 200 points (2 seconds), and the window length is 800 points (8 seconds);
[0316] Signal processing:
[0317] a. Removing jumps and baseline drift: Use the least squares method and polynomial fitting method to remove the jump noise and baseline drift in the PPG signal;
[0318] b. Band-pass filtering: Perform 0.8 - 3.5Hz band-pass filtering on the PPG signal and motion sensing data to remove high-frequency and low-frequency noise;
[0319] c. Removing motion artifacts: Combine the LMS (Least Mean Square) adaptive filtering algorithm, using the acceleration and angular velocity data as the reference signal to remove the interference of motion artifacts on the PPG signal;
[0320] 3. Blood oxygen calculation
[0321] Use the improved blood oxygen algorithm to calculate the perfusion rate ratio R of red light and infrared light: R = = ;
[0322] Calculate the blood oxygen saturation based on the fitted polynomial relationship : = ;
[0323] Use adaptive Kalman filtering to smooth the blood oxygen data and improve the time series consistency;
[0324] Step 2: Heart rate detection method based on green light PPG signal
[0325] 1. Equipment and materials
[0326] Sensor: Green light (500nm) PPG sensor for collecting heart rate signals;
[0327] Data acquisition module: Embedded microcontroller (such as STM32) for signal acquisition, processing and transmission;
[0328] 2. Experimental process
[0329] Signal preprocessing:
[0330] a. Remove jumps and baseline drift: Use the least squares method and polynomial fitting method to remove jump noise and baseline drift in the PPG signal;
[0331] b. Frequency domain analysis: Perform 0.8 - 3.5Hz band-pass filtering on the PPG signal and motion sensing data to remove high-frequency and low-frequency noise, and perform FFT transformation on the PPG signal to extract the spectral signal of 0.8 - 3.5Hz;
[0332] Motion state calibration: Calibrate the motion state according to the sum of squares and mean value of acceleration and assign state weights (stationary, micro-motion, motion);
[0333] Double-layer Wiener filtering: Combine acceleration data and PPG signal to construct a double-layer Wiener filter to remove frequency domain noise;
[0334] 3. Heart rate calculation
[0335] Perform adaptive search on the filtered spectral signal to determine the heart rate peak index and map it to the heart rate value through a look-up table ;;
[0336] Use linear prediction and smoothing algorithm to adjust the heart rate result to obtain the final heart rate value , reducing abnormal jumps;
[0337] Step 3: Motion state recognition method
[0338] 1. Equipment and materials
[0339] Sensors: Triaxial accelerometer and triaxial gyroscope for collecting motion data;
[0340] Deep learning model: A classification network based on CNN, bidirectional LSTM (BiLSTM), and multi-head attention mechanism;
[0341] 2. Experimental procedure
[0342] Data preprocessing:
[0343] Sliding window segmentation, slicing the motion data in units of 200 points (2 seconds);
[0344] Normalize the segmented data to ensure consistent input data range;
[0345] Model construction:
[0346] CNN layer: Extract local features;
[0347] BiLSTM layer: Capture the forward and backward dependencies in the time series;
[0348] Attention mechanism: Highlight the features of key time steps and improve the classification performance;
[0349] Fully connected layer: Map the features to the probability distribution of the motion state;
[0350] Model training: Use the training set to train the model, with the Adam optimizer and the categorical cross-entropy loss function;
[0351] Testing and validation: Validate the model performance on the test set, with the classification accuracy reaching over 95%;
[0352] Step 4: Data display and transmission method
[0353] 1. Equipment and materials
[0354] Display module: An embedded OLED screen for displaying blood oxygen, heart rate, and motion state;
[0355] Wireless transmission module: A Bluetooth communication module for data synchronization and remote monitoring;
[0356] 2. Experimental procedure
[0357] Data display: Real-time update the results of blood oxygen, heart rate, and motion state, and present them in the form of charts and numerical values on the display screen;
[0358] Data transmission: Synchronize the data to the server via Bluetooth, and users can view the historical data and health reports through the mobile application or web page.
[0359] The implementation principle of the blood oxygen and heart rate monitoring system and method based on PPG signals and motion data in the embodiments of the present application is as follows: Through multi-step optimization and signal fusion technology, the problems in the prior art such as signal interference in a dynamic environment, insufficient measurement accuracy, and lack of motion state recognition function are effectively solved, providing a high-precision and stable technical solution for the health monitoring of wearable devices; the method of the present application improves the accuracy and robustness of blood oxygen and heart rate detection, realizes comprehensive health detection in a motion state, enhances data stability and continuity, and expands the application scenarios of wearable devices.
[0360] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereby. Therefore, all equivalent changes made according to the structure, shape, and principle of the present application shall be covered within the protection scope of the present application.
Claims
1. A blood oxygen and heart rate monitoring system based on PPG signals and motion data, characterized in that: Including: A PPG signal acquisition module (1) for acquiring red light, infrared light, and green light PPG signals; A motion sensor module (2) for acquiring the acceleration signal and angular velocity signal of the user; A signal preprocessing module (3) for denoising, removing baseline drift, and adaptive filtering to ensure signal quality; A dynamic signal segmentation and quality assessment module (4) for segmenting signals and evaluating signal quality through the peak-valley ratio and autocorrelation coefficient; A blood oxygen saturation calculation module (5) for calculating blood oxygen saturation based on an improved blood oxygen algorithm and high-quality red light and infrared light PPG signals; Blood oxygen saturation weighted calculation. In the sliding window, the preliminary blood oxygen saturation is calculated based on the peak and valley corresponding to each red light and infrared light , and the historical blood oxygen saturation is used to weight the preliminary calculated value to obtain the comprehensive blood oxygen saturation within the current window . The weighting formula is as follows: Among them, represents the number of peak-valley pairs within the sliding window, is an adjustment parameter used to control the attenuation rate of the weight; for the smoothing process of blood oxygen saturation, an adaptive Kalman filter is used to smooth the calculated blood oxygen saturation. Combining historical blood oxygen saturation data, the consistency of the time series is improved, and the process noise covariance and the observation noise covariance are dynamically adjusted to adapt to the uncertainties under different measurement conditions; for the Kalman filter, parameter initialization is first performed, and the initial blood oxygen estimation value is set as the initial measurement value of the system . The filtering process includes prediction and update. In the prediction step, based on the previous estimated value , the current blood oxygen prediction value and its covariance are calculated, that is: Among them, is the state transition matrix, which describes the evolution of the system state. In the model with a smooth change in blood oxygen saturation, is set as , indicating that there is no significant jump between the current blood oxygen saturation and the blood oxygen saturation at the previous moment. is the process noise covariance, which reflects the uncertainty of the system. The residual is calculated through the current measurement value as follows: = Among them, is the observation matrix, which is used to map the predicted state to the observation space and compare it with the current measurement value In the model where the blood oxygen saturation changes smoothly, is set to ; In the update step, first calculate the Kalman gain : = Among them, is the observation noise covariance, which reflects measurement uncertainty and updates the estimated blood oxygen saturation based on the Kalman gain and covariance : Dynamically update by monitoring the estimation error and residual change and : Among them, and are adjustment factors used to dynamically adjust the changes in process noise and observation noise; A heart rate calculation module (6) for accurately detecting the heart rate according to an improved heart rate algorithm, a high-quality green light PPG signal, and a motion state; adaptive heart rate search, setting an adaptive variable , wherein Among them is the current frame, represents the historical frame, starting from the frame with 20 as the initial value, and subsequent adaptive values are taken, which is the heart rate value corresponding to the frame; Set an adaptive search range and : ( ) ( ) Among them is the spectral resolution, and the expression is as follows: Among them, H represents the signal frequency after adoption under PPG, F represents the number of Fourier points, and the obtained indicates that the heart rate interval size mapped by the unit index interval in the spectrum is . Based on this interval, the heart rate value corresponding to the index of each point in the spectrum can be obtained, and thus a is generated, that is, a heart rate look-up table mapped according to the spectrum index, which is used to subsequently find the corresponding heart rate according to the index of the highest peak found; When the search interval , exceeds the spectral range, clamping is performed, and then the search is carried out in the interval , for the index of the highest peak , that is: = After obtaining the index, it can be mapped to the heart rate: Heart rate post - processing, calculating a linear prediction value using R heart rate data obtained from the past R data frames , using the above - mentioned and to perform weighting to obtain , and the formula is as follows: Among them, is the heart rate weighted value; Perform frame difference heart rate discrimination, and limit possible large-range jumps by the difference between the current heart rate and the heart rate of the previous frame The final heart rate is as follows as shown below: Among them, , shall be determined according to the actual situation; A motion state recognition module (7) for recognizing the motion state of the human body based on a deep learning model, acceleration, and angular velocity data; An adaptive Kalman filter module (8) for smoothing blood oxygen and heart rate data through Kalman filtering to optimize real-time monitoring data; An output display module (9) for real-time displaying the results of blood oxygen saturation, heart rate, and motion state.
2. A method for monitoring blood oxygen and heart rate based on PPG signals and motion data, characterized in that: Including the following steps: S1: Acquisition of PPG signals and motion data; S2: Signal preprocessing; S3: Improved blood oxygen saturation calculation; weighted calculation of blood oxygen saturation. In the sliding window, the preliminary blood oxygen saturation is calculated based on the peaks and valleys corresponding to each red light and infrared light. Using the historical blood oxygen saturation to weight the preliminary calculated value to obtain the comprehensive blood oxygen saturation within the current window. The weighting formula is as follows: Among them, represents the number of peak-valley pairs within the sliding window, is an adjustment parameter used to control the attenuation rate of the weight; for the smoothing process of blood oxygen saturation, an adaptive Kalman filter is used to smooth the calculated blood oxygen saturation, combined with historical blood oxygen saturation data to enhance the consistency of the time series, and dynamically adjust the process noise covariance and the observation noise covariance , to adaptively cope with the uncertainties under different measurement conditions; the Kalman filter first performs parameter initialization, setting the initial blood oxygen estimation value as the initial measurement value of the system , and the filtering process includes prediction and update. In the prediction step, based on the previous estimated value , calculate the current blood oxygen prediction value and its covariance , that is: Among them, is the state transition matrix, which describes the evolution of the system state. In the model with a smooth change in blood oxygen saturation, is set to , indicating that there is no significant jump between the current blood oxygen saturation and the blood oxygen saturation at the previous moment. is the process noise covariance, which reflects the uncertainty of the system. By using the current measurement value calculate the residual : = Among them, is the observation matrix, which is used to map the predicted state to the observation space and compare it with the current measurement value In the model where the blood oxygen saturation changes smoothly, is set to ; In the update step, first calculate the Kalman gain : = Among them, is the observation noise covariance, which reflects measurement uncertainty and updates the estimated blood oxygen saturation based on the Kalman gain and covariance : Dynamically update by monitoring the estimation error and residual change and : Among them, and are adjustment factors used to dynamically adjust the changes in process noise and observation noise; S4: Improved heart rate detection algorithm; Adaptive heart rate search, setting an adaptive variable , wherein Among them is the current frame, represents the historical frame, starting from the frame with an initial value of 20 and adaptively taking subsequent values, is the heart rate value corresponding to the frame; Set an adaptive search range and : ( ) ( ) Among them is the spectral resolution, and the expression is as follows: Among them, H represents the signal frequency after adoption under PPG, F represents the number of Fourier points, and the obtained indicates that the heart rate interval size mapped by the unit index interval in the spectrum is . Based on this interval, the heart rate value corresponding to the index of each point in the spectrum can be obtained, and thus a is generated, that is, a heart rate lookup table mapped according to the spectrum index, which is used to subsequently find the corresponding heart rate according to the index of the found highest peak; When the search interval , exceeds the spectrum range, clamping is performed, and then the search is carried out in the interval , for the index of the highest peak , that is: = After obtaining the index, it can be mapped to the heart rate: Heart rate post - processing, calculating a linear prediction value using R heart rate data obtained from the past R data frames , using the above - mentioned and to perform weighting to obtain , and the formula is as follows: Among them, is the heart rate weighted value; Perform frame difference heart rate discrimination, and limit possible large-range jumps through the difference between the current heart rate and the heart rate of the previous frame The final heart rate is as follows as follows: Among them, , the values should be determined according to the actual situation; S5: Motion state recognition; S6: Result output.
3. The blood oxygen and heart rate monitoring method based on PPG signals and motion data according to claim 2, characterized in that: The step S1: Acquisition of PPG signals and motion data includes: S11: Acquisition of PPG signals, and real-time acquisition of red light, infrared light, and green light PPG signals through sensors; S12: Motion data acquisition, using a three-axis accelerometer and a gyroscope to obtain acceleration data and angular velocity data ; S13: Data segmentation. The collected data is windowed with 200 points, the window length is 800 points, and the sampling rate is 100 Hz to obtain the segmented data , and .
4. The blood oxygen and heart rate monitoring method based on PPG signals and motion data according to claim 3, characterized in that: The step S2: Signal preprocessing includes: S21: Denoising the PPG signal. By removing the discontinuity points algorithm, the jump noise between data frames is removed to ensure the data continuity between data frames, thereby obtaining a continuous PPG signal and the corresponding acceleration and angular velocity data , ; S22: Remove baseline drift, collect the least squares method and fourth-order polynomial fitting to remove the baseline drift of the PPG signal, and obtain , and the formula obtained is as follows: A(i, j) = Where i = [1:800], which is the length of the data frame; j = [1:4]; A(i, j) represents the jth power of i, which is a fourth-order polynomial matrix: coeff= wherein represents the transpose of A, represents the inverse matrix of, and coeff is a 1×5 matrix coefficient; =coeff S23: Signal validity detection. For the newly acquired 200-point data [601∶800], judge the number of points exceeding the upper and lower thresholds ( and ). If the number of points exceeds a certain number P, then use the point data of [401∶600] to replace the 200-point data of [601∶800], and the obtained output waveform is marked as ; S24: Band-pass filtering is performed on the PPG signal, acceleration, and angular velocity data respectively (0.8 - 3.5 Hz), and Z-Score normalization is performed on the PPG signal to obtain the data , , . The Z-Score normalization is as shown in the formula: Where x is the original data point, μ is the mean of the data set; σ is the standard deviation of the data set; z is the result after normalization; S25: Motion artifact removal, based on the obtained and , use the least mean square algorithm for time-domain adaptive filtering. The input of the filter at the sampling point is as shown in the formula: Among them, is the 3-axis acceleration signal of the accelerometer, is the 3-axis angular velocity signal of the gyroscope; According to the input signal Estimate the artifact signal , and remove these artifacts from the target signal . At the th sampling, the filter output estimates the artifact signal as: Among them is the weight vector of the adaptive filter, and the net target signal output by the filter is: The filter updates the filter weights through the error to update the filter weights Among them, is the step size parameter that controls the speed of weight update; repeat the above steps until the error converges to obtain the signal with motion artifacts removed , and thus obtain the PPG signal with motion artifacts removed ; S26: Downsampling, downsample , and to 25 Hz to obtain data and .
5. The blood oxygen and heart rate monitoring method based on PPG signals and motion data according to claim 4, characterized in that: The step S3: Improved calculation of blood oxygen saturation includes: S31: Signal quality assessment; S32: Calculation of blood oxygen saturation.
6. The blood oxygen and heart rate monitoring method based on PPG signals and motion data according to claim 5, characterized in that: The step S4: Improved heart rate detection algorithm includes: S41: Signal frequency domain transformation; S42: Frame motion state calibration; S43: Using a double-layer frequency domain Wiener filter to further filter out motion artifacts in the PPG signal in the frequency domain through the motion state characterized by the accelerometer; S44: Joint adaptive weighted filtering, for the historical M frames The spectrum is weighted according to three weights: Gaussian weight, state weight, and concentration weight; S45: Piecewise function weighting.
7. The blood oxygen and heart rate monitoring method based on PPG signals and motion data according to claim 6, characterized in that: The step S5: Motion state recognition includes: S51: Data preprocessing and feature extraction, Original dataset construction: Transfer and to the server via Bluetooth, and label the data with the motion state according to the motion state when the data is collected, thereby constructing the original dataset; Data loading: Loading three-axis acceleration and angular velocity data from the original data set and extracting motion state labels; Label Encoding: Use Encode the motion state label into an integer form and convert it into a one-hot encoding ; Time series sliding window: Using the sliding window technique to slice the data to generate time series input features while retaining the context information in the time series; Normalization: Normalizing the sliced data to ensure that the input feature ranges are consistent and reduce the influence of noise; S52: Data partitioning. Randomly shuffle the dataset and divide it into a training set, a validation set, and a test set according to the proportions of , , to ensure the generalization ability of the model. The values of , , are 0.8, 0.1, and 0.1; S53: Model design and construction, Input layer: Receiving multi-dimensional time series input of three-axis acceleration and angular velocity data; Convolution layer: Extracting local spatio-temporal features to enhance the model's perception ability of short-time change patterns; Pooling layer: Through the max pooling operation Reduce the data dimension, extract important features, and at the same time reduce the computational amount; Bidirectional Layer: By bidirectional capturing the forward and backward dependencies of the time series, enhancing the model's learning ability for long-term dependency patterns; Attention mechanism: Highlighting the features of key time steps through a multi-head attention layer to improve the model's classification ability for motion states; Fully-connected layer: Classify the features output by the attention layer and map the results to the probability distributions of each motion state; S54: Model training and optimization, Loss function: Select as the loss function for multi-classification tasks; Optimizer: Use the Adam optimizer to achieve fast convergence and avoid local optima; Evaluation metrics: Use accuracy, precision, recall, and F1-score as the main evaluation metrics to monitor the model performance in real time; S55: Model evaluation and testing, Prediction classification: Predict the motion state categories in the test set through the trained model and output the prediction results; Accuracy calculation: Compare the prediction results with the true labels, calculate the classification accuracy of the model, and verify its performance on the test set; Actual effect: Through the model combining CNN, BiLSTM, and the attention mechanism, classify complex motion patterns, achieving high-precision classification of multiple motion states for the motion state monitoring requirements in multiple scenarios.
8. The blood oxygen and heart rate monitoring method based on PPG signals and motion data according to claim 7, characterized in that: Step S6: Result output. The device displays the blood oxygen saturation and heart rate after smoothing processing, and at the same time transmits them together with and data to the server via Bluetooth. The server classifies the motion states of the and data sent, and transmits them back to the device via Bluetooth for display. At the same time, the blood oxygen saturation, heart rate and motion states are uploaded to the web page, APP, etc. for users to use.
Citation Information
Patent Citations
Blood oxygen detection device based on green light, blood oxygen detection method thereof and medium
CN114073520A
Health monitoring bracelet detection method and system capable of detecting pulse rate and blood oxygen in real time
CN119097310A