CN115886833A - Electrocardiosignal classification method and device, computer readable medium and electronic equipment - Google Patents
Electrocardiosignal classification method and device, computer readable medium and electronic equipment Download PDFInfo
- Publication number
- CN115886833A CN115886833A CN202211600433.1A CN202211600433A CN115886833A CN 115886833 A CN115886833 A CN 115886833A CN 202211600433 A CN202211600433 A CN 202211600433A CN 115886833 A CN115886833 A CN 115886833A
- Authority
- CN
- China
- Prior art keywords
- ecg signal
- classification
- feature extraction
- ecg
- dimensional image
- 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
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
本公开具体涉及计算机技术领域,具体涉及一种心电信号分类方法及装置、计算机可读介质,以及电子设备。所述方法包括:对待处理心电信号进行预处理,获取各心拍对应的二维图像;将所述二维图像输入基于VGG网络的心电信号分类模型,利用连续的若干个特征提取单元对所述二维图像进行特征提取,输出特征图;其中,所述特征提取单元包括:基于Ghost Module的卷积层、最大池化层;利用分类单元根据特征图进行分类,获取所述待处理心电信号对应的分类结果。本方案能够实现轻量级的心电信号分类模型结构,能够易于部署在处理能力有限的边缘便携式设备上。
The present disclosure specifically relates to the field of computer technology, in particular to a method and device for classifying electrocardiographic signals, a computer-readable medium, and electronic equipment. The method includes: preprocessing the ECG signal to be processed, and obtaining two-dimensional images corresponding to each cardiac beat; inputting the two-dimensional images into an ECG signal classification model based on a VGG network, and using several continuous feature extraction units to analyze the The two-dimensional image is subjected to feature extraction, and a feature map is output; wherein, the feature extraction unit includes: a convolutional layer based on Ghost Module, a maximum pooling layer; a classification unit is used to classify according to the feature map, and obtain the electrocardiogram to be processed The classification result corresponding to the signal. This solution can realize a lightweight ECG signal classification model structure, and can be easily deployed on edge portable devices with limited processing capabilities.
Description
技术领域Technical Field
本公开涉及计算机技术领域,具体涉及一种心电信号分类方法、一种心电信号分类装置、一种计算机可读介质,以及一种电子设备。The present disclosure relates to the field of computer technology, and in particular to an electrocardiogram signal classification method, an electrocardiogram signal classification device, a computer-readable medium, and an electronic device.
背景技术Background Art
心电图(electrocardiogram,ECG)是诊断心血管疾病最广泛采用的临床方法。在相关技术中,为了保证心电信号分类的性能,大多采用基于深度学习的心电信号分类方法。为了提高模型精度,相关算法通常采用计算密集的网络模型,需要很高的计算量和内存容量。但是,这样的方案并不适用于边缘计算场景下的容量和处理能力受限的可穿戴设备。Electrocardiogram (ECG) is the most widely used clinical method for diagnosing cardiovascular diseases. In related technologies, in order to ensure the performance of ECG signal classification, most ECG signal classification methods based on deep learning are used. In order to improve the accuracy of the model, related algorithms usually use computationally intensive network models, which require high computing power and memory capacity. However, such a solution is not suitable for wearable devices with limited capacity and processing power in edge computing scenarios.
需要说明的是,在上述背景技术部分公开的信息仅用于加强对本公开的背景的理解,因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field.
发明内容Summary of the invention
本公开提供一种心电信号分类方法、一种心电信号分类装置、一种计算机可读介质,以及一种电子设备,能够有效克服现有技术中存在的模型复杂,计算量高,不能适用边缘计算场景下的容量和处理能力受限的可穿戴设备的缺陷。The present disclosure provides an electrocardiogram signal classification method, an electrocardiogram signal classification device, a computer-readable medium, and an electronic device, which can effectively overcome the defects of the prior art such as complex models, high computational complexity, and inability to be applied to wearable devices with limited capacity and processing power in edge computing scenarios.
本公开的其他特性和优点将通过下面的详细描述变得显然,或部分地通过本公开的实践而习得。Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
根据本公开的第一方面,提供一种心电信号分类方法,所述方法包括:According to a first aspect of the present disclosure, a method for classifying an electrocardiogram signal is provided, the method comprising:
对待处理心电信号进行预处理,获取各心拍对应的二维图像;Preprocess the ECG signal to be processed to obtain a two-dimensional image corresponding to each heartbeat;
将所述二维图像输入基于VGG网络的心电信号分类模型,利用连续的若干个特征提取单元对所述二维图像进行特征提取,输出特征图;其中,所述特征提取单元包括:基于Ghost Module的卷积层、最大池化层;Input the two-dimensional image into an electrocardiogram signal classification model based on a VGG network, extract features from the two-dimensional image using a plurality of continuous feature extraction units, and output a feature map; wherein the feature extraction unit includes: a convolution layer and a maximum pooling layer based on a Ghost Module;
利用分类单元根据特征图进行分类,获取所述待处理心电信号对应的分类结果。The classification unit is used to perform classification according to the feature map to obtain the classification result corresponding to the electrocardiogram signal to be processed.
在一些示例性实施方式中,所述对待处理心电信号进行预处理,获取各心拍对应的二维图像,包括:In some exemplary embodiments, preprocessing the electrocardiogram signal to be processed to obtain a two-dimensional image corresponding to each heartbeat includes:
对待处理心电信号进行分割,获取对应的心拍信号;Segment the ECG signal to be processed and obtain the corresponding heart beat signal;
对所述心拍信号进行转换,获取心拍信号对应的灰度形式的二维图像。The heartbeat signal is converted to obtain a two-dimensional image in grayscale format corresponding to the heartbeat signal.
在一些示例性实施方式中,所述方法还包括:训练所述心电信号分类模型,包括:In some exemplary embodiments, the method further comprises: training the ECG signal classification model, comprising:
采集已标记的心电样本数据,根据R波峰值对心电样本数据进行切片以获取心拍样本数据;Collecting marked ECG sample data, and slicing the ECG sample data according to the R wave peak value to obtain heart beat sample data;
对心拍样本数据进行转换,以获取对应的二维图像样本数据,作为训练样本数据;Convert the heartbeat sample data to obtain corresponding two-dimensional image sample data as training sample data;
对所述训练样本数据进行划分,获取对应的训练集、验证集和测试集;Dividing the training sample data to obtain corresponding training sets, validation sets and test sets;
将所述训练集输入基于VGG网络的心电信号分类模型进行模型训练至模型收敛;并将所述验证集输入心电信号分类模型对模型进行验证;Input the training set into the ECG signal classification model based on the VGG network to perform model training until the model converges; and input the verification set into the ECG signal classification model to verify the model;
将所述测试集数据输入已训练完成的心电信号分类模型,输出对应的心电信号分类结果。The test set data is input into the trained ECG signal classification model, and the corresponding ECG signal classification result is output.
在一些示例性实施方式中,所述方法还包括:In some exemplary embodiments, the method further comprises:
对所述二维图像样本数据按预设裁剪规则进行裁剪,以获取裁剪图像;Cropping the two-dimensional image sample data according to a preset cropping rule to obtain a cropped image;
对所述裁剪图像进行尺寸变换以获取增强图像样本数据,并作为所述训练样本数据。The cropped image is resized to obtain enhanced image sample data, which is used as the training sample data.
在一些示例性实施方式中,所述基于VGG网络的心电信号分类模型包括连续设置的多个特征提取单元,以及分类单元;其中,所述特征提取单元包括依次设置的至少两个基于Ghost Module的卷积层,以及最大池化层;所述分类单元包括依次设置的第一全连接层、第二全连接层。In some exemplary embodiments, the VGG network-based ECG signal classification model includes a plurality of feature extraction units arranged in series, and a classification unit; wherein the feature extraction unit includes at least two Ghost Module-based convolutional layers and a maximum pooling layer arranged in sequence; the classification unit includes a first fully connected layer and a second fully connected layer arranged in sequence.
在一些示例性实施方式中,所述第一全连接层、第二全连接层之间设置有dropout层。In some exemplary embodiments, a dropout layer is provided between the first fully connected layer and the second fully connected layer.
在一些示例性实施方式中,心电信号的类型包括:NOR类型、PVC类型、APC类型、RBBB类型和LBBB类型中的任意一项。In some exemplary embodiments, the type of the ECG signal includes any one of a NOR type, a PVC type, an APC type, a RBBB type, and a LBBB type.
根据本公开的第二方面,提供一种心电信号分类装置,包括:According to a second aspect of the present disclosure, there is provided an electrocardiogram signal classification device, comprising:
预处理模块,用于对待处理心电信号进行预处理,获取各心拍对应的二维图像;A preprocessing module, used to preprocess the ECG signal to be processed and obtain a two-dimensional image corresponding to each heartbeat;
特征提取模块,用于将所述二维图像输入基于VGG网络的心电信号分类模型,利用连续的若干个特征提取单元对所述二维图像进行特征提取,输出特征图;其中,所述特征提取单元包括:基于Ghost Module的卷积层、最大池化层;A feature extraction module, used to input the two-dimensional image into an ECG signal classification model based on a VGG network, perform feature extraction on the two-dimensional image using a plurality of consecutive feature extraction units, and output a feature map; wherein the feature extraction unit includes: a convolution layer and a maximum pooling layer based on a Ghost Module;
分类结果输出模块,用于利用分类单元根据特征图进行分类,获取所述待处理心电信号对应的分类结果。The classification result output module is used to use the classification unit to perform classification according to the feature map to obtain the classification result corresponding to the electrocardiogram signal to be processed.
根据本公开的第三方面,提供一种计算机可读介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述的心电信号分类方法。According to a third aspect of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned electrocardiogram signal classification method is implemented.
根据本公开的第四方面,提供一种电子设备,包括:According to a fourth aspect of the present disclosure, there is provided an electronic device, including:
处理器;以及Processor; and
存储器,用于存储所述处理器的可执行指令;A memory, configured to store executable instructions of the processor;
其中,所述处理器配置为经由执行所述可执行指令时实现上述的心电信号分类方法。Wherein, the processor is configured to implement the above-mentioned electrocardiogram signal classification method by executing the executable instructions.
本公开的一种实施例所提供的心电信号分类方法,通过对待处理心电信号进行预处理来获取各心拍对应的二维图像;在将二维图像输入基于VGG网络的心电信号分类模型,利用连续的若干个特征提取单元对所述二维图像进行特征提取,输出特征图;再利用分类单元根据特征图进行分类,获取所述待处理心电信号对应的分类结果。通过将心电信号的二维图像作为模型的输入,并使用基于VGG网络的心电信号分类模型,可以不需要对待处理心电信号进行噪声过滤,并能够实现轻量级的心电信号分类模型结构,能够易于部署在处理能力有限的边缘便携式设备上。An ECG signal classification method provided by an embodiment of the present disclosure obtains a two-dimensional image corresponding to each heartbeat by preprocessing the ECG signal to be processed; after inputting the two-dimensional image into an ECG signal classification model based on a VGG network, a plurality of continuous feature extraction units are used to extract features from the two-dimensional image and output a feature map; and then a classification unit is used to classify according to the feature map to obtain a classification result corresponding to the ECG signal to be processed. By using the two-dimensional image of the ECG signal as the input of the model and using the ECG signal classification model based on a VGG network, it is not necessary to perform noise filtering on the ECG signal to be processed, and a lightweight ECG signal classification model structure can be realized, which can be easily deployed on edge portable devices with limited processing capabilities.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
图1示意性示出本公开示例性实施例中一种心电信号分类方法的示意图;FIG1 schematically shows a schematic diagram of an electrocardiogram signal classification method in an exemplary embodiment of the present disclosure;
图2示意性示出本公开示例性实施例一种心电分类模型的模型架构的示意图;FIG2 schematically shows a schematic diagram of a model architecture of an electrocardiogram classification model according to an exemplary embodiment of the present disclosure;
图3示意性示出本公开示例性实施例一种心电信号分类模型训练的损失函数的变化状态的示意图;FIG3 schematically shows a schematic diagram of a change state of a loss function for training an electrocardiogram signal classification model according to an exemplary embodiment of the present disclosure;
图4示意性示出本公开示例性实施例中一种心电信号分类模型训练的模型精度变化状态的示意图;FIG4 schematically shows a schematic diagram of a model accuracy change state of an electrocardiogram signal classification model training in an exemplary embodiment of the present disclosure;
图5示意性示出本公开示例性实施例中一种心电信号分类模型的分类结果混淆矩阵的示意图;FIG5 schematically shows a schematic diagram of a confusion matrix of classification results of an electrocardiogram signal classification model in an exemplary embodiment of the present disclosure;
图6示意性示出本公开示例性实施例中一种心电信号分类装置的组成示意图;FIG6 schematically shows a composition diagram of an electrocardiogram signal classification device in an exemplary embodiment of the present disclosure;
图7示意性示出本公开示例性实施例中一种电子设备的组成示意图。FIG. 7 schematically shows a composition diagram of an electronic device in an exemplary embodiment of the present disclosure.
具体实施方式DETAILED DESCRIPTION
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
此外,附图仅为本公开的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and/or processor devices and/or microcontroller devices.
针对现有技术的缺点和不足,本示例实施方式中提供了一种心电信号分类方法,可以应用于手机、运动手表、智能手环等低配置、低功耗的可穿戴智能电子设备。参考图1中所示,上述的心电信号分析方法可以包括:In view of the shortcomings and deficiencies of the prior art, this example embodiment provides an ECG signal classification method that can be applied to low-configuration, low-power wearable smart electronic devices such as mobile phones, sports watches, and smart bracelets. Referring to FIG1 , the ECG signal analysis method may include:
步骤S11,对待处理心电信号进行预处理,获取各心拍对应的二维图像;Step S11, preprocessing the ECG signal to be processed to obtain a two-dimensional image corresponding to each heartbeat;
步骤S12,将所述二维图像输入基于VGG网络的心电信号分类模型,利用连续的若干个特征提取单元对所述二维图像进行特征提取,输出特征图;其中,所述特征提取单元包括:基于Ghost Module的卷积层、最大池化层;Step S12, inputting the two-dimensional image into an ECG signal classification model based on a VGG network, extracting features from the two-dimensional image using a plurality of consecutive feature extraction units, and outputting a feature map; wherein the feature extraction unit includes: a convolution layer and a maximum pooling layer based on a Ghost Module;
步骤S13,利用分类单元根据特征图进行分类,获取所述待处理心电信号对应的分类结果。Step S13, using a classification unit to perform classification according to the feature graph, to obtain a classification result corresponding to the electrocardiogram signal to be processed.
本示例实施方式所提供的心电信号分类方法,能够简化对心电信号的预处理过程,在将心电信号分割成心拍后转换为对应的二维图像,并作为心电信号分类模型的输入数据;利用已训练的基于VGG网络的心电信号分类模型进行分类,得到待处理心电信号的分类结果。通过将二维图像作为模型的输入数据,避免了额外的噪声过滤和特征提取步骤。并且,通过使用基于VGG网络的心电信号分类模型进行分类,Ghost-VGG-16网络更适合于性能受限的边缘计算设备,能够在较低的计算和内存成本下取到了99.74%的平均准确率。The ECG signal classification method provided in this example implementation can simplify the preprocessing process of the ECG signal. After the ECG signal is segmented into heartbeats, it is converted into a corresponding two-dimensional image and used as the input data of the ECG signal classification model; the trained ECG signal classification model based on the VGG network is used for classification to obtain the classification result of the ECG signal to be processed. By using the two-dimensional image as the input data of the model, additional noise filtering and feature extraction steps are avoided. In addition, by using the ECG signal classification model based on the VGG network for classification, the Ghost-VGG-16 network is more suitable for edge computing devices with limited performance, and can achieve an average accuracy of 99.74% at a lower computing and memory cost.
下面,将结合附图及实施例对本示例实施方式中的心电信号分类方法的各个步骤进行更详细的说明。In the following, each step of the electrocardiogram signal classification method in this exemplary implementation will be described in more detail with reference to the accompanying drawings and embodiments.
在步骤S11中,对待处理心电信号进行预处理,获取各心拍对应的二维图像。In step S11, the electrocardiographic signal to be processed is preprocessed to obtain a two-dimensional image corresponding to each heartbeat.
本示例实施方式中,上述的步骤S11可以包括:In this example implementation, the above step S11 may include:
步骤S111,对待处理心电信号进行分割,获取对应的心拍信号;Step S111, segmenting the ECG signal to be processed to obtain the corresponding heart beat signal;
步骤S112,对所述心拍信号进行转换,获取心拍信号对应的灰度形式的二维图像。Step S112: convert the heartbeat signal to obtain a two-dimensional image in grayscale format corresponding to the heartbeat signal.
具体而言,待处理心电信号可以是用户佩戴的智能穿戴设备实时采集的心电信号。例如,可以是一段时长内的心电信号。例如,可以预先在智能可穿戴设备上配置心电信号的采集、分类周期;并按照该指定的数据采集周期采集一段时长的心电信号,并生成对应的心电信号分类任务,并添加到任务列表中。例如,心电信号的采集周期可以是10秒、30秒或者60秒等等,具体时长可以根据用户自定义时长设置。Specifically, the ECG signal to be processed may be an ECG signal collected in real time by a smart wearable device worn by a user. For example, it may be an ECG signal within a period of time. For example, the ECG signal collection and classification cycle may be configured in advance on the smart wearable device; and the ECG signal for a period of time may be collected according to the specified data collection cycle, and the corresponding ECG signal classification task may be generated and added to the task list. For example, the ECG signal collection cycle may be 10 seconds, 30 seconds, or 60 seconds, etc., and the specific duration may be set according to the user-defined duration.
对于采集的待处理心电信号,可以对其进行心拍分割,得到对应的心拍信号,再将心拍信号转换为对应的二维灰度图像。具体的,一个完整心电信号心拍周期持续时间在0.6s到0.8s之间,一个完整心拍采样点数在216到288之间。根据R波峰值时间对每个心电信号节拍进行切片,以R波为基准,左右两侧各取150和149个点,一共300个点作为一个心拍。对于心拍信号,可以利用2D-CNN(二维卷积神经网络)将ECG信号转换为ECG图像形式。2D-CNN和池化层更适合提取ECG图像的空间局部性,这也可以解决一些ECG节拍在噪声过滤和特征提取中容易被忽略的问题。截取的一维ECG数据被转换成单个二维128*128灰度图像,获得ECG数据后,无需进行噪声滤波和特征提取步骤。For the collected ECG signal to be processed, the heartbeat segmentation can be performed to obtain the corresponding heartbeat signal, and then the heartbeat signal can be converted into the corresponding two-dimensional grayscale image. Specifically, the duration of a complete ECG signal heartbeat cycle is between 0.6s and 0.8s, and the number of sampling points of a complete heartbeat is between 216 and 288. Each ECG signal beat is sliced according to the R wave peak time. Taking the R wave as the reference, 150 and 149 points are taken on the left and right sides, and a total of 300 points are taken as a heartbeat. For the heartbeat signal, the ECG signal can be converted into an ECG image using 2D-CNN (two-dimensional convolutional neural network). 2D-CNN and pooling layers are more suitable for extracting the spatial locality of ECG images, which can also solve the problem that some ECG beats are easily ignored in noise filtering and feature extraction. The intercepted one-dimensional ECG data is converted into a single two-dimensional 128*128 grayscale image. After obtaining the ECG data, there is no need to perform noise filtering and feature extraction steps.
在步骤S12中,将所述二维图像输入基于VGG网络的心电信号分类模型,利用连续的若干个特征提取单元对所述二维图像进行特征提取,输出特征图;其中,所述特征提取单元包括:基于Ghost Module的卷积层、最大池化层。In step S12, the two-dimensional image is input into an ECG signal classification model based on a VGG network, and features of the two-dimensional image are extracted using a plurality of consecutive feature extraction units to output a feature map; wherein the feature extraction unit includes: a convolution layer and a maximum pooling layer based on a Ghost Module.
本示例实施方式中,具体来说,参考图2所示,心电分类模型20可以包括连续设置的五个特征提取单元(第一特征提取单元201、第二特征提取单元202、第三特征提取单元203、第四特征提取单元204、第五特征提取单元205)以及分类单元。各特征提取单元可以包括至少两个基于Ghost Module的卷积层,以及最大池化层。举例来说,参考表1所示,第一特征提取单元、第二特征提取单元可以包括连续设置的两个基于Ghost Module的卷积层,以及Maxpooling最大池化层;第三特征提取单元、第四特征提取单元、第五特征提取单元可以包括设置的三个基于Ghost Module的卷积层,以及Maxpooling最大池化层。分类单元可以包括第一全连接层FC、第二全连接层FC。其中,第一全连接层仅包含512个神经元,第二个全连接层也是输出层,使用Softmax函数对数据进行分类并输出分类结果。In this example implementation, specifically, with reference to FIG2, the
表1Table 1
在步骤S13中,利用分类单元根据特征图进行分类,获取所述待处理心电信号对应的分类结果。In step S13, a classification unit is used to perform classification according to the feature map to obtain a classification result corresponding to the electrocardiogram signal to be processed.
本示例实施方式中,参考表1所示的模型结构,分类单元可以包括连续设置的两个第一全连接层和第二全连接层。全连接层可以使用Softmax函数对数据进行分类并输出心电信号的分类结果。In this example implementation, referring to the model structure shown in Table 1, the classification unit may include two first fully connected layers and a second fully connected layer that are consecutively arranged. The fully connected layer may use a Softmax function to classify the data and output the classification result of the ECG signal.
此外,在第一全连接层和第二全连接层之间还可以设置有dropout层,执行dropout操作,以0.5的概率舍去全连接层中的神经元数量,避免过度拟合现象。In addition, a dropout layer may be provided between the first fully connected layer and the second fully connected layer to perform a dropout operation and discard the number of neurons in the fully connected layer with a probability of 0.5 to avoid overfitting.
本示例实施方式中,心电信号的类型包括:正常波动(NOR)类型、室性早搏(PVC)类型、房性早搏(APC)类型、右束支传导阻滞搏动(RBBB)类型和左束支传导阻滞搏动(LBBB)类型中的任意一项。In this example implementation, the type of the ECG signal includes any one of a normal fluctuation (NOR) type, a premature ventricular contraction (PVC) type, a premature atrial contraction (APC) type, a right bundle branch block beat (RBBB) type, and a left bundle branch block beat (LBBB) type.
本示例实施方式中,上述方法还可以包括:训练所述心电信号分类模型。具体而言,训练模型具体可以包括:In this example implementation, the above method may further include: training the electrocardiogram signal classification model. Specifically, the training model may include:
步骤S31,采集已标记的心电样本数据,根据R波峰值对心电样本数据进行切片以获取心拍样本数据;Step S31, collecting the marked ECG sample data, and slicing the ECG sample data according to the R wave peak value to obtain heart beat sample data;
步骤S32,对心拍样本数据进行转换,以获取对应的二维图像样本数据,作为训练样本数据;Step S32, converting the heartbeat sample data to obtain corresponding two-dimensional image sample data as training sample data;
步骤S33,对所述训练样本数据进行划分,获取对应的训练集、验证集和测试集;Step S33, dividing the training sample data to obtain corresponding training sets, validation sets and test sets;
步骤S34,将所述训练集输入基于VGG网络的心电信号分类模型进行模型训练至模型收敛;并将所述验证集输入心电信号分类模型对模型进行验证;Step S34, inputting the training set into the ECG signal classification model based on the VGG network to perform model training until the model converges; and inputting the verification set into the ECG signal classification model to verify the model;
步骤S35,将所述测试集数据输入已训练完成的心电信号分类模型,输出对应的心电信号分类结果。Step S35, inputting the test set data into the trained ECG signal classification model, and outputting the corresponding ECG signal classification result.
本示例实施方式中,具体来说,在上述的步骤S31中,已标记的心电样本数据可以采集麻省理工学院的MIT-BIH心律失常数据库。该数据库包含从47名志愿者的48个30分钟长度双通道动态心电图记录中获得的不同节拍类型。由两个或两个以上独立的心电专家对记录的所有心拍诊断并标记,确保了结果正确性。因为MIT-BIH数据库采样频率为360Hz,所以一个完整心电信号心拍周期持续时间在0.6s到0.8s之间,一个完整心拍采样点数在216到288之间。根据R波峰值时间对每个心电图节拍进行切片,以R波为基准,左右两侧各取150和149个点,一共300个点作为一个心拍。根据时间信息,单个ECG搏动范围可定义如下:In this example implementation, specifically, in the above-mentioned step S31, the labeled ECG sample data can be collected from the MIT-BIH arrhythmia database of the Massachusetts Institute of Technology. The database contains different beat types obtained from 48 30-minute dual-channel dynamic electrocardiogram records of 47 volunteers. Two or more independent ECG experts diagnose and mark all recorded heartbeats to ensure the correctness of the results. Because the sampling frequency of the MIT-BIH database is 360Hz, the duration of a complete ECG signal heartbeat cycle is between 0.6s and 0.8s, and the number of sampling points for a complete heartbeat is between 216 and 288. Each ECG beat is sliced according to the R wave peak time, and 150 and 149 points are taken on the left and right sides respectively, with a total of 300 points as a heartbeat. Based on the time information, the range of a single ECG beat can be defined as follows:
T(Rpeak(n)-150)≤T(n)≤T(Rpeak(n)+149)T(R peak (n)-150)≤T(n)≤T(R peak (n)+149)
本示例实施方式中,在上述的步骤S32中,可以采用二维卷积神经网络将ECG信号转换为ECG图像形式,是因为2D-CNN和池化层更适合提取ECG图像的空间局部性,这也可以解决一些ECG节拍在噪声过滤和特征提取中容易被忽略的问题。截取的一维ECG数据被转换成单个二维128*128灰度图像,获得ECG数据后,无需进行噪声滤波和特征提取步骤。MIT-BIH数据库包含约110000条ECG记录,从中选择45987张图像作为实验样本。实验数据集包括五种ECG节拍类型,分别称为NOR、PVC、APC、RBBB和LBBB。In this example implementation, in the above-mentioned step S32, a two-dimensional convolutional neural network can be used to convert the ECG signal into an ECG image form because the 2D-CNN and pooling layer are more suitable for extracting the spatial locality of the ECG image, which can also solve the problem that some ECG beats are easily ignored in noise filtering and feature extraction. The intercepted one-dimensional ECG data is converted into a single two-dimensional 128*128 grayscale image. After obtaining the ECG data, no noise filtering and feature extraction steps are required. The MIT-BIH database contains approximately 110,000 ECG records, from which 45,987 images are selected as experimental samples. The experimental data set includes five ECG beat types, namely NOR, PVC, APC, RBBB and LBBB.
本示例实施方式中,在上述的步骤S33中,可以将所有数据分为三部分:训练集、验证集和测试集,其中60%的数据用于训练神经网络,20%作为验证集,20%用于测试阶段。实验数据集划分如表2所示。In this example implementation, in the above step S33, all data can be divided into three parts: training set, validation set and test set, where 60% of the data is used to train the neural network, 20% as the validation set, and 20% for the test phase. The experimental data set division is shown in Table 2.
表2Table 2
此外,本示例实施方式中,上述方法还可以包括:对所述二维图像样本数据按预设裁剪规则进行裁剪,以获取裁剪图像;以及,对所述裁剪图像进行尺寸变换以获取增强图像样本数据,并作为所述训练样本数据。In addition, in this example implementation, the method may further include: cropping the two-dimensional image sample data according to a preset cropping rule to obtain a cropped image; and resizing the cropped image to obtain enhanced image sample data as the training sample data.
具体而言,对于转换后的二维图像,还可以对其进行数据增强处理。具体的,对于转换的二维心拍图像,可以进一步使用数据增强技术来扩展数据集,以避免过度拟合问题。因此,使用了九种不同的裁剪方法(左上、中上、右上、中上、右中、左下、中下和右下)来增强ECG异常类别。作为裁剪的结果,我们获得了多个缩小尺寸(96×96)的ECG图像,然后将其调整为128×128图像。Specifically, for the converted two-dimensional images, data augmentation can also be performed on them. Specifically, for the converted two-dimensional heartbeat images, data augmentation techniques can be further used to expand the dataset to avoid overfitting problems. Therefore, nine different cropping methods (upper left, upper middle, upper right, upper middle, middle right, lower left, lower middle, and lower right) are used to enhance the ECG abnormality category. As a result of cropping, we obtain multiple ECG images of reduced size (96×96), which are then resized to 128×128 images.
本示例实施方式中,心电信号分类模型的激活函数使用指数线性单元(Exponential linear unit,ELU)代替Relu,提供了一个较小的负值。ELU函数具体可以包括:In this example implementation, the activation function of the ECG signal classification model uses an exponential linear unit (ELU) instead of ReLU, providing a smaller negative value. The ELU function may specifically include:
其中,超参数γ的值可以设置为1.0。Among them, the value of the hyperparameter γ can be set to 1.0.
本示例实施方式中,所述基于VGG网络的心电信号分类模型包括连续设置的多个特征提取单元,以及分类单元;其中,所述特征提取单元包括依次设置的至少两个基于Ghost Module的卷积层,以及最大池化层;所述分类单元包括依次设置的第一全连接层、第二全连接层。In this example implementation, the VGG network-based ECG signal classification model includes a plurality of feature extraction units arranged in series, and a classification unit; wherein the feature extraction unit includes at least two convolutional layers based on Ghost Module arranged in sequence, and a maximum pooling layer; the classification unit includes a first fully connected layer and a second fully connected layer arranged in sequence.
本示例实施方式中,所述第一全连接层、第二全连接层之间设置有dropout层。In this example implementation, a dropout layer is provided between the first fully connected layer and the second fully connected layer.
具体的,在已有的VGG-16网络模型的架构中,随着网络层数的增加,即使使用小的卷积核叠加,VGGNet-16模型参数量仍然非常大。针对VGG-16网络模型参数量大、计算量大、推理速度慢等问题,本方案遵循VGG-16的基本网络结构,参考表1所示,使用Ghost Module代替VGG-16网络中的传统卷积层,减少了参数量和计算量,从而实现网络模型轻量化,有利于便携式设备的应用。Specifically, in the existing VGG-16 network model architecture, as the number of network layers increases, even with the use of small convolution kernel stacking, the number of VGGNet-16 model parameters is still very large. In view of the problems of large number of parameters, large amount of calculation, and slow reasoning speed of the VGG-16 network model, this solution follows the basic network structure of VGG-16, as shown in Table 1, and uses Ghost Module to replace the traditional convolution layer in the VGG-16 network, reducing the number of parameters and calculation, thereby achieving lightweight network models, which is conducive to the application of portable devices.
本示例实施方式中,心电信号分类模型的输入是相对简单的128×128灰度图像,目前经典的卷积神经网络模型对全连接层的要求一般不高。因此,办方案也修改了VGG-16的全连接层,第一个全连接层仅包含512个神经元,第二个全连接层也是输出层,使用Softmax函数对数据进行分类并输出心律失常类型,即NOR、LBBB、RBBB、PVC和APC。全连接层之间添加了一个dropout操作,以0.5的概率舍去完全连接层中的神经元数量,避免过度拟合现象。Ghost-VGG-16的具体步骤如表1所示,Ghost Module和Maxpooling表示特征提取步骤,全连接层表示分类步骤。In this example implementation, the input of the ECG signal classification model is a relatively simple 128×128 grayscale image. The current classic convolutional neural network model generally does not have high requirements for the fully connected layer. Therefore, the solution also modified the fully connected layer of VGG-16. The first fully connected layer contains only 512 neurons, and the second fully connected layer is also the output layer. The Softmax function is used to classify the data and output the arrhythmia type, namely NOR, LBBB, RBBB, PVC and APC. A dropout operation is added between the fully connected layers to discard the number of neurons in the fully connected layer with a probability of 0.5 to avoid overfitting. The specific steps of Ghost-VGG-16 are shown in Table 1. Ghost Module and Maxpooling represent the feature extraction steps, and the fully connected layer represents the classification step.
其中,Ghost Module的主要思想是以一种更具成本效益的方式,用一系列简单的线性操作代替传统卷积的一部分。具体地,传统卷积被分为两部分,其中第一部分使用传统卷积来生成一半的特征图,然后利用廉价的线性变换来获得特征映射的另外一部分,该部分与先前生成的特征图相结合以获得更多的特征图。Ghost Module中的线性变换可以用通道卷积代替,在不改变输出特征图大小的同时,还可以减少Ghost模块中的参数量和计算量。The main idea of Ghost Module is to replace part of the traditional convolution with a series of simple linear operations in a more cost-effective way. Specifically, the traditional convolution is divided into two parts, where the first part uses traditional convolution to generate half of the feature map, and then uses cheap linear transformation to obtain the other part of the feature map, which is combined with the previously generated feature map to obtain more feature maps. The linear transformation in Ghost Module can be replaced by channel convolution, which can reduce the number of parameters and calculations in the Ghost module without changing the size of the output feature map.
假设输入特征图为H×W×M,传统卷积核大小为k×k,Ghost Module的第一部分卷积的大小为k×k,第二部分卷积核大小为d×d,输出特征图大小为H′×W′×N。传统卷积的参数量为:Assume that the input feature map is H×W×M, the size of the traditional convolution kernel is k×k, the size of the first part of the convolution of the Ghost Module is k×k, the size of the second part of the convolution kernel is d×d, and the size of the output feature map is H′×W′×N. The number of parameters of the traditional convolution is:
Ghost Module的参数量为:The parameters of Ghost Module are:
其中,和分别为Ghost Module操作使用传统卷积和线性变换的参数量;其中,in, and The parameters of traditional convolution and linear transformation are used for Ghost Module operation respectively;
传统卷积的计算量为:CalcT=H×W×M×N×k×kThe computational complexity of traditional convolution is: Calc T = H×W×M×N×k×k
Ghost Module操作的计算量为:CalcGhost=CalcConv+CalcLinear The calculation amount of Ghost Module operation is: Calc Ghost = Calc Conv + Calc Linear
其中,CalcConv和CalcLinear分别为Ghost Module操作使用传统卷积和线性变换的参数量。其中,Among them, Calc Conv and Calc Linear are the parameters of the Ghost Module operation using traditional convolution and linear transformation respectively.
使用Ghost Module操作的参数量与使用传统卷积操作的参数量的比例rParam和计算量的比例rCalc为:The ratio of the number of parameters using the Ghost Module operation to the number of parameters using the traditional convolution operation r Param and the ratio of the amount of calculation r Calc are:
通过上述公式可以得到,在获得相同数目特征图的前提下,使用Ghost Module操作可以减少约一半的参数量和计算量,推理速度也更快。From the above formula, it can be concluded that under the premise of obtaining the same number of feature maps, using the Ghost Module operation can reduce the number of parameters and calculations by about half, and the inference speed is also faster.
心电信号分类模型的损失函数可以采用交叉熵损失函数,公式可以包括:The loss function of the ECG signal classification model can adopt the cross entropy loss function, and the formula can include:
其中,n为训练数据的数量(或批量大小),y为预期值,a为输出层的实际值。Where n is the number of training data (or batch size), y is the expected value, and a is the actual value of the output layer.
本示例实施方式中,首先利用训练集和验证集对基于Ghost-VGG-16网络的心电信号分类模型进行训练。经过10次迭代,可获得模型损失函数和训练精度,分别如图3、图4所示。可以观察到,经过10次迭代后,模型逐渐变得稳定,因此我们将epoch设置为10。如图3所示,随着迭代次数的增加,损失函数也会减少,经过5次迭代后,损失函数逐渐变得稳定,这表明所提出的Ghost-VGG16网络模型已经收敛。如图4所示,随着损失函数的不断优化,训练精度和验证集精度也会提高,并逐渐稳定在0.99和1之间。在模型参数训练完毕后,保存模型,用测试集验证模型分类结果,心电信号分类模型的分类结果混淆矩阵如图5所示。在混淆矩阵中,每一行表示测试集中被模型识别的真实心拍的分类,每一列展示了在五种心拍类型中被模型识别为某种心拍类型的数量。In this example implementation, the training set and the validation set are first used to train the ECG signal classification model based on the Ghost-VGG-16 network. After 10 iterations, the model loss function and training accuracy can be obtained, as shown in Figures 3 and 4, respectively. It can be observed that after 10 iterations, the model gradually becomes stable, so we set the epoch to 10. As shown in Figure 3, as the number of iterations increases, the loss function also decreases. After 5 iterations, the loss function gradually becomes stable, which indicates that the proposed Ghost-VGG16 network model has converged. As shown in Figure 4, with the continuous optimization of the loss function, the training accuracy and the validation set accuracy will also increase, and gradually stabilize between 0.99 and 1. After the model parameters are trained, the model is saved, and the model classification results are verified with the test set. The classification result confusion matrix of the ECG signal classification model is shown in Figure 5. In the confusion matrix, each row represents the classification of the real heartbeat recognized by the model in the test set, and each column shows the number of heartbeat types recognized by the model in the five heartbeat types.
计算模型的四个评估指标值,如表3所示。The four evaluation index values of the calculated model are shown in Table 3.
表3Table 3
其中,表3中的各指标中,准确度(Accuracy,Acc)、特异性(Specificity,Sp)、敏感性(Sensitivity,Se)和阳性预测值(Positive predictive value,PPV)四个参数作为衡量分类性能的指标。Acc是正确分类的样品数量与整个测试样品数量之间的比率。Sp是正确识别为正常的阴性测试结果的分数。Se代表识别疾病的能力,Se越高,表明该方法越有可能正确诊断疾病,患者被遗漏的可能性越小。PPV反映了在诊断病例中正确检测疾病的能力。其中,各指标的定义可以包括:Among the indicators in Table 3, four parameters, namely, accuracy (Acc), specificity (Sp), sensitivity (Se) and positive predictive value (PPV), are used as indicators to measure classification performance. Acc is the ratio between the number of correctly classified samples and the total number of test samples. Sp is the fraction of negative test results correctly identified as normal. Se represents the ability to identify the disease. The higher the Se, the more likely the method is to correctly diagnose the disease and the less likely the patient is to be missed. PPV reflects the ability to correctly detect the disease in the diagnosed case. The definition of each indicator may include:
其中,真阳性(True Positive TP)表示心律失常的正确分类,真阴性(TrueNegative TN)表示正常样本的正确分类,假阳性(False Positive FP)表示心律失常的错误分类,假阴性(False Negative FN)表示正常样本的错误分类。Among them, True Positive (TP) indicates the correct classification of arrhythmia, True Negative (TN) indicates the correct classification of normal samples, False Positive (FP) indicates the incorrect classification of arrhythmia, and False Negative (FN) indicates the incorrect classification of normal samples.
将本方法的性能与其他基于VGGNet的相关算法进行了比较,如表4所示。在表4中,weights表示模型大小的参数数量,floating-point operations(Flops)表示模型的计算量,单位M表示一百万。从表5可以看出,与之前的其他工作相比,提出的Ghost-VGG-16不仅实现了优异的性能(平均灵敏度99.11%,平均特异性99.85%,平均准确度99.74%,平均阳性预测值98.76%),而且还大大减少了模型的参数量和计算量。The performance of this method is compared with other related algorithms based on VGGNet, as shown in Table 4. In Table 4, weights represents the number of parameters of the model size, floating-point operations (Flops) represents the amount of calculation of the model, and the unit M represents one million. As can be seen from Table 5, compared with other previous works, the proposed Ghost-VGG-16 not only achieves excellent performance (average sensitivity 99.11%, average specificity 99.85%, average accuracy 99.74%, average positive predictive value 98.76%), but also greatly reduces the number of parameters and the amount of calculation of the model.
表4Table 4
参考表5所示,将本发明提供的轻量型神经网络的心电信号分类模型与其他先进的ECG心律失常自动分类算法进行了比较。结果表明,所提出的基于Ghost Module的轻量型卷积神经网络Ghost-VGG-16,在Acc、Sp、Se和PPV方面达到了最佳性能。同时,与我们提出的模型相比,其他几种方法[11-17]直接使用一维CNN对心律失常进行分类,模型的分类准确率较低([15]-96.40%和[17]-93.60%)。这是得益于二维数据扩增的灵活性。与其他基于2D-CNN的算法相比,我们提出的算法在增加网络层数的前提下获得了更高的精度。As shown in Table 5, the ECG signal classification model of the lightweight neural network provided by the present invention is compared with other advanced ECG arrhythmia automatic classification algorithms. The results show that the proposed lightweight convolutional neural network Ghost-VGG-16 based on Ghost Module achieves the best performance in terms of Acc, Sp, Se and PPV. At the same time, compared with the model proposed by us, several other methods [11-17] directly use one-dimensional CNN to classify arrhythmias, and the classification accuracy of the model is lower ([15]-96.40% and [17]-93.60%). This is due to the flexibility of two-dimensional data augmentation. Compared with other algorithms based on 2D-CNN, the algorithm proposed by us achieves higher accuracy under the premise of increasing the number of network layers.
表5Table 5
通过以上比较,所发明提出的基于Ghost-VGG-16的心电信号分类模型更适合应用在边缘计算场景下的便携式设备上,从而实现ECG心律失常自动分类;信号分类结果可以用于预防心血管疾病。Through the above comparison, the invented Ghost-VGG-16-based ECG signal classification model is more suitable for application on portable devices in edge computing scenarios, thereby realizing automatic classification of ECG arrhythmias; the signal classification results can be used to prevent cardiovascular diseases.
本示例实施方式中,在测试过程中,上述的心电信号分类方法可以树莓派3B作为程序运行载体,进行低算力场景下程序的测试。树莓派是一种基于ARM的微型电脑主板,以SD/MicroSD卡为内存硬盘,卡片主板周围有1/2/4个USB接口和一个10/100以太网接口(A型没有网口),可连接键盘、鼠标和网线,同时拥有视频模拟信号的电视输出接口和HDMI高清视频输出接口,以上部件全部整合在一张仅比信用卡稍大的主板上,具备所有PC的基本功能只需接通电视机和键盘,就能执行如电子表格、文字处理、玩游戏、播放高清视频等诸多功能。Raspberry Pi B款只提供电脑板,无内存、电源、键盘、机箱。普通的计算机主板都是依靠硬盘来存储数据,但是Raspberry Pi来说使用SD卡作为“硬盘”,也可以外接USB硬盘。利用Raspberry Pi可以编辑Office文档、浏览网页、玩游戏等。Raspberry Pi的低价意味着其用途更加广泛,将其打造成极佳的多媒体中心也是一个不错的选择。In this example implementation, during the test process, the above ECG signal classification method can use Raspberry Pi 3B as a program running carrier to test the program in a low computing power scenario. Raspberry Pi is an ARM-based microcomputer motherboard with an SD/MicroSD card as a memory hard disk. There are 1/2/4 USB ports and a 10/100 Ethernet port (Type A has no network port) around the card motherboard, which can be connected to a keyboard, mouse and network cable. It also has a TV output interface for video analog signals and an HDMI high-definition video output interface. All of the above components are integrated on a motherboard that is only slightly larger than a credit card. It has all the basic functions of a PC. Just connect the TV and keyboard to perform functions such as spreadsheets, word processing, playing games, and playing high-definition videos. Raspberry Pi B only provides a computer board without memory, power supply, keyboard, or chassis. Ordinary computer motherboards rely on hard disks to store data, but Raspberry Pi uses SD cards as "hard disks" and can also connect external USB hard disks. Raspberry Pi can be used to edit Office documents, browse the web, play games, etc. The low price of the Raspberry Pi means that it has a wide range of uses, and it is also a good choice to turn it into an excellent multimedia center.
在低算力场景下程序的测试时,首先重置树莓派,应用通过算法文件的烧录,树莓派作为项目测试运行的主体,并对结果进行可视化的呈现。在该项目中,相比于PC的计算能力,应用存储、通信和计算能力较弱的树莓派更好的模拟了低算力终端的应用场景,验证了基于轻量型神经网络的心电信号自动分类模型在低算力场景的可适用性,模型对于可穿戴设备的可应用性,从而充分证明该模型在具有创新性的同时,也具备实用性。When testing the program in a low computing power scenario, first reset the Raspberry Pi, apply the algorithm file through burning, and use the Raspberry Pi as the main body of the project test run, and visualize the results. In this project, compared with the computing power of the PC, the Raspberry Pi with weaker application storage, communication and computing capabilities better simulates the application scenarios of low computing power terminals, verifies the applicability of the ECG signal automatic classification model based on lightweight neural network in low computing power scenarios, and the applicability of the model to wearable devices, thus fully proving that the model is both innovative and practical.
需要注意的是,上述附图仅是根据本发明示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。It should be noted that the above figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
进一步的,参考图6所示,本示例的实施方式中还提供一种心电信号分类装置60,所述装置包括:预处理模块601、特征提取模块602、分类结果输出模块603。其中,Further, referring to FIG6 , an electrocardiogram
所述预处理模块601可以用于对待处理心电信号进行预处理,获取各心拍对应的二维图像。The
所述特征提取模块602可以用于将所述二维图像输入基于VGG网络的心电信号分类模型,利用连续的若干个特征提取单元对所述二维图像进行特征提取,输出特征图;其中,所述特征提取单元包括:基于Ghost Module的卷积层、最大池化层。The
所述分类结果输出模块603可以用于利用分类单元根据特征图进行分类,获取所述待处理心电信号对应的分类结果。The classification
在一些示例性实施方式中,所述预处理模块601可以可以用于对待处理心电信号进行分割,获取对应的心拍信号;对所述心拍信号进行转换,获取心拍信号对应的灰度形式的二维图像。In some exemplary embodiments, the
在一些示例性实施方式中,所述装置还可以包括:模型训练模块。In some exemplary embodiments, the apparatus may further include: a model training module.
所述模型训练模块可以用于采集已标记的心电样本数据,根据R波峰值对心电样本数据进行切片以获取心拍样本数据;对心拍样本数据进行转换,以获取对应的二维图像样本数据,作为训练样本数据;对所述训练样本数据进行划分,获取对应的训练集、验证集和测试集;将所述训练集输入基于VGG网络的心电信号分类模型进行模型训练至模型收敛;并将所述验证集输入心电信号分类模型对模型进行验证;将所述测试集数据输入已训练完成的心电信号分类模型,输出对应的心电信号分类结果。The model training module can be used to collect labeled ECG sample data, slice the ECG sample data according to the R wave peak value to obtain heartbeat sample data; convert the heartbeat sample data to obtain corresponding two-dimensional image sample data as training sample data; divide the training sample data to obtain corresponding training set, verification set and test set; input the training set into the ECG signal classification model based on the VGG network to perform model training until the model converges; and input the verification set into the ECG signal classification model to verify the model; input the test set data into the trained ECG signal classification model, and output the corresponding ECG signal classification result.
在一些示例性实施方式中,所述装置还包括:数据增强模块。In some exemplary embodiments, the apparatus further comprises: a data enhancement module.
所述数据增强模块可以用于对所述二维图像样本数据按预设裁剪规则进行裁剪,以获取裁剪图像;对所述裁剪图像进行尺寸变换以获取增强图像样本数据,并作为所述训练样本数据。The data enhancement module can be used to crop the two-dimensional image sample data according to a preset cropping rule to obtain a cropped image; and to perform a size transformation on the cropped image to obtain enhanced image sample data as the training sample data.
在一些示例性实施方式中,所述基于VGG网络的心电信号分类模型包括连续设置的多个特征提取单元,以及分类单元;其中,所述特征提取单元包括依次设置的至少两个基于Ghost Module的卷积层,以及最大池化层;所述分类单元包括依次设置的第一全连接层、第二全连接层。In some exemplary embodiments, the VGG network-based ECG signal classification model includes a plurality of feature extraction units arranged in series, and a classification unit; wherein the feature extraction unit includes at least two Ghost Module-based convolutional layers and a maximum pooling layer arranged in sequence; the classification unit includes a first fully connected layer and a second fully connected layer arranged in sequence.
在一些示例性实施方式中,所述第一全连接层、第二全连接层之间设置有dropout层。In some exemplary embodiments, a dropout layer is provided between the first fully connected layer and the second fully connected layer.
在一些示例性实施方式中,心电信号的类型包括:NOR类型、PVC类型、APC类型、RBBB类型和LBBB类型中的任意一项。In some exemplary embodiments, the type of the ECG signal includes any one of a NOR type, a PVC type, an APC type, a RBBB type, and a LBBB type.
上述的心电信号分类装置60中各模块的具体细节已经在对应的心电信号分类方法中进行了详细的描述,因此此处不再赘述。The specific details of each module in the above-mentioned electrocardiogram
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
图7示出了适于用来实现本发明实施例的电子设备的示意图。FIG. 7 shows a schematic diagram of an electronic device suitable for implementing an embodiment of the present invention.
需要说明的是,图7示出的电子设备1000仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。It should be noted that the
如图7所示,电子设备1000包括中央处理单元(Central Processing Unit,CPU)1001,其可以根据存储在只读存储器(Read-Only Memory,ROM)1002中的程序或者从储存部分1008加载到随机访问存储器(Random Access Memory,RAM)1003中的程序而执行各种适当的动作和处理。在RAM 1003中,还存储有系统操作所需的各种程序和数据。CPU 1001、ROM1002以及RAM 1003通过总线1004彼此相连。输入/输出(Input/Output,I/O)接口1005也连接至总线1004。As shown in FIG. 7 , the
以下部件连接至I/O接口1005:包括键盘、鼠标等的输入部分1006;包括诸如阴极射线管(Cathode Ray Tube,CRT)、液晶显示器(Liquid Crystal Display,LCD)等以及扬声器等的输出部分1007;包括硬盘等的储存部分1008;以及包括诸如LAN(Local AreaNetwork,局域网)卡、调制解调器等的网络接口卡的通信部分1009。通信部分1009经由诸如因特网的网络执行通信处理。驱动器1010也根据需要连接至I/O接口1005。可拆卸介质1011,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器1010上,以便于从其上读出的计算机程序根据需要被安装入储存部分1008。The following components are connected to the I/O interface 1005: an
特别地,根据本发明的实施例,下文参考流程图描述的过程可以被实现为计算机软件程序。例如,本发明的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分1009从网络上被下载和安装,和/或从可拆卸介质1011被安装。在该计算机程序被中央处理单元(CPU)1001执行时,执行本申请的系统中限定的各种功能。In particular, according to an embodiment of the present invention, the process described below with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a
具体来说,上述的电子设备可以是手机、平板电脑或者笔记本电脑等智能移动电子设备。或者,上述的电子设备也可以是台式电脑等智能电子设备。Specifically, the electronic device may be a smart mobile electronic device such as a mobile phone, a tablet computer or a laptop computer, or may be a smart electronic device such as a desktop computer.
需要说明的是,本发明实施例所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、闪存、光纤、便携式紧凑磁盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本发明中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本发明中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、有线等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium shown in the embodiment of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
附图中的流程图和框图,图示了按照本发明各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
描述于本发明实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现,所描述的单元也可以设置在处理器中。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定。The units involved in the embodiments of the present invention may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, limit the units themselves.
需要说明的是,作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个电子设备执行时,使得该电子设备实现如下述实施例中所述的方法。例如,所述的电子设备可以实现如图1所示的各个步骤。It should be noted that, as another aspect, the present application also provides a computer-readable medium, which may be included in an electronic device; or may exist independently without being assembled into the electronic device. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiments. For example, the electronic device may implement the steps shown in Figure 1.
此外,上述附图仅是根据本发明示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其他实施例。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限。It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211600433.1A CN115886833A (en) | 2022-12-12 | 2022-12-12 | Electrocardiosignal classification method and device, computer readable medium and electronic equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211600433.1A CN115886833A (en) | 2022-12-12 | 2022-12-12 | Electrocardiosignal classification method and device, computer readable medium and electronic equipment |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115886833A true CN115886833A (en) | 2023-04-04 |
Family
ID=86489549
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211600433.1A Pending CN115886833A (en) | 2022-12-12 | 2022-12-12 | Electrocardiosignal classification method and device, computer readable medium and electronic equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115886833A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117883071A (en) * | 2023-12-13 | 2024-04-16 | 华南师范大学 | Lightweight ballistocardiogram positioning method, device, storage medium and computer equipment |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100198050A1 (en) * | 2009-02-05 | 2010-08-05 | Akio Mori | Magnetic resonance imaging apparatus and magnetic resonance imaging method |
| CN108256453A (en) * | 2018-01-06 | 2018-07-06 | 天津大学 | A kind of method based on one-dimensional ECG signal extraction two dimension CNN features |
| CN110897629A (en) * | 2018-09-14 | 2020-03-24 | 杭州脉流科技有限公司 | Deep learning algorithm-based electrocardiogram feature extraction method, device, system, equipment and classification method |
| CN114091530A (en) * | 2021-11-12 | 2022-02-25 | 西安邮电大学 | ECG classification method, ECG classification model training method based on domain adaptation |
| CN114587373A (en) * | 2022-03-09 | 2022-06-07 | 合肥工业大学 | An integrated system of ECG acquisition, identification and storage based on hardware deployment |
| CN114947777A (en) * | 2022-06-29 | 2022-08-30 | 香港心脑血管健康工程研究中心有限公司 | Method and device for processing wearable electrocardiogram and arterial blood pressure map based on deep learning |
-
2022
- 2022-12-12 CN CN202211600433.1A patent/CN115886833A/en active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100198050A1 (en) * | 2009-02-05 | 2010-08-05 | Akio Mori | Magnetic resonance imaging apparatus and magnetic resonance imaging method |
| CN108256453A (en) * | 2018-01-06 | 2018-07-06 | 天津大学 | A kind of method based on one-dimensional ECG signal extraction two dimension CNN features |
| CN110897629A (en) * | 2018-09-14 | 2020-03-24 | 杭州脉流科技有限公司 | Deep learning algorithm-based electrocardiogram feature extraction method, device, system, equipment and classification method |
| CN114091530A (en) * | 2021-11-12 | 2022-02-25 | 西安邮电大学 | ECG classification method, ECG classification model training method based on domain adaptation |
| CN114587373A (en) * | 2022-03-09 | 2022-06-07 | 合肥工业大学 | An integrated system of ECG acquisition, identification and storage based on hardware deployment |
| CN114947777A (en) * | 2022-06-29 | 2022-08-30 | 香港心脑血管健康工程研究中心有限公司 | Method and device for processing wearable electrocardiogram and arterial blood pressure map based on deep learning |
Non-Patent Citations (2)
| Title |
|---|
| FAN JIANG; YUXIN LI; CHANGYIN SUN; 等: "Lightweight Neural Networks for Automatic Classification of ECG Signals", 《2022 14TH INTERNATIONAL CONFERENCE ON WIRELESS COMMUNICATIONS AND SIGNAL PROCESSING (WCSP)》, 15 February 2023 (2023-02-15) * |
| 樊星,刘占文,林杉,等: "融合人眼特征与深度学习的疲劳驾驶检测模型", 《计算机工程》, vol. 47, no. 8, 31 August 2021 (2021-08-31), pages 0 - 3 * |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117883071A (en) * | 2023-12-13 | 2024-04-16 | 华南师范大学 | Lightweight ballistocardiogram positioning method, device, storage medium and computer equipment |
| CN117883071B (en) * | 2023-12-13 | 2024-10-18 | 华南师范大学 | Lightweight ballistocardiogram positioning method, device, storage medium and computer equipment |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Xia et al. | Generative adversarial network with transformer generator for boosting ECG classification | |
| CN111095232B (en) | Discovery of genomes for use in machine learning techniques | |
| WO2021218943A1 (en) | Electrocardiogram image processing method and device, medium, and electrocardiograph | |
| WO2021164640A1 (en) | Retinal image recognition method and apparatus, electronic device, and storage medium | |
| CN111540467B (en) | Schizophrenia classification identification method, operation control device and medical equipment | |
| US11531851B2 (en) | Sequential minimal optimization algorithm for learning using partially available privileged information | |
| CN116431004B (en) | Control method and system for interactive behavior of rehabilitation robot | |
| CN109817339A (en) | Patient's group technology and device based on big data | |
| CN113855063B (en) | An automatic heart sound diagnosis system based on deep learning | |
| US12387847B2 (en) | Method and an apparatus for detecting a level of cardiovascular disease | |
| CN115919330A (en) | EEG Emotional State Classification Method Based on Multi-level SE Attention and Graph Convolution | |
| CN114190897A (en) | Sleep staging model training method, sleep staging method and device | |
| CN116028858A (en) | Pre-labeled self-supervision neural network learning heart beat classification method and system | |
| CN118981664A (en) | Sleep data staging method and sleep data staging device | |
| CN113693611A (en) | Machine learning-based electrocardiogram data classification method and device | |
| CN117398084A (en) | Physiological signal real-time quality assessment method based on light-weight mixed model | |
| CN112052874A (en) | Physiological data classification method and system based on generation countermeasure network | |
| CN115886833A (en) | Electrocardiosignal classification method and device, computer readable medium and electronic equipment | |
| CN116172573A (en) | Arrhythmia image classification method based on improved acceptance-ResNet-v 2 | |
| CN114224354B (en) | Arrhythmia classification method, arrhythmia classification device, and readable storage medium | |
| CN113723519B (en) | Electrocardiogram data processing method and device based on contrast learning and storage medium | |
| CN113627391B (en) | Cross-mode electroencephalogram signal identification method considering individual difference | |
| Sakl et al. | DL Methods for Skin Lesions Automated Diagnosis In Smartphone Images | |
| CN117547283B (en) | ECG signal data classification method, device, computer equipment and medium | |
| US12144634B1 (en) | Apparatus and a method for the improvement of electrocardiogram visualization |
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 |