Method for constructing cross-mechanism atrial fibrillation recurrence prediction model based on federated learning
By using a hierarchical federated learning framework and a multi-task base model, the problems of data silos and privacy security in cross-institutional atrial fibrillation recurrence prediction models are solved, and the secure integration and efficient prediction of multimodal data are achieved, generating an adaptive and stable atrial fibrillation recurrence prediction model.
Patent Information
- Application Number
- CN202511755863.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-02-24
AI Technical Summary
Cross-institutional atrial fibrillation recurrence prediction models suffer from problems such as data silos and privacy security conflicts, inconsistent data formats, insufficient model adaptability and generalization ability, and poor training and iteration reliability. In particular, privacy leaks and overfitting are prone to occur when integrating multimodal data and transmitting parameters.
A hierarchical federated learning framework is adopted, which performs data preprocessing through a federated metadata synchronization mechanism, builds a multi-task basic model, extracts multimodal features by combining deep residual networks, convolutional neural networks and Transformer encoders, introduces a federated distillation mechanism and encrypted adversarial examples for local training, dynamically calculates aggregate weights, and terminates iterations by using multi-index linkage to generate an adaptive prediction model.
It enables local standardized preprocessing and secure transmission of cross-institutional data, enhances the model's generalization ability and prediction accuracy, ensures the model's stability and consistency across institutions, and complies with medical privacy regulations.
Smart Images

Figure FT_1
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical and health data management technology, and more specifically, to a method for constructing a cross-institutional atrial fibrillation recurrence prediction model based on federated learning. Background Technology
[0002] Cross-institutional atrial fibrillation recurrence refers to the recurrence of atrial fibrillation in patients with atrial fibrillation after certain treatments during follow-up visits between different medical institutions. It is usually judged based on electrocardiogram monitoring results and symptom manifestations. Generally, a recurrence is considered to occur when an atrial fibrillation episode lasting more than 30 seconds occurs again more than 3 months after surgery.
[0003] Existing methods for constructing cross-institutional atrial fibrillation recurrence prediction models vary. Typically, this involves first collecting patient data from multiple institutions, including clinical characteristics, electrocardiogram data, and blood parameters. Then, statistical methods (or machine learning algorithms) are used for analysis to identify independent risk factors. Predictive models are then constructed based on these factors, and finally, the model's performance is evaluated using methods such as cross-validation. Therefore, this paper proposes a method for constructing a cross-institutional atrial fibrillation recurrence prediction model based on federated learning.
[0004] The existing technology has the following shortcomings, specifically: 1. Data silos across institutions conflict with privacy and security. Data formats and indicators from multiple institutions are inconsistent, and there is a lack of standardized synchronization mechanisms. Furthermore, the integration of data or the transmission of parameters across institutions can easily lead to the leakage of original data / gradient information. At the same time, the data quality varies, which affects the foundation of model training.
[0005] 2. Insufficient model adaptability and generalization ability: Most models do not deeply integrate multimodal data (structured, unstructured, and semi-structured), and lack data quality assessment, making it difficult to cope with cross-institutional data heterogeneity. Parameter aggregation uses fixed weights, and the contributions of high-quality data institutions are not fully reflected. 3. Poor reliability of model training and iteration. Local training does not combine global model collaborative optimization and lacks robust design against adversarial examples. Iteration is based on a single loss value for convergence and does not consider the accuracy stability and parameter consistency between institutions. It is prone to overfitting or poor cross-institutional adaptation. Summary of the Invention
[0006] The purpose of this invention is to provide a method for constructing a cross-institutional atrial fibrillation recurrence prediction model based on federated learning, so as to solve the problems mentioned in the background art.
[0007] To achieve the above objectives, the present invention aims to provide a method for constructing a cross-institutional atrial fibrillation recurrence prediction model based on federated learning, comprising: S1, system construction and data preprocessing: constructing a hierarchical federated learning framework consisting of a central coordination layer, an institutional node layer and an edge device layer, wherein each institutional node performs data preprocessing on multi-source heterogeneous atrial fibrillation patient data locally according to the federated metadata synchronization mechanism.
[0008] S2. Global Model Initialization and Distribution: The central coordination layer constructs a multi-task basic model, which integrates the main task of atrial fibrillation recurrence prediction and the auxiliary task of data quality assessment, and distributes the initialized global model parameters to each institutional node through an encrypted channel.
[0009] S3. Robust local training: Each institutional node uses the global model issued by the central government as the teacher model and the local model as the student model. The encrypted adversarial examples generated by the central government are combined with the local standardized data. Local training is carried out by minimizing the difference in the prediction distribution between the teacher model and the student model. After training is completed, the update amount of the local model parameters is calculated.
[0010] S4. Dynamic Encrypted Aggregation and Global Update: Each institutional node encrypts and digitally signs the model parameter updates obtained from local training and uploads them to the central coordination layer. The central coordination layer dynamically calculates the aggregation weight based on the data quality score and the number of valid samples of each institutional node. Then, a weighted federated average algorithm is used to aggregate the encrypted parameters to generate a new generation of global model.
[0011] S5. Multi-indicator linkage iteration: Repeat steps S3 to S4, and simultaneously monitor the global loss function value, the stability of prediction accuracy between institutions, and the consistency of parameters across institutions. When all three indicators meet the preset convergence conditions, the federated learning iteration process terminates.
[0012] S6. Adaptive Model Generation: The central coordination layer integrates the global model parameters from the final round to generate a cross-institutional adaptive atrial fibrillation recurrence prediction model for predicting the risk of recurrence after surgery.
[0013] As a further improvement to this technical solution, the multi-source heterogeneous atrial fibrillation patient data includes structured clinical feature data, unstructured electrocardiogram waveform data, and semi-structured blood test report data.
[0014] The structured clinical feature data includes patient age, patient gender, duration of atrial fibrillation, type of atrial fibrillation, comorbidity information, and treatment history information.
[0015] The unstructured electrocardiogram waveform data includes raw electrocardiogram waveform records containing multiple cardiac cycles, from which RR interval, QRS complex width, P wave duration, and waveform morphology features can be extracted.
[0016] The semi-structured blood test report data includes blood biochemical indicators, myocardial injury markers, inflammatory indicators, and abnormal test result annotation information.
[0017] As a further improvement to this technical solution, the multi-task basic model is specifically implemented as follows: A deep residual network is used to extract high-order features from structured tabular data, a one-dimensional convolutional neural network is used to extract local morphological features from unstructured waveform data, and a Transformer encoder is used to extract semantic features from semi-structured text data. The extracted high-order features, local morphological features, and semantic features are then unified to the same dimension through a federated feature alignment layer to construct a modal attention matrix.
[0018] The correlation weights between the three types of features are calculated based on the modal attention matrix. Based on the weights, cross-modal deep interaction is performed through the modal interaction layer and the feature integration layer to generate a global feature vector. The global feature vector is then input into the main task classification head and the auxiliary task regression head, respectively.
[0019] Based on the output of the main task classification head, the main task of atrial fibrillation recurrence binary classification is optimized with the cross-entropy loss function. Based on the output of the auxiliary task regression head, the auxiliary task of data quality assessment is optimized with the mean squared error loss function. The cross-entropy loss and the mean squared error loss are weighted and summed to obtain the multi-task basic model.
[0020] As a further improvement to this technical solution, the local training method by minimizing the difference in prediction distribution between the teacher model and the student model is as follows: the teacher model and the student model predict the samples in the local training dataset respectively, output the probability distribution vector of atrial fibrillation recurrence, which includes two probability values: recurrence and non-recurrence, and normalize the probability distribution using the Softmax function.
[0021] The difference in output probability distributions between the two models is calculated using the KL divergence loss function, as shown in the formula: ; in, Let P represent the KL divergence loss value, used to quantify the degree of difference between the predicted probability distributions of the teacher model and the student model. Let P represent the predicted probability distribution of the teacher model, Q represent the predicted probability distribution of the student model, and P(i) represent the teacher model's prediction of the i-th probability. The output probability of the class prediction result, Q(i), represents the student model's prediction of the first class. The output probability of the class prediction result The number indicates the type of prediction result.
[0022] Construct a joint training loss function by combining the cross-entropy loss of local data: ; in, This represents the joint loss value from local training. This represents the weighting adjustment coefficient. This represents the cross-entropy loss value.
[0023] The student model parameters are iteratively optimized using the backpropagation algorithm, with the goal of minimizing the joint loss function. The parameters are updated, and the decrease in the loss function is calculated after each training round. When the decrease in the loss function is less than a preset threshold for multiple consecutive rounds, the local single training is terminated, and the optimized student model parameters are output.
[0024] As a further improvement to this technical solution, the specific implementation method for calculating the update amount of local model parameters is as follows: based on the joint training loss function, the gradient values of the student model parameters and the corresponding gradient values of the teacher model parameters are solved by the backpropagation algorithm, the difference between the two is calculated, the gradient pruning mechanism is used to limit the difference to a preset range, and the pruned gradient difference is encrypted using a partial homomorphic encryption algorithm to generate an encrypted gradient tensor, which is then uploaded to the central coordination layer as the update amount of local model parameters.
[0025] As a further improvement to this technical solution, the specific method for dynamically calculating the aggregation weight is as follows: extract the data quality score and the number of verified valid samples uploaded by each institutional node; based on the data quality score and the number of verified valid samples uploaded by each institutional node, and based on the dynamic weight calculation formula, calculate the weight value of each institutional node in the parameter aggregation.
[0026] As a further improvement to this technical solution, the global loss function value is specifically implemented as follows: Extract the local joint loss value of each institutional node after each round of local training, extract the weight value of each institutional node in parameter aggregation, calculate the global loss function value based on the global loss function calculation formula, and calculate the global loss difference for consecutive preset rounds of iteration in the central coordination layer. When the global loss difference for consecutive preset rounds of iteration is less than the preset global loss difference threshold in the database, it is determined that the global loss function value meets the convergence condition.
[0027] As a further improvement to this technical solution, the stability of the inter-institutional prediction accuracy is specifically implemented as follows: After each round of local training, each institution node uses the local validation set to calculate the prediction accuracy of each institution based on the model prediction calculation formula. Each institution encrypts and uploads the calculated accuracy to the central coordination layer. After decryption, the central coordination layer calculates the mean and standard deviation of the accuracy of all institutions, and calculates the standard deviation for consecutive preset rounds of iteration. When the standard deviation for consecutive preset rounds of iteration is less than the preset standard deviation threshold in the database, it is determined that the stability of the inter-institutional prediction accuracy meets the convergence condition.
[0028] As a further improvement to this technical solution, the cross-institutional parameter consistency is specifically implemented as follows: each institution node uploads the locally trained model parameters; the central coordination layer performs dimensional alignment and standardization on all parameters, converting the model parameters of each institution into a one-dimensional parameter vector; simultaneously, the global model parameters of the current round are extracted and converted into a one-dimensional vector; the similarity between the parameter vectors of each institution and the global parameter vector is calculated based on the cosine similarity algorithm; and then the mean of the similarity of all institution parameters is calculated as the cross-institutional parameter consistency coefficient. The cross-institutional parameter consistency coefficient is iterated for a consecutive preset round. When the cross-institutional parameter consistency coefficients for a consecutive preset round are all greater than the preset cross-institutional parameter consistency coefficient threshold in the database, it is determined that the cross-institutional parameter consistency meets the convergence condition.
[0029] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. By using a hierarchical federated learning framework and a federated metadata synchronization mechanism, local standardized preprocessing and feature alignment of multi-institutional data can be achieved without transmitting the original data. At the same time, partial homomorphic encryption and digital signature technologies are used to ensure the security of parameter transmission, which maximizes the use of cross-institutional data and complies with medical privacy regulations.
[0030] 2. Construct a multi-task basic model that integrates the main task of "predicting atrial fibrillation recurrence" and the auxiliary task of "data quality assessment". Extract multimodal features and achieve cross-modal interaction through deep residual networks, one-dimensional convolutional neural networks and Transformer encoders respectively. Combine "data quality + effective sample size" to dynamically calculate aggregate weights, reduce interference from low-quality data and enhance the model's generalization ability.
[0031] 3. A federated distillation mechanism is introduced (with the global model as the teacher and the local model as the student), and local training is optimized by combining encrypted adversarial examples and KL divergence loss to ensure collaboration with the global model; the iteration is terminated by a multi-indicator linkage of "global loss value + inter-institutional accuracy stability + cross-institutional parameter consistency" to avoid the defects of a single indicator, and the generated adaptive model can stably and accurately predict atrial fibrillation recurrence in various institutions. Attached Figure Description
[0032] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0033] Figure 1 This is a schematic diagram of the implementation steps of the method of the present invention. Detailed Implementation
[0034] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0035] Example: Please refer to Figure 1 As shown, a method for constructing a cross-institutional atrial fibrillation recurrence prediction model based on federated learning is provided, including: S1, system construction and data preprocessing: constructing a hierarchical federated learning framework consisting of a central coordination layer, an institutional node layer and an edge device layer. Each institutional node performs data preprocessing on multi-source heterogeneous atrial fibrillation patient data locally based on the federated metadata synchronization mechanism.
[0036] In one specific embodiment, the multi-source heterogeneous atrial fibrillation patient data includes structured clinical feature data, unstructured electrocardiogram waveform data, and semi-structured blood test report data.
[0037] The structured clinical feature data includes patient age, patient gender, duration of atrial fibrillation, type of atrial fibrillation, comorbidity information, and treatment history information.
[0038] The unstructured electrocardiogram waveform data includes raw electrocardiogram waveform records containing multiple cardiac cycles, from which RR interval, QRS complex width, P wave duration, and waveform morphology features can be extracted.
[0039] The semi-structured blood test report data includes blood biochemical indicators, myocardial injury markers, inflammatory indicators, and abnormal test result annotation information.
[0040] The specific implementation of the federal metadata synchronization mechanism is as follows: the central coordination layer issues a unified metadata standard (including feature names, data types, dimension specifications, and encoding rules); each institutional node uploads its local data metadata information; the central layer identifies feature differences through metadata comparison, generates an adaptation scheme, and distributes it in encrypted form; each institution adjusts its local data structure according to the scheme to ensure consistency in feature dimensions and formats across institutions, and no original data is transmitted during the synchronization process. For structured clinical features, a multiple imputation method based on federated statistics is used to fill missing values, and outliers are identified using the federated interquartile range method and processed autonomously by the institutions. Classification features are uniformly encoded using federated one-hot encoding rules. For unstructured electrocardiogram waveforms, morphological and rhythmic features are extracted, and the sampling frequency and duration are unified through federated time-series alignment. The waveforms are then converted into frequency domain features through federated Fourier transform while retaining highly correlated frequency band information. For semi-structured blood test reports, key indicators and anomaly annotations are extracted using federated natural language processing, and non-standardized expressions are converted into standardized numerical ranges.
[0041] S2. Global Model Initialization and Distribution: The central coordination layer constructs a multi-task basic model, which integrates the main task of atrial fibrillation recurrence prediction and the auxiliary task of data quality assessment, and distributes the initialized global model parameters to each institutional node through an encrypted channel.
[0042] Encryption processing: Homomorphic encryption algorithm is used to encrypt the local model parameters. The key length is set according to the encryption security level. During the encryption process, the parameter matrix is divided into multiple vectors according to a preset method and encrypted separately to improve transmission efficiency.
[0043] Parameter transmission: The encrypted parameters are transmitted to the central server through an encrypted transmission protocol. During the transmission process, the data is processed in blocks, and the size of each block is set according to the transmission efficiency requirements. Checksums are used to verify the integrity of the data.
[0044] In one specific embodiment, the multi-task basic model is implemented as follows: a deep residual network is used to extract high-order features from structured tabular data, a one-dimensional convolutional neural network is used to extract local morphological features from unstructured waveform data, a Transformer encoder is used to extract semantic features from semi-structured text data, and the extracted high-order features, local morphological features and semantic features are unified to the same dimension through a federated feature alignment layer to construct a modal attention matrix.
[0045] The deep residual network, one-dimensional convolutional neural network, and Transformer encoder mentioned above are all existing technologies and will not be elaborated on here. The semi-structured text data here refers to the text of the semi-structured blood test report data.
[0046] The correlation weights between the three types of features are calculated based on the modal attention matrix. Based on the weights, cross-modal deep interaction is performed through the modal interaction layer and the feature integration layer to generate a global feature vector. The global feature vector is then input into the main task classification head and the auxiliary task regression head, respectively.
[0047] The calculation of the association weights among the three types of features based on the modal attention matrix is as follows: Input preparation: Three types of feature vectors with unified dimensions output from the federated feature alignment layer—structured data feature vectors. Waveform data feature vector Text data feature vectors — As input to the cross-modal feature interaction module.
[0048] Constructing the interaction matrix: Concatenate the three feature vectors to form a multimodal feature matrix. Multiply the matrix by the three trainable parameter matrices respectively. (corresponding to query, key, and value in the attention mechanism, respectively), generating the corresponding query matrix Q, key matrix K, and value matrix V. .
[0049] Calculate the attention score: An unnormalized attention score matrix is obtained by calculating the dot product of the query matrix and the key matrix. This score reflects the initial association strength between different modal features. Then, it is divided by a scaling factor (the square root of the key vector dimension). To stabilize the gradient.
[0050]
[0051] Generating the modal attention matrix and association weights: Performing a Softmax normalization operation on the attention score matrix above yields the modal attention matrix. The off-diagonal elements of this matrix directly represent the bidirectional association weights between any two modal features.
[0052] Weighting and Feature Fusion: The modal attention matrix is multiplied by the value matrix V to obtain a weighted fused feature representation. This result is then fed into subsequent modal interaction layers and feature integration layers for deeper cross-modal feature interaction, ultimately outputting a global feature vector.
[0053]
[0054] Based on the output of the main task classification head, the main task of atrial fibrillation recurrence binary classification is optimized with the cross-entropy loss function. Based on the output of the auxiliary task regression head, the auxiliary task of data quality assessment is optimized with the mean squared error loss function. The cross-entropy loss and the mean squared error loss are weighted and summed to obtain the multi-task basic model.
[0055] The cross-entropy loss function and mean squared error loss function mentioned are existing technologies and will not be elaborated upon here.
[0056] S3. Robust local training: Each institutional node uses the global model issued by the central government as the teacher model and the local model as the student model. The encrypted adversarial examples generated by the central government are combined with the local standardized data. Local training is carried out by minimizing the difference in the prediction distribution between the teacher model and the student model. After training is completed, the update amount of the local model parameters is calculated.
[0057] In one specific embodiment, the local training by minimizing the difference in prediction distribution between the teacher model and the student model is specifically implemented as follows: the teacher model and the student model predict the samples in the local training dataset respectively, output the probability distribution vector of atrial fibrillation recurrence, which includes two probability values: recurrence and non-recurrence, and normalize the probability distribution using the Softmax function.
[0058] The difference in output probability distributions between the two models is calculated using the KL divergence loss function, as shown in the formula: ; in, Let P represent the KL divergence loss value, used to quantify the degree of difference between the predicted probability distributions of the teacher model and the student model. Let P represent the predicted probability distribution of the teacher model, Q represent the predicted probability distribution of the student model, and P(i) represent the teacher model's prediction of the i-th probability. The output probability of the class prediction result, Q(i), represents the student model's prediction of the first class. The output probability of the class prediction result The number indicates the type of prediction result.
[0059] The specific implementation of the output probability distribution is as follows: based on the teacher model and the student model, forward propagation calculation is performed on the preprocessed training samples, and a probability distribution vector is generated in the output layer through the Softmax activation function; the vector dimension is consistent with the number of atrial fibrillation recurrence prediction categories, and the sum of the vector elements is 1.
[0060] The probability distribution vector is compressed to retain a preset number of decimal places (e.g., 4 digits) and converted into a floating-point array format.
[0061] The probability distribution array is encrypted using a federated encryption protocol to generate an encrypted probability tensor. During the encryption process, only the numerical values themselves are encrypted, while the vector dimension and structural information are preserved.
[0062] Each institutional node stores the encrypted student model probability distribution tensor and the teacher model probability distribution tensor (the centrally distributed version after local decryption) locally. This is used to calculate the KL divergence loss to optimize the student model. Only the encrypted student model probability distribution tensor is used as an intermediate result in subsequent parameter aggregation and correlation calculations, and the original probability values are not transmitted.
[0063] Construct a joint training loss function by combining the cross-entropy loss of local data: ; in, This represents the joint loss value from local training. This represents the weighting adjustment coefficient. This represents the cross-entropy loss value.
[0064] The student model parameters are iteratively optimized using the backpropagation algorithm, with the goal of minimizing the joint loss function. The parameters are updated, and the decrease in the loss function is calculated after each training round. When the decrease in the loss function is less than a preset threshold for multiple consecutive rounds, the local single training is terminated, and the optimized student model parameters are output.
[0065] The preset threshold can be dynamically set based on the heterogeneity of cross-institutional data and model training requirements, and the initial value is determined by prioritizing the statistical characteristics of historical loss fluctuations in federated training (such as the mean and standard deviation of the loss decrease in the previous N rounds).
[0066] The model training process also includes model performance monitoring. Specifically, the central server monitors the training progress of each local node in real time, including metrics such as the number of iterations, loss function value, and training duration, and displays them through a visual interface.
[0067] After each preset number of iterations, each local node uploads the model's performance metrics (AUC, accuracy, recall, precision) on the local validation set. The central server calculates the average and standard deviation of each metric and generates a performance report.
[0068] If an institution's model performance metrics fall below a preset percentage of the overall average for multiple consecutive iterations, the central server will send an early warning to that institution, prompting it to check data quality or training parameter settings.
[0069] After the prediction model is generated, it also includes model validation and updating. The specific implementation method is as follows: Model validation: adopts a multi-center validation method, each participating institution provides an independent test set, the sample size of the test set is not less than the preset proportion of the total local sample size, calculates the comprehensive performance index of the model on each test set, and passes the validation if the index requirements are met.
[0070] Model Update: Establish a regular update mechanism, collect data on newly added atrial fibrillation patients from various institutions according to a preset cycle, incrementally train the model according to the steps, and update the global model parameters.
[0071] Model Deployment: The validated prediction model is encapsulated as an API interface and made available to participating institutions. It supports both real-time prediction and batch prediction modes. The prediction results include the recurrence probability and risk level (high risk, medium risk, low risk, with the probability range for each risk level set according to clinical needs).
[0072] In one specific embodiment, the method for calculating the update amount of the local model parameters is as follows: Based on the joint training loss function, the gradient values of the student model parameters and the corresponding gradient values of the teacher model parameters are solved separately using the backpropagation algorithm. The difference between the two is calculated, and the sign and relative magnitude information of the difference are retained. The complete gradient value is not stored. A gradient pruning mechanism is used to limit the difference to a preset range to avoid gradient explosion. The pruned gradient difference is encrypted using a partially homomorphic encryption algorithm to generate an encrypted gradient tensor, which is then uploaded to the central coordination layer as the update amount of the local model parameters. Only this encrypted tensor is uploaded to the central coordination layer, without leaking the original gradient information.
[0073] The backpropagation algorithm, gradient pruning mechanism, and homomorphic encryption algorithm mentioned are existing technologies and will not be elaborated on here. The preset interval is set in combination with the gradient distribution characteristics of model parameters, cross-institutional data heterogeneity, and training stability requirements. The basic range is first determined by the gradient statistics of the initial rounds of federated training (such as the maximum value of the gradient difference in the first 5-10 rounds and the interquartile range).
[0074] S4. Dynamic Encrypted Aggregation and Global Update: Each institutional node encrypts and digitally signs the model parameter updates obtained from local training and uploads them to the central coordination layer. The central coordination layer dynamically calculates the aggregation weight based on the data quality score and the number of valid samples of each institutional node. Then, a weighted federated average algorithm is used to aggregate the encrypted parameters to generate a new generation of global model.
[0075] In one specific embodiment, the dynamic calculation of the aggregation weight is implemented by extracting the data quality score and the number of verified valid samples uploaded by each institutional node, and calculating the weight value of each institutional node in the parameter aggregation based on the data quality score and the number of verified valid samples uploaded by each institutional node and the dynamic weight calculation formula.
[0076] The calculation formula is: ; in, Indicates the first The weight values of each institutional node in parameter aggregation. Indicates the first Data quality score for each institutional node Indicates the first Effective sample size of each institutional node Indicates the number of the institutional node. This indicates the total number of institutional nodes.
[0077] S5. Multi-indicator linkage iteration: Repeat steps S3 to S4, and simultaneously monitor the global loss function value, the stability of prediction accuracy between institutions, and the consistency of parameters across institutions. When all three indicators meet the preset convergence conditions, the federated learning iteration process terminates.
[0078] In one specific embodiment, the global loss function value is specifically implemented as follows: extract the local joint loss value of each institutional node after each round of local training, extract the weight value of each institutional node in parameter aggregation, calculate the global loss function value based on the global loss function calculation formula, calculate the global loss difference for consecutive preset rounds of iteration by the central coordination layer, and determine that the global loss function value meets the convergence condition when the global loss difference for consecutive preset rounds of iteration is less than the preset global loss difference threshold in the database.
[0079] The formula for calculating the global loss function is as follows: ; in, This represents the global loss function value. Indicates the first The local joint loss value of each institutional node after local training is completed.
[0080] The global loss function value is calculated using the following formula: ; This refers to the current iteration round; The preset global loss difference threshold is set in combination with the cross-institutional data scale, model complexity and prediction accuracy requirements. The baseline value is first determined based on the fluctuation range of the global loss in the initial stage of federated training (e.g., the average of the global loss difference in the first 10-20 rounds is multiplied by a coefficient of 0.1-0.3).
[0081] In one specific embodiment, the stability of the inter-institutional prediction accuracy is specifically implemented as follows: After each round of local training, each institution node uses a local validation set (including patient data with known relapse results) to calculate the prediction accuracy of each institution based on the model prediction calculation formula. Each institution encrypts and uploads the calculated accuracy to the central coordination layer. After decryption, the central coordination layer calculates the mean and standard deviation of the accuracy of all institutions, calculates the standard deviation for consecutive preset rounds of iteration, and determines that the stability of the inter-institutional prediction accuracy meets the convergence condition when the standard deviation for consecutive preset rounds of iteration is less than the preset standard deviation threshold in the database.
[0082] The model prediction calculation formula is as follows: ; in, Indicates the first The prediction accuracy of each institutional node, Indicates the first The number of true positive samples (actual relapse and predicted relapse) at each institutional node. Indicates the first The number of true negative samples (actually no recurrence and predicted no recurrence) at each institutional node. Indicates the first The number of false positive samples (those that were predicted to relapse but did not actually relapse) at each institutional node. Indicates the first The number of false negative samples (actual relapse but predicted no relapse) at each institutional node.
[0083] The preset standard deviation threshold is set in combination with cross-institutional data heterogeneity, validation set size and clinical prediction accuracy requirements. The basic threshold range is first determined based on the fluctuation of accuracy of each institution in the initial stage of federated training (such as the mean of standard deviation in the first 10-15 rounds).
[0084] In one specific embodiment, the cross-institutional parameter consistency is implemented as follows: each institution node uploads its locally trained model parameters; the central coordination layer performs dimensional alignment and standardization on all parameters, converting the model parameters of each institution into a one-dimensional parameter vector; simultaneously, the global model parameters of the current round are extracted and converted into a one-dimensional vector; the similarity between the parameter vectors of each institution and the global parameter vector is calculated based on the cosine similarity algorithm; and then the mean of the similarity of all institution parameters is calculated as the cross-institutional parameter consistency coefficient. The cross-institutional parameter consistency coefficient is iterated for a consecutive preset number of rounds. When the cross-institutional parameter consistency coefficients for a consecutive preset number of rounds are all greater than the preset cross-institutional parameter consistency coefficient threshold in the database, it is determined that the cross-institutional parameter consistency meets the convergence condition.
[0085] The preset cross-institutional parameter consistency coefficient threshold is set in combination with the model parameter dimension, cross-institutional data heterogeneity and federated training collaboration requirements. The baseline interval (e.g., 0.75-0.85) is first determined based on the statistical results of cross-institutional parameter similarity in the initial rounds (e.g., the first 8-12 rounds).
[0086] S6. Adaptive Model Generation: The central coordination layer integrates the global model parameters from the final round to generate a cross-institutional adaptive atrial fibrillation recurrence prediction model for predicting the risk of recurrence after surgery.
[0087] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention.
Claims
1. A method for constructing a cross-institutional atrial fibrillation recurrence prediction model based on federated learning, characterized in that, include: S1. System Construction and Data Preprocessing: Construct a hierarchical federated learning framework consisting of a central coordination layer, an institutional node layer, and an edge device layer. Each institutional node performs data preprocessing on multi-source heterogeneous atrial fibrillation patient data locally based on the federated metadata synchronization mechanism. S2. Global Model Initialization and Distribution: The central coordination layer constructs a multi-task basic model, which integrates the main task of atrial fibrillation recurrence prediction and the auxiliary task of data quality assessment, and distributes the initialized global model parameters to each institutional node through an encrypted channel. S3. Robust local training: Each institutional node uses the global model issued by the central government as the teacher model and the local model as the student model. The encrypted adversarial examples generated by the central government are combined with the local standardized data. Local training is carried out by minimizing the difference in the prediction distribution between the teacher model and the student model. After training is completed, the update amount of the local model parameters is calculated. S4. Dynamic Encryption Aggregation and Global Update: Each institutional node encrypts and digitally signs the model parameter updates obtained from local training and uploads them to the central coordination layer. The central coordination layer dynamically calculates the aggregation weight based on the data quality score and the number of valid samples of each institutional node, and then uses a weighted federated average algorithm to aggregate the encrypted parameters to generate a new generation of global model. S5. Multi-indicator linkage iteration: Repeat steps S3 to S4, and simultaneously monitor the global loss function value, the stability of prediction accuracy between institutions, and the consistency of parameters across institutions. When all three indicators meet the preset convergence conditions, the federated learning iteration process terminates. S6. Adaptive Model Generation: The central coordination layer integrates the global model parameters from the final round to generate a cross-institutional adaptive atrial fibrillation recurrence prediction model for predicting the risk of recurrence after surgery.
2. The method for constructing a cross-institutional atrial fibrillation recurrence prediction model based on federated learning according to claim 1, characterized in that, The multi-source heterogeneous atrial fibrillation patient data includes structured clinical feature data, unstructured electrocardiogram waveform data, and semi-structured blood test report data; The structured clinical feature data includes patient age, patient gender, duration of atrial fibrillation, type of atrial fibrillation, comorbidity information, and treatment history information; The unstructured electrocardiogram waveform data includes raw electrocardiogram waveform records containing multiple cardiac cycles, from which RR interval, QRS complex width, P wave duration, and waveform morphology features can be extracted; The semi-structured blood test report data includes blood biochemical indicators, myocardial injury markers, inflammatory indicators, and abnormal test result annotation information.
3. The method for constructing a cross-institutional atrial fibrillation recurrence prediction model based on federated learning according to claim 2, characterized in that, The specific implementation method of the aforementioned multi-task basic model is as follows: A deep residual network is used to extract high-order features from structured tabular data, a one-dimensional convolutional neural network is used to extract local morphological features from unstructured waveform data, and a Transformer encoder is used to extract semantic features from semi-structured text data. The extracted high-order features, local morphological features and semantic features are then unified to the same dimension through a federated feature alignment layer to construct a modal attention matrix. The correlation weights between the three types of features are calculated based on the modal attention matrix. Based on the weights, cross-modal deep interaction is performed through the modal interaction layer and the feature integration layer to generate a global feature vector. The global feature vector is then input into the main task classification head and the auxiliary task regression head, respectively. Based on the output of the main task classification head, the main task of atrial fibrillation recurrence binary classification is optimized with the cross-entropy loss function. Based on the output of the auxiliary task regression head, the auxiliary task of data quality assessment is optimized with the mean squared error loss function. The cross-entropy loss and the mean squared error loss are weighted and summed to obtain the multi-task basic model.
4. The method for constructing a cross-institutional atrial fibrillation recurrence prediction model based on federated learning according to claim 3, characterized in that, The method for local training by minimizing the difference in prediction distributions between the teacher model and the student model is as follows: Based on the teacher model and student model respectively, the samples in the local training dataset are predicted, and the probability distribution vector of atrial fibrillation recurrence is output, which includes two probability values: recurrence and non-recurrence. The probability distribution is then normalized using the Softmax function. The difference in output probability distributions between the two models is calculated using the KL divergence loss function, as shown in the formula: ; in, Let P represent the KL divergence loss value, used to quantify the degree of difference between the predicted probability distributions of the teacher model and the student model. Let P represent the predicted probability distribution of the teacher model, Q represent the predicted probability distribution of the student model, and P(i) represent the teacher model's prediction of the i-th probability. The output probability of the class prediction result, Q(i), represents the student model's prediction of the first class. The output probability of the class prediction result The number indicating the type of prediction result; Construct a joint training loss function by combining the cross-entropy loss of local data: ; in, This represents the joint loss value from local training. This represents the weighting adjustment coefficient. This represents the cross-entropy loss value; The student model parameters are iteratively optimized using the backpropagation algorithm, with the goal of minimizing the joint loss function. The parameters are updated, and the decrease in the loss function is calculated after each training round. When the decrease in the loss function is less than a preset threshold for multiple consecutive rounds, the local single training is terminated, and the optimized student model parameters are output.
5. The method for constructing a cross-institutional atrial fibrillation recurrence prediction model based on federated learning according to claim 4, characterized in that, The specific implementation method for calculating the update amount of the local model parameters is as follows: Based on the joint training loss function, the gradient values of the student model parameters and the corresponding gradient values of the teacher model parameters are solved by the backpropagation algorithm. The difference between the two is calculated, and the gradient pruning mechanism is used to limit the difference to a preset range. The pruned gradient difference is encrypted using a partial homomorphic encryption algorithm to generate an encrypted gradient tensor, which is then uploaded to the central coordination layer as the local model parameter update.
6. The method for constructing a cross-institutional atrial fibrillation recurrence prediction model based on federated learning according to claim 5, characterized in that, The specific method for dynamically calculating its aggregate weight is as follows: Extract the data quality score and the number of verified valid samples uploaded by each institutional node. Based on the data quality score and the number of verified valid samples uploaded by each institutional node, calculate the weight value of each institutional node in the parameter aggregation using the dynamic weight calculation formula.
7. The method for constructing a cross-institutional atrial fibrillation recurrence prediction model based on federated learning according to claim 6, characterized in that, The global loss function value is specifically implemented as follows: Extract the local joint loss value of each institutional node after each round of local training, extract the weight value of each institutional node in parameter aggregation, calculate the global loss function value based on the global loss function calculation formula, and calculate the global loss difference for consecutive preset rounds of iteration in the central coordination layer. When the global loss difference for consecutive preset rounds of iteration is less than the preset global loss difference threshold in the database, it is determined that the global loss function value meets the convergence condition.
8. The method for constructing a cross-institutional atrial fibrillation recurrence prediction model based on federated learning according to claim 7, characterized in that, The stability of the inter-institutional prediction accuracy is specifically achieved as follows: After each round of local training, each institution node uses its local validation set to calculate its prediction accuracy based on the model prediction formula. Each institution then encrypts and uploads the calculated accuracy to the central coordination layer. The central coordination layer decrypts the data and calculates the mean and standard deviation of the accuracy of all institutions. It then calculates the standard deviation for a set number of consecutive iterations. If the standard deviation for a set number of consecutive iterations is less than the preset standard deviation threshold in the database, the stability of the prediction accuracy among institutions is determined to meet the convergence condition.
9. The method for constructing a cross-institutional atrial fibrillation recurrence prediction model based on federated learning according to claim 8, characterized in that, The specific implementation method for the cross-institutional parameter consistency is as follows: Each institutional node uploads its locally trained model parameters. The central coordination layer performs dimensional alignment and standardization on all parameters, converting each institution's model parameters into a one-dimensional parameter vector. Simultaneously, it extracts the global model parameters for the current round and converts them into a one-dimensional vector. Based on the cosine similarity algorithm, it calculates the similarity between each institution's parameter vector and the global parameter vector. Then, it calculates the mean of the similarity of all institutional parameters as the cross-institutional parameter consistency coefficient. The cross-institutional parameter consistency coefficient is iterated for several consecutive rounds. When the cross-institutional parameter consistency coefficient for several consecutive rounds is greater than the cross-institutional parameter consistency coefficient threshold preset in the database, it is determined that the cross-institutional parameter consistency meets the convergence condition.
Citation Information
Cited By
Multi-center collaborative modeling and risk prediction method and system based on quality perception federated learning
CN122000084A