Electrocardiogram signal classification method and device and electrocardiogram monitor
By using a multi-scale expanded convolutional network model in the electrocardiogram signal classification, combining branch networks with multiple different receptive fields and weight fusion technology, the problem of poor generalization of the model in the existing technology is solved, and the reliability of the electrocardiogram signal classification results is improved.
Patent Information
- Application Number
- CN202510375184.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-03-27
AI Technical Summary
In the prior art, when performing electrocardiogram signal classification, due to poor generalization of the model, it is difficult to ensure the reliability of the electrocardiogram signal classification results.
By extracting the basic features of the ECG signal and sending it to a multi-scale expanded convolutional network model, the model contains multiple branch networks of different receptive fields, and the expansion convolution rate is positively correlated with the input signal length. Then, weight fusion is performed based on multiple branch features to determine the classification label of the electrocardiogram signal.
It improves the effective receptive field and generalization of the model and enhances the reliability of electrocardiogram signal classification results.
Smart Images

Figure CN119924848A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of signal processing, and in particular to a classification method and device for electrocardiogram signals and an electrocardiogram monitor. Background Art
[0002] Electrocardiogram is an important tool for diagnosing cardiovascular diseases. By analyzing the waveform, frequency, rhythm and other characteristics of the electrocardiogram, doctors can determine whether the patient has abnormal conditions such as arrhythmia and myocardial ischemia. The classification of electrocardiogram signals can help doctors quickly and accurately identify different types of electrocardiogram characteristics, thus providing an important basis for clinical diagnosis.
[0003] Since the amount of ECG signal data of each lead is extremely large during arrhythmia detection, it is not realistic to rely on experts to perform real-time manual analysis of the patient's ECG signal to achieve real-time monitoring of the patient's cardiovascular health. At present, although there are existing models that can automatically classify ECG signals, the existing models generally correspond to only one type of receptive field, and the size of the receptive field determines the degree of understanding of the input image by the network at this layer. Therefore, the existing models are limited in the number of receptive fields. In addition, because the data focus between different databases is different, the data targets that need to be queried are different, which may require the extraction of local features or global features, resulting in poor generalization of the model between different databases, and it is difficult to ensure the reliability of the ECG signal classification results.
[0004] Therefore, in the process of classifying electrocardiogram signals in the prior art, there is a problem that it is difficult to ensure the reliability of the electrocardiogram signal classification results due to the poor generalization of the model. Summary of the invention
[0005] In view of this, it is necessary to provide a classification method, device and ECG monitor for ECG signals to solve the problem that in the process of classifying ECG signals in the prior art, it is difficult to ensure the reliability of the ECG signal classification results due to the poor generalization of the model.
[0006] In order to solve the above problems, in a first aspect, the present invention provides a classification method for electrocardiogram signals, comprising: Extract basic features of ECG signals; Sending the basic features to a multi-scale dilated convolutional network model, wherein the multi-scale branch module of the multi-scale dilated convolutional network model includes a plurality of branch networks with different receptive fields, and the dilated convolution rate of the receptive field of at least one branch network is positively correlated with the current input signal length of the basic features; Determine multiple branch features of basic features based on branch networks with multiple different receptive fields; Multiple branch features are weighted fused, and the classification label of the electrocardiogram signal is determined based on the weighted fused features.
[0007] In a possible implementation, before extracting the basic features of the electrocardiogram signal, the following steps are also included: The baseline drift of the initial electrocardiogram signal is removed by high-pass filtering, and the initial electrocardiogram signal is denoised according to the improved threshold wavelet denoising method to obtain a denoised electrocardiogram signal; Locate the R peak of the denoised ECG signal to obtain the heart beat of the denoised ECG signal; The heart beats are segmented to obtain the preprocessed electrocardiogram signal.
[0008] In a possible implementation, when the multi-scale branch module includes four branch networks, the expansion convolution rates are:
[0009]
[0010]
[0011]
[0012] in, For the i The expansion convolution rate, L is the length of the current input signal, and [x] represents the rounding operation on x.
[0013] In a possible implementation, the multi-scale dilated convolutional network model includes a depth gating module, a spatial attention fusion module and a classification module; multiple branch features are weighted fused, and the classification label of the electrocardiogram signal is determined based on the weighted fused features, including: Obtain multiple weights of basic features in multiple branch networks according to the deep gating module; Multiply multiple branch features and multiple weights and input them into the spatial attention fusion module to obtain the final feature map of the ECG signal; The final feature map is classified based on the classification module to obtain the classification label of the ECG signal.
[0014] In a possible implementation, multiple weights of basic features in multiple branch networks are obtained according to the deep gating module, including: Adjust the number of output labels of the deep gating module based on the number of branch networks; Input the basic features into the deep gating module to obtain multiple unlabeled probabilities corresponding to the number of output labels; Use multiple unlabeled probabilities as weights of the branch network; Among them, when the basic features are updated during the iteration process, the weights change accordingly based on the unlabeled probability.
[0015] In a possible implementation, multiple branch features and multiple weights are multiplied and input into the spatial attention fusion module to obtain the final feature map of the electrocardiogram signal, including: Multiply the branch feature matrix by the weight to obtain the weighted branch feature matrix; The weighted branch feature matrix is concatenated according to the spatial attention fusion module to obtain the final feature map of the ECG signal.
[0016] In a possible implementation, the spatial attention fusion module includes a first connection operation unit, a first average pooling unit, a maximum pooling unit, a second connection operation unit, a convolution kernel unit, an activation function unit, a broadcast weighting unit, and a second average pooling unit; the weighted branch feature matrix is feature concatenated according to the spatial attention fusion module to obtain a final feature map of the electrocardiogram signal, including: Connecting the weighted branch feature matrices in the second dimension according to the first connection operation unit to obtain a first connection fusion feature; The first connection fusion feature is sequentially passed through a first average pooling unit, a maximum pooling unit, a second connection operation unit, a convolution kernel unit, an activation function unit, and a broadcast weighting unit to obtain a first splicing feature of the electrocardiogram signal; The first splicing feature is fed back to the maximum pooling unit to update the parameters of the maximum pooling unit, and the first splicing feature is repeatedly iteratively fused, and the splicing feature after iterative fusion is input to the second average pooling unit to obtain the final feature map.
[0017] In one possible implementation, the process of training a multi-scale dilated convolutional network model includes: The training data set is input into the initial multi-scale dilated convolutional network model for iterative training. The loss value between the training prediction result and the actual result of the initial multi-scale dilated convolutional network model is calculated according to the cross entropy loss function. The parameters of the initial multi-scale dilated convolutional network model are feedback-adjusted based on the loss value. The training is iterated for a preset number of times to obtain a fully trained multi-scale dilated convolutional network model. Among them, the cross entropy loss function L The expression is:
[0018] in, N is the total number of samples, C is the total number of categories; Represents the true value, which is a one-hot encoded vector. If i The samples belong to the corresponding categoryk ,but is 1, otherwise it is 0; The model is i Prediction samples belong to the category k The probability of is the final feature map.
[0019] In a second aspect, the present invention further provides an electrocardiogram signal classification device, comprising: Basic feature extraction component, used to extract basic features of electrocardiogram signals; A multi-scale dilated convolution component, used to send the basic features to a multi-scale dilated convolution network model, wherein the multi-scale branch module of the multi-scale dilated convolution network model includes a plurality of branch networks with different receptive fields, and the dilated convolution rate of the receptive field of at least one branch network is positively correlated with the current input signal length of the basic features; A branch feature extraction component, used to determine multiple branch features of basic features based on multiple branch networks with different receptive fields; The classification label determination component is used to weight the features of multiple branches and determine the classification label of the electrocardiogram signal based on the weighted fused features.
[0020] In a third aspect, the present invention further provides an electrocardiogram monitor, comprising a memory and a processor, wherein: Memory, used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the electrocardiogram signal classification method described above.
[0021] The beneficial effects of adopting the above-mentioned embodiment are as follows: the present invention provides a classification method for electrocardiogram signals, which extracts branch features of basic features of electrocardiogram signals through branch networks with multiple different receptive fields in a multi-scale branch module, thereby improving the effective receptive field of the model and enhancing the generalization of the model; further, multiple branch features are weighted and fused to determine the classification label of the electrocardiogram signal, thereby realizing the classification of electrocardiogram signals according to the characteristics of multiple effective receptive fields and improving the reliability of the classification results. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A schematic diagram of a flow chart of an embodiment of a method for classifying electrocardiogram signals provided by the present invention; Figure 2 A schematic diagram of a flow chart of an embodiment of preprocessing an electrocardiogram signal provided by the present invention; Figure 3 A schematic diagram of the results of an embodiment of the effect of the expansion rate on the receptive field size of a one-dimensional convolutional layer provided by the present invention; Figure 4A schematic diagram of a flow chart of an embodiment of determining a classification label of an electrocardiogram signal according to the present invention; Figure 5 A schematic diagram of the structure of an embodiment of a multi-scale dilated convolutional network model provided by the present invention; Figure 6 A schematic diagram of a flow chart of an embodiment of obtaining the weight of a branch network provided by the present invention; Figure 7 A schematic diagram of a process of obtaining a final feature map according to a first embodiment of the present invention; Figure 8 A schematic diagram of a flow chart of a second embodiment of obtaining a final feature map provided by the present invention; Fig. 9 A schematic diagram of the structure of an embodiment of a spatial attention fusion module provided by the present invention; Fig.10 A schematic diagram of the structure of an embodiment of an electrocardiogram signal classification device provided by the present invention; Fig.11 This is a structural block diagram of an embodiment of an electrocardiogram monitor provided by the present invention. DETAILED DESCRIPTION
[0023] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of the present invention and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0024] In order to solve the problem in the prior art that it is difficult to ensure the reliability of the electrocardiogram signal classification results due to the poor generalization of the model during the classification of electrocardiogram signals, the present invention provides an electrocardiogram signal classification method, device and electrocardiogram monitor, which are described in detail below.
[0025] like Figure 1 As shown, Figure 1 A schematic flow chart of an embodiment of a method for classifying electrocardiogram signals provided by the present invention includes: S101: extracting basic features of electrocardiogram signals; In some embodiments of the present invention, an electrocardiogram (ECG) signal is a weak electrical signal originating from the human body, which records the potential changes generated during the depolarization and repolarization of cardiac muscle cells. Specifically, the electrical signal of the heart starts from the atrium, passes through the ventricle, and causes the heart muscle to contract. During this process, the potential of the cardiac muscle cells will change, thereby generating an ECG signal.
[0026] S102: Sending the basic features to a multi-scale dilated convolutional network model, wherein the multi-scale branch module of the multi-scale dilated convolutional network model includes a plurality of branch networks with different receptive fields, and the dilated convolution rate of the receptive field of at least one branch network is positively correlated with the current input signal length of the basic features; In some embodiments of the present invention, the multi-scale dilated convolutional network model is essentially a neural network model. Specifically, the executor of the multi-scale dilated convolutional network model can be any one of a high-performance GPU (graphics processing unit), a dedicated deep learning accelerator (such as Tensor Processing Units (TPUs), Neural Processing Units (NPUs)), an FPGA (field programmable gate array), an ASIC (application-specific integrated circuit), and an embedded system, which can be selected and adjusted according to actual needs.
[0027] In some embodiments of the present invention, the receptive field refers to the area of the input image that a point on a feature map can see, that is, the point on the feature map is calculated by the receptive field size area in the input image. In other words, the area that a neuron in a neural network can perceive, in a convolutional neural network (CNN), is the area where the calculation of an element on the feature map is affected by the input image, and this area is the receptive field of the element on the feature map.
[0028] The size of the receptive field determines the degree of understanding of the input image by the network at this layer, that is, how large a range of feature information can be captured. A smaller receptive field can capture more detailed features, but may ignore information in a larger range; a larger receptive field can capture more global information, but may ignore more detailed features.
[0029] In convolutional neural networks, increasing the receptive field can improve the model's ability to understand the input image, but it may also cause the model to overfit or require too much computation. Therefore, increasing the receptive field needs to be done while ensuring model performance.
[0030] S103: determining multiple branch features of the basic feature based on multiple branch networks with different receptive fields; S104: weight-fusing multiple branch features, and determining a classification label of the electrocardiogram signal based on the weight-fused features.
[0031] In some embodiments of the present invention, the classification labels of the electrocardiogram signal include normal test results, supraventricular dysrhythmia, ventricular dysrhythmia, and fusion dysrhythmia of supraventricular dysrhythmia and ventricular dysrhythmia.
[0032] In this embodiment, branch features are extracted from the basic features of the ECG signal through branch networks with multiple different receptive fields in the multi-scale branch module, which improves the effective receptive field of the model and enhances the generalization of the model; further, multiple branch features are weighted and fused to determine the classification label of the ECG signal, thereby achieving classification of the ECG signal according to the characteristics of multiple effective receptive fields and improving the reliability of the classification results.
[0033] In some embodiments of the present invention, in S101, before extracting the basic features of the electrocardiogram signal, the electrocardiogram signal needs to be preprocessed, such as Figure 2 As shown, Figure 2 The schematic diagram of a flow chart of an embodiment of preprocessing an electrocardiogram signal provided by the present invention includes: S201: removing the baseline drift of the initial electrocardiogram signal by high-pass filtering, and performing denoising processing on the initial electrocardiogram signal according to an improved threshold wavelet denoising method to obtain a denoised electrocardiogram signal; In some embodiments of the present invention, after removing the baseline drift using a fourth-order Butterworth high-pass filter with a cutoff frequency of 0.75 Hz, the ECG signal is denoised using an improved threshold wavelet denoising method, wherein the expression of the improved threshold wavelet denoising method is:
[0034] Where b (b = 1,…,9) is the order of wavelet decomposition, c is the number of sampling points in the signal. TEb is the set threshold, which is calculated as: , is the second norm of the wavelet coefficients, is the estimated noise level, calculated as: , where 0.6745 is the value of the 75% area (p = 0.25) of a Gaussian distribution with mean 0 and variance 1.
[0035] Then, in the process of signal decomposition and reconstruction, dB6 wavelet is selected as the wavelet basis, and the signal is decomposed by 4-level stationary wavelet. The wavelet coefficients less than TEb after decomposition are set to zero, thereby removing other noise signals.
[0036] S202: locating the R peak of the denoised electrocardiogram signal to obtain the heart beat of the denoised electrocardiogram signal; S203: Segment the heartbeats to obtain a pre-processed electrocardiogram signal.
[0037] In some embodiments of the present invention, the Pan-Tompkins algorithm is used to locate the R peak, and the data 0.3s before the R peak and 0.45s after the R peak are taken as a heart beat.
[0038] The Pan-Tompkins algorithm is a classic algorithm for electrocardiogram (ECG) signal processing, which is mainly used to detect the QRS waveform of the heart, thereby realizing heart rate measurement and rhythm analysis. In particular, the advantage of the Pan-Tompkins algorithm is that it is simple and efficient, and can accurately detect the R wave peak on the ECG through a mathematical model, while effectively reducing noise and enhancing signals.
[0039] In this embodiment, by preprocessing the initial electrocardiogram signal, interference factors can be eliminated while retaining effective information, thereby improving the reliability and pertinence of the electrocardiogram signal.
[0040] Furthermore, in some embodiments of the present invention, the multi-scale dilated convolutional network model also includes a convolutional feature extraction module, wherein the convolutional feature extraction module is used to extract basic features of the electrocardiogram signal.
[0041] Specifically, the convolutional feature extraction module includes a convolutional layer, a batch normalization layer, and a dropout layer connected in sequence; Among them, the initial convolution kernel size of the convolution layer is 3; A batch normalization layer and a dropout layer are set between each convolutional layer, and the dropout value of the dropout layer is 0.3.
[0042] By revising the convolution kernel size and setting the batch normalization layer and dropout layer accordingly to adapt to the needs of the model, the gradient changes during model training can be stabilized to avoid gradient explosion or overfitting problems.
[0043] In some embodiments of the present invention, in S102, the basic features are sent to a multi-scale dilated convolutional network model, wherein the multi-scale branch module of the multi-scale dilated convolutional network model includes multiple branch networks with different receptive fields, and the dilated convolution rate of the receptive field of at least one branch network is positively correlated with the current input signal length of the basic features.
[0044] Since the branch network corresponding to each receptive field can specifically extract the features of the basic features, the branch networks with multiple different receptive fields can obtain the features of the basic features in multiple aspects; further, since the current input signal length is variable, in order to dynamically adjust the size of the dilated convolution rate, the dilated convolution rate is adaptively linked to the current input signal length, thereby realizing automatic adjustment of the size of the receptive field and improving the dynamic stability when acquiring features.
[0045] In some embodiments of the present invention, in order to ensure the availability of the multi-scale dilated convolutional network model, before using the multi-scale dilated convolutional network model for classification, the model needs to be trained. Specifically, first, the training data set is input into the initial multi-scale dilated convolutional network model for iterative training, and the loss value between the training prediction result and the actual result of the initial multi-scale dilated convolutional network model is calculated according to the cross entropy loss function; then, the parameters of the initial multi-scale dilated convolutional network model are feedback adjusted based on the loss value, and the iterative training is performed to a preset number of times to obtain a fully trained multi-scale dilated convolutional network model.
[0046] Among them, the cross entropy loss function L The expression is:
[0047] in, N is the total number of samples, C is the total number of categories; Represents the true value, which is a one-hot encoded vector. If i The samples belong to the corresponding category k ,but is 1, otherwise it is 0; The model is i Prediction samples belong to the category k The probability of is the final feature map.
[0048] In particular, during the training process, in order to increase the number of training samples and avoid the problem of uneven distribution of data of different categories, data enhancement processing is performed on the supraventricular arrhythmia labels and ventricular arrhythmia labels with a smaller number in the database. Specifically, the data corresponding to the above two labels are enhanced by horizontal flipping, vertical flipping, and random addition of Gaussian white noise.
[0049] In this embodiment, the iterative training effect of the multi-scale dilated convolutional network model is evaluated by taking the cross entropy loss function as a reference standard, which can drive the multi-scale dilated convolutional network model to shift in the target direction, so that the multi-scale dilated convolutional network model can better meet the actual needs and ensure the reliability of the electrocardiogram signal classification results.
[0050] In some embodiments of the present invention, in S103, in the process of determining multiple branch features of a basic feature based on branch networks with multiple different receptive fields, specifically, the dilated convolution rate of the branch network is adjusted according to the current input signal length of the basic feature, and based on the multiple branch networks with different adjusted dilated convolution rates, multiple branch features of the basic feature under different receptive fields are respectively extracted.
[0051] In some embodiments of the present invention, the dilation rate is a key parameter in convolutional neural networks (CNN), especially in the application of dilated convolutions. It determines the spacing between elements in the convolution kernel, thereby affecting the size of the output feature map and the size of the receptive field.
[0052] Specifically, the dilated convolution increases the effective receptive field of the convolution kernel by inserting spaces (i.e., "holes") between the convolution kernel elements without increasing the physical size of the convolution kernel or the amount of additional computation. This mechanism enables the dilated convolution to capture a wider range of contextual information while maintaining the resolution of the feature map.
[0053] It should be noted that the signal features are further extracted under different set receptive fields, and the impact of different expansion rates on the model receptive field is shown in the following formula:
[0054] in K d To use the equivalent convolution kernel size under the same receptive field after dilated convolution, d is the current expansion rate, K is the original convolution kernel size.
[0055] like Figure 3 As shown, Figure 3 A result schematic diagram of an embodiment of the effect of the expansion rate on the receptive field size of a one-dimensional convolutional layer provided by the present invention, wherein Receptive field represents the model receptive field, input represents the input of a one-dimensional signal, output represents the output of a one-dimensional signal, and d represents different expansion rates.
[0056] In some embodiments of the present invention, four branch networks CNN branch_j, j∈{1,2,3,4} are set; when j∈{1,2,3}, the convolution kernel K=3, and when j=4, the convolution kernel K=4.
[0057] For the dilated convolution rate d in each branch j , when j=4, d4=1; when j∈{1,2,3}, set d1, d2 and d3 to be coprime numbers according to the following formulas:
[0058]
[0059]
[0060] Wherein, L represents the length of the current input signal, and [x] represents the rounding operation on x.
[0061] In this embodiment, by setting the expansion convolution rate of each branch network, it is possible to adapt to the prediction needs of the model and improve the adaptability of the branch features.
[0062] In this embodiment, the dynamic stability of the branch features is improved by dynamically limiting the dilation convolution rate.
[0063] In some embodiments of the present invention, in S104, the multi-scale dilated convolutional network model includes a depth gating module, a spatial attention fusion module and a classification module; in order to weight-fuse multiple branch features and determine the classification label of the electrocardiogram signal based on the weight-fused features, such as Figure 4 As shown, Figure 4 The flowchart of an embodiment of determining a classification label of an electrocardiogram signal according to the present invention includes: S401: Acquire multiple weights of basic features in multiple branch networks according to the deep gating module; S402: multiplying multiple branch features and multiple weights and inputting them into a spatial attention fusion module to obtain a final feature map of the electrocardiogram signal; S403: Classify the final feature map based on the classification module to obtain a classification label of the electrocardiogram signal.
[0064] In this embodiment, the weight of each branch feature is adaptively revised through the deep gating module to improve the reliability of the weight; multiple branch features are fused through the spatial attention fusion module to obtain the final feature map, thereby ensuring the reliability of the final feature map and thereby improving the reliability of the ECG signal classification results.
[0065] Specifically, in order to clearly describe the changing process of the ECG signal in the multi-scale dilated convolutional network model, such as Figure 5 As shown, Figure 5 A schematic diagram of the structure of an embodiment of a multi-scale dilated convolutional network model provided by the present invention, wherein the CNN backbone is a convolutional feature extraction module; b The basic features extracted from it; Multi-scale dilationconvolution module represents the multi-scale branch module; CNN branch_i represents the branch networks of the multi-scale branch module; f bi Refers to the branch features output by each branch network; Gated network is a deep gating module; g i is the importance weight of each branch network output by the deep gating module; f bi’represents the result of multiplying each branch feature by the corresponding weight; Spatial attention fusion module is the spatial attention fusion module, f z is the final feature map; Outputresults represents the prediction result of the multi-scale dilated convolutional network model for the input electrocardiogram signal, where N represents a normal test result, S represents supraventricular dysrhythmia, V represents ventricular dysrhythmia, and F represents a fusion of supraventricular and ventricular dysrhythmia.
[0066] In some embodiments of the present invention, in S401, in order to obtain multiple weights of basic features in multiple branch networks according to the depth gating module, such as Figure 6 As shown, Figure 6 A schematic diagram of a flow chart of an embodiment of obtaining the weight of a branch network provided by the present invention includes: S601: Adjust the number of output labels of the deep gating module based on the number of branch networks; S602: Input the basic features into the deep gating module to obtain a plurality of unlabeled probabilities corresponding to the number of output labels; S603: Using multiple unlabeled probabilities as weights of the branch network; Among them, when the basic features are updated during the iteration process, the weights change accordingly based on the unlabeled probability.
[0067] In some embodiments of the present invention, the primary features extracted by the convolutional neural network are sent to the deep gating module, and the four categories of unlabeled probabilities output by the deep gating module are used as weights for feature fusion of the four branch networks. Since the design concept of the gating network is similar to the self-attention mechanism, both use the input features to assign and dynamically update the importance weights of the outputs, thereby improving the generalization performance of the model.
[0068] In some embodiments of the present invention, in S402, multiple branch features and multiple weights are multiplied and input into the spatial attention fusion module to obtain the final feature map of the electrocardiogram signal, such as Figure 7 As shown, Figure 7 The schematic diagram of the process of obtaining the first embodiment of the final feature map provided by the present invention includes: S701: multiply the branch feature matrix by the weight to obtain a weighted branch feature matrix; S702: Perform feature concatenation on the weighted branch feature matrix according to the spatial attention fusion module to obtain the final feature map of the electrocardiogram signal.
[0069] In some embodiments of the present invention, the spatial attention fusion module includes a first connection operation unit, a first average pooling unit, a maximum pooling unit, a second connection operation unit, a convolution kernel unit, an activation function unit, a broadcast weighting unit, and a second average pooling unit; Figure 8 As shown, Figure 8 The schematic diagram of the process of obtaining the second embodiment of the final feature map provided by the present invention includes: S801: Connecting the weighted branch feature matrix in the second dimension according to the first connection operation unit to obtain a first connection fusion feature; In some embodiments of the present invention, a concatenation operation (Cat operation) is a commonly used operation in feature fusion, especially in convolutional neural networks (CNN) and other types of neural networks. The concatenation operation mainly concatenates two or more feature maps or feature vectors in a specific dimension.
[0070] S802: Passing the first connection fusion feature through a first average pooling unit, a maximum pooling unit, a second connection operation unit, a convolution kernel unit, an activation function unit, and a broadcast weighting unit in sequence to obtain a first concatenated feature of the electrocardiogram signal; S803: Feedback the first splicing feature to the maximum pooling unit to update the parameters of the maximum pooling unit, repeatedly iteratively fuse the first splicing feature, and input the splicing feature after iterative fusion to the second average pooling unit to obtain a final feature map.
[0071] In order to clearly describe the process of obtaining the final feature map according to the spatial attention fusion module, as shown in Fig. 9 As shown, Fig. 9 A schematic diagram of the structure of an embodiment of the spatial attention fusion module provided by the present invention, wherein fbi' represents branch features with importance weights; Cat represents feature fusion based on Cat operation on input features; fc represents features after cat feature fusion of fb1, fb2, fb3, and fb4; GAP represents global average pooling; GMP represents global maximum pooling; Conv1_1_1 represents a 1*1 convolution kernel, Sigmoid represents Sigmoid activation function, and Broadcast represents broadcast weighting.
[0072] In some embodiments of the present invention, the weights output by the gated network are multiplied by the feature matrix output by the branch network to weight them. Then, the four weighted feature matrices are input into the feature fusion module combined with the spatial attention mechanism. The weighted feature matrices output by the four branches are connected in the second dimension and then input into the spatial attention mechanism module. The output feature map is broadcasted and weighted from high to low in dimension to further extract features of different scales. Then, the final feature matrix output after fusion is sent to the classification module for learning, and the loss function is calculated based on the classification results and the standard results to optimize the model. Among them, the classification module performs a weighted operation on the input x i The output probability distribution P is shown as follows:
[0073] Among them, x i represents the ECG signal of the i-th input, y i represents the output label corresponding to the i-th ECG signal, and p is the label y i Assigned to input x i The probability of w n is the parameter of class n, C is the total number of label categories, f z is the final feature map.
[0074] In this embodiment, the branch features are specifically fused through the spatial attention fusion module, which effectively ensures the adaptability of the final feature map, thereby improving the reliability of the classification results of the electrocardiogram signal.
[0075] In order to better implement the electrocardiogram signal classification method in the embodiment of the present invention, based on the electrocardiogram signal classification method, the embodiment of the present invention also provides an electrocardiogram signal classification device, such as Fig.10 As shown, Fig.10 This is a schematic diagram of the structure of an embodiment of an electrocardiogram signal classification device provided by the present invention. The electrocardiogram signal classification device 1000 includes: A basic feature extraction component 1001 is used to extract basic features of an electrocardiogram signal; A multi-scale dilated convolution component 1002 is used to send the basic features to a multi-scale dilated convolution network model, wherein the multi-scale branch module of the multi-scale dilated convolution network model includes a plurality of branch networks with different receptive fields, and the dilated convolution rate of the receptive field of at least one branch network is positively correlated with the current input signal length of the basic features; A branch feature extraction component 1003 is used to determine multiple branch features of a basic feature based on multiple branch networks with different receptive fields; The classification label determination component 1004 is used to perform weighted fusion on multiple branch features and determine the classification label of the electrocardiogram signal based on the weighted fused features.
[0076] like Fig.11 As shown, Fig.11 This is a structural block diagram of an embodiment of an electrocardiogram monitor provided by the present invention. The electrocardiogram monitor 1100 includes a processor 1101 , a memory 1102 , and a display 1103 . Fig.11 Only some components of the ECG monitor 1100 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0077] In some embodiments, the processor 1101 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 1102, such as the classification method of the electrocardiogram signal in the present invention.
[0078] In some embodiments, the processor 1101 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 1101 may be local or remote. In some embodiments, the processor 1101 may be implemented in a cloud platform. In one embodiment, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.
[0079] In some embodiments, the memory 1102 may be an internal storage unit of the ECG monitor 1100, such as a hard disk or memory of the ECG monitor 1100. In other embodiments, the memory 1102 may also be an external storage device of the ECG monitor 1100, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the ECG monitor 1100.
[0080] Furthermore, the memory 1102 may include both an internal storage unit of the ECG monitor 1100 and an external storage device. The memory 1102 is used to store application software installed in the ECG monitor 1100 and various data.
[0081] In some embodiments, the display 1103 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 1103 is used to display information on the ECG monitor 1100 and to display a visual user interface. The components 1101-1103 of the ECG monitor 1100 communicate with each other via a system bus.
[0082] In one embodiment, when the processor 1101 executes the classification program of the electrocardiogram signal in the memory 1102, the following steps may be implemented: Extract basic features of ECG signals; Sending the basic features to a multi-scale dilated convolutional network model, wherein the multi-scale branch module of the multi-scale dilated convolutional network model includes a plurality of branch networks with different receptive fields, and the dilated convolution rate of the receptive field of at least one branch network is positively correlated with the current input signal length of the basic features; Determine multiple branch features of basic features based on branch networks with multiple different receptive fields; Multiple branch features are weighted fused, and the classification label of the electrocardiogram signal is determined based on the weighted fused features.
[0083] It should be understood that: when the processor 1101 executes the classification program of the electrocardiogram signal in the memory 1102, in addition to the above functions, other functions can also be realized. For details, please refer to the description of the corresponding method embodiment above.
[0084] Furthermore, the embodiment of the present invention does not specifically limit the type of the ECG monitor 1100 mentioned, and the ECG monitor 1100 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic devices may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the ECG monitor 1100 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0085] Accordingly, an embodiment of the present application also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, it can implement the steps or functions in the electrocardiogram signal classification method provided in the above-mentioned method embodiments.
[0086] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0087] The above is a detailed introduction to the classification method, device, electronic device and storage medium of the electrocardiogram signal provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for classifying electrocardiogram signals, characterized in that: include: Extract basic features of ECG signals; Sending the basic features to a multi-scale dilated convolutional network model, wherein the multi-scale branch module of the multi-scale dilated convolutional network model includes a plurality of branch networks with different receptive fields, and the dilated convolution rate of the receptive field of at least one branch network is positively correlated with the current input signal length of the basic features; Determine multiple branch features of the basic feature based on the branch networks of the multiple different receptive fields; The multiple branch features are weighted fused, and the classification label of the electrocardiogram signal is determined based on the weighted fused features.
2. The electrocardiogram signal classification method according to claim 1, characterized in that: Before extracting the basic features of the ECG signal, it also includes: Removing the baseline drift of the initial electrocardiogram signal by high-pass filtering, and performing denoising processing on the initial electrocardiogram signal according to an improved threshold wavelet denoising method to obtain a denoised electrocardiogram signal; Locating the R peak of the denoised electrocardiogram signal to obtain the heartbeat of the denoised electrocardiogram signal; The heartbeat is segmented to obtain the preprocessed electrocardiogram signal.
3. The electrocardiogram signal classification method according to claim 1, characterized in that: When the multi-scale branch module includes four branch networks, the dilated convolution rates are respectively: in, For the i The dilated convolution rate, L is the current input signal length, and [x] represents the rounding operation on x.
4. The electrocardiogram signal classification method according to claim 1, characterized in that: The multi-scale dilated convolutional network model includes a depth gating module, a spatial attention fusion module and a classification module; the weighted fusion of the multiple branch features and determining the classification label of the electrocardiogram signal based on the weighted fused features include: Acquire multiple weights of the basic features in multiple branch networks according to the deep gating module; Multiplying the multiple branch features and the multiple weights and inputting the resultant into the spatial attention fusion module to obtain a final feature map of the electrocardiogram signal; The final feature map is classified based on the classification module to obtain a classification label of the electrocardiogram signal.
5. The method for classifying electrocardiogram signals according to claim 4, characterized in that: The obtaining, according to the depth gating module, a plurality of weights of the basic features in a plurality of branch networks comprises: Adjusting the number of output labels of the deep gating module based on the number of branch networks; Inputting the basic features into the deep gating module to obtain a plurality of unlabeled probabilities corresponding to the number of output labels; Using the multiple unlabeled probabilities as the weights of the branch network; When the basic features are updated during the iteration process, the weights change accordingly based on the unlabeled probability.
6. The electrocardiogram signal classification method according to claim 4, characterized in that: The multiplying the multiple branch features and the multiple weights and inputting them into the spatial attention fusion module to obtain the final feature map of the electrocardiogram signal includes: Multiplying the matrix of branch features by the weights to obtain a weighted branch feature matrix; The weighted branch feature matrix is feature concatenated according to the spatial attention fusion module to obtain a final feature map of the electrocardiogram signal.
7. The method for classifying electrocardiogram signals according to claim 6, characterized in that: The spatial attention fusion module includes a first connection operation unit, a first average pooling unit, a maximum pooling unit, a second connection operation unit, a convolution kernel unit, an activation function unit, a broadcast weighting unit and a second average pooling unit; the weighted branch feature matrix is feature spliced according to the spatial attention fusion module to obtain the final feature map of the electrocardiogram signal, including: Connecting the weighted branch feature matrices in a second dimension according to the first connection operation unit to obtain a first connection fusion feature; Passing the first connection fusion feature through the first average pooling unit, the maximum pooling unit, the second connection operation unit, the convolution kernel unit, the activation function unit and the broadcast weighting unit in sequence to obtain a first splicing feature of the electrocardiogram signal; The first splicing feature is fed back to the maximum pooling unit to update the parameters of the maximum pooling unit, and the first splicing feature is repeatedly iteratively fused, and the splicing feature after iterative fusion is input to the second average pooling unit to obtain the final feature map.
8. The electrocardiogram signal classification method according to claim 1, characterized in that: The process of training the multi-scale dilated convolutional network model includes: Inputting the training data set into the initial multi-scale dilated convolutional network model for iterative training, calculating the loss value of the training prediction result and the actual result of the initial multi-scale dilated convolutional network model according to the cross entropy loss function, and feedback-adjusting the parameters of the initial multi-scale dilated convolutional network model based on the loss value, iterating the training to a preset number of times, and obtaining the fully trained multi-scale dilated convolutional network model; Among them, the cross entropy loss function L The expression is: in, N is the total number of samples, C is the total number of categories; Represents the true value, which is a one-hot encoded vector. If i samples belong to the corresponding category k ,but is 1, otherwise it is 0; The model is i Prediction samples belong to the category k The probability of is the final feature map.
9. An electrocardiogram signal classification device, characterized in that: include: Basic feature extraction component, used to extract basic features of electrocardiogram signals; A multi-scale dilated convolution component, used to send the basic features to a multi-scale dilated convolution network model, wherein the multi-scale branch module of the multi-scale dilated convolution network model includes a plurality of branch networks with different receptive fields, and the dilated convolution rate of the receptive field of at least one branch network is positively correlated with the current input signal length of the basic features; A branch feature extraction component, used to determine multiple branch features of the basic feature based on the branch networks of the multiple different receptive fields; The classification label determination component is used to perform weight fusion on the multiple branch features and determine the classification label of the electrocardiogram signal based on the weight fused features.
10. An electrocardiogram monitor, characterized in that: comprising a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the electrocardiogram signal classification method described in any one of claims 1 to 8.
Citation Information
Patent Citations
Lip language recognition method based on deep convolution and attention mechanism
CN113343937A
Deep counterfeit video detection method based on three-dimensional space-time network
CN116665089A
Invocational willingness assessment method and system based on natural semantic analysis
CN118195562A
Signal feature extraction method and device based on dynamic expansion convolution
CN118734033A
Single-lead electrocardiogram arrhythmia detection method and system based on adaptive attention
CN119046724A