A heart rate calculation method and system for wearable data acquisition equipment
Through multi-head attention neural network and user feature adaptive algorithm, combined with multi-scale feature extraction and personalized template library optimization, the problem of insufficient user feature adaptability and detection accuracy of wearable devices is solved, and stable detection and continuous optimization of multiple heart rhythm abnormalities is achieved.
Patent Information
- Application Number
- CN202510756813.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-06-09
AI Technical Summary
The existing heart rate monitoring methods of wearable devices cannot adapt to different user characteristics, cannot capture multiple abnormal heart rhythm patterns at the same time, and lack the ability to continuously optimize with user data accumulation, resulting in insufficient detection accuracy and stability, especially in the elderly and patients with cardiovascular disease.
Multi-head attention neural network is used to process PPG signal morphological features of multiple time scales, combined with user feature adaptive adjustment algorithm and incremental learning, and heart rate abnormality detection is achieved through multi-scale feature extraction and personalized template library optimization.
The accuracy and stability of detection of different types of heart rhythm abnormalities have been improved, especially in the elderly and patients with cardiovascular disease, and the detection rate is maintained at a high level, and it is continuously optimized as user data accumulates to adapt to long-term physiological changes of users.
Smart Images

Figure CN120284232B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of disease risk prediction, and more specifically, to a heart rate calculation method and system for a wearable data acquisition device. Background Art
[0002] With the increasing popularity of health monitoring devices, wearables have become essential tools for heart rate monitoring and health management. In health monitoring scenarios, wearables need to identify abnormalities such as arrhythmias and provide users with health warnings. However, traditional heart rate monitoring methods primarily rely on the heart rate value itself, ignoring the rich morphological information contained in the photoplethysmography (PPG) signal waveform.
[0003] Currently, common wearable heart rate monitoring algorithms primarily employ fixed time window analysis, single feature extraction, and static models. These approaches suffer from the following issues: First, fixed-time-scale feature extraction cannot simultaneously capture different types of heart rhythm abnormalities (such as rapid premature beats and slow atrial fibrillation); second, they use the same feature focus for all users, failing to consider the varying importance of PPG morphological features across different populations, resulting in reduced detection accuracy for specific populations (such as the elderly and patients with cardiovascular disease); and finally, they lack the ability to continuously optimize over time as user data accumulates, making them unable to adapt to long-term physiological changes.
[0004] Therefore, a heart rate calculation method is needed that can adapt to different user characteristics, capture multiple abnormal heart rhythm patterns, and continuously optimize as user data accumulates, so as to improve the accuracy and stability of heart rate monitoring of wearable devices. Summary of the Invention
[0005] The present invention provides a heart rate calculation method and system for wearable data collection devices, which solves the technical problems in the prior art of how to adapt to different user characteristics, capture multiple abnormal heart rhythm patterns, and continuously optimize the heart rate calculation method as user data accumulates.
[0006] The present invention provides a heart rate calculation method for a wearable data acquisition device, comprising:
[0007] Analyze the PPG signals collected by wearable devices at multiple time scales and extract morphological features at multiple time scales;
[0008] A multi-head attention neural network is used to process morphological features at multiple time scales, automatically focusing on waveform features at different time scales.
[0009] Adaptively adjust the importance weight of each feature in the multi-head attention neural network based on the user's basic information and physiological characteristics;
[0010] Based on the adjusted attention network output, abnormal heart rate detection is achieved by comparing the current waveform features with the templates in the self-learning normal waveform library, and the individual feature distribution is continuously optimized through incremental learning.
[0011] Furthermore, the multiple time scales include 0.5 seconds, 2 seconds, 5 seconds and 10 seconds, and the window overlap rate is 50%.
[0012] Furthermore, the morphological features include peak width, peak slope, second-order derivative value, peak spacing, waveform area, waveform symmetry, valley-to-peak ratio, waveform energy, spectral center and waveform entropy.
[0013] Furthermore, the attention of the multi-head attention neural network includes:
[0014] The multi-head attention neural network includes multiple attention heads, each of which corresponds to a time scale and focuses on significant waveform features at that time scale through attention calculation;
[0015] Multiply the time-scale feature vector by the query matrix to obtain the query vector;
[0016] Multiply the time-scale eigenvector by the bond matrix to obtain the bond vector;
[0017] Multiply the time-scale eigenvector by the value matrix to obtain a value vector;
[0018] Multiply the query vector with the transpose of the key vector, divide by the square root of the key dimension, and apply the softmax function to obtain the attention score;
[0019] Multiply the attention score with the value vector to get the output value;
[0020] Among them, the eigenvector refers to the eigenvector corresponding to the time scale, and the query matrix, key matrix and value matrix are the parameter matrices of attention calculation.
[0021] Furthermore, the user's basic information and physiological characteristics include: age group, gender, basal heart rate, heart rate variability index, body mass index, activity level and whether there is a history of cardiovascular disease.
[0022] Furthermore, the importance weights of each feature in the multi-head attention neural network are adaptively adjusted, including:
[0023] Construct user feature vector based on user’s basic information and physiological characteristics;
[0024] Through the feature importance mapping neural network, the user feature vector is mapped to the feature importance coefficient;
[0025] Based on the output of the mapping function, the attention head weights of the multi-head attention network are adjusted.
[0026] Furthermore, the current PPG waveform is compared with the template in the self-learning normal waveform library through the dynamic time warping algorithm to obtain the similarity score.
[0027] Furthermore, through knowledge distillation technology, the anomaly detection knowledge of medical-grade ECG equipment is converted into the parameter optimization target of the wearable device algorithm. The knowledge distillation adopts the knowledge distillation loss function, which consists of two parts: one is the cross entropy loss between the true label and the PPG model prediction, and the other is the KL divergence between the softened outputs of the ECG model and the PPG model; the two parts are weightedly combined by the weight coefficient, and the KL divergence part is also multiplied by the square of the temperature parameter as an adjustment factor.
[0028] Furthermore, the optimization of the individualized feature distribution adopts an incremental learning method to update the user's personal normal waveform template library, fuses the original template with the current feature vector through weighted averaging, and updates the weight to control the retention ratio of new and old information to obtain an updated template library.
[0029] A heart rate calculation system for a wearable data acquisition device is used to implement a heart rate calculation method for the wearable data acquisition device, comprising:
[0030] Multi-scale feature extraction module, used to analyze the PPG signals collected by wearable devices at multiple time scales and extract morphological features at multiple time scales;
[0031] Attention feature optimization module, which is used to apply multi-head attention neural network to process morphological features at multiple time scales and automatically focus on waveform features at different time scales;
[0032] The user adaptive adjustment module is used to adaptively adjust the importance weight of each feature in the multi-head attention neural network based on the user's basic information and physiological characteristics;
[0033] The anomaly detection module is used to detect heart rate anomalies based on the adjusted attention network output by comparing the current waveform features with the templates in the self-learning normal waveform library, and continuously optimize the individualized feature distribution through incremental learning.
[0034] The beneficial effects of the present invention are as follows: by analyzing PPG signals on multiple time scales simultaneously, the present invention can effectively capture different types of abnormal heart rhythm characteristics, from rapid premature beats to slow atrial fibrillation, making the detection range more comprehensive, and the detection rate of common abnormal heart rhythm tends to be stable, which is improved compared with traditional methods; secondly, the adaptive adjustment algorithm based on user characteristics enables the system to automatically optimize algorithm parameters according to the individual characteristics of the user, maintain a stable high detection rate in special populations such as the elderly and patients with cardiovascular diseases, and avoid the problem of traditional methods with declining accuracy in these populations; through personalized learning and knowledge distillation technology, the system can continue to optimize over time, effectively adapt to the long-term physiological changes of the user, and the detection accuracy is improved from the initial level, providing a reliable long-term monitoring tool for patients with chronic cardiovascular diseases. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 is a flow chart of a heart rate calculation method for a wearable data acquisition device provided in an embodiment of the present invention;
[0036] Figure 2 This is a module diagram of a heart rate calculation system for a wearable data acquisition device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The subject matter described herein will now be discussed with reference to example embodiments. It should be understood that these embodiments are discussed solely to enable those skilled in the art to better understand and implement the subject matter described herein, and that the functions and arrangements of the elements discussed may be varied without departing from the scope of this specification. Various examples may omit, substitute, or add various processes or components as needed. Furthermore, features described in some examples may be combined in other examples.
[0038] At least one embodiment of the present invention discloses a heart rate calculation method and system for a wearable data acquisition device, such as Figure 1 As shown, including:
[0039] According to the embodiments of this application, this implementation is applicable to heart rate anomaly detection scenarios in wearable health monitoring devices, targeting the heart rhythm anomaly detection needs of different user groups (such as the elderly, athletes, and patients with cardiovascular diseases). In the field of health monitoring, traditional heart rate detection methods mainly rely on the heart rate value itself, ignoring the rich morphological information contained in the photoplethysmography (PPG) signal waveform, and are unable to effectively identify various types of heart rhythm anomalies.
[0040] This application provides a multi-scale adaptive heart rate anomaly detection method that extracts and analyzes PPG signal features at different time scales and can adaptively adjust anomaly detection parameters based on user characteristics. The method mainly includes the following steps:
[0041] Step 1: Analyze the PPG signals collected by the wearable device at multiple time scales and extract morphological features at multiple time scales.
[0042] This step analyzes the PPG signals collected by the wearable device at multiple time scales and extracts morphological features at multiple time scales. It should be noted that this step mainly includes the following sub-steps:
[0043] 1.1. PPG signal preprocessing: The raw PPG signal is subjected to noise reduction and normalization. A bandpass filter (frequency range 0.5-5 Hz) is used for noise reduction to remove baseline drift and high-frequency noise. Normalization normalizes the signal amplitude to the range of [0, 1] to facilitate subsequent processing.
[0044] 1.2. Multi-scale window division: The preprocessed PPG signal is divided into four sliding windows of time scales: 0.5 seconds, 2 seconds, 5 seconds, and 10 seconds, with a window overlap rate of 50%, to cover the temporal characteristics of different types of abnormal heart rhythms.
[0045] 1.3. Morphological Feature Extraction: Ten key morphological parameters are extracted from the PPG signal within each time window to form a feature vector. It should be understood that these features include: Peak Width: The width of the main peak of the PPG waveform, measured in milliseconds; Peak Slope: The slope of the rising edge of the PPG waveform, measured in amplitude / milliseconds; Second Derivative: The maximum and minimum values of the second derivative of the waveform, reflecting the degree of waveform curvature; Peak Interval: The time interval between two adjacent peaks, measured in milliseconds; Waveform Area: The integrated area within one cycle of the PPG waveform; Waveform Symmetry: The ratio of the waveform's rise time to its fall time; Valley-to-Peak Ratio: The ratio of the trough to peak amplitudes; Waveform Energy: The energy distribution characteristic of the signal; Spectral Center: The central position of the signal's frequency distribution; Waveform Entropy: A measure of waveform complexity.
[0046] For each window size , forming the feature vector :
[0047] ;
[0048] in, Indicated on scale The extracted Therefore, for the input PPG signal, a multi-scale feature matrix is finally formed , contains morphological features of all time scales, among which, Represents the scale feature matrix of 0.5s, 2s, 5s, and 10s.
[0049] Step 2: Apply a multi-head attention neural network to process morphological features at multiple time scales and automatically focus on waveform features at different time scales.
[0050] In this step, a multi-head attention neural network is applied to process the multi-scale feature matrix obtained in step 1, automatically focusing on the most significant waveform features at different time scales. It should be noted that this step mainly includes the following sub-steps:
[0051] 2.1. Attention head construction: Construct an independent attention head for each time scale feature vector to form a multi-head attention neural network structure. Each attention head contains three transformation matrices: query matrix , key matrix Sum Matrix ,in is the dimension of the feature vector (10 in this case), and is the internal dimension of the attention network (8 in this example).
[0052] In an embodiment of the present application, the multi-head attention neural network includes the following specific components: Input layer: Receives a feature tensor of shape [batch_size, time_scales, feature_dim], where batch_size is the batch size, time_scales is the number of time scales (4 in this case), and feature_dim is the feature dimension (10 in this case) Attention calculation layer: Each time scale corresponds to an attention head, for a total of 4 attention heads Fusion layer: Connects and maps the outputs of all attention heads to a unified feature space.
[0053] 2.2. Attention calculation: For each time scale The eigenvector of , the attention output is calculated by the following steps: Calculate the query vector:
[0054] ;
[0055] in, is the query vector, Time scale The eigenvector of is the query matrix;
[0056] Compute the key vector:
[0057] ;
[0058] in, is the key vector, Time scale The eigenvector of is the bond matrix;
[0059] Compute a vector of values:
[0060] ;
[0061] in, is a value vector, Time scale The eigenvector of is the value matrix;
[0062] Calculate the attention score:
[0063] ;
[0064] in, Score for attention, for The transpose of is the dimension of the key vector, Calculate the output for the scaling factor: ,in, is the output vector of the attention head, is a normalization function that converts the attention scores into probability distributions.
[0065] In specific application scenarios, the attention calculation process adapts to different types of heart rhythm abnormality detection. For example: for rapid heart rhythm abnormalities (such as premature beats): the attention head with a short time scale (0.5 seconds) can capture the mutation characteristics of the waveform. For chronic heart rhythm abnormalities (such as atrial fibrillation): the attention head with a long time scale (10 seconds) can capture the periodic change characteristics of the waveform. For mixed heart rhythm abnormalities: the attention heads with multiple time scales work together to comprehensively analyze the waveform characteristics.
[0066] 2.3. Multi-head fusion: Connect the outputs of each attention head and pass them through a linear transformation matrix Perform fusion to obtain the final feature representation:
[0067] ;
[0068] in, represents the vector concatenation operation, which concatenates the attention outputs of the four time scales into a long vector; is the final feature representation after fusion; 、 、 、 The attention head outputs at four different time scales: 0.5s, 2s, 5s, and 10s; is the fusion transformation matrix.
[0069] The implementation of the fusion layer includes the following steps: concatenate the outputs of all attention heads to generate a feature tensor of dimension [batch_size, 4*d_v], where batch_size represents the batch size, 4 represents the number of attention heads at four time scales, and d_v represents the feature dimension of each attention head output through the linear transformation matrix The concatenated features are mapped to the final feature space to obtain output features of shape [batch_size, d], where batch_size represents the number of samples in the batch and d represents the dimension of the final feature.
[0070] In addition, through the multi-head attention neural network, the system can automatically identify the most significant waveform features at different time scales, such as focusing on the rapid waveform changes of premature beats at the 0.5-second scale, and focusing on the long-cycle abnormal patterns of atrial fibrillation at the 10-second scale, thereby improving the detection ability of different types of abnormal heart rhythms.
[0071] Step 3: Adaptively adjust the importance weight of each feature in the multi-head attention neural network based on the user's basic information and physiological characteristics.
[0072] According to one embodiment of the present application, this step adaptively adjusts the importance weights of each feature in the multi-head attention network based on the user's basic information and physiological characteristics. It should be noted that this step mainly includes the following sub-steps:
[0073] 3.1. User feature vector construction: Based on the user's basic information and physiological characteristics, the user feature vector is constructed User characteristics include: Age group: divided into three categories: young (18-40 years old), middle-aged (41-60 years old), and elderly (>60 years old); Gender: male or female; Basal heart rate: average heart rate in the resting state, unit is beats / minute; Heart rate variability index: SDNN (standard deviation of adjacent heart beats), unit is milliseconds; Body mass index (BMI): weight (kg) / height2 (m2); Activity level: a quantitative indicator of daily activity intensity; Whether there is a history of cardiovascular disease: a binary indicator (0 or 1).
[0074] The process of constructing the user feature vector includes: normalizing numerical features (such as basal heart rate, BMI, etc.), mapping them to the [0, 1] interval, performing one-hot encoding conversion on categorical features (such as age group, gender, etc.), and concatenating all converted features to form the final user feature vector. .
[0075] 3.2. Feature Importance Mapping Neural Network: Constructing the Mapping Function , the user feature vector Mapping is feature importance coefficient. The mapping function uses a two-layer fully connected neural network structure:
[0076] ;
[0077] in, and are the first and second weight matrices, respectively, and are the first and second bias vectors, is the activation function;
[0078] In the embodiment of the present application, the specific structure of the feature importance mapping neural network is as follows: Input layer: receiving user feature vector , the dimension is the number of user features (in this case, the dimension of 7 features after processing) Hidden layer: A fully connected layer containing 16 neurons, using the ReLU activation function Output layer: A fully connected layer containing 4 neurons, corresponding to the feature importance coefficients of 4 time scales Output normalization: Use the Softmax function to ensure that the sum of all weight coefficients is 1.
[0079] 3.3. Feature weight adjustment: According to the output of the mapping function, the attention head weights of the multi-head attention network in step 2 are adjusted:
[0080] ;
[0081] in, is the baseline feature weight, is the mapping function for The output coefficient of the feature, is the adjusted feature weight, represents the user feature vector. Here The index of the time scale ranges from 1 to 4, corresponding to time scales of 0.5 seconds, 2 seconds, 5 seconds, and 10 seconds, respectively.
[0082] Application examples in specific scenarios: 1. Scenario for elderly patients with cardiovascular disease: User characteristics: Age = 72 years old, history of cardiovascular disease, basal heart rate = 62 bpm Feature importance output: The weight coefficients of long time scales (5 seconds and 10 seconds) are significantly increased (approximately 0.35 and 0.4) Adjustment effect: Improve the detection sensitivity of chronic atrial fibrillation and bradycardia.
[0083] Young athlete scenario: User characteristics: Age = 25 years old, no history of cardiovascular disease, basal heart rate = 55 bpm Feature importance output: The weight coefficients of short time scales (0.5 seconds and 2 seconds) are increased (approximately 0.45 and 0.3). Adjustment effect: Improves the detection sensitivity of instantaneous heart rate changes and premature beats during exercise.
[0084] It should be understood that for the elderly user group, the system will automatically increase the weight of the long time window (5 seconds and 10 seconds) features to improve the detection sensitivity of chronic arrhythmia; while for the young athlete group, the system will increase the weight of the short time window (0.5 seconds and 2 seconds) features to improve the responsiveness to rapid heart rhythm changes during exercise.
[0085] In addition, through adaptive adjustment of user characteristics, the system can optimize the parameters of the anomaly detection algorithm according to the characteristics of different populations, and improve the detection accuracy in diverse user groups.
[0086] Step 4: Based on the adjusted attention network output, abnormal heart rate detection is achieved by comparing the current waveform features with the templates in the self-learning normal waveform library, and the individual feature distribution is continuously optimized through incremental learning.
[0087] In one embodiment of the present application, this step is based on the adjusted attention network output, by comparing the current waveform features with the templates in the self-learned normal waveform library, to detect abnormal heart rate, and continuously optimize the individualized feature distribution through incremental learning. It can be seen that this step mainly includes the following sub-steps:
[0088] 4.1. Normal Waveform Template Library Construction: The system is initially configured with a basic template library containing a variety of typical PPG normal waveforms. These templates include standard PPG waveforms at different heart rate levels (e.g., 60 bpm, 80 bpm, 100 bpm, etc.). Each template is recorded as a feature vector, which is extracted using the same feature extraction method as in step 1.
[0089] The normal waveform template library consists of: Basic template set: contains 10-15 standard normal waveform templates covering different heart rate levels Personalized template set: an exclusive template set established for each user, which is initially empty and continuously accumulates templates during use Template index structure: an index organized by heart rate level, which facilitates quick positioning of templates with similar heart rates.
[0090] 4.2 Dynamic Time Warping Algorithm: Compare the current PPG feature vector processed in steps 2 and 3 with the templates in the template library, and use the Dynamic Time Warping (DTW) algorithm to calculate the similarity score:
[0091] ;
[0092] in, and are the current feature vector and the template feature vector, represents the alignment path between two sequences, is the minimum alignment distance, i.e. the similarity score; and Sequence and Through the path Aligned elements; is the length of the alignment path, is the minimum similarity value.
[0093] The specific implementation of the dynamic time warping algorithm includes: constructing a cumulative distance matrix: calculating the distance between all points of the two eigenvectors and filling the cumulative distance matrix; finding the optimal alignment path: starting from the lower right corner of the matrix, find the minimum distance path to the upper left corner; calculating the normalized distance: dividing the minimum path distance by the path length to obtain the normalized similarity score.
[0094] In practical applications, there are different variants of the DTW algorithm for different types of arrhythmias: For periodic anomalies (such as atrial fibrillation): use a cyclic DTW variant that allows the path to loop at the sequence boundary For local anomalies (such as premature beats): use a constrained DTW variant that limits the maximum time offset window For morphological anomalies (such as ST segment changes): use a weighted DTW variant that gives higher weights to key feature points.
[0095] 4.3. Abnormal detection: Determine whether the heart rate is abnormal based on the similarity score. If the similarity score with the most matching template exceeds the preset threshold , it is determined to be an abnormal heart rate. Threshold The setting takes into account individual differences among users. The initial value is set according to the statistical characteristics of the user group and is subsequently adjusted through feedback.
[0096] The decision-making process of anomaly detection includes: Template matching: select 3-5 templates closest to the current heart rate from the template library for comparison Similarity sorting: calculate the DTW distance between the current feature vector and each template, and sort them in ascending order of distance Threshold judgment: if the minimum distance exceeds the preset threshold , it is determined to be abnormal heart rate abnormality classification: according to the abnormal characteristic pattern and distance distribution, the abnormality is further classified into different types (such as premature beats, tachycardia, atrial fibrillation, etc.).
[0097] 4.4. Personalized template library update: For PPG waveforms that are determined to be normal, the user's personal normal waveform template library is updated through incremental learning:
[0098] ;
[0099] in, It is the original template. is the current eigenvector, is the update weight (value range 0-1), Is the updated template. Update weight As the degree of template matching increases, ensuring high-quality matching has a greater impact on the template.
[0100] The personalized template library update strategy includes: New template generation: When a normal waveform of a certain heart rate level appears for the first time, it is directly added as a new template. Existing template update: When a waveform similar to an existing template appears, the template is updated according to the above formula. Template aging mechanism: Set a usage frequency count for each template, and regularly delete templates with low usage frequency. Template diversity maintenance: Ensure that the template library covers all intervals of the user's heart rate dynamic range.
[0101] In specific application scenarios, such as morning heart rate monitoring, the system works through the following process:
[0102] 1. The user wears the device and starts monitoring their resting heart rate in the morning;
[0103] 2. The system extracts multi-scale features of the PPG signal and processes them through an adaptive model;
[0104] 3. Compare with the resting heart rate template in the user's personalized template library;
[0105] 4. If a significant difference is detected, such as a decrease of more than 40% in heart rate variability, an early warning of potential heart rhythm abnormalities will be issued;
[0106] 5. Update normal waveform data to the personalized template library to optimize future detection results.
[0107] Therefore, in this way, the system can continuously adjust and optimize the individualized normal waveform template library as user data accumulates, so that anomaly detection can more accurately adapt to the individual characteristics of users.
[0108] One embodiment of the present application also provides a method for further improving the generalization performance and detection accuracy of the algorithm by extracting anomaly detection knowledge from professional medical-grade electrocardiogram equipment. Specifically, this step mainly includes the following sub-steps:
[0109] Knowledge source model construction: Based on a large amount of clinical electrocardiogram (ECG) data, a professional-level heart rhythm abnormality detection model is constructed. This model can accurately identify various types of heart rhythm abnormalities, including sinus tachycardia, sinus bradycardia, atrial fibrillation, atrial flutter, premature beats, ventricular fibrillation, etc.
[0110] The structure of the knowledge source model includes: input layer: receives standard 12-lead or single-lead ECG data; feature extraction layer: contains a multi-layer convolutional neural network to extract the time-frequency features of the ECG signal; classification layer: outputs multi-category arrhythmia classification results and confidence levels.
[0111] This ECG anomaly detection model has the following characteristics in practical applications: High accuracy: The classification accuracy on the standard abnormal heart rhythm dataset has been improved;
[0112] Medical verification: clinically verified to meet the data processing requirements of medical equipment level. Multi-disease coverage: able to identify more than 20 common types of abnormal heart rhythms;
[0113] Knowledge distillation algorithm: Through knowledge distillation technology, the knowledge of the medical-grade ECG model is converted into a form that can be learned by the wearable device PPG model.
[0114] The specific method is: let the PPG model learn not only the hard labels (real abnormal / normal classification), but also the soft labels (probability distribution) output by the ECG model, and minimize the total loss function of knowledge distillation of the KL divergence between the two:
[0115] ;
[0116] in, is the total loss function of knowledge distillation, which is used to guide the student model to learn knowledge from the teacher model; is the cross entropy loss function, is the true label, is the label predicted by the PPG model, is the KL divergence (Kullback-Leibler divergence), is the softened output of the ECG model (teacher model), is the softened output of the PPG model (student model), is the temperature parameter (used to soften the model output), is the weight coefficient (used to balance the ratio of hard label loss and distillation loss).
[0117] The specific implementation of the knowledge distillation process includes: Label softening: using temperature parameters (usually set to 2-5) Soften the teacher model output Matching process: For the same input sample, minimize the KL divergence between the student model and the teacher model softened output Joint training: Simultaneously train the hard label supervision signal and the softened knowledge transfer signal, weight coefficient Usually set to 0.3-0.7.
[0118] Application scenario example: In the sleep abnormal rhythm monitoring scenario, the following process can be implemented:
[0119] 1. Use professional ECG equipment to record user sleep data, and have doctors mark abnormal events;
[0120] 2. The ECG model analyzes the data and produces detailed probability distribution output;
[0121] 3. Input the PPG data of the corresponding time into the student model and learn the output pattern of the ECG model through knowledge distillation;
[0122] 4. In actual use, the student model is able to identify abnormal patterns similar to those detected by the ECG model based on PPG data alone.
[0123] Parameter Optimization: Based on the results of knowledge distillation, we optimized the parameters of the PPG anomaly detection model to achieve detection accuracy close to that of medical-grade equipment while maintaining its lightweight. The optimized parameters include key feature extraction parameters, the weight matrix for attention calculation, and the threshold for anomaly detection.
[0124] The parameter optimization process includes: Sensitivity analysis: Identify the key parameters that have the greatest impact on model performance Constraint optimization: Find the optimal balance between performance and efficiency under device resource constraints Differentiation adjustment: Differentiately adjust parameter configuration for different types of anomalies Verification and fine-tuning: Fine-tune the final parameter configuration through precise verification of labeled data sets.
[0125] It should be noted that through medical-grade knowledge enhancement, this embodiment can provide heart rate anomaly detection capabilities close to those of professional medical equipment under the resource constraints of wearable devices, significantly improving detection accuracy and reliability.
[0126] According to the embodiments provided in this application, a high-precision heart rate anomaly detection method for wearable devices is implemented through steps such as multi-scale morphological feature extraction, multi-dimensional attention network, user feature adaptive adjustment, anomaly detection and personalized learning, and medical-grade knowledge enhancement. The method has the following technical effects:
[0127] Improved Detection Accuracy: The implementation method provided in this application achieves a 92% detection rate for common heart rhythm abnormalities such as atrial fibrillation and ventricular tachycardia, an increase of approximately 35% over traditional methods. It is important to note that this method maintains a stable high detection rate in special populations such as the elderly and patients with cardiovascular disease, avoiding the decline in accuracy seen with traditional methods in these populations.
[0128] Wide coverage of abnormality types: Through multi-scale analysis and attention networks, this implementation can simultaneously capture heart rate abnormality characteristics at different time scales, identifying a variety of types ranging from rapid premature beats to slow atrial fibrillation, overcoming the limitations of traditional single-scale analysis.
[0129] Personalized adaptability: The method provided in this application is based on an adaptive adjustment algorithm based on user characteristics, which enables the system to automatically optimize algorithm parameters according to the individual characteristics of the user, and continuously optimize over time, thereby improving detection accuracy in different user groups.
[0130] Application scenario expansion: This implementation extends the function of wearable devices from simple heart rate numerical monitoring to abnormal heart rhythm detection with medical reference value, thereby improving the health management value of the device and its potential for clinical auxiliary diagnosis.
[0131] Long-term monitoring value: Through the continuous learning and adaptation algorithm provided by this application, the system can provide stable and reliable heart rate abnormality detection services in the long term, providing continuous data support for the management of chronic cardiovascular diseases.
[0132] In the embodiments of the present application, the multi-scale adaptive heart rate anomaly detection method has been verified in actual application scenarios. The following is an application example in a health monitoring scenario.
[0133] Application scenario: daily monitoring of elderly patients with chronic cardiovascular diseases.
[0134] A medical institution equipped 80 patients with chronic cardiovascular disease (aged 65-78, 46 men and 34 women) with wearable devices incorporating the proposed method for continuous monitoring over a six-month period. All patients had a history of atrial fibrillation, premature beats, or other abnormal heart rhythms. The purpose of this monitoring was to evaluate the effectiveness and long-term adaptability of the proposed method in real-world home use.
[0135] Phase 1: Initialization and user feature acquisition.
[0136] The system first collects basic information of each user, including age (average 71.3 years), gender, basal heart rate (average resting heart rate 67.2bpm), heart rate variability index SDNN (average 38.4ms), BMI value (average 26.5), daily activity level score (using the International Physical Activity Questionnaire IPAQ score) and cardiovascular disease type.
[0137] Taking the patient with ID A076 as an example (72-year-old male with a history of atrial fibrillation), the user feature vector constructed by the system is: u A 076=[0.95, 1, 0.68, 0.42, 0.73, 0.25, 1], where each dimension corresponds to the standardized age group, gender, basal heart rate, SDNN, BMI, activity level, and history of cardiovascular disease.
[0138] The second stage: multi-scale morphological feature extraction.
[0139] Taking the 5-minute PPG signal of patient A076 in the early morning resting state as an example, the system extracts morphological features at four time scales:
[0140] On a 0.5 second time scale, some of the extracted characteristic values are: peak width: 247ms, peak slope: 0.043 amplitude / ms, and maximum value of the second-order derivative: 0.00018 amplitude / ms. 2 .
[0141] On a 10-second time scale, some of the extracted characteristic values are: waveform period average: 892ms, waveform entropy: 0.673, spectrum center: 1.12Hz.
[0142] The third stage: adaptive adjustment and anomaly detection.
[0143] Based on the user feature vector of patient A076, the weight adjustment coefficients of the feature importance mapping neural network output are: [0.15, 0.25, 0.22, 0.38] corresponding to the attention head weight adjustment coefficients of four time scales (0.5 seconds, 2 seconds, 5 seconds, 10 seconds).
[0144] After adjustment, the system pays more attention to features on long time scales (5 seconds and 10 seconds), which is consistent with the clinical cognition that the waveform abnormalities of elderly patients with atrial fibrillation are usually more obvious on longer time scales.
[0145] On the 14th day of monitoring, when patient A076 experienced an atrial fibrillation episode, the system detected significant changes in the following features on a 10-second timescale: a 246% increase in waveform period variability, a 58% increase in waveform entropy, and a 31% decrease in waveform symmetry.
[0146] After comparing with the patient's personal normal waveform template library, the DTW distance score was 0.47 (the threshold was set at 0.35), and the system successfully detected and marked it as atrial fibrillation abnormality.
[0147] Phase 4: Personalized learning and model optimization.
[0148] During the 6-month monitoring period, patient A076's personal waveform template library expanded from the initial 5 benchmark templates to 27 personalized templates, covering standard waveforms at different heart rate levels and activity states.
[0149] The attention head weights for this patient were also automatically adjusted multiple times and finally converged to [0.12, 0.21, 0.25, 0.42], further enhancing the attention to long-time scale features and improving the sensitivity of atrial fibrillation detection.
[0150] Verification of detection accuracy: The monitoring data of all 80 patients were compared with the hospital's Holter monitoring results to verify the detection accuracy of this method:
[0151] Comparison of accuracy of abnormal heart rhythm types:
[0152] The accuracy rate of atrial fibrillation detection reached 91.7%, which is 33.4% higher than the traditional single-feature method; the accuracy rate of premature beat detection reached 87.6%, which is 29.1% higher than the traditional method; the accuracy rate of tachycardia detection reached 93.2%, which is 26.7% higher than the traditional method; and the accuracy rate of bradycardia detection reached 94.5%, which is 23.8% higher than the traditional method.
[0153] Population difference detection effect:
[0154] The detection accuracy rate was 90.3% in the elderly group (70-78 years old) and 91.2% in the middle-aged group (65-69 years old), with a difference of only 0.9% between the groups. The detection accuracy rate was 89.8% in the group with a history of cardiovascular disease and 91.5% in the group with mild symptoms, with a difference of only 1.7% between the groups.
[0155] This shows that this method maintains a high and stable detection accuracy in different populations, overcoming the problem of traditional methods with significantly decreased accuracy in special populations.
[0156] Verification of personalized adaptation effect:
[0157] Comparison of the detection effect of using the 6-month pre-model and the 6-month post-model:
[0158] The average detection accuracy of the initial model was 82.4%. The average detection accuracy after 6 months of adaptation was 91.8%. The detection error rate was reduced by 53.4%. The missed detection rate was reduced by 67.2%.
[0159] Adaptability to individual patient changes:
[0160] Twelve of the 80 patients experienced significant changes in their basal heart rate (>15%) during the monitoring period. The detection accuracy after automatic adjustment by the system remained at 88.7%, only 2.5% lower than that of the stable population. Seven patients adjusted their medication regimens during the monitoring period. The system automatically adapted to the waveform changes within 2 weeks, and the detection accuracy recovered from a temporary drop of 76.4% to 89.3%.
[0161] Verification results show that this method can effectively adapt to the user's long-term physiological changes through personalized learning and adaptive adjustment, maintain stable abnormal heart rhythm detection effects, and provide a reliable long-term monitoring tool for patients with chronic cardiovascular diseases.
[0162] like Figure 2 As shown, a heart rate calculation system for a wearable data acquisition device is used to implement a heart rate calculation method for a wearable data acquisition device, including:
[0163] Multi-scale feature extraction module, used to analyze the PPG signals collected by wearable devices at multiple time scales and extract morphological features at multiple time scales;
[0164] Attention feature optimization module, which is used to apply multi-head attention neural network to process morphological features at multiple time scales and automatically focus on waveform features at different time scales;
[0165] The user adaptive adjustment module is used to adaptively adjust the importance weight of each feature in the multi-head attention neural network based on the user's basic information and physiological characteristics;
[0166] The anomaly detection module is used to detect heart rate anomalies based on the adjusted attention network output by comparing the current waveform features with the templates in the self-learning normal waveform library, and continuously optimize the individualized feature distribution through incremental learning.
[0167] The above describes an embodiment of the present invention, but this embodiment is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Ordinary technicians in this field can also make more forms of equivalent embodiments based on the inspiration of this embodiment, all of which are protected by this embodiment.
Claims
1. A heart rate calculation method for a wearable data acquisition device, characterized in that: The following steps are involved: Analyze the PPG signals collected by wearable devices at multiple time scales and extract morphological features at multiple time scales; A multi-head attention neural network is used to process morphological features at multiple time scales, automatically focusing on waveform features at different time scales. Adaptively adjust the importance weight of each feature in the multi-head attention neural network based on the user's basic information and physiological characteristics; Based on the adjusted attention network output, abnormal heart rate detection is achieved by comparing the current waveform features with templates in the self-learned normal waveform library, and the individual feature distribution is continuously optimized through incremental learning. The multiple time scales include 0.5 seconds, 2 seconds, 5 seconds and 10 seconds, and the window overlap rate is 50%; The morphological features include peak width, peak slope, second-order derivative value, peak spacing, waveform area, waveform symmetry, valley-to-peak ratio, waveform energy, spectral center and waveform entropy; The attention of the multi-head attention neural network includes: The multi-head attention neural network includes multiple attention heads, each of which corresponds to a time scale and focuses on significant waveform features at that time scale through attention calculation; Multiply the time-scale feature vector by the query matrix to obtain the query vector; Multiply the time-scale eigenvector by the bond matrix to obtain the bond vector; Multiply the time-scale eigenvector by the value matrix to obtain a value vector; Multiply the query vector by the transpose of the key vector, divide it by the square root of the key vector, and apply the softmax function to obtain the attention score; Multiply the attention score with the value vector to get the output value; Among them, the eigenvector refers to the eigenvector corresponding to the time scale, and the query matrix, key matrix and value matrix are the parameter matrices of attention calculation; Among them, the user's basic information and physiological characteristics include: age group, gender, basal heart rate, heart rate variability index, body mass index, activity level and whether there is a history of cardiovascular disease; Among them, the current PPG waveform is compared with the template in the self-learning normal waveform library through the dynamic time warping algorithm to obtain the similarity score; Through knowledge distillation technology, the parameters of the wearable device algorithm are optimized by utilizing the anomaly detection knowledge transformation of medical-grade electrocardiogram equipment. The knowledge distillation loss function is composed of two parts: one is the cross-entropy loss between the true label and the PPG model prediction, and the other is the KL divergence between the softened outputs of the ECG model and the PPG model. The two parts are weightedly combined by the weight coefficient, and the KL divergence part is also multiplied by the square of the temperature parameter as an adjustment factor.
2. A heart rate calculation method for a wearable data acquisition device according to claim 1, characterized in that: Adaptively adjust the importance weights of each feature in the multi-head attention neural network, including: Construct user feature vector based on user’s basic information and physiological characteristics; Through the feature importance mapping neural network, the user feature vector is mapped to the feature importance coefficient; Based on the output of the mapping function, the attention head weights of the multi-head attention network are adjusted.
3. A heart rate calculation method for a wearable data acquisition device according to claim 1, characterized in that: The optimization of the individualized feature distribution adopts an incremental learning method to update the user's personal normal waveform template library, fuses the original template with the current feature vector through a weighted average method, and updates the weight to control the retention ratio of new and old information to obtain an updated template library.
4. A heart rate calculation system for a wearable data acquisition device, used to implement a heart rate calculation method for a wearable data acquisition device as described in any one of claims 1 to 3, characterized in that: include: Multi-scale feature extraction module, used to analyze the PPG signals collected by wearable devices at multiple time scales and extract morphological features at multiple time scales; Attention feature optimization module, which is used to apply multi-head attention neural network to process morphological features at multiple time scales and automatically focus on waveform features at different time scales; The user adaptive adjustment module is used to adaptively adjust the importance weight of each feature in the multi-head attention neural network based on the user's basic information and physiological characteristics; The anomaly detection module is used to detect heart rate anomalies based on the adjusted attention network output by comparing the current waveform features with the templates in the self-learning normal waveform library, and continuously optimize the individualized feature distribution through incremental learning.
Citation Information
Patent Citations
Method and system for arrhythmia prediction using transducer-based neural networks
CN116504398A
Non-contact abnormal heart rate identification and disease risk cognition method and system
CN117807484A
Intelligent nursing management system and method for critical patients
CN119453949A
Ai enabled multisensor connected telehealth system
US20250000361A1