# Electrocardiogram signal classification method, device, program product and storage medium

## A technology of electrocardiogram signal and classification method, which is applied in the field of data processing, can solve problems such as inaccurate classification of electrocardiogram signals, and achieve the effect of improving classification accuracy and avoiding interference

Active Publication Date: 2019-08-20

NEUSOFT CORP

9 Cites 9 Cited by

## AI-Extracted Technical Summary

### Problems solved by technology

[0005] In view of this, the embodiment of the present application provides a method, device, program product, and storage ...

## Abstract

The embodiment of the invention discloses an electrocardiogram signal classification method and a device. The method comprises the following steps: carrying out heart beat cutting on electrocardiogramsignals to be classified so as to obtain heart beat data, wherein the heart beat data is time-domain heart beat data; then, converting the heart beat data to obtain frequency-domain heart beat data,and extracting statistical characteristics and sampling characteristics of the heart beat data and the frequency-domain heart beat data as the heart beat characteristics of the heart beat data; identifying invalid heart beat data according to the heart beat characteristics of the heart beat data so as to remove the invalid heart beat data from the heart beat data and to obtain updated heart beat data; and inputting the heart beat characteristics of the updated heart beat data into a heart beat classification model to obtain a classification result of the heart beat data. The invention performsclassification by using the heart beat characteristics peculiar to each heart beat data. Compared with the prior art that classification is carried out by sampling a fixed threshold value, the methodimproves the classification accuracy.

Application Domain

Diagnostic recording/measuringSensors

Technology Topic

CardiologySignal classification +5

## Image

## Examples

- Experimental program(1)

### Example Embodiment

[0051] In order to make the above objectives, features, and advantages of the present application more obvious and understandable, the following describes the embodiments of the present application in further detail with reference to the accompanying drawings and specific implementations.

[0052] In the research of the traditional ECG signal processing method, the inventor found that the traditional ECG signal processing-based morphological detection relies on preset thresholds for classification. In fact, the ECG signal of each person is quite different. Using a unified signal processing method combined with a fixed threshold for classification will lead to inaccurate classification results.

[0053] Based on this, the embodiment of the present application provides an ECG signal classification method, specifically, cutting the acquired ECG signal to obtain heartbeat data, and real-time heartbeat data. Then, the heartbeat data is converted to obtain the frequency domain heartbeat data, and the heartbeat data and the statistical characteristics and sampling characteristics of the frequency domain heartbeat data are obtained. In order to avoid invalid heartbeat data in the obtained heartbeat data and interfere with the subsequent classification accuracy, the invalid heartbeat data is identified according to the heartbeat characteristics of the heartbeat data, the invalid heartbeat data is extracted from the heartbeat data, and the updated heartbeat data is obtained. Heartbeat data. Then input the heartbeat feature of the updated heartbeat data into the heartbeat classification model to obtain the classification result of the heartbeat data. That is, the embodiment of the present application performs classification according to the heartbeat feature corresponding to each heartbeat data, instead of using a fixed threshold for classification, so as to improve classification accuracy.

[0054] In order to facilitate the understanding of the specific implementation of the embodiments of the present application, the ECG signal classification method provided in the present application will be described below in conjunction with the accompanying drawings.

[0055] See figure 1 , The figure is a flowchart of an ECG signal classification method provided by an embodiment of the application, such as figure 1 As shown, the method can include:

[0056] S101: Perform heartbeat cutting on the ECG signal to be classified to obtain heartbeat data.

[0057] In this embodiment, in order to obtain the classification result of a certain ECG signal, the ECG signal to be classified is first obtained. In a specific implementation, medical equipment such as an electrocardiograph can be used to obtain the ECG signal to be classified, or the ECG signal to be classified can be obtained through a wearable device. Among them, the ECG signal to be classified such as figure 2 As shown, it may include P wave, Q wave, R wave, S wave, T wave, and PQRST is used as a heartbeat cycle to form an ECG signal.

[0058] After the ECG signal to be classified is obtained, heartbeat cutting is performed on the signal to be classified to obtain data of each heartbeat. Among them, the heartbeat data refers to the electrocardiogram data generated every time the heart beats. For example, the obtained ECG signal to be classified is a user's ECG signal for 5 minutes. Assuming that the user's heart beats 60 times per minute, 300 Heartbeat data.

[0059] Among them, the specific implementation of performing heartbeat cutting on the ECG signal to be classified to obtain heartbeat data will be described in subsequent embodiments.

[0060] S102: Convert the heartbeat data into frequency-domain heartbeat data, and extract the heartbeat data and the statistical features and sampling features of the frequency-domain heartbeat data as the heartbeat features of the heartbeat data.

[0061] In this embodiment, for each acquired heartbeat data, first convert the acquired heartbeat data into frequency domain heartbeat data, and extract the heartbeat data and the statistical features and sampling features of the frequency domain heartbeat data, that is, extract heartbeat data. The statistical features and sampling features of the heartbeat data, as well as the statistical features and sampling features of the frequency domain heartbeat data, are used as the heartbeat features of the heartbeat data. It should be noted that since the obtained ECG signal to be classified is a time-domain ECG signal, the heartbeat data obtained after the heartbeat cutting is time-domain heartbeat data.

[0062] It is understandable that when the heartbeat data is obtained, in order to facilitate the subsequent extraction of the statistical characteristics and sampling characteristics of the heartbeat data, the heartbeat data can also be normalized first, and then the normalized heartbeat data Perform heartbeat feature extraction.

[0063] In the specific implementation, Fourier transform can be used to map the heartbeat data from the time domain to the frequency domain to obtain the frequency domain heartbeat data. Specifically, the discrete Fourier transform is performed on the heartbeat data first, and the spectrogram of the heartbeat data is extracted, and then the fast Fourier transform is used to obtain the frequency domain heartbeat data. In actual applications, other transformation methods can also be used to convert the heartbeat data into frequency domain heartbeat data, which is not limited in this embodiment.

[0064] Among them, the statistical feature can include the average value, variance, maximum, minimum, etc. of the data; the sampling feature can be the value corresponding to the sampling point. The specific implementation of obtaining the heartbeat data and the statistical features and sampling features of the frequency domain heartbeat data will be described in subsequent embodiments.

[0065] S103: Identify the invalid heartbeat data according to the heartbeat characteristics of the heartbeat data, and remove the invalid heartbeat data from the heartbeat data to obtain updated heartbeat data.

[0066] In this embodiment, in order to eliminate the interference of invalid heartbeat data on the classification results, the invalid heartbeat data may be cleaned first, specifically by identifying the invalid heartbeat data according to the heartbeat characteristics of the heartbeat data, and then the invalid heartbeat data Excluded from the heartbeat data, the updated heartbeat data is obtained, and the updated heartbeat data is used for classification. Among them, invalid heartbeat data refers to heartbeat data that cannot be identified due to noise interference.

[0067] The specific implementation of identifying invalid heartbeat data based on the heartbeat characteristics of the heartbeat data will be described in subsequent embodiments.

[0068] S104: Input the heartbeat feature of the updated heartbeat data into the heartbeat classification model to obtain a classification result of the heartbeat data.

[0069] In this embodiment, after the updated heartbeat data is obtained, the heartbeat characteristics of the updated heartbeat data are input into the heartbeat classification model, so that the heartbeat classification model classifies the heartbeat data according to the input heartbeat characteristics To obtain the classification result of the heartbeat data.

[0070] From the above description, it can be seen that the embodiment of the application obtains heartbeat data by performing heartbeat slices on the ECG signal, and extracts the statistical characteristics and sampling features of the heartbeat data in the time-frequency domain as the heartbeat characteristics of the heartbeat data, and according to the heartbeat data The blog feature eliminates invalid heartbeat data to avoid the interference of invalid heartbeat data on the recognition result. Then use the heartbeat classification model to classify the heartbeat characteristics of the updated heartbeat data, so as to obtain the classification result of the heartbeat data. Since this application uses the unique heartbeat feature of each heartbeat data for classification, compared with the classification using a fixed threshold in the prior art, the classification accuracy is improved.

[0071] In a possible implementation manner of the embodiment of the present application, a specific implementation manner of using a heartbeat classification model to obtain classification results is provided, that is, S104 can be implemented through the following steps:

[0072] 1) Input the heartbeat feature of the updated heartbeat data into the linear classification model to obtain the first classification result;

[0073] 2) Input the heartbeat feature of the updated heartbeat data into the smooth quadratic classification model to obtain the second classification result.

[0074] In this embodiment, the heartbeat characteristics of the updated heartbeat data are input into the linear classification model and the smooth quadratic classification model to obtain the first classification result output by the linear classification model and the smooth quadratic classification model output. The second classification result. Among them, the linear classification model and the smooth quadratic classification model are generated based on the heartbeat feature of the training heartbeat data and the classification label of the training heartbeat data. The specific training process of the classification model will be described in subsequent embodiments.

[0075] In specific implementation, the classification results of the classification model can be divided into three categories, namely normal heart beats, abnormal heart beats and other heart beats. Each classification model outputs the probability that the heartbeat data corresponding to the heartbeat feature is normal heartbeat, abnormal heartbeat, and other heartbeats according to the input heartbeat feature, and the sum of the three probabilities is 1. That is, for each heartbeat data, the first classification result and the second classification result both include the probability that the heartbeat data is a normal heartbeat, the probability of an abnormal heartbeat, and the probability of other heartbeats. For example, for heartbeat data 1, the first classification result output by the linear classification model is that the probability of the heartbeat data being a normal heartbeat is 0.6, the probability of being an abnormal heartbeat is 0.2, and the probability of being other heartbeats is 0.2; smooth The second classification result output by the quadratic classification model is that the probability of the heartbeat data being a normal heartbeat is 0.7, the probability of being an abnormal heartbeat is 0.2, and the probability of being other heartbeats is 0.1.

[0076] 3) Perform weighted fusion on the first classification result and the second classification result to obtain the classification result of the heartbeat data.

[0077] In this embodiment, when the classification results respectively corresponding to the two classification models are obtained, the first classification result and the second classification result are weighted and fused to determine the classification result of the heartbeat data according to the fusion result. Among them, the weight corresponding to each classification result can be set according to the actual situation, as long as the sum of the two weight values is 1.

[0078] It should be noted that the first classification result and the second classification result respectively include the respective probabilities of multiple classification results. When the first classification result and the second classification result are weighted and fused, the first classification result is combined with the second classification result. The corresponding classification results in the classification results are weighted and fused to obtain the weighted probability corresponding to each classification result, and the classification result corresponding to the weighted maximum probability is determined as the classification result of the heartbeat data.

[0079] For example, the weight of the first classification result is 0.6, the weight of the second classification result is 0.4, the first classification result is that the probability of the heartbeat data being a normal heartbeat is 0.6, and the probability of being an abnormal heartbeat is 0.2, which is another heartbeat. The probability of a stroke is 0.2; the second classification result output by the smooth quadratic classification model is that the probability of the heartbeat data being a normal heartbeat is 0.7, the probability of being an abnormal heartbeat is 0.2, and the probability of being other heartbeats is 0.1. Then the weighted probability that the heartbeat data is a normal heartbeat is 0.6*0.6+0.4*0.7=0.64; the weighted probability of an abnormal heartbeat is 0.6*0.2+0.4*0.2=0.2; the weighted probability of other heartbeats is 0.6 *0.2+0.4*0.1=0.16. If the probability of being a normal heartbeat is the greatest, the classification result of the heartbeat data is a normal heartbeat.

[0080] In practical applications, for multiple heartbeat data corresponding to the ECG signal to be classified, the classification result of each heartbeat data can be determined according to the above method, so that the number of normal heartbeats in the ECG signal to be classified can be obtained. , The number of abnormal heartbeats and other heartbeats to provide a basis for determining the heart condition.

[0081] In this embodiment, the final classification results are obtained by weighting the classification results of the two classification models, so as to improve the accuracy of the classification, thereby providing a reliable data basis for detecting the heart condition.

[0082] It is understandable that when the ECG signal to be classified is actually collected, the ECG signal quality of the body surface will be affected due to the large noise and randomness. In order to avoid the impact on the subsequent classification results, when the ECG signal to be classified is obtained, the ECG signal to be classified can be filtered first, and then the filtered ECG signal to be classified is cut to obtain the heartbeat data . Specifically, the ECG signal to be classified is one-dimensional multi-scale Gaussian filtering and Butterworth filtering.

[0083] Since the ECG signal is a one-dimensional time series signal, the large time scale pays attention to the overall trend of the ECG, and the small time scale pays attention to the part of the ECG. Both are essential for the ECG judgment. Therefore, one can be used for the ECG signal. Multi-scale Gaussian filtering of three-dimensional time series signals to obtain more accurate ECG signals from different time scales. In practical applications, Gaussian filtering is a linear smoothing filter, and the filtered signal is obtained through the weighted average method. In the specific implementation, the filter calculation can be performed by formula (1).

[0084]

[0085] Among them, σ is the standard deviation of the Gaussian function, which can be regarded as the fuzzy coefficient, and the Gaussian kernel function can be obtained by the above formula. The time blur radius r=r1, r2...ri can be taken respectively, and the Gaussian kernels G1, G2...Gi at different scales can be obtained respectively. Then normalize the Gaussian kernels obtained at different scales to obtain G1', G2'...Gi', and then center-align and integrate the Gaussian filters at different scales according to the preset weights, specifically: G=w1 ×G1'+w2×G2'+…+wi×Gi', where,

[0086] It should be noted that ri is the value range of time t. When t corresponds to different value ranges, Gaussian kernels at different scales can be obtained.

[0087] For example, taking three scales of blur radius r=1, 2, 3, the corresponding blur coefficients σ=0.5, 1, 3, and the corresponding weights are respectively 0.7, 0.2, and 0.1. When r=1 and σ=0.5, substituting t=[-1 0 1] into the above formula respectively to obtain Gaussian filter kernel G1=[0.0270,0.1995,0.0270], normalize G1 to obtain G1'= [0.1065 0.78700.1065]; When r=2 and σ=1, substituting t=[-2-1 0 1 2] into the above formula, after normalization, the Gaussian kernel G2'=[0.0545 0.2442 0.4026 0.2442 0.0545]; When r=3 and σ=3, substituting t=[-3-2-1 0 1 2 3] into the above formula, after normalization, the Gaussian kernel G3'=[0.1063 0.1403 0.1658 0.1752 0.16580 .1403 0.1063]. Add two zeros at the beginning and the end of G1', and add one zero at the beginning and the end of G2' to make it reach the length of G3', and then add G1', G2', and G3' to get the final multi-scale Gaussian filter: [0.01,0.02,0.14,0.65,0.14.0.02.0.01]

[0088] When the ECG signal is filtered by one-dimensional multi-scale Gaussian filtering, in order to eliminate the high-frequency myoelectric interference, low-frequency baseline drift and DC component in the filtered ECG signal, the filtered ECG signal can also be filtered. Voss filtering. Specifically, the filtered ECG signal is input to the Butterworth bandpass filter, the signal outside the preset frequency range is filtered, and zero-filling operation is performed at the edge, so as to realize the overall denoising of the ECG signal.

[0089] In a possible implementation of the embodiment of the present application, a specific implementation of performing heartbeat cutting on the ECG signal to be classified to obtain heartbeat data is provided, specifically, detecting the position of the R wave peak in the ECG signal to be classified ; From the ECG signal to be classified, intercept the first ECG data in the first preset time period from the R wave peak position to the P wave direction, and intercept the second preset time period from the R wave peak position to the T wave direction For the second ECG data, the first ECG data and the second ECG data are spliced to obtain the heartbeat data.

[0090] That is, the position of the R wave peak is obtained by detecting the R wave peak of the ECG signal to be classified. In specific implementation, the threshold difference method can be used to detect the R wave peak of the ECG signal. Then, taking the R wave peak position as the reference, intercept the first ECG data in the first preset time period in the P wave direction, that is, take the R wave peak position as the end point, and intercept the first ECG data in the first preset time period to the left. One ECG data. Then take the R wave peak position as the reference, and intercept the second ECG data in the second preset time period in the T wave direction, that is, take the R wave peak position as the starting point and intercept the second data in the second preset time period to the right. ECG data. Then, the first ECG data and the second ECG data are spliced to obtain a heartbeat data. The first preset time period and the second preset time period can be set based on experience, for example, the first preset time period is 0.2 seconds, and the second preset time period is 0.46 seconds.

[0091] It is understandable that since the ECG signal to be classified can include multiple R waves, multiple heartbeat data can be obtained by cutting. Among them, each heartbeat data can include a complete PQRST wave data

[0092] In a possible implementation manner of the embodiment of the present application, a specific implementation manner for extracting statistical features and sampling features of heartbeat data and frequency domain heartbeat data is also provided. The implementation manner will be described below with reference to the accompanying drawings. .

[0093] See image 3 , The figure is a flowchart of a method for extracting heartbeat features provided by an embodiment of the application, such as image 3 As shown, the method can include:

[0094] S301: Cut the heart rate data and the frequency domain heart rate data to obtain the cut heart rate data and the frequency domain heart rate data after the cut.

[0095] In this embodiment, for each heartbeat data and each frequency domain heartbeat data, in order to obtain more heartbeat features, more heartbeat features can be used for classification, and the accuracy of classification can be improved. The heartbeat data and frequency domain heartbeat data will be cut first to obtain the cut heartbeat data and the frequency domain heartbeat data after cutting.

[0096] In the specific implementation, the cutting granularity can be determined according to the actual situation. For example, the heartbeat data and the frequency domain heartbeat data are divided into two equal parts, that is, the heartbeat data is divided into two parts, and the frequency domain heartbeat data is divided into two parts. The blog data is divided into two parts. In practical applications, when the heartbeat data is segmented, it can be segmented based on time, and when segmenting the frequency domain heartbeat data, it can be segmented based on frequency.

[0097] S302: Count the average value, variance, maximum value, and minimum value of each sampling point set according to the sampling frequency in each cut heartbeat data and each cut frequency domain heartbeat data, respectively, as heartbeat data and Statistical characteristics of heartbeat data in frequency domain.

[0098] That is, for each cut heartbeat data, calculate the average value, variance, maximum value, and minimum value of each sampling point in the cut heartbeat data, and use them as the statistical characteristics of the heartbeat data. Among them, the number of sampling points is set according to the sampling frequency. At the same time, for each cut frequency domain heartbeat data, calculate the average, variance, maximum and minimum of each sampling point of the cut frequency domain heartbeat data, and use them as the statistical characteristics of the frequency domain heartbeat data .

[0099] For example, if the heartbeat data and the frequency domain heartbeat data are cut in pairs, there are 2 heartbeat data after cutting and 2 frequency domain heartbeat data after cutting, and there are 4 heartbeat data after each cutting. Statistical features, each cut frequency-domain heartbeat data has 4 statistical features, then the heartbeat data corresponds to 16 statistical features.

[0100] S303: Extract each cut heartbeat data and amplitude data of sampling points at preset intervals in each cut frequency domain heartbeat data, as sampling features of the heartbeat data and frequency domain heartbeat data, respectively.

[0101] In this embodiment, for each heartbeat data after cutting, certain sampling points are determined at preset intervals among all the sampling points, and then the amplitude data of the sampling points at the preset interval is obtained, and the amplitude data is regarded as the heart rate. Sampling characteristics of blog data. In the same way, for each cut frequency domain data, certain sampling points are determined according to the preset interval among all the sampling points, and then the amplitude data of the sampling points at the preset interval is obtained, and the amplitude data is regarded as the frequency domain center. Sampling characteristics of blog data. Among them, the sampling feature of heartbeat data and the sampling feature of frequency domain heartbeat data are unified as the sampling feature of heartbeat data.

[0102] Among them, the preset interval can be set according to the actual situation. For example, the cut heartbeat data and the cut frequency domain heartbeat data are divided into six equal parts, then each cut heartbeat data corresponds to 6 samples Features, each cut frequency domain heartbeat data corresponds to 6 sampling features. Assuming a bisection cut, the 2 cut heartbeat data correspond to 12 sampling features, the 2 cut frequency domain heartbeat data correspond to 12 sampling features, and the heartbeat data correspond to 24 sampling features. Since the heart rate data corresponds to 16 statistical features during the halving cut, the heart rate data corresponds to 40 heart rate features in total.

[0103] It should be noted that for each heartbeat data cut from the ECG signal to be classified, the above method can be used to obtain the heartbeat feature corresponding to the heartbeat data, so as to use the heartbeat feature to determine the classification of the heartbeat data result.

[0104] From the above description, it can be seen that by subdividing and cutting the heart rate data and the frequency domain heart rate data, a large number of heart rate features can be extracted, so that a large number of heart rate features can be used for classification to improve classification accuracy.

[0105] In a possible implementation manner of the embodiment of the present application, a specific implementation manner for identifying invalid heartbeat data is provided, and the implementation manner will be described below with reference to the accompanying drawings.

[0106] See Figure 4 , The figure is a flowchart of a method for identifying invalid heartbeat data provided by an embodiment of the application, such as Figure 4 As shown, the method can include:

[0107] S401: Calculate the feature average value of each heartbeat feature according to the heartbeat feature of the heartbeat data, and compose the feature average value of each heartbeat feature into a feature average vector.

[0108] In this embodiment, for each heartbeat data, the aforementioned method can be used to obtain the heartbeat feature corresponding to the heartbeat data, and then the heartbeat feature of all heartbeat data is used to calculate the feature average value of each heartbeat feature. Then, the feature average value of each heartbeat feature is formed into a feature average vector to use the feature average vector to determine invalid heartbeat data.

[0109] In specific implementation, formula (2) can be used to calculate the feature average of each heartbeat feature:

[0110]

[0111] Among them, N is the number of heartbeat data, Z is the degree of deviation, Z=N; x n,j Represents the j features of the nth heartbeat data.

[0112] That is, the feature average value f corresponding to the jth heartbeat feature j It is determined by using the jth feature of all heartbeat data. When the feature average value corresponding to each heartbeat feature is obtained, the feature average value vector f=[f 1 f 2...f j ].

[0113] S402: Combine the heartbeat features of the target heartbeat data into a target heartbeat feature vector, and calculate the similarity between the target heartbeat feature vector and the feature average vector.

[0114] In this embodiment, for each heartbeat data, it is used as the target heartbeat data, and the heartbeat features corresponding to the target heartbeat data are combined into the target heartbeat feature vector to calculate the target heartbeat feature vector and the feature average The similarity between value vectors. Wherein, the similarity can be Mahalanobis distance, which is used to represent the covariance distance between two samples. The smaller the Mahalanobis distance, the more similar the target heart rate feature vector to the feature average vector.

[0115] In specific implementation, this embodiment provides an implementation method for calculating the Mahalanobis distance. Specifically, the heartbeat characteristics of all heartbeat data are first formed into a matrix, and then the covariance matrix of the matrix is obtained, and the covariance matrix is used Calculate the Mahalanobis distance between the target heartbeat feature vector and the feature average vector. It can be calculated using the following formula:

[0116]

[0117] Where c 1 Represents the first heartbeat feature of all heartbeat data, c 2 Represents the second heartbeat feature of all heartbeat data, c J Represents the Jth heartbeat feature of all heartbeat data, thus forming a matrix X. The covariance matrix of this matrix is:

[0118]

[0119] Where cov(c i , C J )=E[(c i -E[c i ])(c j -E[c j ])], E[c i ] Is the vector c i The mean of.

[0120] Based on this, the Mahalanobis distance between the target heartbeat feature vector and the feature average vector is:

[0121]

[0122] Where x n Is the target heartbeat feature vector, D M (x n ) Is the Mahalanobis distance between the target heartbeat feature vector and the feature average vector, T is the vector transposition, ∑ -1 Is the inverse of the covariance matrix.

[0123] For the heartbeat feature of each heartbeat data, the Mahalanobis distance between the heartbeat feature vector corresponding to the heartbeat data and the feature average vector can be calculated by the above formula to obtain the target heartbeat feature vector and the feature center point The similarity between feature average vectors.

[0124] S403: If the similarity between the target heartbeat feature vector and the feature average vector does not satisfy the preset condition, determine the target heartbeat data corresponding to the target heartbeat feature vector as invalid heartbeat data.

[0125] In this embodiment, after obtaining the similarity between each heartbeat feature vector and the feature average vector, it is determined whether the similarity meets the preset condition, and if not, the heartbeat corresponding to the heartbeat feature vector is determined The data is invalid heartbeat data. Among them, the preset conditions can be set according to actual conditions.

[0126] In practical applications, when the similarity between the target heartbeat feature vector and the feature average vector is represented by Mahalanobis distance, the Mahalanobis distance between the heartbeat feature vector and the feature average vector of any heartbeat data obeys the chi-square For distribution, a certain confidence interval can be selected, and the corresponding threshold can be obtained by querying the standard chi-square table. Heartbeat data whose Mahalanobis distance exceeds this threshold is regarded as noisy and invalid heartbeat data that cannot be distinguished.

[0127] Through this embodiment, invalid heartbeat data can be identified according to the heartbeat characteristics of the heartbeat data, so as to eliminate the invalid heartbeat data, avoid the impact on subsequent classification results, and improve the accuracy of classification.

[0128] In a possible implementation manner of the embodiment of the present application, a training process of a linear classification model and a smooth quadratic classification model is provided. Specifically, the linear classification model is a Bayesian linear classification model, and the smooth quadratic classification The model is a Bayesian smooth quadratic classification model. The training of the linear classification model and the smooth quadratic classification model includes:

[0129] 1) Extract the heartbeat feature of the training heartbeat data.

[0130] In this embodiment, the training ECG signal is acquired first, and then the training ECG signal is cut to obtain training heartbeat data. Then, the heartbeat feature is extracted from the training heartbeat data to use the heartbeat feature to train the classification model.

[0131] In specific implementation, extracting the heart rate characteristics of the training heart rate may include: converting the training heart rate data into frequency domain training heart rate data, extracting the training heart rate data, and the statistical features and sampling features of the training frequency domain heart rate data as The heartbeat characteristics of the training heartbeat data. That is, the statistical features and sampling features of the training heartbeat data, and the statistical features and sampling features of the frequency domain heartbeat data are extracted separately, and they are unified as the heartbeat features of the training heartbeat data.

[0132] In specific implementation, after obtaining the heartbeat characteristics of the training heartbeat data, the invalid heartbeat data from the training heartbeat data can be eliminated according to the heartbeat characteristics, so as to use the heartbeat characteristics of the cleaned training heartbeat data for subsequent classification Model training.

[0133] For the specific implementation of cutting the training ECG signal, extracting the heartbeat feature, and eliminating invalid heartbeat data, refer to the foregoing method embodiment, and this embodiment will not be repeated here.

[0134] 2) According to the heartbeat feature of the training heartbeat data and the classification label of the training heartbeat data, a Bayesian linear classification model is generated.

[0135] In this embodiment, after acquiring the heartbeat features of the training heartbeat data, each heartbeat feature and the classification label corresponding to the heartbeat feature are used as training data to train the initial classification model to obtain the Bayesian classification model. Among them, the classification label may include normal heart beats, abnormal heart beats and other heart beats.

[0136] In the specific implementation, Bayesian formula, heart rate feature, and classification label of heart rate feature can be used for training to obtain a Bayesian model. Among them, the Bayesian formula is:

[0137]

[0138] For the purpose of the classification task, the marginal probability of the denominator part is unnecessary and can be regarded as a constant value. The key point is to observe the denominator part to find the corresponding maximum probability, that is, the original Bayesian model can be simplified to:

[0139] p(q k |X, θ k )∝p(X|q k , Θ k )·P(q k |θ k ) (7)

[0140] Where p(q k |X, θ k ) Is the posterior probability, category q k The probability depends on the feature vector sample X in the parameter θ k Probability under Gaussian distribution. p(X|q k , Θ k ) Is the conditional probability of sample X, depending on category q k In the parameter θ k Probability under Gaussian distribution. p(q k |θ k ) Is the prior probability.

[0141] For the convenience of calculation, the probability is usually expressed in the form of logarithmic summation, as follows:

[0142] log(p(q k |X, θ k ))∝log(p(X|q k , Θ k ))+log(p(q k |θ k )) (8)

[0143] In the specific implementation, the multidimensional Gaussian model can be used as the discriminant model. First, the covariance matrix ∑ of all heartbeat characteristics is obtained, and then the Gaussian distribution parameters of the corresponding samples are obtained for the normal heartbeat, abnormal heartbeat and other heartbeats. . Finally, by calculating the conditional probability and prior probability of the multidimensional Gaussian model in different categories, the Bayesian linear discrimination is realized.

[0144] It should be noted that the covariance matrix Σ of the heartbeat feature above is a rectangle formed by the heartbeat feature after cleaning the training heartbeat data. That is, ∑ is the covariance matrix corresponding to all heartbeat features after excluding invalid heartbeat data from the training heartbeat data.

[0145] 3) According to the heartbeat feature of the training heartbeat data and the classification label of the training heartbeat data, a Bayesian smooth quadratic classification model is generated.

[0146] In this embodiment, after acquiring the heartbeat features of the training heartbeat data, each heartbeat feature and the classification label corresponding to the heartbeat feature are used as training data to train the initial classification model to obtain the Bayesian smooth quadratic form Classification model.

[0147] In practical applications, considering that the conventional quadratic discriminant model calculates the covariance matrix for all different classifications, due to the large dimension of the covariance matrix calculation, the eigenvalues have different magnitude levels, and it is easy to generate an ill-conditioned matrix. In order to avoid the above-mentioned problems, this application proposes a Bayesian smooth quadratic discriminant model. The specific model is:

[0148]

[0149] Among them, λ is the smoothing coefficient, vector x is the heartbeat feature, d is the dimension of vector x, u k Is the mean value of the heartbeat features corresponding to a certain training heartbeat data, and ∑ is the covariance matrix corresponding to all heartbeat features after excluding invalid heartbeat data from the training heartbeat data. Among them, λ can be designed to be 0.1 in this embodiment.

[0150] To facilitate understanding of the solutions provided in the embodiments of this application, see Figure 5 The ECG signal classification framework diagram shown. First, the ECG signal to be classified is collected, and one-dimensional multi-scale Gaussian and Butterworth filtering is performed on the ECG signal to be classified to realize the overall denoising of the ECG signal to be classified. Then the main peak detection is performed on the denoised ECG signal to be classified, and the position of the R wave peak is obtained to perform heartbeat cutting to obtain heartbeat data. Then normalize the heartbeat data, and then convert the normalized heartbeat data to obtain the frequency domain heartbeat data, and use the data splitting method to divide the heartbeat data and the frequency domain heartbeat data to Obtain the statistical features and sampling features of the segmented heartbeat data, and the statistical features and sampling features of the segmented frequency domain heartbeat data, and use them as the heartbeat features of the heartbeat data. Then, the feature average value is calculated using the heartbeat feature of the heartbeat data, and the feature average value of each heartbeat feature is formed into a feature average vector. Then calculate the Mahalanobis distance between the heartbeat feature vector and the feature average vector of each heartbeat data, and check whether the Mahalanobis distance satisfies the preset condition by chi-square. The heartbeat data corresponding to the heartbeat feature vectors that do not meet the preset conditions are eliminated, and the heartbeat features of the remaining heartbeat data are input into the Bayesian linear classification model and the Bayesian smooth quadratic classification model respectively, and the two The classification results output by the classification model are weighted and fused to obtain the classification results of the heartbeat data.

[0151] Based on the foregoing method embodiments, the present application provides an ECG signal classification device, which will be described below with reference to the accompanying drawings.

[0152] See Image 6 , The figure is a structural diagram of an ECG signal classification device provided by an embodiment of the application, such as Image 6 As shown, the device may include:

[0153] The cutting unit 601 is used to perform heartbeat cutting on the ECG signal to be classified to obtain heartbeat data;

[0154] The conversion unit 602 is configured to convert the heartbeat data into frequency domain heartbeat data;

[0155] The extraction unit 603 is configured to extract the heartbeat data and the statistical features and sampling features of the frequency domain heartbeat data as the heartbeat features of the heartbeat data;

[0156] The identifying unit 604 is configured to identify invalid heartbeat data according to the heartbeat characteristics of the heartbeat data, remove the invalid heartbeat data from the heartbeat data, and obtain updated heartbeat data;

[0157] The obtaining unit 605 is configured to input the heartbeat feature of the updated heartbeat data into a heartbeat classification model to obtain a classification result of the heartbeat data.

[0158] In a possible implementation manner, the acquiring unit includes:

[0159] The first obtaining subunit is configured to input the heartbeat feature of the updated heartbeat data into the linear classification model to obtain the first classification result;

[0160] The second acquisition subunit is used to input the heart rate feature of the updated heart rate data into a smooth quadratic classification model to obtain a second classification result; the linear classification model and the smooth quadratic classification model are based on training The heartbeat feature of the heartbeat data and the classification label of the training heartbeat data are generated by training;

[0161] The third acquiring subunit is configured to perform weighted fusion on the first classification result and the second classification result to obtain the classification result of the heartbeat data.

[0162] In a possible implementation manner, the device further includes:

[0163] The filtering unit is configured to perform one-dimensional multi-scale Gaussian filtering and Butterworth filtering on the ECG signal to be classified before executing the cutting unit.

[0164] In a possible implementation manner, the cutting unit includes:

[0165] The detection subunit is used to detect the R wave peak position in the ECG signal to be classified;

[0166] The first intercepting subunit is configured to intercept the first ECG data in the first preset time period from the position of the R wave peak to the P wave direction from the ECG signal to be classified;

[0167] The second intercepting subunit is configured to intercept the second ECG data within a second preset time period from the R wave peak position to the T wave direction;

[0168] The splicing subunit is used for splicing the first ECG data and the second ECG data to obtain heartbeat data.

[0169] In a possible implementation manner, the extraction unit includes:

[0170] A cutting subunit for cutting the heartbeat data and the frequency domain heartbeat data to obtain cut heartbeat data and frequency domain heartbeat data;

[0171] The fourth acquisition subunit is used to separately count the average value, variance, and maximum value of each sampling point set according to the sampling frequency in each of the cut heartbeat data and each of the cut frequency domain heartbeat data , Minimum value, respectively as the statistical characteristics of the heartbeat data and the frequency domain heartbeat data;

[0172] The fifth acquisition subunit is used to extract each of the cut heartbeat data and the amplitude data of the sampling points at preset intervals in each of the cut frequency domain heartbeat data, as the heartbeat data respectively Data and sampling characteristics of the frequency domain heartbeat data.

[0173] In a possible implementation manner, the identification unit includes:

[0174] The first calculation subunit is configured to calculate the feature average value of each heartbeat feature according to the heartbeat feature of the heartbeat data, and compose the feature average value of each heartbeat feature into a feature average vector;

[0175] The second calculation subunit is used to compose the heartbeat feature of the target heartbeat data into a target heartbeat feature vector, and calculate the similarity between the target heartbeat feature vector and the feature average vector;

[0176] The determining subunit is configured to determine the target heart rate data corresponding to the target heart rate feature vector as an invalid heart rate if the similarity between the target heart rate feature vector and the feature average value vector does not satisfy a preset condition Blog data.

[0177] In a possible implementation manner, the linear classification model is a Bayesian linear classification model, the smooth quadratic classification model is a Bayesian smooth quadratic classification model, the linear classification model and the smooth The training of the quadratic classification model includes:

[0178] Extract the heartbeat features of the training heartbeat data;

[0179] Generating a Bayesian linear classification model according to the heartbeat feature of the training heartbeat data and the classification label of the training heartbeat data;

[0180] According to the heartbeat feature of the training heartbeat data and the classification label of the training heartbeat data, a Bayesian smooth quadratic classification model is generated.

[0181] In a possible implementation manner, the extraction of the heart rate feature of the training heart rate data includes:

[0182] The training heartbeat data is converted into frequency-domain training heartbeat data, and the training heartbeat data and statistical features and sampling features of the training frequency-domain heartbeat data are extracted as heartbeat features of the training heartbeat data.

[0183] It should be noted that the implementation of each unit in this embodiment can refer to the foregoing method embodiment, and this embodiment will not be repeated here.

[0184] In addition, an embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium stores instructions. When the instructions run on a terminal device, the terminal device executes the Method of classification of ECG signals.

[0185] An embodiment of the present application provides a computer program product, which is characterized in that, when the computer program product runs on a terminal device, the terminal device is caused to execute the ECG signal classification method.

[0186] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0187] It should be understood that in this application, "at least one (item)" refers to one or more, and "multiple" refers to two or more. "And/or" is used to describe the association relationship of associated objects, indicating that there can be three types of relationships, for example, "A and/or B" can mean: only A, only B, and both A and B , Where A and B can be singular or plural. The character "/" generally indicates that the associated objects are in an "or" relationship. "The following at least one item (a)" or similar expressions refers to any combination of these items, including any combination of single item (a) or plural items (a). For example, at least one of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c" ", where a, b, and c can be single or multiple.

[0188] It should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities or operations There is any such actual relationship or order between. Moreover, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes those that are not explicitly listed Other elements of, or also include elements inherent to this process, method, article or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other same elements in the process, method, article, or equipment including the element.

[0189] The steps of the method or algorithm described in combination with the embodiments disclosed herein can be directly implemented by hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or all areas in the technical field. Any other known storage media.

[0190] The above description of the disclosed embodiments enables those skilled in the art to implement or use this application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined in this document can be implemented in other embodiments without departing from the spirit or scope of the application. Therefore, this application will not be limited to the embodiments shown in this text, but should conform to the widest scope consistent with the principles and novel features disclosed in this text.

## PUM

## Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

## Similar technology patents

## Semiconductor storage device and refresh control method thereof

Owner:NEC ELECTRONICS CORP

## Base station control method and system thereof, and apparatuses

Owner:CHINA MOBILE COMM GRP CO LTD

## Pallet stretching-out device for refrigerator

Owner:TAIZHOU LG ELECTRONICS REFRIGERATOR CO LTD

## Method for improving WiMAX performance based on periodogram testing and spectrum pool

Owner:CHONGQING UNIV OF POSTS & TELECOMM

## Classification and recommendation of technical efficacy words

- avoid interference
- Improve classification accuracy

## Methods and apparatus for endovascularly replacing a patient's heart valve

Owner:BOSTON SCI SCIMED INC

## Wireless extension for cable television signals

Owner:ENTROPIC COMM INC

## Method and apparatus for interference mitigation in an ofdma-based communication system

Owner:FUTUREWEI TECH INC

## Magnetic locking device

Owner:QUANTA COMPUTER INC

## Polarization SAR image classification based on CNN and SVM

Owner:XIDIAN UNIV

## Method for realizing classification of scene images

Owner:INST OF AUTOMATION CHINESE ACAD OF SCI

## Electrocardiogram electrocardiosignal classification method with multi-scale characteristics combined

Owner:BEIJING INSTITUTE OF TECHNOLOGYGY

## Method and system of landslide recognition of complicated geological background area based on LiDAR

Owner:CHINA UNIV OF GEOSCIENCES (WUHAN)

## Heterogeneous network node representation learning method based on meta-path

Owner:EAST CHINA NORMAL UNIVERSITY