A method, system, device and storage medium for detecting abnormal electrocardiogram signal
By using the mesh model integrated with the bidirectional cyclic gating unit layer and attention layer in the detection of ECG signal abnormality, the problem of low detection accuracy under small sample conditions is solved, and higher detection accuracy and comprehensiveness are achieved.
Patent Information
- Application Number
- CN202111629770.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2041-12-28
AI Technical Summary
The existing electrocardiogram abnormality detection methods are not very accurate under small sample conditions, have low degree of automation, and have misdiagnosis problems, making it difficult to accurately diagnose the specific types of the disease.
By training a mesh model integrated by the bidirectional cyclic gating unit layer and the attention layer, an encoder processing the original ECG signal data is generated, more detailed features are extracted, and the hidden Markov model with the Watson hybrid model as the emission density is used for identification.
It improves the accuracy and comprehensiveness of electrocardiogram abnormality detection under small sample conditions, and enhances the accuracy and accuracy of detection results.
Smart Images

Figure CN114386457B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of detection technology, and in particular to a method, system, device and storage medium for detecting abnormal electrocardiogram signals. Background Art
[0002] Traditional ECG signal abnormality detection usually requires doctors with rich clinical experience to read the images manually. It has a low degree of automation, low detection efficiency, and misdiagnosis due to doctor fatigue. Most existing ECG signal automatic detection methods use neural network models. Neural network models are a supervised classification method that requires a lot of manpower to label a large amount of labeled ECG data, and the accuracy is not high in the case of small sample data.
[0003] At present, some ECG signal anomaly detection methods also use unsupervised deep models or data modeling.
[0004] Among them, the network layer of the autoencoder hidden layer of the unsupervised deep model uses a bidirectional LSTM. First, feature extraction is performed through variational autoencoder, and then the extracted features are clustered using classic clustering methods (hierarchical clustering, spectral clustering, k-means) and the method with median Wasserstein distance as the loss function. This method simplifies the ECG abnormality detection problem into a simple binary classification problem, that is, it can only detect normal and abnormal, which reduces the versatility of the model; at the same time, this method generally classifies different abnormal classes into one category, and cannot accurately diagnose the specific type of the disease; secondly, the use of variational autoencoder for feature extraction makes this method difficult to converge when reconstructing ECG data sets with complex backgrounds. In addition, variational autoencoder is a generative network, which is more concerned about whether it can better restore the input data, but ignores the retention of important features of the data, resulting in prediction errors; finally, since this method uses a standard clustering detection method, it assumes that most of the data used to train the representation learning model are normal, so that the representation of abnormal samples is located in different areas of the latent space. Therefore, when the abnormal data accounts for the vast majority or the abnormal data is equivalent to the normal data, this method is likely to fail.
[0005] Data modeling for ECG signal detection combines fuzzy vector quantization (FVQ) with hidden Markov (HMM), and uses the fuzzy membership of each eigenvector class to calculate the elements of the matrix in the model. Each element in the matrix is fuzzily classified by the two closest eigenvectors. This method is a supervised learning process. In the stage of training model parameters, a large amount of labeled data is required, which consumes a lot of manpower and material resources. In addition, the data label annotation process is highly professional and takes a lot of time, which makes the model not very generalizable; secondly, in the classification process, the model needs to calculate the distance between the eigenvector and the center of each cluster each time, which is very time-consuming when facing a large number of long time series data sets, resulting in slow model convergence, which is not conducive to its application in portable ECG devices. Summary of the invention
[0006] The purpose of the present invention is to solve one of the technical problems existing in the prior art to at least a certain extent.
[0007] To this end, an object of an embodiment of the present invention is to provide a method for detecting anomaly of ECG signals under small sample conditions, which realizes anomaly of ECG signals under small sample conditions and improves the accuracy and comprehensiveness of anomaly of ECG signals under small sample conditions.
[0008] Another object of an embodiment of the present invention is to provide an ECG signal abnormality detection system.
[0009] In order to achieve the above technical objectives, the technical solutions adopted by the embodiments of the present invention include:
[0010] In a first aspect, an embodiment of the present invention provides a method for detecting abnormal electrocardiogram signals, comprising the following steps:
[0011] Acquire first data, where the first data is input original electrocardiogram signal data;
[0012] Preprocessing the first data to generate second data;
[0013] Acquire a preset number of samples from the second data as first samples;
[0014] Inputting the first sample into a grid model for training to generate an encoder, wherein the grid model includes a bidirectional recurrent gating unit layer and an attention layer;
[0015] Performing feature processing and dimension reduction on the first data by the encoder to generate a second sample;
[0016] According to the second sample, an electrocardiogram signal detection result is generated by a hidden Markov model, and the emission density of the hidden Markov model is generated by a Watson hybrid model.
[0017] A method for detecting abnormal ECG signals in an embodiment of the present invention obtains an encoder for processing raw ECG signal data by training a grid model integrated by a bidirectional recurrent gating unit layer and an attention layer, thereby improving the data processing capability of the encoder and enabling the encoder to extract more detailed features of the raw ECG signal data; a hidden Markov model with a Watson hybrid model as the emission density is used to identify samples processed by the encoder, thereby improving the accuracy and comprehensiveness of the ECG signal detection results.
[0018] In addition, the method for detecting abnormal ECG signals according to the above embodiment of the present invention may also have the following additional technical features:
[0019] Furthermore, in a method for detecting abnormal ECG signals according to an embodiment of the present invention, the preprocessing of the first data to generate second data includes:
[0020] extracting a first heartbeat from the first data, the first heartbeat comprising each heartbeat in the first data;
[0021] By data interpolation, the length of each heartbeat in the first heartbeat is made equal to generate a second heartbeat;
[0022] Perform L2 regularization processing on the second heartbeat to generate the second data.
[0023] Further, in one embodiment of the present invention, the grid model further includes an input layer and an output layer;
[0024] The step of inputting the first sample into a grid model for training to generate an encoder includes:
[0025] Inputting the first sample into the bidirectional recurrent gating unit layer through the input layer;
[0026] Calculating the first sample through the bidirectional recurrent gating unit layer to obtain a first output, where the first output is an output of a first time step;
[0027] Performing weight analysis on the first output through the attention layer to obtain a second output;
[0028] The second output is processed by the output layer to complete the generation of the encoder.
[0029] Further, in one embodiment of the present invention, calculating the first sample through the bidirectional recurrent gating unit layer to obtain the first output includes:
[0030] Calculating the first sample through the bidirectional recurrent gating unit layer to obtain a third output and a fourth output, wherein the third output is an output forward of the first time step, and the fourth output is an output backward of the first time step;
[0031] The elements in the third output and the elements in the fourth output are added one by one to obtain the first output.
[0032] Further, in one embodiment of the present invention, the processing of the second output by the output layer to complete the generation of the encoder includes:
[0033] Compressing the second output to the interval [0,1];
[0034] Obtain the ECG signal detection category through the argmax function and calculate the loss function;
[0035] The loss function is iterated until convergence to complete the generation of the encoder.
[0036] Further, in one embodiment of the present invention, generating an electrocardiogram signal detection result by using a hidden Markov model according to the second sample includes:
[0037] Calculate the posterior distribution of the second sample by variational inference and maximizing the lower bound of evidence;
[0038] Clustering is performed according to the posterior distribution to generate the electrocardiogram signal detection result.
[0039] Further, in one embodiment of the present invention, clustering is performed according to the posterior distribution to generate the electrocardiogram signal detection result, including:
[0040] Generate a clustering result according to the maximum value of each row in the posterior distribution;
[0041] The electrocardiogram signal detection result is generated according to the clustering result.
[0042] In a second aspect, an embodiment of the present invention provides an ECG signal abnormality detection system, comprising:
[0043] A first data acquisition module, used to acquire first data;
[0044] A second data generating module, used for preprocessing the first data to generate second data;
[0045] A first sample extraction module, used for acquiring a preset number of samples from the second data as first samples;
[0046] An encoder generation module, used for inputting the first sample into a grid model for training to generate an encoder;
[0047] A second sample generating module, configured to perform feature processing and dimension reduction on the first data through the encoder to generate a second sample;
[0048] The ECG signal detection result generating module is used to generate an ECG signal detection result through a hidden Markov model according to the second sample.
[0049] In a third aspect, an embodiment of the present invention provides an electrocardiogram signal abnormality detection device, comprising:
[0050] at least one processor;
[0051] at least one memory for storing at least one program;
[0052] When the at least one program is executed by the at least one processor, the at least one processor implements the method for detecting abnormal electrocardiogram signals.
[0053] In a fourth aspect, an embodiment of the present invention provides a storage medium, in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to implement the method for detecting abnormal electrocardiogram signals.
[0054] The advantages and benefits of the present invention will be partially given in the following description, and partially become apparent from the following description, or be understood through the practice of the present application:
[0055] The embodiment of the present invention obtains an encoder for processing raw ECG signal data by training a grid model integrated by a bidirectional recurrent gating unit layer and an attention layer, thereby improving the data processing capability of the encoder, so that the encoder can extract more detailed features from the raw ECG signal data; a hidden Markov model with a Watson hybrid model as the emission density is used to identify samples processed by the encoder, thereby improving the accuracy and comprehensiveness of the ECG signal detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following introduction is made to the drawings of the embodiments of the present application or the related technical solutions in the prior art. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solutions of the present application. For technical personnel in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0057] Figure 1 A schematic diagram of a flow chart of a specific embodiment of a method for detecting abnormal electrocardiogram signals according to the present invention;
[0058] Figure 2A mapping diagram of a hidden Markov model of a specific embodiment of a method for detecting abnormal electrocardiographic signals according to the present invention;
[0059] Figure 3 It is a structural schematic diagram of a specific embodiment of an abnormal electrocardiogram signal detection system of the present invention;
[0060] Figure 4 The figure is a schematic structural diagram of a specific embodiment of a device for detecting abnormal electrocardiogram signals according to the present invention. DETAILED DESCRIPTION
[0061] Embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and are not to be construed as limitations on the present application. For the step numbers in the following embodiments, they are only provided for the convenience of explanation, and the order between the steps is not limited in any way, and the execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0062] The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present invention and the drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0063] Reference to "embodiments" in the present invention means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0064] Traditional ECG signal abnormality detection usually requires doctors with rich clinical experience to read the images manually. It has a low degree of automation, low detection efficiency, and misdiagnosis due to doctor fatigue. Most existing ECG signal automatic detection methods use neural network models. Neural network models are a supervised classification method that requires a lot of manpower to label a large amount of labeled ECG data, and the accuracy is not high in the case of small sample data.
[0065] At present, some ECG signal anomaly detection methods also use unsupervised deep models or data modeling.
[0066] Among them, the network layer of the autoencoder hidden layer of the unsupervised deep model uses a bidirectional LSTM. First, feature extraction is performed through variational autoencoder, and then the extracted features are clustered using classic clustering methods (hierarchical clustering, spectral clustering, k-means) and the method with median Wasserstein distance as the loss function. This method simplifies the ECG abnormality detection problem into a simple binary classification problem, that is, it can only detect normal and abnormal, which reduces the versatility of the model; at the same time, this method generally classifies different abnormal classes into one category, and cannot accurately diagnose the specific type of the disease; secondly, the use of variational autoencoder for feature extraction makes this method difficult to converge when reconstructing ECG data sets with complex backgrounds. In addition, variational autoencoder is a generative network, which is more concerned about whether it can better restore the input data, but ignores the retention of important features of the data, resulting in prediction errors; finally, since this method uses a standard clustering detection method, it assumes that most of the data used to train the representation learning model are normal, so that the representation of abnormal samples is located in different areas of the latent space. Therefore, when the abnormal data accounts for the vast majority or the abnormal data is equivalent to the normal data, this method is likely to fail.
[0067] Data modeling for ECG signal detection combines fuzzy vector quantization (FVQ) with hidden Markov (HMM), and uses the fuzzy membership of each eigenvector class to calculate the elements of the matrix in the model. Each element in the matrix is fuzzily classified by the two closest eigenvectors. This method is a supervised learning process. In the stage of training model parameters, a large amount of labeled data is required, which consumes a lot of manpower and material resources. In addition, the data label annotation process is highly professional and takes a lot of time, which makes the model not very generalizable; secondly, in the classification process, the model needs to calculate the distance between the eigenvector and the center of each cluster each time, which is very time-consuming when facing a large number of long time series data sets, resulting in slow model convergence, which is not conducive to its application in portable ECG devices.
[0068] To this end, the present invention proposes a method and system for detecting abnormal ECG signals. An encoder for processing raw ECG signal data is obtained by training a grid model integrated by a bidirectional recurrent gating unit layer and an attention layer, thereby improving the data processing capability of the encoder, so that the encoder can extract more detailed features from the raw ECG signal data. A hidden Markov model with a Watson hybrid model as the emission density is used to identify samples processed by the encoder, thereby improving the accuracy and comprehensiveness of the ECG signal detection results.
[0069] A method and system for detecting abnormal ECG signals according to an embodiment of the present invention will be described in detail below with reference to the accompanying drawings. First, a method for detecting abnormal ECG signals according to an embodiment of the present invention will be described with reference to the accompanying drawings.
[0070] Reference Figure 1 In an embodiment of the present invention, a method for detecting abnormal ECG signals is provided. The method for detecting abnormal ECG signals in an embodiment of the present invention can be applied to a terminal, a server, or software running in a terminal or a server. The terminal can be a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDNs), and big data and artificial intelligence platforms. The method for detecting abnormal ECG signals in an embodiment of the present invention mainly includes the following steps:
[0071] S101, obtaining first data;
[0072] The first data is the input original electrocardiogram signal data.
[0073] S102, preprocessing the first data to generate second data;
[0074] The preprocessing of the first data includes heartbeat extraction, data interpolation and L2 regularization processing.
[0075] S102 can be further divided into the following steps S1021-S1023:
[0076] Step S1021, extracting a first heartbeat from the first data;
[0077] The first heartbeat includes each heartbeat in the first data.
[0078] Specifically, in an embodiment of the present invention, for a single-channel ECG signal data set, the size of the original ECG signal data input is N*S, where N represents the amount of data, S represents the time step, the feature channel is 1, and each data represents a heartbeat.
[0079] Step S1022, making the length of each heartbeat in the first heartbeat equal by data interpolation, to generate a second heartbeat;
[0080] Specifically, the first heartbeat extracted in step S1021 is processed by a data interpolation method so that the length of each heartbeat in the first heartbeat is equal, thereby obtaining a second heartbeat.
[0081] Step S1023: Perform L2 regularization processing on the second heartbeat to generate the second data.
[0082] Specifically, by performing L2 regularization processing on the second heartbeat, the data of the second heartbeat is mapped to the interval [0,1] to obtain the second data. By using L2 regularization processing to process the second heartbeat to generate the second data, the influence of the amplitude on the subsequent clustering is eliminated, and the second heartbeat is converted into directional vector data, which is more suitable for the subsequent Watson distribution fitting.
[0083] S103, obtaining a preset number of samples from the second data as first samples;
[0084] The preset number is 10% of the second data, and 10% of the second data is the lowest threshold value obtained after model training considerations in the embodiment of the present invention.
[0085] S104, inputting the first sample into a grid model for training to generate an encoder;
[0086] The grid model includes an input layer, a bidirectional recurrent gated unit layer (Bi-GRU layer), an attention layer (Attention layer) and an output layer.
[0087] S104 can be further divided into the following steps S1041-S1044:
[0088] Step S1041, inputting the first sample into the bidirectional recurrent gating unit layer through the input layer;
[0089] Specifically, the input layer takes the first sample as training data of the grid model, and uses the first sample as input of the bidirectional recurrent gating unit.
[0090] Step S1042: Calculate the first sample through the bidirectional recurrent gating unit layer to obtain a first output, where the first output is an output of a first time step;
[0091] Among them, the bidirectional recurrent gating unit is an upgraded version of the long short-term memory network (LSTM). The bidirectional recurrent gating unit replaces the forget gate and input gate in the LSTM with an update gate, thereby reducing parameters and improving the training speed. The traditional unidirectional recurrent gating unit network can only process data in chronological order, so that the subsequent content of the data is ignored. In contrast, the embodiment of the present invention adopts a bidirectional recurrent gating unit. By introducing a second layer of recurrent gating unit network, the hidden layers flow in opposite directions, realizing the capture of past information and subsequent information, so that the features that best reflect the essence of the data can be extracted from the time series data (ECG signal data).
[0092] Specifically, the formula for calculating the new state of the bidirectional recurrent gating unit at the current time t is:
[0093]
[0094] The new state at the current time t is obtained by the previous state h t-1 and the current candidate status It is calculated by linear interpolation between t Represents the update gate, which determines how much previous information to keep and how much new information to add. t The larger it is, the more previous information is retained. Update gate z t The expression is as follows:
[0095] z t =σ(Wx t +Uh t-1 +b)
[0096] Among them, x t represents the sample vector at time t, W is x t The weight coefficient of h t-1 The weight coefficient, b is the bias, and σ is the sigmoid activation function. The current candidate state The expression is as follows:
[0097]
[0098] Among them, tanh is the activation function, r t Represents the reset gate, r t Decided t-1 right The number of contributions, r t The smaller the value of , the smaller the contribution amount. It is understandable that when r t = 0, h t-1 is completely forgotten. The update formula is as follows:
[0099] r t =σ(W r x t +U r h t-1 +b r )
[0100] In an embodiment of the present invention, calculating the output (first output) of the bidirectional recurrent gating unit at the i-th time step (first time step) includes:
[0101] (1) calculating the first sample through the bidirectional recurrent gating unit layer to obtain a third output and a fourth output;
[0102] Wherein, the third output is the output of the first time step forward, The fourth output is the output of the first time step backwards,
[0103] (2) Add the elements in the third output and the elements in the fourth output one by one to obtain the first output.
[0104] Specifically, the output of the bidirectional recurrent gating unit at the i-th time step (the first time step) is calculated:
[0105]
[0106] Step S1043: performing weight analysis on the first output through the attention layer to obtain a second output;
[0107] Specifically, the Attention layer allocates weight coefficients to the first output, so that samples of different importance receive different degrees of attention, highlighting the contribution of important samples and important periods to the classification of their p300 signals. The output h of the i-th time step (the first time step) is i Enter the Attention layer:
[0108] u=tanh(W s h i +b s )
[0109] α=softmax(u T M)
[0110] h * =Hα T
[0111] Among them, W is the weight coefficient, b is the bias, and M is the context vector at the sample level, which represents the high-level representation of the query "what are the important samples". * It is the result of weighted summation of all hidden states. After being processed by the Attention layer, the data vector size is [N*D], where D is the data dimension after feature extraction, and D<S.
[0112] Step S1044: Process the second output through the output layer to complete the generation of the encoder.
[0113] (1) compressing the second output to the interval [0, 1];
[0114] Specifically, the second output is compressed to the interval [0, 1] through the softmax layer.
[0115] (2) Obtain the ECG signal detection category through the argmax function and calculate the loss function;
[0116] (3) Iterating the loss function until convergence, thereby completing the generation of the encoder.
[0117] Specifically, in the grid model of the embodiment of the present invention, the loss function is approximately converged after 200 iterations. After the encoder is generated, the parameters of the encoder are saved for subsequent use in the hidden Markov model.
[0118] In an embodiment of the present invention, an encoder for processing raw ECG signal data is obtained by training a grid model integrated by a bidirectional recurrent gating unit layer and an attention layer, thereby improving the data processing capability of the encoder and enabling the encoder to extract more detailed features of the raw ECG signal data.
[0119] S105, performing feature processing and dimension reduction on the first data by the encoder to generate a second sample;
[0120] Specifically, the encoder obtained by training the grid model in step S104 processes the first data, extracts features of the first data and reduces its dimension, generates low-dimensional mapping samples (second samples), and reduces the difficulty of subsequent clustering through a hidden Markov model.
[0121] S106. Generate an electrocardiogram signal detection result through a hidden Markov model (HMM model) according to the second sample.
[0122] The emission density of the HMM model is generated by a Watson hybrid model.
[0123] Specifically, according to step S1023, the first data for generating the second sample has been subjected to L2 regularization processing. After L2 regularization processing, the data of the second sample is distributed on the surface of the unit hypersphere to form spherical data, that is, in an embodiment of the present invention, the second sample containing spherical data needs to be clustered by the HMM model. Since the traditional Gaussian mixture model cannot fit the spherical data well, the Watson mixture model is selected to fit the second sample to generate the emission density of the HMM model.
[0124] S106 can be further divided into the following steps S1061-S1062:
[0125] Step S1061, calculating the posterior distribution of the second sample by variational inference and maximizing the lower bound of evidence;
[0126] Specifically, the HMM model assumes that each observed variable (second sample) is generated by a hidden state and a probability distribution. The parameters of the HMM model are in represents the initial state probability vector, represents the state transfer matrix, represents the state component matrix, c ik represents the mixing coefficient of component k in state i, and Represents the parameters of the Watson distribution.
[0127] Reference Figure 2 , assuming that the observed data consists of T unit vectors For each observation x t Introducing two latent variables and z t Represents the indicator value of the hidden state of the t-th observation data, y t represents the indicator value of the mixture component of the t-th observation data. The likelihood function of the model under the complete data set {X, y, z} is:
[0128]
[0129] Since the HMM model of the embodiment of the present invention is a Bayesian model, each hidden state in the model is associated with a prior distribution. Set the Watson-Gamma prior distribution:
[0130]
[0131]
[0132] Then, the parameters of the HMM model are trained by variational inference. Through variational inference, the easy-to-solve as soon as possible distribution q(S, L, Φ) is used to approximate the posterior distribution p(S, L, Φ|Z) of the second sample. By continuously adjusting the parameters of the approximate distribution, the KL divergence between the two distributions is minimized, and finally the likelihood function that maximizes the evidence lower bound (ELBO) is obtained:
[0133]
[0134] By maximizing the variational lower bound ELBO through the algorithm, we get the updated expressions of each HMM parameter. By continuously iterating and updating the expressions until ELBO converges, we get the posterior distribution of the second sample.
[0135] Step S1062: performing clustering according to the posterior distribution to generate the electrocardiogram signal detection result.
[0136] (1) generating a clustering result according to the maximum value of each row in the posterior distribution;
[0137] Specifically, a clustering result is generated according to the dimension where the column where the maximum value of each row in the posterior distribution is located is located.
[0138] (2) Generate the electrocardiogram signal detection result according to the clustering result.
[0139] The embodiment of the present invention adopts a hidden Markov model with a Watson mixture model as the emission density to identify the second sample processed by the encoder, thereby improving the accuracy and comprehensiveness of the electrocardiogram signal detection result.
[0140] Next, a system for detecting abnormal electrocardiogram signals according to an embodiment of the present application will be described with reference to the accompanying drawings.
[0141] Figure 3 It is a structural schematic diagram of an abnormal ECG signal detection system according to an embodiment of the present application.
[0142] The system specifically comprises:
[0143] A first data acquisition module 301, used to acquire first data;
[0144] A second data generating module 302, configured to pre-process the first data to generate second data;
[0145] A first sample extraction module 303, configured to extract 10% of the second data as a first sample;
[0146] An encoder generation module 304 is used to input the first sample into a grid model for training to generate an encoder;
[0147] A second sample generating module 305, configured to perform feature processing and dimension reduction on the first data through the encoder to generate a second sample;
[0148] The ECG signal detection result generating module 306 is configured to generate an ECG signal detection result by using a hidden Markov model according to the second sample.
[0149] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0150] Reference Figure 4 The present application provides an electrocardiogram (ECG) signal abnormality detection device, comprising:
[0151] at least one processor 401;
[0152] At least one memory 402, used to store at least one program;
[0153] When the at least one program is executed by the at least one processor 401, the at least one processor 401 implements the method for detecting abnormal electrocardiogram signals.
[0154] Similarly, the contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0155] In some optional embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the application is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Optional embodiments are expected, wherein the order of various operations is changed and the sub-operation described as a part of a larger operation is performed independently.
[0156] In addition, although the present application is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present application. More specifically, in view of the properties, functions, and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional techniques of the engineer. Therefore, those skilled in the art can implement the present application set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present application, which is determined by the full scope of the attached claims and their equivalents.
[0157] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several programs to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0158] The logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable programs for implementing the logical functions, and may be embodied in any computer-readable medium for use by a program execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch and execute a program from a program execution system, device or apparatus), or in conjunction with such program execution systems, devices or apparatuses. For purposes of this specification, a "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by a program execution system, device or apparatus, or in conjunction with such program execution systems, devices or apparatuses.
[0159] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0160] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable program execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0161] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0162] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.
[0163] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the described embodiments. Technical personnel familiar with the field may make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.
Claims
1. A method for detecting abnormal electrocardiogram signals, characterized in that: The following steps are involved: Acquire first data, where the first data is input original electrocardiogram signal data; Preprocessing the first data to generate second data; Acquire a preset number of samples from the second data as first samples; Inputting the first sample into a grid model for training to generate an encoder, wherein the grid model includes a bidirectional recurrent gating unit layer and an attention layer; Performing feature processing and dimension reduction on the first data by the encoder to generate a second sample, wherein the data of the second sample is distributed on the surface of a unit hypersphere to form spherical data; According to the second sample, clustering the second sample including the spherical data by using a hidden Markov model to generate an electrocardiogram signal detection result, wherein the emission density of the hidden Markov model is generated by a Watson hybrid model; The preprocessing of the first data to generate second data includes: extracting a first heartbeat from the first data, the first heartbeat comprising each heartbeat in the first data; By data interpolation, the length of each heartbeat in the first heartbeat is made equal to generate a second heartbeat; Perform L2 regularization processing on the second heartbeat to generate the second data.
2. The method for detecting abnormal ECG signals according to claim 1, characterized in that: The grid model also includes an input layer and an output layer; The step of inputting the first sample into a grid model for training to generate an encoder includes: Inputting the first sample into the bidirectional recurrent gating unit layer through the input layer; Calculating the first sample through the bidirectional recurrent gating unit layer to obtain a first output, where the first output is an output of a first time step; Performing weight analysis on the first output through the attention layer to obtain a second output; The second output is processed by the output layer to complete the generation of the encoder.
3. The method for detecting abnormal ECG signals according to claim 2, characterized in that: The step of calculating the first sample through the bidirectional recurrent gating unit layer to obtain a first output includes: Calculating the first sample through the bidirectional recurrent gating unit layer to obtain a third output and a fourth output, wherein the third output is an output forward of the first time step, and the fourth output is an output backward of the first time step; The elements in the third output and the elements in the fourth output are added one by one to obtain the first output.
4. The method for detecting abnormal ECG signals according to claim 2, characterized in that: The step of processing the second output through the output layer to complete the generation of the encoder includes: Compressing the second output to the interval [0,1]; Obtain the ECG signal detection category through the argmax function and calculate the loss function; The loss function is iterated until convergence to complete the generation of the encoder.
5. The method for detecting abnormal ECG signals according to claim 1, characterized in that: The step of generating an electrocardiogram signal detection result by using a hidden Markov model according to the second sample includes: Calculate the posterior distribution of the second sample by variational inference and maximizing the lower bound of evidence; Clustering is performed according to the posterior distribution to generate the electrocardiogram signal detection result.
6. The method for detecting abnormal ECG signals according to claim 5, characterized in that: The clustering is performed according to the posterior distribution to generate the electrocardiogram signal detection result, including: Generate a clustering result according to the maximum value of each row in the posterior distribution; The electrocardiogram signal detection result is generated according to the clustering result.
7. An electrocardiogram signal abnormality detection system, characterized in that: include: A first data acquisition module, used to acquire first data; A second data generating module, used for preprocessing the first data to generate second data; A first sample extraction module, used for acquiring a preset number of samples from the second data as first samples; An encoder generation module, used for inputting the first sample into a grid model for training to generate an encoder; A second sample generating module is used to perform feature processing and dimension reduction on the first data through the encoder to generate a second sample, wherein the data of the second sample is distributed on the surface of a unit hypersphere to form spherical data; an ECG signal detection result generating module, configured to cluster the second sample containing the spherical data by a hidden Markov model according to the second sample, and generate an ECG signal detection result; The preprocessing of the first data to generate second data includes: extracting a first heartbeat from the first data, the first heartbeat comprising each heartbeat in the first data; By data interpolation, the length of each heartbeat in the first heartbeat is made equal to generate a second heartbeat; Perform L2 regularization processing on the second heartbeat to generate the second data.
8. An electrocardiogram signal abnormality detection device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the electrocardiogram signal abnormality detection method as described in any one of claims 1-6.
9. A storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to implement an electrocardiogram signal abnormality detection method as described in any one of claims 1-6 when executed by the processor.
Citation Information
Patent Citations
Gene expression data clustering method, device and equipment for non-parametric Waston hybrid model
CN111612101A
Semi-supervised classification method and device based on deep learning, and storage medium
CN112699960A