Model training methods, devices, electronic equipment, and computer-readable storage media
By partitioning and supplementing the training sample set of the heart rate detection algorithm model, the problem of uneven distribution of training samples is solved, and the accuracy of heart rate detection is improved, especially in the detection of abnormal heart rates.
Patent Information
- Application Number
- CN202211667769.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-23
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-12-23
AI Technical Summary
Existing heart rate detection algorithms suffer from low accuracy due to uneven distribution of training samples, especially with significant errors in detecting high and low heart rates.
By dividing the training sample set into subsets of different heart rate ranges, and taking the first sample from the larger subset to generate the second sample, which is then added to the smaller subset to form a balanced target sample set, the heart rate detection algorithm model is trained.
It improves the accuracy of heart rate detection algorithm model, especially in detecting abnormal heart rates.
Smart Images

Figure CN116204783B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the medical field, and more specifically, embodiments of this application relate to a model training method, apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] The condition of the heart is crucial to a person's life. Continuous heart rate monitoring can detect problems such as bradycardia, tachycardia, and sinus rhythm, reminding users to have timely checkups and protect their hearts. Placing electrodes on both sides of the heart to measure ECG is a technique used in hospitals. This method has the advantage of high measurement accuracy, but it also has drawbacks such as being cumbersome to wear, taking a long time to measure, and being unable to be used during physical activities like walking, running, and basketball.
[0003] To facilitate heart rate detection, a heart rate detection method called photoplethysmography (PPG) has been proposed in the prior art. The principle is to obtain the PPG signal by utilizing the changes in the degree of green light absorption caused by different blood flow velocities at different heart rates, and to calculate the heart rate value using a heart rate detection algorithm model.
[0004] Before using a heart rate detection algorithm model to calculate PPG signals, the model needs to be trained. This training process requires known heart rate samples. However, since most people have a normal heart rate in most situations, the heart rate values collected in existing technologies generally exhibit a long-tailed distribution. This means that there are relatively few samples of low or high heart rates, while there are many samples of intermediate normal heart rates. This causes the algorithm to tend to predict high or low heart rates as intermediate heart rates, resulting in a large bias in heart rate estimation and low accuracy. Summary of the Invention
[0005] The purpose of this application is to provide a model training method, apparatus, electronic device, and computer-readable storage medium that can improve the accuracy of heart rate detection results of heart rate detection algorithm models.
[0006] In a first aspect, embodiments of this application provide a model training method for training a heart rate detection algorithm model, comprising: acquiring a training sample set, the training sample set including multiple training samples of different heart rate sizes; dividing the multiple training samples according to heart rate size ranges to form multiple training sample subsets; selecting the training sample subset with a number of training samples greater than a first preset threshold as a first target subset, and selecting the training sample subset with a number of training samples less than the first preset threshold as a second target subset; acquiring a plurality of the training samples in the first target subset as first samples; generating a plurality of second samples based on the first samples, the heart rate size of the second samples belonging to the heart rate size range corresponding to the second target subset; adding the plurality of second samples to the second target subset to obtain a target sample set; and using the target sample set to train the heart rate detection algorithm model.
[0007] In some embodiments, the step of using a subset of training samples whose number is less than the first preset threshold as the second target subset includes: using a subset of training samples whose number is less than the first preset threshold and whose minimum heart rate is greater than the first preset heart rate as the second target subset. Since normal human heart rate has a distribution range, and all heart rates within this range are considered normal and have similar characteristics, determining the second target subset based on the minimum heart rate can better identify abnormal heart rates, further improving the accuracy of the heart rate detection algorithm model's detection results.
[0008] In some embodiments, generating a plurality of second samples based on the first sample includes: splicing a plurality of first samples to form a spliced sample; and performing time-domain compression processing on the spliced sample to generate the second sample.
[0009] In some embodiments, the step of using a subset of training samples whose number is less than the first preset threshold as the second target subset includes: using a subset of training samples whose number is less than the first preset threshold and whose maximum heart rate is less than a second preset heart rate as the second target subset. Since normal human heart rate has a distribution range, and all heart rates within this range are considered normal and have similar characteristics, determining the second target subset based on the maximum heart rate can better identify abnormal heart rates, further improving the accuracy of the heart rate detection algorithm model's detection results.
[0010] In some embodiments, generating a plurality of second samples based on the first sample includes: segmenting the first sample to form a plurality of segmented samples; and performing temporal stretching on the plurality of segmented samples to generate a plurality of second samples.
[0011] In some embodiments, after training the heart rate detection algorithm model using the target sample set, the method further includes: performing multiple heart rate detections using the heart rate detection algorithm model to obtain multiple heart rate detection results; obtaining a first percentage of abnormal heart rate detection results among the multiple heart rate detection results, wherein the abnormal heart rate detection results are heart rate detection results with a heart rate less than a second preset heart rate or a heart rate greater than the first preset heart rate; determining whether the first percentage falls within a first preset range; if the first percentage exceeds the first preset range, adjusting the number of the first samples according to the first percentage, and retraining the heart rate detection algorithm model. By using the trained heart rate testing algorithm model to perform heart rate detection, and determining whether the heart rate testing algorithm model has been trained successfully by using the percentage of abnormal heart rate detection results in the heart rate detection results, if the percentage of abnormal heart rate detection results in the heart rate detection results exceeds the preset range, it indicates that the heart rate testing algorithm model has not yet been trained successfully. Adjusting the number of the first samples and retraining the model allows for feedback adjustment of the heart rate testing algorithm model, further improving the accuracy of the psychological test results after the heart rate testing algorithm model has been trained.
[0012] In some embodiments, before adding the second sample to the training sample set, the method further includes: removing the plurality of first samples from the training sample set. Removing the first samples used as the basis for generating the second sample from the training sample set avoids the impact of two samples having similar waveforms but different heart rates on the model training process of the heart rate testing algorithm model, thereby further improving the heart rate testing accuracy of the psychological testing algorithm model.
[0013] In some embodiments, obtaining a plurality of training samples from the first target subset as the first sample includes: calculating the average number of training samples in the plurality of first target subsets; and obtaining the first sample from the first target subsets where the number of training samples is greater than the average number. Obtaining the first sample only from the first target subsets where the number of training samples is greater than the average number can average the number of training samples in each first target subset, resulting in a more uniform heart rate distribution among the training samples in the target sample set, further improving the model training effect.
[0014] Secondly, embodiments of the present invention provide a model training apparatus for training a heart rate detection algorithm model, comprising: a sample acquisition module for acquiring a training sample set, the training sample set including multiple training samples of different heart rate sizes; a sample partitioning module for partitioning the multiple training samples according to heart rate size ranges to form multiple training sample subsets; a sample adjustment module for selecting a training sample subset with a number of training samples greater than a first preset threshold as a first target subset, selecting a training sample subset with a number of training samples less than the first preset threshold as a second target subset, acquiring a plurality of training samples in the first target subset as first samples, generating a plurality of second samples based on the first samples, the heart rate size of the second samples belonging to the heart rate size range corresponding to the second target subset, adding the plurality of second samples to the second target subset to obtain a target sample set; and a model training module for training the heart rate detection algorithm model using the target sample set.
[0015] Thirdly, embodiments of the present invention provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method as described above.
[0016] Fourthly, embodiments of the present invention provide a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, can implement the method described above.
[0017] Compared with the prior art, the model training method, apparatus, electronic device, and computer-readable storage medium provided in the embodiments of the present invention classify the training sample set of the heart rate detection algorithm model according to different heart rate sizes to obtain multiple training sample subsets of different heart rate sizes. Then, a first sample is obtained from the training sample subset with a larger number of training samples, a second sample is generated based on the first sample, and the second sample is added to the training sample subset with a smaller number of training samples, thereby balancing the number of training samples in each heart rate size range and obtaining a target sample set with a more balanced distribution of heart rate samples. Using the target sample set with a more balanced distribution of heart rate samples to train the heart rate detection algorithm model can improve the accuracy of the heart rate detection results of the heart rate detection algorithm model after training. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating the model training method provided in Embodiment 1 of the present invention;
[0020] Figure 2 These are training sample images with heart rate values corresponding to 60.37 BPM and 60.15 BPM, respectively.
[0021] Figure 3 An image of a second sample with a second sample size of 40.11 BPM, generated from a training sample size of 80.22 BPM;
[0022] Figure 4 for Figure 2 The image of the second sample at 120.52 BPM generated from the training samples at 60.37 BPM and 60.15 BPM, and the image of the sample at 120.45 BPM obtained from the real sampling;
[0023] Figure 5 This is a flowchart illustrating the model training method provided in Embodiment 2 of the present invention;
[0024] Figure 6 This is a schematic diagram of the model training device provided in Embodiment 3 of the present invention;
[0025] Figure 7 This is a schematic diagram of the electronic device provided in Embodiment 4 of the present invention. Detailed Implementation
[0026] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0027] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0028] At least in order to address the technical deficiencies in the prior art mentioned in the background section, some embodiments of this application divide the training sample set of the heart rate detection algorithm model and supplement training samples into the training sample subset with a smaller number of training samples in the heart rate range. This achieves the effect of balancing the number of training samples in the training sample subsets of each heart rate range, thereby making the trained heart rate detection algorithm model more accurate in detecting heart rate.
[0029] Please refer to Figure 1 The following is combined with Figure 1 The model training method proposed in Embodiment 1 of the present invention is illustrated by way of example, the method comprising:
[0030] Step S101: Obtain the training sample set.
[0031] Specifically, in this step, the training sample set includes multiple training samples with different heart rates. In some embodiments of the present invention, the training sample set can be PPG signals from different test subjects at different heart rates obtained through actual measurements.
[0032] Step S102: Divide the multiple training samples according to the heart rate range to form multiple training sample subsets.
[0033] Specifically, in some embodiments of the present invention, the training sample set can be divided according to the heart rate of each training sample. First, the minimum and maximum heart rates of each training sample in the training sample set are obtained to obtain the heart rate distribution range of the training samples in the training sample set. Then, the heart rate distribution range is equally divided into several training sample subsets according to the division requirements. For example, if the maximum heart rate of the training samples in the training sample set is X and the minimum heart rate is Y, then the heart rate distribution range of the training samples in the training sample set is [Y, X]. The heart rate distribution range [Y, X] is equally divided into multiple smaller heart rate ranges, and the training samples in each smaller heart rate range constitute a training sample subset. It is understood that the foregoing is merely an illustrative example of a specific method for dividing the training sample set into several training sample subsets in some embodiments of the present invention, and does not constitute a limitation. In some other embodiments of the present invention, the division can also be carried out according to other methods, such as using a fixed heart rate value. For example, the common daily heart rate of the general population is in the range of 60BPM-100BPM, then the training sample set is divided into three training sample subsets: heart rate less than 60BPM, heart rate greater than 60BPM and less than 100BPM, and heart rate greater than 100BPM.
[0034] Step S103: Select the training sample subset with a number of training samples greater than the first preset threshold as the first target subset, and select the training sample subset with a number of training samples less than the first preset threshold as the second target subset.
[0035] Specifically, in this step, the first preset threshold is a numerical constant set in advance according to the requirements. In different embodiments of the present invention, the first preset threshold can be set according to the number of training samples in the training sample set, or according to the method of dividing the training sample subset, or according to other actual needs.
[0036] Furthermore, in some embodiments of the present invention, a subset of training samples whose number is less than a first preset threshold and whose minimum heart rate is greater than a first preset heart rate can be used as a second target subset, or a subset of training samples whose number is less than a first preset threshold and whose maximum heart rate is less than a second preset heart rate can be used as a second target subset. Since normal human heart rate has a distribution range, and all heart rates within this range are considered normal and have similar characteristics, determining the second target subset based on the maximum and minimum heart rates can better identify abnormal heart rates, further improving the accuracy of the heart rate detection algorithm model. For example, if the normal human heart rate is in the range of 60 BPM-100 BPM, then the first preset heart rate can be set to 100 BPM and the second preset heart rate can be set to 60 BPM.
[0037] Step S104: Obtain several training samples from the first target subset as first samples, and generate several second samples based on the first samples.
[0038] Specifically, in some embodiments of the present invention, the first sample can be obtained based on the number of training samples in the first target subset. If there are multiple different first target subsets, and the number of training samples in each first target subset is not equal, then a larger number of first samples can be obtained from the first target subset with a larger number of training samples, and a smaller number of first samples can be obtained from the first target subset with a smaller number of training samples, or no first samples can be obtained from the first target subset with a smaller number of training samples. Specifically, the average number of training samples in multiple first target subsets can be calculated, and the first sample can be obtained from the first target subset with a number of training samples greater than the average number. For the first target subset with a number of training samples less than the average number, no first sample can be obtained from it. Obtaining the first sample only from the first target subset with a number of training samples greater than the average number can average the number of training samples in each first target subset, making the heart rate distribution of the training samples in the target sample set more uniform, and further improving the model training effect. It is understood that the above is only an example of the method of obtaining training samples from the first target subset in some embodiments of the present invention, and does not constitute a limitation. In some other embodiments of the present invention, other methods such as obtaining an equal number of first samples from each first target subset can also be used, and the specific settings can be flexibly configured according to actual needs.
[0039] Furthermore, in some embodiments of the present invention, different generation methods can be used in the process of generating several second samples based on the first sample, depending on the different heart rate values of the first and second samples. For example, in some embodiments of the present invention, the process of generating second samples with smaller heart rates from a first sample with a larger heart rate involves dividing the first sample with a larger heart rate into multiple segments, and performing temporal stretching on each segment to generate multiple second samples. The temporal stretching process can be a resampling algorithm process, specifically involving proportionally expanding the segmented sample in the temporal domain and then inserting the average of two time points at the intermediate value. For example, for data originally at points 39 and 40 in the temporal domain of a segmented sample, it can be expanded to data at points 78 and 80, and then the average of the original data at points 39 and 40 can be added at position 79 to form a new second sample. It is understood that the foregoing are merely specific examples in some embodiments of the present invention and do not constitute a limitation. In other embodiments of the present invention, interpolation algorithms such as nearest neighbor, single linear interpolation, and bilinear interpolation can also be used to generate second samples, and the specific methods can be flexibly applied according to actual needs. Figure 2 The images shown correspond to heart rate values of 60.37 BPM and 60.15 BPM, respectively. Figure 3 The image shown is a second sample with a low heart rate of 40.11 BPM generated from a training sample of 80.22 BPM.
[0040] In some other embodiments of the present invention, a second sample with a larger heart rate can be generated using a first sample with a smaller heart rate. Specifically, multiple first samples are concatenated to form a concatenated sample; the concatenated sample is then subjected to temporal compression to generate the second sample. This temporal compression process can also be a resampling algorithm process. Specifically, the concatenated sample can be proportionally reduced in the temporal domain, and then the data at intermediate values can be deleted. For example, data originally at points 78 and 80 in the temporal domain of a segmented sample can be reduced to data at points 39 and 40, and then the data originally at position 79 can be deleted to form a new second sample. It is understood that the foregoing are merely specific examples in some embodiments of the present invention and do not constitute a limitation. In some other embodiments of the present invention, interpolation algorithms such as nearest neighbor, single linear interpolation, and bilinear interpolation can also be used to generate the second sample, and the specific method can be flexibly applied according to actual needs. Figure 4 The following is based on Figure 2 Images of a second high heart rate sample of 120.52 BPM generated from 60.37 BPM and 60.15 BPM, and an image of a high heart rate sample of 120.45 BPM obtained from actual sampling.
[0041] Furthermore, in some embodiments of the present invention, after the second sample is generated, the first sample is removed from the training sample set. Removing the first sample, which serves as the basis for generating the second sample, from the training sample set avoids the two samples having similar waveforms but different heart rates, thus preventing them from affecting the model training process of the heart rate testing algorithm model and further improving the accuracy of the heart rate testing in the psychological testing algorithm model.
[0042] Step S105: Add several second samples to the second target subset to obtain the target sample set.
[0043] Step S106: Train the heart rate detection algorithm model using the target sample set.
[0044] Compared with the prior art, the model training method provided in Embodiment 1 of the present invention classifies the training sample set of the heart rate detection algorithm model according to different heart rate sizes, obtaining multiple training sample subsets with different heart rate sizes. Then, a first sample is obtained from the training sample subset with a larger number of training samples, and a second sample is generated based on the first sample. The second sample is added to the training sample subset with a smaller number of training samples, thereby balancing the number of training samples in each heart rate size range and obtaining a target sample set with a more balanced distribution of heart rate samples. Using the target sample set with a more balanced distribution of heart rate samples to train the heart rate detection algorithm model can improve the accuracy of the heart rate detection results of the heart rate detection algorithm model after training.
[0045] Please refer to Figure 5 The following is combined with Figure 5 The model training method proposed in Embodiment 2 of the present invention is illustrated by way of example. The method includes:
[0046] Step S201: Obtain the training sample set.
[0047] Step S202: Divide the multiple training samples according to the heart rate range to form multiple training sample subsets.
[0048] Step S203: Select the training sample subset with a number of training samples greater than the first preset threshold as the first target subset, and select the training sample subset with a number of training samples less than the first preset threshold as the second target subset.
[0049] Step S204: Obtain several training samples from the first target subset as first samples, and generate several second samples based on the first samples.
[0050] Step S205: Add several second samples to the second target subset to obtain the target sample set.
[0051] Step S206: Train the heart rate detection algorithm model using the target sample set.
[0052] It is understood that steps S201 to S206 in the model training method provided in Embodiment 2 of the present invention are largely the same as steps S101 to S106 in Embodiment 1. For details, please refer to the specific description in the foregoing embodiments, which will not be repeated here.
[0053] Step S207: Perform multiple heart rate detections using the heart rate detection algorithm model to obtain multiple heart rate detection results.
[0054] Specifically, in this step, the heart rate detection algorithm model trained in step S206 is used to perform multiple heart rate detections on a large number of users, thereby obtaining a large number of heart rate detection results.
[0055] Step S208: Obtain the first percentage of abnormal heart rate detection results among multiple heart rate detection results.
[0056] Specifically, in this step, the abnormal heart rate detection result is the heart rate detection result where the heart rate is less than the second preset heart rate or greater than the first preset heart rate. As described in the previous embodiment one, the first preset heart rate and the second preset heart rate can be flexibly set according to actual needs. In application, the first preset heart rate can usually be set to 60 BPM and the second preset heart rate to 100 BPM, but this is not a limitation. In some other embodiments of the present invention, the settings can also be flexibly set according to the specific situation of the user group. For example, for heart disease patients, the first preset heart rate can be set to be greater than 60 BPM or the second preset heart rate can be set to be greater than 100 BPM. The specific settings can be made according to actual needs.
[0057] Step S209: Determine whether the first quantity percentage belongs to the first preset range. If yes, proceed to step S210; otherwise, proceed to step S211.
[0058] Specifically, in this step, the first preset range can also be flexibly set according to the specific situation of the user group. For example, for the general public, the first preset range can be set to 10% to 20%, and for heart disease patients, the first preset range can be set to 30% to 50%, etc. The specific settings can be flexibly adjusted according to actual needs.
[0059] Step S210: The heart rate detection algorithm model training is complete.
[0060] Step S211: Adjust the number of the first sample according to the first quantity ratio.
[0061] Specifically, in this step, if the proportion of the first quantity is greater than the maximum value of the first preset range, the number of the first samples is reduced; if the proportion of the first quantity is less than the minimum value of the first preset range, the number of the first samples is increased. Then, steps S204 to S206 are executed again to retrain the heart rate detection algorithm model.
[0062] Compared with the prior art, the model training method provided in Embodiment 2 of the present invention includes all the technical features of Embodiment 1 and has the same technical effect as Embodiment 1. For details, please refer to the specific description in Embodiment 1. In addition, in the model training method provided in Embodiment 2 of the present invention, the trained heart rate test algorithm model is used to detect heart rate. The proportion of abnormal heart rate detection results in the heart rate detection results is used to determine whether the heart rate test algorithm model has been trained. If the proportion of abnormal heart rate detection results in the heart rate detection results exceeds the preset range, it means that the heart rate test algorithm model has not been trained. The number of the first sample is adjusted and the model is retrained, thereby realizing feedback adjustment of the heart rate test algorithm model and further improving the accuracy of the psychological test results after the heart rate test algorithm model is trained.
[0063] Embodiment 3 of the present invention provides a model training device for training a heart rate detection algorithm model, specifically as follows: Figure 6 As shown, the system includes: a sample acquisition module 601, which acquires a training sample set, which includes multiple training samples with different heart rate sizes; a sample partitioning module 602, which partitions the multiple training samples according to their heart rate ranges to form multiple training sample subsets; a sample adjustment module 603, which selects the training sample subset with a number of training samples greater than a first preset threshold as a first target subset, selects the training sample subset with a number of training samples less than the first preset threshold as a second target subset, acquires several training samples from the first target subset as first samples, generates several second samples based on the first samples, wherein the heart rate size of the second samples belongs to the heart rate range corresponding to the second target subset, and adds the several second samples to the second target subset to obtain the target sample set; and a model training module 604, which trains the heart rate detection algorithm model using the target sample set.
[0064] Compared with the prior art, in the model training device provided in Embodiment 3 of the present invention, the sample division module 602 classifies the training sample set obtained by the sample acquisition module 601 according to different heart rate sizes, and obtains multiple training sample subsets with different heart rate sizes. Then, the sample adjustment module 603 obtains a first sample from the training sample subset with a larger number of training samples, generates a second sample based on the first sample, and adds the second sample to the training sample subset with a smaller number of training samples, thereby balancing the number of training samples in each heart rate size range and obtaining a target sample set with a more balanced distribution of heart rate samples. The model training module 604 uses the target sample set with a more balanced distribution of heart rate samples to train the heart rate detection algorithm model, which can improve the accuracy of the heart rate detection results of the heart rate detection algorithm model after training.
[0065] It is not difficult to see that this embodiment is an embodiment of the device corresponding to the foregoing embodiments of the present invention. Therefore, the technical details and technical content of this embodiment can also be applied to the foregoing embodiments and have the same technical effects as the foregoing embodiments. Similarly, the technical details and technical content of the foregoing embodiments of the present invention can also be applied to this embodiment and have the same technical effects, which will not be repeated here.
[0066] Embodiment 4 of this application provides an electronic device, such as... Figure 7 As shown, it includes: at least one processor 701; and a memory 702 communicatively connected to at least one processor 701; wherein the memory 702 stores instructions executable by at least one processor 701, the instructions being executed by at least one processor 701 to enable at least one processor 701 to perform the method as described above.
[0067] The memory 702 can be a read-only memory (ROM), a random access memory (RAM), or another type of memory 702. In this embodiment, the memory 702 is used to store data, as well as various algorithms and commands.
[0068] In this embodiment, the memory 702 may include a physical device for storing information, typically digitizing the information and then storing it using a medium employing electrical, magnetic, or optical methods. The memory 702 in this embodiment may further include: devices that store information using electrical energy, such as RAM and ROM; devices that store information using magnetic energy, such as hard disks, floppy disks, magnetic tapes, magnetic core memory 702, bubble memory 702, and USB flash drives; and devices that store information using optical methods, such as CDs or DVDs. Of course, there are other types of memory 702, such as quantum memories 702, graphene memories 702, etc.
[0069] Processor 701 is configured to read a computer program from memory 702 and execute the computer program to implement the method provided in the foregoing embodiments.
[0070] It should be noted that the processor 701 can be a Central Processing Unit (CPU), but it can also be other processors 701, digital signal processors 701 (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 701 can be a microprocessor 701, or it can be any conventional processor 701. The processor 701 can also be an integrated circuit chip with signal processing capabilities.
[0071] Embodiment 5 of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the method of any embodiment included in the above-described method for obtaining a drive signal.
[0072] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0073] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0074] If a function is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0075] The above are merely embodiments of this application and are not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
Claims
1. A model training method, characterized in that, Used for training the heart rate detection algorithm model, including: Obtain a training sample set, which includes multiple training samples with different heart rate sizes; The multiple training samples are divided according to the range of heart rate to form multiple training sample subsets; The subset of training samples whose number is greater than a first preset threshold is taken as the first target subset, and the subset of training samples whose number is less than the first preset threshold is taken as the second target subset. Obtain several training samples from the first target subset as the first sample; Several second samples are generated based on the first sample, and the heart rate of the second sample belongs to the heart rate range corresponding to the second target subset. The aforementioned second samples are added to the second target subset to obtain the target sample set; The heart rate detection algorithm model is trained using the target sample set. Several second samples are generated based on the first sample, including: Multiple first samples are concatenated to form a concatenated sample; the concatenated sample is then subjected to time-domain compression to generate the second sample; or... The first sample is segmented to form multiple segmented samples; the multiple segmented samples are then subjected to temporal stretching to generate multiple second samples.
2. The method according to claim 1, characterized in that, The step of using a subset of training samples whose number is less than the first preset threshold as the second target subset includes: The subset of training samples whose number is less than the first preset threshold and whose minimum heart rate is greater than the first preset heart rate is taken as the second target subset.
3. The method according to claim 1, characterized in that, The step of using a subset of training samples whose number is less than the first preset threshold as the second target subset includes: The subset of training samples whose number is less than the first preset threshold and whose maximum heart rate is less than the second preset heart rate is taken as the second target subset.
4. The method according to claim 2 or 3, characterized in that, After training the heart rate detection algorithm model using the target sample set, the method further includes: Multiple heart rate detections were performed using the aforementioned heart rate detection algorithm model to obtain multiple heart rate detection results. Obtain the first percentage of abnormal heart rate detection results among the multiple heart rate detection results, wherein the abnormal heart rate detection results are heart rate detection results with a heart rate less than the second preset heart rate or a heart rate greater than the first preset heart rate; Determine whether the first quantity percentage falls within a first preset range. If the first quantity percentage exceeds the first preset range, adjust the number of the first samples according to the first quantity percentage and retrain the heart rate detection algorithm model.
5. The method according to claim 1, characterized in that, Before adding the second sample to the training sample set, the method further includes: The first samples are removed from the training sample set.
6. The method according to claim 1, characterized in that, The step of obtaining a plurality of training samples from the first target subset as the first sample includes: Calculate the average number of training samples across multiple first target subsets; The first sample is obtained from the first target subset where the number of training samples is greater than the average number.
7. A model training device, characterized in that, Used for training the heart rate detection algorithm model, including: A sample acquisition module is used to acquire a training sample set, which includes multiple training samples with different heart rate sizes. A sample partitioning module is used to divide the multiple training samples according to the heart rate range to form multiple training sample subsets. The sample adjustment module is used to take a subset of training samples with a number of training samples greater than a first preset threshold as a first target subset, take a subset of training samples with a number of training samples less than the first preset threshold as a second target subset, obtain a number of training samples in the first target subset as first samples, generate a number of second samples based on the first samples, wherein the heart rate of the second samples belongs to the heart rate range corresponding to the second target subset, and add the number of second samples to the second target subset to obtain the target sample set. A model training module, which is used to train the heart rate detection algorithm model using the target sample set; The sample adjustment module is specifically used to generate several second samples based on the first sample in the following ways: Multiple first samples are concatenated to form a concatenated sample; the concatenated sample is then subjected to time-domain compression to generate the second sample; or... The first sample is segmented to form multiple segmented samples; the multiple segmented samples are then subjected to temporal stretching to generate multiple second samples.
8. An electronic device, characterized in that, include: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described in claims 1 to 7.
9. A computer storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it can implement the method as described in claims 1 to 7.
Citation Information
Patent Citations
CNN (convolutional neural network)-based electrocardiogram signal processing method and arrhythmia detection system
CN109805924A
Classification model training method, object classification method and related equipment
CN114118242A