A method, device and readable storage medium for acquiring a motion heart rate
By filtering PPG and ACC signals and using neural network models and Kalman filtering, the issues of comfort and accuracy in heart rate monitoring during exercise were resolved, achieving efficient and accurate measurement of heart rate during exercise.
Patent Information
- Application Number
- CN202511307669.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-09-15
AI Technical Summary
Existing sports heart rate monitoring devices struggle to balance measurement comfort and accuracy during exercise. Heart rate chest straps are prone to discomfort and unstable signals during exercise, while armbands and watches based on PPG signals are severely affected by limb movement during exercise, leading to decreased measurement accuracy.
By acquiring the initial PPG and ACC signals, and after filtering, the ACC signal is used as the input signal for adaptive filtering. Combined with the heart rate probability neural network model and Kalman filtering, motion artifacts are removed and the signals are dynamically fused to output an accurate heart rate value.
It achieves both accuracy and comfort in heart rate measurement during sports activities, reduces hardware requirements, is suitable for smart wearable devices, and has strong practical application value.
Smart Images

Figure CN120827358B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of data processing, and particularly relates to a method for acquiring a motion heart rate, a device and a readable storage medium. BACKGROUND
[0002] The motion heart rate, as the real-time heart rate data of a human body during exercise, is of great significance to personal exercise safety and effect. It can provide immediate physical state feedback for the exerciser, helping him / her to adjust the exercise intensity in time during the exercise process and avoid damage to the body caused by excessive exercise. Therefore, real-time and accurate measurement of the heart rate during exercise has become a key requirement in the field of exercise monitoring.
[0003] At present, the mainstream method for measuring the heart rate during exercise mainly includes three types of devices: one is a heart rate chest band based on an ECG (Electrocardiogram) signal, the second is a heart rate arm band based on a PPG (Photoplethysmography) signal, and the third is a smart bracelet or watch based on a PPG signal. Among them, the heart rate chest band realizes heart rate measurement by monitoring the electrocardiogram signal, and has the main feature of high measurement accuracy in the prior art. The heart rate arm band, smart bracelet and watch rely on the photoplethysmogram signal (PPG) for heart rate monitoring, and have the characteristics of relatively flexible wearing and less static interference, and are widely used in the consumer-level smart wearable market.
[0004] However, the prior art still has obvious deficiencies. Although the heart rate chest band has high accuracy, it needs to be worn close to the chest, which may cause discomfort to the user during exercise. In addition, in the winter, in the environment with dry skin and strong static electricity, the heart rate may not be measured normally due to unstable signal transmission. Although the arm band, bracelet and watch based on the PPG signal are comfortable to wear, the body shaking during exercise will cause strong interference to the PPG signal, forming motion artifacts, which makes it difficult for the sensor to capture the real heart rate characteristics, and seriously affects the measurement accuracy. These defects make it difficult for the prior art to balance the measurement comfort and accuracy in the exercise scene, and cannot fully meet the user's demand for reliable motion heart rate monitoring. SUMMARY
[0005] The purpose of the present application is to provide a method for acquiring a motion heart rate, which aims to solve the problem of inaccurate motion heart rate acquisition in the prior art. The method for acquiring a motion heart rate provided by the present application comprises the following steps:
[0006] acquiring an initial PPG signal and an initial ACC signal;
[0007] filtering the initial PPG signal and the initial ACC signal to obtain a first PPG signal and a first ACC signal;
[0008] Adaptively filter the first ACC signal as an input signal and the first PPG signal as an expected signal to obtain a second PPG signal;
[0009] Input the first ACC signal, the first PPG signal and the second PPG signal into a pre-trained heart rate probability neural network model to obtain a heart rate probability spectrum;
[0010] Perform Kalman filtering based on the heart rate probability spectrum to obtain a filtered heart rate value, and an observation error covariance used in the Kalman filtering process is associated with a maximum probability value in the heart rate probability spectrum.
[0011] Optionally, the method for obtaining a motion heart rate provided in the first aspect of the embodiments of the present application comprises:
[0012] The initial PPG signal and the initial ACC signal are processed by a band-pass filter to obtain the first ACC signal and the first PPG signal, and a passband frequency range of the band-pass filter is (0.5Hz, 4Hz].
[0013] Optionally, the heart rate probability neural network model is composed of a convolutional neural network structure and a long short-term memory network structure, and comprises two convolutional layers, two pooling layers, one flatten layer, one LSTM layer and two fully connected layers.
[0014] Optionally, the method for obtaining a motion heart rate provided in the first aspect of the embodiments of the present application comprises:
[0015] The first ACC signal is a three-axis acceleration signal, and a first resultant acceleration signal of the first ACC signal is calculated according to the following formula:
[0016]
[0017] wherein is the first resultant acceleration signal, is an X-axis direction acceleration signal, is a Y-axis direction acceleration signal, is a Z-axis direction acceleration signal;
[0018] convert the first combined acceleration signal, the first PPG signal and the second PPG signal to obtain a first combined acceleration spectrum, a first PPG spectrum and a second PPG spectrum, the first combined acceleration spectrum, the first PPG spectrum and the second PPG spectrum being spectrum data of a target length respectively;
[0019] input the first combined acceleration spectrum, the first PPG spectrum and the second PPG spectrum into the pre-trained heart rate probability neural network model to obtain a heart rate probability spectrum.
[0020] Optionally, based on the motion heart rate acquisition method provided in the first aspect of the present application, the Kalman filtering based on the heart rate probability spectrum is performed to obtain a filtered heart rate value, including:
[0021] The filtering formula used includes:
[0022] Predicted heart rate: ;
[0023] Prediction error covariance: ;
[0024] Kalman gain: ;
[0025] Data fusion: ;
[0026] Update prediction error covariance: ;
[0027] wherein HR(k|k-1) is the predicted heart rate and the heart rate at the previous moment HR(k-1) are the same, P is the prediction error covariance, Q is the noise covariance in the prediction process, R is the error covariance of the observed heart rate, K is the Kalman gain, HR_measure is the measured heart rate, R is (1-Prob1), and Prob1 is the maximum probability value in the heart rate probability spectrum.
[0028] Optionally, based on the motion heart rate acquisition method provided in the first aspect of the present application, the method further includes:
[0029] acquiring the first N neural network output results when the user starts measurement;
[0030] accumulating the first N neural network output results to determine the position of the maximum value in the accumulated results, and taking the heart rate value corresponding to the position as the initial heart rate.
[0031] Optionally, based on the motion heart rate acquisition method provided in the first aspect of the present application, after the filtered heart rate value is obtained, the method further includes:
[0032] Determine the difference between the filtered heart rate value and the previous time heart rate value, if the difference is less than or equal to a preset value, output the filtered heart rate value, if the difference is greater than the preset value, the filtered heart rate value is smoothed, and the filtered heart rate value after smoothing is output.
[0033] The second aspect of the embodiments of the application provides a motion heart rate acquisition device, comprising:
[0034] An acquisition unit is configured to acquire an initial PPG signal and an initial ACC signal.
[0035] A first filtering unit is configured to perform filtering processing on the initial PPG signal and the initial ACC signal to obtain a first PPG signal and a first ACC signal.
[0036] A second filtering unit is configured to perform adaptive filtering on the first ACC signal as an input signal and the first PPG signal as an expected signal to obtain a second PPG signal.
[0037] An input unit is configured to input the first ACC signal, the first PPG signal, and the second PPG signal into a pre-trained heart rate probability neural network model to obtain a heart rate probability spectrum.
[0038] A third filtering unit is configured to perform Kalman filtering based on the heart rate probability spectrum to obtain a filtered heart rate value, and an observation error covariance used in the Kalman filtering process is associated with a maximum probability value in the heart rate probability spectrum.
[0039] Optionally, the first filtering unit is specifically configured to: adopt a band-pass filter to process the initial PPG signal and the initial ACC signal to obtain the first ACC signal and the first PPG signal, and a passband frequency range of the band-pass filter is (0.5Hz, 4Hz].
[0040] Optionally, the heart rate probability neural network model is composed of a convolutional neural network structure and a long short-term memory network structure, and includes two convolutional layers, two pooling layers, one flatten layer, one LSTM, and two fully connected layers.
[0041] Optionally, the input unit is specifically configured to:
[0042] The first ACC signal is a three-axis acceleration signal, and a first resultant acceleration signal of the first ACC signal is calculated according to the following formula:
[0043]
[0044] in This is the first combined acceleration signal. This is the acceleration signal in the X-axis direction. This is the acceleration signal in the Y-axis direction. This is the acceleration signal in the Z-axis direction;
[0045] Based on the first combined acceleration signal, the first PPG signal, and the second PPG signal, the first combined acceleration, the first PPG spectrum, and the second PPG spectrum are obtained, where the first combined acceleration spectrum, the first PPG spectrum, and the second PPG spectrum are spectral data of the target length, respectively.
[0046] The first combined acceleration spectrum, the first PPG spectrum, and the second PPG spectrum are input into the pre-trained heart rate probability neural network model to obtain the heart rate probability spectrum.
[0047] Based on the exercise heart rate acquisition device provided in the second aspect of the embodiments of this application, optionally, the third filtering unit is specifically used for:
[0048] The filtering formulas used include:
[0049] Predicted heart rate: ;
[0050] Prediction error covariance: ;
[0051] Kalman gain: ;
[0052] Data fusion: ;
[0053] Update prediction error covariance: ;
[0054] Where HR(k|k-1) is the same as the predicted heart rate and the heart rate HR(k-1) of the previous moment, P is the prediction error covariance, Q is the noise covariance in the prediction process, R is the error covariance of the observed heart rate, K is the Kalman gain, HR_measure is the measured heart rate, R is (1-Prob1), and Prob1 is the maximum probability value in the heart rate probability spectrum.
[0055] Optionally, based on the exercise heart rate acquisition device provided in the second aspect of the embodiments of this application, the device further includes: an initial heart rate determination unit, used for:
[0056] Obtain the first N neural network outputs when the user begins measurement;
[0057] The outputs of the first N neural networks are summed to determine the position of the maximum value in the summed result, and the heart rate value corresponding to that position is used as the initial heart rate.
[0058] Optionally, based on the exercise heart rate acquisition device provided in the second aspect of the embodiments of this application, the device further includes: a smoothing processing unit, used for:
[0059] The difference between the filtered heart rate value and the heart rate value at the previous moment is determined. If the difference is less than or equal to a preset value, the filtered heart rate value is output. If the difference is greater than the preset value, the filtered heart rate value is smoothed and the smoothed filtered heart rate value is output.
[0060] A third aspect of this application provides a heart rate acquisition device, the heart rate acquisition device comprising:
[0061] Central processing unit, memory, input / output interfaces, wired or wireless network interfaces, and power supply;
[0062] The memory is either a short-term memory or a persistent memory;
[0063] The central processing unit is configured to communicate with the memory and execute instructions in the memory on the device to perform the method described in any one of the first aspects of the embodiments of this application.
[0064] A fourth aspect of this application provides a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the method as described in any one of the first aspects of this application.
[0065] The fifth aspect of this application provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the method described in any one of the first aspects of this application.
[0066] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: The embodiments of this application provide a method for obtaining exercise heart rate, including: obtaining an initial PPG signal and an initial ACC signal; filtering the initial PPG signal and the initial ACC signal to obtain a first PPG signal and a first ACC signal; performing adaptive filtering with the first ACC signal as the input signal and the first PPG signal as the desired signal to obtain a second PPG signal; inputting the first ACC signal, the first PPG signal, and the second PPG signal into a pre-trained heart rate probability neural network model to obtain a heart rate probability spectrum; performing Kalman filtering based on the heart rate probability spectrum to obtain a filtered heart rate value, wherein the observation error covariance used in the Kalman filtering process is associated with the maximum probability value in the heart rate probability spectrum. This method filters the initial PPG and ACC signals, and uses adaptive filtering to remove motion artifacts to obtain the second PPG signal, effectively reducing the impact of motion interference on the heart rate signal. Simultaneously, the three sets of signals (first ACC signal, first PPG signal, and second PPG signal) are input into a neural network model, enabling the model to learn more comprehensive spectral features, especially those under "same frequency" conditions, laying the foundation for accurate output of the heart rate probability spectrum. Furthermore, during Kalman filtering, the observation error covariance is correlated with the maximum probability value in the heart rate probability spectrum, giving different weights to heart rate results of varying confidence levels—higher probability results have higher weights. This achieves dynamic fusion of measured and predicted values, ensuring sensitivity in tracking real heart rate changes while suppressing noise interference through reasonable weight allocation, resulting in smoother and more accurate heart rate output. Furthermore, the method relies solely on PPG signals and triaxial acceleration (ACC) signals, requiring minimal hardware and eliminating the need for additional complex sensors. Simultaneously, the neural network model is designed to be compatible with embedded systems and can be widely applied to various smart wearable devices (such as wristbands, watches, armbands, etc.). While meeting the need for accurate heart rate measurement in sports scenarios, it possesses strong practical application value and scalability. Attached Figure Description
[0067] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort. It is understood that the drawings provided in this section are only for better understanding of this solution and do not constitute a limitation on this application.
[0068] Figure 1 This is a flowchart illustrating an embodiment of the exercise heart rate acquisition method provided in this application.
[0069] Figure 2 This is another flowchart illustrating an embodiment of the exercise heart rate acquisition method provided in this application.
[0070] Figure 3 This is a flowchart illustrating the processing procedure of the heart rate probability neural network model provided in this application.
[0071] Figure 4 This is a schematic diagram of a structural embodiment of the exercise heart rate acquisition device provided in this application.
[0072] Figure 5 This is another structural schematic diagram of an embodiment of the exercise heart rate acquisition device provided in this application. Detailed Implementation
[0073] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application are clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application. At the same time, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0074] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0075] Exercise heart rate, as real-time heart rate data during exercise, is of great significance to individual exercise safety and effectiveness. It provides exercisers with immediate feedback on their physical condition, helping them to adjust exercise intensity in a timely manner and avoid injury caused by overexertion. Therefore, real-time and accurate measurement of heart rate during exercise has become a key requirement in the field of sports monitoring.
[0076] Currently, the mainstream methods for measuring heart rate during exercise are based on three types of devices: heart rate chest straps based on ECG (electrocardiogram) signals, heart rate armbands based on PPG (photoplethysmography) signals, and smart bracelets or watches based on PPG signals. Heart rate chest straps measure heart rate by monitoring ECG signals and are characterized by high accuracy in current technology. Heart rate armbands, smart bracelets, and watches rely on photoplethysmography (PPG) signals for heart rate monitoring and are widely used in the consumer smart wearable market due to their relatively flexible wearing methods and lower susceptibility to electrostatic interference.
[0077] However, existing technologies still have significant shortcomings. While heart rate chest straps offer high accuracy, they require a close fit to the chest, which can cause discomfort during exercise. Furthermore, in dry winter conditions or environments with high static electricity, unstable signal transmission may prevent accurate heart rate measurements. Armbands, wristbands, and watches based on PPG signals are comfortable to wear, but limb movement during exercise can strongly interfere with the PPG signal, creating motion artifacts that make it difficult for the sensor to capture true heart rate characteristics, severely impacting measurement accuracy. These deficiencies make it difficult for existing technologies to balance measurement comfort and accuracy in sports scenarios, failing to fully meet users' needs for reliable exercise heart rate monitoring.
[0078] To address the aforementioned problems, this application provides a method for obtaining exercise heart rate, please refer to... Figure 1 This includes steps 101 to 105.
[0079] 101. Obtain the initial PPG signal and the initial ACC signal.
[0080] Specifically, this solution can be applied to wrist-worn watches and wristband devices. The PPG signal, or photoplethysmography signal, is collected by a photoelectric sensor (such as a green LED + photodiode) to reflect changes in blood vessel volume and thus heart rate. The ACC signal (Acceleration Signal), or triaxial acceleration signal, is collected by a MEMS accelerometer to reflect the wearer's movement status (such as being at rest, walking, running, etc.).
[0081] 102. Filter the initial PPG signal and the initial ACC signal to obtain the first PPG signal and the first ACC signal.
[0082] Specifically, the initial PPG signal and the initial ACC signal are filtered to obtain the first PPG signal and the first ACC signal. Preprocessing of the initial PPG signal and the initial ACC signal may include filtering the initial PPG signal and the initial ACC signal. A 6th-order Butterworth bandpass filter with a cutoff frequency of 0.5Hz-4Hz can be used, corresponding to the human heart rate range of (30bpm, 240bpm) (bpm, Beat Per Minute). In actual implementation, the filter form and parameters can be adjusted according to the actual situation, and are not limited here.
[0083] 103. Using the first ACC signal as the input signal and the first PPG signal as the desired signal, perform adaptive filtering to obtain the second PPG signal.
[0084] Specifically, during exercise, when the device is worn loosely, the photodiodes receiving the signal move with the body, causing the received PPG signal to contain motion components (called motion artifacts). The more vigorous the exercise, the greater the impact on the PPG signal, thus requiring filtering to remove this interference. The ACC signal of a smart wearable device reflects human movement; therefore, this solution uses adaptive filtering (such as least mean square filtering) after bandpass filtering. Using the first ACC signal as the input signal and the first PPG signal as the desired signal, motion artifacts are removed to obtain the second PPG signal. Adaptive filtering learns the motion characteristics in the first ACC signal, subtracts motion-related artifact components from the first PPG signal, and finally outputs the artifact-free second PPG signal, retaining purer heart rate-related information.
[0085] 104. Input the first ACC signal, the first PPG signal and the second PPG signal into the pre-trained heart rate probability neural network model to obtain the heart rate probability spectrum;
[0086] Specifically, the first ACC signal, the first PPG signal, and the second PPG signal can be converted into the frequency domain. The spectra of the first PPG signal (ppg1_spectrum), the spectrum of the second PPG signal (ppg2_spectrum), and the spectrum of the first resultant acceleration signal (m_spectrum) can then be calculated. After normalizing these spectra, three sets of spectra with fixed lengths are obtained, which serve as inputs to the heart rate probabilistic neural network model. Using three sets of spectra as input is because, in the case of "same frequency" conditions, the heart rate component of the adaptively filtered second PPG signal may be reduced. In this case, the correct heart rate can be searched using the spectrum of the first PPG signal, thereby improving the model's accuracy in the same frequency scenario.
[0087] The heart rate probability neural network model employs a combination of convolutional neural networks (CNNs) and long short-term memory networks (LSTMs). CNNs can automatically learn and extract useful features from data without requiring complex feature extraction algorithms designed manually. LSTMs excel at processing sequential data, efficiently capturing relationships within a sequence, which aligns with the characteristics of human heart rate—its continuity and the need to consider both current and previous heart rates. The model structure includes two convolutional layers, two pooling layers, one flattening layer, one LSTM layer, and two fully connected layers. The input consists of three sets of spectra of length 145, and the output is the probability of each heart rate within the range [31, 240], forming a vector of length 210 (i.e., the heart rate probability spectrum). The model's labels are derived from the heart rate corresponding to the Polar H10 gold-standard device and constructed in frequency band form. For example, when the heart rate is 85, the label presents different probability values at specific positions, corresponding to the label [0,0,....,0,0.05,0.1,0.7,0.1,0.05,0,...,0,0]. Specifically, the value is 0.7 at (85-30), 0.1 at (84-30) and (86-30), and 0.05 at (83-30) and (87-30). That is, after a 1024-length FFT transformation, the true heart rate will not appear as a single isolated peak point on the spectrum, but rather as a continuous frequency band, meaning that energy is distributed within a certain frequency range around the center frequency corresponding to the true heart rate.
[0088] The heart rate probability neural network model is pre-trained, and the training process is based on the above inputs and labels. The heart rate probability spectrum output by the model is the probability distribution of heart rate values, where the frequency with the highest probability value is the maximum possible heart rate value, providing a key basis for subsequent accurate heart rate calculation.
[0089] 105. Perform Kalman filtering based on the heart rate probability spectrum to obtain the filtered heart rate value.
[0090] The observation error covariance used in the Kalman filtering process is correlated with the maximum probability value in the heart rate probability spectrum. The basic principle of Kalman filtering is to predict the current state through a system model and then correct it by combining the actual observation values to obtain a more accurate estimation result. In this step, the system first predicts the current heart rate based on the heart rate value of the previous moment (i.e., the predicted heart rate) and calculates the prediction error covariance; then, it combines the observed heart rate provided by the heart rate probability spectrum (i.e., the heart rate value corresponding to the maximum probability in step 104) for data fusion, and finally outputs the filtered heart rate value HR2. This process effectively reduces the impact of random noise on the results by balancing the weights of the predicted and observed values.
[0091] Unlike traditional Kalman filtering, the observation error covariance R in this invention is not a fixed value, but rather correlated with the maximum probability value Prob1 in the heart rate probability spectrum (for example, R can be set to 1-Prob1). The core logic of this design is: the higher the maximum probability value, the higher the reliability of the observed heart rate, and the smaller the corresponding observation error should be; therefore, it is given a higher weight in the filtering process. Conversely, if the maximum probability value is low, the observation error increases accordingly, and the weight decreases. Through this dynamic adjustment, the Kalman filter can more rationally integrate predicted and observed information, further improving the stability and accuracy of heart rate measurement.
[0092] Ultimately, the heart rate value HR2 obtained after Kalman filtering is more reliable than the output of a single neural network, better reflecting the true trend of human heart rate changes. In actual implementation, HR2 can also be smoothed based on historical data, but this is not specified here.
[0093] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: The embodiments of this application provide a method for obtaining exercise heart rate, including: obtaining an initial PPG signal and an initial ACC signal; filtering the initial PPG signal and the initial ACC signal to obtain a first PPG signal and a first ACC signal; performing adaptive filtering with the first ACC signal as the input signal and the first PPG signal as the desired signal to obtain a second PPG signal; inputting the first ACC signal, the first PPG signal, and the second PPG signal into a pre-trained heart rate probability neural network model to obtain a heart rate probability spectrum; performing Kalman filtering based on the heart rate probability spectrum to obtain a filtered heart rate value, wherein the observation error covariance used in the Kalman filtering process is associated with the maximum probability value in the heart rate probability spectrum. This method filters the initial PPG and ACC signals, and uses adaptive filtering to remove motion artifacts to obtain the second PPG signal, effectively reducing the impact of motion interference on the heart rate signal. Simultaneously, the three sets of signals (first ACC signal, first PPG signal, and second PPG signal) are input into a neural network model, enabling the model to learn more comprehensive spectral features, especially those under "same frequency" conditions, laying the foundation for accurate output of the heart rate probability spectrum. Furthermore, during Kalman filtering, the observation error covariance is correlated with the maximum probability value in the heart rate probability spectrum, giving different weights to heart rate results of varying confidence levels—higher probability results have higher weights. This achieves dynamic fusion of measured and predicted values, ensuring sensitivity in tracking real heart rate changes while suppressing noise interference through reasonable weight allocation, resulting in smoother and more accurate heart rate output. Furthermore, the method relies solely on PPG signals and triaxial acceleration (ACC) signals, requiring minimal hardware and eliminating the need for additional complex sensors. Simultaneously, the neural network model is designed to be compatible with embedded systems and can be widely applied to various smart wearable devices (such as wristbands, watches, armbands, etc.). While meeting the need for accurate heart rate measurement in sports scenarios, it possesses strong practical application value and scalability.
[0094] To facilitate the use of this method in practical implementation, this application also provides a more detailed embodiment that can be implemented selectively. Please refer to [link to relevant documentation]. Figure 2 One embodiment of this application includes steps 201-210.
[0095] 201. Obtain the initial PPG signal and the initial ACC signal.
[0096] Smart wearable devices (such as smart bracelets and watches) collect initial PPG signals (photoplethysmography pulse wave signals, obtained by detecting changes in blood volume by irradiating the skin with light sources such as green light) through a built-in heart rate module, and at the same time collect initial ACC signals (triaxial acceleration signals, reflecting the acceleration changes in the X, Y, and Z directions during human movement) through a triaxial accelerometer.
[0097] In practical implementation, the sampling rate of both signals can be set to 25Hz, with an 8-second window length. This means that 8 consecutive seconds of signal are captured for processing each time, and each window contains a total of 200 data points (25Hz × 8s = 200 points). To achieve real-time dynamic monitoring, the window is updated using a sliding method, sliding for 1 second each time. Therefore, there is a 7-second overlap between adjacent windows (8 seconds - 1 second). This design ensures data continuity while reducing processing latency, allowing heart rate measurements to reflect changes in physical condition promptly.
[0098] It should be noted that the sampling rate (25Hz) mentioned here is only a specific parameter used for illustrative purposes in this solution. In actual applications, it can be adjusted according to hardware performance, measurement accuracy requirements, etc. (e.g., 16Hz). The window length and sliding interval are also not fixed values. The sampling rate can be increased according to the motion scenario (e.g., jogging, strenuous exercise), i.e., during high-intensity motion (based on acceleration sensor judgment), and thus flexibly set, as long as a balance between real-time performance and data validity is achieved. In addition, the initial signal acquisition location is not limited to the wrist; it can also be on the arm, fingers, or other suitable parts of the body for wearing smart wearable devices, depending on the device design and application scenario.
[0099] 202. Filter the initial PPG signal and the initial ACC signal to obtain the first PPG signal and the first ACC signal.
[0100] During signal acquisition, the initial PPG and initial ACC signals acquired by smart wearable devices inevitably become contaminated with various types of noise. This noise may originate from environmental interference (such as changes in light or electromagnetic radiation), circuit noise within the device itself, or non-target physiological activities of the human body (such as muscle tremors or subtle bodily movements caused by respiration). Direct use of these noises in subsequent analysis would severely impact the accuracy of heart rate measurement. Therefore, filtering is necessary to remove these irrelevant noises and retain the effective signal components related to heart rate.
[0101] This scheme uses a Butterworth bandpass filter to process the two initial signals, ultimately obtaining the first PPG signal and the first ACC signal. The Butterworth filter is a commonly used linear filter characterized by a relatively flat frequency response within its passband. It can effectively preserve the target frequency components while attenuating noise outside the passband, making it suitable for processing signals such as physiological signals that require a smooth transition.
[0102] The filter parameters can be set to a passband frequency range of (0.5Hz, 4Hz). This range is related to the physiological characteristics of human heart rate: the conversion between frequency and heart rate is: heart rate (bpm) = frequency (Hz) × 60. Therefore, 0.5Hz corresponds to 30 bpm (0.5 × 60), and 4Hz corresponds to 240 bpm (4 × 60). This passband precisely covers the range of possible heart rates in the human body (from low heart rate at rest to high heart rate during strenuous exercise). With this setting, the filter can accurately retain heart rate-related signal components while filtering out irrelevant interference below 30 bpm and above 240 bpm.
[0103] It should be noted that the filtering method and passband range mentioned here are only optional options for this solution, and are not the only limitations. In terms of filtering method, in addition to the Butterworth bandpass filter, other types of bandpass filters can also be selected according to actual needs, as long as the signal extraction of the target frequency range can be achieved. The passband frequency range can be flexibly adjusted according to the application scenario. For example, for professional athletes (who may have higher heart rates) or special groups (such as those with low heart rates), the passband can be appropriately widened or narrowed to better adapt to their heart rate characteristics.
[0104] 203. Using the first ACC signal as the input signal and the first PPG signal as the desired signal, adaptive filtering is performed to obtain the second PPG signal.
[0105] When the device is worn loosely, the photodiode receiving the signal moves with the body, causing relative displacement between the device and the skin. This results in changes in light intensity received by the photodiode collecting the PPG signal, including not only fluctuations in blood volume (a valid signal related to heart rate) but also motion interference caused by device shaking and skin stretching. Consequently, the received PPG signal contains motion components (called motion artifacts), and the more intense the movement, the greater the impact on the PPG signal. Therefore, this interference needs to be filtered out. The ACC signal of a smart wearable device can reflect human movement. Therefore, after bandpass filtering, this invention employs adaptive filtering technology (such as LMS filtering, i.e., least mean square filtering) to remove motion artifacts. Its core logic is: using a signal related to the interference source (here, the first ACC signal), the algorithm dynamically learns the interference characteristics and "subtracts" the interference component from the target signal (the first PPG signal). Specific settings are as follows:
[0106] Input signal: Select the first ACC signal (a three-axis acceleration signal after bandpass filtering). The reason is that the ACC signal directly reflects the intensity and pattern of human motion (such as the amplitude and frequency of arm swing), and is highly correlated with the generation mechanism of motion artifacts, so it can be used as a "carrier of interference features".
[0107] Desired signal: Select the first PPG signal (the PPG signal after bandpass filtering). This is because although the first PPG signal contains artifacts, it still contains the true heart rate component.
[0108] The working process of adaptive filtering can be simply understood as follows: the filter dynamically adjusts the filtering parameters by continuously comparing the input signal (ACC) and the desired signal (PPG), gradually "learning" the characteristics of motion artifacts, and finally outputting a result that is as close as possible to the "pure PPG signal", that is, the second PPG signal.
[0109] Taking LMS filtering as an example, it possesses the following characteristics: strong real-time performance, simple algorithm structure, low computational load, making it suitable for the real-time processing needs of embedded platforms such as smart wearable devices; it does not require prior knowledge of the statistical characteristics of the signal and noise, and can dynamically adjust the filtering parameters according to changes in motion state, adapting to different intensities of exercise (such as brisk walking, jogging, and sprinting). In actual processing, LMS filtering optimizes parameters by minimizing the mean square error between the output signal and the desired signal, ultimately significantly suppressing motion artifacts in the second PPG signal while preserving the true heart rate component.
[0110] In practice, in addition to LMS, other adaptive filtering algorithms such as RLS (Recursive Least Squares) and NLMS (Normalized Least Mean Squares) can also be used, but no specific restrictions are made here.
[0111] 204. Calculate the first combined acceleration signal of the first ACC signal.
[0112] The first ACC signal is a triaxial acceleration signal. The first resultant acceleration signal of the first ACC signal is calculated according to the following formula:
[0113]
[0114] in This is the first combined acceleration signal. This is the acceleration signal in the X-axis direction. This is the acceleration signal in the Y-axis direction. This is the acceleration signal in the Z-axis direction;
[0115] The first ACC signal after filtering in step 202 is a typical three-axis acceleration signal, containing acceleration components in three dimensions: X-axis (e.g., left-right direction when wearing the device), Y-axis (e.g., forward-backward direction), and Z-axis (e.g., up-down direction perpendicular to the skin), denoted as accx, accy, and accz, respectively. Each of these three components reflects the intensity of human motion in a specific direction (e.g., forward-backward acceleration when swinging the arm, vertical acceleration when jumping up and down). However, a signal from only one axis cannot fully describe the overall motion state—for example, when running, the arm may simultaneously swing forward and backward and bounce up and down; using only the X-axis or Z-axis signal would miss some motion information.
[0116] Therefore, this step integrates the motion information in the three-dimensional direction into a single signal by calculating the first resultant acceleration signal (denoted as ACCM). Its physical meaning is "the magnitude of the resultant acceleration of human motion in three-dimensional space", which can more comprehensively and intuitively reflect the intensity of motion and provide a more effective reference for subsequent analysis of the correlation between motion artifacts and heart rate signals.
[0117] In practical implementation scenarios with limited hardware computing power, approximate calculations can be used to replace the square root of the sum of squares (such as accm=|accx|+|accy|+|accz|, i.e., Manhattan distance) to reduce computational complexity. Although there is a slight loss in accuracy, it can meet the real-time requirements. Specific details are not limited here.
[0118] 205. The first resultant acceleration, the first PPG spectrum, and the second PPG spectrum are obtained by converting the first resultant acceleration signal, the first PPG signal, and the second PPG signal.
[0119] The first combined acceleration signal, the first PPG signal, and the second PPG signal, processed in the preceding steps, are all time-domain signals (i.e., waveform data that changes over time). Heart rate, however, is essentially a periodic physiological signal, and its characteristics are more easily identified in the frequency domain (i.e., the energy distribution of different frequency components). For example, the frequency corresponding to a normal heart rate is in the range of 0.5-4 Hz, which manifests as energy peaks within that range in the frequency domain. Therefore, converting the time-domain signal to a frequency-domain spectrum allows for a more intuitive extraction of frequency features related to heart rate, while also facilitating the differentiation between motion artifacts (usually related to motion frequency) and the true heart rate signal.
[0120] This step uses Fast Fourier Transform (FFT) to convert the time domain to the frequency domain. The specific parameters and processing are as follows:
[0121] The FFT length is set to 1024 points. The FFT length directly affects the frequency resolution of the spectrum (i.e., the frequency interval represented by each point in the spectrum), and the calculation formula is "resolution = sampling rate ÷ FFT length". Since the signal sampling rate in this scheme is 25Hz, the resolution is 25Hz ÷ 1024 ≈ 0.0244Hz, which means that the frequency difference between two adjacent points in the spectrum is approximately 0.0244Hz.
[0122] The frequency range selected for spectral extraction is the heart rate-related frequency interval (0.5Hz to 4Hz, corresponding to 30-240 bpm). The specific position of this interval in the spectrum needs to be calculated: the spectral position corresponding to 0.5Hz is 0.5Hz ÷ 0.0244Hz ≈ 20.5, rounded down to the nearest integer 20; the spectral position corresponding to 4Hz is 4Hz ÷ 0.0244Hz ≈ 163.9, rounded down to the nearest integer 164. Therefore, points 20 to 164 (inclusive) are extracted from the spectrum, totaling 164 - 20 + 1 = 145 points. Only heart rate-related frequency components are retained, excluding irrelevant signals below 0.5Hz (e.g., baseline drift) or above 4Hz (e.g., high-frequency noise). In actual implementation, the FFT length setting varies, and the target lengths of the first combined acceleration spectrum, the first PPG spectrum, and the second PPG spectrum can also take different values; no specific limitation is made here.
[0123] The 145 extracted points are normalized (e.g., by scaling the spectral values to the range of 0-1, or by dividing by the maximum value, standardizing to a mean of 0 and a variance of 1). Normalization allows the three sets of spectra to participate in model training at the same magnitude, preventing one signal from dominating the neural network's learning process due to excessively high energy.
[0124] In actual implementation, the FFT length is not limited to 1024 points. It can be selected according to the hardware computing power and accuracy requirements (e.g., 512 points can reduce the amount of computation and are suitable for low-power devices; 2048 points can increase the resolution and are suitable for high-precision scenarios). However, the frequency resolution and truncation range need to be recalculated, which is not limited here.
[0125] 206. Input the first combined acceleration spectrum, the first PPG spectrum, and the second PPG spectrum into the pre-trained heart rate probability neural network model to obtain the heart rate probability spectrum.
[0126] This step uses three sets of spectra, each 145 pixels long, as model input: the first combined acceleration spectrum (m_spectrum), the first PPG spectrum (ppg1_spectrum), and the second PPG spectrum (ppg2_spectrum). The core purpose of this design is to address the "co-frequency interference" problem: "co-frequency" refers to the overlap between the frequency of motion artifacts and the frequency of the true heart rate (e.g., the frequency of running, brisk walking, etc., falls within the normal heart rate range of 60-100 bpm). In this case, the adaptive filtering in step 203 may mistakenly filter out the heart rate component as an artifact, causing the heart rate characteristics in the second PPG spectrum (ppg2_spectrum) to be weakened or even disappear. The first PPG spectrum (ppg1_spectrum) retains the characteristics of the original PPG signal (without strong filtering, it may still contain the complete heart rate component), while the first combined acceleration spectrum (m_spectrum) reflects the frequency distribution of motion artifacts. The three sets of spectra input together allow the model to simultaneously observe the "original signal characteristics," "signal characteristics after artifact removal," and "motion interference characteristics."
[0127] The first PPG spectrum provides the original signal features contained in the heart rate probability neural network model. The second PPG spectrum provides the signal features after artifact removal, and the first combined acceleration spectrum provides motion interference features. After extracting these three features, the heart rate probability neural network model can perform feature analysis based on pre-trained knowledge to finally obtain the heart rate probability spectrum. The heart rate probability spectrum is a vector of length 2^10, where each position corresponds to the probability of a certain heart rate between 31 and 240 bpm (e.g., position 0 corresponds to 31 bpm, position 209 corresponds to 240 bpm).
[0128] The heart rate probabilistic neural network model employs a hybrid structure of Convolutional Neural Network (CNN) and Long Short-Term Memory Network (LSTM). Combining the advantages of both networks to adapt to the characteristics of heart rate signals, CNN can automatically learn and extract useful features from data without requiring manually designed complex feature extraction algorithms. For sequence data requiring contextual understanding, LSTM can efficiently capture the relationships within the sequence, providing strong support for subsequent tasks. Since human heart rate is continuous, considering both the current heart rate and the heart rate over a previous period, this approach combines the advantages of both network models. The specific structure and the function of each layer are as follows:
[0129] Convolutional layers (2 layers): These extract local features (such as peak positions and energy distribution patterns) from the spectrum by sliding convolutional kernels. For example, the true heart rate is usually represented by energy peaks within a continuous frequency band in the spectrum, while motion artifacts may exhibit irregular energy fluctuations. Convolutional layers can automatically learn these differences without the need for manually designed features.
[0130] Pooling layer (2 layers): Reduces the dimensionality of the feature map output by the convolutional layer, retains key features while reducing computational cost and avoiding model overfitting.
[0131] Flatten layer: Converts the pooled two-dimensional feature map into a one-dimensional vector, preparing for the sequence processing of the subsequent LSTM layer.
[0132] LSTM layer (1 layer): Handles sequence continuity. Human heart rate changes continuously (e.g., the increase in heart rate from rest to exercise is gradual and does not jump suddenly). LSTM captures the temporal correlation of heart rate by memorizing the features of the preceding window.
[0133] Fully connected layers (2 layers): Map the sequence features output by the LSTM to a specific heart rate probability space, ultimately outputting a vector of length 2^10 (corresponding to a heart rate range of 31-240 bpm). The working process of each layer of the network model in actual implementation can be referenced. Figure 3 .
[0134] The labels for model training are derived from the measurement results (high-precision reference standard) of the heart rate chest strap of the Polar H10 gold-label device. Specifically, the first combined acceleration spectrum, the first PPG spectrum, and the second PPG spectrum are collected when the gold-label device is worn, along with the labels corresponding to each spectrum data. It is important to note that the labels in this scheme are constructed in "band form" rather than as single numerical values, for the following reasons:
[0135] The spectral characteristics of the true heart rate are "band" rather than "single point": due to the small fluctuations in human heart rate (such as ±1-2 bpm per second) and the spectral leakage of FFT transformation, the heart rate spectrum under a 1024-length FFT will form a continuous energy distribution (i.e., band) in the range of ±0.1-0.2Hz with the center frequency as the core. Furthermore, the frequency band method further reduces the computational resources required by this scheme and improves the feasibility of this scheme.
[0136] For example, if the Polar H10 measures a heart rate of 85 bpm, the probability of the position (85-30)=55 in the label vector is set to 0.7 (center peak), the positions 84-30=54 and 86-30=56 are set to 0.1 (adjacent frequency bands), the positions 83-30=53 and 87-30=57 are set to 0.05 (edge frequency bands), and the remaining positions are 0. This design allows the model to learn the frequency band distribution rather than single-point correspondence, which is closer to the characteristics of real signals. The label format is not limited to the above example; it can be used as long as it can simulate the continuous distribution of the real spectrum.
[0137] The model output is a vector of length 2^10, where each position corresponds to the probability of a heart rate between 31 and 240 bpm (e.g., position 0 corresponds to 31 bpm, position 209 corresponds to 240 bpm). To further improve reliability, the output results need to be adjusted as follows:
[0138] Specifically, referring to the frequency band format of the reference labels, the probability of each position is added to the probabilities of its neighboring ±2 positions (e.g., the probability of position 55 = its own probability + the probabilities of positions 53 + 54 + 56 + 57), and then normalized to make the total probability sum equal to 1. This step can compensate for possible peak shifts in the model output and adapt to small fluctuations in heart rate. From the adjusted probability distribution, the position corresponding to the highest probability (Prob1) is taken and converted into the actual heart rate (heart rate = position + 30). For example, when the probability of position 50 is the highest, the corresponding heart rate is 50 + 30 = 80 bpm, and 80 bpm is the heart rate result (HR1).
[0139] 207. Obtain the first N neural network outputs when the user starts the measurement.
[0140] 208. Accumulate the output results of the first N neural networks to determine the position of the maximum value in the accumulated result, and use the heart rate value corresponding to the position as the initial heart rate.
[0141] At the start of heart rate measurement, the user may be in a dynamic state, or the device may not be fully stable. In this case, the heart rate result (HR1) output by a single neural network may have a large deviation—for example, the violent shaking at the beginning of exercise may cause severe PPG signal artifacts, leading the model to misjudge the heart rate. This "inaccurate initial value" will directly affect the effect of subsequent Kalman filtering (the filtering relies on the previous heart rate as the basis for prediction), so a reliable initial heart rate needs to be determined through specific methods.
[0142] The system acquires the first N neural network outputs when the user begins measurement. The specific value of N can be 5, which means acquiring the first 5 adjusted neural network outputs (each output is a probability vector of length 210, corresponding to a heart rate probability distribution of 31-240 bpm). The first 5 results cover the signal within 5 seconds after the start of measurement (the actual time is slightly longer than 5 seconds due to window overlap), which is sufficient to reflect the heart rate trend in the initial stage.
[0143] The probability vectors output by the first five neural networks (each of length 2^10) are summed at corresponding positions to obtain a new vector of length 2^10. For example, the probability of position 50 in the first vector is 0.6, the second is 0.5, ..., the fifth is 0.7, so the total probability of position 50 after summing is 0.6 + 0.5 + ... + 0.7. The position with the highest probability value is found in the summed vector; the heart rate corresponding to this position is the initial heart rate. For example, if position 50 has the highest probability after summing, the initial heart rate is 50 + 30 = 80 bpm. The principle behind this design is that even if the results of a single window are affected by noise, the summation of multiple windows can reduce random errors—the true heart rate may change in the initial stage, but the overall trend is relatively stable, and its corresponding probability gradually becomes more prominent during the summation, while spurious peaks caused by random errors are canceled out by randomness. Through steps 207 and 208, the system can quickly lock in a reliable initial heart rate at the beginning of the measurement, providing a stable starting point for subsequent Kalman filtering and reducing the cumulative error caused by initial value deviation. It is especially suitable for dynamic heart rate monitoring in sports scenarios.
[0144] 209. Perform Kalman filtering based on the heart rate probability spectrum to obtain the filtered heart rate value.
[0145] Kalman filtering uses minimum mean square error as the optimal estimation criterion to seek a recursive estimation algorithm. Its basic idea is to predict the state using a system model, then correct it by combining it with actual measurements, ultimately obtaining a more accurate state estimate than either prediction or measurement alone. This invention utilizes heart rate results obtained from a neural network and probability, combined with the previous moment's heart rate result, and then applies Kalman filtering for smoothing. Specifically:
[0146] In this scheme, the Kalman filter can be simplified to the following iterative formula:
[0147] Predicted heart rate:
[0148] Prediction error covariance:
[0149] Kalman gain:
[0150] Data fusion:
[0151] Update prediction error covariance:
[0152] Where HR(k|k-1) is the same as the predicted heart rate and the heart rate HR(k-1) of the previous moment, P is the prediction error covariance, Q is the noise covariance in the prediction process, R is the error covariance of the observed heart rate, K is the Kalman gain, HR_measure is the measured heart rate, R is (1-Prob1), and Prob1 is the maximum probability value in the heart rate probability spectrum.
[0153] In the Kalman filtering process, the predicted heart rate is the heart rate from the previous moment, and Q is a fixed value, such as 0.2, during the prediction process. The predicted heart rate here can also be a linear prediction of the heart rate from the previous few seconds.
[0154] In typical Kalman filtering, the observation error covariance R is usually a fixed value (e.g., assuming constant observation error). However, in this scheme, R is associated with the maximum probability (Prob1) of the neural network output, specifically: R = 1 - Prob1 (or other Prob1-related forms, such as R = (1 - Prob1)²). The logic behind this design is that Prob1 is the maximum probability (range 0-1) corresponding to HR1. The larger Prob1 is, the higher the reliability of HR1 (e.g., when Prob1 = 0.9, HR1 is likely the true heart rate). In this case, R should be smaller (e.g., R = 0.1), the Kalman gain K should be larger, and the filtering result should depend more on HR1. If Prob1 is smaller (e.g., 0.3), it means that HR1 is greatly affected by noise (e.g., motion artifacts cause model ambiguity). In this case, R should be larger (e.g., R = 0.7), K should be smaller, and the filtering result should depend more on historical trends (predicted values), avoiding being biased by unreliable observations. By dynamically adjusting R, the filtering process can adapt to observations of different qualities, significantly improving heart rate stability during exercise (when observations fluctuate greatly).
[0155] In practical implementation, in addition to R=1-Prob1, nonlinear relationships, such as piecewise functions, can also be used to divide the data into low, medium and high intervals. Different nonlinear functions with different slopes are used in different intervals to make R decrease faster when Prob1 is high (e.g. R=0.05 when Prob1=0.9, instead of 0.1), further highlighting the weight of reliable observations.
[0156] 210. The filtered heart rate value is smoothed.
[0157] The changes in human heart rate are continuous and progressive - even during intense exercise, the rise and fall of heart rate occur gradually (for example, it usually takes dozens of seconds to several minutes to increase from a resting heart rate of 70 bpm to an exercise heart rate of 150 bpm), and the change amplitude per second is generally small (normally not exceeding 5 bpm). Although the heart rate value (HR2) after Kalman filtering has significantly reduced noise, in extreme exercise scenarios (such as sudden acceleration or instant displacement of the device), abnormal jumps may still occur due to signal mutations (such as instantly jumping from 100 bpm to 120 bpm). Such jumps do not conform to the real physiological laws and will affect the user experience and data reliability. Therefore, in this step, a reasonable threshold is set to limit the heart rate change amplitude to ensure that the output result is more in line with the actual situation.
[0158] The smoothing process includes: determining the difference between the filtered heart rate value and the heart rate value at the previous moment. If the difference is less than or equal to the preset value, the filtered heart rate value is output; if the difference is greater than the preset value, the filtered heart rate value is smoothed and the smoothed filtered heart rate value is output.
[0159] This step is based on "the difference between the current filtered heart rate (HR2) and the output heart rate at the previous moment (HR_last)", and the specific rules are as follows:
[0160] Situation without need for smoothing: If |HR2 - HR_last| ≤ 5 bpm (the preset value is 5), it means that the heart rate change is within the physiological reasonable range, and HR2 is directly output as the current heart rate result.
[0161] Situation that needs smoothing: If |HR2 - HR_last| > 5 bpm, it means that the change amplitude is too large and truncation processing is required:
[0162] If HR2 > HR_last (the heart rate rises too fast), the current output heart rate is adjusted to HR_last + 5 bpm;
[0163] If HR2 < HR_last (the heart rate drops too fast), the current output heart rate is adjusted to HR_last - 5 bpm.
[0164] In the actual implementation process, the preset value can be adjusted according to the actual situation, and no specific limitation is made this time.
[0165] Through the processing in step 210, the finally output heart rate result not only accurately reflects the real-time changes but also conforms to the human physiological laws, providing stable and reliable heart rate data for users. When the system receives the instruction to end the measurement, it will calculate and feedback the maximum heart rate, minimum heart rate, and average heart rate during the measurement period based on the heart rate values output throughout the process, completing the entire heart rate measurement process.
[0166] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: The embodiments of this application provide a method for obtaining exercise heart rate, including: obtaining an initial PPG signal and an initial ACC signal; filtering the initial PPG signal and the initial ACC signal to obtain a first PPG signal and a first ACC signal; performing adaptive filtering with the first ACC signal as the input signal and the first PPG signal as the desired signal to obtain a second PPG signal; inputting the first ACC signal, the first PPG signal, and the second PPG signal into a pre-trained heart rate probability neural network model to obtain a heart rate probability spectrum; performing Kalman filtering based on the heart rate probability spectrum to obtain a filtered heart rate value, wherein the observation error covariance used in the Kalman filtering process is associated with the maximum probability value in the heart rate probability spectrum. This method filters the initial PPG and ACC signals, and uses adaptive filtering to remove motion artifacts to obtain the second PPG signal, effectively reducing the impact of motion interference on the heart rate signal. Simultaneously, the three sets of signals (first ACC signal, first PPG signal, and second PPG signal) are input into a neural network model, enabling the model to learn more comprehensive spectral features, especially those under "same frequency" conditions, laying the foundation for accurate output of the heart rate probability spectrum. Furthermore, during Kalman filtering, the observation error covariance is correlated with the maximum probability value in the heart rate probability spectrum, giving different weights to heart rate results of varying confidence levels—higher probability results have higher weights. This achieves dynamic fusion of measured and predicted values, ensuring sensitivity in tracking real heart rate changes while suppressing noise interference through reasonable weight allocation, resulting in smoother and more accurate heart rate output. Furthermore, the method relies solely on PPG signals and triaxial acceleration (ACC) signals, requiring minimal hardware and eliminating the need for additional complex sensors. Simultaneously, the neural network model is designed to be compatible with embedded systems and can be widely applied to various smart wearable devices (such as wristbands, watches, armbands, etc.). While meeting the need for accurate heart rate measurement in sports scenarios, it possesses strong practical application value and scalability.
[0167] The foregoing has described the method provided in this application. To support the implementation of the above embodiments, this application also provides a heart rate acquisition device. Please refer to [link to relevant documentation]. Figure 4 One embodiment of the exercise heart rate acquisition device of this application includes:
[0168] Acquisition unit 401 is used to acquire the initial PPG signal and the initial ACC signal;
[0169] The first filtering unit 402 is used to filter the initial PPG signal and the initial ACC signal to obtain the first PPG signal and the first ACC signal.
[0170] The second filtering unit 403 is used to perform adaptive filtering with the first ACC signal as the input signal and the first PPG signal as the desired signal to obtain the second PPG signal.
[0171] Input unit 404 is used to input the first ACC signal, the first PPG signal and the second PPG signal into a pre-trained heart rate probability neural network model to obtain the heart rate probability spectrum;
[0172] The third filtering unit 405 is used to perform Kalman filtering based on the heart rate probability spectrum to obtain the filtered heart rate value. The observation error covariance used in the Kalman filtering process is associated with the maximum probability value in the heart rate probability spectrum.
[0173] Optionally, the first filtering unit is specifically used to: process the initial PPG signal and the initial ACC signal using a bandpass filter to obtain a first ACC signal and a first PPG signal, wherein the passband frequency range of the bandpass filter is (0.5Hz, 4Hz).
[0174] Optionally, the heart rate probability neural network model consists of a convolutional neural network structure and a long short-term memory network structure, including two convolutional layers, two pooling layers, one flattening layer, one LSTM layer, and two fully connected layers.
[0175] Optionally, the input unit is specifically used for:
[0176] The first ACC signal is a triaxial acceleration signal. The first resultant acceleration signal of the first ACC signal is calculated according to the following formula:
[0177]
[0178] in This is the first combined acceleration signal. This is the acceleration signal in the X-axis direction. This is the acceleration signal in the Y-axis direction. This is the acceleration signal in the Z-axis direction;
[0179] Based on the first combined acceleration signal, the first PPG signal, and the second PPG signal, the first combined acceleration, the first PPG spectrum, and the second PPG spectrum are obtained, where the first combined acceleration spectrum, the first PPG spectrum, and the second PPG spectrum are spectral data of the target length, respectively.
[0180] The first combined acceleration spectrum, the first PPG spectrum, and the second PPG spectrum are input into the pre-trained heart rate probability neural network model to obtain the heart rate probability spectrum.
[0181] Optionally, the third filtering unit is specifically used for:
[0182] The filtering formulas used include:
[0183] Predicted heart rate: ;
[0184] Prediction error covariance: ;
[0185] Kalman gain: ;
[0186] Data fusion: ;
[0187] Update prediction error covariance: ;
[0188] Where HR(k|k-1) is the same as the predicted heart rate and the heart rate HR(k-1) of the previous moment, P is the prediction error covariance, Q is the noise covariance in the prediction process, R is the error covariance of the observed heart rate, K is the Kalman gain, HR_measure is the measured heart rate, R is (1-Prob1), and Prob1 is the maximum probability value in the heart rate probability spectrum.
[0189] Optionally, the device further includes: an initial heart rate determination unit, used for:
[0190] Obtain the first N neural network outputs when the user begins measurement;
[0191] The outputs of the first N neural networks are summed to determine the position of the maximum value in the summed result, and the heart rate value corresponding to that position is used as the initial heart rate.
[0192] Optionally, the device further includes: a smoothing processing unit, for:
[0193] The difference between the filtered heart rate value and the heart rate value at the previous moment is determined. If the difference is less than or equal to a preset value, the filtered heart rate value is output. If the difference is greater than the preset value, the filtered heart rate value is smoothed and the smoothed filtered heart rate value is output.
[0194] In this embodiment, the processes executed by each unit are the same as those described above. Figure 1 , Figure 2 The method flow described in the corresponding embodiments is similar and will not be repeated here.
[0195] Figure 5This is a schematic diagram of the structure of a heart rate acquisition device provided in an embodiment of this application. The heart rate acquisition device 500 may include one or more central processing units (CPUs) 501 and a memory 505, in which one or more applications or data are stored.
[0196] In this embodiment, the specific functional module division in the central processing unit 501 can be the same as described above. Figure 5 The functional module division of each unit described in the text is similar, so it will not be repeated here.
[0197] The memory 505 can be volatile or persistent storage. The program stored in the memory 505 can include one or more modules, each module including a series of instruction operations on the server. Furthermore, the central processing unit 501 can be configured to communicate with the memory 505 and execute the series of instruction operations stored in the memory 505 on the server 500.
[0198] The exercise heart rate acquisition device 500 may also include one or more power supplies 502, one or more wired or wireless network interfaces 503, one or more input / output interfaces 504, and / or one or more operating systems.
[0199] The central processing unit 501 can perform the aforementioned... Figure 1 The specific operations performed by the exercise heart rate acquisition method in the illustrated embodiment will not be described in detail here.
[0200] This application also provides a computer storage medium for storing computer software instructions used for the above-described exercise heart rate acquisition method, including a program designed for executing the exercise heart rate acquisition method.
[0201] The method for obtaining exercise heart rate can be as described above. Figure 1 , Figure 2 The method for obtaining exercise heart rate described in the document.
[0202] This application also provides a computer program product, which includes computer software instructions that can be loaded by a processor to implement the above-described functionality. Figure 1 , Figure 2 The process of obtaining exercise heart rate for any one of the methods.
[0203] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, equivalent circuit transformations and unit divisions are only logical functional divisions. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connections shown or discussed may be through some interfaces, or indirect coupling or communication connections between apparatuses or units, and may be electrical, mechanical, or other forms.
[0204] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0205] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0206] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions or improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for obtaining exercise heart rate, characterized in that, include: Acquire the initial PPG signal and the initial ACC signal; The initial PPG signal and the initial ACC signal are filtered to obtain the first PPG signal and the first ACC signal. Using the first ACC signal as the input signal and the first PPG signal as the desired signal, adaptive filtering is performed to obtain the second PPG signal. The first ACC signal, the first PPG signal, and the second PPG signal are input into a pre-trained heart rate probability neural network model to obtain the heart rate probability spectrum. Kalman filtering is performed based on the heart rate probability spectrum to obtain the filtered heart rate value. The observation error covariance used in the Kalman filtering process is associated with the maximum probability value in the heart rate probability spectrum. The step of inputting the first ACC signal, the first PPG signal, and the second PPG signal into a pre-trained heart rate probability neural network model to obtain a heart rate probability spectrum includes: The first ACC signal is a triaxial acceleration signal. The first resultant acceleration signal of the first ACC signal is calculated according to the following formula: in This is the first combined acceleration signal. This is the acceleration signal in the X-axis direction. This is the acceleration signal in the Y-axis direction. This is the acceleration signal in the Z-axis direction; Based on the first combined acceleration signal, the first PPG signal, and the second PPG signal, the first combined acceleration spectrum, the first PPG spectrum, and the second PPG spectrum are obtained, where the first combined acceleration spectrum, the first PPG spectrum, and the second PPG spectrum are spectral data of the target length, respectively. The first combined acceleration spectrum, the first PPG spectrum, and the second PPG spectrum are input into the pre-trained heart rate probability neural network model to obtain the heart rate probability spectrum. The step of performing Kalman filtering based on the heart rate probability spectrum to obtain the filtered heart rate value includes: The following Kalman filter formula is used for filtering: Predicted heart rate: ; Prediction error covariance: ; Kalman gain: ; Data fusion: ; Update prediction error covariance: ; Where HR(k|k-1) is the same as the predicted heart rate and the heart rate HR(k-1) of the previous moment, P is the prediction error covariance, Q is the noise covariance in the prediction process, R is the error covariance of the observed heart rate, and is a value of (1-Prob1), K is the Kalman gain, HR_measure is the measured heart rate, and Prob1 is the maximum probability value in the heart rate probability spectrum. The method further includes: Obtain the first N neural network outputs when the user begins measurement; The outputs of the first N neural networks are summed up to determine the position of the maximum value in the summed result, and the heart rate value corresponding to that position is used as the initial heart rate.
2. The method for obtaining exercise heart rate according to claim 1, characterized in that, The step of filtering the initial PPG signal and the initial ACC signal to obtain the first PPG signal and the first ACC signal includes: The initial PPG signal and the initial ACC signal are processed by a bandpass filter to obtain a first ACC signal and a first PPG signal. The passband frequency range of the bandpass filter is (0.5Hz, 4Hz).
3. The method for obtaining exercise heart rate according to claim 1, characterized in that, The heart rate probability neural network model consists of a convolutional neural network structure and a long short-term memory network structure, including two convolutional layers, two pooling layers, one flattening layer, one LSTM layer, and two fully connected layers.
4. The method for obtaining exercise heart rate according to claim 1, characterized in that, After obtaining the filtered heart rate value, the method further includes: The difference between the filtered heart rate value and the heart rate value at the previous moment is determined. If the difference is less than or equal to a preset value, the filtered heart rate value is output. If the difference is greater than the preset value, the filtered heart rate value is smoothed and the smoothed filtered heart rate value is output.
5. A device for acquiring exercise heart rate, characterized in that, include: Acquisition unit, used to acquire initial PPG signal and initial ACC signal; The first filtering unit is used to filter the initial PPG signal and the initial ACC signal to obtain the first PPG signal and the first ACC signal. The second filtering unit is used to adaptively filter the first ACC signal as the input signal and the first PPG signal as the desired signal to obtain the second PPG signal. The input unit is used to input the first ACC signal, the first PPG signal and the second PPG signal into a pre-trained heart rate probability neural network model to obtain the heart rate probability spectrum. The third filtering unit is used to perform Kalman filtering based on the heart rate probability spectrum to obtain the filtered heart rate value. The observation error covariance used in the Kalman filtering process is associated with the maximum probability value in the heart rate probability spectrum. The exercise heart rate acquisition device is used to perform the exercise heart rate acquisition method as described in claim 1.
6. A device for acquiring exercise heart rate, characterized in that, include: Central processing unit, memory, input / output interfaces, wired or wireless network interfaces, and power supply; The memory is either a short-term memory or a persistent memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory on the device to perform the method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, Includes instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Heart rate monitoring system and method based on wristband type photoelectric volume pulse wave (PPG)and deep learning
CN110664390A
Exercise heart rate detection method and device and readable storage medium
CN120227008A