



技术领域technical field
本发明涉及信息处理技术领域,特别是涉及一种心电信号处理系统、方法、电子设备及可读存储介质。The present invention relates to the technical field of information processing, and in particular, to an electrocardiographic signal processing system, method, electronic device and readable storage medium.
背景技术Background technique
心律失常通常指过慢、过快或不规则的心跳[8]。临床上对心律失常进行诊断时,通常会使用心电图作为诊断工具,借助心电图的形态将患者一段时间内的心跳进行分类,进而得出诊断结论。心电图(electrocardiogram,ECG)是一系列的时序电位信号,反映了在人体不同位点测量的生物电信号随时间的变化情况。Arrhythmia usually refers to a heartbeat that is too slow, too fast, or irregular [8]. When diagnosing arrhythmia clinically, an electrocardiogram is usually used as a diagnostic tool, and the heartbeat of a patient is classified by the morphology of the electrocardiogram over a period of time, and then a diagnostic conclusion is drawn. An electrocardiogram (ECG) is a series of time-series potential signals, reflecting the changes of bioelectrical signals measured at different sites in the human body over time.
根据临床上的需求,可以指定不同粒度的分类标准。其中,美国AAMI(Associationfor the Advancement of Medical Instrumentation)针对心电图机的自动初步诊断系统,提出了一个比较粗粒度的分类标准[9]。它将非致命性心律失常的心搏分为了五个类:非异常的(N)、室上性心律失常的(SVEB or S)、室性心律失常的(VEB or V)、融合性心搏(F)和其他类别(Q)。正确地将患者心搏分为以上各类,能让医生对患者的病情有一个整体的把握,是进行进一步精确诊断的基础。Classification criteria of different granularities can be specified according to clinical needs. Among them, the American AAMI (Association for the Advancement of Medical Instrumentation) proposed a relatively coarse-grained classification standard for the automatic preliminary diagnosis system of the electrocardiograph [9]. It classifies non-fatal arrhythmic heartbeats into five categories: non-abnormal (N), supraventricular arrhythmias (SVEB or S), ventricular arrhythmias (VEB or V), fusion heartbeats (F) and other categories (Q). Correctly classifying the patient's heartbeat into the above categories allows doctors to have an overall grasp of the patient's condition, which is the basis for further accurate diagnosis.
然而,现有技术主要通过人力诊断,由于动态心电图数据量过大,会导致人力诊断成本较高,且对诊断人员的专业水平要求较高。However, the prior art mainly relies on manual diagnosis. Due to the large amount of dynamic electrocardiogram data, the cost of manual diagnosis is high, and the professional level of the diagnostic personnel is required to be high.
发明内容SUMMARY OF THE INVENTION
鉴于上述问题,提出了本发明实施例以便提供一种克服上述问题或者至少部分地解决上述问题的一种心电信号处理系统、方法、电子设备及可读存储介质。In view of the above problems, embodiments of the present invention are proposed to provide an ECG signal processing system, method, electronic device, and readable storage medium that overcome the above problems or at least partially solve the above problems.
第一方面,本申请实施例提供了一种心电信号处理系统,所述系统包括:存储模块、预处理器和心搏分类器,所述存储模块与所述预处理器连接,所述预处理器与所述心搏分类器连接,所述预处理器包括去噪模块、分割模块和全局特征提取模块;In a first aspect, an embodiment of the present application provides an ECG signal processing system, the system includes: a storage module, a preprocessor, and a heartbeat classifier, the storage module is connected to the preprocessor, and the preprocessor The processor is connected with the heartbeat classifier, and the preprocessor includes a denoising module, a segmentation module and a global feature extraction module;
所述存储模块,用于存储原始心电信号;The storage module is used to store the original ECG signal;
所述去噪模块,用于从所述存储模块中读取所述原始心电信号并对所述原始心电信号进行去噪处理,得到去噪后的心电信号;the de-noising module, configured to read the original ECG signal from the storage module and perform de-noising processing on the original ECG signal to obtain a de-noised ECG signal;
所述分割模块,用于对所述去噪后的心电信号进行心搏分割,得到多个心搏;The segmentation module is configured to perform heartbeat segmentation on the denoised ECG signal to obtain multiple heartbeats;
全局特征提取模块,用于对所述去噪后的心电信号进行全局特征提取,得到每个心搏的全局特征;a global feature extraction module for performing global feature extraction on the denoised ECG signal to obtain the global feature of each heartbeat;
所述心搏分类器,用于根据所述多个心搏以及其对应的全局特征,使用心搏分类模型分别对每个心搏进行分类,得到每个心搏属于每一类的预测概率。The heartbeat classifier is configured to use a heartbeat classification model to classify each heartbeat separately according to the multiple heartbeats and their corresponding global features, and obtain the predicted probability that each heartbeat belongs to each category.
可选地,所述心搏分类模型包括卷积层、激活函数层、池化层、第一全连接层、第二全连接层、第三全连接层和softmax层;所述心搏分类器包括:Optionally, the heartbeat classification model includes a convolution layer, an activation function layer, a pooling layer, a first fully connected layer, a second fully connected layer, a third fully connected layer and a softmax layer; the heartbeat classifier include:
特征表示模块,用于通过卷积层、激活函数层和池化层对每个心搏进行特征提取,得到每个心搏的多个特征表示;The feature representation module is used to extract the features of each heartbeat through the convolution layer, the activation function layer and the pooling layer, and obtain multiple feature representations of each heartbeat;
特征压缩和拼接模块,用于通过所述第一全连接层对所述每个心搏的多个特征表示进行压缩,得到每个心搏的紧密特征表示,并与对应心搏的所述全局特征进行拼接,得到每个心搏的拼接特征;A feature compression and splicing module is used to compress the multiple feature representations of each heartbeat through the first fully connected layer to obtain a compact feature representation of each heartbeat, which is combined with the global feature representation of the corresponding heartbeat The features are spliced to obtain the splicing features of each heartbeat;
变换模块,用于通过所述第二全连接层对所述每个心搏的拼接特征进行变换,得到每个心搏的变换特征;a transformation module, configured to transform the splicing feature of each heartbeat through the second fully connected layer to obtain the transformation feature of each heartbeat;
对齐和识别模块,用于通过所述第三全连接层和softmax层对所述变换特征进行对齐和识别,得到所述每个心搏属于每一类的概率。The alignment and identification module is used for aligning and identifying the transformed features through the third fully connected layer and the softmax layer to obtain the probability that each heartbeat belongs to each class.
可选地,所述系统还包括模型训练器,所述模型训练器与心搏分类器连接,所述模型训练器包括:Optionally, the system further includes a model trainer, the model trainer is connected to the heartbeat classifier, and the model trainer includes:
样本获取和预处理模块,用于获取多段原始心电信号样本并对所述多段原始心电信号样本进行预处理,得到多个心搏样本,其中,所述多段原始心电信号样本为二导联动态心电图样本;A sample acquisition and preprocessing module, used for acquiring multiple segments of original ECG signal samples and preprocessing the multiple segments of original ECG signal samples to obtain multiple heartbeat samples, wherein the multiple segments of original ECG signal samples are two-lead Linked dynamic ECG samples;
样本分类模块,用于将所述多个心搏样本分为预训练集和微调集;a sample classification module for dividing the multiple heartbeat samples into a pre-training set and a fine-tuning set;
预训练模块,用于使用所述预训练集对预设模型进行预训练,得到基准分类模型;a pre-training module for pre-training a preset model using the pre-training set to obtain a benchmark classification model;
主动学习模块,用于使用所述微调集对所述基准分类模型进行主动学习与模型微调,得到所述心搏分类模型。An active learning module, configured to perform active learning and model fine-tuning on the benchmark classification model using the fine-tuning set to obtain the heartbeat classification model.
可选地,所述预训练模块包括:Optionally, the pre-training module includes:
调参子模块,用于将所述预训练集采用交叉验证的方式对预设模型进行调参,确定预设模型的超参数和模型规模;A parameter adjustment sub-module, used to adjust the parameters of the preset model using the cross-validation method on the pre-training set, and determine the hyperparameters and model scale of the preset model;
预训练子模块,用于使用所述预训练集对已设定所述超参数和所述模型规模的预设模型进行预训练,得到基准分类模型。The pre-training sub-module is configured to use the pre-training set to pre-train the preset model for which the hyperparameters and the model scale have been set to obtain a benchmark classification model.
可选地,所述主动学习模块包括:Optionally, the active learning module includes:
第一微调集分类子模块,用于采用基于不确定性采样的方法对所述微调集进行采样,得到第一主动训练样本,并将所述第一主动训练样本分为第一微调子集和第一评估子集;The first fine-tuning set classification sub-module is used to sample the fine-tuning set using a method based on uncertainty sampling to obtain a first active training sample, and divide the first active training sample into a first fine-tuning subset and a the first evaluation subset;
第一主动学习子模块,用于采用所述第一微调子集对所述基准分类模型进行多轮主动学习与模型微调;a first active learning sub-module, configured to perform multiple rounds of active learning and model fine-tuning on the benchmark classification model by using the first fine-tuning subset;
第一评估和确定子模块,用于采用所述第一评估子集对每一轮主动学习与模型微调后的基准分类模型进行性能评估,直至误差值在预设轮数内均不再下降,停止所述主动学习与模型微调,将误差值最小的那一轮所对应的基准分类模型确定为所述心搏分类模型。The first evaluation and determination submodule is used to use the first evaluation subset to perform performance evaluation on the benchmark classification model after each round of active learning and model fine-tuning, until the error value no longer decreases within the preset number of rounds, The active learning and model fine-tuning are stopped, and the reference classification model corresponding to the round with the smallest error value is determined as the heartbeat classification model.
可选地,所述主动学习模块包括:Optionally, the active learning module includes:
第二微调集分类子模块,用于将所述微调集分为微调子集和评估子集;a second fine-tuning set classification submodule, configured to divide the fine-tuning set into a fine-tuning subset and an evaluation subset;
第二主动学习子模块,用于将所述微调子集采用基于委员会的方法对所述基准分类模型进行多轮主动学习与模型微调,所述预设模型的第一全连接层和第二全连接层均引入Dropout层,采用所述Dropout层产生委员会;The second active learning sub-module is used to perform multiple rounds of active learning and model fine-tuning on the benchmark classification model using the committee-based method for the fine-tuning subset. The first fully-connected layer and the second fully-connected layer of the preset model are The connection layer introduces the Dropout layer, and the Dropout layer is used to generate the committee;
第二评估和确定子模块,用于采用所述评估子集对每一轮主动学习与模型微调后的基准分类模型进行性能评估,直至误差值在预设轮数内均不再下降,停止所述主动学习与模型微调,将误差值最小的那一轮所对应的基准分类模型确定为所述心搏分类模型。The second evaluation and determination sub-module is used to use the evaluation subset to evaluate the performance of the benchmark classification model after each round of active learning and model fine-tuning, until the error value does not decrease within the preset number of rounds, stop all The active learning and model fine-tuning are performed, and the reference classification model corresponding to the round with the smallest error value is determined as the heartbeat classification model.
可选地,在主动学习模块之前,还包括:Optionally, before the active learning module, also include:
随机采样训练模块,用于将所述微调集采用随机采样的方法对所述基准分类模型进行训练和评估,直至所述基准分类模型的分类准确率大于预设值。The random sampling training module is used for training and evaluating the benchmark classification model by using the random sampling method on the fine-tuning set until the classification accuracy of the benchmark classification model is greater than a preset value.
第二方面,本申请实施例还提供了一种心电信号处理方法,所述方法包括:In a second aspect, an embodiment of the present application further provides an ECG signal processing method, the method comprising:
存储原始心电信号;Store the original ECG signal;
读取所述原始心电信号并对所述原始心电信号进行去噪处理,得到去噪后的心电信号;Reading the original ECG signal and performing denoising processing on the original ECG signal to obtain a denoised ECG signal;
对所述去噪后的心电信号进行心搏分割,得到多个心搏;performing heartbeat segmentation on the denoised ECG signal to obtain multiple heartbeats;
对所述去噪后的心电信号进行全局特征提取,得到每个心搏的全局特征;Perform global feature extraction on the denoised ECG signal to obtain the global feature of each heartbeat;
根据所述多个心搏以及其对应的全局特征,使用心搏分类模型分别对每个心搏进行分类,得到每个心搏属于每一类的预测概率。According to the multiple heartbeats and their corresponding global features, use a heartbeat classification model to classify each heartbeat respectively, and obtain the predicted probability that each heartbeat belongs to each category.
可选地,所述心搏分类模型包括卷积层、激活函数层、池化层、第一全连接层、第二全连接层、第三全连接层和softmax层;根据所述多个心搏以及其对应的全局特征,使用心搏分类模型分别对每个心搏进行分类,得到每个心搏属于每一类的预测概率,包括:Optionally, the heartbeat classification model includes a convolution layer, an activation function layer, a pooling layer, a first fully connected layer, a second fully connected layer, a third fully connected layer and a softmax layer; The heartbeat and its corresponding global features are used to classify each heartbeat separately, and the predicted probability of each heartbeat belonging to each category is obtained, including:
通过卷积层、激活函数层和池化层对每个心搏进行特征提取,得到每个心搏的多个特征表示;Feature extraction is performed on each heartbeat through convolutional layer, activation function layer and pooling layer, and multiple feature representations of each heartbeat are obtained;
通过所述第一全连接层对所述每个心搏的多个特征表示进行压缩,得到每个心搏的紧密特征表示,并与对应心搏的所述全局特征进行拼接,得到每个心搏的拼接特征;The multiple feature representations of each heartbeat are compressed by the first fully connected layer to obtain a tight feature representation of each heartbeat, and spliced with the global features of the corresponding heartbeat to obtain each heartbeat splicing characteristics of stroke;
通过所述第二全连接层对所述每个心搏的拼接特征进行变换,得到每个心搏的变换特征;Transform the splicing feature of each heartbeat through the second fully connected layer to obtain the transformation feature of each heartbeat;
通过所述第三全连接层和softmax层对所述变换特征进行对齐和识别,得到所述每个心搏属于每一类的概率。The transformed features are aligned and identified through the third fully connected layer and the softmax layer, and the probability that each heartbeat belongs to each class is obtained.
可选地,所述方法还包括:Optionally, the method further includes:
获取多段原始心电信号样本并对所述多段原始心电信号样本进行预处理,得到多个心搏样本,其中,所述多段原始心电信号样本为二导联动态心电图样本;Obtaining multiple segments of original ECG signal samples and preprocessing the multiple segments of original ECG signal samples to obtain multiple heartbeat samples, wherein the multiple segments of original ECG signal samples are two-lead dynamic ECG samples;
将所述多个心搏样本分为预训练集和微调集;dividing the multiple heartbeat samples into a pre-training set and a fine-tuning set;
使用所述预训练集对预设模型进行预训练,得到基准分类模型;Pre-training the preset model using the pre-training set to obtain a benchmark classification model;
使用所述微调集对所述基准分类模型进行主动学习与模型微调,得到所述心搏分类模型。Active learning and model fine-tuning are performed on the benchmark classification model using the fine-tuning set to obtain the heartbeat classification model.
可选地,使用所述预训练集对预设模型进行预训练,得到基准分类模型,包括:Optionally, use the pre-training set to pre-train a preset model to obtain a benchmark classification model, including:
将所述预训练集采用交叉验证的方式对预设模型进行调参,确定预设模型的超参数和模型规模;The pre-training set is used to adjust the parameters of the preset model by means of cross-validation, and the hyperparameters and model scale of the preset model are determined;
使用所述预训练集对已设定所述超参数和所述模型规模的预设模型进行预训练,得到基准分类模型。Using the pre-training set to pre-train the preset model with the hyperparameters and the model scale set, to obtain a benchmark classification model.
可选地,使用所述微调集对所述基准分类模型进行主动学习与模型微调,得到所述心搏分类模型,包括:Optionally, use the fine-tuning set to perform active learning and model fine-tuning on the benchmark classification model to obtain the heartbeat classification model, including:
采用基于不确定性采样的方法对所述微调集进行采样,得到第一主动训练样本,并将所述第一主动训练样本分为第一微调子集和第一评估子集;The fine-tuning set is sampled by a method based on uncertainty sampling to obtain a first active training sample, and the first active training sample is divided into a first fine-tuning subset and a first evaluation subset;
采用所述第一微调子集对所述基准分类模型进行多轮主动学习与模型微调;Using the first fine-tuning subset to perform multiple rounds of active learning and model fine-tuning on the benchmark classification model;
采用采用所述第一评估子集对每一轮主动学习与模型微调后的基准分类模型进行性能评估,直至误差值在预设轮数内均不再下降,停止所述主动学习与模型微调,将误差值最小的那一轮所对应的基准分类模型确定为所述心搏分类模型。Using the first evaluation subset to evaluate the performance of the benchmark classification model after each round of active learning and model fine-tuning, until the error value does not decrease within the preset number of rounds, stop the active learning and model fine-tuning, The reference classification model corresponding to the round with the smallest error value is determined as the heartbeat classification model.
可选地,使用所述微调集对所述基准分类模型进行主动学习与模型微调,得到所述心搏分类模型,包括:Optionally, use the fine-tuning set to perform active learning and model fine-tuning on the benchmark classification model to obtain the heartbeat classification model, including:
采用基于委员会的方法对所述微调集进行采样,得到第二主动训练样本,并将所述第二主动训练样本分为微调子集和评估子集;其中,所述预设模型的第一全连接层和第二全连接层均引入Dropout层,采用所述Dropout层产生委员会;The committee-based method is used to sample the fine-tuning set to obtain second active training samples, and the second active training samples are divided into fine-tuning subsets and evaluation subsets; Both the connection layer and the second fully connected layer introduce a Dropout layer, and the Dropout layer is used to generate a committee;
采用所述第二微调子集对所述基准分类模型进行多轮主动学习与模型微调;Using the second fine-tuning subset to perform multiple rounds of active learning and model fine-tuning on the benchmark classification model;
采用所述评估子集对每一轮主动学习与模型微调后的基准分类模型进行性能评估,直至误差值在预设轮数内均不再下降,停止所述主动学习与模型微调,将误差值最小的那一轮所对应的基准分类模型确定为所述心搏分类模型。Use the evaluation subset to evaluate the performance of the benchmark classification model after each round of active learning and model fine-tuning, until the error value does not decrease within the preset number of rounds, stop the active learning and model fine-tuning, and set the error value The reference classification model corresponding to the smallest round is determined as the heartbeat classification model.
可选地,在使用所述微调集对所述基准分类模型进行主动学习与模型微调,得到所述心搏分类模型之前,还包括:Optionally, before using the fine-tuning set to perform active learning and model fine-tuning on the benchmark classification model to obtain the heartbeat classification model, the method further includes:
将所述微调集采用随机采样的方法对所述基准分类模型进行训练和评估,直至所述基准分类模型的分类准确率大于预设值。The fine-tuning set is randomly sampled to train and evaluate the benchmark classification model, until the classification accuracy of the benchmark classification model is greater than a preset value.
第三方面,本申请实施例还提供了一种电子设备,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时,实现如第二方面所述的心电信号处理方法的步骤。In a third aspect, an embodiment of the present application further provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being processed by the processor When the device is executed, the steps of the ECG signal processing method described in the second aspect are implemented.
第四方面,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时,实现如第二方面所述的心电信号处理方法的步骤。In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program described in the second aspect is implemented. Steps of an ECG signal processing method.
本发明实施例包括以下优点:The embodiments of the present invention include the following advantages:
在本发明实施例中,通过存储模块存储原始心电信号,再通过去噪模块读取原始心电信号并对其进行去噪处理,再通过分割模块对去噪后的心电信号进行进行心搏分割,得到多个心搏,再通过全局特征提取模块对去噪后的心电信号进行全局特征提取,得到每个心搏的全局特征,最后通过心搏分类器,根据多个心搏以及其对应的全局特征,使用心搏分类模型分别对每个心搏进行分类,得到每个心搏属于每一类的预测概率。通过本申请的心电信号处理系统,能够快速地对心电信号进行处理,得到每个心搏属于每一类的预测概率,从而能够辅助医生对心电信号的分类,提高分类效率。In the embodiment of the present invention, the original ECG signal is stored by the storage module, the original ECG signal is read and de-noised by the de-noising module, and the de-noised ECG signal is processed by the segmentation module. beat segmentation to obtain multiple heartbeats, and then perform global feature extraction on the denoised ECG signal through the global feature extraction module to obtain the global features of each heartbeat. For its corresponding global feature, use the heartbeat classification model to classify each heartbeat separately, and obtain the predicted probability that each heartbeat belongs to each category. The ECG signal processing system of the present application can quickly process the ECG signal to obtain the predicted probability that each heartbeat belongs to each category, thereby assisting the doctor in classifying the ECG signal and improving the classification efficiency.
附图说明Description of drawings
图1是本发明的一种心电信号处理系统的结构框图;Fig. 1 is the structural block diagram of a kind of electrocardiogram signal processing system of the present invention;
图2是本发明的一种心搏分类模型的网络结构图;Fig. 2 is the network structure diagram of a kind of heartbeat classification model of the present invention;
图3是本发明的一种心搏分类器的结构框图;Fig. 3 is the structural block diagram of a kind of heartbeat classifier of the present invention;
图4是本发明的另一种心电信号处理系统的结构框图;4 is a structural block diagram of another ECG signal processing system of the present invention;
图5是本发明的一种心电信号处理方法的步骤流程图。FIG. 5 is a flow chart of steps of an ECG signal processing method of the present invention.
具体实施方式Detailed ways
为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above objects, features and advantages of the present invention more clearly understood, the present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.
请参考图1,图1示出了本申请实施例的一种心电信号处理系统的结构框图,如图1所示,所述系统包括以下结构:存储模块101、预处理器102和心搏分类器103,所述存储模块101与所述预处理器102连接,所述预处理器102与所述心搏分类器103连接,所述预处理器102包括去噪模块1021、分割模块1022和全局特征提取模块1023;Please refer to FIG. 1. FIG. 1 shows a structural block diagram of an ECG signal processing system according to an embodiment of the present application. As shown in FIG. 1, the system includes the following structures: a
所述存储模块101,用于存储原始心电信号。The
在本实施方式中,存储模块用于存储原始心电信号,其中,原始心电信号由医护人员检测得到后并输入存储模块中进行存储。In this embodiment, the storage module is used to store the original ECG signal, wherein the original ECG signal is detected by the medical staff and input into the storage module for storage.
第一存储模块101,用于存储电子病历信息,所述电子病历信息包括客观指标、现病史和体格检查结果。The
所述去噪模块1021,用于从所述存储器中读取所述原始心电信号并对所述原始心电信号进行去噪处理,得到去噪后的心电信号。The
在本实施方式中,采集到的原始心电信号主要包括两类比较严重的噪声:基线漂移、工频干扰。基线漂移是指由于人体呼吸等因素导致心电信号的基线发生变化,可以认为是原始信号叠加了一段低频噪声。工频干扰是指由于线缆等原因,不可避免地在原始信号上叠加了高频噪声。具体实施时,可采用中值滤波器去除基线漂移,使用中值滤波器,可过滤掉原始信号中的各特征波,得到原始信号的低频基线成分。最后,用原始信号减去得到的低频基线成分,就使原始信号的基线归一化,去除了基线漂移。实际操作中,首先使用宽为200ms的中值滤波器去除P波和QRS波群,再对结果使用宽为600ms的中值滤波器去除T波,即可得到去噪后的心电信号。对心电信号进行去噪处理,能够使后续的预测结果更加准确。In this implementation manner, the collected original ECG signals mainly include two types of relatively serious noises: baseline drift and power frequency interference. Baseline drift refers to the change of the baseline of the ECG signal due to factors such as human respiration, which can be considered as a low-frequency noise superimposed on the original signal. Power frequency interference refers to the inevitable superposition of high-frequency noise on the original signal due to cables and other reasons. In specific implementation, a median filter can be used to remove baseline drift, and by using a median filter, each characteristic wave in the original signal can be filtered out, and the low-frequency baseline component of the original signal can be obtained. Finally, by subtracting the resulting low-frequency baseline component from the original signal, the baseline of the original signal is normalized to remove baseline drift. In actual operation, firstly, a median filter with a width of 200ms is used to remove the P wave and QRS complex, and then a median filter with a width of 600ms is used to remove the T wave, and the denoised ECG signal can be obtained. Denoising the ECG signal can make subsequent prediction results more accurate.
所述分割模块1022,用于对所述去噪后的心电信号进行心搏分割,得到多个心搏。The
在本实施方式中,由于预测分类的单元为单个心搏,而一段心电信号包含有多个心搏,所以需要通过分割模块将去噪后的心电信号进行心搏分割,分割为多个心搏。具体实施时,首先提取出去噪后的心电信号的各个R峰的值,然后以R峰为基准,向左取0.278s的数据,并向右取0.556s的数据(在MIT-BIH心律失常数据库中,心电信号的采样频率是360Hz,即在R峰向左取100个点,向右取299个点,得到的信号长度为300),将去噪后的心电信号分割为多个心搏。In this embodiment, since the unit of prediction and classification is a single heartbeat, and a piece of ECG signal contains multiple heartbeats, it is necessary to use the segmentation module to divide the denoised ECG signal into multiple heartbeats. heartbeat. In the specific implementation, first extract the value of each R peak of the denoised ECG signal, then take the R peak as the benchmark, take the data of 0.278s to the left, and take the data of 0.556s to the right (in MIT-BIH arrhythmia) In the database, the sampling frequency of the ECG signal is 360Hz, that is, taking 100 points to the left of the R peak and 299 points to the right, the obtained signal length is 300), and the denoised ECG signal is divided into multiple heartbeat.
全局特征提取模块1023,用于对所述去噪后的心电信号进行全局特征提取,得到每个心搏的全局特征。The global
在本实施方式中,对一个心搏进行分类,可以提取一些心搏的全局特征,以提高分类的准确率。具体实施时,对每个心搏提取了如下四个全局特征:(1)前向RR间期:该心搏R峰与前一个心搏R峰的距离;(2)后向RR间期:该心搏R峰与后一个心搏R峰的距离;(3)局部RR间期均值:该心搏前10个心搏的RR间期的平均值;(4)全局RR间期均值:该心搏前300个心搏的RR间期的平均值。In this embodiment, a heartbeat is classified, and some global features of the heartbeat can be extracted to improve the classification accuracy. During specific implementation, the following four global features are extracted for each heartbeat: (1) Forward RR interval: the distance between the R peak of this heartbeat and the previous heartbeat R peak; (2) Backward RR interval: The distance between the R peak of this heartbeat and the R peak of the next heartbeat; (3) Mean local RR interval: the average of the RR intervals of the previous 10 heartbeats; (4) Mean global RR interval: the The mean of the RR intervals of the 300 previous heartbeats.
所述心搏分类器103,用于根据所述多个心搏以及其对应的全局特征,使用心搏分类模型分别对每个心搏进行分类,得到每个心搏属于每一类的预测概率。The
在本实施方式中,心搏分类器采用训练好的心搏分类模型,根据多个心搏以及其对应的全局特征,对每个心搏进行分类,能够较为快速地得到每个心搏属于每一类的预测概率,可作为参考,以辅助医生对心搏的分类,从而提高心搏分类速率,降低人工成本。In this embodiment, the heartbeat classifier adopts a trained heartbeat classification model, and classifies each heartbeat according to multiple heartbeats and their corresponding global features, so that each heartbeat belongs to each heartbeat can be obtained relatively quickly. The predicted probability of one class can be used as a reference to assist doctors in classifying heartbeats, thereby improving the heartbeat classification rate and reducing labor costs.
在本发明实施例中,通过存储模块存储原始心电信号,再通过去噪模块读取原始心电信号并对其进行去噪处理,再通过分割模块对去噪后的心电信号进行进行心搏分割,得到多个心搏,再通过全局特征提取模块对去噪后的心电信号进行全局特征提取,得到每个心搏的全局特征,最后通过心搏分类器,根据多个心搏以及其对应的全局特征,使用心搏分类模型分别对每个心搏进行分类,得到每个心搏属于每一类的预测概率。通过本申请的心电信号处理系统,能够快速地对心电信号进行处理,得到每个心搏属于每一类的预测概率,从而能够辅助医生对心电信号的分类,提高分类效率。In the embodiment of the present invention, the original ECG signal is stored by the storage module, the original ECG signal is read and de-noised by the de-noising module, and the de-noised ECG signal is processed by the segmentation module. beat segmentation to obtain multiple heartbeats, and then perform global feature extraction on the denoised ECG signal through the global feature extraction module to obtain the global features of each heartbeat. For its corresponding global feature, use the heartbeat classification model to classify each heartbeat separately, and obtain the predicted probability that each heartbeat belongs to each category. The ECG signal processing system of the present application can quickly process the ECG signal to obtain the predicted probability that each heartbeat belongs to each category, thereby assisting the doctor in classifying the ECG signal and improving the classification efficiency.
请参考图2和图3,其中,图2示出了本申请实施例的一种心搏分类模型的网络结构图,如图2所示,所述心搏分类模型包括卷积层、激活函数层、池化层、第一全连接层、第二全连接层、第三全连接层和softmax层。图3示出了本申请实施例的一种心搏分类器的结构框图,如图3所示,所述心搏分类器包括:Please refer to FIG. 2 and FIG. 3, wherein FIG. 2 shows a network structure diagram of a heartbeat classification model according to an embodiment of the present application. As shown in FIG. 2, the heartbeat classification model includes a convolution layer, an activation function layer, pooling layer, first fully connected layer, second fully connected layer, third fully connected layer and softmax layer. FIG. 3 shows a structural block diagram of a heartbeat classifier according to an embodiment of the present application. As shown in FIG. 3 , the heartbeat classifier includes:
特征表示模块301,用于通过卷积层、激活函数层和池化层对每个心搏进行特征提取,得到每个心搏的多个特征表示。The
在本实施方式中,使用的原始心电信号包含两个导联,经过预处理得到的每个心搏也包括两个导联,可以为MLII导联和V5导联,在通过特征表示模块进行特征提取时,卷积层、激活函数层和池化层分为两个子网络,分别对每个心搏进行特征提取,没有信息的融合,从而提取出每个心搏的多个特征表示。In this embodiment, the original ECG signal used includes two leads, and each heartbeat obtained after preprocessing also includes two leads, which can be MLII lead and V5 lead. During feature extraction, the convolution layer, activation function layer and pooling layer are divided into two sub-networks, and feature extraction is performed for each heartbeat respectively, without information fusion, so as to extract multiple feature representations of each heartbeat.
特征压缩和拼接模块302,用于通过所述第一全连接层对所述每个心搏的多个特征表示进行压缩,得到每个心搏的紧密特征表示,并与对应心搏的所述全局特征进行拼接,得到每个心搏的拼接特征。The feature compression and
在本实施方式中,特征压缩和拼接模块在对每个心搏的多个特征表示进行处理时,先通过第一全连接层对每个心搏的多个特征表示进行压缩,得到每个心搏的紧密特征表示,再将每个心搏的紧密特征表示与对应心搏的全局特征进行拼接,得到每个心搏的拼接特征。在此处将每个心搏的全局特征与紧密特征表示进行拼接,能够使后续的分类结果更加准确。In this embodiment, when the feature compression and splicing module processes the multiple feature representations of each heartbeat, it first compresses the multiple feature representations of each heartbeat through the first fully connected layer to obtain each heartbeat. The tight feature representation of each heartbeat is then spliced with the global feature of the corresponding heartbeat to obtain the spliced feature of each heartbeat. Here, the global features of each heartbeat are spliced with the tight feature representation, which can make the subsequent classification results more accurate.
变换模块303,用于通过所述第二全连接层对所述每个心搏的拼接特征进行变换,得到每个心搏的变换特征。The
对齐和识别模块304,用于通过所述第三全连接层和softmax层对所述变换特征进行对齐和识别,得到所述每个心搏属于每一类的概率。The alignment and
在本实施方式中,通过上述心搏分类器中的心搏分类模型对每个心搏以及其对应的全局特征进行处理,能够快速得到每个心搏属于每一类的概率,从而能够辅助医生对心电信号的分类,提高分类效率,节约人工成本。In this embodiment, each heartbeat and its corresponding global feature are processed by the heartbeat classification model in the above-mentioned heartbeat classifier, so that the probability that each heartbeat belongs to each category can be quickly obtained, so as to assist the doctor The classification of ECG signals improves classification efficiency and saves labor costs.
请参考图4,图4示出了本申请实施例的另一种心电信号处理系统的结构框图,如图4所示,所述系统还包括模型训练器,所述模型训练器与心搏分类器连接,所述模型训练器包括:Please refer to FIG. 4. FIG. 4 shows a structural block diagram of another ECG signal processing system according to an embodiment of the present application. As shown in FIG. 4, the system further includes a model trainer, the model trainer is connected to the heartbeat The classifier is connected, and the model trainer includes:
样本获取和预处理模块401,用于获取多段原始心电信号样本并对所述多段原始心电信号样本进行预处理,得到多个心搏样本,其中,所述多段原始心电信号样本为二导联动态心电图样本。The sample acquisition and preprocessing module 401 is used for acquiring multiple segments of original ECG signal samples and preprocessing the multiple segments of original ECG signal samples to obtain multiple heartbeat samples, wherein the multiple segments of original ECG signal samples are two Lead Holter sample.
在本实施方式中,需要获取多段原始心电信号样本,并对其进行预处理,以便于后续对预设模型进行训练,其预处理方式和上述预处理器中的去噪模块1021、分割模块1022和全局特征提取模块1023的处理方式相同,可参照上述具体解释,在此不再赘述,得到的多个心搏样本中,每个心搏样本均包含心搏和其对应的全局特征。In this embodiment, it is necessary to obtain multiple segments of original ECG signal samples and preprocess them to facilitate subsequent training of the preset model. The processing methods of 1022 and the global
样本分类模块402,用于将所述多个心搏样本分为预训练集和微调集;a sample classification module 402, configured to divide the multiple heartbeat samples into a pre-training set and a fine-tuning set;
预训练模块403,用于使用所述预训练集对预设模型进行预训练,得到基准分类模型。The pre-training module 403 is configured to perform pre-training on a preset model by using the pre-training set to obtain a benchmark classification model.
为了得到一个较好的模型训练效果,需要先使用一部分数据对预设模型进行预训练,在本实施方式中,将多个心搏样本分为预训练集和微调集,使用预训练集对预设模型进行预训练。In order to obtain a better model training effect, it is necessary to use a part of the data to pre-train the preset model. In this embodiment, multiple heartbeat samples are divided into a pre-training set and a fine-tuning set, and the pre-training set is used for the pre-training set. Let the model be pre-trained.
在一种可行的实施方式中,所述预训练模块包括:In a feasible implementation manner, the pre-training module includes:
调参子模块,用于将所述预训练集采用交叉验证的方式对预设模型进行调参,确定预设模型的超参数和模型规模;A parameter adjustment sub-module, used to adjust the parameters of the preset model using the cross-validation method on the pre-training set, and determine the hyperparameters and model scale of the preset model;
预训练子模块,用于使用所述预训练集对已设定所述超参数和所述模型规模的预设模型进行预训练,得到基准分类模型。The pre-training sub-module is configured to use the pre-training set to pre-train the preset model for which the hyperparameters and the model scale have been set to obtain a benchmark classification model.
在本实施方式中,为了充分利用数据,可以使用n折交叉验证的方法确定预设模型的超参数和模型规模,将数据平均划分成n份,每次取1份作为验证集,用另外(n-1)份数据进行模型的训练,可以得到一个评估指标,如此重复n次,取n次的平均值作为最终的评估指标。这样做可以相对充分地利用数据,并在使用Dropout时,可取值为0.5,增加训练的参数规模,最终,经交叉验证,可以选取第一次全连接层后得到的特征向量大小为50,并选取批大小为10。在此基础上,再使用全部的数据,按照这样的超参数及模型规模设定进行预训练,得到基准分类模型。In this embodiment, in order to make full use of the data, the method of n-fold cross-validation can be used to determine the hyperparameters and model scale of the preset model, the data is evenly divided into n parts, and one part is taken as the verification set each time, and another ( N-1) pieces of data are used for model training, and an evaluation index can be obtained. Repeat this n times, and take the average value of the n times as the final evaluation index. In this way, the data can be relatively fully utilized, and when using Dropout, the value can be 0.5 to increase the parameter scale of training. Finally, after cross-validation, the size of the feature vector obtained after the first fully connected layer can be selected to be 50. And choose a batch size of 10. On this basis, using all the data, pre-training is performed according to such hyperparameters and model scale settings to obtain a benchmark classification model.
主动学习模块404,用于使用所述微调集对所述基准分类模型进行主动学习与模型微调,得到所述心搏分类模型。The active learning module 404 is configured to use the fine-tuning set to perform active learning and model fine-tuning on the benchmark classification model to obtain the heartbeat classification model.
在一种可行的实施方式中,所述主动学习模块包括:In a feasible implementation, the active learning module includes:
第一微调集分类子模块,用于采用基于不确定性采样的方法对所述微调集进行采样,得到第一主动训练样本,并将所述第一主动训练样本分为第一微调子集和第一评估子集;The first fine-tuning set classification sub-module is used to sample the fine-tuning set using a method based on uncertainty sampling to obtain a first active training sample, and divide the first active training sample into a first fine-tuning subset and a the first evaluation subset;
第一主动学习子模块,用于采用所述第一微调子集对所述基准分类模型进行多轮主动学习与模型微调;a first active learning sub-module, configured to perform multiple rounds of active learning and model fine-tuning on the benchmark classification model by using the first fine-tuning subset;
第一评估和确定子模块,用于采用所述第一评估子集对每一轮主动学习与模型微调后的基准分类模型进行性能评估,直至误差值在预设轮数内均不再下降,停止所述主动学习与模型微调,将误差值最小的那一轮所对应的基准分类模型确定为所述心搏分类模型。The first evaluation and determination submodule is used to use the first evaluation subset to perform performance evaluation on the benchmark classification model after each round of active learning and model fine-tuning, until the error value no longer decreases within the preset number of rounds, The active learning and model fine-tuning are stopped, and the reference classification model corresponding to the round with the smallest error value is determined as the heartbeat classification model.
在本实施方式中,可将用于主动学习的微调集采用基于不确定性采样的方法进行采样,得到第一主动训练样本,具体地,对微调集进行不确定性采样,使用基准分类模型对微调集进行分类,使用边缘置信度判定法,这种方法考虑各类别中置信度最高的2个类别对应的概率p1、p2(p1≥p2),p1-p2的值越低,样本信息量越大,可以记1-(p1-p2)为该样本的信息评分,从而从微调集中选出信息评分较大的作为第一主动训练样本,具体实施时,可以从微调集中选出信息评分前50%作为第一主动训练样本,然后将第一主动训练样本进行人工分类的标注,并将其分为第一微调子集和第一评估子集,对基准分类模型进行多轮训练和评估,具体实施时,可直至评估计算出的误差值在10轮预设轮数内均不再下降,停止所述主动学习与模型微调,将误差值最小的那一轮所对应的基准分类模型确定为所述心搏分类模型。In this embodiment, the fine-tuning set used for active learning can be sampled by a method based on uncertainty sampling to obtain the first active training sample. Specifically, uncertainty sampling is performed on the fine-tuning set, and a benchmark classification model is used to The fine-tuning set is classified, and the edge confidence judgment method is used. This method considers the probabilities p1 and p2 (p1≥p2) corresponding to the two categories with the highest confidence in each category. The lower the value of p1-p2, the greater the amount of sample information. If it is large, 1-(p1-p2) can be recorded as the information score of the sample, so that the first active training sample with a larger information score can be selected from the fine-tuning set. In specific implementation, the top 50 information scores can be selected from the fine-tuning set % as the first active training sample, and then the first active training sample is manually classified and labeled, and divided into the first fine-tuning subset and the first evaluation subset, and the benchmark classification model is trained and evaluated for multiple rounds. During implementation, until the error value calculated by the evaluation does not decrease within the preset number of 10 rounds, the active learning and model fine-tuning are stopped, and the benchmark classification model corresponding to the round with the smallest error value is determined as the Describe the heartbeat classification model.
在本实施方式中,采用基于不确定性采样的方法对所述微调集进行采样,选出信息量较大的样本,得到第一主动训练样本,并对基准分类模型进行主动学习与模型微调,能够达到较好的主动学习效果。In this embodiment, a method based on uncertainty sampling is used to sample the fine-tuning set, and a sample with a large amount of information is selected to obtain a first active training sample, and the benchmark classification model is actively learned and fine-tuned. Can achieve better active learning effect.
在另一种可行的实施方式中,所述主动学习模块包括:In another feasible implementation, the active learning module includes:
第二微调集分类子模块,用于采用基于委员会的方法对所述微调集进行采样,得到第二主动训练样本,并将所述第二主动训练样本分为微调子集和评估子集;其中,所述预设模型的第一全连接层和第二全连接层均引入Dropout层,采用所述Dropout层产生委员会;The second fine-tuning set classification sub-module is used for sampling the fine-tuning set using a committee-based method to obtain a second active training sample, and dividing the second active training sample into a fine-tuning subset and an evaluation subset; wherein , the first fully connected layer and the second fully connected layer of the preset model both introduce a Dropout layer, and the Dropout layer is used to generate a committee;
第二主动学习子模块,用于采用所述第二微调子集对所述基准分类模型进行多轮主动学习与模型微调;a second active learning sub-module, configured to use the second fine-tuning subset to perform multiple rounds of active learning and model fine-tuning on the benchmark classification model;
第二评估和确定子模块,用于采用所述评估子集对每一轮主动学习与模型微调后的基准分类模型进行性能评估,直至误差值在预设轮数内均不再下降,停止所述主动学习与模型微调,将误差值最小的那一轮所对应的基准分类模型确定为所述心搏分类模型。The second evaluation and determination sub-module is used to use the evaluation subset to evaluate the performance of the benchmark classification model after each round of active learning and model fine-tuning, until the error value does not decrease within the preset number of rounds, stop all The active learning and model fine-tuning are performed, and the reference classification model corresponding to the round with the smallest error value is determined as the heartbeat classification model.
在本实施方式中,可将用于主动学习的微调集采用基于委员会的方法进行采样,得到第二主动训练样本,具体地,有上述可知,心搏分类模型包括卷积层、激活函数层、池化层、第一全连接层、第二全连接层、第三全连接层和softmax层,则预设模型和预训练后的基准分类模型也包括卷积层、激活函数层、池化层、第一全连接层、第二全连接层、第三全连接层和softmax层,在预设模型的第一全连接层和第二全连接层均引入Dropout层,从而在使用基准分类模型对微调集进行分类时,采用Dropout层产生委员会,对同一个样本属于每一类会得到多个不同的概率,它们分类结果的差异性越大,该样本的信息量越大,并计算出该样本的信息评分,从而从微调集中选出信息评分较大的作为第二主动训练样本,具体实施时,可以从微调集中选出信息评分前50%作为第二主动训练样本,然后将第二主动训练样本进行人工分类的标注,并将其分为第二微调子集和第二评估子集,对基准分类模型进行多轮训练和评估,具体实施时,可直至评估计算出的误差值在10轮预设轮数内均不再下降,停止所述主动学习与模型微调,将误差值最小的那一轮所对应的基准分类模型确定为所述心搏分类模型。In this embodiment, the fine-tuning set used for active learning can be sampled by a committee-based method to obtain a second active training sample. Specifically, as can be seen from the above, the heartbeat classification model includes a convolution layer, an activation function layer, a Pooling layer, first fully connected layer, second fully connected layer, third fully connected layer and softmax layer, the preset model and pre-trained benchmark classification model also include convolution layer, activation function layer, pooling layer , the first fully connected layer, the second fully connected layer, the third fully connected layer and the softmax layer, and the Dropout layer is introduced into the first fully connected layer and the second fully connected layer of the preset model. When the fine-tuning set is used for classification, the Dropout layer is used to generate committees. For the same sample to belong to each category, multiple different probabilities will be obtained. In order to select the higher information score from the fine-tuning set as the second active training sample, in the specific implementation, the top 50% of the information score can be selected from the fine-tuning set as the second active training sample, and then the second active training sample can be selected. The samples are manually classified and labeled, and they are divided into the second fine-tuning subset and the second evaluation subset, and the benchmark classification model is trained and evaluated for multiple rounds. If there is no further decrease within the preset number of rounds, the active learning and model fine-tuning are stopped, and the reference classification model corresponding to the round with the smallest error value is determined as the heartbeat classification model.
在本实施方式中,采用基于委员会的方法对所述微调集进行采样,选出信息量较大的样本,得到第二主动训练样本,并对基准分类模型进行主动学习与模型微调,能够达到较好的主动学习效果。In this embodiment, a committee-based method is used to sample the fine-tuning set, select a sample with a larger amount of information, obtain a second active training sample, and perform active learning and model fine-tuning on the benchmark classification model, which can achieve a relatively high level of accuracy. Good active learning effect.
在一种可行的实施方式中,在主动学习模块之前,还包括:In a feasible implementation manner, before the active learning module, it further includes:
随机采样训练模块,用于将所述微调集采用随机采样的方法对所述基准分类模型进行训练和评估,直至所述基准分类模型的分类准确率大于预设值。The random sampling training module is used for training and evaluating the benchmark classification model by using the random sampling method on the fine-tuning set until the classification accuracy of the benchmark classification model is greater than a preset value.
在本实施方式中,先通过随机采样的方法对所述基准分类模型进行训练和评估,使其具备一定的分类准确率,例如,使基准分类模型的分类准确率达到50%,再对基准分类模型进行主动学习与模型微调,能够获得更好的主动学习效果,使得到的心搏分类模型的分类更加准确。In this embodiment, the benchmark classification model is trained and evaluated by random sampling first, so that it has a certain classification accuracy, for example, the classification accuracy of the benchmark classification model reaches 50%, and then the benchmark classification model is The model performs active learning and model fine-tuning, which can obtain better active learning effect and make the classification of the obtained heartbeat classification model more accurate.
基于同一发明构思,本申请一实施例提供一种心电信号处理方法,参考图5,图5是申请实施例的一种心电信号处理方法的步骤流程图,如图5所示,所述方法包括:Based on the same inventive concept, an embodiment of the present application provides an ECG signal processing method. Referring to FIG. 5 , FIG. 5 is a flowchart of steps of an ECG signal processing method according to an embodiment of the application. As shown in FIG. 5 , the Methods include:
步骤S501:存储原始心电信号;Step S501: store the original ECG signal;
步骤S502:读取所述原始心电信号并对所述原始心电信号进行去噪处理,得到去噪后的心电信号;Step S502: Read the original ECG signal and perform denoising processing on the original ECG signal to obtain a denoised ECG signal;
步骤S503:对所述去噪后的心电信号进行心搏分割,得到多个心搏;Step S503: performing heartbeat segmentation on the denoised ECG signal to obtain multiple heartbeats;
步骤S504:对所述去噪后的心电信号进行全局特征提取,得到每个心搏的全局特征;Step S504: perform global feature extraction on the denoised ECG signal to obtain the global feature of each heartbeat;
步骤S505:根据所述多个心搏以及其对应的全局特征,使用心搏分类模型分别对每个心搏进行分类,得到每个心搏属于每一类的预测概率。Step S505: According to the multiple heartbeats and their corresponding global features, use a heartbeat classification model to classify each heartbeat respectively, and obtain a predicted probability that each heartbeat belongs to each category.
可选地,所述心搏分类模型包括卷积层、激活函数层、池化层、第一全连接层、第二全连接层、第三全连接层和softmax层;根据所述多个心搏以及其对应的全局特征,使用心搏分类模型分别对每个心搏进行分类,得到每个心搏属于每一类的预测概率,包括:Optionally, the heartbeat classification model includes a convolution layer, an activation function layer, a pooling layer, a first fully connected layer, a second fully connected layer, a third fully connected layer and a softmax layer; The heartbeat and its corresponding global features are used to classify each heartbeat separately, and the predicted probability of each heartbeat belonging to each category is obtained, including:
通过卷积层、激活函数层和池化层对每个心搏进行特征提取,得到每个心搏的多个特征表示;Feature extraction is performed on each heartbeat through convolutional layer, activation function layer and pooling layer, and multiple feature representations of each heartbeat are obtained;
通过所述第一全连接层对所述每个心搏的多个特征表示进行压缩,得到每个心搏的紧密特征表示,并与对应心搏的所述全局特征进行拼接,得到每个心搏的拼接特征;The multiple feature representations of each heartbeat are compressed by the first fully connected layer to obtain a tight feature representation of each heartbeat, and spliced with the global features of the corresponding heartbeat to obtain each heartbeat splicing characteristics of stroke;
通过所述第二全连接层对所述每个心搏的拼接特征进行变换,得到每个心搏的变换特征;Transform the splicing feature of each heartbeat through the second fully connected layer to obtain the transformation feature of each heartbeat;
通过所述第三全连接层和softmax层对所述变换特征进行对齐和识别,得到所述每个心搏属于每一类的概率。The transformed features are aligned and identified through the third fully connected layer and the softmax layer, and the probability that each heartbeat belongs to each class is obtained.
可选地,所述方法还包括:Optionally, the method further includes:
获取多段原始心电信号样本并对所述多段原始心电信号样本进行预处理,得到多个心搏样本,其中,所述多段原始心电信号样本为二导联动态心电图样本;Obtaining multiple segments of original ECG signal samples and preprocessing the multiple segments of original ECG signal samples to obtain multiple heartbeat samples, wherein the multiple segments of original ECG signal samples are two-lead dynamic ECG samples;
将所述多个心搏样本分为预训练集和微调集;dividing the multiple heartbeat samples into a pre-training set and a fine-tuning set;
使用所述预训练集对预设模型进行预训练,得到基准分类模型;Pre-training the preset model using the pre-training set to obtain a benchmark classification model;
使用所述微调集对所述基准分类模型进行主动学习与模型微调,得到所述心搏分类模型。Active learning and model fine-tuning are performed on the benchmark classification model using the fine-tuning set to obtain the heartbeat classification model.
可选地,使用所述预训练集对预设模型进行预训练,得到基准分类模型,包括:Optionally, use the pre-training set to pre-train a preset model to obtain a benchmark classification model, including:
将所述预训练集采用交叉验证的方式对预设模型进行调参,确定预设模型的超参数和模型规模;The pre-training set is used to adjust the parameters of the preset model by means of cross-validation, and the hyperparameters and model scale of the preset model are determined;
使用所述预训练集对已设定所述超参数和所述模型规模的预设模型进行预训练,得到基准分类模型。Using the pre-training set to pre-train the preset model with the hyperparameters and the model scale set, to obtain a benchmark classification model.
可选地,使用所述微调集对所述基准分类模型进行主动学习与模型微调,得到所述心搏分类模型,包括:Optionally, use the fine-tuning set to perform active learning and model fine-tuning on the benchmark classification model to obtain the heartbeat classification model, including:
采用基于不确定性采样的方法对所述微调集进行采样,得到第一主动训练样本,并将所述第一主动训练样本分为第一微调子集和第一评估子集;The fine-tuning set is sampled by a method based on uncertainty sampling to obtain a first active training sample, and the first active training sample is divided into a first fine-tuning subset and a first evaluation subset;
采用所述第一微调子集对所述基准分类模型进行多轮主动学习与模型微调;Using the first fine-tuning subset to perform multiple rounds of active learning and model fine-tuning on the benchmark classification model;
采用采用所述第一评估子集对每一轮主动学习与模型微调后的基准分类模型进行性能评估,直至误差值在预设轮数内均不再下降,停止所述主动学习与模型微调,将误差值最小的那一轮所对应的基准分类模型确定为所述心搏分类模型。Using the first evaluation subset to evaluate the performance of the benchmark classification model after each round of active learning and model fine-tuning, until the error value does not decrease within the preset number of rounds, stop the active learning and model fine-tuning, The reference classification model corresponding to the round with the smallest error value is determined as the heartbeat classification model.
可选地,使用所述微调集对所述基准分类模型进行主动学习与模型微调,得到所述心搏分类模型,包括:Optionally, use the fine-tuning set to perform active learning and model fine-tuning on the benchmark classification model to obtain the heartbeat classification model, including:
采用基于委员会的方法对所述微调集进行采样,得到第二主动训练样本,并将所述第二主动训练样本分为微调子集和评估子集;其中,所述预设模型的第一全连接层和第二全连接层均引入Dropout层,采用所述Dropout层产生委员会;The committee-based method is used to sample the fine-tuning set to obtain second active training samples, and the second active training samples are divided into fine-tuning subsets and evaluation subsets; Both the connection layer and the second fully connected layer introduce a Dropout layer, and the Dropout layer is used to generate a committee;
采用所述第二微调子集对所述基准分类模型进行多轮主动学习与模型微调;Using the second fine-tuning subset to perform multiple rounds of active learning and model fine-tuning on the benchmark classification model;
采用所述评估子集对每一轮主动学习与模型微调后的基准分类模型进行性能评估,直至误差值在预设轮数内均不再下降,停止所述主动学习与模型微调,将误差值最小的那一轮所对应的基准分类模型确定为所述心搏分类模型。Use the evaluation subset to evaluate the performance of the benchmark classification model after each round of active learning and model fine-tuning, until the error value does not decrease within the preset number of rounds, stop the active learning and model fine-tuning, and set the error value The reference classification model corresponding to the smallest round is determined as the heartbeat classification model.
可选地,在使用所述微调集对所述基准分类模型进行主动学习与模型微调,得到所述心搏分类模型之前,还包括:Optionally, before using the fine-tuning set to perform active learning and model fine-tuning on the benchmark classification model to obtain the heartbeat classification model, the method further includes:
将所述微调集采用随机采样的方法对所述基准分类模型进行训练和评估,直至所述基准分类模型的分类准确率大于预设值。The fine-tuning set is randomly sampled to train and evaluate the benchmark classification model, until the classification accuracy of the benchmark classification model is greater than a preset value.
基于同一发明构思,本申请另一实施例提供一种电子设备,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时,实现上述任一实施例所述的方法中的步骤。Based on the same inventive concept, another embodiment of the present application provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being When executed by the processor, the steps in the method described in any of the foregoing embodiments are implemented.
基于同一发明构思,本申请另一实施例提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时,实现如本申请上述任一实施例所述的方法中的步骤。Based on the same inventive concept, another embodiment of the present application provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, any one of the above-mentioned applications in the present application is implemented. Steps in the methods described in the Examples.
对于方法实施例而言,由于其与系统实施例基本相似,所以描述的比较简单,相关之处参见系统实施例的部分说明即可。As for the method embodiment, since it is basically similar to the system embodiment, the description is relatively simple, and reference may be made to the partial description of the system embodiment for related parts.
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments may be referred to each other.
本领域内的技术人员应明白,本发明实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本发明实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It should be understood by those skilled in the art that the embodiments of the embodiments of the present invention may be provided as a method, an apparatus, or a computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media having computer-usable program code embodied therein, including but not limited to disk storage, CD-ROM, optical storage, and the like.
本发明实施例是参照根据本发明实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。Embodiments of the present invention are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present invention. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal equipment to produce a machine that causes the instructions to be executed by the processor of the computer or other programmable data processing terminal equipment Means are created for implementing the functions specified in a flow or flows of the flowcharts and/or a block or blocks of the block diagrams.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal equipment to operate in a particular manner, such that the instructions stored in the computer readable memory result in an article of manufacture comprising instruction means, the The instruction means implement the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing terminal equipment, so that a series of operational steps are performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby executing on the computer or other programmable terminal equipment The instructions executed on the above provide steps for implementing the functions specified in the flowchart or blocks and/or the block or blocks of the block diagrams.
尽管已描述了本发明实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明实施例范围的所有变更和修改。Although preferred embodiments of the embodiments of the present invention have been described, additional changes and modifications to these embodiments may be made by those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications that fall within the scope of the embodiments of the present invention.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。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 non-exclusive inclusion, such that a process, method, article or terminal device comprising a list of elements includes not only those elements, but also a non-exclusive list of elements. other elements, or also include elements inherent to such a process, method, article or terminal equipment. Without further limitation, an element defined by the phrase "comprises a..." does not preclude the presence of additional identical elements in the process, method, article or terminal device comprising said element.
以上对本发明所提供的一种心电信号处理系统、一种心电信号处理方法、一种电子设备和一种计算机可读存储介质进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。An ECG signal processing system, an ECG signal processing method, an electronic device, and a computer-readable storage medium provided by the present invention have been described in detail above. Specific examples are used in this paper to explain the principles of the present invention. The description of the above embodiment is only used to help understand the method of the present invention and its core idea; meanwhile, for those of ordinary skill in the art, according to the idea of the present invention, in the specific embodiment and the scope of application There will be changes. To sum up, the contents of this specification should not be construed as limiting the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911007785.4ACN110693488A (en) | 2019-10-22 | 2019-10-22 | ECG signal processing system, method, electronic device and readable storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201911007785.4ACN110693488A (en) | 2019-10-22 | 2019-10-22 | ECG signal processing system, method, electronic device and readable storage medium |
| Publication Number | Publication Date |
|---|---|
| CN110693488Atrue CN110693488A (en) | 2020-01-17 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201911007785.4APendingCN110693488A (en) | 2019-10-22 | 2019-10-22 | ECG signal processing system, method, electronic device and readable storage medium |
| Country | Link |
|---|---|
| CN (1) | CN110693488A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112022142A (en)* | 2020-08-07 | 2020-12-04 | 上海联影智能医疗科技有限公司 | Electrocardiosignal type identification method, device and medium |
| CN113712525A (en)* | 2020-05-21 | 2021-11-30 | 深圳市理邦精密仪器股份有限公司 | Physiological parameter processing method and device and medical equipment |
| CN113712564A (en)* | 2020-05-12 | 2021-11-30 | 深圳市科瑞康实业有限公司 | Electrocardiosignal classification device and method |
| CN113974649A (en)* | 2021-12-03 | 2022-01-28 | 上海交通大学医学院附属瑞金医院 | Method, apparatus and medium for classification of heart beat signals and training of deep learning models for classification of heart beat signals |
| CN115251944A (en)* | 2022-07-25 | 2022-11-01 | 清华大学 | Heartbeat classification method and device based on electrocardiogram diagnosis report |
| CN115381462A (en)* | 2022-09-26 | 2022-11-25 | 上海乐普云智科技股份有限公司 | Electrocardiosignal processing method and device |
| CN116509414A (en)* | 2023-04-14 | 2023-08-01 | 中国科学院大学 | Electrocardiosignal denoising classification system and method |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109223002A (en)* | 2018-08-27 | 2019-01-18 | 上海铱硙医疗科技有限公司 | Self-closing disease illness prediction technique, device, equipment and storage medium |
| CN109805924A (en)* | 2019-02-15 | 2019-05-28 | 济南大学 | CNN-based ECG signal processing method and arrhythmia detection system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109223002A (en)* | 2018-08-27 | 2019-01-18 | 上海铱硙医疗科技有限公司 | Self-closing disease illness prediction technique, device, equipment and storage medium |
| CN109805924A (en)* | 2019-02-15 | 2019-05-28 | 济南大学 | CNN-based ECG signal processing method and arrhythmia detection system |
| Title |
|---|
| BINHANG YUAN ET AL: "Diagnosing Cardiac Abnormalities from 12-Lead Electrocardiograms Using Enhanced Deep Convolutional Neural Networks", 《MACHINE LEARNING AND MEDICAL ENGINEERING FOR CARDIOVASCULAR HEALTH AND INTRAVASCULAR IMAGING AND COMPUTER ASSISTED STENTING》* |
| MELANIE DUCOFFE ET AL: "Active learning strategy for CNN combining", 《ESANN 2017 PROCEEDINGS, EUROPEAN SYMPOSIUM ON ARTIFICIAL NEURAL NETWORKS, COMPUTATIONAL INTELLIGENCE AND MACHINE LEARNING》* |
| 王珍钰: "基于不确定性的主动学习算法研究", 《中国优秀硕士学位论文全文数据库信息科技辑》* |
| 邓力等: "基于心拍的端到端心律失常分类", 《南方医科大学学报》* |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113712564A (en)* | 2020-05-12 | 2021-11-30 | 深圳市科瑞康实业有限公司 | Electrocardiosignal classification device and method |
| CN113712564B (en)* | 2020-05-12 | 2023-09-01 | 深圳市科瑞康实业有限公司 | Electrocardiogram signal classification equipment and method |
| CN113712525A (en)* | 2020-05-21 | 2021-11-30 | 深圳市理邦精密仪器股份有限公司 | Physiological parameter processing method and device and medical equipment |
| CN113712525B (en)* | 2020-05-21 | 2024-07-12 | 深圳市理邦精密仪器股份有限公司 | Physiological parameter processing method and device and medical equipment |
| CN112022142A (en)* | 2020-08-07 | 2020-12-04 | 上海联影智能医疗科技有限公司 | Electrocardiosignal type identification method, device and medium |
| CN112022142B (en)* | 2020-08-07 | 2023-10-17 | 上海联影智能医疗科技有限公司 | Electrocardiosignal type identification method, device and medium |
| CN113974649A (en)* | 2021-12-03 | 2022-01-28 | 上海交通大学医学院附属瑞金医院 | Method, apparatus and medium for classification of heart beat signals and training of deep learning models for classification of heart beat signals |
| CN113974649B (en)* | 2021-12-03 | 2025-02-14 | 上海交通大学医学院附属瑞金医院 | Classification method, device and medium of heartbeat signal based on deep learning |
| CN115251944A (en)* | 2022-07-25 | 2022-11-01 | 清华大学 | Heartbeat classification method and device based on electrocardiogram diagnosis report |
| CN115381462A (en)* | 2022-09-26 | 2022-11-25 | 上海乐普云智科技股份有限公司 | Electrocardiosignal processing method and device |
| CN116509414A (en)* | 2023-04-14 | 2023-08-01 | 中国科学院大学 | Electrocardiosignal denoising classification system and method |
| CN116509414B (en)* | 2023-04-14 | 2023-12-15 | 中国科学院大学 | An ECG signal denoising classification system and method |
| Publication | Publication Date | Title |
|---|---|---|
| Çınar et al. | Classification of normal sinus rhythm, abnormal arrhythmia and congestive heart failure ECG signals using LSTM and hybrid CNN-SVM deep neural networks | |
| CN111449645B (en) | Intelligent classification and recognition method of electrocardiogram heartbeat | |
| US10869610B2 (en) | System and method for identifying cardiac arrhythmias with deep neural networks | |
| CN110693488A (en) | ECG signal processing system, method, electronic device and readable storage medium | |
| CN109171712B (en) | Atrial fibrillation identification method, atrial fibrillation identification device, atrial fibrillation identification equipment and computer readable storage medium | |
| CN108714026B (en) | Fine-grained electrocardiosignal classification method based on deep convolutional neural network and online decision fusion | |
| Abibullaev et al. | A new QRS detection method using wavelets and artificial neural networks | |
| CN111107785A (en) | Detecting atrial fibrillation using short single lead ECG recordings | |
| CN110840402A (en) | Atrial fibrillation signal identification method and system based on machine learning | |
| CN109758145B (en) | An automatic sleep staging method based on the causal relationship of EEG signals | |
| CN113057648A (en) | ECG signal classification method based on composite LSTM structure | |
| CN109948396B (en) | Heart beat classification method, heart beat classification device and electronic equipment | |
| CN113995419A (en) | A risk prediction system for atrial fibrillation based on heartbeat rhythm signal and its application | |
| CN113180688A (en) | Coronary heart disease electrocardiogram screening system and method based on residual error neural network | |
| Mahesh et al. | ECG arrhythmia classification based on logistic model tree | |
| Majhi et al. | Explainable AI-driven machine learning for heart disease detection using ECG signal | |
| CN115337018A (en) | Electrocardiosignal classification method and system based on overall dynamic characteristics | |
| CN117582235A (en) | ECG signal classification method based on CNN-LSTM model | |
| Kharshid et al. | Classification of short-time single-lead ECG recordings using deep residual CNN | |
| Sultana et al. | MSVM-based classifier for cardiac arrhythmia detection | |
| CN115429284B (en) | Electrocardiogram signal classification method, system, computer device and readable storage medium | |
| CN108836312B (en) | Clutter rejection method and system based on artificial intelligence | |
| Golpaygani et al. | Detection and identification of S1 and S2 heart sounds using wavelet decomposition method | |
| CN113712525B (en) | Physiological parameter processing method and device and medical equipment | |
| Shafaatfar et al. | Improving the efficiency of automatic cardiac arrhythmias classification by a novel patient-specific feature space mapping |
| 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 | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication | Application publication date:20200117 |