






技术领域technical field
本发明涉及数据处理技术领域,特别涉及一种心率检测方法及装置、存储介质及电子设备。The present invention relates to the technical field of data processing, and in particular, to a heart rate detection method and device, a storage medium and an electronic device.
背景技术Background technique
精准实时的心率检测技术能够为临床医疗诊断、健康风险评估等应用提供指导,在健康监测领域具有重要意义。目前,在对用户进行心率检测时,通常会采集用户的一些生理状态信号,例如采集用户的光电容积脉搏波(Photoplethysmography,PPG)信号,然后通过信号时域上心率波峰的查找或者频域上心率谱峰的查找进行心率的检测。Accurate and real-time heart rate detection technology can provide guidance for clinical medical diagnosis, health risk assessment and other applications, and is of great significance in the field of health monitoring. At present, when detecting the user's heart rate, some physiological state signals of the user are usually collected, such as collecting the user's photoplethysmography (PPG) signal, and then searching for the heart rate peak in the signal time domain or the heart rate in the frequency domain. The search of spectral peaks is used to detect the heart rate.
然而,如果心率检测时用户处在运动中,信号中会引入运动伪影,因此在心率检测前需要进行运动伪影的去除,常用的去除运动伪影的方式有基于信号分解或者自适应滤波等降噪技术。但是,信号中引入的运动伪影通常数量较多,且信号中的运动伪影的性质复杂,在此场景下,应用现有的降噪技术无法干净的去除信号中的运动伪影,进而导致心率检测不准确。However, if the user is in motion during heart rate detection, motion artifacts will be introduced into the signal. Therefore, motion artifacts need to be removed before heart rate detection. Commonly used methods to remove motion artifacts include signal decomposition or adaptive filtering. Noise reduction technology. However, the number of motion artifacts introduced into the signal is usually large, and the nature of the motion artifacts in the signal is complex. In this scenario, the motion artifacts in the signal cannot be removed cleanly by applying the existing noise reduction technology, which leads to Heart rate detection is not accurate.
发明内容SUMMARY OF THE INVENTION
本发明所要解决的技术问题是提供一种心率检测方法,能够准确地检测出用户的心率。The technical problem to be solved by the present invention is to provide a heart rate detection method, which can accurately detect the user's heart rate.
本发明还提供了一种心率检测装置,用以保证上述方法在实际中的实现及应用。The present invention also provides a heart rate detection device to ensure the practical realization and application of the above method.
一种心率检测方法,包括:A heart rate detection method comprising:
获取待测用户的身体状态信号;Obtain the physical state signal of the user to be tested;
应用预先构建的身体状态识别模型对所述身体状态信号进行识别,获得所述待测用户的身体状态识别结果,并在所述身体状态信号的频谱中选取出预设数量的候选谱峰;Identify the body state signal by applying a pre-built body state recognition model, obtain the body state recognition result of the user to be tested, and select a preset number of candidate spectrum peaks in the spectrum of the body state signal;
利用所述身体状态识别结果对应的心率转移概率模型和各个所述候选谱峰,计算出每个所述候选谱峰的权重值;Using the heart rate transition probability model corresponding to the body state identification result and each of the candidate spectral peaks, calculate the weight value of each of the candidate spectral peaks;
将所述权重值最大的所述候选谱峰作为所述待测用户的心率检测结果。The candidate spectrum peak with the largest weight value is used as the heart rate detection result of the user to be tested.
上述的方法,可选的,所述应用预先构建的身体状态识别模型对所述身体状态信号进行识别,获得所述待测用户的身体状态识别结果,包括:In the above method, optionally, the application of a pre-built body state identification model to identify the body state signal, and obtaining the body state identification result of the user to be tested, includes:
应用预先构建的身体状态识别模型中的卷积模块对所述身体状态信号进行卷积处理,获得所述身体状态信号的卷积特征;Applying the convolution module in the pre-built body state recognition model to perform convolution processing on the body state signal to obtain the convolution feature of the body state signal;
应用所述身体状态识别模型中的时间循环神经网络对所述卷积特征进行处理,获得所述时间循环神经网络的输出;Applying the time recurrent neural network in the body state recognition model to process the convolution feature to obtain the output of the time recurrent neural network;
应用所述身体状态识别模型中的识别模块对所述时间循环神经网络的输出进行处理,获得所述待测用户的身体状态识别结果;所述身体状态识别结果为日常工作状态、运动起始状态、运动保持状态以及运动结束状态中的一种。Apply the recognition module in the body state recognition model to process the output of the time loop neural network to obtain the body state recognition result of the user to be tested; the body state recognition result is the daily work state and the exercise start state , one of the motion hold state and the motion end state.
上述的方法,可选的,构建身体状态识别模型的过程,包括:The above method, optionally, the process of constructing a body state recognition model includes:
获取训练样本集;所述训练样本集包括多个身体状态信号样本以及所述身体状态信号样本的身体状态标签;所述身体状态标签为日常工作状态标签、运动起始状态标签、运动保持状态标签以及运动结束状态标签中的一种;Obtain a training sample set; the training sample set includes a plurality of body state signal samples and body state labels of the body state signal samples; the body state labels are daily work state labels, exercise start state labels, and exercise hold state labels and one of the motion end state tags;
应用所述训练样本集中的每个身体状态信号样本以及每个所述身体状态信号样本的身体状态标签,对预设的初始身体状态识别模型进行训练;Applying each body state signal sample in the training sample set and the body state label of each of the body state signal samples to train a preset initial body state recognition model;
在所述初始身体状态识别模型满足预设的训练完成条件的情况下,将满足所述训练完成条件的所述初始身体状态识别模型确定为身体状态识别模型。When the initial body state recognition model satisfies a preset training completion condition, the initial body state recognition model that satisfies the training completion condition is determined as a body state recognition model.
上述的方法,可选的,所述在所述身体状态信号的频谱中选取出预设数量的候选谱峰,包括:In the above method, optionally, selecting a preset number of candidate spectrum peaks in the spectrum of the body state signal, including:
确定所述身体状态信号的频谱中的各个谱峰;determining individual spectral peaks in the frequency spectrum of the body state signal;
按各个所述谱峰由大至小的顺序选取预设数量的候选谱峰。A preset number of candidate spectral peaks are selected in descending order of each of the spectral peaks.
上述的方法,可选的,所述身体状态信号包括生理状态信号和运动状态信号,所述确定所述身体状态信号的频谱中的各个谱峰,包括:In the above method, optionally, the body state signal includes a physiological state signal and a movement state signal, and the determining each spectral peak in the frequency spectrum of the body state signal includes:
应用预设的联合稀疏谱估计算法对所述生理状态信号和所述运动状态信号进行处理,获得所述生理状态信号的第一频谱以及所述运动状态信号的各个通道的第二频谱;Applying a preset joint sparse spectrum estimation algorithm to process the physiological state signal and the motion state signal to obtain a first spectrum of the physiological state signal and a second spectrum of each channel of the motion state signal;
对所述第一频谱以及所述运动状态信号的各个通道的第二频谱进行归一化处理;normalizing the first frequency spectrum and the second frequency spectrum of each channel of the motion state signal;
对归一化处理后的运动状态信号的各通道的第二频谱取平均,获得所述运动状态信号的各通道的平均频谱;averaging the second spectrum of each channel of the normalized motion state signal to obtain the average spectrum of each channel of the motion state signal;
利用归一化处理后的所述第一频谱减去所述平均频谱,获得所述频谱;The spectrum is obtained by subtracting the average spectrum from the normalized first spectrum;
获取所述频谱中的各个谱峰。Obtain individual spectral peaks in the spectrum.
上述的方法,可选的,利用所述身体状态识别结果对应的心率转移概率模型和各个所述候选谱峰,计算出每个所述候选谱峰的权重值,包括:The above-mentioned method, optionally, using the heart rate transition probability model corresponding to the body state identification result and each of the candidate spectral peaks to calculate the weight value of each of the candidate spectral peaks, including:
在获取到所述身体状态信号的时刻不为初始时刻的情况下,确定所述时刻的前一时刻获取到的历史身体状态信号的每一历史候选谱峰对应的心率以及每个所述历史候选谱峰的权重值;利用所述身体状态识别结果对应的心率转移概率模型根据每个历史候选谱峰对应的心率、每个所述历史候选谱峰的权重值、每个所述候选谱峰对应的心率以及每个所述候选谱峰的幅值,计算出每个所述候选谱峰的权重值;If the moment when the body state signal is acquired is not the initial moment, determine the heart rate corresponding to each historical candidate spectrum peak of the historical body state signal acquired at the previous moment of the moment and each historical candidate The weight value of the spectral peak; the heart rate transition probability model corresponding to the physical state identification result is used according to the heart rate corresponding to each historical candidate spectral peak, the weight value of each historical candidate spectral peak, and the corresponding value of each candidate spectral peak. The heart rate and the amplitude of each of the candidate spectral peaks, calculate the weight value of each of the candidate spectral peaks;
其中,所述身体状态识别结果对应的心率转移概率模型基于所述身体状态识别结果的心率转移特征构建得到。The heart rate transition probability model corresponding to the body state identification result is constructed and obtained based on the heart rate transition feature of the body state identification result.
上述的方法,可选的,所述将所述权重值最大的所述候选谱峰作为所述待测用户的心率检测结果之后,还包括:In the above method, optionally, after the candidate spectrum peak with the largest weight value is used as the heart rate detection result of the user to be tested, the method further includes:
在预设的显示界面显示所述心率检测结果。The heart rate detection result is displayed on a preset display interface.
一种心率检测装置包括:A heart rate detection device includes:
获取单元,用于获取待测用户的身体状态信号;an acquisition unit, used to acquire the physical state signal of the user to be tested;
第一执行单元,用于应用预先构建的身体状态识别模型对所述身体状态信号进行识别,获得所述待测用户的身体状态识别结果,并在所述身体状态信号的频谱中选取出预设数量的候选谱峰;The first execution unit is used to identify the body state signal by applying a pre-built body state recognition model, obtain the body state recognition result of the user to be tested, and select a preset in the frequency spectrum of the body state signal the number of candidate peaks;
计算单元,用于利用所述身体状态识别结果对应的心率转移概率模型和各个所述候选谱峰,计算出每个所述候选谱峰的权重值;a calculation unit, configured to calculate the weight value of each of the candidate spectrum peaks by using the heart rate transition probability model corresponding to the body state identification result and each of the candidate spectrum peaks;
第二执行单元,用于将所述权重值最大的所述候选谱峰作为所述待测用户的心率检测结果。The second execution unit is configured to use the candidate spectrum peak with the largest weight value as the heart rate detection result of the user to be tested.
一种存储介质,所述存储介质包括存储指令,其中,在所述指令运行时控制所述存储介质所在的设备执行如上述的心率检测方法。A storage medium, the storage medium includes a storage instruction, wherein when the instruction is executed, a device where the storage medium is located is controlled to execute the above-mentioned heart rate detection method.
一种电子设备,包括存储器,以及一个或者一个以上的指令,其中一个或一个以上指令存储于存储器中,且经配置以由一个或者一个以上处理器执行如上述的心率检测方法。An electronic device includes a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to perform, by one or more processors, the heart rate detection method as described above.
与现有技术相比,本发明包括以下优点:Compared with the prior art, the present invention includes the following advantages:
本发明提供了一种心率检测方法及装置、存储介质及电子设备,该方法包括:获取待测用户的身体状态信号;应用预先构建的身体状态识别模型对当前时刻获取到的所述身体状态信号进行识别,获得所述待测用户的身体状态识别结果,并在当前时刻获取到的所述身体状态信号的频谱中选取出预设数量的候选谱峰;利用所述身体状态识别结果对应的心率转移概率模型和各个所述候选谱峰,计算出每个所述候选谱峰的权重值;将所述权重值最大的所述候选谱峰作为所述待测用户当前的心率检测结果。应用本发明实施例提供的方法,能够结合不同身体状态下的心率变化趋势进行心率估计,有效的提高了心率检测精度。The present invention provides a heart rate detection method and device, a storage medium and an electronic device. The method includes: acquiring a body state signal of a user to be measured; applying a pre-built body state recognition model to the body state signal acquired at the current moment Identify, obtain the body state identification result of the user to be tested, and select a preset number of candidate spectrum peaks from the spectrum of the body state signal obtained at the current moment; use the heart rate corresponding to the body state identification result The transition probability model and each of the candidate spectral peaks are used to calculate the weight value of each of the candidate spectral peaks; the candidate spectral peak with the largest weight value is used as the current heart rate detection result of the user to be tested. By applying the method provided by the embodiment of the present invention, the heart rate estimation can be performed in combination with the heart rate variation trend under different body states, which effectively improves the heart rate detection accuracy.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to the provided drawings without creative work.
图1为本发明提供的一种心率检测方法的方法流程图;Fig. 1 is a method flowchart of a heart rate detection method provided by the present invention;
图2为本发明提供的一种身体状态识别模型的结构示例图;Fig. 2 is a structural example diagram of a body state recognition model provided by the present invention;
图3为本发明提供的一种构建身体状态识别模型的过程的流程图;3 is a flowchart of a process for constructing a body state recognition model provided by the present invention;
图4为本发明提供的一种确定身体状态信号的频谱中的各个谱峰的过程的流程图;4 is a flowchart of a process for determining each spectral peak in the frequency spectrum of the body state signal provided by the present invention;
图5为本发明提供的一种心率检测过程的示例图;5 is an exemplary diagram of a heart rate detection process provided by the present invention;
图6为本发明提供的一种心率检测装置的结构示意图;6 is a schematic structural diagram of a heart rate detection device provided by the present invention;
图7为本发明提供的一种电子设备的结构示意图。FIG. 7 is a schematic structural diagram of an electronic device provided by the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
在本申请中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。In this application, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device comprising a list of elements includes not only those elements, but also no Other elements expressly listed, or which are also inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
目前,在对用户进行心率检测时,通常会采集用户的一些生理状态信号,例如采集用户的光电容积脉搏波(Photoplethysmography,PPG)信号,然后通过采集到的信号时域上心率波峰的查找或者频域上心率谱峰的查找进行心率的检测。At present, when detecting the user's heart rate, some physiological state signals of the user are usually collected, for example, the user's photoplethysmography (PPG) signal is collected, and then the heart rate peak in the time domain of the collected signal is searched or frequency. The heart rate detection is performed by searching the heart rate spectrum peaks on the domain.
然而,如果心率检测时用户处在运动中,信号中会引入运动伪影,因此在心率检测前需要进行运动伪影的去除,常用的去除运动伪影的方式有基于信号分解或者自适应滤波的降噪技术。However, if the user is in motion during heart rate detection, motion artifacts will be introduced into the signal. Therefore, motion artifacts need to be removed before heart rate detection. Commonly used methods to remove motion artifacts include signal decomposition or adaptive filtering. Noise reduction technology.
但是,经本发明人研究发现,信号中引入的运动伪影通常数量较多,且信号中的运动伪影的性质复杂,在此场景下,应用现有的降噪技术无法干净的去除信号中的运动伪影,进而导致心率检测不准确。However, the inventors have found that the motion artifacts introduced into the signal are usually large in number and the nature of the motion artifacts in the signal is complex. In this scenario, the existing noise reduction technology cannot be used to remove the signal motion artifacts, which in turn lead to inaccurate heart rate detection.
同时,当人体处于不同运动状态时,心率的变化趋势具有不同特点,例如;在日常生活状态,心率基本保持不变;在运动起始阶段,心率的变化为上升趋势;在运动保持过程中,心率的变化趋势也基本保持不变;在运动结束阶段,心率的变化为下降趋势。因此,传统的不考虑心率变化趋势的心率追踪方法在心率上升或者下降阶段会出现较大的心率估计误差。At the same time, when the human body is in different exercise states, the change trend of heart rate has different characteristics. For example, in daily life, the heart rate basically remains unchanged; in the initial stage of exercise, the change of heart rate is an upward trend; in the process of exercise maintenance, The change trend of heart rate also remained basically unchanged; at the end of the exercise, the change of heart rate showed a downward trend. Therefore, the traditional heart rate tracking method that does not consider the change trend of heart rate will have a large heart rate estimation error during the heart rate rising or falling phase.
基于此,本发明实施例提供了一种心率检测方法,该方法可以应用于电子设备,所述方法的方法流程图如图1所示,具体包括:Based on this, an embodiment of the present invention provides a heart rate detection method, which can be applied to electronic devices. The method flowchart of the method is shown in FIG. 1 , and specifically includes:
S101:获取待测用户的身体状态信号。S101: Acquire a body state signal of the user to be tested.
在本实施例中,身体状态信号可以包括生理状态信号和身体运动状态信号,具体可以通过采集设备实时采集待测用户的原始身体状态信号,然后可以采用滤波器对原始身体状态信号进行滤波,以去除原始身体状态信号中的噪声,例如可以去除原始身体状态信号中0.5Hz-4Hz之外的频率部分,滤波器可以为多阶巴特沃斯带通滤波器。In this embodiment, the body state signal may include a physiological state signal and a body motion state signal. Specifically, the original body state signal of the user to be tested may be collected in real time through a collection device, and then a filter may be used to filter the original body state signal to obtain To remove noise in the original body state signal, for example, frequency parts other than 0.5Hz-4Hz in the original body state signal may be removed, and the filter may be a multi-order Butterworth bandpass filter.
在对原始身体状态信号进行滤波后,可以调用预先设置的滑动窗,按预设的步长,从滤波后的原始身体状态信号中截取窗信号,作为身体状态信号。After filtering the original body state signal, a preset sliding window can be called, and the window signal can be intercepted from the filtered original body state signal according to a preset step size as the body state signal.
可选的,窗长可以大于步长,例如,窗长可以设置为8秒,步长可以设置为1秒。Optionally, the window length may be greater than the step length, for example, the window length may be set to 8 seconds, and the step length may be set to 1 second.
S102:应用预先构建的身体状态识别模型对所述身体状态信号进行识别,获得所述待测用户的身体状态识别结果,并在所述身体状态信号的频谱中选取出预设数量的候选谱峰。S102: Use a pre-built body state recognition model to identify the body state signal, obtain a body state identification result of the user to be tested, and select a preset number of candidate spectrum peaks from the spectrum of the body state signal .
在本实施例中,身体状态识别结果可以表征待测用户所处的状态,身体状态识别模型可以为训练好的神经网络模型,身体状态模型可以基于训练样本集训练得到;训练样本集包括历史身体状态信号以及采集所述历史身体状态信号时用户所处的状态。In this embodiment, the body state recognition result can represent the state of the user to be tested, the body state recognition model can be a trained neural network model, and the body state model can be obtained by training based on a training sample set; the training sample set includes historical physical The state signal and the state the user was in when the historical body state signal was collected.
可选的,每个候选谱峰的幅值均大于频谱中除各个候选谱峰以外的谱峰的幅值。Optionally, the amplitude of each candidate spectral peak is greater than the amplitudes of the spectral peaks other than each candidate spectral peak in the spectrum.
S103:利用所述身体状态识别结果对应的心率转移概率模型和各个所述候选谱峰,计算出每个所述候选谱峰的权重值。S103: Calculate the weight value of each candidate spectral peak by using the heart rate transition probability model corresponding to the body state identification result and each of the candidate spectral peaks.
在本实施例中,身体状态识别结果可以为预设的多种状态中的一种,不同的状态对应的心率转移概率模型可以相同或不同。In this embodiment, the body state identification result may be one of multiple preset states, and the heart rate transition probability models corresponding to different states may be the same or different.
可选的,候选谱峰的权重值可以表征候选谱峰的可信程度,权重值越高,则候选谱峰的可行程度越高。Optionally, the weight value of the candidate spectral peak may represent the credibility of the candidate spectral peak, and the higher the weight value, the higher the feasibility of the candidate spectral peak.
S104:将所述权重值最大的所述候选谱峰作为所述待测用户的心率检测结果。S104: Use the candidate spectrum peak with the largest weight value as the heart rate detection result of the user to be tested.
在本实施例中,可以将权重值最大的候选谱峰作为待测用户的心率输出。In this embodiment, the candidate spectral peak with the largest weight value may be output as the heart rate of the user to be measured.
应用本发明实施例提供的方法,能够结合不同身体状态下的心率变化趋势进行心率估计,有效的提高了心率检测精度。By applying the method provided by the embodiment of the present invention, the heart rate estimation can be performed in combination with the heart rate variation trend under different body states, which effectively improves the heart rate detection accuracy.
在本发明提供的一实施例中,基于上述的实施过程,可选的,所述应用预先构建的身体状态识别模型对所述身体状态信号进行识别,获得所述待测用户的身体状态识别结果,包括:In an embodiment provided by the present invention, based on the above-mentioned implementation process, optionally, the body state signal is identified by the application of a pre-built body state identification model, and the body state identification result of the user to be tested is obtained. ,include:
应用预先构建的身体状态识别模型中的卷积模块对所述身体状态信号进行卷积处理,获得所述身体状态信号的卷积特征;Applying the convolution module in the pre-built body state recognition model to perform convolution processing on the body state signal to obtain the convolution feature of the body state signal;
应用所述身体状态识别模型中的时间循环神经网络对所述卷积特征进行处理,获得所述时间循环神经网络的输出;Applying the time recurrent neural network in the body state recognition model to process the convolution feature to obtain the output of the time recurrent neural network;
应用所述身体状态识别模型中的识别模块对所述时间循环神经网络的输出进行处理,获得所述待测用户的身体状态识别结果;所述身体状态识别结果为日常工作状态、运动起始状态、运动保持状态以及运动结束状态中的一种。Apply the recognition module in the body state recognition model to process the output of the time loop neural network to obtain the body state recognition result of the user to be tested; the body state recognition result is the daily work state and the exercise start state , one of the motion hold state and the motion end state.
在本实施例中,所述卷积模块包括卷积提取特征网络,卷积提取特征网络可以包含多个卷积层和多个最大值池化层;时间循环神经网络可以包括多层长短期记忆网络(LSTM,Long Short-Term Memory)LSTM;识别模块可以包括多个全连接层以及输出层,输出层可以Softmax层。In this embodiment, the convolution module includes a convolution extraction feature network, and the convolution extraction feature network may include multiple convolution layers and multiple maximum pooling layers; the temporal recurrent neural network may include multiple layers of long short-term memory Network (LSTM, Long Short-Term Memory) LSTM; the recognition module can include multiple fully connected layers and an output layer, and the output layer can be a Softmax layer.
如图2所示,为本发明实施例提供的一种身体状态识别模型的结构示例图;身体状态识别模型可以包括三个卷积和最大值池化层组成的卷积提取特征网络;用于提取较长时间尺度上特征的两层LSTM网络,第一层LSTM的输出为第二层LSTM网络的输入;两个全连接层和一个Softmax层,输出维度为4的向量,每个维度对应一种状态。As shown in FIG. 2, it is a structural example diagram of a body state recognition model provided by an embodiment of the present invention; the body state recognition model may include a convolution extraction feature network composed of three convolution and maximum pooling layers; A two-layer LSTM network that extracts features on a longer time scale. The output of the first layer of LSTM is the input of the second layer of LSTM network; two fully connected layers and a Softmax layer output a vector of dimension 4, each dimension corresponds to a state.
在本发明提供的一实施例中,基于上述的实施过程,可选的,构建身体状态识别模型的过程,如图3所示,包括:In an embodiment provided by the present invention, based on the above implementation process, optionally, the process of constructing a body state recognition model, as shown in FIG. 3 , includes:
S301:获取训练样本集;所述训练样本集包括多个身体状态信号样本以及所述身体状态信号样本的身体状态标签;所述身体状态标签为日常工作状态标签、运动起始状态标签、运动保持状态标签以及运动结束状态标签中的一种。S301: Obtain a training sample set; the training sample set includes a plurality of body state signal samples and body state labels of the body state signal samples; the body state labels are daily work state labels, exercise start state labels, exercise hold state labels One of the state tags and the motion end state tags.
在本实施例中,身体状态识别模型通过在特定实验中采集的多个用户的生理状态信号和身体运动状态信号训练得到。数据采集过程中,用户需执行以下三类任务:(1)日常工作任务,例如打字、写字以及摆放质量小于1kg的物品等;(2)一定强度的运动,如慢跑、快跑、跳跃等;(3)运动后休息直到心率趋于平稳。在采集生理状态信号和身体运动状态信号的同时,同时采集用户的胸部心电图(Electrocardiogram,ECG)信号。对ECG信号做傅里叶变换,将其频谱谱峰作为用户的参考真实心率值。采集到足够的数据后,对采集到的生理状态信号和身体运动状态信号分段,将每段信号和采集信号时的身体状态相关联,制作样本集。In this embodiment, the body state recognition model is obtained by training the physiological state signals and body motion state signals of multiple users collected in a specific experiment. During the data collection process, users need to perform the following three types of tasks: (1) daily work tasks, such as typing, writing, and placing items with a mass of less than 1kg; (2) exercise of a certain intensity, such as jogging, fast running, jumping, etc. ; (3) rest until the heart rate stabilizes after exercise. While collecting the physiological state signal and the body motion state signal, the user's chest electrocardiogram (Electrocardiogram, ECG) signal is collected at the same time. Fourier transform is performed on the ECG signal, and its spectral peak is used as the user's reference real heart rate value. After collecting enough data, segment the collected physiological state signal and body motion state signal, associate each segment of signal with the body state at the time of signal collection, and make a sample set.
可选的,若用户处于非运动状态,且相对前一秒ECG心率变化值大于-4BPM(beatsperminute),则确定用户的身体状态为日常工作状态;Optionally, if the user is in a non-exercise state and the ECG heart rate change value relative to the previous second is greater than -4BPM (beatsperminute), it is determined that the user's physical state is a daily work state;
若用户处于运动状态,且相对于前一秒ECG心率变化值大于4BPM,则确定用户的身体状态为运动起始状态;If the user is in a state of exercise, and the ECG heart rate change value from the previous second is greater than 4BPM, it is determined that the user's physical state is the exercise start state;
若用户处于运动状态,且相对前一秒ECG心率变化绝对值小于4BPM,则确定用户的身体状态为运动保持状态;If the user is in a state of exercise, and the absolute value of the ECG heart rate change relative to the previous second is less than 4BPM, the user's physical state is determined to be in the state of exercise maintenance;
若用户处于非运动状态,且相对前一秒ECG心率变化值小于-4BPM,则确定用户的身体状态为运动结束状态。If the user is in a non-exercise state, and the ECG heart rate change value relative to the previous second is less than -4BPM, it is determined that the user's physical state is the exercise end state.
S302:应用所述训练样本集中的每个身体状态信号样本以及每个所述身体状态信号样本的身体状态标签,对预设的初始身体状态识别模型进行训练。S302: Apply each body state signal sample in the training sample set and the body state label of each body state signal sample to train a preset initial body state recognition model.
在本实施例中,身体状态信号样本以及身体状态信号样本的身体状态标签输入初始身体状态识别模型中,由所述初始身体状态识别模型对身体状态信号样本进行识别,得到识别结果;利用预设的损失函数基于识别结果以及身体状态标签计算出损失函数值,根据该损失函数值更新初始身体状态识别模型的网络参数,以完成对初始身体状态识别模型的训练。In this embodiment, the body state signal samples and the body state labels of the body state signal samples are input into the initial body state recognition model, and the initial body state recognition model identifies the body state signal samples to obtain the recognition result; The loss function of , calculates the loss function value based on the recognition result and the body state label, and updates the network parameters of the initial body state recognition model according to the loss function value to complete the training of the initial body state recognition model.
可选的,损失函数可以为交叉熵函数。Optionally, the loss function can be a cross-entropy function.
S303:在所述初始身体状态识别模型满足预设的训练完成条件的情况下,将满足所述训练完成条件的所述初始身体状态识别模型确定为身体状态识别模型。S303: If the initial body state recognition model satisfies a preset training completion condition, determine the initial body state recognition model that satisfies the training completion condition as a body state recognition model.
在本实施例中,训练完成条件可以是初始身体状态识别模型的损失函数收敛、初始身体状态识别模型的识别准确率大于预设的准确率阈值或者初始身体状态识别模型的训练次数大于预设的次数阈值等。In this embodiment, the training completion condition may be that the loss function of the initial body state recognition model converges, the recognition accuracy of the initial body state recognition model is greater than a preset accuracy threshold, or the number of training times of the initial body state recognition model is greater than a preset Thresholds, etc.
在本发明提供的一实施例中,基于上述的实施过程,可选的,所述在所述身体状态信号的频谱中选取出预设数量的候选谱峰,包括:In an embodiment provided by the present invention, based on the above implementation process, optionally, selecting a preset number of candidate spectrum peaks from the spectrum of the body state signal includes:
确定所述身体状态信号的频谱中的各个谱峰;determining individual spectral peaks in the frequency spectrum of the body state signal;
按各个所述谱峰由大至小的顺序选取预设数量的候选谱峰。A preset number of candidate spectral peaks are selected in descending order of each of the spectral peaks.
在本实施例中,可以从频谱中查找出三个最大的谱峰作为候选谱峰,分别记录它们的幅值和对应心率In this embodiment, the three largest spectral peaks can be found from the spectrum as candidate spectral peaks, and their amplitudes are recorded respectively and the corresponding heart rate
在本发明提供的一实施例中,基于上述的实施过程,可选的,所述身体状态信号包括生理状态信号和运动状态信号,所述确定所述身体状态信号的频谱中的各个谱峰的过程,如图4所示,可以包括:In an embodiment provided by the present invention, based on the above-mentioned implementation process, optionally, the body state signal includes a physiological state signal and a movement state signal, and the determining the value of each spectral peak in the spectrum of the body state signal The process, shown in Figure 4, can include:
S401:应用预设的联合稀疏谱估计算法对所述生理状态信号和所述运动状态信号进行处理,获得所述生理状态信号的第一频谱以及所述运动状态信号的各个通道的第二频谱。S401: Process the physiological state signal and the motion state signal by applying a preset joint sparse spectrum estimation algorithm to obtain a first spectrum of the physiological state signal and a second spectrum of each channel of the motion state signal.
在本实施例中,生理状态信号可以为PPG信号,运动状态信号可以为加速度(Acceleration,ACC)信号,生理状态信号可以为单通道信号,运动状态信号可以为三通道信号。In this embodiment, the physiological state signal may be a PPG signal, the exercise state signal may be an acceleration (Acceleration, ACC) signal, the physiological state signal may be a single-channel signal, and the exercise state signal may be a three-channel signal.
可选的,联合稀疏谱估计算法可以表示为如下公式:Optionally, the joint sparse spectral estimation algorithm can be expressed as the following formula:
其中,X是生理状态信号和身体运动状态信号通过行拼接组成的矩阵信号,该矩阵信号的大小可以为200*4,φ是DFT逆变换矩阵,该DFT逆变换矩阵的大小可以为200*1000,λ和p是控制频谱稀疏性的参数,通常选取为λ=0.0001,p=0.9,tr是矩阵的迹,Y是等式右边函数的可变变量,通过使等式右边函数值最小得到是得到的生理状态信号和身体运动状态信号的频谱。Among them, X is the matrix signal composed of the physiological state signal and the body motion state signal by row splicing, the size of the matrix signal can be 200*4, φ is the DFT inverse transformation matrix, the size of the DFT inverse transformation matrix can be 200*1000 , λ and p are the parameters to control the spectral sparsity, usually selected as λ=0.0001, p=0.9, tr is the trace of the matrix, Y is the variable variable of the function on the right side of the equation, which is obtained by minimizing the value of the function on the right side of the equation is the spectrum of the obtained physiological state signal and body motion state signal.
S402:对所述第一频谱以及所述运动状态信号的各个通道的第二频谱进行归一化处理。S402: Perform normalization processing on the first frequency spectrum and the second frequency spectrum of each channel of the motion state signal.
在本实施例中,可以对生理状态信号的第一频谱和运动状态信号的频谱进行归一化,使方差为1。In this embodiment, the first frequency spectrum of the physiological state signal and the frequency spectrum of the motion state signal may be normalized so that the variance is 1.
S403:对归一化处理后的运动状态信号的各通道的第二频谱取平均,获得所述运动状态信号的各通道的平均频谱。S403: Average the second frequency spectrum of each channel of the normalized motion state signal to obtain an average frequency spectrum of each channel of the motion state signal.
S404:利用归一化处理后的所述第一频谱减去所述平均频谱,获得频谱。S404: Subtract the average spectrum from the normalized first spectrum to obtain a spectrum.
在本实施例中,可以用归一化处理后的生理状态信号减去各通道的运动状态信号的平均频谱,将相减后小于零的值设置为零,获得身体状态信号的频谱。In this embodiment, the average spectrum of the motion state signal of each channel can be subtracted from the normalized physiological state signal, and the value less than zero after the subtraction is set to zero to obtain the spectrum of the body state signal.
S405:获取所述频谱中的各个谱峰。S405: Acquire each spectral peak in the frequency spectrum.
在本发明提供的一实施例中,基于上述的实施过程,可选的,利用所述身体状态识别结果对应的心率转移概率模型和各个所述候选谱峰,计算出每个所述候选谱峰的权重值,包括:In an embodiment provided by the present invention, based on the above implementation process, optionally, each of the candidate spectral peaks is calculated by using the heart rate transition probability model corresponding to the body state identification result and each of the candidate spectral peaks The weight value of , including:
在获取到所述身体状态信号的时刻不为初始时刻的情况下,确定所述时刻的前一时刻获取到的历史身体状态信号的每一历史候选谱峰对应的心率以及每个所述历史候选谱峰的权重值;利用所述身体状态识别结果对应的心率转移概率模型根据每个历史候选谱峰对应的心率、每个历史候选谱峰的权重值、每个所述候选谱峰对应的心率以及每个所述候选谱峰的幅值,计算出每个所述候选谱峰的权重值;If the moment when the body state signal is acquired is not the initial moment, determine the heart rate corresponding to each historical candidate spectrum peak of the historical body state signal acquired at the previous moment of the moment and each historical candidate The weight value of the spectral peak; the heart rate corresponding to each historical candidate spectral peak, the weight value of each historical candidate spectral peak, the heart rate corresponding to each of the candidate spectral peaks are based on the heart rate transition probability model corresponding to the physical state identification result and the amplitude of each of the candidate spectral peaks, calculate the weight value of each of the candidate spectral peaks;
其中,所述身体状态识别结果对应的心率转移概率模型基于所述身体状态识别结果的心率转移特征构建得到。The heart rate transition probability model corresponding to the body state identification result is constructed and obtained based on the heart rate transition feature of the body state identification result.
在本实施例中,在所述获取到所述身体状态信号的时刻为初始时刻的情况下,将每个所述候选谱峰的幅值作为每个所述候选谱峰的权重值。In this embodiment, when the time when the body state signal is acquired is the initial time, the amplitude of each of the candidate spectral peaks is used as the weight value of each of the candidate spectral peaks.
在本实施例中,获取到所述身体状态信号的时刻即为当前时刻,若当前的时刻不是初始时刻,则利用前一时刻的三个谱峰的对应心率权重和当前时刻三个谱峰的对应心率幅值计算当前时刻三个谱峰的权重计算公式如下:In this embodiment, the moment when the body state signal is acquired is the current moment. If the current moment is not the initial moment, the heart rate corresponding to the three spectral peaks at the previous moment is used. Weights and the corresponding heart rate of the three spectral peaks at the current moment Amplitude Calculate the weights of the three spectral peaks at the current moment Calculated as follows:
其中,表示心率由所述时刻的上一时刻转移到所述时刻的转移概率函数。谱峰权重的计算考虑了两个因素:(1)当前谱峰的幅值。谱峰幅值越大,谱峰为真实心率的可能性越大;(2)上一时刻谱峰的权重和转移到当前谱峰的概率。符合心率变化趋势的谱峰为真实心率的可能性越大。in, Indicates that the heart rate is determined by the previous moment of the moment transfer to the moment The transition probability function of . The calculation of the spectral peak weight considers two factors: (1) the amplitude of the current spectral peak. The greater the amplitude of the spectral peak, the greater the possibility that the spectral peak is the real heart rate; (2) the weight of the spectral peak at the previous moment and the probability of shifting to the current spectral peak. The higher the probability that the spectral peak that matches the heart rate variation trend is the true heart rate.
保存当前时刻的谱峰权重,以用于下一时刻的计算,并选取三个谱峰中权重最大的谱峰作为当前时刻的心率输出。The spectral peak weight at the current moment is saved for the calculation of the next moment, and the spectral peak with the largest weight among the three spectral peaks is selected as the heart rate output at the current moment.
在本发明提供的一实施例中,可以设转移概率函数P(y|x)=P(HRt=y│HRt-1=x)表示当t-1时刻心率为x时,t时刻心率为y的概率,sgn为符号函数。根据不同身体状态下的心率变化特点,可按以下公式定义不同身体状态下的心率转移概率模型。In an embodiment provided by the present invention, the transition probability function P(y|x)=P(HRt =y│HRt-1 =x) can be set to indicate that when the heart rate at time t-1 is x, the heart rate at time t is the probability of y, and sgn is the sign function. According to the change characteristics of heart rate in different body states, the heart rate transition probability model under different body states can be defined according to the following formula.
1、日常工作状态下的心率转移概率模型为:1. The heart rate transition probability model under daily working conditions is:
在本实施例中,由于心率随时间的变化是连续的且不会发生突变,日常工作状态下,可以选取均值为0方差为10的正态分布作为描述心率变化值(y-x)的概率函数。正太分布具有对称性,符合心率上升和下降概率相等的特点,正态分布方差通过经验选取。In this embodiment, since the change of heart rate with time is continuous and does not undergo sudden change, in the daily work state, a normal distribution with a mean value of 0 and a variance of 10 can be selected as the probability function describing the heart rate change value (y-x). The normal distribution is symmetric and conforms to the characteristics of equal probability of heart rate rise and fall, and the normal distribution variance is selected through experience.
2、运动起始状态的心率转移概率模型为:2. The heart rate transition probability model of the initial state of exercise is:
在本实施例中,由于在运动起始状态下,心率趋于上升,可以选取正态分布大于0区间的函数作为描述心率变化值(y-x)的概率函数,方差设置为日常工作状态下方差的二倍。In this embodiment, since the heart rate tends to increase in the initial state of exercise, a function with a normal distribution greater than 0 interval can be selected as the probability function describing the heart rate variation value (y-x), and the variance is set to the variance of the variance in the daily working state. Twice.
3、运动保持状态的心率转移概率模型为:3. The heart rate transition probability model of the exercise holding state is:
在本实施例中,由于运动维持状态下,心率趋于不变,可以选取均值为0方差为10的正态分布作为描述心率变化值(y-x)的概率函数。In this embodiment, since the heart rate tends to remain unchanged in the exercise maintenance state, a normal distribution with a mean value of 0 and a variance of 10 can be selected as a probability function describing the heart rate variation value (y-x).
4、运动结束状态的心率转移概率模型为:4. The heart rate transition probability model of the exercise end state is:
在本实施例中,由于运动结束状态下,心率趋于下降,可以选取正态分布小于0区间的函数作为描述心率变化值(y-x)的概率函数,同时方差设置为日常工作状态下方差的二倍。In this embodiment, since the heart rate tends to decrease at the end of the exercise, a function whose normal distribution is smaller than 0 can be selected as the probability function describing the heart rate variation value (y-x), and the variance is set to be two times the variance in the daily working state. times.
本发明定义的心率转移概率模型更符合客观规律,结合此转移概率模型进行心率估计可显著克服心率变化对估计精度的影响。The heart rate transition probability model defined in the present invention is more in line with objective laws, and heart rate estimation combined with this transition probability model can significantly overcome the influence of heart rate variation on estimation accuracy.
在本发明提供的一实施例中,基于上述的实施过程,可选的,所述将所述权重值最大的所述候选谱峰作为所述待测用户的心率检测结果之后,还包括:In an embodiment provided by the present invention, based on the above implementation process, optionally, after the candidate spectrum peak with the largest weight value is used as the heart rate detection result of the user to be tested, the method further includes:
在预设的显示界面显示所述心率检测结果。The heart rate detection result is displayed on a preset display interface.
参见图5,为本发明实施例提供的一种心率检测过程的示例图,具体的,可以将嵌有反射式PPG传感器和ACC传感器的设备穿戴于手腕背部距离腕关节一指处的位置,以采集单通道PPG信号和三通道ACC信号,各通道采集频率均为25Hz。对采集到的PPG信号和ACC信号,利用4阶巴特沃斯带通滤波器进行滤波,去除信号0.5Hz-4Hz之外的频率成分。将PPG信号和ACC信号用长度为8秒的滑动窗截取窗信号,滑动窗滑动步长为1秒。根据采集到的PPG和ACC信号,采用身体状态识模型进行身体状态识别,并根据身体状态识别结果,从心率转移概率模型中选择相对应的转移概率函数P(y|x)。并在当前时刻获取到的身体状态信号的频谱中选取出预设数量的候选谱峰;该频谱可以通过谱减法获得。利用身体状态识别结果对应的心率转移概率模型和各个候选谱峰,计算出每个候选谱峰的权重值;将权重值最大的所述候选谱峰作为所述待测用户当前的心率检测结果。Referring to FIG. 5, it is an example diagram of a heart rate detection process provided by an embodiment of the present invention. Specifically, a device embedded with a reflective PPG sensor and an ACC sensor can be worn on the back of the wrist at a position one finger away from the wrist joint to Single-channel PPG signal and three-channel ACC signal were collected, and the collection frequency of each channel was 25Hz. The collected PPG signal and ACC signal are filtered by a 4th-order Butterworth band-pass filter to remove frequency components other than 0.5Hz-4Hz of the signal. The PPG signal and the ACC signal were intercepted by a sliding window with a length of 8 seconds, and the sliding window sliding step was 1 second. According to the collected PPG and ACC signals, the body state recognition model is used to identify the body state, and according to the result of the body state recognition, the corresponding transition probability function P(y|x) is selected from the heart rate transition probability model. A preset number of candidate spectrum peaks are selected from the spectrum of the body state signal acquired at the current moment; the spectrum can be obtained by spectral subtraction. Using the heart rate transition probability model corresponding to the body state identification result and each candidate spectral peak, the weight value of each candidate spectral peak is calculated; the candidate spectral peak with the largest weight value is used as the current heart rate detection result of the user to be tested.
与图1所述的方法相对应,本发明实施例还提供了一种心率检测装置,用于对图1中方法的具体实现,本发明实施例提供的心率检测装置可以应用于电子设备中,其结构示意图如图6所示,具体包括:Corresponding to the method described in FIG. 1 , an embodiment of the present invention further provides a heart rate detection device, which is used to specifically implement the method in FIG. 1 . The heart rate detection device provided by the embodiment of the present invention can be applied to electronic equipment. The schematic diagram of its structure is shown in Figure 6, which specifically includes:
获取单元601,用于获取待测用户的身体状态信号;an
第一执行单元602,用于应用预先构建的身体状态识别模型对所述身体状态信号进行识别,获得所述待测用户的身体状态识别结果,并在所述身体状态信号的频谱中选取出预设数量的候选谱峰;The
计算单元603,用于利用所述身体状态识别结果对应的心率转移概率模型和各个所述候选谱峰,计算出每个所述候选谱峰的权重值;A
第二执行单元604,用于将所述权重值最大的所述候选谱峰作为所述待测用户的心率检测结果。The
在本发明提供的一实施例中,基于上述的方案,可选的,所述第一执行单元602,被配置为:In an embodiment provided by the present invention, based on the above solution, optionally, the
应用预先构建的身体状态识别模型中的卷积模块对所述身体状态信号进行卷积处理,获得所述身体状态信号的卷积特征;Applying the convolution module in the pre-built body state recognition model to perform convolution processing on the body state signal to obtain the convolution feature of the body state signal;
应用所述身体状态识别模型中的时间循环神经网络对所述卷积特征进行处理,获得所述时间循环神经网络的输出;Applying the time recurrent neural network in the body state recognition model to process the convolution feature to obtain the output of the time recurrent neural network;
应用所述身体状态识别模型中的识别模块对所述时间循环神经网络的输出进行处理,获得所述待测用户的身体状态识别结果;所述身体状态识别结果为日常工作状态、运动起始状态、运动保持状态以及运动结束状态中的一种。Apply the recognition module in the body state recognition model to process the output of the time loop neural network to obtain the body state recognition result of the user to be tested; the body state recognition result is the daily work state and the exercise start state , one of the motion hold state and the motion end state.
在本发明提供的一实施例中,基于上述的方案,可选的,所述第一执行单元602,被配置为:In an embodiment provided by the present invention, based on the above solution, optionally, the
获取训练样本集;所述训练样本集包括多个身体状态信号样本以及所述身体状态信号样本的身体状态标签;所述身体状态标签为日常工作状态标签、运动起始状态标签、运动保持状态标签以及运动结束状态标签中的一种;Obtain a training sample set; the training sample set includes a plurality of body state signal samples and body state labels of the body state signal samples; the body state labels are daily work state labels, exercise start state labels, and exercise hold state labels and one of the motion end state tags;
应用所述训练样本集中的每个身体状态信号样本以及每个所述身体状态信号样本的身体状态标签,对预设的初始身体状态识别模型进行训练;Applying each body state signal sample in the training sample set and the body state label of each of the body state signal samples to train a preset initial body state recognition model;
在所述初始身体状态识别模型满足预设的训练完成条件的情况下,将满足所述训练完成条件的所述初始身体状态识别模型确定为身体状态识别模型。When the initial body state recognition model satisfies a preset training completion condition, the initial body state recognition model that satisfies the training completion condition is determined as a body state recognition model.
在本发明提供的一实施例中,基于上述的方案,可选的,所述第一执行单元602,包括:In an embodiment provided by the present invention, based on the above solution, optionally, the
第一确定子单元,用于确定所述身体状态信号的频谱中的各个谱峰;a first determination subunit, configured to determine each spectral peak in the frequency spectrum of the body state signal;
选取子单元,用于按各个所述谱峰由大至小的顺序选取预设数量的候选谱峰。The selection subunit is used to select a preset number of candidate spectral peaks in descending order of each of the spectral peaks.
在本发明提供的一实施例中,基于上述的方案,可选的,所述第一确定子单元,被配置为:In an embodiment provided by the present invention, based on the above solution, optionally, the first determination subunit is configured as:
应用预设的联合稀疏谱估计算法对所述生理状态信号和所述运动状态信号进行处理,获得所述生理状态信号的第一频谱以及所述运动状态信号的各个通道的第二频谱;Applying a preset joint sparse spectrum estimation algorithm to process the physiological state signal and the motion state signal to obtain a first spectrum of the physiological state signal and a second spectrum of each channel of the motion state signal;
对所述第一频谱以及所述运动状态信号的各个通道的第二频谱进行归一化处理;normalizing the first frequency spectrum and the second frequency spectrum of each channel of the motion state signal;
对归一化处理后的运动状态信号的各通道的第二频谱取平均,获得所述运动状态信号的各通道的平均频谱;averaging the second spectrum of each channel of the normalized motion state signal to obtain the average spectrum of each channel of the motion state signal;
利用归一化处理后的所述第一频谱减去所述平均频谱,获得所述频谱;The spectrum is obtained by subtracting the average spectrum from the normalized first spectrum;
获取所述频谱中的各个谱峰。Obtain individual spectral peaks in the spectrum.
在本发明提供的一实施例中,基于上述的方案,可选的,所述计算单元603,被配置为:In an embodiment provided by the present invention, based on the above solution, optionally, the
在获取到所述身体状态信号的时刻不为初始时刻的情况下,确定所述时刻的前一时刻获取到的历史身体状态信号的每一历史候选谱峰对应的心率以及每个所述历史候选谱峰的权重值;利用所述身体状态识别结果对应的心率转移概率模型根据每个历史候选谱峰对应的心率、每个历史候选谱峰的权重值、每个所述候选谱峰对应的心率以及每个所述候选谱峰的幅值,计算出每个所述候选谱峰的权重值;If the moment when the body state signal is acquired is not the initial moment, determine the heart rate corresponding to each historical candidate spectrum peak of the historical body state signal acquired at the previous moment of the moment and each historical candidate The weight value of the spectral peak; the heart rate corresponding to each historical candidate spectral peak, the weight value of each historical candidate spectral peak, the heart rate corresponding to each of the candidate spectral peaks are based on the heart rate transition probability model corresponding to the physical state identification result and the amplitude of each of the candidate spectral peaks, calculate the weight value of each of the candidate spectral peaks;
其中,所述身体状态识别结果对应的心率转移概率模型基于所述身体状态识别结果的心率转移特征构建得到。The heart rate transition probability model corresponding to the body state identification result is constructed and obtained based on the heart rate transition feature of the body state identification result.
在本发明提供的一实施例中,基于上述的方案,可选的,所述心率检测装置,还包括:显示单元,所述显示单元被配置为:In an embodiment provided by the present invention, based on the above solution, optionally, the heart rate detection device further includes: a display unit, where the display unit is configured to:
在预设的显示界面显示所述心率检测结果。The heart rate detection result is displayed on a preset display interface.
上述本发明实施例公开的心率检测装置中的各个单元和模块具体的原理和执行过程,与上述本发明实施例公开的心率检测方法相同,可参见上述本发明实施例提供的心率检测方法中相应的部分,这里不再进行赘述。The specific principles and execution processes of each unit and module in the heart rate detection device disclosed in the above embodiments of the present invention are the same as the heart rate detection methods disclosed in the above embodiments of the present invention. part, which will not be repeated here.
本发明实施例还提供了一种存储介质,所述存储介质包括存储的指令,其中,在所述指令运行时控制所述存储介质所在的设备执行上述心率检测方法。An embodiment of the present invention further provides a storage medium, where the storage medium includes stored instructions, wherein when the instructions are executed, a device where the storage medium is located is controlled to execute the above heart rate detection method.
本发明实施例还提供了一种电子设备,其结构示意图如图7所示,具体包括存储器701,以及一个或者一个以上的指令702,其中一个或者一个以上指令702存储于存储器701中,且经配置以由一个或者一个以上处理器703执行所述一个或者一个以上指令702进行以下操作:An embodiment of the present invention further provides an electronic device, the schematic structural diagram of which is shown in FIG. 7 , and specifically includes a
获取待测用户的身体状态信号;Obtain the physical state signal of the user to be tested;
应用预先构建的身体状态识别模型对所述身体状态信号进行识别,获得所述待测用户的身体状态识别结果,并在所述身体状态信号的频谱中选取出预设数量的候选谱峰;Identify the body state signal by applying a pre-built body state recognition model, obtain the body state recognition result of the user to be tested, and select a preset number of candidate spectrum peaks in the spectrum of the body state signal;
利用所述身体状态识别结果对应的心率转移概率模型和各个所述候选谱峰,计算出每个所述候选谱峰的权重值;Using the heart rate transition probability model corresponding to the body state identification result and each of the candidate spectral peaks, calculate the weight value of each of the candidate spectral peaks;
将所述权重值最大的所述候选谱峰作为所述待测用户的心率检测结果。The candidate spectrum peak with the largest weight value is used as the heart rate detection result of the user to be tested.
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。对于装置类实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. For the same and similar parts among the various embodiments, refer to each other Can. As for the apparatus type embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant part, please refer to the partial description of the method embodiment.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。Finally, it should also be noted that in this document, relational terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply these entities or that there is any such actual relationship or sequence between operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本发明时可以把各单元的功能在同一个或多个软件和/或硬件中实现。For the convenience of description, when describing the above device, the functions are divided into various units and described respectively. Of course, when implementing the present invention, the functions of each unit may be implemented in one or more software and/or hardware.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本发明可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例或者实施例的某些部分所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solutions of the present invention can be embodied in the form of software products in essence or the parts that make contributions to the prior art. The computer software products can be stored in storage media, such as ROM/RAM, magnetic disks, etc. , CD, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present invention.
以上对本发明所提供的一种心率检测方法进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The heart rate detection method provided by the present invention has been described in detail above. The principles and implementations of the present invention are described with specific examples in this paper. At the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. To sum up, the content of this description should not be construed as a limitation to the present invention. .
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210227051.2ACN114469040A (en) | 2022-03-08 | 2022-03-08 | Heart rate detection method and device, storage medium and electronic equipment |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210227051.2ACN114469040A (en) | 2022-03-08 | 2022-03-08 | Heart rate detection method and device, storage medium and electronic equipment |
| Publication Number | Publication Date |
|---|---|
| CN114469040Atrue CN114469040A (en) | 2022-05-13 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210227051.2APendingCN114469040A (en) | 2022-03-08 | 2022-03-08 | Heart rate detection method and device, storage medium and electronic equipment |
| Country | Link |
|---|---|
| CN (1) | CN114469040A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2023220894A1 (en)* | 2022-05-16 | 2023-11-23 | 北京小米移动软件有限公司 | Statistical method and apparatus for motion physiological data, device, storage medium and chip |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2004089267A (en)* | 2002-08-29 | 2004-03-25 | Ritsumeikan | Sleep depth estimation device and futon having the same |
| US20120232417A1 (en)* | 2011-03-10 | 2012-09-13 | Siemens Medical Solutions Usa, Inc. | Signal Analysis System for Heart Condition Determination |
| US20150272509A1 (en)* | 2014-03-31 | 2015-10-01 | Samsung Electronics Co., Ltd. | Diagnostic apparatus and method |
| US20160143592A1 (en)* | 2014-11-19 | 2016-05-26 | Suunto Oy | Wearable sports monitoring equipment for measuring heart rate or muscular activity and relating method |
| CN106264505A (en)* | 2016-07-21 | 2017-01-04 | 浙江师范大学 | A kind of heart rate spectral peak system of selection based on support vector machine |
| CN108629457A (en)* | 2018-05-09 | 2018-10-09 | 西南交通大学 | The method and apparatus predicted trip mode and build prediction model |
| CN109222949A (en)* | 2018-10-12 | 2019-01-18 | 杭州士兰微电子股份有限公司 | Heart rate detection method and heartbeat detection device |
| US20190059822A1 (en)* | 2017-08-22 | 2019-02-28 | Shenzhen GOODIX Technology Co., Ltd. | Heart rate detection method and apparatus, and electronic terminal thereof |
| CN109875543A (en)* | 2019-02-01 | 2019-06-14 | 电子科技大学 | Heart rate estimation method and device for wearable heart rate monitoring equipment under various fitness exercise states |
| EP3626167A1 (en)* | 2018-09-21 | 2020-03-25 | IMEC vzw | A method of generating a model for heart rate estimation from a photoplethysmography signal and a method and a device for heart rate estimation |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2004089267A (en)* | 2002-08-29 | 2004-03-25 | Ritsumeikan | Sleep depth estimation device and futon having the same |
| US20120232417A1 (en)* | 2011-03-10 | 2012-09-13 | Siemens Medical Solutions Usa, Inc. | Signal Analysis System for Heart Condition Determination |
| US20150272509A1 (en)* | 2014-03-31 | 2015-10-01 | Samsung Electronics Co., Ltd. | Diagnostic apparatus and method |
| US20160143592A1 (en)* | 2014-11-19 | 2016-05-26 | Suunto Oy | Wearable sports monitoring equipment for measuring heart rate or muscular activity and relating method |
| CN106264505A (en)* | 2016-07-21 | 2017-01-04 | 浙江师范大学 | A kind of heart rate spectral peak system of selection based on support vector machine |
| US20190059822A1 (en)* | 2017-08-22 | 2019-02-28 | Shenzhen GOODIX Technology Co., Ltd. | Heart rate detection method and apparatus, and electronic terminal thereof |
| CN108629457A (en)* | 2018-05-09 | 2018-10-09 | 西南交通大学 | The method and apparatus predicted trip mode and build prediction model |
| EP3626167A1 (en)* | 2018-09-21 | 2020-03-25 | IMEC vzw | A method of generating a model for heart rate estimation from a photoplethysmography signal and a method and a device for heart rate estimation |
| CN109222949A (en)* | 2018-10-12 | 2019-01-18 | 杭州士兰微电子股份有限公司 | Heart rate detection method and heartbeat detection device |
| CN109875543A (en)* | 2019-02-01 | 2019-06-14 | 电子科技大学 | Heart rate estimation method and device for wearable heart rate monitoring equipment under various fitness exercise states |
| Title |
|---|
| 付光明;穆平安;蒋睿杰;: "基于级联型LMS自适应滤波PPG信号心率估算", 电子测量技术, no. 22, 23 November 2019 (2019-11-23), pages 165 - 169* |
| 王群;张;刘志文;: "一种基于稀疏贝叶斯分解的抗运动干扰心率提取算法", 航天医学与医学工程, no. 06, 15 December 2017 (2017-12-15), pages 69 - 75* |
| 董腾飞: "基于心率变异性的睡眠分期方法研究及睡眠监测系统研发", 《中国优秀硕士论文全文数据库(工程科技Ⅱ辑)》, 15 January 2021 (2021-01-15), pages 030 - 240* |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2023220894A1 (en)* | 2022-05-16 | 2023-11-23 | 北京小米移动软件有限公司 | Statistical method and apparatus for motion physiological data, device, storage medium and chip |
| Publication | Publication Date | Title |
|---|---|---|
| Zhang et al. | Heart sound classification based on scaled spectrogram and partial least squares regression | |
| CN112022144B (en) | Network training method for detecting electrocardio abnormality, electrocardio abnormality early warning method and device | |
| Tazarv et al. | A deep learning approach to predict blood pressure from ppg signals | |
| US20180235487A1 (en) | Method and system for cuffless blood pressure estimation using photoplethysmogram features and pulse transit time | |
| Chen et al. | Edge2Analysis: a novel AIoT platform for atrial fibrillation recognition and detection | |
| CN111839506A (en) | Method and device for detecting mental load | |
| EP3165158B1 (en) | Signal feature extracting apparatus | |
| CN113116321A (en) | Non-invasive continuous blood pressure measuring system based on PSO-GRNN neural network | |
| Zheng et al. | Tiny-PPG: A lightweight deep neural network for real-time detection of motion artifacts in photoplethysmogram signals on edge devices | |
| Roy et al. | BePCon: A photoplethysmography-based quality-aware continuous beat-to-beat blood pressure measurement technique using deep learning | |
| John et al. | Binary classifiers for data integrity detection in wearable IoT edge devices | |
| Kumar et al. | Edge-based computation of super-resolution superlet spectrograms for real-time estimation of heart rate using an IoMT-based reference-signal-less PPG sensor | |
| Sivanjaneyulu et al. | Cnn based ppg signal quality assessment using raw ppg signal for energy-efficient ppg analysis devices in internet of medical things | |
| Zhang et al. | An Improved Real‐Time R‐Wave Detection Efficient Algorithm in Exercise ECG Signal Analysis | |
| CN114469040A (en) | Heart rate detection method and device, storage medium and electronic equipment | |
| Mesin | Heartbeat monitoring from adaptively down-sampled electrocardiogram | |
| WO2025180241A1 (en) | Method and apparatus for determining frequency, non-volatile storage medium, and computer device | |
| JP7557550B2 (en) | Systems and methods for hypertension monitoring - Patents.com | |
| CN111053552A (en) | QRS wave detection method based on deep learning | |
| Sahoo et al. | Autocorrelation and Hilbert transform-based QRS complex detection in ECG signal | |
| CN110200642A (en) | A method and terminal for measuring cognitive load and psychological stress | |
| Mansourian et al. | Fetal QRS extraction from single-channel abdominal ECG using adaptive improved permutation entropy | |
| Gawande et al. | Empirical review on heart failure detection techniques using heart sound | |
| Boulkaboul et al. | D-Resnet: Deep Resnet based approach for ECG classification | |
| Hurr et al. | Feature extraction and recognition of human physiological signals based on the convolutional neural network |
| 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 | ||
| AD01 | Patent right deemed abandoned | ||
| AD01 | Patent right deemed abandoned | Effective date of abandoning:20250408 |