Automatic atrial fibrillation detection system and detection method
By combining the multi-stage feature fusion of the ECG and RR interphase feature extraction module in the AF automatic detection system, the problem of inaccurate detection of atrial fibrillation in the prior art is solved, and the accurate capture and detection of early AF signals is achieved.
Patent Information
- Application Number
- CN202411852681.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-16
AI Technical Summary
The prior art cannot accurately perform atrial fibrillation detection, especially in the early stages, and it is difficult to capture intermittent atrial fibrillation signals.
It provides an automatic detection system for atrial fibrillation, including an ECG feature extraction module, an RR interperiod feature extraction module, a feature fusion module and a classifier. The system extracts multi-level features through the encoding-decoding structure and uses the cross attention module to perform feature fusion to achieve information complementarity between the ECG signal and the RR interperiod sequence.
It significantly improves the accuracy of atrial fibrillation detection, especially in short-segment atrial fibrillation detection within 1 minute, which can effectively capture early atrial fibrillation signals and reduce the rate of missed diagnosis.
Smart Images

Figure CN119791675A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of atrial fibrillation detection, and more specifically, relates to an atrial fibrillation automatic detection system and a detection method. Background Art
[0002] Atrial fibrillation, or AF for short, is the most common clinical arrhythmia, characterized by rapid and irregular atrium beating. Palpitations are the main symptom of AF, and severe cases are often accompanied by complications such as thromboembolism, stroke, and heart failure. AF is a progressive disease, and intervention and treatment in the early stages play a very important role. Among them, maintaining sinus rhythm and minimizing the burden of AF are the most important. Early AF patients can help reduce the incidence of hospitalization and stroke, as well as mortality through rhythm control. Therefore, early diagnosis and appropriate intervention of AF can help restore normal heart rhythm and reduce the risk of complications. The electrocardiogram (ECG) recorded by the electrocardiograph is an important preliminary screening basis for clinical detection and diagnosis of AF. However, since the early stages of AF are intermittent, it is difficult for doctors to capture it in a long-term dynamic electrocardiogram containing a large number of ECG signals, which makes it easy for doctors to ignore and miss the diagnosis. Therefore, how to detect AF in the early stage is an urgent problem to be solved.
[0003] Existing automatic atrial fibrillation detection methods often use the RR interval as a feature of atrial fibrillation for atrial fibrillation detection. When atrial fibrillation occurs, the time intervals of ventricular contractions are inconsistent, and correspondingly, the RR interval presents irregular characteristics, which is an important indicator for atrial fibrillation monitoring; however, the RR interval can only reflect the time interval changes of the heart rate, and cannot reflect the detailed electrophysiological characteristics of detailed atrial activity, so atrial fibrillation cannot be accurately detected. Summary of the invention
[0004] In view of the above defects or improvement needs of the prior art, the present invention provides an automatic atrial fibrillation detection system, a training method and a detection method to solve the technical problem that the prior art cannot accurately detect atrial fibrillation.
[0005] In order to achieve the above-mentioned object, in a first aspect, the present invention provides an automatic detection system for atrial fibrillation, comprising: an ECG feature extraction module, an RR interval feature extraction module, a feature fusion module and a classifier;
[0006] Among them, the ECG feature extraction module and the RR interval feature extraction module are both encoding-decoding structures; the encoding structure in the encoding-decoding structure includes: N cascaded encoders, and a downsampling module is arranged between two adjacent encoders; the decoding structure in the encoding-decoding structure includes: N cascaded decoders, and an upsampling module is arranged between two adjacent decoders; the i-th encoder is correspondingly connected to the N-i+1-th decoder; i=1,2,…,N; N is a positive integer;
[0007] The encoding structure in the ECG feature extraction module is used to extract features of N different scales of the ECG signal to be detected.
[0008] The encoding structure in the RR interval feature extraction module is used to extract features of N different scales of the RR interval sequence. The RR interval sequence is a sequence consisting of RR interval values extracted from a global ECG signal segment including the ECG signal to be detected;
[0009] The feature fusion module includes: N cross attention modules; the i-th cross attention module is used to calculate Relative to Correlation characteristics and Relative to Correlation characteristics
[0010] The N-i+1th decoder in the ECG feature extraction module is used to obtain and the Ni-th ECG decoding feature, and decode them to obtain the N-i+1-th ECG decoding feature;
[0011] The N-i+1th decoder in the RR interval feature extraction module is used to obtain and the Ni-th RR interval decoding feature, and decode them to obtain the N-i+1-th RR interval decoding feature;
[0012] The classifier is used to obtain an atrial fibrillation detection result of the ECG signal to be detected based on the Nth ECG decoding feature and the Nth RR interval decoding feature.
[0013] Further preferably, the decoder in the ECG feature extraction module comprises: a cascaded attention module and a decoding module;
[0014] The attention module in the N-i+1th decoder in the ECG feature extraction module is used to Perform feature enhancement;
[0015] The decoding module in the N-i+1th decoder in the ECG feature extraction module is used to extract the feature enhanced The fusion feature of the Ni-th ECG decoding feature is decoded to obtain the N-i+1-th ECG decoding feature.
[0016] Further preferably, the above-mentioned attention module is a CBAM module.
[0017] Further preferably, the decoder in the RR interval feature extraction module comprises: a cascaded LSTM module and a decoding module;
[0018] The LSTM module in the N-i+1th decoder in the RR interval feature extraction module is used to extract The timing characteristics of
[0019] The decoding module in the N-i+1th decoder in the RR interval feature extraction module is used to The timing characteristics of The fusion features of the Ni-th RR interval decoding features are decoded to obtain the N-i+1-th RR interval decoding features.
[0020] Further preferably, the LSTM module is a Bi-LSTM module.
[0021] Further preferably, the above-mentioned automatic atrial fibrillation detection system is trained by the following method:
[0022] Inputting the pre-collected training set into the automatic detection system for atrial fibrillation, and training the automatic detection system for atrial fibrillation by minimizing the training loss;
[0023] Among them, the training loss is the difference loss between the atrial fibrillation detection results and the corresponding labels of the training samples in the training set after being detected by the atrial fibrillation automatic detection system;
[0024] The training sample is a pair of ECG signal samples and RR interval sequence samples, and the corresponding label is the actual result of atrial fibrillation detection of the ECG signal sample;
[0025] The RR interval sequence sample is a sequence consisting of RR interval values extracted from a global ECG signal segment including the ECG signal sample.
[0026] In a second aspect, the present invention provides a method for automatic detection of atrial fibrillation, comprising:
[0027] Inputting the ECG signal to be detected and the RR interval sequence into the automatic atrial fibrillation detection system provided by the first aspect of the present invention to obtain an atrial fibrillation detection result of the ECG signal to be detected;
[0028] The RR interval sequence is a sequence composed of RR interval values extracted from a global ECG signal segment including the ECG signal to be detected.
[0029] In a third aspect, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method for automatic detection of atrial fibrillation provided in the second aspect of the present invention is executed.
[0030] In a fourth aspect, the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the automatic atrial fibrillation detection method provided in the second aspect of the present invention.
[0031] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method for automatic detection of atrial fibrillation provided in the second aspect of the present invention.
[0032] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:
[0033] 1. The present invention provides an automatic detection system for atrial fibrillation, wherein the input includes an ECG signal to be detected and an RR interval sequence, wherein the RR interval sequence is a sequence composed of RR interval values extracted from a global ECG signal segment including the ECG signal to be detected; the ECG signal to be detected that provides fine-grained information and is of shorter duration fully complements the RR interval sequence that provides coarse-grained information and is of longer duration; on this basis, the multi-level features of the ECG signal to be detected and the RR interval sequence are extracted respectively through an ECG feature extraction module and an RR interval feature extraction module; the feature fusion module including the multi-level cross attention module not only makes full use of the multi-level features of the ECG signal to be detected and the RR interval sequence, but also makes full use of the multi-level features of the ECG signal to be detected and the RR interval sequence. The temporal multi-scale nature of the multi-level features of the R interval sequence, the low-level features have relatively rich detail information, and the high-level features have relatively rich semantic information, which realizes the effective fusion of coarse-grained information and fine-grained information; at the same time, the feature fusion module also makes the features of the ECG signal to be tested and the features of the RR interval sequence mutually serve as query sequences and key-value sequences. After the coarse-grained information and the fine-grained information are interacted with each other, they are sent to the decoders corresponding to the ECG feature extraction module and the RR interval feature extraction module respectively, and fused with the corresponding encoding features and the decoding features of the previous level, which greatly improves the feature representation ability of the ECG signal to be tested and significantly improves the accuracy of atrial fibrillation detection, especially in the detection of short-segment atrial fibrillation within 1 minute.
[0034] 2. Furthermore, in the automatic atrial fibrillation detection system provided by the present invention, the ECG feature extraction module also includes an attention module, which is used to enhance the features of the ECG signal output by the corresponding encoder based on the attention mechanism, and then input it into the corresponding decoding module for decoding, thereby further improving the feature representation capability and further improving the accuracy of atrial fibrillation detection.
[0035] 3. Furthermore, in the automatic atrial fibrillation detection system provided by the present invention, the attention module is preferably a CBAM module, which performs channel and spatial analysis on the features of the ECG signal and enhances it at the channel and spatial levels, thereby further improving the feature characterization capability.
[0036] 4. Furthermore, in the automatic atrial fibrillation detection system provided by the present invention, the RR interval feature extraction module also includes an LSTM module for extracting the temporal features of the RR interval sequence features, thereby further improving the feature characterization capability. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of the structure of an automatic atrial fibrillation detection system provided by an embodiment of the present invention;
[0038] Figure 2 A schematic diagram of the structure of a CBAM module provided in an embodiment of the present invention;
[0039] Figure 3 A schematic diagram of the structure of a bidirectional LSTM provided in an embodiment of the present invention;
[0040] Figure 4 A schematic diagram of the structure of a convolution module provided in an embodiment of the present invention;
[0041] Figure 5 A schematic diagram of the structure of a cross-attention module provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0043] In order to achieve the above-mentioned object, in a first aspect, the present invention provides an automatic detection system for atrial fibrillation, comprising: an ECG feature extraction module, an RR interval feature extraction module, a feature fusion module and a classifier;
[0044] Among them, the ECG feature extraction module and the RR interval feature extraction module are both encoding-decoding structures; the encoding structure in the encoding-decoding structure includes: N cascaded encoders, and a downsampling module is arranged between two adjacent encoders; the decoding structure in the encoding-decoding structure includes: N cascaded decoders, and an upsampling module is arranged between two adjacent decoders; the i-th encoder is correspondingly connected to the N-i+1-th decoder; i=1,2,…,N; N is a positive integer;
[0045] The encoding structure in the ECG feature extraction module is used to extract features of N different scales of the ECG signal to be detected.
[0046] The encoding structure in the RR interval feature extraction module is used to extract features of N different scales of the RR interval sequence. The RR interval sequence is a sequence consisting of RR interval values extracted from a global ECG signal segment including the ECG signal to be detected;
[0047] The feature fusion module includes: N cross attention modules; the i-th cross attention module is used to calculate Relative to Correlation characteristics and Relative to Correlation characteristics
[0048] The N-i+1th decoder in the ECG feature extraction module is used to obtain and the Ni-th ECG decoding feature, and decode them to obtain the N-i+1-th ECG decoding feature;
[0049] The N-i+1th decoder in the RR interval feature extraction module is used to obtain and the Ni-th RR interval decoding feature, and decode them to obtain the N-i+1-th RR interval decoding feature;
[0050] The classifier is used to obtain an atrial fibrillation detection result of the ECG signal to be detected based on the Nth ECG decoding feature and the Nth RR interval decoding feature.
[0051] In an optional embodiment, the N-i+1th decoder in the ECG feature extraction module is used to The fusion feature of the Ni-th ECG decoding feature is decoded to obtain the N-i+1-th ECG decoding feature.
[0052] Further preferably, the decoder in the ECG feature extraction module comprises: a cascaded attention module and a decoding module;
[0053] The attention module in the N-i+1th decoder in the ECG feature extraction module is used to Perform feature enhancement;
[0054] The decoding module in the N-i+1th decoder in the ECG feature extraction module is used to extract the feature enhanced The fusion feature of the Ni-th ECG decoding feature is decoded to obtain the N-i+1-th ECG decoding feature.
[0055] It should be noted that the attention module can be a CBAM module, a channel attention module, a spatial attention module, a temporal attention module, a self-attention module, etc., and the CBAM module is preferably used.
[0056] In an optional implementation, the N-i+1th decoder in the RR interval feature extraction module is used to The fusion features of the Ni-th RR interval decoding features are decoded to obtain the N-i+1-th RR interval decoding features.
[0057] In an optional implementation, the decoder in the RR interval feature extraction module includes: a cascaded LSTM module and a decoding module;
[0058] The LSTM module in the N-i+1th decoder in the RR interval feature extraction module is used to extract The timing characteristics of
[0059] The decoding module in the N-i+1th decoder in the RR interval feature extraction module is used to The timing characteristics of The fusion features of the Ni-th RR interval decoding features are decoded to obtain the N-i+1-th RR interval decoding features.
[0060] Preferably, the above-mentioned LSTM module is a Bi-LSTM module.
[0061] In an optional implementation manner, the above-mentioned automatic atrial fibrillation detection system is trained by:
[0062] Inputting the pre-collected training set into the automatic detection system for atrial fibrillation, and training the automatic detection system for atrial fibrillation by minimizing the training loss;
[0063] Among them, the training loss is the difference loss between the atrial fibrillation detection results and the corresponding labels of the training samples in the training set after being detected by the atrial fibrillation automatic detection system;
[0064] The training sample is a pair of ECG signal samples and RR interval sequence samples, and the corresponding label is the actual result of atrial fibrillation detection of the ECG signal sample;
[0065] The RR interval sequence sample is a sequence consisting of RR interval values extracted from a global ECG signal segment including the ECG signal sample.
[0066] It should be noted that there are multiple types of the above-mentioned difference losses, which can be cross entropy loss, Dice loss, a combination of cross entropy loss and Dice loss, L2 loss, etc., which are not limited here.
[0067] It should be noted that, in an optional implementation, the above classifier can directly obtain the atrial fibrillation detection result of the ECG signal to be detected based on the fusion features of the Nth ECG decoding features and the Nth RR interval decoding features. The fusion method is not limited, and splicing is preferred. The above classifier can be a fully connected layer, SVM, convolutional layer, Dense, MLP, Linear layer, etc., which is not limited here.
[0068] In another optional implementation, the above-mentioned classifier includes a first classification module and a second classification module; the first classification module is used to obtain the atrial fibrillation detection result of the ECG signal to be detected based on the Nth ECG decoding feature; the second classification module is used to obtain the atrial fibrillation detection result of the ECG signal to be detected based on the Nth RR interval decoding feature; finally, the final atrial fibrillation detection result is comprehensively judged. For example, the first classification module and the second classification module respectively obtain the probability that the ECG signal to be detected is an atrial fibrillation signal, and finally the probabilities of the two classification modules are respectively weighted and summed to realize integrated decision-making to obtain the final atrial fibrillation detection result. The above-mentioned classification module can be a fully connected layer, SVM, convolutional layer, Dense, MLP, Linear layer, etc., which is not limited here.
[0069] In order to further illustrate the automatic detection system for atrial fibrillation provided by the present invention, a specific embodiment is described in detail below:
[0070] 1) Get the training set.
[0071] R peak detection and RR interval extraction:
[0072] First, the original ECG signal (electrocardiogram signal) is collected, and R wave detection is performed on the original ECG signal. The R wave moment of each heartbeat in the ECG signal is extracted, and its RR interval value is calculated to obtain the corresponding RR interval sequence.
[0073] Optionally, in this embodiment, the extraction of RR intervals is completed by mature commercial equipment (DMS CardioSca12 Satellite System, USA, dynamic electrocardiogram analysis software).
[0074] Data preprocessing:
[0075] The original ECG signal and the corresponding RR interval sequence are denoised and normalized respectively; the original ECG signal is divided into segments with a certain proportion of overlap to obtain multiple ECG signal samples, and the corresponding RR interval sequence is also divided into segments with a certain proportion of overlap, and it is ensured that the ECG signal segment corresponding to each RR interval sequence contains an ECG signal sample, thereby obtaining RR interval sequence samples that provide coarse-grained information and have a longer time, and ECG signal samples that provide fine-grained information and have a shorter time; multiple pairs of ECG signal samples and RR interval sequence samples together constitute a training set, and the corresponding labels are the true results of atrial fibrillation detection of the ECG signal samples.
[0076] Optionally, in this embodiment, the z-score method is used to normalize the original signal, and then the original ECG signal and the corresponding RR interval sequence are segmented according to the length of 64 RR intervals. Since the lengths of the original signals corresponding to the 64 RR intervals are inconsistent, they are downsampled to a certain length by stretching or compressing. At the same time, considering that the ECG signal corresponding to the 64 RR intervals contains a large amount of data, the original ECG signal is divided into 3 shorter global ECG signal segments according to 22, 21, and 21 RR intervals.
[0077] 2) Build an automatic atrial fibrillation detection system
[0078] like Figure 1 As shown, the automatic detection system for atrial fibrillation includes: an ECG feature extraction module, an RR interval feature extraction module, a feature fusion module and a classifier;
[0079] Among them, the ECG feature extraction module and the RR interval feature extraction module are both encoding-decoding structures based on the UNet architecture; the encoding structure in the encoding-decoding structure includes: N cascaded encoders, and a downsampling module is arranged between two adjacent encoders; in this embodiment, the global maximum pooling layer is used as the downsampling module; the decoding structure in the encoding-decoding structure includes: N cascaded decoders, and an upsampling module is arranged between two adjacent decoders; the i-th encoder is correspondingly connected to the N-i+1-th decoder; i=1,2,…,N; N is a positive integer;
[0080] The working process of the encoding-decoding structure is as follows:
[0081] First, the multi-level local spatial information of the input signal is comprehensively extracted through the cascaded encoders, and then the most essential features extracted are decoded and classified from the deep level to the shallow level of context information through the cascaded decoders, and then the classification result of the encoding-decoding structure is output.
[0082] In this embodiment, in order to further improve the feature extraction capability, the decoder in the ECG feature extraction module includes a CBAM module (channel space attention module) and a decoding module; Figure 2 As shown in , the CBAM module is a convolutional block composed of channel attention and spatial attention. The CBAM module is connected between the decoding module and the corresponding encoder to perform channel and spatial analysis on the features of the input ECG signal. The decoder in the RR interval feature extraction module includes a bidirectional LSTM and a decoding module; Figure 3 As shown, the bidirectional LSTM is composed of two LSTMs in opposite directions, and the bidirectional LSTM is connected between the decoding module and the corresponding encoder to improve the timing analysis capability of the input RR interval sequence features.
[0083] In the ECG feature extraction module, the encoder and CBAM utilize both the spatial features of the ECG signal and the channel information in parallel feature extraction at each level; in the RR interval feature extraction module, the encoder and bidirectional LSTM utilize both the spatial features of the RR interval sequence and the time series information in parallel feature extraction at each level. The maximum pooling layer reduces the length of the feature by half to achieve downsampling; the decoder performs upsampling, and the extracted features are connected in series step by step.
[0084] The coding structures in the ECG feature extraction module and the RR interval feature extraction module proposed in the present invention fully extract the multi-level essential features of each time scale, and send the respective essential features to the feature fusion module for feature fusion at the corresponding level; at the same time, the output of the last level decoder in the ECG feature extraction module and the RR interval feature extraction module constitutes an integrated decision, which effectively improves the performance of the method.
[0085] In this embodiment, the encoder and the decoder are two cascaded convolution modules; Figure 4 As shown in the figure, the convolution module includes: a cascaded convolution layer conv, a BN normalization layer, a ReLu activation layer, and a Dorpout layer. By stacking two convolution modules, more complex and advanced features can be extracted, which is conducive to capturing basic information from the input data.
[0086] In the encoding stage, the convolution kernel of the convolution module is doubled and the feature length is halved by using the Maxpool layer with a step size of 2; in the decoding stage, the feature length is doubled by using the upsampling layer, which is exactly the opposite of the encoding process, so that the corresponding features extracted are connected in series step by step. In order to improve the robustness of the model, a Dropout layer is connected after each convolution module in the decoding stage.
[0087] The classifier includes a first fully connected layer connected after the ECG feature extraction module and a second fully connected layer connected after the RR interval feature extraction module. The first fully connected layer and the second fully connected layer respectively implement the mapping classification of ECG signal samples and RR interval sequence samples, and obtain the fused classification result through decision fusion.
[0088] The feature fusion module includes: N cross attention modules; the structural diagram of the cross attention module is as follows Figure 5 As shown in the figure, through cross attention, the relationship between ECG information with short time and rich details and RR interval information with long time and coarse details is learned, so as to achieve effective fusion of fine-grained information and coarse-grained information, and send them to the decoders corresponding to the ECG feature extraction module and the RR interval feature extraction module respectively to improve the classification ability of each decoder. Finally, the fused classification result is obtained by merging the results of the cross-overlapping parts of the ECG encoder and the RR interval encoder through decision fusion.
[0089] In this embodiment, the automatic atrial fibrillation detection system is divided into an ECG encoding-decoding structure and an RR encoding-decoding structure; the ECG encoding-decoding structure includes: an ECG feature extraction module and a first fully connected layer; the RR encoding-decoding structure includes: an RR interval feature extraction module and a second fully connected layer.
[0090] The first fully connected layer outputs the probability of whether the ECG signal sample is an atrial fibrillation signal; the second fully connected layer outputs the probability of whether the global ECG signal corresponding to the RR interval sequence sample is an atrial fibrillation signal. Combining the probabilities obtained from the two, the probability of whether the ECG signal sample is an atrial fibrillation signal is finally determined, thereby obtaining the final atrial fibrillation detection result.
[0091] 3) Training of the automatic detection system for atrial fibrillation
[0092] The above-mentioned automatic atrial fibrillation detection system is trained in the following way:
[0093] The training set is input into the automatic detection system for atrial fibrillation, and the automatic detection system for atrial fibrillation is trained by minimizing the training loss.
[0094] In this embodiment, the training loss includes a first training loss and a second training loss.
[0095] The first training loss is the difference loss between the atrial fibrillation detection results of the training samples in the training set after the ECG encoding-decoding structure and the corresponding labels; the second training loss is the difference loss between the atrial fibrillation detection results of the training samples in the training set after the RR encoding-decoding structure and the corresponding labels.
[0096] The difference loss in this embodiment includes cross entropy loss and Dice loss. The calculation formula of cross entropy loss is:
[0097]
[0098] The calculation formula of Dice loss is:
[0099]
[0100] The total loss of the first training loss and the second training loss is:
[0101] In this implementation, the samples in the training set are input into the automatic detection system for atrial fibrillation in batches. In the above formula, N represents the number of samples in a batch, and y i Represents the label of input sample i (ECG signal sample / RR interval sequence sample), p i Represents the predicted probability of the ECG encoding-decoding structure / RR encoding-decoding structure for the input sample i. The loss L is obtained ECG and L RRIs .
[0102] In this embodiment, the total loss generated by the ECG encoding-decoding structure and the RR encoding-decoding structure is used as the loss function, and the Adam optimizer is used to optimize the network parameters, which can be expressed by the following formula:
[0103] L total =λ ECG L ECG +λ RRIs L RRIs
[0104] Among them, L ECG , L RRIs are the losses generated by the ECG encoding-decoding structure and the RR encoding-decoding structure, λ ECG , RRIs are the corresponding loss coefficients respectively.
[0105] Optionally, in this embodiment, λ ECG , RRIs The loss coefficients are all set to 1, and the Adam optimizer is used to optimize the network parameters.
[0106] In summary, the present invention realizes an end-to-end time multi-scale automatic detection of atrial fibrillation without the need for manually designed feature extraction schemes. The preprocessing process is convenient and fast, and the preprocessed ECG signal is directly classified. The present invention not only performs slightly better than the single time scale model when the duration of atrial fibrillation exceeds 1 minute, but also significantly improves the performance when the duration of atrial fibrillation does not exceed 1 minute. It has excellent performance and wide applicability. Specifically, the present invention fully extracts the essential characteristics of each modality through the ECG feature extraction module and the RR interval feature extraction module, and sends each feature to the feature fusion module for feature fusion; the cross-attention module designed in the feature fusion module can make full use of the various levels of features extracted by the coding structure in the ECG feature extraction module and the RR interval feature extraction module, and fully mine valuable information from the fused features, effectively realize the complementarity of the feature information of the ECG signal and the RR interval sequence, and improve the detection accuracy; at the same time, the output of the ECG feature extraction module and the RR interval feature extraction module combined with the fused feature information can constitute an integrated decision, effectively improving the performance of the method.
[0107] In a second aspect, the present invention provides a method for automatic detection of atrial fibrillation, comprising:
[0108] Inputting the ECG signal to be detected and the RR interval sequence into the automatic atrial fibrillation detection system provided by the first aspect of the present invention to obtain an atrial fibrillation detection result of the ECG signal to be detected;
[0109] The RR interval sequence is a sequence composed of RR interval values extracted from a global ECG signal segment including the ECG signal to be detected.
[0110] The related technical solution is the same as the automatic atrial fibrillation detection system provided in the first aspect of the present invention, and will not be described in detail here.
[0111] The beneficial effects achieved by the present invention are further explained below in conjunction with a specific application scenario.
[0112] In order to measure the effect of the time multi-scale atrial fibrillation automatic detection method proposed in the present invention, first, a self-built data set of 1000 cases, specifically 700 cases of paroxysmal atrial fibrillation data and 300 cases of non-atrial fibrillation data of 12 leads with a duration of about 1 hour sampled at 128Hz, was divided into a training set and a test set in a ratio of 7:3, wherein the training set consisted of 500 cases of paroxysmal atrial fibrillation data and 200 cases of non-paroxysmal atrial fibrillation, and the remaining data was a test set. Since it was necessary to evaluate the performance of the method on short-term atrial fibrillation (atrial fibrillation duration not exceeding 1 minute), 700 cases of paroxysmal atrial fibrillation were counted, and it was found that there were 500 cases containing short-term atrial fibrillation, of which the training set contained 400 cases and the test set contained 100 cases.
[0113] Then, referring to the data preprocessing method in the above embodiment, the original ECG signal and the original RR interval data are processed respectively, and the original RR interval sequence is divided into segments according to the length of 64 RR intervals. It is worth mentioning that every 64 RR intervals and their corresponding original ECG signal segments are regarded as one sample. In order to evaluate the performance of this method in short-term atrial fibrillation detection, samples with short-term atrial fibrillation were extracted from the self-built data test set to form a self-built short-term atrial fibrillation test set. Then the corresponding original ECG signal segment is divided into 3 small segments according to the length of 22, 21, and 21 RR intervals, and the original signal is stretched or compressed to a fixed length to form a pair of training samples with the corresponding RR interval sequence of 64 RR interval lengths to form a training set to train the above-mentioned automatic atrial fibrillation detection system. Finally, the test set is used for testing, and the classification results of each heartbeat are obtained.
[0114] In this application scenario, we use three indicators, namely sensitivity, specificity and accuracy, to evaluate the performance of our method. The formulas of the above three indicators are:
[0115]
[0116] Among them, TP is the number of true positive heart beats, TN is the number of true negative heart beats, FP is the number of false positive heart beats, FN is the number of false negative heart beats, P is the total number of positive heart beats, and N is the total number of negative heart beats. At the same time, the AUC index (the area under the ROC curve and the coordinate axis) is also calculated to measure the overall performance of the method.
[0117] First, the performance of the automatic detection system for atrial fibrillation provided by the present invention (referred to as ERMNet) on a self-built data set was evaluated, and compared with the performance of the original signal single-modality model (the original signal ECG encoder-decoder is used as an independent network and trained using the original signal) and the RR interval single-modality model (the RR interval encoder-decoder is used as an independent network and trained using the RR interval). Table 1 shows the performance comparison of ERMNet with the single-modality model on the self-built overall test set. The results show that the performance of the RR interval decoding output of ERMNet is slightly better than that of the RR interval single-modality model, and the performance of the ECG decoding output is better than that of the ECG single-modality model. The performance after decision fusion is better than that of the single ECG single-modality model and the RR interval single-modality model. Compared with the ECG single-modality model, the accuracy rate is increased by 1.4 percentage points, and the AUC is increased from 0.978 to 0.991. Compared with the RR interval single-modality model, the accuracy rate is increased by 0.7 percentage points, and the AUC is increased from 0.982 to 0.991. In addition, compared with the ECG decoding end output and the RR interval decoding end output, the performance after decision fusion is slightly improved. The results on the self-built overall test set show that the ERMNet model is slightly better than the ECG single-modality model and the RR interval single-modality model, as well as the effectiveness of decision fusion.
[0118] Table 1. Performance comparison of ERMNet and single-modal models on the self-built overall test set
[0119]
[0120] Next, the performance of ERMNet on the self-built short-term atrial fibrillation test set was evaluated, and it was still compared with the original signal single-modality model and the RR interval single-modality model. Table 2 shows the performance comparison of ERMNet and the single-modality model on the self-built short-term atrial fibrillation test set. According to Table 2, compared with the ECG single-modality model and the RR interval single-modality model, ERMNet has significantly improved performance on the self-built short-term atrial fibrillation data set, whether it is the ECG, RR interval decoding end output alone or after decision fusion. Among them, the output of the ECG decoding end is better than the ECG single-modal model, with the accuracy increased from 86.3% to 93.2%, and the AUC increased from 0.936 to 0.973; the RR interval decoding end also performs better than the RR interval single-modal model, with the accuracy increased from 87.0% to 93.5%, and the AUC increased from 0.932 to 0.978; compared with the ECG single-modal model and the RR interval single-modal model, the performance of ERMNet after decision fusion is significantly improved, with the accuracy increased to 94.9%, and the AUC increased by 0.48 and 0.52 respectively, reaching 0.984. The above results show that the ERMNet proposed in the present invention can effectively combine the multi-time scale signal characteristics of ECG and RR intervals, realize information complementarity, and improve the detection accuracy, especially the detection accuracy of short-term atrial fibrillation.
[0121] Table 2. Performance comparison of ERMNet and single modality model on self-built short-term atrial fibrillation test set
[0122]
[0123] In summary, the present invention can simultaneously utilize the two characteristics of P wave absence and RR interval irregularity, and the shorter ECG signal that provides fine-grained information is fully complementary to the longer RR interval sequence that provides coarse-grained information. By effectively fusing and analyzing data at different time scales, the detection effect of atrial fibrillation attacks can be significantly improved, especially in the detection of short-segment atrial fibrillation within 1 minute.
[0124] In a third aspect, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method for automatic detection of atrial fibrillation provided in the second aspect of the present invention is executed.
[0125] The related technical solution is the same as the automatic atrial fibrillation detection method provided in the second aspect of the present invention, and will not be described in detail here.
[0126] In a fourth aspect, the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the automatic atrial fibrillation detection method provided in the second aspect of the present invention.
[0127] The related technical solution is the same as the automatic atrial fibrillation detection method provided in the second aspect of the present invention, and will not be described in detail here.
[0128] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method for automatic detection of atrial fibrillation provided in the second aspect of the present invention.
[0129] The related technical solution is the same as the automatic atrial fibrillation detection method provided in the second aspect of the present invention, and will not be described in detail here.
[0130] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An automatic detection system for atrial fibrillation, characterized in that: include: ECG feature extraction module, RR interval feature extraction module, feature fusion module and classifier; The ECG feature extraction module and the RR interval feature extraction module are both encoding-decoding structures; the encoding structure in the encoding-decoding structure includes: N cascaded encoders, and a downsampling module is arranged between two adjacent encoders; the decoding structure in the encoding-decoding structure includes: N cascaded decoders, and an upsampling module is arranged between two adjacent decoders; the i-th encoder is correspondingly connected to the N-i+1-th decoder; i=1,2,…,N; N is a positive integer; The coding structure in the ECG feature extraction module is used to extract features of N different scales of the ECG signal to be detected. The encoding structure in the RR interval feature extraction module is used to extract features of N different scales of the RR interval sequence. The RR interval sequence is a sequence consisting of RR interval values extracted from a global ECG signal segment including the ECG signal to be detected; The feature fusion module includes: N cross attention modules; the i-th cross attention module is used to calculate Relative to Correlation characteristics and Relative to Correlation characteristics The N-i+1th decoder in the ECG feature extraction module is used to obtain and the Ni-th ECG decoding feature, and decode them to obtain the N-i+1-th ECG decoding feature; The N-i+1th decoder in the RR interval feature extraction module is used to obtain and the Ni-th RR interval decoding feature, and decode them to obtain the N-i+1-th RR interval decoding feature; The classifier is used to obtain an atrial fibrillation detection result of the ECG signal to be detected based on the Nth ECG decoding feature and the Nth RR interval decoding feature.
2. The automatic atrial fibrillation detection system according to claim 1, characterized in that: The decoder in the ECG feature extraction module includes: a cascaded attention module and a decoding module; The attention module in the N-i+1th decoder in the ECG feature extraction module is used to Perform feature enhancement; The decoding module in the N-i+1th decoder in the ECG feature extraction module is used to extract the feature enhanced The fusion feature of the Ni-th ECG decoding feature is decoded to obtain the N-i+1-th ECG decoding feature.
3. The automatic atrial fibrillation detection system according to claim 2, characterized in that: The attention module is a CBAM module.
4. The automatic atrial fibrillation detection system according to any one of claims 1 to 3, characterized in that: The decoder in the RR interval feature extraction module includes: a cascaded LSTM module and a decoding module; The LSTM module in the N-i+1th decoder in the RR interval feature extraction module is used to extract The timing characteristics of The decoding module in the N-i+1th decoder in the RR interval feature extraction module is used to The timing characteristics of The fusion features of the Ni-th RR interval decoding features are decoded to obtain the N-i+1-th RR interval decoding features.
5. The automatic atrial fibrillation detection system according to claim 4, characterized in that: The LSTM module is a Bi-LSTM module.
6. The automatic atrial fibrillation detection system according to claim 1, characterized in that: The automatic atrial fibrillation detection system is trained by the following method: Inputting the pre-collected training set into the automatic atrial fibrillation detection system, and training the automatic atrial fibrillation detection system by minimizing the training loss; The training loss is the difference loss between the atrial fibrillation detection results of the training samples in the training set after being detected by the atrial fibrillation automatic detection system and the corresponding labels; The training sample is a pair of ECG signal samples and RR interval sequence samples, and the corresponding label is the true result of atrial fibrillation detection of the ECG signal sample; The RR interval sequence samples are a sequence composed of RR interval values extracted from a global ECG signal segment including ECG signal samples.
7. A method for automatic detection of atrial fibrillation, characterized in that: include: Inputting the ECG signal to be detected and the RR interval sequence into the automatic atrial fibrillation detection system according to any one of claims 1 to 6 to obtain an atrial fibrillation detection result of the ECG signal to be detected; The RR interval sequence is a sequence composed of RR interval values extracted from a global ECG signal segment including the ECG signal to be detected.
8. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program, and the processor executes the method for automatic detection of atrial fibrillation according to claim 7 when executing the computer program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the method for automatic detection of atrial fibrillation according to claim 7.
10. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, implements the steps of the method for automatic detection of atrial fibrillation as claimed in claim 7.
Citation Information
Patent Citations
Deep learning-based automatic detecting system for atrial fibrillation of electrocardiograph signal
CN111772628A
Atrial fibrillation identification method and device, storage medium and computer equipment
CN116616791A
Alzheimer disease diagnosis method based on multi-modal cross attention
CN118116573A
Electrocardiogram long tail classification method and device based on abnormal detection pre-training and medium
CN118873148A
Electrocardiosignal open set identity recognition method based on hybrid network and cross attention mechanism
CN119128684A
Cited By
Electrocardiosignal atrial fibrillation detection system and method and electronic equipment
CN121040922A