CN115956924A - A method, device, electronic device and medium for processing electrocardiographic signals - Google Patents
A method, device, electronic device and medium for processing electrocardiographic signals Download PDFInfo
- Publication number
- CN115956924A CN115956924A CN202111181641.8A CN202111181641A CN115956924A CN 115956924 A CN115956924 A CN 115956924A CN 202111181641 A CN202111181641 A CN 202111181641A CN 115956924 A CN115956924 A CN 115956924A
- Authority
- CN
- China
- Prior art keywords
- electrocardiosignal
- pulse
- heart
- segment
- label
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 60
- 238000012545 processing Methods 0.000 title claims abstract description 29
- 238000001514 detection method Methods 0.000 claims abstract description 32
- 230000033764 rhythmic process Effects 0.000 claims abstract description 18
- 238000003672 processing method Methods 0.000 claims abstract description 16
- 230000002159 abnormal effect Effects 0.000 claims abstract description 13
- 238000010801 machine learning Methods 0.000 claims description 34
- 230000008569 process Effects 0.000 claims description 24
- 238000012549 training Methods 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 12
- 230000000747 cardiac effect Effects 0.000 claims description 5
- 238000000605 extraction Methods 0.000 claims description 3
- 239000012634 fragment Substances 0.000 claims 8
- 230000004927 fusion Effects 0.000 claims 1
- 230000009286 beneficial effect Effects 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 13
- 238000004422 calculation algorithm Methods 0.000 description 10
- 238000005516 engineering process Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 6
- 238000002372 labelling Methods 0.000 description 6
- 230000007246 mechanism Effects 0.000 description 6
- 230000001133 acceleration Effects 0.000 description 5
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 238000007781 pre-processing Methods 0.000 description 5
- 230000005856 abnormality Effects 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 239000011159 matrix material Substances 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 3
- 238000000718 qrs complex Methods 0.000 description 3
- 206010015856 Extrasystoles Diseases 0.000 description 2
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 2
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 2
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 2
- 230000004913 activation Effects 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 230000005189 cardiac health Effects 0.000 description 2
- 238000012937 correction Methods 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 206010003658 Atrial Fibrillation Diseases 0.000 description 1
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 208000000418 Premature Cardiac Complexes Diseases 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 208000001871 Tachycardia Diseases 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 230000019771 cognition Effects 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000004069 differentiation Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000011478 gradient descent method Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000004807 localization Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000013139 quantization Methods 0.000 description 1
- 230000006794 tachycardia Effects 0.000 description 1
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A90/00—Technologies having an indirect contribution to adaptation to climate change
- Y02A90/10—Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation
Landscapes
- Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及数据处理技术领域,尤其涉及一种心电信号处理方法、装置、电子设备及介质。The present invention relates to the field of data processing technology, and in particular to an electrocardiogram signal processing method, device, electronic equipment and medium.
背景技术Background Art
心电信号,又称心电图,是一种无创的心脏电生理活动监测技术。随着机器学习技术的发展,机器学习技术经常被用于解决心电信号的分类问题。现有的基于机器学习的心电信号自动分析技术主要分为两类:第一类基于专家知识进行心搏特征的手工提取,再基于提取的特征进行心搏的分类。具体地,常用的特征包括各个特征波段的波形,统计值,小波变换特征等等。第二类方法则是基于深度学习方法对于给定波形进行自动特征提取,基于自动提取的特征进行分类,但是心搏分类任务其实包括心搏的定位和分类两个子任务,需要先提取出心搏的位置再对其进行分类,现有的技术常常需要额外的心搏定位算法进行支持。Electrocardiogram, also known as electrocardiogram, is a non-invasive monitoring technology for cardiac electrophysiological activity. With the development of machine learning technology, machine learning technology is often used to solve the classification problem of ECG signals. Existing automatic analysis technologies of ECG signals based on machine learning are mainly divided into two categories: the first category is to manually extract heartbeat features based on expert knowledge, and then classify the heartbeat based on the extracted features. Specifically, commonly used features include waveforms of each characteristic band, statistical values, wavelet transform features, etc. The second method is to automatically extract features from a given waveform based on a deep learning method, and classify it based on the automatically extracted features. However, the heartbeat classification task actually includes two subtasks: heartbeat location and classification. The heartbeat location needs to be extracted first and then classified. Existing technologies often require additional heartbeat location algorithms for support.
现有的基于机器学习的心电信号自动分析技术存在以下几个缺点:上述第一类的方法依赖大量医学领域的专家知识,不仅需要大量的人力资源,并且分析效果局限于人类专家的认知;特征工程需要巨大的工作量来进行,很难找到最佳的特征子集;特征提取的鲁棒性不足,而且可扩展性差,对于不同的任务需要重新构建特征子集。第二类方法得益于随机梯度下降方法能够针对不同任务自动提取合适的特征,对噪声有较好的鲁棒性,但是当前的技术需要使用额外的心搏定位算法进行心搏位置的提取,耗费额外的计算量,提升应用部署难度,无法避免定位精度不高带来的误差,而且不能利用心搏之间的相关信息。The existing automatic ECG signal analysis technology based on machine learning has the following disadvantages: the first type of method mentioned above relies on a lot of expert knowledge in the medical field, which not only requires a lot of human resources, but also the analysis effect is limited to the cognition of human experts; feature engineering requires a huge workload, and it is difficult to find the best feature subset; feature extraction is not robust enough and has poor scalability, and feature subsets need to be rebuilt for different tasks. The second type of method benefits from the ability of the stochastic gradient descent method to automatically extract appropriate features for different tasks and has good robustness to noise, but the current technology requires the use of additional heartbeat location algorithms to extract the heartbeat position, which consumes additional computing power, increases the difficulty of application deployment, cannot avoid the errors caused by low positioning accuracy, and cannot use the relevant information between heartbeats.
因此,如何更快速高效地预测给定心电信号中所有心搏的位置和类别,提升心电信号处理性能,成为一个技术难题。Therefore, how to predict the location and category of all heartbeats in a given ECG signal more quickly and efficiently and improve the ECG signal processing performance has become a technical challenge.
发明内容Summary of the invention
本申请实施例提供了一种心电信号处理方法、装置、电子设备及介质,该方法能够同时进行心搏的定位和分类,并且利用心搏之间的潜在依赖关系进一步提升分类性能,有利于提高心电信号处理的准确性。The embodiments of the present application provide an electrocardiogram signal processing method, device, electronic device and medium. The method can simultaneously locate and classify heartbeats, and further improve the classification performance by utilizing the potential dependencies between heartbeats, which is beneficial to improving the accuracy of electrocardiogram signal processing.
第一方面,本发明通过本发明的一实施例提供如下技术方案:In a first aspect, the present invention provides the following technical solution through an embodiment of the present invention:
一种心电信号处理方法,包括:获取待检测的心电信号;对所述心电信号进行划分,得到多个相同长度的心电信号片段,其中,每个心电信号片段中至少包含一个心搏脉冲;分别将所述每个心电信号片段输入预先训练的检测模型,确定每个心电信号片段中每个心搏脉冲的相对位置信息,以及每个心搏脉冲的类别信息,其中,所述类别信息反映了心律异常状况。A method for processing an electrocardiogram signal comprises: obtaining an electrocardiogram signal to be detected; dividing the electrocardiogram signal to obtain a plurality of electrocardiogram signal segments of the same length, wherein each electrocardiogram signal segment contains at least one heartbeat pulse; inputting each electrocardiogram signal segment into a pre-trained detection model to determine the relative position information of each heartbeat pulse in each electrocardiogram signal segment and the category information of each heartbeat pulse, wherein the category information reflects the abnormal heart rhythm condition.
优选地,所述检测模型是按照以下步骤训练得到的:获取用于训练的初始心电信号;对所述初始心电信号进行划分,得到多个心电信号片段样本,其中,所述心电信号片段样本中至少包含一个心搏脉冲,所述心电信号片段样本的长度与所述心电信号片段的长度相等;对每个心电信号片段样本进行打标处理,获得所述每个心电信号片段样本的标签集合,其中,所述标签集合包括所述每个心电信号片段样本中每个心搏的位置标签与类别标签;基于所述心电信号片段样本与所述标签集合,对预先构建的机器学习模型进行训练,得到所述检测模型。Preferably, the detection model is trained according to the following steps: obtaining an initial ECG signal for training; dividing the initial ECG signal to obtain a plurality of ECG signal segment samples, wherein the ECG signal segment samples contain at least one heart pulse, and the length of the ECG signal segment samples is equal to the length of the ECG signal segment; labeling each ECG signal segment sample to obtain a label set for each ECG signal segment sample, wherein the label set includes a position label and a category label for each heart beat in each ECG signal segment sample; training a pre-constructed machine learning model based on the ECG signal segment samples and the label set to obtain the detection model.
优选地,所述检测模型包括:一维卷积模块、自注意力编码模块、自注意力解码模块以及全连接输出模块,将所述心电信号片段输入预先训练的检测模型,确定所述心电信号片段中每个心搏脉冲的相对位置信息,以及每个心搏脉冲的类别信息,包括:通过所述一维卷积模块对输入的心电信号片段进行特征提取;通过所述自注意力编码模块以及所述自注意力解码模块对所述一维卷积模块的输出结果进行特征提取与融合;通过所述全连接输出模块对所述自注意力解码模块输出的特征进行处理,输出所述心电信号片段中每个心搏脉冲的相对位置信息以及每个心搏脉冲的类别信息。Preferably, the detection model includes: a one-dimensional convolution module, a self-attention encoding module, a self-attention decoding module and a fully connected output module. The ECG signal segment is input into a pre-trained detection model to determine the relative position information of each heart pulse in the ECG signal segment and the category information of each heart pulse, including: extracting features of the input ECG signal segment through the one-dimensional convolution module; extracting and fusing features of the output result of the one-dimensional convolution module through the self-attention encoding module and the self-attention decoding module; processing the features output by the self-attention decoding module through the fully connected output module, and outputting the relative position information of each heart pulse in the ECG signal segment and the category information of each heart pulse.
优选地,对每个心电信号片段样本进行打标处理,包括:获取每个心电信号片段中每个心搏脉冲均具有的心搏特征点的位置;基于心搏的特征点位置与所述心搏所在心电信号片段的起始位置之间的距离,确定出每个心搏的位置标签;针对每个心电信号片段样本中的每个心博脉冲,从预设的多种心律异常类别中确定一个类别,作为该心搏脉冲的类别标签。Preferably, each ECG signal segment sample is labeled, including: obtaining the position of the heartbeat characteristic point of each heartbeat pulse in each ECG signal segment; determining the position label of each heartbeat based on the distance between the position of the heartbeat characteristic point and the starting position of the ECG signal segment where the heartbeat is located; and for each heartbeat pulse in each ECG signal segment sample, determining a category from a plurality of preset heart rhythm abnormality categories as the category label of the heartbeat pulse.
优选地,所述基于所述心电信号片段样本与所述标签集合,对预先构建的机器学习模型进行训练,包括:将所述心电信号片段样本输入所述机器学习模型,得到预测集合,所述预测集合包括输入的各心电信号片段样本中每个心搏的预测位置信息与预测类别信息;基于所述机器学习模型输出的预测集合以及所述标签集合,得出所述预测集合与所述标签集合的最佳匹配;根据所述最佳匹配结果,得出所述预测集合与所述标签集合的总损失,所述总损失包括类别损失和位置损失;基于总损失对所述机器学习模型进行训练,得到所述检测模型。Preferably, the pre-constructed machine learning model is trained based on the ECG signal segment samples and the label set, including: inputting the ECG signal segment samples into the machine learning model to obtain a prediction set, the prediction set including predicted position information and predicted category information of each heart beat in each input ECG signal segment sample; based on the prediction set output by the machine learning model and the label set, obtaining the best match between the prediction set and the label set; according to the best matching result, obtaining the total loss of the prediction set and the label set, the total loss including category loss and position loss; training the machine learning model based on the total loss to obtain the detection model.
优选地,所述基于所述机器学习模型输出的预测集合以及所述标签集合,得出所述预测集合与所述标签集合的最佳匹配,包括:依次对所述标签集合中的每一个元素与所述预测集合中的每一个元素进行匹配,得到误差最小的匹配,其中,所述匹配过程包括:将所述标签集合的相对位置信息与所述预测集合的相对位置信息进行匹配,以及将所述标签集合的类别信息与所述预测集合的类别信息进行匹配;确定所述误差最小的匹配为最佳匹配。Preferably, the prediction set based on the output of the machine learning model and the label set are used to obtain the best match between the prediction set and the label set, including: matching each element in the label set with each element in the prediction set in turn to obtain a match with minimal error, wherein the matching process includes: matching the relative position information of the label set with the relative position information of the prediction set, and matching the category information of the label set with the category information of the prediction set; determining the match with the smallest error as the best match.
优选地,所述对所述心电信号进行划分,得到多个相同长度的心电信号片段,包括:基于预设长度的滑动窗口,对所述心电信号进行划分,得到多个相同长度的心电信号片段。Preferably, dividing the ECG signal to obtain a plurality of ECG signal segments of the same length comprises: dividing the ECG signal based on a sliding window of a preset length to obtain a plurality of ECG signal segments of the same length.
第二方面,本发明通过本发明的一实施例,提供如下技术方案:In a second aspect, the present invention provides the following technical solution through an embodiment of the present invention:
一种心电信号处理装置,包括:An electrocardiogram signal processing device, comprising:
获取模块,用于获取待检测的心电信号;An acquisition module, used for acquiring the electrocardiogram signal to be detected;
划分模块,用于对所述心电信号进行划分,得到多个相同长度的心电信号片段,其中,每个心电信号片段中至少包含一个心搏脉冲;A division module, used for dividing the electrocardiogram signal to obtain a plurality of electrocardiogram signal segments of the same length, wherein each electrocardiogram signal segment contains at least one heart beat pulse;
确定模块,用于分别将所述每个心电信号片段输入预先训练的检测模型,确定每个心电信号片段中每个心搏脉冲的相对位置信息,以及每个心搏脉冲的类别信息,其中,所述类别信息反映了心律异常状况。The determination module is used to input each ECG signal segment into a pre-trained detection model to determine the relative position information of each heart beat pulse in each ECG signal segment and the category information of each heart beat pulse, wherein the category information reflects the abnormal heart rhythm condition.
第三方面,本发明通过本发明的一实施例,提供如下技术方案:In a third aspect, the present invention provides the following technical solution through an embodiment of the present invention:
一种电子设备,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现前述第一方面所述方法的步骤。An electronic device comprises: a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect when executing the program.
第四方面,本发明通过本发明的一实施例,提供如下技术方案:In a fourth aspect, the present invention provides the following technical solution through an embodiment of the present invention:
一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现前述第一方面任一项所述方法的步骤。A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method described in any one of the first aspects above.
本申请实施例中提供的一个或多个技术方案,至少具有如下技术效果或优点:One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
本发明实施例提供的一种心电信号处理方法、装置、电子设备及介质,先获取待检测的心电信号;对心电信号进行划分,得到多个相同长度的心电信号片段,其中,每个心电信号片段中至少包含一个心搏脉冲;分别将每个心电信号片段输入预先训练的检测模型,确定每个心电信号片段中每个心搏脉冲的相对位置信息,以及每个心搏脉冲的类别信息,其中,类别信息反映了心律异常状况。从而通过将经过划分处理的心电信号,输入预先训练的检测模型中,得到每个心电信号片段中每个心搏脉冲的相对位置信息以及类别信息。该方法能够端到端地同时预测待检测的心电信号中所有心搏的位置和类别,不需额外的心搏定位算法的支持,可以减少计算量,降低应用部署的复杂度。并且由于能够处理包含多个心搏的心电信号,同时计算出整个心电信号中所有心搏的位置和类别,因此,能够获取各心搏之间的潜在依赖关系,并利用该潜在依赖关系进一步提升心搏分类的准确性,有利于提高心电信号处理的准确性。An ECG signal processing method, device, electronic device and medium provided by an embodiment of the present invention first obtain an ECG signal to be detected; divide the ECG signal to obtain multiple ECG signal segments of the same length, wherein each ECG signal segment contains at least one heartbeat pulse; input each ECG signal segment into a pre-trained detection model to determine the relative position information of each heartbeat pulse in each ECG signal segment, as well as the category information of each heartbeat pulse, wherein the category information reflects the abnormal heart rhythm condition. Thus, by inputting the divided ECG signal into the pre-trained detection model, the relative position information and category information of each heartbeat pulse in each ECG signal segment are obtained. This method can simultaneously predict the position and category of all heartbeats in the ECG signal to be detected end-to-end, without the support of an additional heartbeat positioning algorithm, and can reduce the amount of calculation and the complexity of application deployment. And because it can process ECG signals containing multiple heartbeats and simultaneously calculate the positions and categories of all heartbeats in the entire ECG signal, it is possible to obtain the potential dependencies between the heartbeats and use the potential dependencies to further improve the accuracy of heartbeat classification, which is beneficial to improving the accuracy of ECG signal processing.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
图1为本发明实施例提供的心电信号处理方法的流程图;FIG1 is a flow chart of an electrocardiogram signal processing method provided by an embodiment of the present invention;
图2为本发明实施例提供的心电信号片段的划分的示意图;FIG2 is a schematic diagram of the division of ECG signal segments provided by an embodiment of the present invention;
图3为本发明实施例提供的机器学习模型的结构示意图;FIG3 is a schematic diagram of the structure of a machine learning model provided by an embodiment of the present invention;
图4为本发明实施例提供的机器学习模型控制过程的结构示意图;FIG4 is a schematic diagram of the structure of a machine learning model control process provided by an embodiment of the present invention;
图5为本发明实施例提供的基于心电信号处理方法的检测结果示意图;FIG5 is a schematic diagram of a detection result based on an electrocardiogram signal processing method provided by an embodiment of the present invention;
图6为本发明实施例提供的心电信号处理装置的结构示意图;FIG6 is a schematic diagram of the structure of an electrocardiogram signal processing device provided by an embodiment of the present invention;
图7为本发明实施例提供的不带专用加速电路的电子设备的结构示意图;FIG7 is a schematic diagram of the structure of an electronic device without a dedicated acceleration circuit provided by an embodiment of the present invention;
图8为本发明实施例提供的带专用加速电路的电子设备的结构示意图。FIG8 is a schematic diagram of the structure of an electronic device with a dedicated acceleration circuit provided in an embodiment of the present invention.
具体实施方式DETAILED DESCRIPTION
本申请实施例通过提供了一种心电信号处理方法、装置、电子设备及介质,该方法能够同时进行心搏的定位和分类,并且利用心搏之间的潜在依赖关系进一步提升分类性能,有利于提高心电信号处理的准确性。The embodiments of the present application provide an electrocardiogram signal processing method, device, electronic device and medium. The method can simultaneously locate and classify heartbeats, and further improve the classification performance by utilizing the potential dependencies between heartbeats, which is beneficial to improving the accuracy of electrocardiogram signal processing.
本申请实施例的技术方案为解决上述技术问题,总体思路如下:The technical solution of the embodiment of the present application is to solve the above technical problems, and the overall idea is as follows:
一种心电信号处理方法,包括:获取待检测的心电信号,对所述心电信号进行划分,得到多个相同长度的心电信号片段,其中,每个心电信号片段中至少包含一个心搏脉冲;分别将所述每个心电信号片段输入预先训练的检测模型,确定每个心电信号片段中每个心搏脉冲的位置标签,以及每个心搏脉冲的类别标签,其中,所述类别标签反映了心律异常状况。A method for processing an electrocardiogram signal comprises: obtaining an electrocardiogram signal to be detected, dividing the electrocardiogram signal to obtain a plurality of electrocardiogram signal segments of the same length, wherein each electrocardiogram signal segment contains at least one heartbeat pulse; inputting each electrocardiogram signal segment into a pre-trained detection model, respectively, determining a position label of each heartbeat pulse in each electrocardiogram signal segment, and a category label of each heartbeat pulse, wherein the category label reflects the abnormal heart rhythm condition.
为了更好的理解上述技术方案,下面将结合说明书附图以及具体的实施方式对上述技术方案进行详细的说明。In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
需要说明的是,本申请实施例提供的心电信号处理方法适用于智能手表、智能手环等可穿戴设备上,以用于对人的心脏健康状态进行实时监测。另外,本申请中的心搏脉冲表示心律的波动,一个心搏表示心律的一次波动。It should be noted that the ECG signal processing method provided in the embodiment of the present application is applicable to wearable devices such as smart watches and smart bracelets for real-time monitoring of a person's heart health status. In addition, the heartbeat pulse in the present application represents the fluctuation of the heart rhythm, and one heartbeat represents one fluctuation of the heart rhythm.
第一方面,本发明实施例提供的一种心电信号处理方法,具体来讲,如图1所示,所述方法包括以下步骤S101至步骤S103。In a first aspect, an embodiment of the present invention provides an electrocardiogram signal processing method. Specifically, as shown in FIG. 1 , the method includes the following steps S101 to S103 .
步骤S101,获取待检测的心电信号。Step S101, obtaining an electrocardiogram signal to be detected.
在具体实施过程中,所述心电信号中至少包含一个导联通道的心电数据,具体地,可以分别对每个导联通道的心电信号进行采集,得到原始心电信号数据。In a specific implementation process, the ECG signal includes at least ECG data of one lead channel. Specifically, the ECG signal of each lead channel can be collected separately to obtain original ECG signal data.
作为一种可选地实施例,在获取原始心电信号数据之后,还包括:对原始心电信号进行预处理,得到预处理后的心电信号。具体地,所述预处理包括降噪处理和/或数据正则化处理。本申请实施例以针对单导联通道的心电数据进行处理为例,预处理过程包括:使用高斯滤波对原始心电信号进行降噪,并进行数据正则化处理,以通过动态调整模型参数的取值来降低模型的复杂度,得到心电信息。当然,所述预处理过程还可以包括差分、移动窗口积分等。As an optional embodiment, after acquiring the original ECG signal data, it also includes: preprocessing the original ECG signal to obtain a preprocessed ECG signal. Specifically, the preprocessing includes noise reduction processing and/or data regularization processing. The embodiment of the present application takes the processing of ECG data of a single lead channel as an example. The preprocessing process includes: using Gaussian filtering to reduce the noise of the original ECG signal, and performing data regularization processing to reduce the complexity of the model by dynamically adjusting the values of the model parameters to obtain ECG information. Of course, the preprocessing process can also include differentiation, moving window integration, etc.
步骤S102,对心电信号进行划分,得到多个相同长度的心电信号片段,其中,每个心电信号片段中至少包含一个心搏脉冲。Step S102 , dividing the ECG signal to obtain a plurality of ECG signal segments of the same length, wherein each ECG signal segment contains at least one heartbeat pulse.
在具体实施例中,将待检测的心电信号划分成预设长度的若干连续的心电信号片段,包括:通过使用滑动窗口的方法进行片段的划分。In a specific embodiment, the electrocardiogram signal to be detected is divided into a plurality of continuous electrocardiogram signal segments of a preset length, including: dividing the segments by using a sliding window method.
作为一种可选地实施例,基于预设长度的滑动窗口,对心电信号进行划分,得到多个相同长度的心电信号片段。举例来说,预设长度可以为2-10秒,优选地,本申请实施例提供的预设长度为3秒。As an optional embodiment, the ECG signal is divided based on a sliding window of a preset length to obtain multiple ECG signal segments of the same length. For example, the preset length may be 2-10 seconds, and preferably, the preset length provided in the embodiment of the present application is 3 seconds.
当然,作为另一种可选地实施例,还可以通过机器裁剪的方式,将心电信号裁剪成多个相同长度的片段。Of course, as another optional embodiment, the ECG signal may be cut into multiple segments of the same length by machine cutting.
步骤S103,分别将每个心电信号片段输入预先训练的检测模型,确定每个心电信号片段中每个心搏脉冲的位置标签,以及每个心搏脉冲的类别标签,其中,所述类别标签反映了心律异常状况。举例来说,这里的类别标签可以包括:心房颤动、心动过速、异搏、早搏等。Step S103, input each ECG signal segment into a pre-trained detection model, determine the position label of each heart beat pulse in each ECG signal segment, and the category label of each heart beat pulse, wherein the category label reflects the abnormal heart rhythm condition. For example, the category label here may include: atrial fibrillation, tachycardia, ectopic beats, premature beats, etc.
在具体实施例中,所述检测模型是按照以下步骤训练得到的:获取用于训练的初始心电信号;对初始心电信号进行划分,得到多个心电信号片段样本,其中,心电信号片段样本中至少包含一个心搏脉冲,心电信号片段样本的长度与心电信号片段的长度相等;对每个心电信号片段样本进行打标处理,获得每个心电信号片段样本的标签集合,其中,标签集合包括每个心电信号片段样本中每个心搏的位置标签与类别标签;基于心电信号片段样本与所述标签集合,对预先构建的机器学习模型进行训练,得到检测模型。In a specific embodiment, the detection model is trained according to the following steps: obtaining an initial ECG signal for training; dividing the initial ECG signal to obtain a plurality of ECG signal segment samples, wherein the ECG signal segment sample contains at least one heart beat pulse, and the length of the ECG signal segment sample is equal to the length of the ECG signal segment; labeling each ECG signal segment sample to obtain a label set for each ECG signal segment sample, wherein the label set includes a position label and a category label for each heart beat in each ECG signal segment sample; training a pre-constructed machine learning model based on the ECG signal segment samples and the label set to obtain a detection model.
具体地,获取用于训练的初始心电信号之后,还包括:对所述初始心电信息进行预处理,得到预处理后的初始心电信号。再基于与待检测的心电信号相同的划分方法,得到多个心电信号片段样本。进一步地,对每个心电信号片段样本进行打标处理,获得每个心电信号片段样本的标签集合。Specifically, after obtaining the initial ECG signal for training, the method further includes: preprocessing the initial ECG information to obtain the preprocessed initial ECG signal. Then, based on the same division method as the ECG signal to be detected, a plurality of ECG signal segment samples are obtained. Furthermore, each ECG signal segment sample is labeled to obtain a label set of each ECG signal segment sample.
在具体实施例中,所述对每个心电信号片段样本进行打标处理,包括:获取每个心电信号片段中每个心搏脉冲均具有的心搏特征点的位置;基于心搏的特征点位置与所述心搏所在心电信号片段的起始位置之间的距离,确定出每个心搏的位置标签。In a specific embodiment, the labeling process for each ECG signal segment sample includes: obtaining the position of the heartbeat characteristic point of each heartbeat pulse in each ECG signal segment; and determining the position label of each heartbeat based on the distance between the position of the heartbeat characteristic point and the starting position of the ECG signal segment where the heartbeat is located.
具体地,可以通过QRS波群识别算法识别出心电信号中每个心搏的位置,将描述心搏位置的至少一个特征点相对于心搏所在的心电片段的起始位置之间的距离,归一化到0到1之间,将归一化后的距离数据作为心搏的位置标签。Specifically, the position of each heartbeat in the ECG signal can be identified through the QRS complex recognition algorithm, and the distance between at least one characteristic point describing the heartbeat position and the starting position of the ECG segment where the heartbeat is located is normalized to between 0 and 1, and the normalized distance data is used as the position label of the heartbeat.
举例来说,如图2所示,本申请实施例选择每个心搏脉冲和前后相邻两个心搏脉冲的切分点作为两个特征点,即图中L10为心搏脉冲的一个相邻的切分点,L11为心搏脉冲的另一个相邻的切分点。具体地,所述相邻心搏之间切分点Si定义为:Si=α×Pi-1+(1-α)×Pi,其中,Pi-1与Pi分别为相邻两个心搏QRS波群中R波的波峰位置,可以通过QRS波群识别算法或人工标注得到;α是预设的超参数,范围取0到1之间,在本实施例中设定为0.4。将所述特征点与心搏所在的心电片段的起始位置之间的距离,作为心搏的位置标签。For example, as shown in FIG2 , the embodiment of the present application selects each heartbeat pulse and the dividing point of the two adjacent heartbeat pulses as two feature points, that is, L10 in the figure is an adjacent dividing point of the heartbeat pulse, and L11 is another adjacent dividing point of the heartbeat pulse. Specifically, the dividing point S i between adjacent heartbeats is defined as: S i = α×P i-1 +(1-α)×P i , wherein P i-1 and P i are the peak positions of the R waves in the two adjacent heartbeat QRS complexes, respectively, which can be obtained by the QRS complex recognition algorithm or manual annotation; α is a preset hyperparameter, ranging from 0 to 1, and is set to 0.4 in this embodiment. The distance between the feature point and the starting position of the ECG segment where the heartbeat is located is used as the position label of the heartbeat.
在具体实施例中,所述对每个心电信号片段样本进行打标处理,还包括:针对每个心电信号片段样本中的每个心博脉冲,从预设的多种心律异常类别中确定一个类别,作为该心搏脉冲的类别标签。In a specific embodiment, the labeling process for each ECG signal segment sample further includes: for each heartbeat pulse in each ECG signal segment sample, determining a category from a plurality of preset heart rhythm abnormality categories as a category label for the heartbeat pulse.
具体地,获取每个心电信号片段样本中的每个心博脉冲的类别特征点,基于类别特征点,对每个心搏脉冲进行标注,确定心搏脉冲的类别。当然,也可以接收通过人工从预设的多种心律异常类别中选取至少一个标签,作为心搏的类别标签。Specifically, the category feature points of each heartbeat pulse in each ECG signal segment sample are obtained, and each heartbeat pulse is labeled based on the category feature points to determine the category of the heartbeat pulse. Of course, at least one label can also be manually selected from a plurality of preset heart rhythm abnormality categories as the category label of the heartbeat.
进一步,所述基于心电信号片段样本与标签集合,对预先构建的机器学习模型进行训练,可以包括:将心电信号片段样本输入机器学习模型,得到预测集合,预测集合包括输入的各心电信号片段样本中每个心搏的预测位置信息与预测类别信息;基于机器学习模型输出的预测集合以及标签集合,得出预测集合与标签集合的最佳匹配;根据最佳匹配结果,得出预测集合与标签集合的总损失,总损失包括类别损失和位置损失;基于总损失对机器学习模型进行训练,得到检测模型。Furthermore, the training of a pre-constructed machine learning model based on the ECG signal segment samples and the label set may include: inputting the ECG signal segment samples into the machine learning model to obtain a prediction set, the prediction set including the predicted position information and predicted category information of each heart beat in each input ECG signal segment sample; based on the prediction set and the label set output by the machine learning model, obtaining the best match between the prediction set and the label set; according to the best matching result, obtaining the total loss of the prediction set and the label set, the total loss including the category loss and the position loss; and training the machine learning model based on the total loss to obtain a detection model.
具体地,所述基于机器学习模型输出的预测集合以及标签集合,得出预测集合与标签集合的最佳匹配,具体包括:Specifically, the prediction set and label set outputted by the machine learning model are used to obtain the best match between the prediction set and the label set, including:
依次对标签集合中的每一个元素与预测集合中的每一个元素进行匹配,得到误差最小的匹配,其中,匹配过程包括:将标签集合的相对位置信息与预测集合的相对位置信息进行匹配,以及将标签集合的类别信息与预测集合的类别信息进行匹配;确定误差最小的匹配为最佳匹配。Match each element in the label set with each element in the prediction set in turn to obtain a match with the smallest error, wherein the matching process includes: matching the relative position information of the label set with the relative position information of the prediction set, and matching the category information of the label set with the category information of the prediction set; determining the match with the smallest error as the best match.
具体而言,计算出预测集合与标签集合两个集合中每两个元素匹配带来的综合误差,综合误差由位置误差和类别误差线性组合得到:Specifically, the comprehensive error caused by matching every two elements in the prediction set and the label set is calculated. The comprehensive error is obtained by linearly combining the position error and the category error:
其中,代表i元素和j元素匹配带来的位置误差,本实施例中选择L1损失作为位置误差,代表i元素和j元素匹配带来的类别误差,其中i元素来自预测集合,j元素来自标签集合。in, represents the position error caused by the matching of the i element and the j element. In this embodiment, the L1 loss is selected as the position error. Represents the category error caused by the matching of element i and element j, where element i comes from the prediction set and element j comes from the label set.
再基于综合误差计算出使得匹配误差最小的最佳匹配。举例来说,本实施例使用匈牙利算法计算最佳匹配。Then, the best match that minimizes the matching error is calculated based on the comprehensive error. For example, this embodiment uses the Hungarian algorithm to calculate the best match.
需要说明的是,当机器学习模型输出预设数目的心搏位置信息和类别预测信息集合,这一预设数目往往不小于心电信号片段样本中可能出现的最大心搏数目,以使得每个心电信号片段样本标签集合中的元素都对应有一个预测集合中的元素。举例来说,本实施例中预设数目为8,标签集合中一个心电信号片段所包含心搏的最多数目为8。It should be noted that when the machine learning model outputs a preset number of heartbeat position information and category prediction information sets, this preset number is often not less than the maximum number of heartbeats that may appear in the ECG signal segment sample, so that each element in the ECG signal segment sample label set corresponds to an element in the prediction set. For example, in this embodiment, the preset number is 8, and the maximum number of heartbeats contained in an ECG signal segment in the label set is 8.
另外,在进行匹配过程中,输出的类别除了预设的多个心律异常类别以外,还包括一个额外的无目标类,即在检测到的位置没有心搏波形出现。然后计算出预测集合和标签集合的一个最佳匹配。In addition, during the matching process, the output categories include an additional no-target category in addition to the preset multiple abnormal heart rhythm categories, that is, no heartbeat waveform appears at the detected location. Then, the best match between the prediction set and the label set is calculated.
进一步地,根据最佳匹配结果,得出预测集合与标签集合的总损失,包括:通过线性组合共同组成总损失:Furthermore, based on the best matching result, the total loss of the prediction set and the label set is obtained, including: the total loss is formed by linear combination:
Ltotal=λl1Ll1+λgiouLgiou+λclassLclass L total =λ l1 L l1 +λ giou L giou +λ class L class
其中,本申请实施例使用KL散度作为类别损失Lclass,Ll1为L1正则化损失,Lgiou为自定义的一维扩展交并比损失。In this embodiment of the present application, KL divergence is used as the class loss L class , L l1 is the L1 regularization loss, and L giou is a customized one-dimensional extended intersection-over-union loss.
优选地,本实施例将Ll1与Lgiou共同作为位置损失,分别定义为:Preferably, in this embodiment, L l1 and L giou are used together as position loss, and are defined as:
Ll1(Dp,Dgt)=||bp-bgt||1 L l1 (D p ,D gt )=||b p -b gt || 1
其中,Dgt为标签集合中的元素,Dp为与标签集合中的元素相匹配的预测集合中的元素,bgt和bp分别代表本实施例定义的两个特征点覆盖的区间,A函数为覆盖两个区间所需要的最小区间长度,δ为一个极小的常量。Wherein, D gt is an element in the label set, D p is an element in the prediction set that matches the element in the label set, b gt and b p respectively represent the intervals covered by the two feature points defined in this embodiment, A function is the minimum interval length required to cover the two intervals, and δ is a very small constant.
得出预测集合与标签集合的总损失后,再基于反向传播算法和随机梯度下降算法使用总损失对机器学习模型进行训练,得到检测模型。After obtaining the total loss of the prediction set and the label set, the total loss is used to train the machine learning model based on the back propagation algorithm and the stochastic gradient descent algorithm to obtain the detection model.
由此,本申请将基于步骤S102得到的心电信号片段分别输入上述检测模型中,确定出每个心电信号片段中每个心搏脉冲的位置标签,以及每个心搏脉冲的类别标签。Therefore, the present application inputs the ECG signal segments obtained based on step S102 into the above detection model respectively, and determines the position label of each heart pulse in each ECG signal segment, and the category label of each heart pulse.
具体地,获取每个心电信号片段中的每个心博脉冲的类别标签,包括:当某一心搏脉冲包含多个类别标签时,对比心搏脉冲中多个类别标签的概率,将大于预设概率阈值的类别标签,作为心搏脉冲的类别标签,以此,确定出该心搏脉冲的类别。Specifically, the category label of each heart pulse in each ECG signal segment is obtained, including: when a heart pulse contains multiple category labels, the probabilities of multiple category labels in the heart pulse are compared, and the category label that is greater than a preset probability threshold is used as the category label of the heart pulse, thereby determining the category of the heart pulse.
需要说明的是,如图3所示,本申请实施例中所述的机器学习模型100可以包括:一维卷积模块102、自注意力编码模块104、自注意力解码模块105、全连接输出模块106。It should be noted that, as shown in Figure 3, the
其中,将心电信号片段输入预先训练的检测模型,确定心电信号片段中每个心搏脉冲的相对位置信息,以及每个心搏脉冲的类别信息,包括:通过一维卷积模块102对输入的心电信号片段进行特征提取;通过自注意力编码模块104以及自注意力解码模块105对第一心电信号片段进行特征提取与融合;全连接输出模块106对自注意力解码模块105输出的特征进行处理,输出心电信号片段中每个心搏脉冲的相对位置信息以及每个心搏脉冲的类别信息。Among them, the ECG signal segment is input into a pre-trained detection model to determine the relative position information of each heart pulse in the ECG signal segment and the category information of each heart pulse, including: extracting features of the input ECG signal segment through a one-
具体地,一维卷积模块102是由块结构堆叠而成的网络结构。优选地,每个块包含一个用于通道扩张的点卷积层和用于修正的激活函数,一个通道卷积层和用于修正的激活函数,一个用于通道缩减的点卷积层,一个通道注意力模块,每个块之间使用残差操作连接。Specifically, the one-
其中,自注意力编码模块104和自注意力解码模块105,用于对一维卷积层102的输出进行进一步的特征提取与融合,并且利用自注意力机制对不同区域的相互依赖信息进行提取;编码和解码层是由块结构堆叠而成的网络结构。在本实施例中,每个块包含若干个基于注意力机制的自注意力模块,用于修正的层正则化和多层感知机模块,正则化层之间使用。Among them, the self-
具体地,如图4所示,本实施例所选用的自注意力计算模块具体包括:全连接层,用于将输入的特征图映射为三组输入V,K和Q,其中K和Q依次进行矩阵乘法,缩放和softmax层,得到的输出再与V进行矩阵乘法,得到输出,使用数学公式可表达为:Specifically, as shown in FIG4 , the self-attention calculation module selected in this embodiment specifically includes: a fully connected layer for mapping the input feature map into three sets of inputs V, K and Q, wherein K and Q are sequentially subjected to matrix multiplication, scaling and softmax layers, and the obtained output is then matrix multiplied with V to obtain the output, which can be expressed as follows using a mathematical formula:
其中dk代表K矩阵的列数。Where d k represents the number of columns of the K matrix.
进一步地,本申请描述的机器学习模型还包括位置编码模块103,由于基于自注意力机制的编码模块104和解码模块105无法获知输入中序列顺序的影响,但是序列的顺序能够帮助模型进行更高精度的心电信号检测,实现更高精度的心电信息处理。因为根据统计,异常心搏出现的一段时间内有更高的概率出现异常心搏。所以在本实施例中提供一个使用一个常用的正余弦位置编码模块103提供位置编码信息,该位置编码和一维卷积模块输出的特征图大小相同,相加后作为输入提供给编码模块,位置编码定义为:Furthermore, the machine learning model described in the present application also includes a
其中,dmodel为机器学习模型的一个超参数,用于控制中间计算结果的形状大小。Among them, d model is a hyperparameter of the machine learning model, which is used to control the shape and size of the intermediate calculation results.
其中,全连接输出模块106,用于对基于自注意力机制的解码层105输出的特征进行处理,输出固定个数的心搏的相对位置信息和类别概率预测,不同位置权值共享。除了预设的N个分类,还包括无目标类的预测,代表目标检测区域中没有检测到心搏波形。Among them, the fully connected
具体地,在本实施例中,使用两个公用的全连接层对所述基于自注意力机制的解码模块的所有输出进行处理,分别输出预测类别的概率以及心搏的位置特征点的回归值。Specifically, in this embodiment, two common fully connected layers are used to process all outputs of the decoding module based on the self-attention mechanism, and the probability of the predicted category and the regression value of the position feature point of the heartbeat are output respectively.
如图5所示,为基于心电信号处理方法的检测结果,横坐标表示时间,纵坐标表示心律强度,图中标注的N、S、V和F为心搏的类别,本实施例参考美国医疗仪器促进协会AAMI提出的标准来进行心搏的分类,可见每个心搏都同时检测出了其位置与类别。As shown in FIG5 , it is the detection result based on the electrocardiogram signal processing method. The horizontal axis represents time, the vertical axis represents heart rhythm intensity, and N, S, V and F marked in the figure are the categories of heartbeats. This embodiment classifies heartbeats with reference to the standards proposed by the American Association for the Advancement of Medical Instrumentation (AAMI). It can be seen that the position and category of each heartbeat are detected at the same time.
本申请提供的心电信号处理方法能够端到端地同时预测给定心电信号中所有心搏的位置和类别,不需额外的心搏定位算法的支持,可以减少计算量,降低应用部署的复杂度,此外,模型通过随机梯度下降算法进行训练,同时用定位损失和分类损失来优化机器学习模型,能够减少因为定位不准确带来的分类性能损失,而且能够针对不同任务需求,自动提取适合该任务的特征。The ECG signal processing method provided in the present application can simultaneously predict the positions and categories of all heartbeats in a given ECG signal in an end-to-end manner without the support of an additional heartbeat localization algorithm, which can reduce the amount of calculation and the complexity of application deployment. In addition, the model is trained through a stochastic gradient descent algorithm, and the positioning loss and classification loss are used to optimize the machine learning model, which can reduce the classification performance loss caused by inaccurate positioning, and can automatically extract features suitable for the task according to different task requirements.
另外,本申请提供的心电信号处理方法能够处理包含多个心搏的心电信号,一次前递推理运算能够同时计算出整个心电信号中所有心搏的位置和类别,并且通过自注意力机制利用这些心搏之间的潜在依赖关系进一步提升心搏分类的准确性。In addition, the ECG signal processing method provided in the present application can process ECG signals containing multiple heartbeats. A forward reasoning operation can simultaneously calculate the positions and categories of all heartbeats in the entire ECG signal, and further improve the accuracy of heartbeat classification by utilizing the potential dependencies between these heartbeats through the self-attention mechanism.
综上所述,通过本发明实施例提供的心电信号处理方法,能够同时进行心搏的定位和分类,并且利用心搏之间的潜在依赖关系进一步提升分类性能,有利于提高心电信号处理的准确性。In summary, the ECG signal processing method provided by the embodiment of the present invention can simultaneously locate and classify heartbeats, and further improve the classification performance by utilizing the potential dependency between heartbeats, which is beneficial to improving the accuracy of ECG signal processing.
第二方面,基于同一发明构思,本实施例提供了一种心电信号处理装置,如图6所示,包括:In the second aspect, based on the same inventive concept, this embodiment provides an electrocardiogram signal processing device, as shown in FIG6 , comprising:
获取模块401,用于获取待检测的心电信号;An
划分模块402,用于对心电信号进行划分,得到多个相同长度的心电信号片段,其中,每个心电信号片段中至少包含一个心搏脉冲;A
确定模块403,用于分别将每个心电信号片段输入预先训练的检测模型,确定每个心电信号片段中每个心搏脉冲的相对位置信息,以及每个心搏脉冲的类别信息,其中,类别信息反映了心律异常状况。The
作为一种可选的实施例,所述确定模块403,具体包括:As an optional embodiment, the determining
获取子模块,用于获取用于训练的初始心电信号;An acquisition submodule, used for acquiring an initial ECG signal for training;
划分子模块,用于对初始心电信号进行划分,得到多个心电信号片段样本,其中,心电信号片段样本中至少包含一个心搏脉冲,心电信号片段样本的长度与心电信号片段的长度相等;A division submodule, used for dividing the initial ECG signal to obtain a plurality of ECG signal segment samples, wherein the ECG signal segment samples contain at least one heart beat pulse, and the length of the ECG signal segment samples is equal to the length of the ECG signal segment;
打标处理子模块,用于对每个心电信号片段样本进行打标处理,获得每个心电信号片段样本的标签集合,其中,标签集合包括所述每个心电信号片段样本中每个心搏的位置标签与类别标签;A labeling processing submodule is used to label each ECG signal segment sample to obtain a label set for each ECG signal segment sample, wherein the label set includes a position label and a category label for each heart beat in each ECG signal segment sample;
训练子模块,用于基于心电信号片段样本与所述标签集合,对预先构建的机器学习模型进行训练,得到检测模型。The training submodule is used to train a pre-built machine learning model based on the ECG signal segment samples and the label set to obtain a detection model.
作为一种可选的实施例,所述确定模块403中的检测模型包括:一维卷积模块、自注意力编码模块、自注意力解码模块以及全连接输出模块,所述确定模块403用于:通过一维卷积模块对输入的心电信号片段进行特征提取;通过自注意力编码模块以及自注意力解码模块对一维卷积模块的输出结果进行特征提取与融合;通过全连接输出模块对所述自注意力解码模块输出的特征进行处理,输出心电信号片段中每个心搏脉冲的相对位置信息以及每个心搏脉冲的类别信息。As an optional embodiment, the detection model in the
作为一种可选的实施例,所述打标处理子模块,用于:获取每个心电信号片段中每个心搏脉冲均具有的心搏特征点的位置;基于心搏的特征点位置与所述心搏所在心电信号片段的起始位置之间的距离,确定出每个心搏的位置标签;针对每个心电信号片段样本中的每个心博脉冲,从预设的多种心律异常类别中确定一个类别,作为该心搏脉冲的类别标签。As an optional embodiment, the labeling processing submodule is used to: obtain the position of the heartbeat characteristic point of each heartbeat pulse in each ECG signal segment; determine the position label of each heartbeat based on the distance between the position of the heartbeat characteristic point and the starting position of the ECG signal segment where the heartbeat is located; and for each heartbeat pulse in each ECG signal segment sample, determine a category from a plurality of preset heart rhythm abnormality categories as the category label of the heartbeat pulse.
作为一种可选的实施例,所述训练子模块,用于:将心电信号片段样本输入机器学习模型,得到预测集合,预测集合包括输入的各心电信号片段样本中每个心搏的预测位置信息与预测类别信息;基于机器学习模型输出的预测集合以及标签集合,得出预测集合与标签集合的最佳匹配;根据最佳匹配结果,得出预测集合与标签集合的总损失,总损失包括类别损失和位置损失;基于总损失对机器学习模型进行训练,得到检测模型。As an optional embodiment, the training submodule is used to: input ECG signal segment samples into a machine learning model to obtain a prediction set, the prediction set including predicted position information and predicted category information of each heart beat in each input ECG signal segment sample; based on the prediction set and label set output by the machine learning model, obtain the best match between the prediction set and the label set; based on the best matching result, obtain the total loss of the prediction set and the label set, the total loss includes category loss and position loss; train the machine learning model based on the total loss to obtain a detection model.
作为一种可选的实施例,所述训练子模块,用于:依次对标签集合中的每一个元素与预测集合中的每一个元素进行匹配,得到误差最小的匹配,其中,匹配过程包括:将标签集合的相对位置信息与预测集合的相对位置信息进行匹配,以及将标签集合的类别信息与预测集合的类别信息进行匹配;确定误差最小的匹配为最佳匹配。As an optional embodiment, the training submodule is used to: match each element in the label set with each element in the prediction set in turn to obtain a match with the smallest error, wherein the matching process includes: matching the relative position information of the label set with the relative position information of the prediction set, and matching the category information of the label set with the category information of the prediction set; and determining the match with the smallest error as the best match.
作为一种可选的实施例,所述划分模块402,用于:控制滑动窗口对心电信号进行划分,使得滑动窗口在每一个预设时间后得到一个心电信号片段,得到多个相同长度的心电信号片段。As an optional embodiment, the
以上各模块可以是由软件代码实现,此时,上述的各模块可存储于控制设备的存储器内。以上各模块同样可以由硬件例如集成电路芯片实现。The above modules can be implemented by software codes, in which case, the above modules can be stored in the memory of the control device. The above modules can also be implemented by hardware such as integrated circuit chips.
本发明实施例所提供的一种心电信号处理装置,其实现原理及产生的技术效果和前述方法实施例相同,为简要描述,装置实施例部分未提及之处,可参考前述方法实施例中相应内容。An electrocardiogram signal processing device provided in an embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
第三方面,基于同一发明构思,本实施例提供了一种电子设备500,如图7所示,包括:存储器501、处理器502及存储在存储器上并可在处理器上运行的计算机程序503,所述处理器502执行所述程序时实现前述第一方面所述心电信号处理方法的步骤。In the third aspect, based on the same inventive concept, this embodiment provides an electronic device 500, as shown in Figure 7, comprising: a
进一步地,如图8所示,所述电子设备还包括专用加速电路504,所述专用加速电路504与处理器502连接,用于处理心电信号处理中计算密集型的任务,其中包括但不限于卷积运算,矩阵乘法运算,向量运算,指数运算,量化运算等,对这些计算任务进行硬件加速。Furthermore, as shown in FIG8 , the electronic device also includes a
该专用加速电路能够降低系统功耗与成本,使得所述方法能够部署于智能手表,智能手环等可穿戴设备上,对人的心脏健康状态进行实时监测。The dedicated acceleration circuit can reduce system power consumption and cost, so that the method can be deployed on wearable devices such as smart watches and smart bracelets to monitor a person's heart health status in real time.
第四方面,基于同一发明构思,本实施例提供了一种非临时性计算机可读存储介质,当所述存储介质中的指令由电子设备500的处理器执行时,使得电子设备500能够执行一种心电信号处理方法,包括前述第一方面中任一项所述方法的步骤。In the fourth aspect, based on the same inventive concept, this embodiment provides a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by the processor of the electronic device 500, the electronic device 500 can perform an electrocardiogram signal processing method, including the steps of any one of the methods described in the first aspect.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本发明的其它实施方案。本发明旨在涵盖本发明的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本发明的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本发明的真正范围和精神由下面的权利要求指出。Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的模块。The present invention is described with reference to the flowchart and/or block diagram of the method, device (system) and computer program product according to the embodiment of the present invention. It should be understood that each process and/or box in the flowchart and/or block diagram, as well as the combination of the process and/or box in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate a module for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令模块的制造品,该指令模块实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction module that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111181641.8A CN115956924A (en) | 2021-10-11 | 2021-10-11 | A method, device, electronic device and medium for processing electrocardiographic signals |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111181641.8A CN115956924A (en) | 2021-10-11 | 2021-10-11 | A method, device, electronic device and medium for processing electrocardiographic signals |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115956924A true CN115956924A (en) | 2023-04-14 |
Family
ID=87351564
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111181641.8A Pending CN115956924A (en) | 2021-10-11 | 2021-10-11 | A method, device, electronic device and medium for processing electrocardiographic signals |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115956924A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119138898A (en) * | 2024-11-18 | 2024-12-17 | 毕胜普生物科技有限公司 | Emotion recognition method, device, equipment and storage medium based on high-frequency electrocardiosignal |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109871742A (en) * | 2018-12-29 | 2019-06-11 | 安徽心之声医疗科技有限公司 | A kind of electrocardiosignal localization method based on attention Recognition with Recurrent Neural Network |
US20200008696A1 (en) * | 2017-03-07 | 2020-01-09 | Transformative AI Ltd | Analysis of cardiac data |
CN111310572A (en) * | 2020-01-17 | 2020-06-19 | 上海优加利健康管理有限公司 | Processing method and device for generating heart beat label sequence by utilizing heart beat time sequence |
CN111772619A (en) * | 2020-06-19 | 2020-10-16 | 厦门纳龙科技有限公司 | Electrocardiogram heart beat identification method, terminal device and storage medium |
CN112603330A (en) * | 2020-12-28 | 2021-04-06 | 中国科学院微电子研究所 | Electrocardiosignal identification and classification method |
-
2021
- 2021-10-11 CN CN202111181641.8A patent/CN115956924A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20200008696A1 (en) * | 2017-03-07 | 2020-01-09 | Transformative AI Ltd | Analysis of cardiac data |
CN109871742A (en) * | 2018-12-29 | 2019-06-11 | 安徽心之声医疗科技有限公司 | A kind of electrocardiosignal localization method based on attention Recognition with Recurrent Neural Network |
CN111310572A (en) * | 2020-01-17 | 2020-06-19 | 上海优加利健康管理有限公司 | Processing method and device for generating heart beat label sequence by utilizing heart beat time sequence |
CN111772619A (en) * | 2020-06-19 | 2020-10-16 | 厦门纳龙科技有限公司 | Electrocardiogram heart beat identification method, terminal device and storage medium |
CN112603330A (en) * | 2020-12-28 | 2021-04-06 | 中国科学院微电子研究所 | Electrocardiosignal identification and classification method |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119138898A (en) * | 2024-11-18 | 2024-12-17 | 毕胜普生物科技有限公司 | Emotion recognition method, device, equipment and storage medium based on high-frequency electrocardiosignal |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Fernando et al. | Heart sound segmentation using bidirectional LSTMs with attention | |
Murugesan et al. | Ecgnet: Deep network for arrhythmia classification | |
CN111772619B (en) | Heart beat identification method based on deep learning, terminal equipment and storage medium | |
US11564612B2 (en) | Automatic recognition and classification method for electrocardiogram heartbeat based on artificial intelligence | |
EP3777674A1 (en) | Time series data learning and analyzing method using artificial intelligence | |
US11826129B2 (en) | Heart rate prediction from a photoplethysmogram | |
Warrick et al. | Ensembling convolutional and long short-term memory networks for electrocardiogram arrhythmia detection | |
US20220093215A1 (en) | Discovering genomes to use in machine learning techniques | |
Zhao et al. | An explainable attention-based TCN heartbeats classification model for arrhythmia detection | |
CA3069891A1 (en) | Discovering novel features to use in machine learning techniques, such as machine learning techniques for diagnosing medical conditions | |
US20210106240A1 (en) | Fetal Heart Rate Prediction from Electrocardiogram | |
Dhyani et al. | Arrhythmia disease classification utilizing ResRNN | |
KR102483693B1 (en) | Method and apparatus of explainable multi electrocardiogram arrhythmia diagnosis | |
Chen et al. | Edge2Analysis: a novel AIoT platform for atrial fibrillation recognition and detection | |
Prakash et al. | A system for automatic cardiac arrhythmia recognition using electrocardiogram signal | |
CN116504398A (en) | Methods and systems for arrhythmia prediction using a transducer-based neural network | |
Peimankar et al. | Ensemble learning for detection of short episodes of atrial fibrillation | |
Zhu et al. | Cardiovascular disease detection based on deep learning and multi-modal data fusion | |
CN115956924A (en) | A method, device, electronic device and medium for processing electrocardiographic signals | |
Majumder et al. | Identification and classification of arrhythmic heartbeats from electrocardiogram signals using feature induced optimal extreme gradient boosting algorithm | |
Irungu et al. | ML-ECG-COVID: A machine learning-electrocardiogram signal processing technique for COVID-19 predictive modeling | |
Huang et al. | A deep-learning-based multi-modal ecg and pcg processing framework for label efficient heart sound segmentation | |
Katikala et al. | Detecting anomaly in ECG signal using time series forecast approach | |
Lennox et al. | Robust classification of cardiac arrhythmia using a deep neural network | |
Mary et al. | An effective hybrid optimal deep learning approach using BI-LSTM and restricted Boltzmann machines whale optimization to detect arrhythmia |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |