Atrial fibrillation detection model training method, atrial fibrillation detection method, equipment and storage medium

The atrial fibrillation detection model training framework, which utilizes self-supervised pre-training and ensemble learning, addresses the issues of performance degradation across databases and scarcity of labeled data, achieving highly accurate and robust atrial fibrillation detection suitable for wearable devices.

CN121880924APending Publication Date: 2026-04-17SOUTHEAST UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SOUTHEAST UNIV
Filing Date
2025-12-16
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing deep learning-based atrial fibrillation detection models suffer from performance degradation when applied across databases, and the scarcity of high-quality labeled data leads to insufficient reliability and generalization ability of the detection results.

Method used

A training framework for atrial fibrillation detection models is adopted, which combines self-supervised pre-training and ensemble learning. The encoder is pre-trained on an unlabeled dataset using different self-supervised learning architectures. The prediction results of multiple sub-models are integrated by combining supervised fine-tuning and fusion models. The model combination method is adaptively adjusted using a meta-learner.

Benefits of technology

It improves the accuracy and robustness of atrial fibrillation detection, enhances the model's generalization ability, reduces reliance on high-cost labeled data, and adapts to data scenarios of different devices and populations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121880924A_ABST
    Figure CN121880924A_ABST
Patent Text Reader

Abstract

The invention discloses an atrial fibrillation detection model training method, an atrial fibrillation detection method, equipment and a storage medium, and relates to the technical field of electrocardiosignal analysis, the method comprises the following steps: pre-training at least two to-be-trained encoders on a preset label-free data set by adopting different self-supervised learning architectures, the preset label-free data set comprises an electrocardiosignal without a label; respectively adding a preset classifier to be trained to each pre-trained encoder; performing supervised fine tuning on each to-be-trained sub-model on a preset tag data set, wherein the preset tag data set comprises electrocardiosignals with atrial fibrillation detection tags; and taking a feature vector obtained by combining the prediction probabilities output by the target sub-models as input data of a preset to-be-trained fusion model, and performing supervised training on a preset labeled data set to obtain an atrial fibrillation detection model. According to the invention, the accuracy, robustness and generalization ability of atrial fibrillation detection are improved, and the dependence on labeled data is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electrocardiogram signal analysis technology, and in particular to an atrial fibrillation detection model training method, an atrial fibrillation detection method, an atrial fibrillation detection model training device, an atrial fibrillation detection device, and a storage medium. Background Technology

[0002] Atrial fibrillation (AFib) is a common and serious arrhythmia that significantly increases the risk of stroke and other cardiovascular events. Early detection of AFib is crucial for preventing these complications and helping patients receive timely treatment. With the widespread adoption of wearable device technology, real-time, long-term acquisition of users' electrocardiogram (ECG) signals has become possible, bringing new opportunities for daily monitoring and early warning of AFib.

[0003] Currently, deep learning-based methods have become the mainstream technology for automatic atrial fibrillation detection. These methods, by training deep neural network models, can automatically learn complex patterns and features from electrocardiogram (ECG) signals, thereby achieving high-precision classification. However, existing technologies face two key challenges in practical applications: First, performance degradation across databases. Existing models are typically trained and optimized on a specific database (source domain). When applied to another database (target domain) from different devices, populations, and acquisition environments, their performance significantly degrades, severely impacting the reliability of detection results. This is essentially due to insufficient model generalization ability, making it difficult to adapt to differences in data distribution. Second, the scarcity of high-quality labeled data. Deep learning models typically rely on large amounts of labeled data for supervised training, while accurate labeling of ECG signals requires cardiovascular specialists, a costly and time-consuming process that severely limits model optimization and application.

[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0005] The main purpose of this application is to provide a training method for an atrial fibrillation (AF) detection model, an AF detection method, an AF detection model training device, an AF detection device, and a storage medium. The aim is to propose a training framework for an AF detection model based on self-supervised pre-training and ensemble learning, so as to improve the accuracy, robustness, and generalization ability of AF detection, while reducing the dependence on labeled data.

[0006] To achieve the above objectives, this application proposes a method for training an atrial fibrillation detection model, the method comprising: At least two pre-defined encoders to be trained are pre-trained on a pre-defined unlabeled dataset using different self-supervised learning architectures to obtain pre-trained encoders, wherein the pre-defined unlabeled dataset includes unlabeled electrocardiogram signals. Each of the pre-trained encoders is then added to a preset classifier to be trained, resulting in a sub-model to be trained. Each of the sub-models to be trained is subjected to supervised fine-tuning on a pre-defined labeled dataset to obtain each target sub-model. The pre-defined labeled dataset includes electrocardiogram signals labeled with atrial fibrillation detection. The feature vector obtained by combining the predicted probabilities of each target sub-model based on the same ECG signal output is used as the input data of the preset fusion model to be trained. The fusion model to be trained is supervised and trained on the preset labeled dataset to obtain the target fusion model. Each target sub-model and the target fusion model are used as the atrial fibrillation detection model.

[0007] Optionally, three encoders to be trained are pre-set, and the step of pre-training at least two pre-set encoders on a pre-set unlabeled dataset using different self-supervised learning architectures to obtain each pre-trained encoder includes: The three encoders to be trained were pre-trained on a pre-defined unlabeled dataset using BYOL, Simsiam, and MoCo self-supervised learning architectures, respectively, to obtain each pre-trained encoder.

[0008] Optionally, the fusion model to be trained is a Lightweight Gradient Boosting Machine (LightGBM). The step of using the feature vector obtained by combining the predicted probabilities of each target sub-model based on the same ECG signal output as the input data of the preset fusion model to be trained, and performing supervised training on the preset labeled dataset to obtain the target fusion model includes: Multiple first sample electrocardiogram signals and their corresponding atrial fibrillation detection labels are obtained from the pre-labeled dataset; For each of the first sample ECG signals, the first sample ECG signal is input into each of the target sub-models to obtain the prediction probability of each sub-model corresponding to the first sample ECG signal. The prediction probabilities of each of the sub-models corresponding to the same first sample ECG signal are combined to obtain a feature vector. The feature vector is then input into the fusion model to be trained to obtain the prediction probability of the fusion model corresponding to the first sample ECG signal. The fusion model loss is calculated based on the predicted probabilities of the fusion model corresponding to multiple ECG signals of the first sample and the atrial fibrillation detection label. The fusion model to be trained is optimized according to the fusion model loss to obtain the target fusion model.

[0009] Optionally, the step of pre-training at least two preset encoders on a preset unlabeled dataset using different self-supervised learning architectures to obtain each pre-trained encoder includes: Multiple second-sample electrocardiogram signals are obtained from the preset unlabeled dataset; For each of the second sample ECG signals, the second sample ECG signal is augmented using two different data augmentation methods to obtain an augmented signal pair corresponding to the second sample ECG signal. For each of the encoders to be trained, multiple pairs of the enhanced signals are used for pre-training to obtain the corresponding pre-trained encoder. Different self-supervised learning architectures are used for pre-training of different encoders to be trained.

[0010] Optionally, the step of performing data enhancement on the first sample ECG signal using two different data enhancement methods to obtain an enhanced signal pair corresponding to the first sample ECG signal includes: The first sample electrocardiogram signal is copied to obtain a sample signal pair; Two ECG signals in the sample signal pair are independently augmented with data augmentation methods from a set of data augmentation methods according to a preset probability to obtain an augmented signal pair corresponding to the first sample ECG signal. The set of data augmentation methods includes at least one of random cropping and resampling, Gaussian noise injection, time warp, amplitude scaling, and baseline drift.

[0011] Optionally, each of the encoders to be trained adopts the same encoder structure, which includes multiple stacked encoding modules. Each encoding module includes a convolutional layer, a batch normalization layer, a linear rectified activation function, a max pooling layer, a residual network unit, a global pooling unit, and a fully connected layer connected in sequence.

[0012] Furthermore, to achieve the above objectives, this application also proposes a method for detecting atrial fibrillation, the method comprising: Acquire the target electrocardiogram signal to be detected; The target ECG signal is input into each target sub-model in the atrial fibrillation detection model to obtain the preliminary prediction probability output by each target sub-model. The target feature vector is obtained by combining the preliminary prediction probabilities, and the target feature vector is input into the target fusion model in the atrial fibrillation detection model to obtain the atrial fibrillation detection result. The atrial fibrillation detection model was trained using the atrial fibrillation detection model training method described above.

[0013] In addition, to achieve the above objectives, this application also proposes an atrial fibrillation detection model training device, characterized in that the atrial fibrillation detection model training device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the atrial fibrillation detection model training method as described above.

[0014] In addition, to achieve the above objectives, this application also proposes an atrial fibrillation detection device, characterized in that the atrial fibrillation detection device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the atrial fibrillation detection method as described above.

[0015] In addition, to achieve the above objectives, this application also proposes a storage medium, characterized in that the storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the atrial fibrillation detection model training method as described above, or implements the steps of the atrial fibrillation detection method as described above.

[0016] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the atrial fibrillation detection model training method as described above, or implements the steps of the atrial fibrillation detection method as described above.

[0017] In this application, at least two pre-set encoders to be trained are pre-trained on a pre-set unlabeled dataset using different self-supervised learning architectures to obtain pre-trained encoders. The pre-set unlabeled dataset includes unlabeled electrocardiogram (ECG) signals. This allows the encoders to learn general feature representations of ECG signals that are not limited by specific databases through self-supervised learning, utilizing massive amounts of unlabeled ECG signal data. This fundamentally reduces the dependence on expensive labeled data, addressing the problem of scarce labeled data. Furthermore, each pre-trained encoder is added with a pre-set classifier to obtain a sub-model to be trained. Each sub-model is then fine-tuned in a supervised manner on a pre-set labeled dataset to obtain a target sub-model. This enables the use of limited ECG signal data with atrial fibrillation detection labels to... The general feature representation is adapted to the specific atrial fibrillation detection task, enabling the model to acquire preliminary discriminative ability. Finally, the feature vector obtained by combining the predicted probabilities of each target sub-model based on the same ECG signal output is used as input data for a pre-defined fusion model to be trained. Supervised training of the fusion model to be trained is performed on a pre-defined labeled dataset to obtain the target fusion model. The target sub-models and the target fusion model are then used as the atrial fibrillation detection model. This achieves the integration of multiple sub-models trained based on different self-supervised learning architectures, and the use of a meta-learner to adaptively learn the optimal combination. This allows the final model to combine the advantages of each sub-model to make more stable and reliable predictions when facing unknown data from different devices and populations (i.e., cross-database scenarios), effectively solving the problem of single-model performance degradation across domains. Based on this, the overall solution in this embodiment improves the accuracy, robustness, and generalization ability of atrial fibrillation detection, while reducing dependence on labeled data, providing support for the practical application of wearable devices in atrial fibrillation monitoring. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating the first embodiment of the atrial fibrillation detection model training method of this application. Figure 2 This is a schematic diagram of the model architecture involved in one embodiment of this application; Figure 3This is a schematic diagram of the encoder structure according to one embodiment of this application; Figure 4 This is a flowchart illustrating the third embodiment of the atrial fibrillation detection method of this application. Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application.

[0021] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0022] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0023] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0024] Currently, deep learning-based methods have become the mainstream technology for automatic atrial fibrillation detection. These methods, by training deep neural network models, can automatically learn complex patterns and features from electrocardiogram (ECG) signals, thereby achieving high-precision classification. However, existing technologies face two key challenges in practical applications: First, performance degradation across databases. Existing models are typically trained and optimized on a specific database (source domain). When applied to another database (target domain) from different devices, populations, and acquisition environments, their performance significantly degrades, severely impacting the reliability of detection results. This is essentially due to insufficient model generalization ability, making it difficult to adapt to differences in data distribution. Second, the scarcity of high-quality labeled data. Deep learning models typically rely on large amounts of labeled data for supervised training, while accurate labeling of ECG signals requires cardiovascular specialists, a costly and time-consuming process that severely limits model optimization and application.

[0025] This application aims to address the problem of decreased detection accuracy in existing technologies due to insufficient labeled samples and cross-domain differences. By comprehensively utilizing self-supervised feature pre-training and stacked ensemble learning, feature enhancement and cross-domain robust recognition of ECG signals are achieved. Through the development of feature representation techniques for ECG signals using self-supervised learning algorithms (such as BYOL, SimSiam, and MoCo), this framework can fully exploit large-scale unlabeled ECG signal resources and learn a representation model with cross-domain robustness. Finally, a stacked ensemble strategy is designed, using a meta-learner (such as LightGBM) to adaptively integrate the prediction results of multiple models, thereby improving detection accuracy and generalization ability. Experimental validation on multiple databases demonstrates significant performance advantages, providing a practical solution for the application of wearable devices in intelligent atrial fibrillation monitoring, with broad market prospects and clinical application value.

[0026] The following presents a first embodiment of the atrial fibrillation detection model training method of this application. (Refer to...) Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the atrial fibrillation detection model training method of this application. In this embodiment, the executing entity of the atrial fibrillation detection model training method can be a device with program execution capabilities, specifically a server, personal computer, mobile phone, or other general-purpose computing service device. In this embodiment, the atrial fibrillation detection model training method includes steps S10-S40: Step S10: At least two preset encoders to be trained are pre-trained on a preset unlabeled dataset using different self-supervised learning architectures to obtain each pre-trained encoder, wherein the preset unlabeled dataset includes unlabeled electrocardiogram signals.

[0027] An encoder is a deep neural network structure that functions similarly to a feature extractor, converting the raw electrocardiogram (ECG) signal waveform into a set of mathematical vectors that characterize its essential properties. A trainable encoder refers to an encoder network that has not yet been trained, with its network parameters randomly initialized or in a default state. At least two trainable encoders are pre-set; the structures used by these encoders can be the same or different, and the specific structures used are not limited in this embodiment.

[0028] The pre-set unlabeled dataset refers to a pre-configured dataset of unlabeled electrocardiogram (ECG) signals, including ECG waveform data collected from various sources such as wearable devices, without indicating whether atrial fibrillation has occurred. An ECG signal is a physiological electrical signal waveform generated by the electrical activity of the heart and recorded by electrodes on the body surface, changing over time. In one feasible implementation, a dataset containing a large number of unlabeled samples can be constructed from ECG signal data collected from multiple sources (e.g., various wearable devices) as the pre-set unlabeled dataset. To improve data quality, the raw acquired signals can be bandpass filtered to remove high-frequency noise and low-frequency drift, baseline drift correction can be performed to bring the signal baseline to zero, and signal normalization can be performed to scale the amplitude to a standard range. These operations remove noise interference, ensure signal quality, and provide stable input for subsequent training.

[0029] Self-supervised learning architecture refers to a machine learning framework that does not rely on external manual labeling. Instead, it designs specific learning tasks to allow the model to mine supervisory signals from the data itself for training. For each encoder to be trained, different self-supervised learning architectures are used for pre-training on a pre-defined unlabeled dataset. After pre-training, each encoder obtains a pre-trained encoder. Based on the self-supervised learning architecture, each pre-trained encoder learns discriminative temporal features related to atrial fibrillation in electrocardiogram signals, such as heartbeat morphology and rhythm patterns. Furthermore, because different self-supervised learning architectures are used, each encoder learns complementary feature representations from different angles and with different focuses. For example, some encoders may focus more on local waveform details, while others are better at capturing global rhythm contrasts. This diversity provides a foundation for subsequent model ensemble.

[0030] Step S20: Add a preset classifier to each of the pre-trained encoders to obtain a sub-model to be trained.

[0031] A classifier is a network structure used to map the feature vectors extracted by the encoder to specific atrial fibrillation classification results (such as normal or atrial fibrillation), such as a combination of fully connected layers. A classifier to be trained refers to a classifier whose parameters have not yet been trained. A corresponding classifier to be trained is pre-set for each pre-trained encoder. The structure of the classifiers for each pre-trained encoder can be the same or different; the specific structure used is not limited in this embodiment. For each pre-trained encoder, the corresponding pre-set classifier to be trained is added to the pre-trained encoder, that is, the classifier network layer is connected to the output of the encoder, forming a complete, end-to-end deep neural network model that can directly output classification predictions from the raw ECG signal. The resulting model is called the sub-model to be trained.

[0032] Step S30: Supervised fine-tuning is performed on each of the sub-models to be trained on a preset labeled dataset to obtain each target sub-model, wherein the preset labeled dataset includes electrocardiogram signals with atrial fibrillation detection labels.

[0033] A pre-defined labeled dataset refers to a pre-set dataset of electrocardiogram (ECG) signals labeled with atrial fibrillation (AF) detection tags. This includes ECG waveform data and corresponding expert-annotated AF detection tags. AF detection tags are identifiers used to indicate whether an ECG signal segment belongs to the AF category; for example, "1" represents AF and "0" represents no AF. The construction method for a pre-defined labeled dataset is similar to that of a pre-defined unlabeled dataset, involving signal acquisition from multiple sources and preprocessing to ensure quality. However, the key difference lies in the need for additional, precise signal annotation to generate the realistic labels required for supervised learning.

[0034] Supervised fine-tuning on labeled datasets refers to using a pre-defined labeled dataset and standard supervised learning algorithms, such as cross-entropy loss and gradient descent optimizers, to update the parameters of the sub-models to be trained, making their output predictions as close as possible to the actual atrial fibrillation detection labels. The sub-models to be trained after supervised fine-tuning are referred to as target sub-models for distinction. Each sub-model to be trained corresponds to a target sub-model. Through supervised fine-tuning, the target sub-models, based on the general and robust ECG feature representations obtained in the initial self-supervised learning, further optimize their decision boundaries for the specific binary classification task of atrial fibrillation detection, thereby significantly improving the model's accuracy in recognizing atrial fibrillation signals.

[0035] Step S40: The feature vector obtained by combining the predicted probabilities of each target sub-model based on the same ECG signal output is used as the input data of the preset fusion model to be trained. The fusion model to be trained is supervised and trained on the preset labeled dataset to obtain the target fusion model. Each target sub-model and the target fusion model are used as the atrial fibrillation detection model.

[0036] In this embodiment, to integrate the complementary advantages of different self-supervised methods, a stacking-based ensemble strategy is adopted, which uses a meta-learner to adaptively integrate the prediction results of multiple target sub-models, thereby improving the accuracy and generalization ability of atrial fibrillation detection.

[0037] The pre-set fusion model to be trained refers to a meta-learner used to integrate the prediction results of multiple target sub-models to make a final joint decision. For example, a gradient boosting decision tree model can be used. The structure of the pre-set fusion model to be trained can be set as needed and is not limited in this embodiment. After the target sub-models are trained, the fusion model to be trained is further trained. During training, a pre-set labeled dataset is used for supervised training. The feature vector obtained by combining the prediction probabilities of each target sub-model based on the same ECG signal output is used as the input data of the fusion model to be trained. That is, for each training sample in the pre-set labeled dataset, the training sample is input into each target sub-model. After processing by each target sub-model, its prediction probability of the sample belonging to the atrial fibrillation category is output. The prediction probabilities are combined to obtain a feature vector, which is input into the fusion model to be trained. After processing by the fusion model to be trained, a fused, final atrial fibrillation prediction probability is output. The loss is calculated by comparing this prediction probability with the real atrial fibrillation detection label corresponding to the training sample. The parameters of the fusion model to be trained are optimized based on the loss. After multiple rounds of iterative training, the trained fusion model (called the target fusion model for distinction) is finally obtained.

[0038] Finally, the individual target sub-models and the target fusion model are combined as a whole to form an atrial fibrillation detection model, which is used to detect atrial fibrillation in electrocardiogram signals.

[0039] In this embodiment, at least two pre-set encoders to be trained are pre-trained on a pre-set unlabeled dataset using different self-supervised learning architectures to obtain pre-trained encoders. The pre-set unlabeled dataset includes unlabeled electrocardiogram (ECG) signals. This allows the encoders to learn general feature representations of ECG signals that are not limited by specific databases, utilizing massive amounts of unlabeled ECG signal data through self-supervised learning. This fundamentally reduces the dependence on expensive labeled data, addressing the problem of scarce labeled data. Furthermore, each pre-trained encoder is added with a pre-set classifier to obtain a sub-model to be trained. Each sub-model is then fine-tuned in a supervised manner on a pre-set labeled dataset to obtain a target sub-model. This enables the use of limited ECG signal data with atrial fibrillation detection labels. By adapting general feature representations to specific atrial fibrillation (AF) detection tasks, the model gains preliminary discriminative ability. Finally, the feature vectors obtained by combining the predicted probabilities of each target sub-model based on the same ECG signal output are used as input data for a pre-defined fusion model to be trained. Supervised training of the fusion model is performed on a pre-defined labeled dataset to obtain the target fusion model. The target sub-models and the target fusion model are then used as the AF detection model. This approach integrates multiple sub-models trained on different self-supervised learning architectures and uses a meta-learner to adaptively learn the optimal combination. This allows the final model to leverage the strengths of each sub-model to make more stable and reliable predictions when facing unknown data from different devices and populations (i.e., cross-database scenarios), effectively solving the problem of single-model performance degradation across domains. Based on this, the overall solution in this embodiment improves the accuracy, robustness, and generalization ability of AF detection while reducing dependence on labeled data, providing support for the practical application of wearable devices in AF monitoring.

[0040] Based on the first embodiment described above, a second embodiment of the atrial fibrillation detection model training method of this application is proposed. In this embodiment, the content that is the same as or similar to that of the first embodiment can be referred to the above description and will not be repeated hereafter. In this embodiment, three encoders to be trained are pre-set. Step S10 includes S101: pre-training the three encoders to be trained on a pre-set unlabeled dataset using BYOL, Simsiam, and MoCo self-supervised learning architectures respectively, to obtain each pre-trained encoder.

[0041] In this embodiment, three self-supervised learning architectures—BYOL, Simsiam, and MoCo—are used to train three encoders. BYOL is a self-supervised learning method based on an online network and a target network architecture. Its core is to allow the online network to predict the output of the target network for different augmented views of the same signal, thereby learning features without explicit negative samples. Simsiam is a self-supervised learning method based on a simple Siamese network architecture. Its core is to learn feature representations by matching the predictor of one branch with the feature output of the other branch after a stopping gradient operation. MoCo is a momentum-contrast-based self-supervised learning method. Its core is to construct a large-scale contrastive learning task by maintaining a dynamic negative sample queue and a momentum-updated encoder to learn discriminative features. The advantage of using these three self-supervised learning architectures to train the encoders is that they can extract multi-level temporal features, thereby significantly improving the feature representation ability of ECG signals. Specifically, these three self-supervised learning architectures, starting from different learning objectives (such as prediction consistency, feature similarity, and contrastive discriminability), guide the encoder to discover complementary, multi-layered information in ECG signals. For example, BYOL excels at learning robust representations of high-level semantics, SimSiam excels at capturing feature tightness, and MoCo excels at establishing clear class distinction boundaries. By extracting multi-layered temporal features through these three self-supervised strategies, the feature representation ability of the finally trained atrial fibrillation detection model for ECG signals is significantly improved, thereby significantly enhancing the atrial fibrillation detection accuracy and generalization ability of the atrial fibrillation detection model.

[0042] In one feasible implementation, the fusion model to be trained employs Lightweight Gradient Boosting Machine (LightGBM). LightGBM is an efficient gradient boosting decision tree framework. Its core principle is to achieve extreme training speed and lower memory consumption while ensuring prediction accuracy through a series of technological innovations. In this implementation, LightGBM is used as the meta-learner to adaptively integrate the prediction results of multiple target sub-models, thereby improving the accuracy and generalization ability of atrial fibrillation detection. Step S40 includes S401~S404: Step S401: Obtain multiple first sample electrocardiogram signals and their corresponding atrial fibrillation detection labels from the preset labeled dataset.

[0043] A sample ECG signal refers to a single ECG signal data instance selected from the dataset for model training or testing. For example, it could be a 10-second ECG signal segment with 4000 sampling points (sampling rate: 400 sampling points / second). The sample ECG signal obtained from the pre-labeled dataset will be referred to as the first sample ECG signal for distinction.

[0044] Step S402: For each of the first sample ECG signals, input the first sample ECG signal into each of the target sub-models to obtain the prediction probability of each sub-model corresponding to the first sample ECG signal.

[0045] Reference Figure 2 For each first sample ECG signal, the following processing is performed: The first sample ECG signal is input into three target sub-models trained using the BYOL, SimSiam, and MoCo architectures. Each target sub-model processes the signal independently. The encoder in the target sub-model outputs a feature representation, which is then processed by the classifier in the target sub-model to output a probability value indicating that the signal is classified as atrial fibrillation. For example... These probability values ​​reflect the independent detection and judgment results of each target sub-model on the first sample ECG signal based on its own learned features.

[0046] Step S403: Combine the prediction probabilities of each sub-model corresponding to the same first sample ECG signal to obtain a feature vector, and input the feature vector into the fusion model to be trained to obtain the prediction probability of the fusion model corresponding to the first sample ECG signal.

[0047] Reference Figure 2 The multiple predicted probabilities obtained in step S402, for example Concatenate them in order to form a feature vector Then, this feature vector, representing the "voting opinions" of multiple models, is... The input is fed into the LightGBM fusion model to be trained. The LightGBM model consists of multiple decision trees, and its overall structure can be viewed as a function that processes the feature vector and ultimately outputs a fused prediction probability. The specific processing procedure for the LightGBM model can be found in the following expression:

[0048] in, In the LightGBM model, the first... A decision tree based on gradient boosting. For the corresponding weights, This is the Sigmoid function, used for binary classification output.

[0049] Step S404: Calculate the fusion model loss based on the fusion model prediction probability corresponding to multiple first sample electrocardiogram signals and the atrial fibrillation detection label; optimize the fusion model to be trained based on the fusion model loss to obtain the target fusion model.

[0050] The loss function of the LightGBM model needs to be calculated to guide its optimization. The loss function consists of two parts: one is a loss term that measures the difference between the predicted and true values, such as the log loss function commonly used for binary classification problems; the other is a regularization term that controls model complexity and prevents overfitting. By minimizing this overall loss function, the LightGBM model is trained to learn how to optimally balance and integrate the information from the combination of probabilities predicted by the three target sub-models, thereby outputting a more accurate final prediction than any single target sub-model. The trained model obtained through this process is the target fusion model.

[0051] For example, the loss function of the LightGBM model can be:

[0052] Among them, among them, For binary log loss:

[0053] This is a regularization term for the tree structure, controlling the model complexity.

[0054] In this implementation, LightGBM acts as a meta-learner, automatically learning the complex nonlinear relationships between the predicted probabilities of different target sub-models. In practical applications, when faced with new data of unknown distribution (cross-database scenarios), the prediction confidence of each target sub-model may change. LightGBM can adaptively adjust the trust weights for different sub-models based on the real-time received prediction probability vector features. For example, it may place greater trust in the BYOL model's judgment under certain data features and greater trust in the MoCo model's judgment under other features. This dynamic and adaptive fusion mechanism effectively utilizes the complementarity of the three self-supervised representations, significantly improving the robustness and cross-domain generalization ability of the final atrial fibrillation detection model, enabling it to maintain stable high performance across different devices and population data.

[0055] In one feasible embodiment, step S10 includes S102 to S104: Step S102: Obtain multiple second sample electrocardiogram signals from the preset unlabeled dataset.

[0056] The sample ECG signals obtained from the preset unlabeled dataset are called the second sample ECG signals to distinguish them.

[0057] Step S103: For each second sample ECG signal, the second sample ECG signal is augmented using two different data augmentation methods to obtain an augmented signal pair corresponding to the second sample ECG signal.

[0058] By independently applying two random but potentially different data augmentation transformations to the same original electrocardiogram (ECG) signal, two augmented signals are obtained that differ in appearance but are completely identical in semantic content (i.e., the corresponding cardiac state). This augmented signal pair will be used as input for a self-supervised learning task, the goal of which is to teach the encoder to recognize that the two augmented signals originate from the same source.

[0059] Step S104: For each of the encoders to be trained, pre-training is performed using multiple pairs of the enhanced signals to obtain the corresponding pre-trained encoder. Different self-supervised learning architectures are used for pre-training of different encoders to be trained.

[0060] In one feasible implementation, for one of the encoders to be trained (hereinafter referred to as the first encoder for distinction), the first encoder is pre-trained using multiple enhancement signals according to the BYOL architecture. The BYOL architecture involves two networks: an online network and a target network, wherein the online network includes the encoder. Projector head and prediction head The target network includes an encoder. and projector head (Same structure as the encoder and projection head in the online network). The first encoder is the encoder in the online network. .

[0061] During training, for the enhanced signal pairs ( , ), to enhance the signal The feature representation of the encoder output is obtained through online network processing. The output of the projector head The output of the prediction head ; and enhance the signal therein The feature representation of the encoder output is obtained through processing by the target network. The output of the projector head Predicted output for online networks Projection output of the target network Perform L2 normalization to obtain and Calculate the mean square error (MSE) between the two normalized vectors as the loss; then swap the two enhancement signals, and... Processed through the target network, Process the loss through the online network, then calculate it again in the same way; the total loss is the average of the two losses; based on the total loss, update all parameters of the online network using gradient descent. ); Parameters of the target network ( Updated using an exponential moving average (EMA). After training: Discard the projection heads and prediction heads in both the target network and the online network, retaining only the encoder of the online network. This encoder That is, a pre-trained encoder.

[0062] In one feasible implementation, for one of the encoders to be trained (hereinafter referred to as the second encoder for distinction), the second encoder is pre-trained using multiple enhancement signals according to the SimSiam architecture. The SimSiam architecture involves an encoder, a projection head MLP(g), and a prediction head MLP(p). The two branches share the weights of the encoder and the projection head. The second encoder is the encoder of one of the branches.

[0063] During training, for the enhanced signal pairs ( , ), to enhance the signal Through encoding and projection head processing, the output z1=g(f( Then, through prediction head processing, p1=p(z1) is obtained; the enhanced signal is then... Through processing by the encoder and the projection head, the output z2=g(f( After L2 normalization of p1 and z2, the negative cosine similarity (i.e., the negative dot product) is calculated as the loss. Similarly, another loss is calculated symmetrically in the other direction (by swapping the roles of x1 and x2). The two losses are averaged to obtain the total loss. During loss calculation, a stop-gradient operation is performed on z2 (or z1 in the symmetrical case), treating it as a constant and not participating in gradient backpropagation. The parameters of the entire network (encoder, projector, and predictor) are updated using gradient descent based on the total loss, but due to the stop-gradient operation, the update is actually performed through only one branch. After training: the predictor is discarded, and the encoder is retained; this encoder is a pre-trained encoder.

[0064] In one feasible implementation, for one of the encoders to be trained (hereinafter referred to as the third encoder for distinction), the third encoder is pre-trained according to the MoCo architecture using multiple enhancement signals. The MoCo architecture involves a query encoder, a key encoder, and a queue. The key encoder has the same structure as the query encoder, but its parameters are updated via momentum. The queue stores the key features of previous batches. The third encoder is the query encoder.

[0065] During training, for the enhanced signal pairs ( , ), to enhance the signal The query feature q is obtained by querying the encoder and then performing L2 normalization on the result; the enhanced signal is then used to obtain the query feature q. The key features are processed by a key encoder, and the result is L2 normalized to obtain key features k. Previously stored negative key features are retrieved from the queue (assuming there are N negative samples in the queue). Using InfoNCE loss (similar to contrastive loss), k is treated as a positive sample, and the N key features in the queue are treated as negative samples; the similarity between q and these features is calculated. Based on the loss, gradient descent is used to update the parameters of the query encoder, while the parameters of the key encoder are updated via momentum. The key features k of the current batch are enqueued, while the earliest batch features are dequeued to maintain the queue size. After training: the key encoder and queue are discarded, and only the query encoder is retained; this query encoder is a pre-trained encoder.

[0066] In one feasible embodiment, step S103 includes S1031~S1032: Step S1031: Copy the first sample ECG signal to obtain a sample signal pair.

[0067] In other words, the sample signal pair includes two identical sample ECG signals. By replicating the same original ECG signal, it is ensured that the two subsequently generated enhanced signals have completely consistent intrinsic physiological meanings, providing a foundation for constructing positive sample pairs for self-supervised learning.

[0068] Step S1032: Apply data augmentation methods from the data augmentation method set independently to the two ECG signals in the sample signal pair according to a preset probability to obtain an augmented signal pair corresponding to the first sample ECG signal. The data augmentation method set includes at least one of random cropping and resampling, Gaussian noise injection, time warp, amplitude scaling and baseline drift.

[0069] The preset probability can be set as needed, for example, it can be set to 0.7. Data augmentation methods from the set of data augmentation methods are independently applied to the two ECG signals according to the preset probability. Specifically, for each ECG signal, it is determined whether to perform data augmentation according to the preset probability. If data augmentation is determined, a method is randomly selected from the set of data augmentation methods for alignment and augmentation. This method ensures the randomness and difference of the transformations of the two ECG signals.

[0070] The set of data augmentation techniques used aims to cover common real-world variations in ECG signals: random pruning and resampling simulates the random selection of the analysis window and heart rate variability by randomly truncating segments of the original signal and resampling them to a fixed length; Gaussian noise injection simulates random electronic noise in the acquisition process; temporal warping simulates natural heart rate fluctuations by non-linearly warping the signal along the time axis; amplitude scaling simulates differences in signal gain between individuals or leads; and baseline drift simulates slow baseline fluctuations caused by respiration or exercise. These transformations work together to generate augmented signal pairs that adequately simulate the variability of clinical scenarios, providing crucial data support for training a robust encoder.

[0071] In one feasible implementation, random cropping and resampling can be achieved by randomly cropping the ECG signal x according to a certain ratio and then resampling it through linear interpolation. The specific process is as follows: Let the original electrocardiogram signal be: The random sampling and cropping ratio is: , Randomly select the starting point. To obtain the cropped fragment Linear interpolation is performed on the sampled data, and it is resampled to a fixed length L (e.g., L = 4000 sample points). For the i-th resampled point, the following is defined: , i=0,1…,L-1.

[0072] The corresponding enhancement signal is:

[0073]

[0074] Gaussian noise injection can be used to inject ECG signals Add zero-mean Gaussian noise: .

[0075] Timing distortion can affect electrocardiogram signals Randomly select m anchor points on the timeline ( L represents the electrocardiogram (ECG) signal. The length (number of sampling points) is used to perturb the signal shape through nonlinear interpolation.

[0076] Amplitude scaling can be applied to electrocardiogram signals. Randomly scale the signal amplitude: .

[0077] Baseline drift can be a response to electrocardiogram signals Add a constant offset: .

[0078] In one feasible embodiment, each of the encoders to be trained employs the same encoder structure, which includes multiple stacked encoding modules. Each encoding module includes a convolutional layer (conv), a batch normalization layer (BN), a rectified linear activation function (ReLU), a max pooling layer (M-Pool), a residual network unit, a global pooling unit, and a fully connected layer (FC) connected in sequence. In a specific embodiment, refer to... Figure 3 The number of encoding modules can be set as needed, for example, eight encoding modules. Residual network units can be set up by stacking multiple ResNet residual networks, such as stacking two ResNets. The various modules of this encoder structure work together to form a powerful temporal feature extractor. Convolutional layers are the core of feature extraction, using one-dimensional convolutional kernels sliding along the time axis to capture local waveform patterns in ECG signals, such as QRS complexes. Batch normalization layers standardize the convolutional outputs, accelerating network training convergence and improving stability. Linear rectified activation functions introduce non-linear transformation capabilities to the network, enabling it to fit complex feature patterns. Max pooling layers perform downsampling, reducing data dimensionality while expanding the receptive field of subsequent layers and imparting some translation invariance to the features. Residual network units, by introducing skip connections, effectively alleviate the vanishing or exploding gradient problems common in deep network training, allowing the construction of deeper networks to learn more abstract and higher-level feature combinations, such as complete heartbeat cycle patterns or rhythm patterns composed of basic waveforms. The global pooling unit (usually global average pooling) aggregates the feature maps, which are still quite long in the time dimension after processing by all the preceding layers, into a fixed-length global feature vector, thus integrating the summary information of the entire input sequence. Finally, the fully connected layer further transforms and performs non-linear mapping on this global feature vector, outputting the final feature representation. The advantage of this structure is that it achieves progressive feature abstraction from local details to global semantics through layer-by-layer processing, making it very suitable for time-series data such as electrocardiogram signals. Its powerful feature extraction capability provides a foundation for the success of self-supervised pre-training, ensuring that the encoder can learn high-quality, information-rich feature representations, thereby supporting the high performance of the entire atrial fibrillation detection model. At the same time, the modular design also facilitates the adjustment of depth and width to adapt to different task requirements.

[0079] The following section presents a performance comparison analysis between the optimized atrial fibrillation (AF) detection model (referred to as the optimized model) trained using the training methods combining the implementation methods of the first and second embodiments, and existing publicly available models. The MIT-BIH AF dataset was used as the source domain labeled data, and the CPSC2021 dataset was used as the target domain test data to verify cross-domain performance. Accuracy (Acc), Precision (Pre), Recall (Rec), and F1 score were used to comprehensively evaluate the performance of both models. The MIT-BIH AF dataset is a high-quality, expert-labeled, small-scale standard dataset used for AF research, while the CPSC2021 dataset is a publicly available dataset derived from 12-lead Holter monitoring and 3-lead wearable devices, with a significantly larger data volume than the MIT-BIH AF dataset.

[0080] Table 1 below shows the performance of the XResNet1D50 model, trained in a supervised manner only on the MIT-BIH AF dataset, when directly applied to the four independent test sets of CPSC2021. The XResNet1D50 model is a variant of the ResNet (Residual Network) architecture, specifically designed for processing one-dimensional sequential signals such as ECG and audio.

[0081] Table 1 Test results of existing models

[0082] As shown in Table 1, the XResNet1D50 model exhibits a significant overall performance degradation across domains. While its F1 score on the source domain validation set is 99.80%, it drops to only 69.05%, 78.26%, 60.84%, and 82.84% on CPSC2021-datasets 1 / 2 / 3 / 4, respectively. The largest decrease is observed in dataset 3, indicating the most significant difference in performance between the dataset and the source domain. These results demonstrate that direct transfer learning models generally experience a performance decline in the target domain, and relying solely on source domain training is insufficient to achieve stable generalization performance, failing to meet the requirements for atrial fibrillation detection.

[0083] Table 2 below shows the performance of the optimized model trained on the CPSC2021-dataset1 dataset when applied to the other three independent test sets of CPSC2021.

[0084] Table 2 Test results of the optimized model

[0085] It should be noted that “SimSam”, “BYOL”, and “MoCo” in the second column of Table 2 refer to the target sub-models obtained based on the three architectures SimSam, BYOL, and MoCo in the optimization model.

[0086] As shown in Table 2, the optimized model outperformed the existing models in all tests, demonstrating top-tier overall performance across all test sets. On CPSC2021-dataset2, the optimized model achieved an F1 score of 91.75%, surpassing the best-performing single model on this dataset, SimSiam (91.30%). More importantly, its recall reached 96.26%, a 2.47 percentage point improvement over SimSiam (93.79%), effectively reducing the risk of missed diagnoses. On CPSC2021-dataset3, where the distribution differences were greatest, the optimized model achieved an F1 score of 93.32%, achieving the best overall performance. Although its recall (97.43%) was slightly lower than MoCo, its precision (89.54%) was significantly improved, achieving a better precision-recall balance. On CPSC2021-dataset4, the optimized model also demonstrated strong competitiveness with an F1 score of 93.67%.

[0087] Based on the first and / or second embodiments described above, a third embodiment of the atrial fibrillation detection method of this application is proposed. In this embodiment, content that is the same as or similar to the first and second embodiments described above can be referred to the above description and will not be repeated hereafter. The executing entity of the atrial fibrillation detection method described in this embodiment can be a device with program execution capabilities, specifically a server, personal computer, mobile phone, or other general computing service device, or a wearable device with electrocardiogram signal acquisition capabilities. (Refer to...) Figure 4 The atrial fibrillation detection method includes A10~A30: Step A10: Obtain the target electrocardiogram signal to be detected.

[0088] The target ECG signal refers to the raw ECG waveform data that needs to be automatically analyzed and interpreted for atrial fibrillation. In personal health management scenarios, the target ECG signal can originate from signals collected in real time by consumer-grade wearable devices such as smartwatches, smart bracelets, or dedicated ECG patches. In clinical auxiliary diagnosis or long-term monitoring scenarios, the target ECG signal can originate from signals collected by professional medical devices used in hospitals, such as multi-lead ECG machines, Holter monitors, or implantable circulatory recorders. Furthermore, in telemedicine or home care scenarios, the target ECG signal may also be collected via portable ECG monitors and uploaded to a cloud server. Before being input into the model, these signals undergo the same preprocessing procedures as during the training phase, such as bandpass filtering and baseline correction, to ensure the compatibility and quality of the input data format.

[0089] Step A20: Input the target ECG signal into each target sub-model in the atrial fibrillation detection model to obtain the preliminary prediction probability output by each target sub-model.

[0090] For an atrial fibrillation (AF) detection model trained using any of the above-described embodiments, the AF detection model can be deployed in devices requiring integrated AF detection functionality, such as the processor of a wearable device or a cloud server. During actual detection, the system inputs a single target ECG signal in parallel into multiple target sub-models included in the AF detection model. These target sub-models are independent neural network models pre-trained and fine-tuned using different self-supervised architectures (such as BYOL, SimSiam, and MoCo). Each target sub-model performs independent forward inference calculations on the target ECG signal based on its learned feature representations and outputs a confidence level indicating that the signal is diagnosed as AF. This is the preliminary prediction probability output by each target sub-model, and these preliminary prediction probabilities constitute a multi-faceted and diverse preliminary diagnostic opinion for the target ECG signal.

[0091] Step A30: Combine the preliminary predicted probabilities to obtain the target feature vector, and input the target feature vector into the target fusion model in the atrial fibrillation detection model to obtain the atrial fibrillation detection result.

[0092] The various preliminary predicted probabilities are combined and concatenated in a predetermined order to obtain a mathematical vector, called the target feature vector, for differentiation, for example, z_target=[P1, P2, P3]. This target feature vector is then input into the target fusion model in the atrial fibrillation detection model (e.g., a trained LightGBM meta-learner). The target fusion model processes and synthesizes the input feature vector through complex nonlinear decision rules, ultimately outputting a fused, unified prediction value. This output is typically a scalar probability value between 0 and 1, representing the final probability that the target ECG signal belongs to the atrial fibrillation category after being determined by the ensemble model. Depending on the actual application requirements, a classification threshold (e.g., 0.5) can be set to convert this probability value into a binary classification atrial fibrillation detection result, i.e., "atrial fibrillation" or "non-atrial fibrillation," thereby completing automatic diagnosis.

[0093] In this embodiment, since the atrial fibrillation detection model is trained using any of the above-described atrial fibrillation detection model training methods, and this model is used to detect atrial fibrillation in the target ECG signal, in practical applications, it can obtain atrial fibrillation detection results with higher cross-domain robustness and accuracy. Furthermore, when facing target ECG signals from new devices or new populations, or with distributions different from the training data, this method integrates the preliminary judgments of multiple complementary target sub-models, and performs adaptive weight adjustment and intelligent arbitration via the LightGBM fusion model. This effectively mitigates the biases or misjudgments that may arise from a single model, thus maintaining stable and reliable detection performance when facing changes in data distribution. This solves the core problem of poor cross-database generalization ability of existing models.

[0094] This application provides an atrial fibrillation detection model training device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the atrial fibrillation detection model training method in the above embodiment.

[0095] This embodiment also provides an atrial fibrillation detection device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the atrial fibrillation detection method in the above embodiment.

[0096] The following is for reference. Figure 5 It shows a schematic diagram of the structure of an atrial fibrillation detection model training device or atrial fibrillation detection device (collectively referred to as electronic device) suitable for implementing the embodiments of this application. Figure 5 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0097] like Figure 5As shown, the electronic device may include a processing unit 1001 (e.g., a DSP processor), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the electronic device. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: an input device 1007 including, for example, a microphone, an accelerometer, etc.; an output device 1008 including, for example, a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 allows the electronic device to communicate wirelessly or wiredly with other devices to exchange data. Although electronic devices with various systems are shown in the figures, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems may be implemented or possessed alternatively.

[0098] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0099] Compared with the prior art, the beneficial effects of the atrial fibrillation detection model training device and atrial fibrillation detection device provided in this application embodiment are the same as the beneficial effects of the atrial fibrillation detection model training method and atrial fibrillation detection method provided in the above embodiments, and will not be repeated here.

[0100] It should be understood that the various parts disclosed in the embodiments of this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0101] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the atrial fibrillation detection model training method or atrial fibrillation detection method in the above embodiments.

[0102] The computer-readable storage medium provided in this application embodiment may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0103] The aforementioned computer-readable storage medium may be included in the atrial fibrillation detection model training device or the atrial fibrillation detection device; or it may exist independently and not be assembled into the atrial fibrillation detection model training device or the atrial fibrillation detection device.

[0104] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the atrial fibrillation detection model training device or the atrial fibrillation detection device, cause the atrial fibrillation detection model training device or the atrial fibrillation detection device to perform the functions defined in the methods of the embodiments disclosed in this application.

[0105] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0106] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0107] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0108] The readable storage medium provided in this application embodiment is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-described atrial fibrillation detection model training method or atrial fibrillation detection method. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application embodiment are the same as the beneficial effects of the atrial fibrillation detection model training method or atrial fibrillation detection method provided in the above-described embodiments, and will not be repeated here.

[0109] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the atrial fibrillation detection model training method or the atrial fibrillation detection method described above.

[0110] Compared with the prior art, the beneficial effects of the computer program product provided in this application embodiment are the same as the beneficial effects of the atrial fibrillation detection model training method or atrial fibrillation detection method provided in the above embodiments, and will not be repeated here.

[0111] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A method for training an atrial fibrillation detection model, characterized in that, The training method for the atrial fibrillation detection model includes: At least two pre-defined encoders to be trained are pre-trained on a pre-defined unlabeled dataset using different self-supervised learning architectures to obtain pre-trained encoders, wherein the pre-defined unlabeled dataset includes unlabeled electrocardiogram signals. Each of the pre-trained encoders is then added to a preset classifier to be trained, resulting in a sub-model to be trained. Each of the sub-models to be trained is subjected to supervised fine-tuning on a pre-defined labeled dataset to obtain each target sub-model. The pre-defined labeled dataset includes electrocardiogram signals labeled with atrial fibrillation detection. The feature vector obtained by combining the predicted probabilities of each target sub-model based on the same ECG signal output is used as the input data of the preset fusion model to be trained. The fusion model to be trained is supervised and trained on the preset labeled dataset to obtain the target fusion model. Each target sub-model and the target fusion model are used as the atrial fibrillation detection model.

2. The atrial fibrillation detection model training method as described in claim 1, characterized in that, The step of pre-setting three encoders to be trained, and pre-training at least two of the pre-set encoders on a pre-set unlabeled dataset using different self-supervised learning architectures to obtain each pre-trained encoder includes: The three encoders to be trained were pre-trained on a pre-defined unlabeled dataset using BYOL, Simsiam, and MoCo self-supervised learning architectures, respectively, to obtain each pre-trained encoder.

3. The atrial fibrillation detection model training method as described in claim 1, characterized in that, The fusion model to be trained employs a lightweight gradient boosting machine (LightGBM). The step of using the feature vector obtained by combining the predicted probabilities of each target sub-model based on the same ECG signal output as the input data of the preset fusion model to be trained, and performing supervised training on the preset labeled dataset to obtain the target fusion model includes: Multiple first sample electrocardiogram signals and their corresponding atrial fibrillation detection labels are obtained from the pre-labeled dataset; For each of the first sample ECG signals, the first sample ECG signal is input into each of the target sub-models to obtain the prediction probability of each sub-model corresponding to the first sample ECG signal. The prediction probabilities of each of the sub-models corresponding to the same first sample ECG signal are combined to obtain a feature vector. The feature vector is then input into the fusion model to be trained to obtain the prediction probability of the fusion model corresponding to the first sample ECG signal. The fusion model loss is calculated based on the predicted probabilities of the fusion model corresponding to multiple ECG signals of the first sample and the atrial fibrillation detection label. The fusion model to be trained is optimized according to the fusion model loss to obtain the target fusion model.

4. The atrial fibrillation detection model training method as described in claim 1, characterized in that, The step of pre-training at least two pre-defined encoders on a pre-defined unlabeled dataset using different self-supervised learning architectures to obtain each pre-trained encoder includes: Multiple second-sample electrocardiogram signals are obtained from the preset unlabeled dataset; For each of the second sample ECG signals, the second sample ECG signal is augmented using two different data augmentation methods to obtain an augmented signal pair corresponding to the second sample ECG signal. For each of the encoders to be trained, multiple pairs of the enhanced signals are used for pre-training to obtain the corresponding pre-trained encoder. Different self-supervised learning architectures are used for pre-training of different encoders to be trained.

5. The atrial fibrillation detection model training method as described in claim 4, characterized in that, The step of performing data enhancement on the first sample electrocardiogram signal using two different data enhancement methods to obtain an enhanced signal pair corresponding to the first sample electrocardiogram signal includes: The first sample electrocardiogram signal is copied to obtain a sample signal pair; Two ECG signals in the sample signal pair are independently augmented with data augmentation methods from a set of data augmentation methods according to a preset probability to obtain an augmented signal pair corresponding to the first sample ECG signal. The set of data augmentation methods includes at least one of random cropping and resampling, Gaussian noise injection, time warp, amplitude scaling, and baseline drift.

6. The atrial fibrillation detection model training method as described in claim 1, characterized in that, Each of the encoders to be trained adopts the same encoder structure, which includes multiple stacked encoding modules. Each encoding module includes a convolutional layer, a batch normalization layer, a linear rectified activation function, a max pooling layer, a residual network unit, a global pooling unit, and a fully connected layer connected in sequence.

7. A method for detecting atrial fibrillation, characterized in that, The atrial fibrillation detection method includes: Acquire the target electrocardiogram signal to be detected; The target ECG signal is input into each target sub-model in the atrial fibrillation detection model to obtain the preliminary prediction probability output by each target sub-model. The target feature vector is obtained by combining the preliminary prediction probabilities, and the target feature vector is input into the target fusion model in the atrial fibrillation detection model to obtain the atrial fibrillation detection result. The atrial fibrillation detection model is trained using the atrial fibrillation detection model training method described in any one of claims 1 to 6.

8. A training device for an atrial fibrillation detection model, characterized in that, The atrial fibrillation detection model training device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the atrial fibrillation detection model training method as described in any one of claims 1 to 6.

9. An atrial fibrillation detection device, characterized in that, The atrial fibrillation detection device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the atrial fibrillation detection method as described in claim 7.

10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the atrial fibrillation detection model training method as described in any one of claims 1 to 6, or implements the steps of the atrial fibrillation detection method as described in claim 7.