Atrial fibrillation prediction method and system based on free lead channel
By using neural network selection based on free lead channels and two-level ensemble Transformer feature fusion, the problem of predicting atrial fibrillation with few or any leads is solved, achieving high flexibility and high accuracy in real-world scenarios, and is suitable for multi-scenario applications.
Patent Information
- Application Number
- CN202610013330.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-07
- Publication Date
- 2026-02-03
AI Technical Summary
Existing technologies struggle to effectively predict atrial fibrillation in real-world scenarios using few or any leads, and traditional methods cannot handle missing leads or poor signal quality.
A method for predicting atrial fibrillation based on free lead channels is designed. The method automatically selects ECG lead channels through a neural network, uses a two-level ensemble Transformer for feature fusion and lead selection, and generates a global feature vector of the channel domain and attention weights to achieve atrial fibrillation prediction without a fixed 12-lead arrangement.
It improves the flexibility and usability of the model in real-world scenarios, maintaining high prediction accuracy even when some leads are missing or the signal quality is poor, and is suitable for various applications such as low-cost chest patches and smartwatches.
Smart Images

Figure CN121456433A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of atrial fibrillation prediction, and in particular to an atrial fibrillation prediction method and system based on a free lead channel. BACKGROUND
[0002] Atrial fibrillation (AF) is a common arrhythmia, mainly manifested as rapid and disordered electrical activity in the atrium, which leads to ineffective atrial contraction, affecting the normal filling of the ventricle and cardiac output. Atrial fibrillation not only significantly increases the risk of stroke, but also can cause serious complications such as heart failure, which has an important impact on mortality and disability.
[0003] Most current research relies on complete 12-lead electrocardiogram (ECG) signal input for prediction, but in actual daily application scenarios, due to device portability, patient compliance, and acquisition conditions, it is often difficult to obtain standard 12-lead data. Prediction models based on few-lead or even arbitrary lead combinations have more application value in actual scenarios, not only reducing device size, power consumption and cost, but also reducing the burden on patients when wearing.
[0004] However, there are relatively few methods that can handle arbitrary lead input. In the work that can handle arbitrary lead input, Liu et al. designed a K-MERL framework, which uses a dynamic lead masking strategy and a lead-aware neural network to handle arbitrary lead input. SUMMARY
[0005] To overcome the deficiencies of the prior art, the present application provides an atrial fibrillation prediction method and system based on a free lead channel, which automatically selects the connected electrocardiogram lead channel for atrial fibrillation prediction by designing a neural network, and completes atrial fibrillation prediction after channel screening, so that the model can complete atrial fibrillation prediction without relying on fixed 12-lead arrangement, significantly improving the flexibility and usability of the model in actual scenarios.
[0006] To achieve the above purpose, the following technical solutions are provided:
[0007] An atrial fibrillation prediction method based on a free lead channel, comprising the following steps:
[0008] S1, collecting and preprocessing the original ECG signals of each lead channel; extracting the time domain features and frequency domain features of the original ECG signals;
[0009] S2, inputting the frequency domain features and time domain features of each channel into a first-level set Transformer for time domain fusion to generate a multi-channel fusion feature set;
[0010] S3, fusing all channel features in the multi-channel fusion feature set using a second-level set Transformer with channel awareness to generate a channel domain global feature vector and channel attention weights; and screening dominant lead channels according to the channel attention weights;
[0011] S4, taking the ECG signals of the dominant lead channels as new inputs, and performing S1 to S3 again;
[0012] S5, inputting the newly generated channel domain global feature vector into a fully connected layer to generate a prediction result.
[0013] Preferably, the preprocessing in S1 includes:
[0014] A 50Hz notch filter is used to suppress power frequency interference, a Butterworth low-pass filter is used to suppress high-frequency components and partial electromyographic noise, a LOESS local regression smoothing method is used to estimate and remove baseline drift, and a non-local mean filter is used to weaken residual random noise.
[0015] Preferably, the extraction of the time domain features and the frequency domain features of the original ECG signal in S1 includes:
[0016] A sliding window technique is used to divide the continuous long-range ECG signal into ECG segments of fixed length; in each ECG segment, an R-wave detection algorithm is used to locate the R-wave peak position, and the time difference between adjacent R-waves is calculated to generate an RR interval sequence;
[0017] According to the RR interval sequence, the time domain features reflecting heart rate variability are extracted;
[0018] The ECG segment is converted to the frequency domain, and the frequency domain features of the f-wave frequency band and the P-wave frequency band are extracted.
[0019] Preferably, the frequency domain features include the spectral energy value, energy proportion, and spectral entropy of the f-wave frequency band and the P-wave frequency band.
[0020] Preferably, S1 further includes splicing or stacking the time domain features and the frequency domain features to generate a multi-dimensional feature vector as the input of the first-level set Transformer.
[0021] Preferably, S2 includes:
[0022] The time domain features and the frequency domain features of each channel at different times are encoded using a first-level set Transformer with input invariance to generate mapped initial time series features;
[0023] The initial timing features are input into an ISAB module in the first set Transformer for self-attention calculation to generate ISAB attention features;
[0024] The ISAB attention features are input into a PMA module in the first set Transformer for dimension reduction encoding to generate dimension reduction features;
[0025] The dimension reduction features corresponding to each lead channel are stacked, and after processing, the multi-channel fusion feature set is output.
[0026] Preferably, S3 comprises:
[0027] The ISAB module and the PMA module of the second set Transformer with input order invariance are constructed based on the multi-head Transformer;
[0028] The attention values of ECG segments of different channels at different times are accumulated in the attention sedimentation layer to generate an attention accumulation value;
[0029] The first N lead channels with the largest attention accumulation values are selected as the main lead channels;
[0030] The ECG signals of the main lead channels are input into the ISAB module of the second set Transformer for self-attention calculation between different channels to generate channel attention weights;
[0031] A channel domain feature kernel vector is defined, and the channel attention weights are dimensionally encoded by the PMA module of the second set Transformer to generate a channel domain global feature vector.
[0032] Preferably, in S3, an attention sedimentation layer is added to the PMA module of the second set Transformer network, described as:
[0033]
[0034] wherein, represents the attention value of a single ECG segment; N represents the batch size, and the input ECG signal is divided into batches input into the network, is the attention accumulation value after attention sedimentation.
[0035] Preferably, in S5, the fully connected layer comprises a nonlinear activation function for outputting an unnormalized classification score; the classification score is input into a Softmax function for normalization to generate a class prediction probability; the class prediction probabilities are compared, and the class label corresponding to the maximum class prediction probability is selected as the prediction result.
[0036] In a second aspect, a free-lead channel-based atrial fibrillation prediction system comprises:
[0037] A collection and feature extraction module is configured to collect and pre-process original ECG signals of each lead channel, and extract time-domain features and frequency-domain features of the original ECG signals.
[0038] A time-domain fusion module is configured to input the frequency-domain features and the time-domain features of each channel into a first set of Transformers for time-domain fusion to generate a multi-channel fusion feature set.
[0039] A channel fusion screening module is configured to fuse all channel features in the multi-channel fusion feature set using a second set of Transformers with channel awareness to generate a channel-domain global feature vector and channel attention weights, and screen a dominant lead channel according to the channel attention weights.
[0040] A network training module is configured to take the ECG signals of the dominant lead channel as new input of the collection and feature extraction module, and perform feature extraction, time-domain fusion and channel fusion screening again.
[0041] A prediction module is configured to input the newly generated channel-domain global feature vector into a fully connected layer to generate a prediction result.
[0042] The free-lead channel-based atrial fibrillation prediction system is used to implement the free-lead channel-based atrial fibrillation prediction method of the first aspect.
[0043] Compared with the prior art, the beneficial effects of the present application are as follows:
[0044] 1. Unlike the conventional technology that needs to rely on complete leads to capture the characteristics of atrial electrical activity disorder, the present application uses a feature extraction model designed for the time sequence characteristics of atrial fibrillation, i.e., "periodic irregularity, weak short-range correlation, and chaotic RR interval", so that even if there are only free leads or a few leads, the model can still identify the rhythm destruction pattern of AF precursor in advance.
[0045] 2. Unlike the model structure of the conventional technology that cannot handle missing leads, the present application uses a lead-aware feature fusion and adaptive weight distribution mechanism, so that it still maintains high prediction accuracy when some leads are missing or the signal quality is poor.
[0046] 3. The existing algorithm is different from the traditional technology, which is designed for specific devices, and the present application is suitable for multiple scenarios, can adapt to low-cost chest patches, smart watches or any collection lead, making the application scenario wider. BRIEF DESCRIPTION OF DRAWINGS
[0047] Figure 1 The method framework schematic diagram of embodiment 1 of the present application is shown in the figure;
[0048] Figure 2 The MAB module structure schematic diagram of embodiment 1 of the present application is shown in the figure;
[0049] Figure 3 The time domain set Transformer structure diagram of embodiment 1 of the present application is shown in the figure;
[0050] Figure 4 The network training flowchart of embodiment 1 of the present application is shown in the figure. DETAILED DESCRIPTION
[0051] In order to make the technical means, creative features, purposes and effects of the invention easy to understand, the present application will be further described in conjunction with specific figures. However, the present application is not limited to the following embodiments.
[0052] It should be noted that the structure, proportion, size, etc. shown in the drawings attached to the present specification are only used to cooperate with the content disclosed in the specification for understanding and reading by those skilled in the art, and do not define the limiting conditions for the implementation of the present application, so they do not have technical substantive significance. Any modification of structure, change of proportion relationship or adjustment of size, without affecting the effects and purposes that can be achieved by the present application, should still fall within the scope of the technical content disclosed by the present application.
[0053] Embodiment 1:
[0054] As shown in the figure, a free lead channel-based atrial fibrillation prediction method includes the following steps: Figure 1
[0055] S1, collect and pre-process the original ECG (electrocardiogram) signal of each lead channel; extract the time domain features and frequency domain features of the original ECG signal;
[0056] Specifically, the following steps are included:
[0057] S101, collect the original ECG signal from a multi-lead electrocardiogram device, each lead capturing different aspects of cardiac electrical activity;
[0058] S102, remove unnecessary frequency components from the original ECG signal, reduce random noise in the signal, make the signal have a uniform scale mark, make the signals of each channel of the ECG more smooth and clear, and improve the signal quality and prepare for subsequent processing;
[0059] The preprocessing specifically includes:
[0060] Power frequency interference suppression processing. First, a 50Hz notch filter is used to suppress power frequency interference and eliminate part of the interference caused by power supply noise;
[0061] Partial electromyographic noise interference suppression processing. Second, a Butterworth low-pass filter is used to suppress high-frequency components and partial electromyographic noise to improve the overall frequency domain quality of the signal;
[0062] Baseline drift elimination. Subsequently, the baseline drift is estimated and removed by the LOESS local regression smoothing method to restore the stable baseline level of the ECG;
[0063] Residual random noise reduction. Finally, non-local mean (NLM) filtering is used to reduce residual random noise to preserve waveform details while improving waveform signal-to-noise ratio;
[0064] S103, extracting time domain features and frequency domain features from the preprocessed original ECG signal.
[0065] The specific method is:
[0066] Signal segmentation and R-wave peak detection: sliding window technology is used to divide the continuous long-range ECG signal into fixed-length time segments (such as 10 seconds / segment). In each segment, the R-wave detection algorithm (such as Pan-Tompkins algorithm) is used to accurately locate the R-wave peak position, calculate the time difference between adjacent R-waves, and generate an RR interval sequence.
[0067] Extracting time domain statistical features: based on the generated RR interval sequence, extracting time domain features reflecting heart rate variability (HRV) for quantifying the absolute irregularity of atrial fibrillation.
[0068] Extracting frequency energy distribution features (for f-wave and P-wave abnormalities): performing fast Fourier transform (FFT) or calculating power spectral density (PSD) for each ECG segment to convert the signal to the frequency domain. The spectral energy value, energy proportion and spectral entropy of the low frequency band (such as 3Hz-10Hz, corresponding to the atrial fibrillation f-wave range) and P-wave frequency band are extracted.
[0069] Multi-dimensional feature vector construction: the extracted time domain features (heart rhythm features) and frequency domain features (waveform energy features) are spliced or stacked as the input of the subsequent first-level set Transformer.
[0070] S2, input the frequency domain features and time domain features of each channel into the first set Transformer for time domain fusion to generate a multi-channel fusion feature set;
[0071] Specifically, the following steps are included:
[0072] S201, using a set Transformer with input invariance to encode the time domain and frequency domain features of each channel at different time points, and outputting mapped initial time sequence features;
[0073] S202, the mapped initial time sequence features are subjected to self-attention calculation between T segments through an ISAB (Induced Set Attention Block) module, and ISAB attention features are outputted;
[0074] S203: the attention features are subjected to further dimension reduction coding on the output of the ISAB module through a PMA (Pooling by Multihead Attention) module, and dimension reduction feature representation is outputted;
[0075] S204: the dimension reduction features corresponding to each lead channel are stacked, and a multi-channel fusion feature set is outputted after time domain set Transformer processing.
[0076] The first set Transformer used in S2 has the following features:
[0077] F1: multi-head Transformer is adopted;
[0078] F2: the core of the set Transformer adopts a MAB (Multihead Attention Block) module;
[0079] F3: the encoding process of the set Transformer is completed through an ISAB module;
[0080] F4: the input features are converged to kernel vectors through a PMA module.
[0081] S3, using a second set Transformer with channel perception ability to fuse all channel features in the multi-channel fusion feature set, generating a channel domain global feature vector and channel attention weights; and screening dominant lead channels according to the channel attention weights;
[0082] Specifically, the following steps are included:
[0083] S301: an attention sedimentation layer is additionally added in the set Transformer network;
[0084] S302: The attention values of the ECG signal segments of each channel at different time points are accumulated in the attention sedimentation layer;
[0085] S303: After the accumulation is completed, a specific number of channels with the largest attention accumulation values are selected as the leading lead channels;
[0086] S304: After channel screening, only the leading lead channels are input, and the signal input of other channels is removed;
[0087] S305: A channel domain network module ISAB and PMA with input order invariance is constructed based on multi-head Transformer;
[0088] S306: The input is subjected to self-attention calculation between different channels through the ISAB module, and the attention weights of each channel are output;
[0089] S307: A channel domain feature kernel vector is defined, and the output of the ISAB module is further dimensionally encoded through the PMA module.
[0090] In the step of S3 of fusing the features of all channels using the set Transformer with channel perception ability, the set Transformer with channel perception ability used has the following characteristics relative to the set Transformer in S2, and the specific method is:
[0091] An attention sedimentation layer is additionally added based on the PMA module, and the mathematical description of the attention sedimentation layer is:
[0092]
[0093] Among them, represents the inter-channel attention of a single ECG segment; N represents the batch size, and the input ECG signal is divided into batch inputs into the network, is the inter-channel attention after attention sedimentation.
[0094] S4, the ECG signal of the leading lead channel is taken as a new input, and S1 to S3 are executed again;
[0095] The ECG signal of the screened channel is used to replace all channels in S1 as an input signal, and then the process of S1 to S3 is repeated. After reducing the input channels, the network is retrained according to the new input, so as to fuse the features of the selected channels;
[0096] S5, the newly generated channel domain global feature vector is input into the fully connected layer to generate a prediction result.
[0097] Specifically comprising the following steps:
[0098] S501, input the channel domain global feature vector output by the PMA module in S3 into the full connection layer. The full connection layer contains a weight matrix W and a bias term b, and maps the high-dimensional feature space to the sample space of the target category through linear transformation.
[0099] S502: introduce a nonlinear activation function (such as ReLU or GELU) in the full connection layer to enhance the model's fitting ability for complex nonlinear relationships, and output the unnormalized classification score.
[0100] S503: input the classification score into the Softmax function to convert the numerical value into a probability distribution. This step ensures that the sum of the predicted probabilities of all categories is 1, and the numerical value is between 0 and 1.
[0101] S504: compare the probability values of each category (such as atrial fibrillation, normal rhythm, and other arrhythmias) output by S503, and select the category label corresponding to the maximum probability value as the final prediction result.
[0102] After the ECG signal is preprocessed, the heart beat time is obtained by R wave detection and the heartbeat interval sequence is constructed; then the statistical features, time-frequency features and irregularity features reflecting rhythm changes are extracted in different length time windows, and a simple time series modeling method is used to obtain the rhythm change pattern; finally, the multi-scale features are fused to realize atrial fibrillation prediction.
[0103] The overall framework of the two-stage channel-aware Set Transformer (TCAST) proposed in the present application is shown in Figure 1 First, in view of the rhythm fluctuation enhancement, frequency energy diffusion and local fragment instability in the ECG before the onset of atrial fibrillation, the frequency band energy features of each ECG segment are extracted by fast Fourier transform. Then, the first-stage Set Transformer processes the time-domain and frequency-domain features in a period of time on each channel. Then, the second-stage channel-aware Set Transformer fuses the features of all channels and selects a few lead channels that play a leading role. Finally, the output of the second stage enters the full connection layer to obtain the prediction result of the risk of atrial fibrillation.
[0104] The Set Transformer removes the position encoding operation in the standard Transformer and builds a network module with input order invariance based on the multi-head attention module of the Transformer.
[0105] The calculation process of attention in the standard Transformer is as follows:
[0106]
[0107] where Q, K represent Query and Key respectively, and the dimension is ; V represents Value, and the dimension is In practical applications, the multi-head Transformer is more commonly used:
[0108]
[0109] where ; is a matrix used to fuse the outputs of multiple Transformers together. Specifically, MultiHead(·,·,·;λ) has learnable parameters , where . and are the dimensions of Key and Value in a single Transformer, is the dimension of the Multihead output, is the number of multi-head network heads. In the present application, is set to 8. The core of the ensemble Transformer is the MAB module (Multihead Attention Block). The MAB module is a derivative network based on the multi-head Transformer. In the MAB module, the Key and Value input to the multi-head Transformer are the same:
[0110]
[0111] where Conv represents a one-dimensional convolutional network.
[0112] After adding the feedforward connection, MultiHeadMAB forms MAB:
[0113] MAB(X,Y)=LayerNorm(H+Relu(ConvH(H)))
[0114] where H=LayerNorm(X+MultiHeadMAB(X,Y)). The overall structure of MAB is shown in Figure 2 .
[0115] In order to reduce the amount of calculation, the encoding process of the ensemble Transformer is completed through the ISAB module (InducedSetAttentionBlock):
[0116]
[0117] where I∈ is the component of ISAB, representing m trainable tensors of d dimensions; X∈ represents n input of d dimensions. By introducing ISAB, the complexity of this part of self-attention calculation is reduced from O(n2) to O(m·n), where m is the number of artificially defined tensors I, and is less than n.
[0118] The output of the above set Transformer autoencoder is denoted as Z∈Rn×d, and k seed vectors S∈Rk×d are defined, and the convergence of input features to seed vectors is completed by PMA (Pooling by Multihead Attention) module:
[0119] PMAk(Z)=MAB(S,rFF(Z))
[0120] Where rFF refers to a row-wise feedforward layer, which is a one-dimensional convolution layer in the present application; k is the number of output vectors, which is set to 1 in the present application.
[0121] Because the ECG data fluctuates greatly, and the information contained in different time points is also different, the prediction based on the relatively long ECG data will be more accurate and robust. In the present application, the length of ECG data input into the network is 38 seconds. The power spectral density (PSD) is extracted from the data every two seconds using fast Fourier transform to obtain 19 groups of frequency band energy distribution features from different time points.
[0122] The inventors believe that the ECG data at different time points contains different information useful for predicting atrial fibrillation, and the order of inputting features of different time periods into the network has little effect on predicting the onset of atrial fibrillation. Therefore, a set Transformer with input invariance can be used to encode the input features at different time points. The first level of time domain set Transformer structure is as shown in Figure 3 .
[0123] The input of the first level is the frequency band energy distribution features extracted from each channel. The input of a certain specific channel i can be represented as , where is the dimension of the frequency band energy distribution feature, which is 44 in the present application; T represents the number of input ECG signal segments, which is set to 19 in the present application. Because the length of each segment is 2 seconds, each prediction is based on an ECG signal of 38 seconds in length.
[0124] Firstly, the input is processed by an ISAB module for self-attention calculation among T segments. Here, the number of self-attention kernel vectors in the ISAB is set to 3, so the complexity of this part of self-attention calculation is O(3·T). Then, a time domain feature kernel vector is defined, and the output of the ISAB module is further dimensionally encoded by a PMA module. The whole process can be represented by the formula:
[0125]
[0126] wherein, represents the feature output by the time domain set Transformer processing of the ith lead channel.
[0127] The first level network needs to calculate the self-attention of different time periods, and in the second level, the input of the channels not selected by the algorithm will be removed, so there is no need to calculate the self-attention distribution among all channels again. First, similar to the first level, a PMA module is needed to complete the dimension reduction of the input.
[0128]
[0129] Different from the ordinary PMA module, in order to select the dominant lead channel, the attention distribution result of the second level needs to be explicitly output as a result. It is found in the experiment that the attention weight allocated to each lead channel at different times is very different, whether in the process of network training or reasoning. The attention distribution of each lead channel fluctuates sharply with time, which may cause the dominant lead channel to be submerged. Therefore, the application designs a set Transformer with channel perception ability, which is characterized by additionally adding an attention sedimentation layer based on the PMA module. The mathematical description of the attention sedimentation layer is:
[0130]
[0131] wherein, represents the inter-channel attention of a single ECG segment; N represents the batch size, and the input ECG signal is divided into batch inputs into the network; is the inter-channel attention after attention sedimentation
[0132] Although the attention fluctuates greatly at each time point, the attention weight assigned to each channel gradually converges in the sedimentary layer as the number of ECG segments increases, and the dominant channels are found. If the channel screening is successful, the signal input of other channels can be removed, and only the signal of the dominant channels is input. Due to the network structure characteristics of the ensemble Transformer, when the input channel is reduced, no modification is needed for the network structure. However, because the input changes after channel selection, the network needs to be retrained to further improve the network's ability to predict the risk of atrial fibrillation through the signals of these channels. The whole network training process is shown in Figure 4 , where CAST represents the ensemble Transformer network at each level.
[0133] Embodiment 2
[0134] A free-lead channel-based atrial fibrillation prediction system comprises:
[0135] A collection and feature extraction module is configured to collect and pre-process the original ECG signals of each lead channel, extract the time domain features and frequency domain features of the original ECG signals.
[0136] A time domain fusion module is configured to input the frequency domain features and time domain features of each channel into the first-level ensemble Transformer for time domain fusion to generate a multi-channel fusion feature set.
[0137] A channel fusion screening module is configured to use the second-level ensemble Transformer with channel perception capability to fuse all channel features in the multi-channel fusion feature set to generate a channel domain global feature vector and channel attention weights, and screen the dominant lead channel according to the channel attention weights.
[0138] A network training module is configured to use the ECG signals of the dominant lead channel as the new input of the collection and feature extraction module, and perform feature extraction, time domain fusion and channel fusion screening again.
[0139] A prediction module is configured to input the newly generated channel domain global feature vector into a fully connected layer to generate a prediction result.
[0140] The above is only a preferred embodiment of the present application, and the protection scope of the present application is not limited to the above-mentioned embodiments. Any technical solutions falling within the scope of the present application should be considered within the protection scope of the present application. It should be noted that for ordinary skilled persons in the art, some improvements and refinements without departing from the principles of the present application should also be considered within the protection scope of the present application.
Claims
1. A method for predicting atrial fibrillation based on free lead channels, characterized in that, Includes the following steps: S1. Acquire and preprocess the raw ECG signals of each lead channel; extract the time-domain and frequency-domain features of the raw ECG signals; S2. Input the frequency domain features and time domain features of each channel into the first-level set Transformer for time domain fusion to generate a multi-channel fused feature set; S3. Use a second-level set Transformer with channel awareness to fuse all channel features in the multi-channel fusion feature set to generate a channel-domain global feature vector and attention weights for each channel; select the dominant lead channel according to the attention weights of each channel. S4. Using the ECG signal of the dominant lead channel as the new input, execute S1 to S3 again; S5. Input the newly generated channel domain global feature vector into the fully connected layer to generate prediction results.
2. The atrial fibrillation prediction method based on free lead channels according to claim 1, characterized in that, Preprocessing in S1 includes: The original ECG signal was subjected to a 50Hz band-notch filter to suppress power frequency interference; a Butterworth low-pass filter was used to suppress high-frequency components and some electromyographic noise; baseline drift was estimated and removed using the LOESS local regression smoothing method; and residual random noise was weakened using a nonlocal mean filter.
3. The atrial fibrillation prediction method based on free lead channels according to claim 1, characterized in that, The time-domain and frequency-domain features extracted from the original ECG signal in S1 include: The continuous long-range ECG signal is divided into fixed-length ECG segments using the sliding window technique; within each ECG segment, the peak position of the R wave is located using the R wave detection algorithm, the time difference between adjacent R waves is calculated, and the RR interval sequence is generated. Based on the RR interval sequence, extract the time-domain features reflecting heart rate variability; The ECG segments are converted to the frequency domain, and the frequency domain features of the f-band and P-band are extracted.
4. The atrial fibrillation prediction method based on free lead channels according to claim 3, characterized in that, The frequency domain features include the extraction of spectral energy values, energy percentages, and spectral entropy for the f-band and P-band.
5. The atrial fibrillation prediction method based on free lead channels as described in claim 1, characterized in that, S1 further includes concatenating or stacking the time-domain features and the frequency-domain features to generate a multi-dimensional feature vector, which is used as the input of the first-level set Transformer.
6. The atrial fibrillation prediction method based on free lead channels as described in claim 1, characterized in that, S2 include: The time-domain and frequency-domain features of each channel at different times are encoded using a first-level set Transformer with input invariance to generate the mapped initial time-series features; The initial temporal features are input into the ISAB module within the first-level set Transformer for self-attention calculation to generate ISAB attention features. The ISAB attention features are input into the PMA module within the first-level set Transformer for dimensionality reduction encoding to generate dimensionality reduction features. The dimensionality reduction features corresponding to each lead channel are stacked, and after processing, the multi-channel fused feature set is output.
7. The atrial fibrillation prediction method based on free lead channels as described in claim 1, characterized in that, S3 include: Based on the multi-head Transformer, construct the ISAB module of the second-level set Transformer and the PMA module of the second-level set Transformer with input order invariance; Attention values of ECG segments from different times in each channel are accumulated in the attention sedimentation layer to generate an attention accumulation value; The top N lead channels with the largest accumulated attention values are selected as the dominant lead channels; The ECG signal of the dominant lead channel is input into the ISAB module of the second-level set Transformer to perform self-attention calculation between different channels, and generate attention weights for each channel. Define a channel domain feature kernel vector, and use the PMA module of the second-level set Transformer to perform dimensionality reduction encoding on the attention weights of each channel to generate the channel domain global feature vector.
8. The atrial fibrillation prediction method based on free lead channels as described in claim 7, characterized in that, In S3, an attention sedimentation layer is added to the PMA module of the second-level ensemble Transformer network, described as follows: ; in, This represents the attention value for a single ECG segment; N represents the batch size, and the input ECG signal is divided into... One batch of inputs into the network, This is the accumulated value of attention after attention has settled.
9. The atrial fibrillation prediction method based on free lead channels as described in claim 1, characterized in that, In S5, the fully connected layer includes a non-linear activation function for outputting unnormalized classification scores; the classification scores are input into a Softmax function for normalization to generate prediction probabilities for each category; the prediction probabilities for each category are compared, and the category label corresponding to the largest prediction probability value for each category is selected as the prediction result.
10. An atrial fibrillation prediction system based on free lead channels, characterized in that, include: The acquisition and feature extraction module is used to acquire and preprocess the raw ECG signals of each lead channel, and extract the time-domain and frequency-domain features of the raw ECG signals. The time-domain fusion module is used to input the frequency domain features and time domain features of each channel into the first-level set Transformer for time-domain fusion to generate a multi-channel fused feature set; The channel fusion filtering module uses a second-level set Transformer with channel awareness to fuse all channel features in the multi-channel fusion feature set, generate a channel domain global feature vector and attention weights for each channel, and filter the dominant lead channel according to the attention weights of each channel. The network training module uses the ECG signal of the dominant lead channel as a new input to the acquisition and feature extraction module, and performs feature extraction, temporal fusion and channel fusion filtering again. The prediction module is used to input the newly generated channel domain global feature vector into the fully connected layer to generate prediction results; The aforementioned atrial fibrillation prediction system based on free lead channels is used to implement the atrial fibrillation prediction method based on free lead channels as described in claim 1.
Citation Information
Patent Citations
Method for obtaining artificial neural network weighted value matrix for identifying atrial fibrillation
CN106066933A
Long-sequence electrocardiosignal disease recognition system based on Transform architecture
CN120983046A
Method and system for determining cardiac abnormalities using chaos-based classification model from multi-lead ECG
US20240321450A1