Electrocardiosignal classification method, electrocardiosignal classification model training method and electronic equipment
By combining semi-supervised learning and masked autoencoders with a mixed Gaussian distribution method, the problems of high training cost and low accuracy of ECG signal classification models are solved, and efficient and accurate ECG signal classification is achieved.
Patent Information
- Application Number
- CN202410893058.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-09-17
AI Technical Summary
The process of training ECG signal classification models in the existing technology requires high costs, affects model training efficiency, and the accuracy of the classification model is not high, especially because all ECG signals to be classified require professional feature design and data. Preprocessing, and deep neural network training requires a large amount of labeled data and the labeling results are prone to errors.
A semi-supervised model training method is adopted, using a training data set including labeled ECG signal samples and unlabeled ECG signal samples, through the initial variable transformation module and the initial variable classification module, including multiple masks cascaded in sequence The autoencoder and the classification module generated based on the mixed Gaussian distribution train the ECG signal classification model, extract deeper features and adjust model parameters, reducing the need for professional annotation.
It effectively reduces the cost of ECG signal classification model training, improves training efficiency and classification accuracy, improves the model's classification accuracy of ECG signals, and saves a lot of time and cost.
Smart Images

Figure CN118648906A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electrocardiogram signal classification, and in particular to electrocardiogram signal classification, an electrocardiogram signal classification model training method and electronic equipment. Background Art
[0002] Since the beginning of the 21st century, the global prevalence and mortality of cardiovascular diseases have shown an increasing trend year by year, seriously threatening human life and health. Therefore, early prevention and diagnosis of cardiovascular diseases are particularly important. ECG signals, as a tool that can record the electrical activity during heart beats, have become one of the basic tools for diagnosing various cardiovascular diseases. Abnormal detection and classification of collected ECG signals can assist in the prevention and early detection of cardiovascular diseases, thereby reducing mortality and treatment costs.
[0003] At present, there have been many studies on the classification methods of ECG signals, one of which is a supervised learning method. The supervised learning method extracts the time domain features and frequency domain features of ECG signals, and combines the time domain features and frequency domain features of ECG signals with supervised machine learning classification algorithms to perform ECG signal classification. This method relies on professional feature design and data preprocessing, requires professional practitioners to process, has high requirements for data quality, makes classification model training costly, and affects model training efficiency. In addition, in the actual ECG signal classification process, it is difficult to perform professional feature design and data preprocessing for all ECG signals to be classified, which will affect the accuracy of the classification results of ECG signals obtained by the classification model. The second method is to use different types of deep neural networks, such as fully connected neural networks, convolutional neural networks, etc., to learn high-dimensional abstract features in an end-to-end manner and automatically perform ECG signal classification. The training data set used in the deep neural network training process corresponding to this method requires a large number of ECG signals and fine-grained labels corresponding to the ECG signals (such as beat type labels or rhythm type labels for each ECG signal beat by beat). The labels of ECG signals usually require professional practitioners to perform annotation on the ECG signals. This work not only consumes a lot of costs, but also the annotation results are prone to errors, which makes the training of deep neural network classification models require high costs, affects the model training efficiency and the accuracy of the classification model obtained by training, and also affects the classification accuracy of ECG signals by the obtained deep neural network classification model. Summary of the invention
[0004] The purpose of the present invention is to solve the problem that the process of training an ECG signal classification model in the prior art requires high costs, affects the model training efficiency, and the classification inaccuracy of the classification model obtained by training. The present invention provides an ECG signal classification, an ECG signal classification model training method, and an electronic device, which can adopt a semi-supervised model training method, and use a training data set including labeled ECG signal samples and unlabeled ECG signal samples to train the initial ECG signal classification model to obtain a target ECG signal classification model. The cost of ECG signal classification model training is effectively reduced, the training efficiency of the ECG signal classification model is improved, and the classification accuracy of the ECG signal classification model obtained by training is improved.
[0005] To solve the above technical problems, an embodiment of the present invention discloses a method for training an ECG signal classification model, the method comprising: determining a training data set and determining an initial ECG signal classification model, the training data set comprising labeled ECG signal samples and unlabeled ECG signal samples, the initial ECG signal classification model comprising an initial variable transformation module and an initial variable classification module, the initial variable transformation module comprising a plurality of masked autoencoders cascaded in sequence, and the initial variable classification module being generated based on a mixed Gaussian distribution; inputting the ECG signal samples included in the training data set into the initial ECG signal classification model, performing variable transformation processing on the ECG signal samples by the initial variable transformation module to obtain a target variable that obeys the mixed Gaussian distribution, and inputting the target variable into the initial variable classification module, performing variable classification processing by the initial variable classification module according to the target variable to obtain a classification result of the ECG signal sample; adjusting the target parameters of the initial ECG signal classification model according to the classification result to obtain a target ECG signal classification model.
[0006] By adopting the above technical scheme, in the process of training the ECG signal classification model, the training data set including the ECG signal samples with labels and the ECG signal samples without labels can be used to train the ECG signal classification model in a semi-supervised manner, that is, it is not necessary to professionally label all the ECG signal samples in the training set, saving a lot of cost and time, and increasing the model training efficiency. In addition, the initial variable transformation module composed of multiple masked autoencoders cascaded in sequence performs variable transformation processing on the ECG signal samples included in the training data set, and the multiple masked autoencoders cascaded in sequence can extract deeper features of the ECG signal samples to obtain the target variable that obeys the mixed Gaussian distribution. Then the target variable is input into the initial variable classification module generated based on the mixed Gaussian distribution, and the initial variable classification module performs variable classification processing according to the target variable to obtain the classification result of the ECG signal sample, and adjusts the target parameters of the initial ECG signal classification model according to the classification result to obtain the target ECG signal classification model, which utilizes the high stability and good fitting ability of the Gaussian distribution, effectively improves the accuracy of the target ECG signal classification model obtained by training, and then improves the classification accuracy of the target ECG signal classification model for the ECG signal.
[0007] According to another specific embodiment of the present invention, an embodiment of the present invention discloses a method for training an ECG signal classification model, in which an initial variable transformation module performs variable transformation processing on ECG signal samples to obtain a target variable that obeys a mixed Gaussian distribution, including: inputting the ECG signal samples included in the training data set into a first-level masked autoencoder included in the initial variable transformation module, and performing corresponding processing on the ECG signal samples by the first-level masked autoencoder to obtain output variables that obey a mixed Gaussian distribution; and sequentially inputting the output variables output by the previous-level masked autoencoder into the next-level masked autoencoder for corresponding processing, until the last-level masked autoencoder outputs the corresponding output variable as the target variable.
[0008] By adopting the above technical solution, multi-level feature extraction of ECG signal samples is performed through masked autoencoders, which can effectively extract deeper features of ECG signal samples, making the obtained target variables obeying the mixed Gaussian distribution more convenient for the training of ECG signal classification models, and effectively improving the accuracy of the trained target ECG signal classification model.
[0009] According to another specific embodiment of the present invention, an embodiment of the present invention discloses a method for training an ECG signal classification model, in which target parameters include the mean and standard deviation corresponding to each masked autoencoder, and the output variables output by the previous level masked autoencoder are input to the next level masked autoencoder for corresponding processing, including: inputting the output variables output by the previous level masked autoencoder to the next level masked autoencoder, and the next level masked autoencoder performs variable transformation processing on the output variables output by the previous level masked autoencoder based on the corresponding mean and standard deviation.
[0010] By adopting the above technical scheme, the latter-stage masked autoencoder performs variable transformation processing on the output variables output by the previous-stage masked autoencoder based on their corresponding mean and standard deviation, so that the final target variable is more consistent with the mixed Gaussian distribution, which facilitates the training of the ECG signal classification model including the initial variable classification module generated based on the mixed Gaussian distribution, thereby improving the accuracy of the trained target ECG signal classification model.
[0011] According to another specific embodiment of the present invention, an embodiment of the present invention discloses a method for training an electrocardiogram signal classification model, in which the masked autoencoder performs variable transformation processing on the output variable by using the following formula:
[0012] z d =(x d -μ d )exp(-α d )
[0013] Among them, x d The output variable of the previous level mask self-encoder includes the d-th dimension attribute data, z d The output variable of the next-level masked self-encoder includes the d-th dimension attribute data, μ d is the mean of the d-th dimension, α d is the standard deviation of the dth dimension.
[0014] By adopting the above technical solution, the target variable obtained by transforming the ECG signal samples through the above formula is more consistent with the mixed Gaussian distribution, which can effectively improve the accuracy of the trained target ECG signal classification model.
[0015] According to another specific embodiment of the present invention, an embodiment of the present invention discloses an ECG signal classification model training method, wherein the initial variable classification module includes multiple probability density calculation units, each probability density calculation unit corresponds to an ECG signal sample type, the probability density calculation unit is obtained based on a mixed Gaussian distribution, and the initial variable classification module performs variable classification processing according to the target variable to obtain the classification result of the ECG signal sample, including: inputting the target variable into each probability density calculation unit respectively to perform probability density calculation based on the mixed Gaussian distribution to obtain the target probability density; selecting the ECG signal sample type corresponding to the probability density calculation unit with the largest target probability density as the classification result of the ECG signal sample.
[0016] By adopting the above technical solution, the target variables are input into each probability density calculation unit respectively to perform probability density calculation based on mixed Gaussian distribution, which can obtain a more accurate target probability density and effectively increase the accuracy of the classification results of the ECG signal samples.
[0017] According to another specific embodiment of the present invention, an embodiment of the present invention discloses an ECG signal classification model training method, wherein the target parameters also include a mean and a covariance matrix of a mixed Gaussian distribution, and when the ECG signal sample is a labeled ECG signal sample, the target probability density of the target variable is calculated based on the mixed Gaussian distribution, including calculating the target probability density by the following formula:
[0018]
[0019] Among them, p(x|y) is the target probability density, z L is the target variable, L is the number of masked autoencoders, μ y is the mean of the mixed Gaussian distribution corresponding to the yth probability density calculation unit, Σ y is the covariance matrix of the mixed Gaussian distribution corresponding to the yth probability density calculation unit, is the standard deviation of the dth dimension corresponding to the lth masked autoencoder.
[0020] By adopting the above technical solution and the above formula, the target probability density corresponding to the ECG signal sample with a label can be accurately obtained, thereby effectively increasing the accuracy of the classification result of the ECG signal sample.
[0021] According to another specific embodiment of the present invention, an embodiment of the present invention discloses an ECG signal classification model training method, wherein the target parameters also include a mean and a covariance matrix of a mixed Gaussian distribution, and when the ECG signal sample is an unlabeled ECG signal sample, the target probability density of the target variable is calculated based on the mixed Gaussian distribution, including calculating the target probability density by the following formula:
[0022]
[0023] Among them, p(x) is the target probability density, Z L is the target variable, L is the number of masked autoencoders, μ y is the mean of the mixed Gaussian distribution corresponding to the yth probability density calculation unit, Σ y is the covariance matrix of the mixed Gaussian distribution corresponding to the yth probability density calculation unit, is the standard deviation of the dth dimension corresponding to the lth masked autoencoder, and C is the number of probability density calculation units.
[0024] By adopting the above technical solution and the above formula, the target probability density corresponding to the ECG signal sample being an unlabeled ECG signal sample can be accurately obtained, thereby effectively increasing the accuracy of the classification result of the ECG signal sample.
[0025] According to another specific embodiment of the present invention, an embodiment of the present invention discloses a method for training an ECG signal classification model, and a training data set is obtained in the following manner: acquiring multiple initial ECG signals; determining the beat peak positions of the initial ECG signals, and performing type labeling on a preset proportion of the multiple initial ECG signals to obtain classification types corresponding to the initial ECG signals; performing beat segmentation processing on the initial ECG signals according to the beat peak positions and the target window to obtain ECG signals after the beat segmentation processing; performing normalization processing on the ECG signals after the beat segmentation processing to obtain ECG signals after the normalization processing; and obtaining a training data set based on the normalized ECG signals and the corresponding classification types.
[0026] By adopting the above technical solution, the initial ECG signal is preprocessed (such as determining the peak position of the heartbeat, performing heartbeat segmentation, and normalization), and the obtained training data set is more suitable for model training, which can effectively improve the accuracy of the target ECG signal classification model obtained by training.
[0027] An embodiment of the present invention also discloses an ECG signal classification method, which includes: acquiring a target ECG signal; inputting the target ECG signal into a target ECG signal classification model including a variable transformation module and a variable classification module, performing variable transformation processing on the target ECG signal by the variable transformation module to obtain a target variable that obeys a mixed Gaussian distribution, and inputting the target variable into the variable classification module, performing variable classification processing according to the target variable by the variable classification module to obtain a classification result of the target ECG signal, and the target ECG signal classification model is trained based on the aforementioned ECG signal classification model training method.
[0028] By adopting the above technical scheme, the target ECG signal is input into a target ECG signal classification model including a variable transformation module and a variable classification module. The variable transformation module performs variable transformation processing on the target ECG signal to obtain a target variable that obeys a mixed Gaussian distribution, thereby effectively extracting the deep features of the target ECG signal. Then, the variable classification module performs variable classification processing based on the target variable to obtain a classification result of the target ECG signal, thereby effectively increasing the accuracy of the classification result of the target ECG signal.
[0029] An embodiment of the present invention also discloses an ECG signal classification model training device, comprising: a first processing module, used to determine a training data set and an initial ECG signal classification model, the training data set comprising labeled ECG signal samples and unlabeled ECG signal samples, the initial ECG signal classification model comprising an initial variable transformation module and an initial variable classification module, the initial variable transformation module comprising a plurality of masked autoencoders cascaded in sequence, and the initial variable classification module being generated based on a mixed Gaussian distribution; a second processing module, used to input the ECG signal samples included in the training data set into the initial ECG signal classification model, the initial variable transformation module performing variable transformation processing on the ECG signal samples to obtain a target variable that obeys the mixed Gaussian distribution, and the target variable is input into the initial variable classification module, the initial variable classification module performing variable classification processing according to the target variable to obtain a classification result of the ECG signal sample; a third processing module, used to adjust the target parameters of the initial ECG signal classification model according to the classification result to obtain a target ECG signal classification model.
[0030] An embodiment of the present invention also discloses an ECG signal classification device, including: a fifth processing module, used to obtain a target ECG signal; a sixth processing module, used to input the target ECG signal into a target ECG signal classification model including a variable transformation module and a variable classification module, the variable transformation module performs variable transformation processing on the target ECG signal to obtain a target variable that obeys a mixed Gaussian distribution, and the target variable is input into the variable classification module, the variable classification module performs variable classification processing according to the target variable to obtain a classification result of the target ECG signal, and the target ECG signal classification model is trained based on the aforementioned ECG signal classification model training method.
[0031] An embodiment of the present invention also discloses an electronic device, comprising: a memory for storing a computer program, the computer program comprising program instructions; a processor for executing the program instructions so that the electronic device executes the ECG signal classification model training method and / or the ECG signal classification method provided in any possible embodiment described above.
[0032] An embodiment of the present invention also discloses a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, the computer program includes program instructions, and the program instructions are run by an electronic device to execute the aforementioned ECG signal classification model training method and / or ECG signal classification method.
[0033] An embodiment of the present invention further discloses a computer program product, characterized in that it includes a computer program / instruction, and when the computer program / instruction is executed by a processor, it implements the aforementioned ECG signal classification model training method and / or ECG signal classification method. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a flowchart of an electrocardiogram signal classification model training method provided by an embodiment of the present invention;
[0035] Figure 2 is a schematic diagram of a process for obtaining a training data set provided by an embodiment of the present invention;
[0036] Figure 3 is a schematic diagram of performing heart beat segmentation using a fixed-length window method provided by an embodiment of the present invention;
[0037] Figure 4 is a schematic diagram of performing heart beat segmentation using an adjustable length window method provided by an embodiment of the present invention;
[0038] Figure 5 is a schematic diagram of a masked autoencoder modeling Gaussian distribution mean and standard deviation provided by an embodiment of the present invention;
[0039] Figure 6 It is a schematic diagram of a process for obtaining a target variable that obeys a mixed Gaussian distribution provided by an embodiment of the present invention;
[0040] Figure 7 is a schematic diagram of a flow chart of obtaining classification results of electrocardiogram signal samples provided by an embodiment of the present invention;
[0041] Figure 8 It is a flowchart of a semi-supervised abnormal ECG detection method based on masked autoregressive flow provided by an embodiment of the present invention;
[0042] Fig. 9 is a flow chart of an electrocardiogram signal classification method provided by an embodiment of the present invention;
[0043] Fig.10 It is a structural schematic diagram of an electrocardiogram signal classification model training device provided by an embodiment of the present invention;
[0044] Fig.11is a structural schematic diagram of an electrocardiogram signal classification device provided by an embodiment of the present invention;
[0045] Fig.12 According to some embodiments of the present application, a structural schematic diagram of an electronic device is shown. DETAILED DESCRIPTION
[0046] As mentioned above, in the prior art, there is a problem that the process of training the ECG signal classification model requires high costs, affects the model training efficiency, and causes inaccurate classification of the trained classification model.
[0047] Based on this, the present invention provides an electrocardiogram signal classification, an electrocardiogram signal classification model training method and an electronic device, which can use a data training set including labeled electrocardiogram signal samples and unlabeled electrocardiogram signal samples to train the electrocardiogram signal classification model in a semi-supervised manner, reduce the number of professional annotations of electrocardiogram signal samples, save a lot of time and cost, and increase the model training efficiency. And the electrocardiogram signal classification model includes an initial variable transformation module composed of multiple masked autoencoders cascaded in sequence and an initial variable classification module generated based on a mixed Gaussian distribution, through the multiple masked autoencoders cascaded in sequence, it is possible to extract deeper features of the electrocardiogram signal samples, obtain a target variable that obeys the mixed Gaussian distribution, and input the target variable into the initial variable classification module generated based on the mixed Gaussian distribution to obtain the classification result of the electrocardiogram signal sample, adjust the target parameter of the initial electrocardiogram signal classification model according to the classification result, and obtain the target electrocardiogram signal classification model, which utilizes the good fitting ability of the Gaussian distribution, effectively improves the accuracy of the target electrocardiogram signal classification model obtained by training, and then improves the classification accuracy of the target electrocardiogram signal classification model for the obtained electrocardiogram signal.
[0048] Next, with reference to the accompanying drawings, the specific steps of the electrocardiogram signal classification model training method provided by the present invention are described in detail.
[0049] like Figure 1 As shown, the electrocardiogram signal classification model training method provided by the present invention comprises the following steps:
[0050] S100: Determine a training data set and an initial electrocardiogram signal classification model.
[0051] The training data set includes labeled ECG signal samples and unlabeled ECG signal samples, the initial ECG signal classification model includes an initial variable transformation module and an initial variable classification module, the initial variable transformation module includes a plurality of masked autoencoders cascaded in sequence, and the initial variable classification module is generated based on a mixed Gaussian distribution. Furthermore, the label of the ECG signal sample, that is, the type of the ECG signal sample, can be, for example, normal or abnormal, and the type can be, for example, abnormal ECG signals including atrial premature beats, atrial tachycardia, atrial flutter, etc.
[0052] S200: Input the ECG signal samples included in the training data set into the initial ECG signal classification model, and use the initial variable transformation module to perform variable transformation on the ECG signal samples to obtain a target variable that obeys a mixed Gaussian distribution, and input the target variable into the initial variable classification module, and use the initial variable classification module to perform variable classification according to the target variable to obtain a classification result of the ECG signal samples.
[0053] S300: adjusting target parameters of the initial ECG signal classification model according to the classification result to obtain a target ECG signal classification model.
[0054] The ECG signal classification model training method provided by the present invention can train the ECG signal classification model in a semi-supervised manner by using a data training set including labeled ECG signal samples and unlabeled ECG signal samples during the training of the ECG signal classification model, that is, it is not necessary to professionally label all ECG signal samples in the training set, saving a lot of cost and time and increasing the model training efficiency. In addition, an initial variable transformation module composed of a plurality of masked autoencoders cascaded in sequence performs variable transformation processing on the ECG signal samples included in the training data set, and a plurality of masked autoencoders cascaded in sequence can extract deeper features of the ECG signal samples by using a semi-regression flow method, and obtain a target variable that obeys a mixed Gaussian distribution. The target variable is then input into the initial variable classification module generated based on the mixed Gaussian distribution. The initial variable classification module performs variable classification processing according to the target variable to obtain the classification result of the ECG signal sample, and adjusts the target parameters of the initial ECG signal classification model according to the classification result to obtain the target ECG signal classification model. The high stability and good fitting ability of the Gaussian distribution are utilized to effectively improve the accuracy of the trained target ECG signal classification model, thereby improving the classification accuracy of the target ECG signal classification model for ECG signals.
[0055] In one embodiment of the present invention, Figure 2 As shown, the training data set is obtained through the following steps:
[0056] S110: Acquire multiple initial ECG signals.
[0057] S120: Determine the heartbeat peak position of the initial ECG signal, and perform type marking on a preset proportion of initial ECG signals among the multiple initial ECG signals to obtain classification types corresponding to the initial ECG signals.
[0058] S130: Performing heart beat segmentation processing on the initial electrocardiogram signal according to the heart beat peak position and the target window to obtain the electrocardiogram signal after the heart beat segmentation processing.
[0059] S140: performing normalization processing on the electrocardiogram signal after the heartbeat segmentation processing to obtain a normalized electrocardiogram signal.
[0060] S150: Obtain a training data set according to the normalized ECG signal and the corresponding classification type.
[0061] For example, to obtain multiple initial ECG signals, single-lead ECG signals of multiple subjects over a period of time can be collected at a fixed frequency fs, and one collected record corresponds to the ECG signal of one subject. After the ECG signal data collection is completed, an ECG signal processing algorithm (such as the Pan-Tompkins algorithm) is used to detect the R-peak position (i.e., the R wave peak position) of all heartbeats in the ECG signal of each subject, such as Figure 3 and Figure 4 As shown, the types of some of the heart beat signals are marked.
[0062] Furthermore, the collected ECG signals are segmented into beats and then normalized to the interval [-1, 1] using the maximum and minimum value normalization method.
[0063] In one embodiment of the present invention, Figure 3 As shown in the figure, a fixed-length window (i.e., target window) can be used to segment the heartbeats. The R-peak position of each heartbeat obtained above is taken as the center, and L is taken on the left and right sides respectively. l and L r Sample points constitute a heartbeat sample with a length of w, w = L l +L r , using x i ∈R w represents the heartbeat sample, and i represents the index of the heartbeat sample. After the heartbeat segmentation of the ECG signal, it can be obtained by Figure 3 The upper part shows the ECG signal of the subject. Figure 3 The lower part shows multiple heartbeat samples (i.e., the ECG signal after heartbeat segmentation processing).
[0064] In another embodiment of the present invention, Figure 4As shown in , the adjusted length window segmentation method can also be used for heartbeat segmentation. Specifically, the latter one-third of the signal between the current heartbeat R-peak and the previous heartbeat R-peak, and the former two-thirds of the signal between the current heartbeat R-peak and the next heartbeat R-peak can be selected to form the current heartbeat sample. The heartbeat samples segmented in this way may have different lengths and need to be uniformly resampled to be adjusted to samples of length w. After the ECG signal is segmented, it can be obtained by Figure 4 The upper part shows the ECG signal of the subject. Figure 4 The lower part shows multiple heartbeat samples (i.e., the ECG signal after heartbeat segmentation processing).
[0065] Assume that after the heartbeat segmentation is completed, a total of N heartbeat samples are obtained, and their labels are recorded as y∈{0,1,…,C}, where C represents the total number of heartbeat classifications, including normal categories and C-1 abnormal categories. Due to individual differences, the amplitudes of the ECG signals of different subjects are different, and the maximum and minimum value normalization method is used to normalize them to the interval [-1,1]. The normalization calculation formula is as follows:
[0066]
[0067] Normalized heartbeat samples and labels form the entire dataset (That is, the training data set). Set the proportion of the training set to δ, and divide the entire training data set into training sets and test set N train and N test Represents the number of heartbeat samples in the training set and test set respectively. The training set is used to train the model and learn the network parameters of the model. After the model training is completed, the test set is used to test the ECG signal classification performance of the model.
[0068] Next, the process of building an ECG signal classification model is explained.
[0069] The ECG signal classification model constructed by the present invention can also be called an abnormal ECG classification model based on masked autoregressive flow, which uses masked autoregressive flow to model complex ECG distribution.
[0070] The masked autoregressive flow is a standardized flow model that can model autoregression. Its basic idea is to express the complex heartbeat sample x as a reversible transformation of the base distribution sample z through a reversible transformation f: z = f(x), z ~ p(z), x ~ p(x), where p(z) is the probability density function of the variable z, and p(z) is the probability density function of the heartbeat sample x. According to the variable transformation rule, the density of the heartbeat sample x is expressed as:
[0071]
[0072] Here, the base distribution p(z) is a distribution with a computable probability density, such as a standard Gaussian distribution, and f is generally implemented through a neural network with a special structure. Masked autoregressive flow builds a standardized flow model by stacking multiple masked autoencoder layers to learn complex data distributions.
[0073] Furthermore, ECG signals are essentially time series data and therefore have time dependence and autoregression. For each heartbeat sample x = (x1,…,x w ), the transformed variable z=(z1,...,z w ) It is necessary to model the dependence and autoregression of ECG signals. According to the chain rule of probability, its probability can be decomposed into the form of probability product:
[0074]
[0075] Where z <d =(z1,…,z d-1 ). The masked autoencoder can be used to model the time dependency of ECG signals. Through the mask matrix, the masked autoencoder makes each output unit of the network only depend on the input with a smaller number than itself, thus maintaining the autoregressive nature of the ECG signal. Considering that different types of abnormal ECG signals are transformed into different Gaussian distributions, it is more in line with the actual situation. The mean and standard deviation of the Gaussian distribution are calculated through the masked autoencoder:
[0076]
[0077] like Figure 5 As shown in the figure, a schematic diagram of the mean and standard deviation of the Gaussian distribution modeled by the masked autoencoder with an input data length of 3 and two hidden layer units of 4 is shown. For example, according to the arrows in the figure, it can be seen that the calculation of μ2 only depends on x1, and the calculation of μ3 depends on x1 and x2.
[0078] Assume that for a heartbeat sample x (heartbeat sample x has a w-dimensional attribute), the masked autoencoder has 2w outputs, the first w output units model the conditional mean of the heartbeat sample (that is, the mean corresponding to the masked autoencoder), and the last w output units output the conditional standard deviation of the heartbeat sample (that is, the standard deviation corresponding to the masked autoencoder). The dth dimension of the transformed variable is expressed as:
[0079] z d =(x d -μ d )exp(-α d ),d=1,…,w
[0080] The reversible transformation f constructed at this time has an inverse transformation f due to the autoregressive structure of the masked autoencoder. -1 The Jacobian matrix is as follows:
[0081]
[0082] We can see that the Jacobian matrix is triangular, so its determinant is equal to the product of the diagonal elements, that is:
[0083]
[0084] Combined with the above formula, the probability density calculation formula of the heartbeat signal is as follows:
[0085]
[0086] You can use MADE([n1,…,n h ],fn) represents a masked autoencoder with h hidden layers, n i represents the number of units in the i-th layer, and fn represents the activation function of each hidden layer in the masked autoencoder. A bounded activation function such as Tanh and ReLU6 is required.
[0087] In one embodiment of the present invention, the present invention learns complex heartbeat distribution by stacking L layers of masked autoregressive flow composed of masked autoencoders (i.e., variable transformation modules), and transforms the electrocardiogram signal x through the first MADE layer to obtain the corresponding mean and standard deviation (i.e., the mean μ corresponding to the first-level masked autoencoder) 1 and standard deviation α 1 ):
[0088] [μ 1 ,α 1 ]=MADE(x;[n1,…,n h ],fn)
[0089] According to the above formula, the transformed variable z 1 (that is, the output variable of the first-level masked self-encoder) is:
[0090]
[0091] in, That is, the d-th dimension mean μ corresponding to the first layer of masked autoencoder d , That is, the standard deviation α of the dth dimension corresponding to the first layer of masked self-encoder d In the subsequent formulas, the mean μ d and standard deviation α d The superscripts refer to the layer (i.e., the number) of the masked autoencoder.
[0092] The probability density of x can be further calculated as:
[0093]
[0094] By analogy, the transformed variables (i.e., output variables) are sequentially input into the next MADE layer (i.e., the next level of masked autoencoder) to the Lth layer (i.e., the last level of masked autoencoder) to obtain the corresponding mean and standard deviation, as well as the transformed variables:
[0095] [μ i ,α i ]=MADE(z i-1 ; [n1,...,n h ],fn),i=2,...,L
[0096]
[0097] That is, in one embodiment of the present invention, Figure 6 As shown, the initial variable transformation module performs variable transformation processing on the ECG signal to obtain a target variable that obeys a mixed Gaussian distribution, including the following steps:
[0098] S210: Input the ECG signal samples included in the training data set to the first-level masked autoencoder included in the initial variable transformation module, and the first-level masked autoencoder performs corresponding processing on the ECG signal samples to obtain output variables that obey the mixed Gaussian distribution.
[0099] S220: sequentially inputting the output variables output by the previous masked autoencoder into the next masked autoencoder for corresponding processing, until the last masked autoencoder outputs the corresponding output variables as the target variables.
[0100] In one embodiment of the present invention, the target parameters include the mean and standard deviation corresponding to each masked autoencoder, and the output variables output by the previous masked autoencoder are input to the next masked autoencoder for corresponding processing, including: the output variables output by the previous masked autoencoder are input to the next masked autoencoder, and the next masked autoencoder performs variable transformation processing on the output variables output by the previous masked autoencoder based on the corresponding mean and standard deviation.
[0101] In one embodiment of the present invention, the masked autoencoder performs variable transformation processing on the output variable by the following formula:
[0102] z d =(x d -μ d )exp(-α d )
[0103] Among them, x d The output variable of the previous level mask self-encoder includes the d-th dimension attribute data, zd The output variable of the next-level masked self-encoder includes the d-th dimension attribute data, μ d is the mean of the d-th dimension, α d is the standard deviation of the dth dimension.
[0104] At this time, the probability density of the heartbeat sample x is obtained as:
[0105]
[0106] There are a total of C categories of abnormal heart beat classification, so it is assumed that the final variable z L (i.e., the target variable) obeys the C-element mixed Gaussian model (i.e., the variable classification module), assuming that the mean and covariance matrix of the mixed Gaussian distribution are μ k ,Σ k ,k=1,…,C, where μ k Select from the standard Gaussian, Σ k Set to the identity matrix. For the labeled heartbeat samples, the variable z L The probability density of (i.e., target probability density) is calculated as follows:
[0107] p(z L |y)=N(z L ;μ y ,Σ y )
[0108]
[0109] In summary, we can conclude that the probability density of labeled heart beat samples (that is, labeled ECG signal samples) is:
[0110]
[0111] That is, in one embodiment of the present invention, the target parameter also includes the mean and covariance matrix of the mixed Gaussian distribution. When the ECG signal sample is a labeled ECG signal sample, the target probability density of the target variable is calculated based on the mixed Gaussian distribution, including calculating the target probability density by the following formula:
[0112]
[0113] Among them, p(x|y) is the target probability density, z L is the target variable, L is the number of masked autoencoders, μ y is the mean of the mixed Gaussian distribution corresponding to the yth probability density calculation unit, Σ y is the covariance matrix of the mixed Gaussian distribution corresponding to the yth probability density calculation unit, is the standard deviation of the dth dimension corresponding to the lth masked autoencoder.
[0114] For the unlabeled heartbeat samples, considering the possibility that they may belong to each category of samples, the variable z is calculated using the following formula: L The probability density of is:
[0115]
[0116] In summary, the probability density of unlabeled heart beat samples can be obtained as:
[0117]
[0118] That is, in one embodiment of the present invention, the target parameter also includes the mean and covariance matrix of the mixed Gaussian distribution. When the ECG signal sample is an unlabeled ECG signal sample, the target probability density of the target variable is calculated based on the mixed Gaussian distribution, including calculating the target probability density by the following formula:
[0119]
[0120] Among them, p(x) is the target probability density, z L is the target variable, L is the number of masked autoencoders, μ y is the mean of the mixed Gaussian distribution corresponding to the yth probability density calculation unit, Σ y is the covariance matrix of the mixed Gaussian distribution corresponding to the yth probability density calculation unit, is the standard deviation of the dth dimension corresponding to the lth masked autoencoder, and C is the number of probability density calculation units.
[0121] The training loss of the abnormal ECG classification model based on masked autoregressive flow is the negative logarithm of the transformed variables of all samples in the training set, that is:
[0122] loss=-(∑ y≠-1 logp(x|y)+∑ y=-1 logp(x)
[0123] =-∑ y≠-1 logp(x|y)-∑ y=-1 logp(x
[0124] Where p(x|y) and p(x) are as shown above. Finally, the model is trained by the Adam optimizer to learn the network parameters of the model. After the model training is completed according to the set training rounds, the model performance is evaluated based on the test set.
[0125] The classification result is used to adjust the target parameters of the initial ECG signal classification model (such as the mean and standard deviation corresponding to the masked autoencoder, the mean and covariance matrix corresponding to the mixed Gaussian distribution, and the loss function of the initial ECG signal classification model).
[0126] In one embodiment of the present invention, after the target ECG signal classification model is trained, the aforementioned test set For each heartbeat sample x in the training target ECG signal classification model, the corresponding output variable z is obtained. L (i.e., target variable), the probability density (i.e., target probability density) of the heartbeat sample x belonging to each Gaussian distribution in the mixed Gaussian distribution is calculated according to the following formula:
[0127]
[0128] Among them, p(y=i|x) is the target probability density of the target variable corresponding to the i-th probability density calculation unit, N(z|μ i ,Σ i ) is the mixed Gaussian distribution corresponding to the i-th probability density calculation unit, μ i is the mean of the mixed Gaussian distribution corresponding to the i-th probability density calculation unit, Σ i is the covariance matrix of the mixed Gaussian distribution corresponding to the i-th probability density calculation unit.
[0129] Use the following rules to predict the category of the heartbeat sample x (i.e., the ECG signal sample):
[0130]
[0131] Test Set The predicted labels of all samples in The performance of the model is evaluated using true labels and predicted labels. Since abnormal ECG signal classification is a classification task with imbalanced categories, the performance evaluation indicators used are classification accuracy and F1 score.
[0132] That is, in one embodiment of the present invention, the initial variable classification module includes a plurality of probability density calculation units, each probability density calculation unit corresponds to a type of ECG signal sample, and the probability density calculation unit is obtained based on a mixed Gaussian distribution, such as Figure 7 As shown, the initial variable classification module performs variable classification processing according to the target variable to obtain the classification result of the ECG signal sample, including the following steps:
[0133] S230: Input the target variable into each probability density calculation unit respectively to perform probability density calculation based on mixed Gaussian distribution to obtain the target probability density.
[0134] S240: Selecting the ECG signal sample type corresponding to the probability density calculation unit with the largest target probability density as the classification result of the ECG signal sample.
[0135] In one implementation of the present invention, the present invention provides an ECG signal classification model training method, that is, an abnormal ECG signal classification method based on masked autoregressive flow, such as Figure 8 As shown, the following steps are included:
[0136] S101: ECG signal acquisition and annotation.
[0137] For example, single-lead ECG signals of multiple subjects are collected for a period of time, and the Pan-Tompkins algorithm is used to detect the R-peaks position of each heartbeat in the collected ECG signals and mark the type of heartbeat.
[0138] S102: ECG signal preprocessing, training set and test set division.
[0139] Perform heartbeat segmentation on the ECG signal. According to the R-peak position, use a fixed-length window or an adjustable-length window to segment all heartbeat samples and determine the heartbeat labels. For labeled ECG signals, divide the corresponding heartbeat samples into five categories: N, S, V, F, and Q according to the AAMI standard, and use 0, 1, 2, 3, and 4 to represent their label values, respectively. For unlabeled heartbeats, set their labels to -1.
[0140] The processed data set is divided into a training set and a test set. According to the given proportion of training set samples, a stratified sampling method is used to divide the data set into training set D train and the test set D test .
[0141] S103: Use masked autoregressive flow and Gaussian mixture model to build a network model, input the training set into the network, train the network using Adam optimizer, and learn / update network parameters.
[0142] Construct a heartbeat generation model based on masked autoregressive flow, with the heartbeat signal as input and the transformed representation and corresponding log-likelihood as output; calculate the loss function, use the Adam optimizer to train the model for M rounds (the specific value can be set as needed), and learn the model parameters.
[0143] S104: Classification of abnormal ECG signals: inputting the test set samples into the learned / trained network model to classify the ECG samples in the test set.
[0144] In one embodiment of the present invention, a method for classifying an electrocardiogram signal is also provided. Fig. 9 As shown, the method comprises the following steps:
[0145] S10: Acquire a target ECG signal.
[0146] S20: Input the target ECG signal into a target ECG signal classification model including a variable transformation module and a variable classification module, and the variable transformation module performs variable transformation processing on the target ECG signal to obtain a target variable that obeys a mixed Gaussian distribution, and input the target variable into the variable classification module, and the variable classification module performs variable classification processing based on the target variable to obtain a classification result of the target ECG signal.
[0147] The target ECG signal classification model is trained based on the aforementioned ECG signal classification model training method.
[0148] The present invention also provides an electrocardiogram signal classification model training device, such as Fig.10 As shown, including:
[0149] The first processing module is used to determine a training data set and an initial ECG signal classification model. The training data set includes labeled ECG signal samples and unlabeled ECG signal samples. The initial ECG signal classification model includes an initial variable transformation module and an initial variable classification module. The initial variable transformation module includes a plurality of masked autoencoders cascaded in sequence. The initial variable classification module is generated based on a mixed Gaussian distribution.
[0150] The second processing module is used to input the ECG signal samples included in the training data set into the initial ECG signal classification model, and the initial variable transformation module performs variable transformation processing on the ECG signal samples to obtain a target variable that obeys a mixed Gaussian distribution, and input the target variable into the initial variable classification module. The initial variable classification module performs variable classification processing based on the target variable to obtain a classification result of the ECG signal samples.
[0151] The third processing module is used to adjust the target parameters of the initial ECG signal classification model according to the classification result to obtain the target ECG signal classification model.
[0152] For specific operations that can be performed by the first processing module to the third processing module, please refer to the above Figure 1 Corresponding ECG signal classification model training method. In addition, according to the specific operation steps of the above ECG signal classification model training method, the ECG signal classification model training device may include more or fewer processing modules for processing the content of the above ECG signal classification model training method.
[0153] The present invention also provides an electrocardiogram signal classification device, such as Fig.11 As shown, including:
[0154] The fifth processing module is used to obtain the target ECG signal.
[0155] The sixth processing module is used to input the target ECG signal into a target ECG signal classification model including a variable transformation module and a variable classification module. The variable transformation module performs variable transformation processing on the target ECG signal to obtain a target variable that obeys a mixed Gaussian distribution, and input the target variable into the variable classification module. The variable classification module performs variable classification processing based on the target variable to obtain a classification result of the target ECG signal. The target ECG signal classification model is trained based on the aforementioned ECG signal classification model training method.
[0156] The specific operations that can be performed by the fourth processing module and the fifth processing module are shown above. Figure 8 Corresponding ECG signal classification method. Furthermore, according to the specific operation steps of the above ECG signal classification method, the ECG signal classification device may include more or fewer processing modules for processing the contents of the above ECG signal classification method.
[0157] See also Fig.12 , Fig.12 The electronic device may include one or more processors 1002, a system control logic 1008 connected to at least one of the processors 1002, a system memory 1004 connected to the system control logic 1008, a non-volatile memory (NVM) 1006 connected to the system control logic 1008, and a network interface 1010 connected to the system control logic 1008.
[0158] The processor 1002 may include one or more single-core or multi-core processors. The processor 1002 may include any combination of a general-purpose processor and a dedicated processor (e.g., a graphics processor, an application processor, a baseband processor, etc.). In the implementation of this document, the processor 1002 may be configured to execute the aforementioned ECG signal classification model training method, and / or ECG signal classification method.
[0159] In some implementations, the system control logic 1008 may include any suitable interface controller to provide any suitable interface to at least one of the processors 1002 and / or any suitable device or component in communication with the system control logic 1008 .
[0160] In some implementations, the system control logic 1008 may include one or more memory controllers to provide an interface to the system memory 1004. The system memory 1004 may be used to load and store data and / or instructions. In some implementations, the system memory 1004 of the electronic device may include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM).
[0161] NVM / memory 1006 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. In some implementations, NVM / memory 1006 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as a hard disk drive (HDD), a compact disc (CD) drive, and a digital versatile disc (DVD) drive.
[0162] NVM / storage 1006 may include a portion of storage resources installed on a device of an electronic device, or it may be accessible by the device but not necessarily a portion of the device. For example, NVM / storage 1006 may be accessed over a network via network interface 1010 .
[0163] In particular, the system memory 1004 and the NVM / storage 1006 may include: a temporary copy and a permanent copy of the instruction 1020, respectively. The instruction 1020 may include: instructions that, when executed by at least one of the processors 1002, cause the electronic device to implement the aforementioned ECG signal classification model training method, and / or ECG signal classification method. In some implementations, the instruction 1020, hardware, firmware, and / or software components thereof may be additionally / alternatively placed in the system control logic 1008, the network interface 1010, and / or the processor 1002.
[0164] The network interface 1010 may include a transceiver for providing a radio interface for the electronic device, thereby communicating with any other suitable device (such as a front-end module, an antenna, etc.) through one or more networks. In some implementations, the network interface 1010 may be integrated into other components of the electronic device. For example, the network interface 1010 may be integrated into at least one of the processor 1002, the system memory 1004, the NVM / storage 1006, and a firmware device (not shown) having instructions. When at least one of the processors 1002 executes the instructions, the electronic device implements the aforementioned ECG signal classification model training method and / or ECG signal classification method.
[0165] The network interface 1010 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 1010 may be a network adapter, a wireless network adapter, a telephone modem and / or a wireless modem.
[0166] In one implementation, at least one of the processors 1002 may be packaged with logic for one or more controllers of the system control logic 1008 to form a system in a package (SiP). In one implementation, at least one of the processors 1002 may be integrated with logic for one or more controllers of the system control logic 1008 on the same die to form a system on chip (SoC).
[0167] The electronic device may further include: an input / output (I / O) device 1012. The I / O device 1012 may include a user interface that enables a user to interact with the electronic device; the design of the peripheral component interface enables the peripheral component to also interact with the electronic device. In some implementations, the electronic device further includes a sensor for determining at least one of an environmental condition and location information related to the electronic device.
[0168] In some implementations, the peripheral component interface can include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.
[0169] In some implementations, the sensors may include, but are not limited to, gyroscope sensors, accelerometers, proximity sensors, ambient light sensors, and positioning units. The positioning unit may also be part of or interact with the network interface 1010 to communicate with components of a positioning network (e.g., Global Positioning System (GPS) satellites).
[0170] It is to be understood that the structure illustrated in the implementation of the present invention does not constitute a specific limitation on the electronic device. In other implementations of the present application, the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0171] In another implementation of the present application, a computer-readable storage medium is also disclosed, which stores a computer program. The computer program includes program instructions, and the program instructions are executed by an electronic device to execute the aforementioned ECG signal classification model training method and / or ECG signal classification method.
[0172] In another implementation of the present application, a computer program / instruction is included, and when the computer program / instruction is executed by a processor, the aforementioned ECG signal classification model training method and / or ECG signal classification method are implemented.
[0173] Program code can be applied to input instructions to perform the functions described herein and generate output information. The output information can be applied to one or more output devices in a known manner. For the purpose of the present application implementation, the processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0174] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described herein is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.
[0175] It should be noted that, in addition to the implementation methods of the present invention described in the above-mentioned specific embodiments, those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Although the description of the present invention is introduced in conjunction with the preferred embodiment, this does not mean that the features of this invention are limited to this implementation method. On the contrary, the purpose of introducing the invention in conjunction with the implementation method is to cover other options or modifications that may be extended based on the claims of the present invention. In order to provide a deep understanding of the present invention, the above description contains many specific details, and the present invention can also be implemented without using these details. In addition, in order to avoid confusion or blurring the focus of the present invention, some specific details will be omitted in the description. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0176] Although the present invention has been illustrated and described with reference to certain preferred embodiments of the present invention, it should be understood by those skilled in the art that the above is a further detailed description of the present invention in conjunction with specific embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. Those skilled in the art may make various changes in form and details, including making several simple deductions or substitutions, without departing from the spirit and scope of the present invention.
Claims
1. A method for training an electrocardiogram signal classification model, characterized in that: The method comprises: Determine a training data set and an initial ECG signal classification model, wherein the training data set includes labeled ECG signal samples and unlabeled ECG signal samples, and the initial ECG signal classification model includes an initial variable transformation module and an initial variable classification module, wherein the initial variable transformation module includes a plurality of masked autoencoders cascaded in sequence, and the initial variable classification module is generated based on a mixed Gaussian distribution; Input the ECG signal samples included in the training data set into the initial ECG signal classification model, perform variable transformation processing on the ECG signal samples by the initial variable transformation module to obtain a target variable that obeys a mixed Gaussian distribution, and input the target variable into the initial variable classification module, perform variable classification processing according to the target variable by the initial variable classification module to obtain a classification result of the ECG signal samples; The target parameters of the initial ECG signal classification model are adjusted according to the classification result to obtain a target ECG signal classification model.
2. The electrocardiogram signal classification model training method according to claim 1, characterized in that: The initial variable transformation module performs variable transformation processing on the ECG signal sample to obtain a target variable that obeys a mixed Gaussian distribution, including: Inputting the ECG signal samples included in the training data set into the first-level masked autoencoder included in the initial variable transformation module, and performing corresponding processing on the ECG signal samples by the first-level masked autoencoder to obtain output variables that obey a mixed Gaussian distribution; The output variables output by the masked autoencoder of the previous stage are sequentially input into the masked autoencoder of the next stage for corresponding processing, until the masked autoencoder of the last stage outputs the corresponding output variables as the target variables.
3. The ECG signal classification model training method according to claim 2, characterized in that: The target parameters include the mean and standard deviation corresponding to each of the masked autoencoders, and the output variable output by the masked autoencoder of the previous stage is input to the masked autoencoder of the next stage for corresponding processing, including: The output variable output by the masked autoencoder of the previous stage is input to the masked autoencoder of the next stage, and the masked autoencoder of the next stage performs variable transformation processing on the output variable output by the masked autoencoder of the previous stage based on the corresponding mean and standard deviation.
4. The electrocardiogram signal classification model training method according to claim 3, characterized in that: The masked autoencoder performs variable transformation processing on the output variable by the following formula: z d =(x d -m d )exp(-a d ) Among them, x d The output variable output by the masked self-encoder of the previous stage includes the d-th dimension attribute data, z d The output variable output by the masked self-encoder at the next stage includes the d-th dimension attribute data, μ d is the mean of the dth dimension, α d is the standard deviation of the dth dimension.
5. The electrocardiogram signal classification model training method according to any one of claims 2 to 4, characterized in that: The initial variable classification module includes a plurality of probability density calculation units, each of which corresponds to a type of ECG signal sample, and the probability density calculation unit is obtained based on the mixed Gaussian distribution. The initial variable classification module performs variable classification processing according to the target variable to obtain the classification result of the ECG signal sample, including: Inputting the target variables into each of the probability density calculation units to perform probability density calculation based on the mixed Gaussian distribution to obtain a target probability density; The electrocardiogram signal sample type corresponding to the probability density calculation unit with the largest target probability density is selected as the classification result of the electrocardiogram signal sample.
6. The ECG signal classification model training method according to claim 5, characterized in that: The target parameters also include the mean and covariance matrix of the mixed Gaussian distribution. When the electrocardiogram signal sample is a labeled electrocardiogram signal sample, the target probability density of the target variable is calculated based on the mixed Gaussian distribution, including calculating the target probability density by the following formula: Among them, p(x|y) is the target probability density, z L is the target variable, L is the number of masked autoencoders, μ y is the mean of the mixed Gaussian distribution corresponding to the yth probability density calculation unit, Σ y is the covariance matrix of the mixed Gaussian distribution corresponding to the y-th probability density calculation unit, is the d-th dimension standard deviation corresponding to the l-th masked autoencoder.
7. The electrocardiogram signal classification model training method according to claim 5, characterized in that: The target parameters also include the mean and covariance matrix of the mixed Gaussian distribution. When the electrocardiogram signal sample is an unlabeled electrocardiogram signal sample, the target probability density of the target variable is calculated based on the mixed Gaussian distribution, including calculating the target probability density by the following formula: Where p(x) is the target probability density, z L is the target variable, L is the number of masked autoencoders, μ y is the mean of the mixed Gaussian distribution corresponding to the yth probability density calculation unit, Σ y is the covariance matrix of the mixed Gaussian distribution corresponding to the y-th probability density calculation unit, The d-th dimension standard deviation corresponding to the l-th masked autoencoder, and C is the number of the probability density calculation units.
8. The electrocardiogram signal classification model training method according to claim 1, characterized in that: The training data set is obtained in the following way: Acquire multiple initial ECG signals; Determine the heartbeat peak position of the initial ECG signal, and perform type marking on a preset proportion of the initial ECG signals among the multiple initial ECG signals to obtain the classification type corresponding to the initial ECG signal; Performing heartbeat segmentation processing on the initial electrocardiogram signal according to the heartbeat peak position and the target window to obtain an electrocardiogram signal after the heartbeat segmentation processing; Normalizing the electrocardiogram signal after the heartbeat segmentation process to obtain a normalized electrocardiogram signal; The training data set is obtained according to the normalized electrocardiogram signal and the corresponding classification type.
9. A method for classifying electrocardiogram signals, characterized in that: The method comprises: Acquire target ECG signal; The target ECG signal is input into a target ECG signal classification model including a variable transformation module and a variable classification module. The variable transformation module performs variable transformation processing on the target ECG signal to obtain a target variable that obeys a mixed Gaussian distribution. The target variable is input into the variable classification module. The variable classification module performs variable classification processing according to the target variable to obtain a classification result of the target ECG signal. The target ECG signal classification model is trained based on the ECG signal classification model training method according to any one of claims 1 to 8.
10. An electronic device, characterized in that: include: A memory for storing a computer program, wherein the computer program includes program instructions; A processor is used to execute program instructions so that the electronic device executes the electrocardiogram signal classification model training method as described in any one of claims 1 to 8, and / or the electrocardiogram signal classification method as described in claim 9.
Citation Information
Cited By
Epilepsy detection model training method, epilepsy detection method and epilepsy detection system
CN119903410A
A training method for an epilepsy detection model, an epilepsy detection method and a system
CN119903410B
