Signal processing method in heart rate measurement
By collecting multi-source data, building a heart rate prediction model and setting a difference threshold, the problems of insufficient accuracy and poor adaptability of individual users in existing heart rate measurement methods are solved, and accurate heart rate measurement in complex environments is achieved.
Patent Information
- Application Number
- CN202510534039.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-04-27
AI Technical Summary
The existing heart rate measurement methods rely on fixed parameter settings, cannot flexibly respond to the physiological characteristics and usage scenarios of different users, and lack the comprehensive analysis ability of multi-source data, resulting in inaccurate measurement in complex environments.
Multi-source data from users, including PPG, heartbeat cycle and accelerometer data, synchronize and preprocess, build a heart rate prediction model, use adaptive peak detection and fast Fourier transform to extract features, combine TensorFlow and LSTM network training models, set individual differences and thresholds for application scenarios, and use correction algorithms to adjust the predicted value.
Accurate capture of complex heart rate signal modes is achieved, which improves the accuracy and flexibility of heart rate prediction, reduces prediction errors, and enhances the accuracy of heart rate measurement.
Smart Images

Figure CN120392049A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical signal processing, and particularly to a signal processing method for heart rate measurement. Background Art
[0002] With the development of biomedical engineering technology, heart rate monitoring technology is increasingly widely used in healthcare and daily health management. Ordinary heart rate signal processing methods mainly rely on electrocardiogram technology to obtain heart rate information by detecting cardiac electrical activities. However, this method usually requires professional medical equipment and environment, and is complex to operate, which limits its wide application in daily life.
[0003] There are still deficiencies in the existing signal processing methods for heart rate measurement. Conventional signal processing methods often rely on fixed parameter settings and cannot flexibly cope with the physiological characteristics and usage scenarios of different users. Secondly, most of the existing heart rate prediction models are based on a single type of data source and lack the ability to comprehensively analyze multi-source data. This makes the model perform poorly in heart rate measurement under complex environments and unable to fully utilize wearable devices to provide detailed data information. Summary of the Invention
[0004] In view of the above existing problems, the present invention is proposed.
[0005] Therefore, the present invention provides a signal processing method for heart rate measurement, which solves the problems of insufficient signal processing accuracy and poor adaptability to user individual differences in heart rate measurement methods.
[0006] To solve the above technical problems, the present invention provides the following technical solutions: In a first aspect, the present invention provides a signal processing method for heart rate measurement, which includes collecting the initial heart rate multi-source data of the user and the personal information of the user, synchronizing and preprocessing the initial heart rate multi-source data of the user to obtain the preprocessed user heart rate multi-source data; extracting the heart rate signal features from the preprocessed user heart rate multi-source data, constructing a heart rate prediction model for the user based on the heart rate signal features, and training the parameters of the heart rate prediction model to obtain a trained heart rate prediction model; using the trained heart rate prediction model to calculate the predicted heart rate value of the user, measuring the actual heart rate value of the user, setting a heart rate difference threshold based on the individual differences and application scenarios of the user, and when the difference between the predicted heart rate value and the actual heart rate value of the user exceeds the heart rate difference threshold range, using a correction algorithm to correct the predicted heart rate value of the user to obtain a corrected heart rate value; collecting the comprehensive heart rate data of the user based on the corrected heart rate value and generating management suggestions for heart rate health adjustment.
[0007] As a preferred solution of the signal processing method in the heart rate measurement of the present invention, wherein: collecting the initial heart rate multi-source data of the user and the personal information of the user includes the following steps, The initial heart rate multi-source data of the user includes the user's PPG data, heart beat cycle data, and accelerometer data; The personal information of the user includes the user's age, gender, and health status.
[0008] As a preferred solution of the signal processing method in the heart rate measurement of the present invention, wherein: synchronizing and preprocessing the initial heart rate multi-source data of the user to obtain the preprocessed user heart rate multi-source data includes the following steps, Select the highest sampling frequency as the reference time axis, and use the interpolation method to synchronize and align the initial heart rate multi-source data of the user to the reference time axis; Use a band-pass filter to remove high-frequency noise and low-frequency drift in the PPG data; Use a power frequency filter to remove power interference in the heart beat cycle data; Use a low-pass filter to remove high-frequency vibration noise in the accelerometer data.
[0009] As a preferred solution of the signal processing method in the heart rate measurement of the present invention, wherein: extracting the heart rate signal features from the preprocessed user heart rate multi-source data includes the following steps, Use an adaptive peak detection algorithm to extract the peak position features of each heart beat cycle; Select a time window with a set length, and use SciPy to detect the zero-crossing features of the heart beat cycle; Use the fast Fourier transform library to intercept a section of the preprocessed user heart rate multi-source data, obtain the frequency domain representation, and extract the spectral energy features.
[0010] As a preferred solution of the signal processing method in the heart rate measurement of the present invention, wherein: constructing a heart rate prediction model for the user based on the heart rate signal features and training the parameters of the heart rate prediction model to obtain the trained heart rate prediction model includes the following steps, Combining the personal information of the user, use the TensorFlow learning framework to combine the extracted heart rate signal features into a user heart rate feature vector; Based on the user heart rate feature vector and the initial heart rate multi-source data, construct a labeled data set and a pre-training data set, and divide the pre-training data set into a training set and a validation set; Select a long short-term memory network and use the labeled data set to construct an initial heart rate prediction model with N layers; Input the user's heart rate feature vector into the initial heart rate prediction model for forward propagation to obtain the predicted value of the initial heart rate prediction model; Use a Philips device to obtain the true labels in the pre-training dataset; Use the MSE loss function to calculate the error between the predicted value of the initial heart rate prediction model and the true label; Perform backpropagation on the error between the predicted value and the true label to obtain the parameter gradient of the initial heart rate prediction model; Use the Adam optimizer to update the parameter gradient of the initial heart rate prediction model to obtain the updated parameters of the initial heart rate prediction model; Based on the updated parameters of the initial heart rate prediction model, freeze some layers in the initial heart rate prediction model with N layers, and use a low learning rate to adjust the parameters of the unfrozen layers in combination with the training set. At the same time, gradually release the frozen layers to obtain the adjusted heart rate prediction model; Use the validation set to evaluate the accuracy and AUC-ROC curve in the adjusted heart rate prediction model to obtain the trained heart rate prediction model.
[0011] As a preferred solution of the signal processing method in the heart rate measurement of the present invention, wherein: use the trained heart rate prediction model to calculate the predicted heart rate value of the user, and measure the actual heart rate value of the user, including the following steps, [[ID=...]] Use the robust statistics method combined with the Huber loss function to calculate the mean and median absolute deviation of all heart rate features in the user's heart rate feature vector; Define the median of the user's heart rate feature vector based on the mean and median absolute deviation of all heart rate features; Use the trained heart rate prediction model and combine it with the Gaussian distribution probability function to calculate the predicted heart rate value of the user. The expression is: ; ; ; Wherein, σ represents the mean of all heart rate features, μ represents the transition point of the Huber loss function, M represents the dimension of the user's heart rate feature vector, Represents the Huber loss function, Represents the j-th heart rate feature in the user's heart rate feature vector, D represents the median absolute deviation of all heart rate features, P represents the median of the user's heart rate feature vector, H represents the predicted heart rate value of the user, Represents the scaling factor that makes the mean and median absolute deviation of all heart rate features have the same scale; Select a wearable device and wear it on the user's wrist; The wearable device detects the blood flow by emitting green light to the user's skin and receiving the change in the amount of reflected light, and measures the user's actual heart rate value.
[0012] As a preferred solution of the signal processing method in the heart rate measurement of the present invention, wherein: a heart rate difference threshold is set based on the individual differences of the user and the application scenario. When the difference between the predicted heart rate value and the actual heart rate value of the user exceeds the heart rate difference threshold range, a correction algorithm is used to correct the predicted heart rate value of the user to obtain a corrected heart rate value, including the following steps, Set the heart rate difference threshold; Calculate the difference between the predicted heart rate value and the actual heart rate value of the user; Compare the difference between the predicted heart rate value and the actual heart rate value of the user with the heart rate difference threshold. When the difference exceeds the range of the heart rate difference threshold, use the least squares correction algorithm to perform corresponding correction on the predicted heart rate value of the user; When the predicted heart rate value of the user is greater than the sum of the actual heart rate value of the user and the heart rate difference threshold, reduce the predicted heart rate value of the user; When the predicted heart rate value of the user is less than the difference between the actual heart rate value of the user and the heart rate difference threshold, increase the predicted heart rate value of the user.
[0013] As a preferred solution of the signal processing method in the heart rate measurement of the present invention, wherein: based on the corrected heart rate value, collect the user's comprehensive heart rate data and generate management suggestions for heart rate health adjustment, including the following steps, Convert the corrected heart rate value into a heart rate display standard format, and set the sampling frequency of the wearable device to collect the user's comprehensive heart rate data over a past period of time; The user's comprehensive heart rate data over the past period of time includes resting heart rate data, maximum heart rate data, and minimum heart rate data; Use a line chart to analyze the heart rate change trend of the user's comprehensive heart rate data over a past period of time to generate a health report for the user; Based on the user's health report, provide management suggestions for heart rate health adjustment to the user.
[0014] In a second aspect, the present invention provides a computer device, including a memory and a processor, where the memory stores a computer program, wherein: when the computer program is executed by the processor, any step of the signal processing method in the heart rate measurement as described in the first aspect of the present invention is implemented.
[0015] In a third aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, wherein: when the computer program is executed by the processor, any step of the signal processing method in the heart rate measurement as described in the first aspect of the present invention is implemented.
[0016] The beneficial effects of the present invention are as follows: By constructing a heart rate prediction model, accurate capture of complex heart rate signal patterns is achieved. The adaptive peak detection algorithm and fast Fourier transform technology are used to extract features, which can effectively cope with the individual differences of different users, improve the accuracy of heart rate prediction. Based on the individual differences of users and application scenarios, a heart rate difference threshold is set. When the difference between the predicted value and the actual value exceeds the threshold, the least squares correction algorithm is used to correct the predicted value. By adjusting the correction amplitude in this process, the prediction error is effectively reduced, and the accuracy and flexibility of heart rate measurement are enhanced. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0018] Figure 1 It is a flowchart of the signal processing method in heart rate measurement in Embodiment 1.
[0019] Figure 2 It is a flowchart of correcting the predicted heart rate value of the user in Embodiment 1. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0020] In order to make the above objects, features, and advantages of the present invention more obvious and understandable, the following will make a detailed description of the specific embodiments of the present invention with reference to the drawings of the specification.
[0021] Many specific details are set forth in the following description in order to provide a thorough understanding of the present invention. However, the present invention can be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.
[0022] Secondly, the so-called "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that can be included in at least one implementation of the present invention. The phrase "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment that is mutually exclusive with other embodiments.
[0023] Embodiment 1, referring to Figure 1 and Figure 2 , is the first embodiment of the present invention. This embodiment provides a signal processing method in heart rate measurement, including the following steps: S1. Collect the user's initial multi-source heart rate data and the user's personal information, synchronize and preprocess the user's initial multi-source heart rate data to obtain the preprocessed user multi-source heart rate data.
[0024] It includes the following steps: The user's initial multi-source heart rate data includes the user's PPG data, heartbeat cycle data, and accelerometer data; The user's personal information includes the user's age, gender, and health status (all of the above information has been obtained with the user's consent and is used for legal purposes); Select the highest sampling frequency (i.e., the highest sampling frequency of the sensor, which is the PPG sensor here, with a sampling frequency of 100 Hz) as the reference time axis, and use the interpolation method to synchronize and align the user's initial multi-source heart rate data to the reference time axis (the purpose of synchronization and alignment is to eliminate the timing differences between different initial multi-source heart rate data); Use a band-pass filter to remove high-frequency noise (such as environmental light interference) and low-frequency drift (such as baseline drift caused by temperature changes) in the PPG data; Use a power frequency filter to remove power interference (frequency of 50 Hz - 60 Hz) in the heartbeat cycle data; Use a low-pass filter to remove high-frequency vibration noise (such as rapid jitter) in the accelerometer data.
[0025] S2. Extract the heart rate signal features from the preprocessed user multi-source heart rate data, construct a heart rate prediction model for the user based on the heart rate signal features, and train the parameters of the heart rate prediction model to obtain the trained heart rate prediction model.
[0026] It includes the following steps: Use the adaptive peak detection algorithm (set the height parameter and the distance parameter, the height parameter is used to filter out the pseudo-peaks caused by noise, and the distance parameter is used to complete the time of one cardiac cycle between adjacent peaks) to extract the peak position features of each heartbeat cycle; Select a time window of a set length (such as 10 seconds), and use SciPy to detect the zero-crossing features of the heartbeat cycle; Use the np.sign function in the SciPy library to find the change points of the heartbeat cycle, and then use the np.diff function to find the positions of these change points as the zero-crossing points of the heartbeat cycle; Use the fast Fourier transform library (fft function) to intercept a section of the preprocessed user multi-source heart rate data to obtain the frequency domain representation and extract the spectral energy features (i.e., the energy distribution of the heart rate signal in the frequency domain); Perform FFT transformation on the preprocessed multi-source user heart rate data using the fft function to obtain the original spectral amplitude. Divide the zero-crossing points of the heartbeat period into multiple heartbeat period segments, then perform FFT transformation on each segment separately to obtain the local spectral amplitude. Combine the local spectral amplitude and the original spectral amplitude to form a complete frequency-domain representation, and then extract the sum of the squares of the spectral amplitudes to obtain the spectral energy feature; Combine the personal information of the user, and use the TensorFlow learning framework to combine the extracted heart rate signal features into a user heart rate feature vector; First, use Z-score to standardize the personal information of the user. For categorical variables (such as gender), use one-hot encoding for encoding. For example, a male is encoded as [1,0], and a female is encoded as [0,1]; Use the TensorFlow learning framework to concatenate the encoded user personal information and heart rate signal features in sequence to form a high-dimensional user heart rate feature vector. Suppose a user's personal information and heart rate signal features are: age: 30 years old, gender: male, weight: 70 kg, height: 177 cm, peak position feature: [1.2, 1.5, 1.7], zero-crossing point feature: [0.8, 1.0, 1.2], spectral energy feature: [0.5, 0.6, 0.7]. Then the concatenated feature vector is: [0.2, 1, 0, 0.5, 0.7, 1.2, 1.5, 1.7, 0.8, 1.0, 1.2, 0.5, 0.6, 0.7]; Based on the user heart rate feature vector and the initial multi-source heart rate data, construct a labeled dataset and a pre-training dataset (select a large-scale publicly available heart rate dataset and combine it with the user heart rate feature vector to form a pre-training dataset), and divide the pre-training dataset into a training set and a validation set (the allocation ratio is 70%, 30%); Pair the heart rate feature vector of each user after concatenation with its corresponding initial multi-source heart rate data. Take the heart rate feature vector of a user [0.4, 1, 0, 0.2, 0.5, 1.2, 1.8, 1.7, 0.5, 1, 1.1, 0.6, 0.7, 0.6] as an example, and its corresponding initial multi-source heart rate data is [1.5, 1.5, 1.9], [0.3, 0.6, 1.7], [0.3, 0.7, 1]. Then pair them to form a complete paired sample (i.e., the labeled dataset); Select the long short-term memory network (LSTM) and use the labeled dataset to construct an initial heart rate prediction model with N (N can be 2 to 6 layers, specifically depending on the scale of the labeled dataset. Here, choose 5-layer LSTM as the initial architecture. This depth can capture dependencies within a relatively long time range without making the initial heart rate prediction model overly complex) layers; The reason for choosing LSTM is that it is a neural network structure suitable for processing sequential data. Since the heart rate signal is essentially a time series data, LSTM is very suitable for the heart rate prediction task; The architecture of this initial heart rate prediction model is divided into an input layer, a feature extraction layer, a high-level feature extraction layer, a fully connected layer, and an output layer; Input layer: Confirm the input dimension and represent it in the form of a three-dimensional tensor (for example, if the length of a user's heart rate feature vector is 14, the input dimension is batch_size, time_steps, 14); Feature extraction layer: Set 128 neurons (which can be adjusted according to the specific task) and use tanh as the activation function (the output range is between -1 and 1) to keep the gradient state of this layer stable; High-level feature extraction layer: The design idea is the same as that of the feature extraction layer. The only difference is that it is necessary to extract high-level heart rate signal features from the feature extraction layer for the final heart rate prediction; Fully connected layer: Set 64 or 32 neurons, and use the ELU activation function to map the output result of the high-level feature extraction layer to a scalar (i.e., the heart rate prediction value) through a linear transformation; Output layer: Convert the heart rate prediction value completed by the fully connected layer into a specific numerical value; Input the user's heart rate feature vector into the initial heart rate prediction model for forward propagation to obtain the prediction value of the initial heart rate prediction model; The process of forward propagation is as follows: Receive the user's heart rate feature vector - set the hidden state - update the internal state - use the gating mechanism (forget gate, input gate, output gate) to process the internal state information (the forget gate determines which information needs to be discarded, the input gate determines which new information needs to be stored, and the output gate determines which information needs to be output to the next time step) - perform a weighted sum on the final internal state information - obtain the prediction value of the initial heart rate prediction model; Use a Philips device to obtain the true labels in the pre-training dataset; When constructing the pre-training dataset using a Philips device, synchronously record the user's physiological indicators (such as activity type) as the annotation information of the original physiological indicators, and combine the user's electrocardiogram data for comparison and screening to find the user's physiological indicator samples that are not affected by time offset (such as the user's breathing rate in a static state) as the true labels; Use the MSE (mean squared error) loss function to calculate the error between the prediction value of the initial heart rate prediction model and the true label; The formula is as follows: ; Where, S represents the error between the predicted value of the initial heart rate prediction model and the true label, n represents the number of time steps, represents the true label within the t-th time step, represents the predicted value of the initial heart rate prediction model within the t-th time step; Perform backpropagation on the error between the predicted value and the true label to obtain the parameter gradients of the initial heart rate prediction model; Starting from the output layer, use the chain rule to gradually calculate the parameter gradients of each layer of the initial heart rate prediction model forward. Assume that the output layer is the result of a linear transformation plus an activation function (such as ReLU), then it is necessary to calculate the loss gradient relative to the weights of this linear transformation, and use matrix multiplication to calculate the parameter loss gradients of the fully connected layer. Repeat the operation to gradually forward the parameter loss gradients layer by layer until the input layer; After calculating the parameter loss gradients of the input layer, use mini-batch training to accumulate the parameter loss gradients of each layer to obtain all the parameter gradients of the initial heart rate prediction model; Use the Adam optimizer to update the parameter gradients of the initial heart rate prediction model to obtain the updated parameters of the initial heart rate prediction model; Define two state variables, the first moment estimate and the second moment estimate, and initialize them to zero; For the first moment estimate, set a hyperparameter (value 0.9) according to the time step gradients of the current initial heart rate prediction model and perform an exponentially weighted average on the time step gradients to obtain the stacked historical gradients (i.e., the time step gradients are weakened); For the second moment estimate, set a hyperparameter (value 0.999) according to the squares of the time step gradients of the current initial heart rate prediction model and perform an exponentially weighted average on the time step gradients to obtain the change amplitude of the time step gradients; Based on the stacked historical gradients and the change amplitude of the time step gradients, set an adaptive learning rate to update the initial heart rate prediction model at different speeds in different feature dimensions until approaching the optimal solution; Based on the updated parameters of the initial heart rate prediction model, freeze some layers (feature extraction layer and advanced feature extraction layer) in the N-layer initial heart rate prediction model, and use a low learning rate to adjust the parameters of the unfrozen part of the layers (input layer, output layer, and fully connected layer) in combination with the training set. At the same time, gradually release the frozen layers to obtain the adjusted heart rate prediction model; The purpose of freezing some layers in the initial heart rate prediction model is that this way can retain the basic feature representations that the initial heart rate prediction model has learned, and these low-level features are relatively similar among different users, avoiding re-learning these features on newly emerging data later, thereby accelerating the training speed and reducing the risk of overfitting; The freezing process is as follows: Use load_state_dict in the PyTorch learning framework to load the initial heart rate prediction model weight file, and define the class of the initial heart rate prediction model according to the weight file using HeartRatePredictor; Use freeze_layers to iterate through all the parameters within each layer of the initial heart rate prediction model, print the parameter names of each layer and their requires_grad attributes, turn off the calculation gradients of all parameters, and determine whether they belong to the feature extraction layer and the advanced feature extraction layer that need to be frozen according to their attributes. If the requires_grad attribute of a certain layer is False, it means that the layer has been frozen; if the requires_grad attribute is True, it means that the layer has not been frozen; Use a low learning rate (set to 0.001, the purpose is to make the parameter update amplitude smaller) to train the parameters of the unfrozen part of the layers for a small number of epochs (5 - 10 epochs) using the training set. After each training epoch, check the performance on the validation set and record the validation loss of each epoch. If the validation loss on the validation set continues to decrease, maintain the current learning rate; if the loss no longer decreases significantly or starts to increase, appropriately reduce the learning rate (such as halving it) or increase the regularization term; The reason for gradually unfreezing the frozen layers is to introduce more levels of feature adjustment, thereby enhancing the adaptability of the initial heart rate prediction model to the newly incorporated data; Use the validation set to evaluate the accuracy and AUC-ROC curve in the adjusted heart rate prediction model to obtain the trained heart rate prediction model; Accuracy: Set an accuracy threshold according to the specific business objective (usually the threshold range is between -5 and 5). Based on this threshold, count the number of data samples correctly predicted by the adjusted heart rate prediction model, and divide the number of correctly predicted data samples by the total number of predicted data samples to calculate the accuracy in the adjusted heart rate prediction model (if the accuracy under the current threshold reaches more than 90%, the overall prediction ability of the adjusted heart rate prediction model is excellent at this time); AUC-ROC curve: Define the confusion matrix (including true positives, false positives, true negatives, and false negatives), and use the confidence scores to calculate the true positive rate (obtained by dividing the true positives by the sum of true positives and false negatives) and the false positive rate (obtained by dividing the false positives by the sum of false positives and true negatives); Connect each point of the true positive rate and the false positive rate in sequence to draw the ROC curve; Use the trapezoidal method to approximate the area between adjacent two points as a trapezoid, and accumulate the areas of all trapezoids to calculate the area of the ROC (i.e., AUC. The closer the AUC value is to 1, the better the classification performance of the adjusted heart rate prediction model).
[0027] S3. Calculate the predicted heart rate value of the user using the trained heart rate prediction model, measure the actual heart rate value of the user, set a heart rate difference threshold based on the individual differences and application scenarios of the user. When the difference between the predicted heart rate value and the actual heart rate value of the user exceeds the heart rate difference threshold range, use a correction algorithm to correct the predicted heart rate value of the user to obtain the corrected heart rate value.
[0028] It includes the following steps Use the robust statistics method (a method to reduce the influence of outliers on the data analysis results) combined with the Huber loss function to calculate the mean and median absolute deviation of all heart rate features in the user's heart rate feature vector; In this step, by calculating the mean and median absolute deviation of all heart rate features, the heart rate prediction model can better adapt to different data distribution situations. Especially when there may be large fluctuations or outliers in the predicted heart rate value, it can still provide accurate prediction results; Define the median of the user's heart rate feature vector based on the mean and median absolute deviation of all heart rate features; For example, assume a set of user heart rate feature vectors is [16, 14, 20, 15, 10], each number represents a heart rate feature. Sort each heart rate feature from smallest to largest as [10, 14, 15, 16, 20]. Since there are 5 odd numbers, the median is 15. At this time, it is necessary to use the difference obtained by subtracting this median from each heart rate feature to form a difference set [5, 0, 1, 1, 5], and the median of the difference set is 1; Use the trained heart rate prediction model and combine it with the Gaussian distribution probability function to calculate the predicted heart rate value of the user. The expression is: ; ; ; where, σ represents the mean of all heart rate features, μ represents the transition point of the Huber loss function, which is used to control the linear loss, M represents the dimension of the user's heart rate feature vector, represents the Huber loss function, represents the j-th heart rate feature in the user's heart rate feature vector, D represents the median absolute deviation of all heart rate features, P represents the median of the user's heart rate feature vector, H represents the predicted heart rate value of the user, represents the scaling factor (set to 1.4826) that makes the mean and median absolute deviation of all heart rate features have the same scale, represents the exponential term of the Gaussian distribution probability function, that is, it describes how the distance between and σ affects the probability density process; Select a wearable device (Apple Watch) and wear it on the user's wrist (the non-dominant hand wrist. For example, a right-handed user should wear it on the left wrist). The reason for choosing the Apple Watch is that it is easy to wear and operate. Without the need to carry other devices additionally, users can monitor their heart rate anytime and anywhere. It can also record multiple health indicators such as steps, calorie consumption, and sleep quality, helping users comprehensively manage their physical conditions. The wearable device detects the blood flow condition and measures the user's actual heart rate value by emitting green light (green light wavelength) towards the user's skin and receiving the change in the amount of reflected light. When the user's heart beats, the blood flow changes, resulting in a change in the intensity of the reflected green light. The Apple Watch determines the time interval of each heartbeat cycle by detecting these changes in the reflected light and converting them into electrical signals, detecting the fluctuations in blood flow (i.e., hemoglobin level), and thus measuring the actual heart rate value. Set the heart rate difference threshold (set according to the user's individual differences and application scenarios. For example, for users in a resting state, the setting range of the heart rate difference threshold can be smaller, while for users during high-intensity exercise, the heart rate difference threshold can be larger). The user's individual differences include the user's physical condition (for example, young people have a higher basal heart rate and a larger heart rate fluctuation range than the elderly) and exercise habits (the heart rate change range of high-intensity trainers is wider, and the fluctuation of low-intensity exercisers is smaller). Application scenarios include the user's daily walking volume (such as walking to and from work), activity training volume (such as running), and sleep monitoring. In this step, by considering the user's individual differences and application scenarios and setting the heart rate difference threshold, it can more accurately reflect the user's real heart rate changes. Whether in daily life or during exercise, it can better adapt to heart rate changes in different situations and provide more reliable monitoring results. Calculate the difference between the user's predicted heart rate value and the actual heart rate value. Compare the difference between the user's predicted heart rate value and the actual heart rate value with the heart rate difference threshold. When the difference exceeds the range of the heart rate difference threshold, use the least squares correction algorithm (a regression method that minimizes the sum of the squares of the errors between the predicted value and the actual value, which is used here to adjust the predicted heart rate value) to perform corresponding correction on the user's predicted heart rate value. The purpose of correcting the user's predicted heart rate value is to make the predicted heart rate value closer to the real value, thereby reducing errors and timely detecting potential problems in the body (such as heart diseases, over-fatigue). When the predicted heart rate value of the user is greater than the sum of the actual heart rate value of the user and the heart rate difference threshold, reduce the predicted heart rate value of the user. The expression is as follows: ; When the predicted heart rate value of the user is less than the difference between the actual heart rate value of the user and the heart rate difference threshold, increase the predicted heart rate value of the user. The expression is as follows: ; Wherein, represents the corrected heart rate value, represents the actual measured value of the user, H represents the predicted heart rate value of the user, and E represents the adjustment coefficient for controlling the correction amplitude.
[0029] S4. Collect the comprehensive heart rate data of the user based on the corrected heart rate value and generate management suggestions for heart rate health adjustment.
[0030] It includes the following steps Convert the corrected heart rate value into the standard format for heart rate display (such as 71.5 BPM, that is, the user's heart beats 71.5 times per minute), and set the sampling frequency of the wearable device (Apple Watch) (collect once every five minutes, and increase the sampling frequency to once per second or higher during exercise. The user can also manually change the sampling frequency according to their own situation), and collect the comprehensive heart rate data of the user in the past period (one week) (for athletes or fitness enthusiasts, collecting this comprehensive heart rate data can help this user group formulate a more scientific training plan and avoid overtraining or injury); The comprehensive heart rate data of the user in the past period includes resting heart rate data (that is, the heart rate data collected when the user is in a static state, such as when waking up in the morning and not getting out of bed), maximum heart rate data (the peak heart rate data collected during high-intensity exercise, used to measure the user's exercise intensity limit), and minimum heart rate data (the minimum heart rate data collected during deep sleep or low metabolic state, used to reflect the user's heart rate recovery ability and overall health status); Use a line chart to analyze the heart rate change trend of the user's comprehensive heart rate data in the past period and generate a health report for the user; Select an appropriate time interval (for daily activity monitoring, one hour can be selected as a time point; for sports training, one minute can be selected as a time point) and draw a two-dimensional coordinate (the X-axis represents time and the Y-axis represents the user's heart rate value), and plot the heart rate value corresponding to each time point on the graph to form a line chart; Observe the peaks and valleys in the line chart to identify the high heart rate and low heart rate conditions of the user during a specific period. For example, the heart rate is lower when waking up in the morning and higher during exercise; Based on the high and low heart rates of the user within a specific time period, analyze the change patterns of the heart rate, such as whether there are regular periodic fluctuations (such as the difference in heart rate between day and night), whether there are sudden rises or drops (which may indicate a stress response). Mark important life events or activities on the line graph, such as intense exercise, sleep periods, and meal times, and use different colors to distinguish different types of time points (e.g., blue for resting heart rate and red for exercise heart rate). The user's health report includes a heart rate change trend graph (add annotations on the graph to explain the reasons for peaks and troughs), a summary of key indicators (the resting heart rate after getting up every morning to help the user understand the basal metabolic level, the maximum heart rate reached every day, especially the heart rate peak during high-intensity exercise, and the lowest heart rate every day, which usually appears during deep sleep). Based on the user's health report, provide management suggestions for heart rate health adjustment to the user (for different user groups). For office worker users, it is recommended to perform 5 - 10 minutes of deep breathing exercises every day to regulate the autonomic nerves. The specific methods include abdominal breathing and the 4 - 7 - 8 breathing method. In terms of diet, reduce the intake of high-sugar and high-fat foods, and increase the intake of fiber-rich foods, such as vegetables, fruits, and whole grains, to maintain stable blood sugar and avoid abnormal elevation of heart rate due to blood sugar fluctuations. For fitness athlete users, set different training zones according to HRmax (such as low-intensity, medium-intensity, and high-intensity). For example, during low-intensity training, the heart rate should be controlled at 60% - 70% HRmax, and during medium-intensity training, it should be controlled at 70% - 80% HRmax. Conduct 10 - 15 minutes of dynamic warm-up before each training to activate the cardiopulmonary function and prevent sudden increase in heart rate; perform static stretching after training to help the heart rate gradually return to normal and promote muscle recovery. After each high-intensity training, monitor the heart rate recovery speed. Under normal circumstances, the heart rate should drop by about 20 BPM within 1 minute after the end of training. If the recovery is slow, it indicates physical fatigue or insufficient recovery, and it is recommended to appropriately reduce the training intensity or extend the rest time.
[0031] For this type of user who are the elderly (a population with a higher risk of cardiovascular diseases), measure the resting heart rate once every morning before getting up, record and observe its change trend. If it is found that the resting heart rate continuously exceeds the normal range (60 - 100 BPM), consult a doctor in time to rule out heart problems, and conduct a comprehensive cardiovascular examination once a year, including indicators such as electrocardiogram, blood pressure, and blood lipids. If there are chronic diseases such as hypertension and coronary heart disease, take medications strictly according to the doctor's advice to control the condition. In terms of diet, pay attention to being light, reduce the intake of salt and fat, eat more foods rich in minerals such as potassium and magnesium, such as bananas and spinach, and at the same time, maintain an appropriate water intake to avoid abnormal heart rate caused by dehydration.
[0032] This embodiment also provides a computer device, which is applicable to the signal processing method in heart rate measurement, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the signal processing method in heart rate measurement as proposed in the above embodiment.
[0033] The computer device can be a terminal. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be achieved through WIFI, a carrier network, NFC (Near Field Communication), or other technologies. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, a trackball, or a touchpad provided on the outer shell of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0034] This embodiment also provides a storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the signal processing method in heart rate measurement as proposed in the above embodiment; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM for short), Electrically Erasable Programmable Read-Only Memory (EEPROM for short), Erasable Programmable Read-Only Memory (EPROM for short), Programmable Read-Only Memory (PROM for short), Read-Only Memory (ROM for short), magnetic memory, flash memory, a magnetic disk, or an optical disc.
[0035] In summary, the present invention realizes the precise capture of complex heart rate signal patterns by constructing a heart rate prediction model. The use of an adaptive peak detection algorithm and fast Fourier transform technology to extract features can effectively cope with individual differences among different users and improve the accuracy of heart rate prediction. Based on the individual differences of users and application scenarios, a heart rate difference threshold is set. When the difference between the predicted value and the actual value exceeds the threshold, the least squares correction algorithm is used to correct the predicted value. This process effectively reduces the prediction error and enhances the accuracy and flexibility of heart rate measurement by adjusting the correction amplitude.
[0036] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.
Claims
1. A signal processing method in heart rate measurement, characterized in that: including, collecting the initial multi-source heart rate data of the user and the personal information of the user, synchronizing and preprocessing the initial multi-source heart rate data of the user to obtain the preprocessed multi-source heart rate data of the user; extracting the heart rate signal features from the preprocessed multi-source heart rate data of the user, constructing a heart rate prediction model for the user based on the heart rate signal features, and training the parameters of the heart rate prediction model to obtain the trained heart rate prediction model; using the trained heart rate prediction model to calculate the predicted heart rate value of the user, measuring the actual heart rate value of the user, setting a heart rate difference threshold based on the individual differences and application scenarios of the user, and when the difference between the predicted heart rate value and the actual heart rate value of the user exceeds the heart rate difference threshold range, using a correction algorithm to correct the predicted heart rate value of the user to obtain the corrected heart rate value; collecting the comprehensive heart rate data of the user based on the corrected heart rate value and generating management suggestions for heart rate health adjustment.
2. The signal processing method in heart rate measurement according to claim 1, characterized in that: The collecting of the initial multi-source heart rate data of the user and the collection of the personal information of the user include the following steps, The initial multi-source heart rate data of the user includes the user's PPG data, heart beat cycle data, and accelerometer data; The personal information of the user includes the user's age, gender, and health status.
3. The signal processing method in heart rate measurement according to claim 2, characterized in that: Synchronizing and preprocessing the initial multi-source heart rate data of the user to obtain the preprocessed multi-source heart rate data of the user includes the following steps, selecting the highest sampling frequency as the reference time axis and using the interpolation method to synchronize and align the initial multi-source heart rate data of the user to the reference time axis; using a band-pass filter to remove the high-frequency noise and low-frequency drift in the PPG data; using a power frequency filter to remove the power interference in the heart beat cycle data; using a low-pass filter to remove the high-frequency vibration noise in the accelerometer data.
4. The signal processing method in heart rate measurement according to claim 3, characterized in that: The extracting of the heart rate signal features from the preprocessed multi-source heart rate data of the user, includes the following steps, using an adaptive peak detection algorithm to extract the peak position features of each heart beat cycle; selecting a time window of a set length and using SciPy to detect the zero-crossing features of the heart beat cycle; using the fast Fourier transform library to intercept a section of the preprocessed multi-source heart rate data of the user to obtain the frequency domain representation and extract the spectral energy features.
5. The signal processing method in heart rate measurement according to claim 4, characterized in that: The constructing of a heart rate prediction model for the user based on the heart rate signal features and the training of the parameters of the heart rate prediction model to obtain the trained heart rate prediction model includes the following steps, combining the personal information of the user and using the TensorFlow learning framework to combine the extracted heart rate signal features into a user heart rate feature vector; based on the user heart rate feature vector and the initial multi-source heart rate data, constructing a labeled data set and a pre-training data set, and dividing the pre-training data set into a training set and a validation set; selecting a long short-term memory network and using the labeled data set to construct an initial heart rate prediction model with N layers; inputting the user heart rate feature vector into the initial heart rate prediction model for forward propagation to obtain the predicted value of the initial heart rate prediction model; using a Philips device to obtain the true labels in the pre-training data set; using the MSE loss function to calculate the error between the predicted value of the initial heart rate prediction model and the true labels; Backpropagate the error between the predicted value and the true label to obtain the parameter gradients of the initial heart rate prediction model; Use the Adam optimizer to update the parameter gradients of the initial heart rate prediction model to obtain the updated parameters of the initial heart rate prediction model; Based on the updated parameters of the initial heart rate prediction model, freeze some layers in the initial heart rate prediction model with N layers, and use a low learning rate to adjust the parameters of the unfrozen part of the layers in combination with the training set. At the same time, gradually release the frozen layers to obtain the adjusted heart rate prediction model; Use the validation set to evaluate the accuracy and AUC-ROC curve in the adjusted heart rate prediction model to obtain the trained heart rate prediction model.
6. The signal processing method in heart rate measurement according to claim 5, characterized in that: Use the trained heart rate prediction model to calculate the predicted heart rate value of the user and measure the actual heart rate value of the user, including the following steps, Use the robust statistics method combined with the Huber loss function to calculate the mean and median absolute deviation of all heart rate features in the user's heart rate feature vector; Define the median of the user's heart rate feature vector based on the mean and median absolute deviation of all heart rate features; Use the trained heart rate prediction model and combine it with the Gaussian distribution probability function to calculate the predicted heart rate value of the user. The expression is: ; ; ; Among them, σ represents the mean of all heart rate features, μ represents the transition point of the Huber loss function, M represents the dimension of the user's heart rate feature vector, represents the Huber loss function, represents the j-th heart rate feature in the user's heart rate feature vector, D represents the median absolute deviation of all heart rate features, P represents the median of the user's heart rate feature vector, H represents the predicted heart rate value of the user, represents the scaling factor that makes the mean and median absolute deviation of all heart rate features have the same scale; Select a wearable device and wear it on the user's wrist; The wearable device detects the blood flow situation by emitting green light to the user's skin and receiving the change in the amount of reflected light, and measures the actual heart rate value of the user.
7. The signal processing method in heart rate measurement according to claim 6, characterized in that: Based on the individual differences and application scenarios of the user, set a heart rate difference threshold. When the difference between the predicted heart rate value and the actual heart rate value of the user exceeds the heart rate difference threshold range, use a correction algorithm to correct the predicted heart rate value of the user to obtain the corrected heart rate value, including the following steps, Set the heart rate difference threshold; Calculate the difference between the predicted heart rate value and the actual heart rate value of the user; Compare the difference between the predicted heart rate value and the actual heart rate value of the user with the heart rate difference threshold. When the difference exceeds the heart rate difference threshold range, use the least squares correction algorithm to perform corresponding correction on the predicted heart rate value of the user; When the predicted heart rate value of the user is greater than the sum of the actual heart rate value of the user and the heart rate difference threshold, reduce the predicted heart rate value of the user; When the predicted heart rate value of the user is less than the difference between the actual heart rate value of the user and the heart rate difference threshold, increase the predicted heart rate value of the user.
8. The signal processing method in heart rate measurement according to claim 7, characterized in that: Collect the comprehensive heart rate data of the user based on the corrected heart rate value and generate management suggestions for heart rate health adjustment, including the following steps, Convert the corrected heart rate value into the heart rate display standard format, set the sampling frequency of the wearable device, and collect the comprehensive heart rate data of the user in the past period of time; The comprehensive heart rate data of the user in the past period of time includes resting heart rate data, maximum heart rate data, and minimum heart rate data; Use a line chart to analyze the heart rate change trend of the comprehensive heart rate data of the user in the past period of time to generate a health report of the user; Based on the health report of the user, provide management suggestions for heart rate health adjustment to the user.
9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the signal processing method in the heart rate measurement according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the steps of the signal processing method in the heart rate measurement according to any one of claims 1 to 8.
Citation Information
Patent Citations
Heart rate measurement method and system
CN105943016A
Deep neural network blood pressure prediction training method, computer device and storage medium
CN113647905A
Novel heart rate value correction equipment based on intelligent wearable device
CN117582196A
Human body physiological index detection method and system based on millimeter wave radar
CN118824452A
Heart rate value prediction method and device, medium and equipment
CN119055207A