An electrocardio data classification method, device and electronic equipment
By constructing a residual neural network model and combining depthwise separable convolution with multi-scale convolution kernels, the hardware resource limitations of ECG data recognition on mobile devices are overcome, the recognition accuracy is improved and it is suitable for low-resource devices, thus achieving efficient classification of ECG data.
Patent Information
- Application Number
- CN202310119890.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-15
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2043-02-15
AI Technical Summary
Existing neural network-based models have difficulty in realizing ECG data recognition on mobile devices with low hardware resources and low power consumption, and traditional machine learning methods require insufficient manual feature extraction, resulting in low recognition accuracy.
A residual neural network model is adopted, combined with residual structure and depthwise separable convolution, and ECG features are extracted through multi-scale convolution kernels. An ECG data classification model is constructed, and a global average pooling layer and a fully connected layer are introduced into the model to classify ECG data.
The classification and recognition accuracy of ECG data is improved, the amount of calculation and parameters is reduced, making the model suitable for mobile devices with low hardware resources and low power consumption, avoiding the gradient vanishing problem, and effectively extracting the local spatial features of ECG data.
Smart Images

Figure CN116383695B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to an electrocardiogram data classification method, a storage medium and an electronic device. BACKGROUND
[0002] The computer-aided identification of electrocardiogram is usually classified by using a traditional machine learning method. This method needs to rely on the extraction of manual features, which may cause insufficient feature extraction and other problems. At present, a neural network model has the characteristics of high accuracy and fast running speed, so the neural network model is widely used in the field of image recognition, including the field of electrocardiogram data recognition. However, the neural network model for identifying electrocardiogram data often needs excessive parameter quantity and calculation quantity, and accordingly needs a hardware platform to provide available high memory and large computing power support, that is, it is difficult to realize the electrocardiogram data recognition function on a mobile device end with low hardware resources and low power consumption. Therefore, how to improve the applicability of the neural network model for identifying electrocardiogram data is an urgent technical problem to be solved. SUMMARY
[0003] Embodiments of the present application provide an electrocardiogram data classification method, device, storage medium and electronic device, which can improve the applicability of the neural network model for classifying electrocardiogram data to some extent, and improve the recognition accuracy of classifying electrocardiogram data.
[0004] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.
[0005] According to a first aspect of an embodiment of the present application, an electrocardiogram data classification method is provided, which comprises: constructing a residual neural network model, and training the residual neural network model by using pre-acquired sample electrocardiogram data to obtain an electrocardiogram data classification model, the electrocardiogram data classification model being composed of an input layer, a residual module, a first activation layer, a first global average pooling layer, a full connection layer and an output layer which are sequentially connected in series, and the residual module being composed of a plurality of residual sub-modules which are connected in series; obtaining electrocardiogram data to be classified, and pre-processing the electrocardiogram data to be classified to obtain target electrocardiogram data; inputting the target electrocardiogram data into the electrocardiogram data classification model, so as to output a classification result of the electrocardiogram data to be classified by the electrocardiogram data classification model.
[0006] In some embodiments of the present application, based on the foregoing scheme, the pre-processing of the electrocardiogram data to be classified to obtain target electrocardiogram data comprises: cutting electrocardiogram data of a preset time length from the electrocardiogram data to be classified as initial electrocardiogram data; and performing standardization processing on the initial electrocardiogram data to obtain target electrocardiogram data.
[0007] In some embodiments of the present application, based on the foregoing scheme, the standardization processing of the initial electrocardio data is performed according to the following formula:
[0008] X * =(X-μ) / σ
[0009] Wherein, X * is the target electrocardio data; X is the initial electrocardio data; μ is the mean of the initial electrocardio data; σ is the standard deviation of the initial electrocardio data.
[0010] In some embodiments of the present application, based on the foregoing scheme, if the time length of the electrocardio data to be classified is less than the preset time length, the electrocardio data to be classified is padded to obtain the initial electrocardio data.
[0011] In some embodiments of the present application, based on the foregoing scheme, the residual module is composed of three residual sub-modules connected in series, each residual sub-module is composed of a main branch and a residual branch connected in parallel, a superposition layer connected in series with the main branch and the residual branch respectively, and a second activation layer connected in series; the main branch is composed of two multi-scale convolution modules connected in series; the residual branch is composed of a first convolution layer and a first batch normalization layer connected in series; the superposition layer is used for superimposing the output data output from the main branch and the output data output from the residual branch.
[0012] In some embodiments of the present application, based on the foregoing scheme, the multi-scale convolution module is composed of a first branch and a second branch connected in parallel, a splicing layer connected in series with the first branch and the second branch respectively, a second batch normalization layer, a third activation layer, an SE module, and a second convolution layer connected in series; the first branch is composed of a max-pooling layer and a third convolution layer connected in series; the second branch is composed of a fourth convolution layer, a fourth activation layer, and a plurality of DW convolution layers connected in parallel; the splicing layer is used for splicing the output data output from the first branch and the output data output from the second branch according to the channel dimension.
[0013] In some embodiments of the present application, based on the foregoing scheme, the SE module is composed of a second global average pooling layer, a fifth convolution layer, a fifth activation layer, a sixth convolution layer, a sixth activation layer, and a product layer connected in series; the product layer is used for multiplying the input data input into the SE module and the output data output from the sixth activation layer.
[0014] According to a second aspect of the embodiments of the present application, an electrocardio data classification device is provided, the device comprising: a construction unit configured to construct a residual neural network model, and train the residual neural network model by pre-acquired sample electrocardio data to obtain an electrocardio data classification model, the electrocardio data classification model comprising an input layer, a residual module, a first activation layer, a first global average pooling layer, a full connection layer, and an output layer in sequence, and the residual module comprising a plurality of residual sub-modules in sequence; an acquisition unit configured to acquire electrocardio data to be classified, and pre-process the electrocardio data to be classified to obtain target electrocardio data; and an output unit configured to input the target electrocardio data into the electrocardio data classification model, so as to output a classification result of the electrocardio data to be classified by the electrocardio data classification model.
[0015] According to a third aspect of the embodiments of the present application, a computer readable storage medium is provided, and the computer readable storage medium stores at least one program code, and the at least one program code is loaded and executed by a processor to implement the operations performed by the method according to any one of the first aspect.
[0016] According to a fourth aspect of the embodiments of the present application, an electronic device is provided, comprising one or more processors and one or more memories, and the one or more memories store at least one program code, and the at least one program code is loaded and executed by the one or more processors to implement the operations performed by the method according to any one of the first aspect.
[0017] In the technical solution of the present application, the electrocardio data to be classified is identified by the electrocardio data classification model constructed and trained, so as to output a classification result of the electrocardio data to be classified, wherein the electrocardio data classification model provided by the present application is established based on a residual multi-scale deep separable convolutional neural network, and comprises an input layer, a residual module, a first activation layer, a first global average pooling layer, a full connection layer, and an output layer in sequence. Compared with general twelve-lead electrocardio data classification methods, a plurality of different size convolution kernels are used to extract multi-scale electrocardio features, thereby improving the classification and identification accuracy of electrocardio data. Meanwhile, the convolution used is deep separable convolution, which has smaller calculation amount and parameter amount compared with traditional convolution, so that the electrocardio data classification method designed by the present application can be applied to mobile device terminals with low hardware resources and low power consumption, thereby improving the applicability of electrocardio data identification based on neural networks. In addition, the introduction of the residual structure in the residual network in the electrocardio data classification model can avoid the gradient vanishing problem caused by deepening of the convolutional neural network, and this part can effectively extract the local spatial features of the electrocardio data.
[0018] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application, as claimed. BRIEF DESCRIPTION OF DRAWINGS
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and serve to explain the principles of the application. It is readily apparent to one skilled in the art that the following figures are merely illustrative of some embodiments of the application and that other figures can be obtained from these figures without incurring inventive faculty. In the drawings:
[0020] Figure 1 A flow chart of an electrocardio data classification method according to an embodiment of the application is shown;
[0021] Figure 2 A structural schematic diagram of an electrocardio data classification model according to an embodiment of the application is shown;
[0022] Figure 3 A structural schematic diagram of a residual sub-module according to an embodiment of the application is shown;
[0023] Figure 4 A structural schematic diagram of a multi-scale convolution module according to an embodiment of the application is shown;
[0024] Figure 5 A structural schematic diagram of an SE module according to an embodiment of the application is shown;
[0025] Figure 6 A block diagram of an electrocardio data classification apparatus according to an embodiment of the application is shown;
[0026] Figure 7 A structural schematic diagram of a computer system of an electronic device suitable for implementing embodiments of the application is shown. DETAILED DESCRIPTION
[0027] Example implementations will now be described more fully with reference to the accompanying drawings. Example implementations may, however, be implemented in many different forms and should not be construed as limited to the examples set forth herein; rather, these implementations are provided so that this disclosure will be thorough and complete, and will fully convey the scope of example implementations to those skilled in the art.
[0028] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner.In the following description, many specific details are provided so as to provide a full understanding of the embodiments of the present application. However, it will be appreciated by those skilled in the art that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps etc. can be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0029] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0030] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.
[0031] It should be noted that the term "plurality" used in this document refers to two or more. "And / or" describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. The character " / " generally indicates an "or" relationship between the associated objects.
[0032] It should be noted that the terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, such that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described.
[0033] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0034] Some embodiments of the present application will be described in detail with reference to the drawings. The following embodiments and features of the embodiments described below can be combined with each other in the case of no conflict.
[0035] It should be noted that the electrocardio data classification method proposed in the present application can be applied to a computer terminal with a large memory, etc., and can also be applied to a mobile phone terminal with a low memory, etc.
[0036] Referring to Figure 1 , a flowchart of an electrocardio data classification method according to an embodiment of the present application is shown, which specifically includes steps 110 to 130:
[0037] Step 110, a residual neural network model is constructed, and the residual neural network model is trained by pre-acquired sample electrocardio data to obtain an electrocardio data classification model, the electrocardio data classification model is composed of an input layer, a residual module, a first activation layer, a first global average pooling layer, a full connection layer, and an output layer in series, and the residual module is composed of a plurality of serial residual sub-modules.
[0038] In some embodiments, the sample electrocardio data used to train the constructed residual neural network model can be electrocardio data in the open source data MIT-BIH arrhythmia database, or electrocardio data in the PTB-XL data set, and the source of the sample electrocardio data is not limited in the present application.
[0039] In some embodiments, the acquired sample electrocardio data needs to be pre-processed before being used to train the constructed residual neural network model. The specific pre-processing steps can be performed according to the following steps 1 and 3.
[0040] Step 1, the first preset length of electrocardio data is cut from the sample electrocardio data as initial sample electrocardio data.
[0041] Step 2, the initial sample electrocardio data is standardized to obtain target sample electrocardio data.
[0042] Step 3, the target sample electrocardio data is input into the residual neural network model for training to obtain an electrocardio data classification model.
[0043] It should be noted that the purpose of intercepting the electrocardio data of the first preset time length from the sample electrocardio data is to unify the length of the collected sample electrocardio data, for example, the first preset time length can be set to 10s, then for the sample electrocardio data with a time length greater than 10s, 10s of electrocardio signal data can be randomly intercepted therefrom as initial sample electrocardio data; if the sample electrocardio data with a time length less than 10s, it can be filled, such as 0 padding, to obtain electrocardio data with a length of 10s as initial sample electrocardio data.
[0044] It should also be noted that the purpose of standardizing the initial sample electrocardio data is to standardize the obtained initial sample electrocardio data and convert it to a normal distribution, so as to improve the convergence speed, accuracy of the model, and prevent the model gradient from exploding, specifically, the following formula can be executed:
[0045] Y * =(Y-α) / β
[0046] Wherein, Y * is the target sample electrocardio data; Y is the initial sample electrocardio data; α is the mean of the initial sample electrocardio data; β is the standard deviation of the initial sample electrocardio data.
[0047] In some embodiments, during the training of the residual neural network model, the output result is a probability between 0 and 1, and the residual neural network is trained using a back propagation algorithm to improve the recognition accuracy of the model in classifying electrocardio data.
[0048] For example, if the source of the sample electrocardio data is the PTB-XL data set, then during the training of the residual neural network model, the output result of the residual neural network model can be output according to the standard classification of the PTB-XL data set. The PTB-XL data set includes 6 data subsets, corresponding name categories and classification results (evaluation index AUC) are shown in Table 1.
[0049]
[0050] Table 1
[0051] It can be understood that if the residual neural network is trained using all the data subsets of the PTB-XL data set, when the loss function value of the model on the validation set no longer decreases, the training is stopped.
[0052] In order for those skilled in the art to better understand the electrocardio data classification model proposed in the present application, the following will be described in conjunction with Figure 2 .
[0053] Referring to Figure 2 , a structural diagram of an electrocardio data classification model according to an embodiment of the present application is shown.
[0054] The electrocardio data classification model is composed of an input layer, three residual sub-modules (residual sub-module 1, residual sub-module 2, and residual sub-module 3), a first activation layer, a first global average pooling layer (Global Average Pool, GAP), a fully connected layer (Dense), and an output layer.
[0055] In some embodiments, the activation function adopted by the first activation layer is a Leaky Rectified Linear Unit (Leaky ReLU); the first global average pooling layer is used to calculate the average value of all feature values on each channel; the input node of the fully connected layer is 256, and the output node is the number of classification categories; the output layer adopts a Sigmoid function as the activation function; and the loss function is a cross-entropy loss function.
[0056] In some embodiments, the residual module is composed of three residual sub-modules connected in series, each residual sub-module is composed of a main branch and a residual branch connected in parallel, a superposition layer connected in series with the main branch and the residual branch respectively, and a second activation layer connected in series; the main branch is composed of two multi-scale convolution modules connected in series; the residual branch is composed of a first convolution layer and a first batch normalization layer (Batch Nomalization, BN) connected in series; and the superposition layer is used to superimpose the output data output from the main branch and the output data output from the residual branch.
[0057] It should be noted that the multi-scale convolution module is a multi-scale depthwise separable convolution module (Multi-Scale Depthwise Separable Convolution Block, MSDSC-Block). The activation function adopted in the second activation layer is a Leaky Rectified Linear Unit (Leaky ReLU).
[0058] Specifically, referring to Figure 3 , a structural diagram of a residual sub-module according to an embodiment of the present application is shown.
[0059] As Figure 3As shown, a structural schematic diagram of the residual sub-module 1 is shown. It can be understood that data is input from the input layer of the electrocardio data classification model. After the same data passes through the input layer, it will be input into the multi-scale convolution module 1 of the residual sub-module 1 and the first convolution layer 1 of the residual sub-module 1. After the data passes through the main branch and the residual branch of the residual sub-module 1 for electrocardio feature extraction, the data output by the two branches is superimposed based on the superimposition layer.
[0060] It should be noted that the residual sub-module 2 and the residual sub-module 3 in the electrocardio data classification model have the same structure design as the residual sub-module 1, except that the parameter settings of the convolution kernel are different.
[0061] Specifically, the main branch of the residual sub-module 1 is composed of the multi-scale convolution module 1, the multi-scale convolution module 2, and the first convolution layer 1 connected in sequence; the residual branch is composed of the first convolution layer 1, the first batch normalization layer 1 connected in sequence, and the residual sub-module 1 further includes the superimposition layer 1 and the second activation layer 1.
[0062] The main branch of the residual sub-module 2 is composed of the multi-scale convolution module 3, the multi-scale convolution module 4, and the first convolution layer 2 connected in sequence; the residual branch is composed of the first convolution layer 2, the first batch normalization layer 2 connected in sequence, and the residual sub-module 2 further includes the superimposition layer 2 and the second activation layer 2.
[0063] The main branch of the residual sub-module 3 is composed of the multi-scale convolution module 5, the multi-scale convolution module 6, and the first convolution layer 3 connected in sequence; the residual branch is composed of the first convolution layer 3, the first batch normalization layer 3 connected in sequence, and the residual sub-module 3 further includes the superimposition layer 3 and the second activation layer 3.
[0064] The first convolution layer in the residual branch in the residual sub-module of the present application is Conv1x1, and the parameters are set according to Table 2 as follows.
[0065] Name Input dimension Output dimension Stride First convolution layer 1 Conv1x1 12 64 2 First convolution layer 2 Conv1x1 64 128 2 First convolution layer 3 Conv1x1 128 256 2
[0066] Table 2
[0067] Continuing to refer to Figure 3 The multi-scale convolution module is composed of a first branch and a second branch in parallel, a splicing layer connected in series with the first branch and the second branch respectively, a second batch normalization layer, a third activation layer, an SE module, and a second convolution layer connected in sequence; the first branch is composed of a max-pooling layer and a third convolution layer connected in sequence; the second branch is composed of a fourth convolution layer, a fourth activation layer, and a plurality of parallel DW convolution layers connected in sequence; the splicing layer is used for splicing the output data output from the first branch and the output data output from the second branch according to the channel dimension.
[0068] It should be noted that the third activation layer and the fourth activation layer both adopt a Leaky Rectified Linear Unit (Leaky ReLU) activation function. The SE module (Squeeze-and-Excitation) can model the importance of the channel dimension of the spliced features.
[0069] It can be understood that designing the DW convolution layer in the multi-scale convolution module as a depth-wise convolution (DW Conv) can effectively reduce the parameter quantity and the calculation quantity of the electrocardiogram data classification model.
[0070] Referring to Figure 4 , a structural schematic diagram of a multi-scale convolution module according to an embodiment of the present application is shown.
[0071] As Figure 4 shown, the data input into the multi-scale convolution module is input into both the maximum pooling layer of the first branch and the fourth convolution layer of the second branch; then the data output from the third convolution layer of the first branch and the data output from the DW convolution layer 1, the DW convolution layer 2, and the DW convolution layer 3 are all input into the splicing layer, so that the splicing layer splices the input data according to the dimension.
[0072] It should be noted that the multi-scale convolution modules in the residual sub-modules have the same structure design, except that the parameters of the convolution kernels are different.
[0073] Specifically, for the multi-scale convolution module 1, the multi-scale convolution module 2, the multi-scale convolution module 3, the multi-scale convolution module 4, the multi-scale convolution module 5, and the multi-scale convolution module 6 in the residual sub-module, the parameters of the convolution kernels and the maximum pooling layer can be set according to Table 3-Table 8 as follows.
[0074] Table 3 is the parameter setting of the convolution kernel and the maximum pooling layer in the multi-scale convolution module 1; Table 4 is the parameter setting of the convolution kernel and the maximum pooling layer in the multi-scale convolution module 2; Table 5 is the parameter setting of the convolution kernel and the maximum pooling layer in the multi-scale convolution module 3; Table 6 is the parameter setting of the convolution kernel and the maximum pooling layer in the multi-scale convolution module 4; Table 7 is the parameter setting of the convolution kernel and the maximum pooling layer in the multi-scale convolution module 5; and Table 8 is the parameter setting of the convolution kernel and the maximum pooling layer in the multi-scale convolution module 6.
[0075] Multi-scale convolution module 1 Name Kernel size Number of kernels Stride Fourth convolution layer Conv1x1 1x1 32 1 Max-pooling layer 1x3 1 Third convolution layer Conv1x1 1x1 32 1 DW convolution layer 1 DWConv 1x3 32 1 DW convolution layer 2 DWConv 1x5 32 1 DW convolution layer 3 DWConv 1x7 32 1 Second convolution layer Conv1x1 1x1 32 1
[0076] Table 3
[0077]
[0078]
[0079] Table 4
[0080] Multi-scale convolution module 3 Name Kernel size Number of kernels Stride Fourth convolution layer Conv1x1 1x1 64 1 Max-pooling layer 1x3 1 Third convolution layer Conv1x1 1x1 64 1 DW convolution layer 1 DWConv 1x3 64 1 DW convolution layer 2 DWConv 1x5 64 1 DW convolution layer 3 DWConv 1x7 64 1 Second convolution layer Conv1x1 1x1 64 1
[0081] Table 5
[0082] Multi-scale convolution module 4 Name Kernel size Number of kernels Stride Fourth convolution layer Conv1x1 1x1 128 1 Max-pooling layer 1x4 2 Third convolution layer Conv1x1 1x1 128 1 DW convolution layer 1 DWConv 1x3 128 2 DW convolution layer 2 DWConv 1x5 128 2 DW convolution layer 3 DWConv 1x7 128 2 Second convolution layer Conv1x1 1x1 128 1
[0083] Table 6
[0084] Multi-scale convolution module 5 Name Kernel size Number of kernels Stride Fourth convolution layer Conv1x1 1x1 128 1 Max-pooling layer 1x3 1 Third convolution layer Conv1x1 1x1 128 1 DW convolution layer 1 DWConv 1x3 128 1 DW convolution layer 2 DWConv 1x5 128 1 DW convolution layer 3 DWConv 1x7 128 1 Second convolution layer Conv1x1 1x1 128 1
[0085] Table 7
[0086] Multi-scale convolution module 6 Name Kernel size Number of kernels Stride Fourth convolution layer Conv1x1 1x1 256 1 Max-pooling layer 1x4 2 Third convolution layer Conv1x1 1x1 256 1 DW convolution layer 1 DWConv 1x3 256 2 DW convolution layer 2 DWConv 1x5 256 2 DW convolution layer 3 DWConv 1x7 256 2 Second convolution layer Conv1x1 1x1 256 1
[0087] Table 8
[0088] In the embodiment, each multi-scale convolution module performs dimension increasing and dimension decreasing on input data, can effectively extract features of electrocardio data, and thus improves classification and recognition accuracy of electrocardio data.
[0089] With reference to Figure 4 continuously, the SE module is composed of a second global average pooling layer, a fifth convolution layer, a fifth activation layer, a sixth convolution layer, a sixth activation layer, and a product layer connected in sequence; the product layer is configured to multiply input data input into the SE module and output data output from the sixth activation layer.
[0090] Specifically, as shown in Figure 5 , a structure diagram of the SE module according to an embodiment of the application is shown.
[0091] It can be understood that the data input into the SE module is input into the second global average pooling layer and the product layer, so that the product layer can multiply the input data and the data output from the sixth activation layer.
[0092] It should be noted that the fifth convolution layer is a 1x1Conv layer, the number of convolution kernels is one sixteenth of the number of input channels of the fifth convolution layer; the fifth activation layer adopts a Leaky ReLU (Leaky Rectified Linear Unit) as an activation function; the sixth convolution layer is a 1x1Conv layer, the number of convolution kernels is the number of channels input into the SE module; the sixth activation layer adopts a Sigmoid function as an activation function, so as to calculate the importance score of each channel input into the sixth activation layer.
[0093] The electrocardio data classification model designed in the application is a one-dimensional neural network model, and all the convolution layers are 1x1Conv layers. The electrocardio data classification model adopts multiple convolution kernels of different sizes to extract multi-scale electrocardio features, which can improve the classification and recognition accuracy of electrocardio data. Meanwhile, the convolution used in the electrocardio data classification model is a depth separable convolution, which has a smaller calculation amount and parameter amount than the traditional convolution, so that the electrocardio data classification method of the application can be supported on a mobile device with low hardware resources and low power consumption. In addition, the residual structure in the residual network is introduced into the electrocardio data classification model, which can avoid the gradient vanishing problem caused by deepening the convolutional neural network, and this part can effectively extract the local spatial features of the electrocardiogram.
[0094] With reference to Figure 1 , step 120 acquires the electrocardio data to be classified, and pre-processes the electrocardio data to be classified to obtain target electrocardio data.
[0095] In some embodiments, the electrocardio data to be classified can be the electrocardio data of a user collected by a wearable electrocardio device, or can be the electrocardio data to be classified acquired by a mobile phone or other smart device after the user takes an electrocardiogram with an electrocardio device.
[0096] In some embodiments, the specific implementation of pre-processing the electrocardio data to be classified to obtain target electrocardio data can be performed according to the following steps 121 to 122.
[0097] Step 121: cutting electrocardio data of a preset time length from the electrocardio data to be classified as initial electrocardio data.
[0098] Step 122: standardizing the initial electrocardio data to obtain target electrocardio data.
[0099] It should be noted that the purpose of cutting electrocardio data of a preset time length from the electrocardio data to be classified is to unify the length of the acquired electrocardio data to be classified. For example, the preset time length can be set to 8s. For the electrocardio data to be classified with a time length greater than 8s, 8s of electrocardio signal data can be randomly cut from it as initial electrocardio data. If the time length of the electrocardio data to be classified is less than 8s, it can be padded, such as 0 padding, to obtain electrocardio data with a length of 8s as initial electrocardio data.
[0100] It should also be noted that the purpose of standardizing the initial electrocardio data is to standardize the obtained initial electrocardio data and convert it to a normal distribution, so as to improve the convergence speed, accuracy of the model, and prevent the model gradient from exploding. Specifically, it can be performed according to the following formula:
[0101] X * =(X-μ) / σ
[0102] Among them, X * is the target ECG data; X is the initial ECG data; μ is the mean of the initial ECG data; σ is the standard deviation of the initial ECG data.
[0103] Continue to refer to Figure 1 , step 130, inputting the target ECG data into the ECG data classification model, so that the ECG data classification model outputs a classification result of the ECG data to be classified.
[0104] In order to better illustrate the beneficial effects of the ECG data classification method proposed in this application, it will be described below in conjunction with Table 9.
[0105]
[0106]
[0107] Table 9
[0108] It should be noted that Table 9 above shows the classification results obtained by combining the BiLSTM model, MobileNetV3 model, ATI-CNN model, and the ECG data classification model proposed in this application to identify ECG data from the All, Diagnostic, Sub-diagnostic, Super-diagnostic, Form, and Rhythm categories in the PTB-XL dataset. As can be seen from Table 9, the ECG data classification model proposed in this application achieves the highest recognition accuracy across all categories, using the lowest number of parameters.
[0109] In the technical solutions provided by some embodiments of the present application, the electrocardio data classification model is established and trained, and the electrocardio data to be classified is identified by using the electrocardio data classification model, so that the classification result of the electrocardio data to be classified is output. The electrocardio data classification model provided by the present application is established based on a residual multi-scale deep separable convolutional neural network, and is composed of an input layer, a residual module, a first activation layer, a first global average pooling layer, a full connection layer, and an output layer in series. Compared with general twelve-lead electrocardio data classification methods, the electrocardio data classification method designed by the present application uses multiple convolution kernels of different sizes to extract multi-scale electrocardio features, thereby improving the classification and identification accuracy of electrocardio data. At the same time, the convolution used is deep separable convolution, which has smaller calculation amount and parameter amount compared with traditional convolution, so that the electrocardio data classification method designed by the present application can be applied to mobile device terminals with low hardware resources and low power consumption, thereby improving the applicability of electrocardio data identification based on neural networks. In addition, the introduction of the residual structure in the residual network in the electrocardio data classification model can avoid the gradient vanishing problem caused by deepening of the convolutional neural network, and the part can effectively extract the local spatial features of the electrocardio data.
[0110] The device embodiments of the present application are introduced below, which can be used to execute the electrocardio data classification method in the above-mentioned embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the above-mentioned embodiments of the electrocardio data classification method of the present application.
[0111] Figure 6 A block diagram of an electrocardio data classification device according to an embodiment of the present application is shown.
[0112] Referring to Figure 6 According to an embodiment of the present application, the electrocardio data classification device 600 includes a construction unit 601, an acquisition unit 602, and an output unit 603.
[0113] The construction unit 601 is configured to construct a residual neural network model, and train the residual neural network model by using pre-acquired sample electrocardio data to obtain an electrocardio data classification model. The electrocardio data classification model is composed of an input layer, a residual module, a first activation layer, a first global average pooling layer, a full connection layer, and an output layer in series. The residual module is composed of a plurality of residual sub-modules in series. The acquisition unit 602 is configured to acquire electrocardio data to be classified, and pre-process the electrocardio data to be classified to obtain target electrocardio data. The output unit 603 is configured to input the target electrocardio data into the electrocardio data classification model, so that the classification result of the electrocardio data to be classified is output by the electrocardio data classification model.
[0114] In some embodiments of the present application, based on the foregoing scheme, the construction unit 601 is further configured to: construct a residual module, the residual module being composed of three residual sub-modules connected in series, each residual sub-module being composed of a main branch and a residual branch connected in parallel, a superposition layer connected in series with the main branch and the residual branch respectively, and a second activation layer connected in series; the main branch being composed of two multi-scale convolution modules connected in series; the residual branch being composed of a first convolution layer and a first batch normalization layer connected in series; and the superposition layer being configured to superimpose output data output from the main branch and output data output from the residual branch.
[0115] In some embodiments of the present application, based on the foregoing scheme, the construction unit 601 is further configured to: construct a multi-scale convolution module, the multi-scale convolution module being composed of a first branch and a second branch connected in parallel, a concatenation layer connected in series with the first branch and the second branch respectively, a second batch normalization layer, a third activation layer, an SE module, and a second convolution layer connected in series; the first branch being composed of a max-pooling layer and a third convolution layer connected in series; the second branch being composed of a fourth convolution layer, a fourth activation layer, and a plurality of DW convolution layers connected in parallel; and the concatenation layer being configured to concatenate output data output from the first branch and output data output from the second branch in the channel dimension.
[0116] In some embodiments of the present application, based on the foregoing scheme, the construction unit 601 is further configured to: construct an SE module, the SE module being composed of a second global average pooling layer, a fifth convolution layer, a fifth activation layer, a sixth convolution layer, a sixth activation layer, and a product layer connected in series; and the product layer being configured to multiply input data input into the SE module and output data output from the sixth activation layer.
[0117] In some embodiments of the present application, based on the foregoing scheme, the acquisition unit 602 is further configured to: intercept electrocardio data of a preset time length from the electrocardio data to be classified as initial electrocardio data; and perform standardization processing on the initial electrocardio data to obtain target electrocardio data.
[0118] In some embodiments of the present application, based on the foregoing scheme, the acquisition unit 602 is further configured to: perform standardization processing on the initial electrocardio data according to the following formula:
[0119] X * = (X - μ) / σ
[0120] wherein, X * is the target electrocardio data; X is the initial electrocardio data; μ is the mean of the initial electrocardio data; and σ is the standard deviation of the initial electrocardio data.
[0121] In some embodiments of the present application, based on the foregoing scheme, the acquisition unit 602 is further configured to, if the time length of the to-be-classified electrocardio data is less than the preset time length, perform padding processing on the to-be-classified electrocardio data to obtain the initial electrocardio data.
[0122] Figure 7 A structural diagram of a computer system of an electronic device suitable for implementing embodiments of the present application is shown.
[0123] It should be noted that, Figure 7 The computer system 700 of the electronic device shown is only an example and should not impose any limitation on the functions and use range of embodiments of the present application.
[0124] As Figure 7 shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 702 or programs loaded from a storage portion 708 into a random access memory (RAM) 703, such as performing the methods described in the above embodiments. In the RAM 703, various programs and data required for system operation are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0125] The following components are connected to the I / O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output portion 707 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a speaker, and the like; a storage portion 708 including a hard disk, and the like; and a communication portion 709 including a network interface card such as a LAN (Local Area Network) card, a modem, and the like. The communication portion 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as necessary. A removable recording medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is attached to the drive 710 as necessary, so that a computer program read therefrom is installed in the storage portion 708 as necessary.
[0126] In particular, the processes described above with reference to the flow charts can be implemented as a computer software program in accordance with the embodiments of the present application. For example, an embodiment of the present application includes a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the methods illustrated by the flow charts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, various functions defined in the system of the present application are executed.
[0127] It should be noted that the computer readable medium shown in the embodiments of the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, 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 (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present application, the computer readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer readable program code. Such a propagated data signal can take many forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium other than the computer readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or apparatus. The program code contained on the computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, or the like, or any suitable combination of the above.
[0128] The flow and block diagrams in the drawings represent possible architectural, functional, and operational architectures of systems, methods, and computer program products according to various embodiments of the present application. Each block in the flow and block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may be executed in the reverse order, depending on the functionality involved. It will also be noted that each block of the block diagrams and / or flowchart illustrations, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.
[0129] The units described in the embodiments of the present application can be implemented by software, or by hardware, or by a combination of software and hardware. The units described may
[0130] As another aspect, the present application also provides a computer program product or computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the electrocardio data classification method described in the above embodiments.
[0131] As another aspect, the present application also provides a computer readable medium, which can be included in the electronic device described in the above embodiments, or can exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to implement the electrocardio data classification method described in the above embodiments.
[0132] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, the division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into a plurality of modules or units.
[0133] Those skilled in the art can easily understand, through the above description of the embodiments, that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, or the like) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to perform the methods according to the embodiments of the present application.
[0134] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. It is intended that the present application cover any and all variations of the present application that come within the scope of the claims and that the terms describe and cover both structural and functional equivalents. Therefore, it is intended that the application not be limited to the exact cartoms recited.
[0135] It is to be understood that the application is not limited to the precise details of construction and the above-described embodiments and that various modifications and changes can be effected therein by one skilled in the art without departing from the scope of the application. The scope of the application should be determined by the terms of the appended claims and their legal equivalents.
Claims
1. A method for classifying electrocardiogram data, characterized in that: The method comprises: Constructing a residual neural network model and training the residual neural network model using pre-collected sample ECG data to obtain an ECG data classification model, wherein the ECG data classification model is composed of a sequentially arranged input layer, a residual module, a first activation layer, a first global average pooling layer, a fully connected layer, and an output layer, wherein the residual module is composed of a plurality of sequentially arranged residual submodules, each of which is composed of three sequentially arranged residual submodules, each of which is composed of a parallel main branch and a residual branch, an overlay layer serially connected to the main branch and the residual branch, and a second activation layer sequentially connected; The main branch consists of two multi-scale convolution modules connected in sequence; The residual branch is composed of the first convolutional layer and the first batch of regularization layers connected in sequence; The superposition layer is used to superimpose the output data output from the main branch and the output data output from the residual branch; Acquiring to-be-classified ECG data, and preprocessing the to-be-classified ECG data to obtain target ECG data; The target ECG data is input into the ECG data classification model, so that the ECG data classification model outputs a classification result of the ECG data to be classified.
2. The method according to claim 1, characterized in that The preprocessing of the to-be-classified ECG data to obtain target ECG data includes: intercepting electrocardiogram data of a preset time length from the electrocardiogram data to be classified as initial electrocardiogram data; The initial ECG data is normalized to obtain target ECG data.
3. The method according to claim 2, characterized in that The standardization of the initial ECG data is performed according to the following formula: X * =(X-μ) / σ Among them, X * is the target ECG data; X is the initial ECG data; μ is the mean of the initial ECG data; σ is the standard deviation of the initial ECG data.
4. The method according to claim 2, characterized in that The method further comprises: If the time length of the electrocardiographic data to be classified is less than the preset time length, padding processing is performed on the electrocardiographic data to be classified to obtain the initial electrocardiographic data.
5. The method according to claim 1, wherein The multi-scale convolution module is composed of a first branch and a second branch in parallel, a splicing layer serially connected to the first branch and the second branch respectively, a second batch normalization layer, a third activation layer, an SE module, and a second convolution layer connected in sequence; The first branch is composed of a maximum pooling layer and a third convolutional layer connected in sequence; The second branch is composed of a fourth convolutional layer, a fourth activation layer, and a plurality of parallel DW convolutional layers connected in sequence; The splicing layer is used to splice the output data output from the first branch and the output data output from the second branch according to the channel dimension.
6. The method according to claim 5, characterized in that The SE module is composed of a second global average pooling layer, a fifth convolutional layer, a fifth activation layer, a sixth convolutional layer, a sixth activation layer, and a product layer connected in sequence; the product layer is used to multiply the input data input into the SE module and the output data output from the sixth activation layer.
7. An electrocardiogram data classification device, characterized in that: The device comprises: A construction unit is used to construct a residual neural network model and train the residual neural network model using pre-collected sample ECG data to obtain an ECG data classification model, wherein the ECG data classification model is composed of a sequentially connected input layer, a residual module, a first activation layer, a first global average pooling layer, a fully connected layer, and an output layer, wherein the residual module is composed of a plurality of sequentially connected residual submodules, each of which is composed of three sequentially connected residual submodules, each of which is composed of a parallel main branch and a residual branch, an overlay layer serially connected to the main branch and the residual branch, and a second activation layer sequentially connected; The main branch consists of two multi-scale convolution modules connected in sequence; The residual branch is composed of the first convolutional layer and the first batch of regularization layers connected in sequence; The superposition layer is used to superimpose the output data output from the main branch and the output data output from the residual branch; an acquisition unit, configured to acquire the ECG data to be classified, and preprocess the ECG data to be classified to obtain target ECG data; An output unit is used to input the target ECG data into the ECG data classification model so that the ECG data classification model outputs a classification result of the ECG data to be classified.
8. A computer-readable storage medium, characterized in that At least one program code is stored in the computer-readable storage medium, and the at least one program code is loaded and executed by the processor to implement the operations performed by the method according to any one of claims 1 to 6.
9. An electronic device, characterized in that: The method comprises one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Intelligent identification method for electrocardiogram data based on residual network
CN108175402A
Image processing method and device, electronic equipment and storage medium
CN111368849A