Atrial fibrillation automatic detection system and detection method

Through the multi-level feature fusion of the ECG feature extraction module and the RR interval feature extraction module, the problem of inaccurate atrial fibrillation detection in the existing technology is solved, and efficient automatic atrial fibrillation detection is achieved.

CN119791675BActive Publication Date: 2025-10-03HUAZHONG UNIV OF SCI & TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411852681.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-10-03
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

Existing automatic atrial fibrillation detection methods cannot accurately detect early atrial fibrillation because the RR interval can only reflect the changes in the time interval of heart rate, but cannot reflect the detailed electrophysiological characteristics of atrial activity.

Method used

The ECG feature extraction module and the RR interval feature extraction module are used. Through the encoding-decoding structure and the cross-attention module, combined with the LSTM module and the CBAM module, multi-level features are extracted and feature fusion is performed to realize atrial fibrillation detection.

Benefits of technology

The accuracy of atrial fibrillation detection has been significantly improved, especially in the detection of short-segment atrial fibrillation within 1 minute, and the feature characterization capability has been improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119791675B_ABST
    Figure CN119791675B_ABST
Patent Text Reader

Abstract

The present invention discloses an automatic atrial fibrillation detection system and method, belonging to the technical field of atrial fibrillation detection. The present invention takes as input an ECG signal to be tested that provides fine-grained information and a short time, and an RR interval sequence that provides coarse-grained information and a long time. On this basis, the multi-level features of the two are extracted respectively by an ECG feature extraction module and an RR interval feature extraction module. The feature fusion module uses the features of the ECG signal to be tested and the RR interval sequence as a query sequence and a key-value sequence, so that the coarse-grained information and the fine-grained information interact with each other, and are respectively sent to the decoders corresponding to the ECG feature extraction module and the RR interval feature extraction module for fusion with the corresponding encoding features and the decoding features of the previous level, thereby greatly improving the feature representation capability of the ECG signal to be tested and significantly improving the accuracy of atrial fibrillation detection, especially in the detection of short-segment atrial fibrillation within 1 minute.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of atrial fibrillation detection, and more specifically, relates to an automatic atrial fibrillation detection system and a detection method. Background Art

[0002] Atrial fibrillation, or AF, is the most common clinically diagnosed cardiac arrhythmia, characterized by rapid, irregular beating of the atria. Palpitations are the primary symptom of AF, and severe cases are often accompanied by complications such as thromboembolism, stroke, and heart failure. AF is a progressive disease, and early intervention plays a crucial role. Maintaining sinus rhythm and minimizing the burden of AF are crucial. Early rhythm control in AF patients can help reduce hospitalizations, strokes, and mortality. Therefore, early diagnosis and appropriate intervention can help restore normal heart rhythm and reduce the risk of complications. Electrocardiogram (ECG) signals recorded by an electrocardiograph are an important initial screening tool for clinical detection and diagnosis of AF. However, because AF is intermittent in its early stages, it can be difficult for doctors to detect it in long-term, high-volume Holter monitoring, leading to missed diagnoses. Therefore, early detection of AF is an urgent challenge.

[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 between 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 response to the above defects or improvement needs of the prior art, the present invention provides an automatic atrial fibrillation detection system, training method and detection method to solve the problem that the prior art cannot accurately detect atrial fibrillation.

[0005] To achieve the above objectives, in a first aspect, the present invention provides an automatic atrial fibrillation detection system, 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 set between two adjacent encoders; the decoding structure in the encoding-decoding structure includes: N cascaded decoders, and an upsampling module is set 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 composed of RR interval values ​​extracted from the 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 of and Relative to Correlation characteristics of

[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 it 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 it 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 after 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 includes: 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 temporal 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 feature of the Ni-th RR interval decoding feature is decoded to obtain the N-i+1-th RR interval decoding feature.

[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 atrial fibrillation detection system, and training the automatic atrial fibrillation detection system by minimizing the training loss;

[0023] 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 automatically detecting 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 the processor executes the method for automatic detection of atrial fibrillation provided in the second aspect of the present invention when executing the computer program.

[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 atrial fibrillation detection system, the input of which includes an ECG signal to be tested 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 tested; the ECG signal to be tested, which provides fine-grained information and a shorter time, and the RR interval sequence to be tested, which provides coarse-grained information and a longer time, fully complement each other; on this basis, the ECG feature extraction module and the RR interval feature extraction module are used to extract multi-level features of the ECG signal to be tested and the RR interval sequence respectively; the feature fusion module including the multi-level cross attention module not only fully utilizes the multi-level features of the ECG signal to be tested and the RR interval sequence, but also fully utilizes the multi-level features of the ECG signal to be tested and the RR interval sequence. The multi-level features of the R interval sequence have temporal multi-scale characteristics, and the low-level features have relatively rich detail information, while 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 them at the channel and spatial levels, thereby further improving the feature characterization capability.

[0036] 4. Furthermore, in the atrial fibrillation automatic 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 representation capability. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A schematic structural diagram 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 the cross-attention module provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0042] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely for the purpose of explaining 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 may be combined with each other as long as they do not conflict with each other.

[0043] To achieve the above objectives, in a first aspect, the present invention provides an automatic atrial fibrillation detection system, 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 set between two adjacent encoders; the decoding structure in the encoding-decoding structure includes: N cascaded decoders, and an upsampling module is set 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 composed of RR interval values ​​extracted from the 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 of and Relative to Correlation characteristics of

[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 it 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 it 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 after 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 embodiment, the N-i+1th decoder in the RR interval feature extraction module is used to The fusion feature of the Ni-th RR interval decoding feature is decoded to obtain the N-i+1-th RR interval decoding feature.

[0057] In an optional embodiment, 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 temporal 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 feature of the Ni-th RR interval decoding feature is decoded to obtain the N-i+1-th RR interval decoding feature.

[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 atrial fibrillation detection system, and training the automatic atrial fibrillation detection system 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 many 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 embodiment, the classifier can directly derive an atrial fibrillation detection result for the ECG signal under test based on a fusion of the Nth ECG decoding feature and the Nth RR interval decoding feature. The fusion method is not limited, but concatenation is preferred. The classifier can be a fully connected layer, SVM, convolutional layer, Dense layer, MLP layer, linear layer, etc., without limitation here.

[0068] In another optional embodiment, 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; and 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 are not limited here.

[0069] In order to further illustrate the automatic atrial fibrillation detection system provided by the present invention, a specific embodiment is described below in detail:

[0070] 1) Obtain the training set.

[0071] R peak detection and RR interval extraction:

[0072] First, the original ECG signal (electrocardiogram) is collected, R wave detection is performed on the original ECG signal, the R wave moment of each heartbeat in the ECG signal is extracted, its RR interval value is calculated, and the corresponding RR interval sequence is obtained.

[0073] Optionally, in this embodiment, the extraction of RR intervals is completed by a mature commercial device (DMS CardioSca12 Satellite System, USA, a Holter 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. In this way, 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 are obtained; multiple pairs of ECG signal samples and RR interval sequence samples together constitute a training set, and the corresponding labels are the actual results of atrial fibrillation detection of 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. Because the original signal lengths 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 three shorter global ECG signal segments of 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 provided between two adjacent encoders; in this embodiment, a 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 provided 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 results of the encoding-decoding structure are 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; as shown in Figure 3 As shown in FIG, the bidirectional LSTM is composed of two LSTMs in opposite directions. 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 perform parallel feature extraction at each level, leveraging both the spatial features and channel information of the ECG signal. In the RR interval feature extraction module, the encoder and bidirectional LSTM perform parallel feature extraction at each level, leveraging both the spatial features and temporal information of the RR interval sequence. The max pooling layer halves the length of the features, achieving downsampling; the decoder performs upsampling, and the extracted features are concatenated 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 each essential feature 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 decoder are two cascaded convolution modules; Figure 4 As shown in the figure, the convolution module consists of a cascaded convolutional layer (conv), a batch normalization layer (BN), a ReLu activation layer, and a Dorpout layer. By stacking two convolutional modules, more complex and advanced features can be extracted, which is conducive to capturing basic information from the input data.

[0086] During the encoding phase, the convolution kernels of the convolutional modules are doubled and the feature length is halved using a Maxpool layer with a stride of 2. During the decoding phase, the encoding process is reversed, with upsampling layers used to double the feature length, allowing the extracted features to be serially connected. To improve the robustness of the model, a Dropout layer is added after each convolutional module in the decoding phase.

[0087] The classifier consists of 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 and second fully connected layers respectively implement mapping and classification of ECG signal samples and RR interval sequence samples, and the fused classification results are obtained 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 the short, detailed ECG information and the long, coarse RR interval information is learned, thereby effectively fusing fine-grained and coarse-grained information. This information is then fed into the decoders corresponding to the ECG feature extraction module and the RR interval feature extraction module, respectively, to improve the classification capabilities of each decoder. Finally, the fused classification result is obtained by decision fusion of the overlapping results of the ECG encoder and the RR interval encoder.

[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 an ECG signal sample represents 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 represents an atrial fibrillation signal. Combining these two probabilities ultimately determines the probability of whether the ECG signal sample represents an atrial fibrillation signal, resulting in the final atrial fibrillation detection result.

[0091] 3) Training of the automatic atrial fibrillation detection system

[0092] The above-mentioned automatic atrial fibrillation detection system is trained in the following ways:

[0093] The training set is input into the automatic atrial fibrillation detection system, and the automatic atrial fibrillation detection system 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 atrial fibrillation automatic detection system in batches. In the above formula, N represents the number of samples in a batch, y i Indicates 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 from this 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 as follows:

[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 features 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 realizing the complementarity of the feature information of the ECG signal and the RR interval sequence, and improving 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 automatically detecting 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 solutions are 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] To measure the effectiveness of the proposed temporal multi-scale automatic detection method for atrial fibrillation, a self-built dataset of 1,000 cases, specifically 700 cases of paroxysmal atrial fibrillation data and 300 cases of non-atrial fibrillation data, each sampled at 128 Hz for approximately one hour, was first divided into a training set and a test set in a ratio of 7:3. The training set consisted of 500 cases of paroxysmal atrial fibrillation data and 200 cases of non-paroxysmal atrial fibrillation data, and the remaining data served as the test set. Since it was necessary to evaluate the performance of the method on short-duration atrial fibrillation (atrial fibrillation lasting no more than one minute), a statistical analysis of the 700 cases of paroxysmal atrial fibrillation was performed, revealing a total of 500 cases with short-duration atrial fibrillation, of which 400 were in the training set and 100 in the test set.

[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 a sample. In order to evaluate the performance of this method in the detection of short-term atrial fibrillation, 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. The corresponding original ECG signal segments are then divided into three small segments according to the lengths of 22, 21, and 21 RR intervals, and the original signals are 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] Where 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. We also calculated the AUC metric (the area under the ROC curve and the coordinate axes) to measure the overall performance of the method.

[0117] First, the performance of the automatic atrial fibrillation detection system provided by the present invention (denoted as ERMNet) was evaluated on a self-built dataset and compared with the performance of the original signal single-modality model (the original signal ECG encoder-decoder was used as an independent network and trained using the original signal) and the RR interval single-modality model (the RR interval encoder-decoder was 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 ERMNet's RR interval decoding output 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 separate ECG single-modality model and the RR interval single-modality model. Compared with the ECG single-modality model, the accuracy rate increased by 1.4 percentage points, and the AUC increased from 0.978 to 0.991. Compared with the RR interval single-modality model, the accuracy rate increased by 0.7 percentage points, and the AUC increased from 0.982 to 0.991. Furthermore, compared to the ECG decoding output and the RR interval decoding output, the performance after decision fusion is slightly improved. Results on a self-built overall test set show that the ERMNet model slightly outperforms the ECG single-modality model and the RR interval single-modality model, demonstrating 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, we evaluated ERMNet's performance on a self-constructed short-duration atrial fibrillation test set, again comparing it to a single-modality model of the original signal and a single-modality model of the RR interval. Table 2 shows the performance comparison of ERMNet with single-modality models on the self-constructed short-duration atrial fibrillation test set. Table 2 shows that, compared to the single-modality ECG model and the single-modality RR interval model, ERMNet significantly improves on the self-constructed short-duration atrial fibrillation dataset, both for the individual outputs of the ECG and RR interval decoders and after decision fusion. Among them, the ECG decoding end output is better than the ECG single-modality 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 performance is also better than the RR interval single-modality 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-modality model and the RR interval single-modality 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 this invention can effectively combine the multi-time scale signal features of ECG and RR intervals, realize information complementarity, and improve detection accuracy, especially the detection accuracy of short-term atrial fibrillation.

[0121] Table 2. Performance comparison of ERMNet and single-modality models on the 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 fully complement the shorter ECG signal that provides fine-grained information with 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 the processor executes the method for automatic detection of atrial fibrillation provided in the second aspect of the present invention when executing the computer program.

[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 merely 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 scope of protection of the present invention.

Claims

1. An automatic atrial fibrillation detection system, 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 provided between two adjacent encoders; the decoding structure in the encoding-decoding structure includes: N cascaded decoders, and an upsampling module is provided 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 composed 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 of and Relative to Correlation characteristics of The N-i+1th decoder in the ECG feature extraction module is used to obtain and the Ni-th ECG decoding feature, and decode it 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 it 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 after 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 temporal 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 feature of the Ni-th RR interval decoding feature is decoded to obtain the N-i+1-th RR interval decoding feature.

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 actual 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 The invention comprises a computer program, which implements the steps of the method for automatic detection of atrial fibrillation according to claim 7 when executed by a processor.

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