CN116784815A - Abnormal heart rhythm classification method based on combination of convolutional neural network and transducer - Google Patents
Abnormal heart rhythm classification method based on combination of convolutional neural network and transducer Download PDFInfo
- Publication number
- CN116784815A CN116784815A CN202310617270.6A CN202310617270A CN116784815A CN 116784815 A CN116784815 A CN 116784815A CN 202310617270 A CN202310617270 A CN 202310617270A CN 116784815 A CN116784815 A CN 116784815A
- Authority
- CN
- China
- Prior art keywords
- heartbeat
- neural network
- sequence
- abnormal heart
- heart rhythm
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 230000002159 abnormal effect Effects 0.000 title claims abstract description 36
- 230000033764 rhythmic process Effects 0.000 title claims abstract description 35
- 238000013527 convolutional neural network Methods 0.000 title claims abstract description 26
- 239000013598 vector Substances 0.000 claims abstract description 24
- 238000013528 artificial neural network Methods 0.000 claims abstract description 12
- 238000012360 testing method Methods 0.000 claims abstract description 11
- 230000008569 process Effects 0.000 claims abstract description 9
- 238000000605 extraction Methods 0.000 claims description 12
- 238000012549 training Methods 0.000 claims description 12
- 230000011218 segmentation Effects 0.000 claims description 6
- 108091026890 Coding region Proteins 0.000 claims description 2
- 238000010606 normalization Methods 0.000 claims description 2
- 238000012545 processing Methods 0.000 abstract description 5
- 238000001514 detection method Methods 0.000 description 6
- 238000011176 pooling Methods 0.000 description 4
- 238000013136 deep learning model Methods 0.000 description 3
- 238000005070 sampling Methods 0.000 description 3
- 208000009729 Ventricular Premature Complexes Diseases 0.000 description 2
- 230000005189 cardiac health Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000013135 deep learning Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000018109 developmental process Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- 238000011478 gradient descent method Methods 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 238000007781 pre-processing Methods 0.000 description 2
- 208000024172 Cardiovascular disease Diseases 0.000 description 1
- 206010042602 Supraventricular extrasystoles Diseases 0.000 description 1
- 206010047289 Ventricular extrasystoles Diseases 0.000 description 1
- 230000005856 abnormality Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 239000003814 drug Substances 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012706 support-vector machine Methods 0.000 description 1
Classifications
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/02—Detecting, measuring or recording pulse, heart rate, blood pressure or blood flow; Combined pulse/heart-rate/blood pressure determination; Evaluating a cardiovascular condition not otherwise provided for, e.g. using combinations of techniques provided for in this group with electrocardiography or electroauscultation; Heart catheters for measuring blood pressure
- A61B5/024—Detecting, measuring or recording pulse rate or heart rate
- A61B5/0245—Detecting, measuring or recording pulse rate or heart rate by using sensing means generating electric signals, i.e. ECG signals
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/02—Detecting, measuring or recording pulse, heart rate, blood pressure or blood flow; Combined pulse/heart-rate/blood pressure determination; Evaluating a cardiovascular condition not otherwise provided for, e.g. using combinations of techniques provided for in this group with electrocardiography or electroauscultation; Heart catheters for measuring blood pressure
- A61B5/024—Detecting, measuring or recording pulse rate or heart rate
- A61B5/02405—Determining heart rate variability
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/24—Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
- A61B5/316—Modalities, i.e. specific diagnostic methods
- A61B5/318—Heart-related electrical modalities, e.g. electrocardiography [ECG]
- A61B5/346—Analysis of electrocardiograms
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/24—Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
- A61B5/316—Modalities, i.e. specific diagnostic methods
- A61B5/318—Heart-related electrical modalities, e.g. electrocardiography [ECG]
- A61B5/346—Analysis of electrocardiograms
- A61B5/349—Detecting specific parameters of the electrocardiograph cycle
- A61B5/352—Detecting R peaks, e.g. for synchronising diagnostic apparatus; Estimating R-R interval
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/24—Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
- A61B5/316—Modalities, i.e. specific diagnostic methods
- A61B5/318—Heart-related electrical modalities, e.g. electrocardiography [ECG]
- A61B5/346—Analysis of electrocardiograms
- A61B5/349—Detecting specific parameters of the electrocardiograph cycle
- A61B5/355—Detecting T-waves
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/72—Signal processing specially adapted for physiological signals or for diagnostic purposes
- A61B5/7235—Details of waveform analysis
- A61B5/7264—Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/72—Signal processing specially adapted for physiological signals or for diagnostic purposes
- A61B5/7235—Details of waveform analysis
- A61B5/7264—Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems
- A61B5/7267—Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems involving training the classification device
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
- G06N3/0455—Auto-encoder networks; Encoder-decoder networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2218/00—Aspects of pattern recognition specially adapted for signal processing
- G06F2218/12—Classification; Matching
Landscapes
- Health & Medical Sciences (AREA)
- Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Physics & Mathematics (AREA)
- Cardiology (AREA)
- Molecular Biology (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- General Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Theoretical Computer Science (AREA)
- Public Health (AREA)
- Surgery (AREA)
- Animal Behavior & Ethology (AREA)
- Heart & Thoracic Surgery (AREA)
- Pathology (AREA)
- Veterinary Medicine (AREA)
- Medical Informatics (AREA)
- Evolutionary Computation (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Physics (AREA)
- Physiology (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Signal Processing (AREA)
- Computational Linguistics (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Psychiatry (AREA)
- Fuzzy Systems (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)
Abstract
The invention discloses an abnormal heart rhythm classification method based on combination of a convolutional neural network and a transducer, which comprises the steps of firstly converting original electrocardio data into a sequence form after proper processing, and then utilizing a deep neural network combined by the convolutional neural network and the transducer to enable a machine to automatically learn intrinsic characteristics of electrocardio data in a vector form, wherein only simple and easily obtained R-R interval characteristics are used, and other artificially designed complex characteristics are completely abandoned. The whole process does not need to carry out a large amount of complex processing manually, and the efficiency and the accuracy can be greatly improved when the method is used for classifying abnormal heart rhythms. The invention tests on the MIT-BIH abnormal heart rhythm database, and obtains good performance. When classifying five abnormal heart rhythms, the performance on the test set was 97.66% higher than the average accuracy.
Description
Technical Field
The invention relates to an abnormal heart rhythm classification method, in particular to a realization method of abnormal heart rhythm classification based on combination of a convolutional neural network and a transducer.
Background
Remote automatic heart health monitoring is of great importance for cardiovascular disease control for large populations, and ECG electrocardiographs are often used as a data source for assessing heart health status. Because manual detection consumes a great deal of manpower and material resources, the current electrocardiographic abnormality detection technology is gradually turning to an artificial intelligence method.
In abnormal heart rhythm techniques, electrocardiographic signals are mainly divided into several categories: normal (N), supraventricular ectopic beat (SVEB), ventricular Ectopic Beat (VEB), fusion beat (F), and unknown (Q). Typical steps for abnormal heart rhythm classification include preprocessing, segmentation, feature extraction, and classification. Preprocessing and segmentation have had relatively sophisticated technical support, and therefore efforts have been made mainly to improve the methods of feature extraction and to develop classifiers to improve the performance of abnormal heart rhythm classification, with the development of classifiers being more aggressive. The earliest classifiers used include support vector machines SVM, multi-layer perceptrons MLP, linear discriminators, etc., and in recent years, with the vigorous development of deep learning in various fields, researchers have gradually started to apply a deep learning model to electrocardiographic signal recognition. Because abnormal heartbeat samples in the training set are difficult to collect, the data volume is small, unbalance of different types of data is easy to cause, and accordingly a great challenge is brought to classification. In addition, because the heartbeat signals of different people can have obvious differences, the obvious differences between the training sample space and the test sample space are easily caused under the condition that the data volume is not too large, and therefore the classification difficulty is increased.
Disclosure of Invention
The invention aims to provide an abnormal heart rhythm classification method based on combination of a convolutional neural network and a transducer, which can change single-lead electrocardiograph data into a vector sequence form through sampling and utilize a sequence-to-sequence deep learning model, thereby realizing automatic learning of features through a machine and classification and finally realizing automatic detection of abnormal heart rhythm types. When the method is used for classifying abnormal heart rhythms, no additional model or manual feature extraction is needed, so that the efficiency and the accuracy of classifying abnormal heart rhythms are greatly improved, and the method has important significance in the clinical medicine field.
The invention aims at realizing the following technical scheme:
an abnormal heart rhythm classification method based on combination of convolutional neural network and transducer comprises the following steps:
step (1) acquiring continuous electrocardiographic data of a single lead of a patient by using an Electrocardiograph (ECG) acquisition device;
step (2) obtaining the peak position of the R wave and the end position of the T wave in the continuous signals;
step (3) extracting heartbeat signals one by one based on the result of the step (2), and scaling a single heartbeat signal to a fixed length D, wherein all heartbeats in the whole lead can be regarded as a heartbeat vector sequence, and the dimension of each vector is D, and the method for extracting the heartbeat signals comprises the following two methods:
the method comprises the steps of starting from the next point of the ending position of the last T wave to the ending position of the current T wave;
calculating the starting point position and the ending point position of the current heartbeat by taking the R peak and the T wave end point of the current heartbeat as references, and finally extracting the whole heartbeat signal;
extracting R-R interval characteristics of the current heartbeat and a plurality of adjacent heartbeat signals according to the R peak position of each heartbeat, namely, the distance between the R peak position of the current heartbeat and the R peak positions of the adjacent heartbeats, so as to form a characteristic vector with the length of M, and sequentially arranging the characteristics of all heartbeat signals in the whole lead signal, so as to form an R-R interval characteristic vector sequence;
step (5) dividing the heartbeat sequence and the R-R interval characteristic sequence according to fixed L heartbeats, thereby obtaining a plurality of heartbeat signal vector sequence segments with the length of L and R-R interval characteristic vector sequence segments, wherein: after segmentation, if the length of the last segment of sequence is smaller than L, reversely intercepting the sequence meeting the specified length from the tail end of the whole lead signal, thereby ensuring that each heartbeat data is covered by a sample and participating in the learning and testing process of abnormal heart rhythm classification;
step (6) repeating the steps (2) - (5), and converting a continuously acquired electrocardiographic data segment into a plurality of sequence segments with the length of L;
and (7) repeating the steps (1) - (6) to obtain a data set of the electrocardiographic data segment, wherein: in the process of forming a data set, samples are enhanced based on a sliding window technology to increase the number of training samples, and the specific method is as follows: when L heartbeats are extracted backwards by taking a certain heartbeat as a starting point to form one sample, the starting point extracted next time slides backwards, the step length of the starting point is d heartbeats, and d is more than or equal to 1 and less than or equal to L;
step (8) training by using a deep neural network combining a convolutional neural network and a transducer based on the data set in the step (7) to obtain a deep neural network parameter model for abnormal heart rhythm classification, wherein the specific process is as follows:
(a) All heartbeat signals are subjected to feature extraction through a CNNBlock to form a heartbeat feature sequence;
(b) Splicing the heartbeat characteristic sequence and the R-R characteristic sequence according to the heartbeat corresponding relation to form a combined characteristic sequence;
(c) The combined characteristic sequence and the position coding sequence of each heartbeat are combined to form a new characteristic sequence input TransformerBlock, each output vector is processed through a feedforward neural network (FFN) and based on Softmax normalization to obtain the output probability of each category, and the category with the largest probability value is used as the final output.
Compared with the prior art, the invention has the following advantages:
1. according to the invention, the original electrocardiograph data is converted into a sequence form after being properly processed, then the intrinsic characteristics of the electrocardiograph data in a vector form are automatically learned by a machine by utilizing a deep neural network combined with a convolutional neural network and a transducer, and only the R-R interval characteristics which are simple and easy to obtain are used, so that the complex characteristics of other artificial designs are completely abandoned. The whole process does not need to carry out a large amount of complex processing manually, and the efficiency and the accuracy can be greatly improved when the method is used for classifying abnormal heart rhythms.
2. The invention tests on the MIT-BIH abnormal heart rhythm database, and obtains good performance. When classifying five abnormal heart rhythms, the performance on the test set was 97.66% higher than the average accuracy.
Drawings
FIG. 1 is a general flow chart of an abnormal heart rhythm classification method based on a convolutional neural network and a transducer combined deep neural network;
FIG. 2 is an overall block diagram of a deep neural network based on a combination of convolutional neural networks and transformers;
fig. 3 is a specific structural diagram of a convolutional neural network section.
Detailed Description
The following description of the present invention is provided with reference to the accompanying drawings, but is not limited to the following description, and any modifications or equivalent substitutions of the present invention should be included in the scope of the present invention without departing from the spirit and scope of the present invention.
Example 1:
the embodiment provides a method for realizing abnormal heart rhythm classification based on a convolutional neural network and a transducer, which can change single-lead electrocardiograph data into a vector sequence form through sampling and is suitable for a sequence-to-sequence deep learning model, so that automatic learning features through a machine and classification are realized, and finally automatic detection of abnormal heart rhythm is realized. In this embodiment, the processing of the original signal is performed by the currently popular integration tool MATLAB for data analysis and signal processing or Python algorithm package with open source. In addition, convolutional neural networks and Transformer models are built based on Tensorflow2, one of the most popular deep learning frameworks at the present time. As shown in fig. 1, the specific implementation steps are as follows:
and (1) acquiring continuous electrocardiographic data of a single lead of a patient by using an ECG acquisition device, and marking the category label of each heartbeat data manually. If the data set provides the electrocardio category mark, the label file is directly loaded.
And (2) if the data set provides information of the R peak position and the T wave start-stop position, directly using the information. Otherwise, the R peak position and the T wave end position are obtained in the continuous signals by using the existing electrocardiographic waveform detection tool. And segmenting the signal according to the T wave end point position information in two adjacent heartbeats, wherein each segment is one heart beat. The specific extraction method comprises the following steps: starting from the next point of the end position of the last T wave to the end of the end position of the current T wave. And uniformly adjusting each heartbeat signal to D dimension through linear scaling operation. And sequentially arranging a plurality of heartbeat vectors by taking each heartbeat signal as a vector to obtain a vector sequence formed by L heartbeats.
And (3) calculating an R-R interval sequence corresponding to the signal according to the position of the R peak to form an R-R interval characteristic sequence. The R-R interval feature comprises a dimension, i.e. the distance of the R peak of the current heartbeat from the R peak of the previous heartbeat.
And (4) cutting the heartbeat sequence and the R-R interval characteristic sequence into a plurality of sequence segments with the length of L according to a certain length, and carrying out subsequent steps. The annotation file is also processed as described above, e.g., based on dataset experiments. In addition, a small section of heartbeat with the tail part smaller than the L length of each sequence is specially processed, and a complete section of heartbeat sequence with the L length is reversely intercepted from the tail part, so that all data can participate in classification of abnormal heart rhythms.
And (5) repeating the steps (2) - (4), and converting a continuously acquired electrocardiographic data segment into a plurality of sequence segments with the length of L. If the length of the last segment of the sequence is smaller than L, extracting L heartbeats from the tail end starting direction of the signal to form a complete sequence.
And (6) repeating the steps (1) - (5) to obtain a data set of the electrocardio data segment. In forming the data set, we do data enhancement to increase the number of training samples, since too little data volume affects model learning. Standard sequence data segmentation is performed in a non-overlapping manner, and to increase the sample size, we use a sliding window technique to increase the sample size. The specific method comprises the following steps: when L heartbeats are extracted backwards by taking a certain heartbeat as a starting point to form a sample, the starting point extracted next time slides backwards, and the step length is d heartbeats.
Step (7) performs feature extraction and model training based on a model combining CNN and a transducer, as shown in fig. 2, and the specific flow is as follows:
(a) All the heartbeat signals are subjected to feature extraction through a CNNBlock to form a heartbeat feature sequence. The structure of the convolutional neural network is shown in fig. 3, and consists of five one-dimensional convolutional layers and four maximum pooling layers alternately. Each convolution layer has 16 filters with a filter kernel size of 2 x 1 and a step size of 1. Each convolution layer is followed by a 2 x 1 maximum pooling layer except the last one, with a step size of 2.
(b) And splicing the heartbeat characteristic sequence and the R-R characteristic sequence according to the heartbeat corresponding relation to form a combined characteristic sequence.
(c) The combined feature sequence is combined with the position code sequence of each heartbeat to form a new feature sequence input TransformerBlock. The output probability of each class is obtained after the vector of each output is normalized by a feedforward neural network (FFN) and based on Softmax, and the class with the largest probability value is used as the final output.
And (8) during model training, the step (7) needs to perform repeated iterative optimization of model parameters based on a gradient descent method until the model converges. And (3) in the process of model test and practical application, the step (7) is only required to be operated once, and a classification result can be obtained. Based on the MIT-BIH dataset, when d=280, l=15, m=1 (only the distance features of the current heartbeat from the previous heartbeat are extracted), d=3, the overall average recognition accuracy over the test set reaches 97.66%.
Example 2:
the embodiment provides a method for realizing abnormal heart rhythm classification based on a convolutional neural network and a transducer, which comprises the following specific steps:
and (1) acquiring continuous electrocardiographic data of a single lead of a patient by using an ECG acquisition device, and marking the category label of each heartbeat data manually. If the data set provides the electrocardio category mark, the label file is directly loaded.
And (2) if the data set provides information of the R peak position and the T wave start-stop position, directly using the information. Otherwise, the R peak position and the T wave end position are obtained in the continuous signals by using the existing electrocardiographic waveform detection tool. And segmenting the signal according to the T wave position information in two adjacent heartbeats, wherein each segment is one heartbeat. The specific extraction method comprises the following steps: the length D of one heartbeat signal to be extracted is set based on the current electrocardiographic dataset characteristics. The sampling rate characteristic of the electrocardiographic signal is referenced when setting so that an extracted heartbeat signal should contain a complete PQRST signature. Calculating the extraction length of the left side of the R peak value to be a-diff according to the distance diff between the R peak value position and the T wave end point position of the current heartbeat, wherein a is more than or equal to 0.5 and less than or equal to 1. A continuous heartbeat signal with the R peak as a reference point is thus formed, the left start point being a×diff from the R peak, and the right end point (i.e. the end point of the T wave) being diff from the R peak. The signal length extracted at this time is s= (1+a) diff. If S is smaller than D, the signal starting point and the signal ending point are both moved outwards until the extracted length reaches D dimension; otherwise, uniformly adjusting each heartbeat signal to D dimension through linear scaling operation. And sequentially arranging a plurality of heartbeat vectors by taking each heartbeat signal as a vector to obtain a vector sequence formed by L heartbeats.
And (3) calculating an R-R interval sequence corresponding to the signal according to the position of the R peak to form an R-R interval characteristic sequence. The R-R interval feature includes two dimensions: the distance between the R peak of the current heartbeat and the R peak of the previous heartbeat and the distance between the R peak of the current heartbeat and the R peak of the next heartbeat.
And (4) cutting the heartbeat sequence and the R-R interval characteristic sequence into a plurality of sequence segments with the length of L according to a certain length, and carrying out subsequent steps. The annotation file is also processed as described above, e.g., based on dataset experiments. In addition, a small section of heartbeat with the tail part smaller than the L length of each sequence is specially processed, and a complete section of heartbeat sequence with the L length is reversely intercepted from the tail part, so that all data can participate in classification of abnormal heart rhythms.
And (5) repeating the steps (2) - (4), and converting a continuously acquired electrocardiographic data segment into a plurality of sequence segments with the length of L.
And (6) repeating the steps (1) - (5) to obtain a data set of the electrocardio data segment. In forming the data set, we do data enhancement to increase the number of training samples, since too little data volume affects model learning. Standard sequence data segmentation is performed in a non-overlapping manner, and to increase the sample size, we use a sliding window technique to increase the sample size. The specific method comprises the following steps: when L heartbeats are extracted backwards by taking a certain heartbeat as a starting point to form a sample, the starting point extracted next time slides backwards, and the step length is d heartbeats.
Step (7) performs feature extraction and model training based on a model combining CNN and a transducer, as shown in fig. 2, and the specific flow is as follows:
(a) All the heartbeat signals are subjected to feature extraction through a CNNBlock to form a heartbeat feature sequence. The structure of the convolutional neural network is shown in fig. 3, and consists of five one-dimensional convolutional layers and four maximum pooling layers alternately. Each convolution layer has 16 filters with a filter kernel size of 2 x 1 and a step size of 1. Each convolution layer is followed by a 2 x 1 maximum pooling layer except the last one, with a step size of 2.
(b) And splicing the heartbeat characteristic sequence and the R-R characteristic sequence according to the heartbeat corresponding relation to form a combined characteristic sequence.
(c) The combined feature sequence is combined with the position code sequence of each heartbeat to form a new feature sequence input TransformerBlock. The output probability of each class is obtained after the vector of each output is normalized by a feedforward neural network (FFN) and based on Softmax, and the class with the largest probability value is used as the final output.
And (8) during model training, the step (7) needs to perform repeated iterative optimization of model parameters based on a gradient descent method until the model converges. And (3) in the process of model test and practical application, the step (7) is only required to be operated once, and a classification result can be obtained. Based on the MIT-BIH dataset, when d=280, l=15, m=1 (only the distance features of the current heartbeat from the previous heartbeat are extracted), d=3, the overall average recognition accuracy over the test set reaches 97.02%.
Claims (6)
1. An abnormal heart rhythm classification method based on combination of convolutional neural network and transducer is characterized by comprising the following steps:
step (1) collecting continuous electrocardiographic data of a single lead of a patient;
step (2) obtaining the peak position of the R wave and the end position of the T wave in the continuous signals;
step (3) extracting heartbeat signals one by one based on the result of the step (2), and scaling the single heartbeat signal to a fixed length D;
extracting R-R interval characteristics of the current heartbeat and a plurality of adjacent heartbeat signals according to the R peak position of each heartbeat, namely, the distance between the R peak position of the current heartbeat and the R peak positions of the adjacent heartbeats, so as to form a characteristic vector with the length of M, and sequentially arranging the characteristics of all heartbeat signals in the whole lead signal, so as to form an R-R interval characteristic vector sequence;
step (5) dividing the heartbeat sequence and the R-R interval characteristic sequence according to fixed L heartbeats, thereby obtaining a plurality of heartbeat signal vector sequence segments with the length of L and R-R interval characteristic vector sequence segments;
step (6) repeating the steps (2) - (5), and converting a continuously acquired electrocardiographic data segment into a plurality of sequence segments with the length of L;
step (7), repeating the steps (1) - (6) to obtain a data set of the electrocardio data segment;
and (8) training by using a deep neural network combining a convolutional neural network and a transducer based on the data set in the step (7) to obtain a deep neural network parameter model for abnormal heart rhythm classification.
2. The abnormal heart rhythm classification method based on convolutional neural network and transducer combination according to claim 1, wherein in the step (3), the method for extracting the heartbeat signal is as follows: starting from the next point of the ending position of the last T wave to the ending position of the current T wave.
3. The abnormal heart rhythm classification method based on convolutional neural network and transducer combination according to claim 1, wherein in the step (3), the method for extracting the heartbeat signal is as follows: and calculating the starting position and the ending position of the current heartbeat by taking the R peak and the T wave end point of the current heartbeat as references, and finally extracting the whole heartbeat signal.
4. The abnormal heart rhythm classification method based on the combination of convolutional neural network and transducer according to claim 1, wherein in the step (5), after segmentation, if the length of the last segment of sequence is smaller than L, the sequence meeting the specified length is reversely intercepted from the tail end of the whole lead signal, thereby ensuring that each heartbeat data is covered by a sample and participating in the learning and testing process of abnormal heart rhythm classification.
5. The abnormal heart rhythm classification method based on convolutional neural network and transducer combination according to claim 1, wherein in step (6), samples are enhanced based on sliding window technique to increase the number of training samples when forming data set, specifically comprising: when L heartbeats are extracted backwards by taking a certain heartbeat as a starting point to form one sample, the starting point extracted next time slides backwards, the step length is d heartbeats, and d is more than or equal to 1 and less than or equal to L.
6. The abnormal heart rhythm classification method based on combination of convolutional neural network and transducer according to claim 1, wherein the specific process of step (8) is as follows:
(a) All heartbeat signals are subjected to feature extraction through a CNNBlock to form a heartbeat feature sequence;
(b) Splicing the heartbeat characteristic sequence and the R-R characteristic sequence according to the heartbeat corresponding relation to form a combined characteristic sequence;
(c) The combined characteristic sequence and the position coding sequence of each heartbeat are combined to form a new characteristic sequence input TransformerBlock, the output probability of each class is obtained after the vector of each output is processed through a feedforward neural network and the normalization based on Softmax, and the class with the maximum probability value is used as the final output.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310617270.6A CN116784815A (en) | 2023-05-29 | 2023-05-29 | Abnormal heart rhythm classification method based on combination of convolutional neural network and transducer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310617270.6A CN116784815A (en) | 2023-05-29 | 2023-05-29 | Abnormal heart rhythm classification method based on combination of convolutional neural network and transducer |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116784815A true CN116784815A (en) | 2023-09-22 |
Family
ID=88038988
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310617270.6A Pending CN116784815A (en) | 2023-05-29 | 2023-05-29 | Abnormal heart rhythm classification method based on combination of convolutional neural network and transducer |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116784815A (en) |
-
2023
- 2023-05-29 CN CN202310617270.6A patent/CN116784815A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107822622B (en) | Electrocardiogram diagnosis method and system based on deep convolutional neural network | |
US11564612B2 (en) | Automatic recognition and classification method for electrocardiogram heartbeat based on artificial intelligence | |
CN107203692B (en) | Electrocardio data digital signal processing method based on deep convolutional neural network | |
CN111772619B (en) | Heart beat identification method based on deep learning, terminal equipment and storage medium | |
CN111626114B (en) | Electrocardiosignal arrhythmia classification system based on convolutional neural network | |
EP3614301A1 (en) | Artificial intelligence-based interference recognition method for electrocardiogram | |
CN111759345B (en) | Heart valve abnormality analysis method, system and device based on convolutional neural network | |
CN111310572B (en) | Processing method and device for generating heart beat label sequence by using heart beat time sequence | |
CN109009102B (en) | Electroencephalogram deep learning-based auxiliary diagnosis method and system | |
CN113095302B (en) | Depth model for arrhythmia classification, method and device using same | |
CN113855038B (en) | Electrocardiosignal critical value prediction method and device based on multi-model integration | |
CN110558975B (en) | Electrocardiosignal classification method and system | |
CN113229825A (en) | Deep neural network-based multi-label multi-lead electrocardiogram classification method | |
CN111126350B (en) | Method and device for generating heart beat classification result | |
CN110313894A (en) | Arrhythmia cordis sorting algorithm based on convolutional neural networks | |
CN112426160A (en) | Electrocardiosignal type identification method and device | |
CN111956214A (en) | QRS wave automatic detection method based on U-net end-to-end neural network model | |
CN114970637A (en) | Lightweight arrhythmia classification method based on deep learning | |
CN115530788A (en) | Arrhythmia classification method based on self-attention mechanism | |
CN112472101A (en) | Deep learning electrocardiogram data classification method and device based on conversion technology | |
CN113116300A (en) | Physiological signal classification method based on model fusion | |
CN113288157A (en) | Arrhythmia classification method based on depth separable convolution and improved loss function | |
CN113855037A (en) | Atrial fibrillation identification method and device based on Transformer | |
CN117582235A (en) | Electrocardiosignal classification method based on CNN-LSTM model | |
CN111759302A (en) | Wearable individual electrocardiogram detection method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |