CN117694861A - Training method and device for heart rate prediction model, electronic equipment and storage medium - Google Patents

Training method and device for heart rate prediction model, electronic equipment and storage medium Download PDF

Info

Publication number
CN117694861A
CN117694861A CN202311833186.4A CN202311833186A CN117694861A CN 117694861 A CN117694861 A CN 117694861A CN 202311833186 A CN202311833186 A CN 202311833186A CN 117694861 A CN117694861 A CN 117694861A
Authority
CN
China
Prior art keywords
heart rate
sample
characteristic parameters
model
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311833186.4A
Other languages
Chinese (zh)
Inventor
刘畅
卢县
李倩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bestechnic Shanghai Co Ltd
Original Assignee
Bestechnic Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bestechnic Shanghai Co Ltd filed Critical Bestechnic Shanghai Co Ltd
Priority to CN202311833186.4A priority Critical patent/CN117694861A/en
Publication of CN117694861A publication Critical patent/CN117694861A/en
Pending legal-status Critical Current

Links

Landscapes

  • Measuring Pulse, Heart Rate, Blood Pressure Or Blood Flow (AREA)

Abstract

The application provides a training method and device of a heart rate prediction model, electronic equipment and storage medium, wherein the method comprises the following steps: s1: inputting the sample characteristic parameters in the training set into the attention model to obtain output characteristic parameters of the attention model; the sample characteristic parameters carry a label sequence, and the label sequence comprises labels corresponding to K heart rate categories; s2: processing and outputting characteristic parameters through K heart rate classifiers to obtain K heart rate classification results; wherein the K heart rate classifiers correspond to K consecutive heart rate categories; s3: calculating prediction losses according to the K heart rate classification results and the tag sequences, and adjusting model parameters of the neural network model based on the prediction losses; the neural network model comprises an attention model and K heart rate classifiers; s4: and repeating the processes of S1 to S3 until the neural network model converges to obtain a heart rate prediction model. According to the scheme, the heart rate prediction model capable of accurately realizing heart rate prediction can be trained.

Description

Training method and device for heart rate prediction model, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of electrophysiological signal processing technologies, and in particular, to a method and apparatus for training a heart rate prediction model, an electronic device, and a computer readable storage medium.
Background
With the emphasis of physical health, wearable devices (e.g., smart watches, smart wrists, etc.) are becoming increasingly popular. The PPG (Photoplethysmography) signal and the ACC (triaxial Accelerometer) signal are collected by the wearable device, so that the heart rate is predicted by the PPG signal and the ACC signal, which is a more common application service. In the correlation scheme, the prediction method is usually implemented by means of a regression model or a classification model. The regression model can directly predict the specific value of the heart rate according to the input characteristics, however, the regression model is used for debugging a large amount of super parameters, and the complexity is high. The classification model classifies heart rate into several categories, and the current heart rate is determined by predicting the category. However, the heart rate is divided into a plurality of categories to enable the model to learn, and the natural sequence characteristic of the heart rate is ignored, namely, the transformation of the heart rate is a continuous and smooth process, so that the situation that the heart rate suddenly jumps from 40bpm to 180bpm is difficult to occur. In this case, a general classification model cannot achieve accurate heart rate prediction.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and apparatus for training a heart rate prediction model, an electronic device, and a computer readable storage medium, which are used for training a heart rate prediction model capable of accurately realizing heart rate prediction by an orderly regression training mode.
In one aspect, the present application provides a method for training a heart rate prediction model, including:
s1: inputting the sample characteristic parameters in the training set into an attention model to obtain output characteristic parameters of the attention model; the sample characteristic parameters are obtained through fusion of sample PPG data and sample ACC data, the sample characteristic parameters carry a label sequence, the label sequence comprises labels corresponding to K heart rate categories, and any label indicates whether a real heart rate value corresponding to the sample characteristic parameters is larger than or equal to the heart rate category corresponding to the label;
s2: processing the output characteristic parameters through K heart rate classifiers to obtain K heart rate classification results; wherein the K heart rate classifiers correspond to K consecutive heart rate categories;
s3: calculating prediction losses according to the K heart rate classification results and the tag sequences, and adjusting model parameters of a neural network model based on the prediction losses; wherein the neural network model includes the attention model and the K heart rate classifiers;
s4: and repeating the processes from S1 to S3 until the neural network model converges to obtain a heart rate prediction model.
In an embodiment, the training set is constructed in a manner including:
respectively carrying out filtering processing on the sample PPG data and the sample ACC data through a wavelet filtering algorithm to obtain filtered sample PPG data and filtered sample ACC data;
respectively carrying out normalization processing on the filtered sample PPG data and the filtered sample ACC data to obtain normalized PPG data and normalized ACC data;
constructing sample characteristic parameters according to the normalized PPG data and the normalized ACC data, and determining a tag sequence of the sample characteristic parameters based on the sample PPG data and a real heart rate value corresponding to the sample ACC data;
and constructing the training set according to a plurality of sample characteristic parameters carrying the tag sequence.
In an embodiment, the normalizing the filtered sample PPG data and the filtered sample ACC data to obtain normalized PPG data and normalized ACC data includes:
determining a first average and a first maximum of a plurality of sampling points in the filtered sample PPG data, respectively subtracting the first average from the plurality of sampling points, and dividing the first average by the first maximum to obtain normalized PPG data;
and determining a second average value and a second maximum value of a plurality of sampling points in the filtered sample ACC data channel by channel, respectively subtracting the second average value of the channel from the plurality of sampling points of each channel, and dividing the second average value by the second maximum value of the channel to obtain the normalized ACC data.
In an embodiment, the determining the tag sequence of the sample feature parameter based on the sample PPG data and the actual heart rate value corresponding to the sample ACC data includes:
comparing the true-solid rate value with the K heart rate categories respectively to determine labels corresponding to the K heart rate categories, and forming a label sequence by the K labels; wherein any tag in the tag sequence is represented as:
wherein, label i Is the ith tag, and the value range of i is from 1 to K; hr is the true solidity value; class of things i Is the ith heart rate category.
In an embodiment, the calculating the prediction loss according to the K heart rate classification results and the tag sequence includes:
wherein L is loss Representing a predicted loss; a, a i A weight representing an ith heart rate prediction task; l (L) CE Representing a cross entropy loss function; pred (pred) i Representing an ith heart rate classification result; label i Representing the ith tag in the tag sequence.
In an embodiment, the method further comprises:
fusing PPG data to be detected and ACC data to be detected as input characteristic parameters;
processing the input characteristic parameters through an attention model of the heart rate prediction model to obtain target characteristic parameters;
processing the target characteristic parameters through K heart rate classifiers of the heart rate prediction model to obtain K heart rate classification results;
and determining heart rate predicted values according to the K heart rate classification results.
In an embodiment, the determining a heart rate prediction value according to the K heart rate classification results includes:
judging whether each heart rate two-classification result is larger than a preset probability threshold value or not;
if any heart rate two classification result is larger than the probability threshold value, setting the heart rate two classification result to be 1;
if any heart rate two classification result is not greater than the probability threshold value, setting the heart rate two classification result to 0;
and accumulating the K heart rate classification results after adjustment, and fusing the accumulated results with a heart rate lower limit value to obtain the heart rate predicted value.
In another aspect, the present application provides a training device for a heart rate prediction model, including:
an input module for executing steps S1, S1: inputting the sample characteristic parameters in the training set into an attention model to obtain output characteristic parameters of the attention model; the sample characteristic parameters are obtained through fusion of sample PPG data and sample ACC data, the sample characteristic parameters carry a label sequence, the label sequence comprises labels corresponding to K heart rate categories, and any label indicates whether a real heart rate value corresponding to the sample characteristic parameters is larger than or equal to the heart rate category corresponding to the label;
the classification module is configured to perform steps S2, S2: processing the output characteristic parameters through K heart rate classifiers to obtain K heart rate classification results; wherein the K heart rate classifiers correspond to K consecutive heart rate categories;
the adjusting module is used for executing steps S3 and S3: calculating prediction losses according to the K heart rate classification results and the tag sequences, and adjusting model parameters of a neural network model based on the prediction losses; wherein the neural network model includes the attention model and the K heart rate classifiers;
a repeating module, configured to execute steps S4, S4: and repeating the processes from S1 to S3 until the neural network model converges to obtain a heart rate prediction model.
Further, the present application provides an electronic device, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the above-described training method of the heart rate prediction model.
Furthermore, the present application provides a computer readable storage medium storing a computer program executable by a processor to perform the above-described method of training a heart rate prediction model.
According to the scheme, the sequential characteristics of heart rates are fully considered in the training stage, the thought of ordered regression is used, the model learns continuity existing among heart rate categories, and only the training targets with differences among the categories are maximized when the traditional classification model is trained, so that a better training effect is obtained. In addition, the neural network model of the heart rate prediction model is trained by taking the attention model as a feature extraction model, so that features related to heart rate categories in sample feature parameters can be fully utilized, and the classification accuracy is further improved. Therefore, the heart rate prediction model for accurately predicting the heart rate category can be trained by the scheme.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly explain the drawings that are required to be used in the embodiments of the present application.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a training method of a heart rate prediction model according to an embodiment of the present disclosure;
fig. 3 is a flow chart of a method for constructing a training set according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating a heart rate prediction method according to an embodiment of the present disclosure;
FIG. 5 is a detailed flowchart of step 440 of FIG. 4 according to an embodiment of the present application;
fig. 6 is a block diagram of a training device for heart rate prediction model according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
Like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
As shown in fig. 1, the present embodiment provides an electronic apparatus 1 including: at least one processor 11 and a memory 12, one processor 11 being exemplified in fig. 1. The processor 11 and the memory 12 are connected by a bus 10, and the memory 12 stores instructions executable by the processor 11, which instructions are executed by the processor 11, so that the electronic device 1 may perform all or part of the flow of the method in the embodiments described below. In an embodiment, the electronic device 1 may be a host, a server cluster or a cloud computing center for performing the training method of the heart rate prediction model.
The Memory 12 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as static random access Memory (Static Random Access Memory, SRAM), electrically erasable Programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), erasable Programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), programmable Read-Only Memory (PROM), read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk.
The present application also provides a computer readable storage medium storing a computer program executable by the processor 11 to perform the method of training the heart rate prediction model provided herein.
Referring to fig. 2, a flowchart of a training method of a heart rate prediction model according to an embodiment of the present application is shown in fig. 2, and the method may include the following steps S1 to S4.
Step S1: inputting the sample characteristic parameters in the training set into the attention model to obtain output characteristic parameters of the attention model; the sample characteristic parameters are obtained through fusion of sample PPG data and sample ACC data, the sample characteristic parameters carry a label sequence, the label sequence comprises labels corresponding to K heart rate categories, and any label indicates whether a real heart rate value corresponding to the sample characteristic parameters is larger than or equal to the heart rate category corresponding to the label.
The K heart rate categories are determined from the human heart rate range and the predictive resolution of the model (denoted S). For example, the human heart rate range is denoted as h= [ L, L+1, … …, H-1, H ], L, H ε R, and training data can be classified into K= (H-L)/S+1. Illustratively, L is 30, H is 100, S is 1, and K is 71. Alternatively, L is 30, H is 100, S is 2, and K is 36.
Any sample characteristic parameter is input into the attention model, and the attention model is used for processing the sample characteristic parameter, so that the output characteristic parameter can be obtained. The sample characteristic parameter is sequence data obtained by fusing sample PPG data and sample ACC data, and the form of the sample characteristic parameter can be vectors, matrixes and the like. The attention model gives higher weight to the characteristics related to the heart rate category in the sample characteristic parameters based on the attention mechanism, so that the output characteristic parameters are obtained. The output characteristic parameters may be in the form of vectors, matrices, etc.
Step S2: processing and outputting characteristic parameters through K heart rate classifiers to obtain K heart rate classification results; wherein the K heart rate classifiers correspond to K consecutive heart rate categories.
Each heart rate classifier is used to perform its corresponding heart rate class classification task. For example, the heart rate classifier may be composed of a fully connected layer and a sigmoid function, and the heart rate classifier outputs a value between 0 and 1, as a heart rate classification result, where the value characterizes a probability that a true heart rate value corresponding to a sample feature parameter is greater than or equal to a heart rate class corresponding to the heart rate classifier.
And classifying the output characteristic parameters by using K heart rate classifiers to obtain K heart rate classification results.
Step S3: calculating prediction losses according to the K heart rate classification results and the tag sequences, and adjusting model parameters of the neural network model based on the prediction losses; the neural network model comprises an attention model and K heart rate classifiers.
After obtaining K heart rate classification results, differences between the K heart rate classification results and labels corresponding to the K heart rate classes in the label sequence may be compared, so as to calculate a predicted loss through a preset loss function. After obtaining the predicted loss, model parameters of the attention model and the K heart rate classifiers in the neural network model can be adjusted in a back propagation manner with the predicted loss, thereby completing a round of training.
In one embodiment, when calculating the prediction loss, the calculation process can be represented by the following formula (1):
wherein L is loss Representing a predicted loss; a, a i The weight of the ith heart rate prediction task is represented, the importance degree of the ith heart rate prediction task is represented, the default value is 1/K, and the importance of K heart rate prediction tasks is represented; l (L) CE Representing a cross entropy loss function; pred (pred) i Representing an ith heart rate classification result; label i Representing the ith tag in the tag sequence. If the label is 1, the true heart rate value corresponding to the sample characteristic parameter is larger than or equal to the heart rate category corresponding to the heart rate classifier; if the label is 0, the true heart rate value corresponding to the sample characteristic parameter is smaller than the heart rate category corresponding to the heart rate classifier.
Step S4: and repeating the processes of S1 to S3 until the neural network model converges to obtain a heart rate prediction model.
After the training of one round is completed, the step S1 may be returned to start a new round of training, and after repeated iteration, when the training round reaches the preset round threshold, or when the prediction loss tends to be stable, the neural network model may be considered to converge, and at this time, the neural network model that has converged and includes the attention model and K heart rate classifiers may be used as the heart rate prediction model.
Through the measures, the sequential characteristics of heart rate are fully considered in the training stage, the thought of ordered regression is used, the model learns continuity existing among heart rate categories, and the training target of only maximizing the difference among the categories in the training of the traditional classification model is improved, so that a better training effect is obtained. Such as: the training mode of the traditional classification model is that for a sample with a true solid rate value of 65bpm (Beat Per Minute), the calculated class loss is the same when the predicted class loss is 64bpm and 100bpm, and the predicted class loss is smaller when the predicted class loss is 64bpm in the scheme, so that the model can learn the characteristics of the sample more fully in the training process. In addition, the neural network model of the heart rate prediction model is trained by taking the attention model as a feature extraction model, so that features related to heart rate categories in sample feature parameters can be fully utilized, and the classification accuracy is further improved. Therefore, the heart rate prediction model for accurately predicting the heart rate category can be trained by the scheme.
In an embodiment, the training set may be constructed prior to training the heart rate prediction model. Referring to fig. 3, a flowchart of a method for constructing a training set according to an embodiment of the present application is shown in fig. 3, and the method may include the following steps 310 to 340.
Step 310: and respectively carrying out filtering processing on the sample PPG data and the sample ACC data through a wavelet filtering algorithm to obtain filtered sample PPG data and filtered sample ACC data.
Sample PPG data are acquired through a PPG sensor, and sample ACC data are acquired through an ACC sensor. The same set of sample PPG data is identical to the acquisition time (start time, end time) corresponding to the sample ACC data. And the corresponding acquisition time lengths of all the samples are the same. The sampling frequencies of the sample PPG data and the sample ACC data are the same, and if the sampling frequencies are different, the sampling frequencies of the sample PPG data and the sample ACC data can be unified by a resampling mode.
And filtering the sample PPG data through a wavelet filtering algorithm to obtain filtered sample PPG data.
And filtering the sample ACC data through a wavelet filtering algorithm to obtain filtered sample ACC data.
Step 320: and respectively carrying out normalization processing on the filtered sample PPG data and the filtered sample ACC data to obtain normalized PPG data and normalized ACC data.
And carrying out normalization processing on the filtered sample PPG data to obtain normalized PPG data. And carrying out normalization processing on the filtered sample ACC data channel by channel to obtain normalized ACC data.
Step 330: and constructing sample characteristic parameters according to the normalized PPG data and the normalized ACC data, and determining a label sequence of the sample characteristic parameters based on the sample PPG data and the real heart rate value corresponding to the sample ACC data.
Step 340: and constructing a training set according to the plurality of sample characteristic parameters carrying the tag sequences.
The normalized PPG data is a vector of 1*n and the normalized ACC data is a matrix of 3*n. Here, n is the number of sampling points. The normalized PPG data and normalized ACC data may be constructed as a matrix of 4*n as sample characteristic parameters. For the real heart rate value corresponding to each sample characteristic parameter, the real heart rate value can be converted into a label sequence, and an association relation is established between the real heart rate value and the sample characteristic parameter.
After obtaining a plurality of sample feature parameters carrying the tag sequence, the plurality of sample feature parameters may be constructed as a training set.
Through the above measures, a training set can be constructed based on a combination of a plurality of sample PPG data and sample ACC data.
In an embodiment, when step 320 is performed, an average and a maximum of a plurality of sampling points in the filtered sample PPG data may be determined, where the average is taken as the first average and the maximum is taken as the first maximum. The plurality of sample points in the filtered sample PPG data are subtracted by the first average and divided by the first maximum, respectively, so that the plurality of processed sample points form normalized PPG data.
The filtered sample ACC data has three sampling points of channels in the X-axis direction, the Y-axis direction, and the Z-axis direction. An average and a maximum of a plurality of sampling points in the filtered sample ACC data are determined channel by channel, the average is taken as a second average, and the maximum is taken as a second maximum. The second average number of each channel is subtracted from the plurality of sample points of each channel and divided by the second maximum value, respectively, so that the sample points of the three channels after processing form normalized ACC data.
By the measures, the filtered sample PPG data and the filtered sample ACC can be normalized.
In one embodiment, when step 330 is performed to construct a tag sequence, the true-solid rate value may be compared to the K heart rate categories, respectively, to determine tags corresponding to the K heart rate categories, and the tag sequence may be constructed with the K tags. Wherein any tag in the tag sequence can be represented by the following formula (2):
wherein, label i Is the ith tag, and the value range of i is from 1 to K; hr is true solid rate value; class of things i Is the ith heart rate category.
It should be noted that, when the prediction resolution S is greater than or equal to 2, any heart rate class may correspond to a plurality of specific heart rate values, and when comparing whether the true heart rate value is greater than or equal to the ith heart rate class, it may be determined whether the true heart rate value is greater than or equal to the minimum value of the plurality of heart rate values corresponding to the ith heart rate class.
By this measure, a tag sequence can be constructed whose tags are consecutive multiple or one 1 and 0 following the 1.
In an embodiment, after the heart rate prediction model is trained, heart rate prediction tasks may be performed with the heart rate prediction model. Referring to fig. 4, a flowchart of a heart rate prediction method according to an embodiment of the present application is shown in fig. 4, and the method may include the following steps 410 to 440.
Step 410: and fusing the PPG data to be detected and the ACC data to be detected as input characteristic parameters.
The PPG data to be measured and the ACC data to be measured form a combination, and the acquisition time corresponding to the PPG data to be measured and the ACC data to be measured in the combination is the same. The sampling frequencies of the PPG data to be tested and the ACC data to be tested are the same, and if the sampling frequencies of the PPG data to be tested and the ACC data to be tested are different, the sampling frequencies of the PPG data to be tested and the ACC data to be tested can be unified in a resampling mode.
After obtaining the PPG data to be measured and the ACC data to be measured, fusion processing may be performed to obtain the input feature parameters. Here, the manner of fusing the sample PPG data and the sample ACC data into the sample feature parameters may be the same as the manner of fusing the sample PPG data and the sample ACC data into the sample feature parameters, which is not described herein.
Step 420: and processing the input characteristic parameters through the attention model of the heart rate prediction model to obtain target characteristic parameters.
After the input characteristic parameters are obtained, the input characteristic parameters are input into a heart rate prediction model, and the input characteristic parameters are processed through an attention model in the heart rate prediction model, so that target characteristic parameters are output.
Step 430: and processing the target characteristic parameters through K heart rate classifiers of the heart rate prediction model to obtain K heart rate classification results.
After the target characteristic parameters are obtained, classifying the target characteristic parameters through K heart rate classifiers of a heart rate prediction model, so that K heart rate classification results are obtained. Each heart rate two-classification result is a probability that the true heart rate value is greater than or equal to the heart rate class of its corresponding heart rate classifier.
Step 440: and determining heart rate predicted values according to the K heart rate classification results.
And carrying out fusion processing on the K heart rate two-classification results to obtain heart rate predicted values.
Through the measure, after the heart rate prediction model is trained through the training mode of ordered regression, heart rate prediction can be performed based on the heart rate prediction model, compared with the conventional classification mode, the scheme is performed in a heart rate range prediction mode, heart rate continuity characteristics are fully utilized, and a more accurate prediction result can be obtained.
In an embodiment, referring to fig. 5, a detailed flowchart of step 440 in fig. 4 provided in an embodiment of the present application, as shown in fig. 5, when step 440 is performed, the following steps 441 to 444 may be specifically performed.
Step 441: judging whether each heart rate two-classification result is larger than a preset probability threshold value.
Wherein the probability threshold can be configured as required. Illustratively, the probability threshold may be 0.5, 0.6, or 0.7, etc.
Step 442: if any heart rate two classification result is larger than the probability threshold value, setting the heart rate two classification result to be 1.
Step 443: if any heart rate two classification result is not greater than the probability threshold value, setting the heart rate two classification result to 0.
On the other hand, if any heart rate two classification result is greater than the probability threshold, it indicates that the true solid rate value is greater than or equal to the heart rate category corresponding to the heart rate two classification result, and at this time, the heart rate two classification result may be set to 1. On the other hand, if any heart rate two classification result is not greater than the probability threshold, it indicates that the true-solid rate value is smaller than the heart rate category corresponding to the heart rate two classification result, and at this time, the heart rate two classification result may be set to 0.
Step 444: and accumulating the K heart rate classification results after adjustment, and fusing the accumulated results with the heart rate lower limit value to obtain a heart rate predicted value.
Wherein the heart rate lower limit value is the minimum value in the human heart rate range selected when constructing the heart rate category.
And accumulating the K heart rate classification results after adjustment, multiplying the accumulated results by the prediction resolution, and fusing the product with the heart rate lower limit value to obtain the heart rate prediction value. By way of example, the heart rate prediction value may be represented by the following formula (3):
wherein h is pre Is a heart rate predicted value; l is the heart rate lower limit value; s is the prediction resolution; f (f) i (x) To be adjusted byThe i-th heart rate classification result of (2) takes a value of 1 or 0.
By this measure, K heart rate classification results can be fused into heart rate predictors.
FIG. 6 is a block diagram of a training apparatus for heart rate prediction models according to an embodiment of the present invention, as shown in FIG. 6, the apparatus may include:
the input module 610 is configured to perform steps S1, S1: inputting the sample characteristic parameters in the training set into an attention model to obtain output characteristic parameters of the attention model; the sample characteristic parameters are obtained through fusion of sample PPG data and sample ACC data, the sample characteristic parameters carry a label sequence, the label sequence comprises labels corresponding to K heart rate categories, and any label indicates whether a real heart rate value corresponding to the sample characteristic parameters is larger than or equal to the heart rate category corresponding to the label;
the classification module 620 is configured to perform steps S2, S2: processing the output characteristic parameters through K heart rate classifiers to obtain K heart rate classification results; wherein the K heart rate classifiers correspond to K consecutive heart rate categories;
the adjustment module 630 is configured to perform steps S3, S3: calculating prediction losses according to the K heart rate classification results and the tag sequences, and adjusting model parameters of a neural network model based on the prediction losses; wherein the neural network model includes the attention model and the K heart rate classifiers;
a repetition module 640, configured to perform steps S4, S4: and repeating the processes from S1 to S3 until the neural network model converges to obtain a heart rate prediction model.
The implementation process of the functions and roles of each module in the device is specifically shown in the implementation process of the corresponding steps in the training method of the heart rate prediction model, and is not repeated here.
In the several embodiments provided in the present application, the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored on a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.

Claims (10)

1. A method of training a heart rate predictive model, comprising:
s1: inputting the sample characteristic parameters in the training set into an attention model to obtain output characteristic parameters of the attention model; the sample characteristic parameters are obtained through fusion of sample PPG data and sample ACC data, the sample characteristic parameters carry a label sequence, the label sequence comprises labels corresponding to K heart rate categories, and any label indicates whether a real heart rate value corresponding to the sample characteristic parameters is larger than or equal to the heart rate category corresponding to the label;
s2: processing the output characteristic parameters through K heart rate classifiers to obtain K heart rate classification results; wherein the K heart rate classifiers correspond to K consecutive heart rate categories;
s3: calculating prediction losses according to the K heart rate classification results and the tag sequences, and adjusting model parameters of a neural network model based on the prediction losses; wherein the neural network model includes the attention model and the K heart rate classifiers;
s4: and repeating the processes from S1 to S3 until the neural network model converges to obtain a heart rate prediction model.
2. The method according to claim 1, wherein the training set is constructed in a manner that includes:
respectively carrying out filtering processing on the sample PPG data and the sample ACC data through a wavelet filtering algorithm to obtain filtered sample PPG data and filtered sample ACC data;
respectively carrying out normalization processing on the filtered sample PPG data and the filtered sample ACC data to obtain normalized PPG data and normalized ACC data;
constructing sample characteristic parameters according to the normalized PPG data and the normalized ACC data, and determining a tag sequence of the sample characteristic parameters based on the sample PPG data and a real heart rate value corresponding to the sample ACC data;
and constructing the training set according to a plurality of sample characteristic parameters carrying the tag sequence.
3. The method according to claim 2, wherein normalizing the filtered sample PPG data and the filtered sample ACC data, respectively, results in normalized PPG data and normalized ACC data, comprising:
determining a first average and a first maximum of a plurality of sampling points in the filtered sample PPG data, respectively subtracting the first average from the plurality of sampling points, and dividing the first average by the first maximum to obtain normalized PPG data;
and determining a second average value and a second maximum value of a plurality of sampling points in the filtered sample ACC data channel by channel, respectively subtracting the second average value of the channel from the plurality of sampling points of each channel, and dividing the second average value by the second maximum value of the channel to obtain the normalized ACC data.
4. The method according to claim 2, wherein the determining the tag sequence of the sample characteristic parameter based on the sample PPG data and the corresponding true heart rate value of the sample ACC data comprises:
comparing the true-solid rate value with the K heart rate categories respectively to determine labels corresponding to the K heart rate categories, and forming a label sequence by the K labels; wherein any tag in the tag sequence is represented as:
wherein, label i Is the ith tag, and the value range of i is from 1 to K; hr is the true solidity value; class of things i Is the ith heart rate category.
5. The method of claim 1, wherein said calculating a predictive loss from said K heart rate classification results and said tag sequence comprises:
wherein L is loss Representing a predicted loss; a, a i A weight representing an ith heart rate prediction task; l (L) CE Representing a cross entropy loss function; pred (pred) i Representing an ith heart rate classification result; label i Representing the ith tag in the tag sequence.
6. The method according to claim 1, wherein the method further comprises:
fusing PPG data to be detected and ACC data to be detected as input characteristic parameters;
processing the input characteristic parameters through an attention model of the heart rate prediction model to obtain target characteristic parameters;
processing the target characteristic parameters through K heart rate classifiers of the heart rate prediction model to obtain K heart rate classification results;
and determining heart rate predicted values according to the K heart rate classification results.
7. The method of claim 6, wherein determining a heart rate predictor from the K heart rate classification results comprises:
judging whether each heart rate two-classification result is larger than a preset probability threshold value or not;
if any heart rate two classification result is larger than the probability threshold value, setting the heart rate two classification result to be 1;
if any heart rate two classification result is smaller than or equal to the probability threshold value, setting the heart rate two classification result to 0;
and accumulating the K heart rate classification results after adjustment, and fusing the accumulated results with a heart rate lower limit value to obtain the heart rate predicted value.
8. A training device for a heart rate prediction model, comprising:
an input module for executing steps S1, S1: inputting the sample characteristic parameters in the training set into an attention model to obtain output characteristic parameters of the attention model; the sample characteristic parameters are obtained through fusion of sample PPG data and sample ACC data, the sample characteristic parameters carry a label sequence, the label sequence comprises labels corresponding to K heart rate categories, and any label indicates whether a real heart rate value corresponding to the sample characteristic parameters is larger than or equal to the heart rate category corresponding to the label;
the classification module is configured to perform steps S2, S2: processing the output characteristic parameters through K heart rate classifiers to obtain K heart rate classification results; wherein the K heart rate classifiers correspond to K consecutive heart rate categories;
the adjusting module is used for executing steps S3 and S3: calculating prediction losses according to the K heart rate classification results and the tag sequences, and adjusting model parameters of a neural network model based on the prediction losses; wherein the neural network model includes the attention model and the K heart rate classifiers;
a repeating module, configured to execute steps S4, S4: and repeating the processes from S1 to S3 until the neural network model converges to obtain a heart rate prediction model.
9. An electronic device, the electronic device comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the training method of the heart rate prediction model of any one of claims 1-7.
10. A computer readable storage medium, characterized in that the storage medium stores a computer program executable by a processor to perform the method of training the heart rate prediction model of any one of claims 1-7.
CN202311833186.4A 2023-12-27 2023-12-27 Training method and device for heart rate prediction model, electronic equipment and storage medium Pending CN117694861A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311833186.4A CN117694861A (en) 2023-12-27 2023-12-27 Training method and device for heart rate prediction model, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311833186.4A CN117694861A (en) 2023-12-27 2023-12-27 Training method and device for heart rate prediction model, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117694861A true CN117694861A (en) 2024-03-15

Family

ID=90151563

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311833186.4A Pending CN117694861A (en) 2023-12-27 2023-12-27 Training method and device for heart rate prediction model, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117694861A (en)

Similar Documents

Publication Publication Date Title
Vaicenavicius et al. Evaluating model calibration in classification
Kumar et al. A comparative study of supervised machine learning algorithms for stock market trend prediction
CN108805083B (en) Single-stage video behavior detection method
CN110503531B (en) Dynamic social scene recommendation method based on time sequence perception
CN110443969B (en) Fire detection method and device, electronic equipment and storage medium
Pruteanu-Malinici et al. Infinite hidden Markov models for unusual-event detection in video
JP2001502831A (en) A method for classifying the statistical dependence of measurable time series
CN114297036A (en) Data processing method and device, electronic equipment and readable storage medium
CN117041017B (en) Intelligent operation and maintenance management method and system for data center
CN113379059B (en) Model training method for quantum data classification and quantum data classification method
CN113988357B (en) Advanced learning-based high-rise building wind induced response prediction method and device
CN115983497A (en) Time sequence data prediction method and device, computer equipment and storage medium
CN112613617A (en) Uncertainty estimation method and device based on regression model
CN112101156A (en) Target identification method and device and electronic equipment
CN112766402A (en) Algorithm selection method and device and electronic equipment
JP2019105871A (en) Abnormality candidate extraction program, abnormality candidate extraction method and abnormality candidate extraction apparatus
CN108984851B (en) Weighted Gaussian model soft measurement modeling method with time delay estimation
US20200279148A1 (en) Material structure analysis method and material structure analyzer
CN117540336A (en) Time sequence prediction method and device and electronic equipment
CN117154256A (en) Electrochemical repair method for lithium battery
CN116192665B (en) Data processing method, device, computer equipment and storage medium
CN116451081A (en) Data drift detection method, device, terminal and storage medium
CN114422450B (en) Network traffic analysis method and device based on multi-source network traffic data
CN117694861A (en) Training method and device for heart rate prediction model, electronic equipment and storage medium
CN113868597A (en) Regression fairness measurement method for age estimation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination