Disease diagnosis methods, devices, equipment, and storage media based on medical images
By introducing a probability distribution aggregation method and a knowledge distillation regularization strategy within the federated learning framework, the problem of bias propagation caused by static parameter aggregation is solved, improving the robustness and generalization performance of the medical image diagnostic model and enhancing its ability to handle mislabeled data.
Patent Information
- Application Number
- CN202511447327.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-11
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-10-11
AI Technical Summary
In the federated learning framework, mislabeled medical image data introduces training bias, affecting the reliability of local models. Static parameter aggregation strategies propagate and amplify these biases, leading to model inaccuracy and insufficient robustness. This results in an inability to effectively integrate global knowledge and limits the generalization performance of diagnostic models.
A local training strategy combining a probability distribution-based aggregation method with knowledge distillation and global prior regularization is adopted. The global posterior distribution parameters are calculated by Gaussian distribution multiplication, and a loss function is constructed using the knowledge distillation loss function and the global prior regularization term to guide the training of the local diagnostic model, thereby enhancing its robustness to mislabeled data and resistance to data heterogeneity.
It effectively integrates the local knowledge of various clients, avoids the accumulation of bias caused by static parameter aggregation, improves the robustness and generalization performance of the local diagnostic model, enhances the resistance to mislabeled data and data heterogeneity, and improves the accuracy and robustness of the diagnostic model.
Smart Images

Figure CN120913825B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of medical diagnostic technology, and more specifically, to a disease diagnosis method, apparatus, device, and storage medium based on medical images. Background Technology
[0002] Medical image diagnostic technology plays a central role in disease identification. Federated learning, as an emerging method, is widely used to address the challenges of medical data privacy protection and insufficient data, promoting cross-institutional collaboration and improving model generalization capabilities, thus driving continuous optimization of diagnostic accuracy. This trend reflects the deep integration of artificial intelligence in the medical field, laying the foundation for the development of efficient and safe diagnostic models.
[0003] However, within the federated learning framework, mislabeled medical image data introduces training bias, affecting the reliability of local models. Existing methods fail to effectively integrate global knowledge, resulting in an inability to accurately assess the credibility of client-side labels, thus weakening model training performance. Static parameter aggregation strategies further propagate and amplify these biases, exacerbating model inaccuracies. Furthermore, the difference between non-convex optimization and convex functions during parameter aggregation generates additional errors, limiting the robustness and generalization performance of diagnostic models. These issues collectively constrain the practical application of federated learning in medical image diagnosis.
[0004] There is currently no effective technical solution to the above problems. Summary of the Invention
[0005] The purpose of this application is to provide a disease diagnosis method, device, equipment, and storage medium based on medical images to solve the problem of bias propagation caused by static parameter aggregation, and to integrate global knowledge to guide local training, thereby enhancing the robustness of the local diagnostic model to mislabeled data and its resistance to mislabeled data and data heterogeneity.
[0006] In a first aspect, this application provides a disease diagnosis method based on medical images, the method comprising the following steps:
[0007] S1. Acquire the patient's medical images;
[0008] S2. Using the local diagnostic model obtained from the previous communication round, disease diagnosis is performed based on the medical image. The training process of the local diagnostic model in each communication round includes:
[0009] A1. The server receives the dataset size and local posterior distribution parameters of the local diagnostic model uploaded by each hospital client.
[0010] A2. The server-side uses Gaussian distribution multiplication to calculate the global posterior distribution parameters of the global probability distribution based on the dataset size and the local posterior distribution parameters, in order to update the global diagnostic model.
[0011] A3. The server sends the global posterior distribution parameters to each hospital client.
[0012] A4. The hospital client initializes the local diagnostic model based on the global posterior distribution parameters, and trains it based on the loss function constructed using the knowledge distillation loss function and the global prior regularization term to determine the new local posterior distribution parameters.
[0013] This application's method introduces a probability distribution-based aggregation method and a local training strategy combining knowledge distillation and global prior regularization within the federated learning framework. The probability aggregation method effectively integrates the local knowledge of each client, avoiding the accumulation of bias caused by static averaging, thus solving the bias propagation problem caused by static parameter aggregation. At the same time, by using the global posterior distribution as prior information and combining it with knowledge distillation to guide local training, global knowledge is effectively integrated to guide local training, enhancing the robustness of the local diagnostic model to mislabeled data and strengthening the model's resistance to mislabeled data and data heterogeneity, thereby improving the robustness and generalization performance of the diagnostic model.
[0014] The aforementioned disease diagnosis method based on medical images, wherein the global posterior distribution parameters include the expectation and covariance matrix of the global probability distribution, the local posterior distribution parameters include the expectation and covariance matrix of the local probability distribution, and the calculation formula for calculating the global posterior distribution parameters of the global probability distribution based on the dataset size and the local posterior distribution parameters includes:
[0015] ;
[0016] Where, μ S Let K be the expectation of the global probability distribution, K be the total number of local diagnostic models, N be the total dataset size of all local diagnostic models, and n be the expected value of the global probability distribution. k Let μ be the dataset size of the k-th local diagnostic model. k The expected value of the local probability distribution. Let be the covariance matrix of the global probability distribution. Let be the inverse matrix of the covariance matrix of the global probability distribution. is the inverse matrix of the covariance matrix of the local probability distribution.
[0017] The above design uses a Gaussian distribution product to estimate the global posterior probability, which ensures the strong convexity of the aggregation function, thereby mitigating aggregation errors. It also effectively reduces the computational difficulty of calculating local posterior probabilities for neural networks, thus alleviating the local computational pressure within the hospital client.
[0018] The aforementioned disease diagnosis method based on medical images, wherein the loss function is:
[0019] ;
[0020] Among them, L dt Let R be the loss function, α be a preset first hyperparameter, β be a preset second hyperparameter, and R be the loss function. gp L is the global prior regularization term. kd Let be the knowledge distillation loss function.
[0021] The aforementioned disease diagnosis method based on medical images, wherein the knowledge distillation loss function is constructed based on the cross-entropy loss function and the KL divergence between the local diagnosis model and the global diagnosis model, satisfying:
[0022] ;
[0023] Where ϵ is the preset third hyperparameter, L ce Let the cross-entropy loss function be... Let KL(·|·) be the KL divergence between the local diagnostic model and the global diagnostic model, where KL(·|·) represents the KL divergence between calculated elements, and D k This represents the local dataset for the k-th local diagnostic model. This indicates that the k-th local diagnostic model is for D. k The output, This indicates that the global diagnostic model is for D k The output of .
[0024] The aforementioned disease diagnosis method based on medical images, wherein α is set to 1, β is set to 5, and ϵ is set to 0.5.
[0025] In the aforementioned disease diagnosis method based on medical images, the global prior regularization term is constructed using the global posterior distribution parameters as prior probabilities.
[0026] The aforementioned disease diagnosis method based on medical images, wherein the global prior regularization term satisfies:
[0027] ;
[0028] Where θ represents the global diagnostic model parameters, and T is the matrix transpose. Let μ be the inverse of the covariance matrix of the global probability distribution. S Let be the expectation of the global probability distribution.
[0029] Secondly, this application also provides a disease diagnosis device based on medical images, the device comprising:
[0030] The acquisition module is used to acquire the patient's medical images;
[0031] The diagnostic module is used to diagnose diseases based on the medical images using the local diagnostic model trained in the previous communication round. The training process of the local diagnostic model in each communication round includes:
[0032] A1. The server receives the dataset size and local posterior distribution parameters of the local diagnostic model uploaded by each hospital client.
[0033] A2. The server-side uses Gaussian distribution multiplication to calculate the global posterior distribution parameters of the global probability distribution based on the dataset size and the local posterior distribution parameters, in order to update the global diagnostic model.
[0034] A3. The server sends the global posterior distribution parameters to each hospital client.
[0035] A4. The hospital client initializes the local diagnostic model based on the global posterior distribution parameters, and trains it based on the loss function constructed using the knowledge distillation loss function and the global prior regularization term to determine the new local posterior distribution parameters.
[0036] The device proposed in this application introduces a probability distribution-based aggregation method and a local training strategy combining knowledge distillation and global prior regularization within the federated learning framework. The probability aggregation method effectively integrates the local knowledge of each client, avoiding the accumulation of bias caused by static averaging, thereby solving the bias propagation problem caused by static parameter aggregation. At the same time, by using the global posterior distribution as prior information and combining it with knowledge distillation to guide local training, global knowledge is effectively integrated to guide local training, enhancing the robustness of the local diagnostic model to mislabeled data and strengthening the model's resistance to mislabeled data and data heterogeneity, thus improving the robustness and generalization performance of the diagnostic model.
[0037] Thirdly, this application also provides an electronic device, including a processor and a memory, the memory storing computer-readable instructions that, when executed by the processor, perform the steps of the method provided in the first aspect above.
[0038] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the method provided in the first aspect above.
[0039] As can be seen from the above, this application provides a disease diagnosis method, device, equipment, and storage medium based on medical images. The training process of the local diagnostic model used in this application introduces a probability distribution-based aggregation method and a local training strategy combining knowledge distillation and global prior regularization within a federated learning framework. The probability aggregation method effectively integrates the local knowledge of each client, avoiding the accumulation of bias caused by static averaging, thus solving the bias propagation problem caused by static parameter aggregation. Simultaneously, by using the global posterior distribution as prior information and combining it with knowledge distillation to guide local training, global knowledge is effectively integrated to guide local training, enhancing the robustness of the local diagnostic model to mislabeled data and strengthening the model's resistance to mislabeled data and data heterogeneity, thereby improving the robustness and generalization performance of the diagnostic model. Attached Figure Description
[0040] Figure 1 A flowchart of a disease diagnosis method based on medical images provided in an embodiment of this application.
[0041] Figure 2 This is a flowchart of the training process for each communication round of the local diagnostic model.
[0042] Figure 3 This is a schematic diagram of the structure of a disease diagnosis device based on medical images provided in an embodiment of this application.
[0043] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0044] Reference numerals: 201, Acquisition module; 202, Diagnostic module; 301, Processor; 302, Memory; 303, Communication bus. Detailed Implementation
[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0046] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0047] Firstly, please refer to Figure 1 and Figure 2 This application provides a disease diagnosis method based on medical images, which includes the following steps:
[0048] S1. Acquire the patient's medical images;
[0049] S2. Using the local diagnostic model trained in the previous communication round, disease diagnosis is performed based on medical images. The training process of the local diagnostic model in each communication round includes:
[0050] A1. The server receives the dataset size and local posterior distribution parameters of the local diagnostic model uploaded by each hospital client.
[0051] A2. The server-side uses Gaussian distribution multiplication to calculate the global posterior distribution parameters of the global probability distribution based on the dataset size and local posterior distribution parameters, in order to update the global diagnostic model.
[0052] A3. The server sends the global posterior distribution parameters to each hospital client.
[0053] A4. The hospital client initializes the local diagnostic model based on the global posterior distribution parameters and trains it based on the loss function constructed using the knowledge distillation loss function and the global prior regularization term to determine the new local posterior distribution parameters.
[0054] Specifically, the dataset size of the local diagnostic model refers to the amount of data used by each hospital client to train the local diagnostic model. The local posterior distribution parameter of the local diagnostic model refers to the probability parameters describing the parameters or output distribution of the local diagnostic model for each hospital client. The global posterior distribution parameter of the global probability distribution refers to the probability parameters describing the parameters or output distribution of the global diagnostic model obtained by aggregating information from all clients, used to represent the knowledge and model state of the overall data. Gaussian distribution multiplication is a probability aggregation method used to combine information from multiple Gaussian distributions to obtain a new Gaussian distribution. Its main purpose is to fuse local knowledge from different clients at the probability level to form more representative global knowledge. The knowledge distillation loss function is a training objective that makes the output distribution of the local diagnostic model approximate the output distribution of the global diagnostic model (or knowledge represented by global parameters). It can be constructed using methods such as cross-entropy or KL divergence. Its main purpose is to transfer global knowledge to the local diagnostic model and enhance the generalization ability of the local diagnostic model. The global prior regularization term is a penalty term added to the local training loss function. This penalty term is constructed based on the global posterior distribution parameters and is used to constrain the parameter distribution of the local diagnostic model to guide the parameters of the local diagnostic model toward the global consensus, thereby improving the robustness of the local diagnostic model.
[0055] Specifically, the local diagnostic model used in this application is updated through iterative communication rounds. In each communication round, each hospital client first trains its local diagnostic model based on local data and calculates the local posterior distribution parameters describing the state of the local diagnostic model and the size of the local dataset. Subsequently, these local posterior distribution parameters and the dataset size are uploaded to the server. After receiving the information uploaded by all clients, the server aggregates these local posterior distribution parameters using Gaussian distribution multiplication and weights the contributions of each client according to the dataset size, thereby calculating the global posterior distribution parameters representing the global probability distribution of global knowledge. The calculated global posterior distribution parameters are then sent back to each hospital client. After receiving the global posterior distribution parameters, the client initializes its local diagnostic model using these parameters, allowing the local diagnostic model to start training from a state closer to the global optimum or global distribution. Next, the client trains on the local dataset, using a loss function that combines knowledge distillation loss and a global prior regularization term. The knowledge distillation loss ensures that the prediction results of the local diagnostic model are consistent with the prediction results of the global diagnostic model (represented by global parameters), thereby incorporating global knowledge. The global prior regularization term uses the global posterior distribution as prior information to constrain the parameters of the local diagnostic model, preventing it from deviating excessively from the global consensus and enhancing its resistance to local noise and bias. Through training in this way, the client determines new local posterior distribution parameters for the next round of uploading and aggregation. The entire process is iterative, with both the global and local diagnostic models being optimized and updated in each round.
[0056] This application's method introduces a probability distribution-based aggregation method and a local training strategy combining knowledge distillation and global prior regularization within the federated learning framework. The probability aggregation method effectively integrates the local knowledge of each client, avoiding the accumulation of bias caused by static averaging, thus solving the bias propagation problem caused by static parameter aggregation. At the same time, by using the global posterior distribution as prior information and combining it with knowledge distillation to guide local training, global knowledge is effectively integrated to guide local training, enhancing the robustness of the local diagnostic model to mislabeled data and strengthening the model's resistance to mislabeled data and data heterogeneity, thereby improving the robustness and generalization performance of the diagnostic model.
[0057] In some preferred embodiments, the global posterior distribution parameters include the expectation and covariance matrix of the global probability distribution, and the local posterior distribution parameters include the expectation and covariance matrix of the local probability distribution. The formula for calculating the global posterior distribution parameters of the global probability distribution based on the dataset size and the local posterior distribution parameters includes:
[0058] (1)
[0059] Where, μ S Let K be the expectation of the global probability distribution, K be the total number of local diagnostic models, N be the total dataset size of all local diagnostic models, and n be the expected value of the global probability distribution. k Let μ be the dataset size of the k-th local diagnostic model. k The expected value of the local probability distribution. Let be the covariance matrix of the global probability distribution. Let be the inverse of the covariance matrix of the global probability distribution. It is the inverse of the covariance matrix of the local probability distribution.
[0060] Specifically, the method of this application proposes to estimate the local posterior probability distribution using a multivariate Gaussian distribution, and to aggregate the estimates of the local posterior probabilities using Gaussian multiplication to ensure the strong convexity of the aggregated parameters, thereby reducing the aggregation error; the aggregation method of multivariate Gaussian distribution multiplication can be expressed as:
[0061] (2)
[0062] in, Let θ be the objective function, and θ be the parameters of the global diagnostic model. D represents the local posterior probability of the k-th local diagnostic model. k This represents the local dataset of the k-th local diagnostic model.
[0063] This application uses a multivariate Gaussian distribution to estimate the local posterior probability distribution of the k-th client, obtaining... ,in, satisfy:
[0064] (3)
[0065] in, This is the symbol for a normal distribution.
[0066] Similarly, this application uses a multivariate Gaussian distribution to estimate the global probability distribution, then we have ,in, This represents the global probability distribution of the global diagnostic model. satisfy:
[0067] (4)
[0068] Therefore, based on equations (2), (3), and (4), the following relationship is obtained:
[0069] (5)
[0070] because and All can be guaranteed to be convex functions, so the aggregation method of multivariate Gaussian distribution multiplication can alleviate the aggregation error; according to the relationship of equation (5), based on Gaussian multiplication, μ shown in equation (1) can be obtained. S and The closed-form solution.
[0071] It should be noted that in the federated learning framework, Actually belongs to The precision matrix can be easily transformed using a single inverse matrix. The two are interconnected through a closed-loop formula, requiring no explicit conversion.
[0072] The process of deriving equation (1) based on Gaussian multiplication and equation (5) is as follows:
[0073] Taking the logarithm of equation (5) yields:
[0074] (6)
[0075] Will Expanded to:
[0076] (7)
[0077] in, Since is the covariance matrix of the local probability distribution, equation (6) can be transformed into
[0078] (8)
[0079] in, Expanded to:
[0080] (9)
[0081] Substituting equation (9) into equation (8), we get:
[0082] (10)
[0083] because, and Since both are constants, equation (10) can be further simplified to:
[0084] (11)
[0085] Expanded according to Gaussian probability density We can obtain:
[0086] (12)
[0087] Finally, by matching the coefficients of equations (11) and (12), equation (1) can be obtained. Thus, step A2 can calculate the global posterior distribution parameters of the global probability distribution based on Gaussian multiplication according to equation (1).
[0088] Equation (1) is obtained based on Gaussian multiplication transformation. The multiplication of multiple Gaussian distributions is still a Gaussian distribution, which guarantees that it is a convex function.
[0089] Specifically, the core of Equation (1) lies in the weighted averaging of local information from different clients. The weights consider not only the dataset size of the clients but also the reliability or information content of the local models. The method in this application weights and aggregates the local posterior distribution parameters based on the dataset size and the information content of the local models, enabling the global diagnostic model update to more accurately reflect reliable information from different clients. Thus, this scheme can effectively overcome the challenge of inaccurate global diagnostic model updates caused by data bias and mislabeling in federated learning, improve the accuracy, robustness, and generalization ability of the global diagnostic model, and thereby enhance the overall performance of disease diagnosis models based on medical images.
[0090] The above design uses a Gaussian distribution product to estimate the global posterior probability, which ensures the strong convexity of the aggregation function, thereby mitigating aggregation errors. It also effectively reduces the computational difficulty of calculating local posterior probabilities for neural networks, thus alleviating the local computational pressure within the hospital client.
[0091] In some preferred embodiments, the loss function is:
[0092] (13)
[0093] Among them, L dt Let R be the loss function, α be the preset first hyperparameter, β be the preset second hyperparameter, and R be the loss function. gp L is the global prior regularization term. kd Let be the knowledge distillation loss function.
[0094] Specifically, during the training of the local diagnostic model, minimize L dt This prompts the local diagnostic model to consider two objectives simultaneously: one is to minimize L kd This is achieved by firstly making the output of the local diagnostic model approximate the output of the global diagnostic model, thereby learning the knowledge and generalization ability of the global diagnostic model; secondly, by minimizing R... gpThis approach aligns the parameters of the local diagnostic model with the center of the global posterior distribution, thereby utilizing prior information obtained from global aggregation to constrain the parameter space of the local diagnostic model and mitigate the impact of local data bias. The first hyperparameter α and the second hyperparameter β serve as weights, allowing the system to adjust the influence of knowledge distillation and global prior regularization on local training according to actual needs. This combination enables the local diagnostic model to effectively integrate knowledge from the global diagnostic model and constraints from the global parameter distribution while utilizing local data, thus overcoming the problems caused by uneven or biased local data distribution within the federated learning framework. By using the global posterior distribution parameters obtained from global aggregation to construct the global prior regularization term and combining it with knowledge distillation, the training of the local diagnostic model is guided to a more optimal and robust parameter space, which helps improve the model's performance on unseen data.
[0095] Therefore, the loss function described above can guide the local diagnostic model to effectively utilize the knowledge of the global diagnostic model, while constraining the parameters of the local diagnostic model through global prior information, thereby overcoming the impact of local data bias on model training and improving the robustness and generalization performance of the model.
[0096] In some preferred embodiments, the knowledge distillation loss function is constructed based on the cross-entropy loss function and the KL divergence between the local diagnostic model and the global diagnostic model, satisfying:
[0097] (14)
[0098] Where ϵ is the preset third hyperparameter, L ce Let cross-entropy be the loss function. Let KL(·|·) be the KL divergence between the local diagnostic model and the global diagnostic model, where KL(·|·) represents the KL divergence between elements. This indicates that the k-th local diagnostic model is for D. k The output, This indicates that the global diagnostic model is for D k The output of .
[0099] Specifically, the cross-entropy loss function is a commonly used loss function that measures the difference between the probability distribution of the output of a classification model and the probability distribution of the true labels. It reflects the degree of fit of the local diagnostic model to the local labels and can be implemented using the cross-entropy calculation formula in standard classification tasks.
[0100] Specifically, during the local training phase of federated learning, the local diagnostic model utilizes the local dataset D. k Training is performed. Cross-entropy loss L ceThis enables the local diagnostic model to learn the true label information of local data, ensuring that the model can accurately classify local data. Simultaneously, the local diagnostic model is designed for the local dataset D. k Output θ k (D k The global diagnostic model (downloaded to the hospital client) targets the same dataset D. k Output θ(D) k The KL divergence between the local and global diagnostic model outputs is calculated and incorporated into the loss function. By minimizing the KL divergence between the local and global diagnostic model outputs, the local diagnostic model is guided to mimic the behavior and output distribution of the global diagnostic model, thereby learning more generalized and robust knowledge from the global diagnostic model. When ϵ is large, the local diagnostic model focuses more on fitting local labels; when ϵ is small, the local diagnostic model focuses more on mimicking the global diagnostic model. This combination allows the local diagnostic model to effectively absorb knowledge from the global diagnostic model while utilizing local labeled data for supervised learning. This helps improve the generalization ability of the local diagnostic model, especially when there are differences between the local and global data distributions. The knowledge distillation loss function L... kd As the total loss function L dt Part of it, with the global prior regularization term R gp Together, they are used for training the local diagnostic model. Thus, within the framework of federated learning, the server aggregates global information and feeds it back to the client, while the client combines local data, global diagnostic model knowledge, and global priors during local training, achieving effective training of the local diagnostic model and integration of global knowledge.
[0101] In some preferred embodiments, α is set to 1, β is set to 5, and ϵ is set to 0.5.
[0102] This scheme sets the weight α of the knowledge distillation loss term in the total loss function to 1 and the weight β of the global prior regularization term to 5. This makes the global prior regularization term play a relatively more important role in the total loss, thus emphasizing the use of the global posterior distribution to constrain the parameters of the local diagnostic model and enhancing the model's global consistency and generalization ability. Simultaneously, the weight ϵ of the cross-entropy loss and the KL divergence between the outputs of the local and global diagnostic models in the knowledge distillation loss function is set to 0.5. This means that the fitting of the local diagnostic model to local labels and the learning of knowledge from the global diagnostic model are given equal weight in the knowledge distillation process, balancing the utilization of local data and the absorption of global knowledge, which helps improve the model's performance in heterogeneous data environments.
[0103] In some preferred embodiments, the global prior regularization term is constructed using the global posterior distribution parameter as the prior probability.
[0104] Specifically, the global prior regularization term is constructed using the global posterior distribution parameters calculated on the server side as prior information. This means that during the training process, the parameter updates of the local diagnostic model are not only affected by local data and the output of the global diagnostic model (through knowledge distillation), but also by a prior constraint determined by the current state of the global diagnostic model. This constraint guides the parameters of the local diagnostic model to align with the collective knowledge represented by the global diagnostic model. In this way, global knowledge is effectively integrated into the training process of the local diagnostic model, helping it overcome the bias caused by relying solely on local data. This mechanism, which directly transforms the global aggregation result (global posterior distribution parameters) into prior constraints for local training, enables global knowledge to dynamically and specifically guide the learning of the local diagnostic model, thereby improving its generalization ability and robustness.
[0105] In some preferred implementations, the global prior regularization term satisfies:
[0106] (15)
[0107] Where T is the matrix transpose operator.
[0108] The reason for designing the global prior regularization term as equation (15) is as follows:
[0109] According to Bayes' criterion, the posterior probability within the k-th client can be expressed as:
[0110] lnp(θ|D k ) = lnp(θ)+lnp(D k |θ)−lnp(D k (16)
[0111] Where, when D is given k At that time, lnp(D) k )=0; lnp(θ) represents the prior probability, lnp(D k |θ) represents the local likelihood estimate.
[0112] To mitigate the weight discrepancies and aggregation bias caused by independent local training across clients, this application integrates prior knowledge based on equation (16) to guide local training, using the global posterior probability p(θ|D) as the prior probability for local training, thus transforming equation (16) into:
[0113] lnp(θ|D k ) = lnp(θ|D) +lnp(D) k |θ) (17)
[0114] Where D represents all local datasets of all local diagnostic models, and R... gp Set as:
[0115] (18)
[0116] Because this application uses a multivariate Gaussian distribution to estimate the local posterior probability distribution of the k-th client (i.e. , ), through expansion Combining equation (18) yields equation (15).
[0117] In this embodiment, the purpose of the aforementioned global prior regularization term is to anchor θ to μ using a global prior. S Above (by minimizing) (to achieve), thereby reducing weight divergence, and at the same time, based on Dynamically penalize parameter biases to prioritize local knowledge with lower uncertainty, thereby mitigating the impact of noise labels.
[0118] The design of the global prior regularization term dynamically adjusts the learning intensity at the sample level, enabling the local diagnostic model to more robustly handle uncertainties arising from data ambiguity during the learning process. This is combined with the global parameter constraints of the global prior regularization term and L... kd Aligning the global diagnostic model output with the KL divergence term, the optimized client-side training method can learn more effectively from medical image data containing uncertain labels, generating more robust local diagnostic model parameter estimates (μ). k ,Σ k This allows the contribution of client data to more accurately reflect the knowledge learned from clear samples when aggregating on the server side, even if some client data contains a large number of fuzzy samples. This improves the performance and robustness of the entire federated learning framework on complex medical image diagnosis tasks.
[0119] Through the above design, this application provides a precise mathematical form of the global prior regularization term, enabling global knowledge to act explicitly on the parameter optimization process of the local diagnostic model. This helps the local diagnostic model more effectively integrate global consensus, overcome training bias caused by local data, and enhance the model's ability to cope with data heterogeneity. Consequently, the robustness and generalization performance of the diagnostic model are improved.
[0120] Secondly, please refer to Figure 3 Some embodiments of this application also provide a disease diagnosis device based on medical images, the device comprising:
[0121] Acquisition module 201 is used to acquire the patient's medical images;
[0122] Diagnostic module 202 is used to diagnose diseases based on medical images using the local diagnostic model trained in the previous communication round. The training process of the local diagnostic model in each communication round includes:
[0123] A1. The server receives the dataset size and local posterior distribution parameters of the local diagnostic model uploaded by each hospital client.
[0124] A2. The server-side uses Gaussian distribution multiplication to calculate the global posterior distribution parameters of the global probability distribution based on the dataset size and local posterior distribution parameters, in order to update the global diagnostic model.
[0125] A3. The server sends the global posterior distribution parameters to each hospital client.
[0126] A4. The hospital client initializes the local diagnostic model based on the global posterior distribution parameters and trains it based on the loss function constructed using the knowledge distillation loss function and the global prior regularization term to determine the new local posterior distribution parameters.
[0127] The device proposed in this application introduces a probability distribution-based aggregation method and a local training strategy combining knowledge distillation and global prior regularization within the federated learning framework. The probability aggregation method effectively integrates the local knowledge of each client, avoiding the accumulation of bias caused by static averaging, thereby solving the bias propagation problem caused by static parameter aggregation. At the same time, by using the global posterior distribution as prior information and combining it with knowledge distillation to guide local training, global knowledge is effectively integrated to guide local training, enhancing the robustness of the local diagnostic model to mislabeled data and strengthening the model's resistance to mislabeled data and data heterogeneity, thus improving the robustness and generalization performance of the diagnostic model.
[0128] In some preferred embodiments, the medical image-based disease diagnosis apparatus of this application is used to perform the medical image-based disease diagnosis method provided in the first aspect above.
[0129] Thirdly, please refer to Figure 4 Some embodiments of this application also provide a schematic diagram of the structure of an electronic device. This application provides an electronic device including: a processor 301 and a memory 302. The processor 301 and the memory 302 are interconnected and communicate with each other through a communication bus 303 and / or other forms of connection mechanism (not shown). The memory 302 stores computer-readable instructions that can be executed by the processor 301. When the electronic device is running, the processor 301 executes the computer-readable instructions to execute the method in any optional implementation of the above embodiments.
[0130] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program performs the method in any optional implementation of the above embodiments. The computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0131] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0132] Furthermore, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0133] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0134] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.
[0135] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A disease diagnosis method based on a medical image, characterized by, The method comprises the following steps: S1, acquiring a medical image of a patient; S2, performing disease diagnosis on the medical image by using a local diagnosis model obtained through training in a previous communication round, and the training process of the local diagnosis model in each communication round comprises: A1, receiving, by a server side, a data set size and a local posterior distribution parameter of a local diagnosis model uploaded by each hospital client; A2, calculating, by the server side, a global posterior distribution parameter of a global probability distribution based on Gaussian distribution multiplication according to the data set size and the local posterior distribution parameter, to update a global diagnosis model; A3, sending, by the server side, the global posterior distribution parameter to each hospital client; A4, initializing, by the hospital client, the local diagnosis model according to the global posterior distribution parameter, and performing training based on a loss function constructed by a knowledge distillation loss function and a global prior regularization term, to determine a new local posterior distribution parameter; The global posterior distribution parameter comprises an expectation and a covariance matrix of the global probability distribution, the local posterior distribution parameter comprises an expectation and a covariance matrix of the local probability distribution, and the calculation formula of the global posterior distribution parameter of the global probability distribution according to the data set size and the local posterior distribution parameter comprises: ; wherein μ S is the expectation of the global probability distribution, K is the total number of local diagnostic models, N is the total dataset size of all local diagnostic models, n k is the dataset size of the kth local diagnostic model, μ k is the expectation of the local probability distribution, is the covariance matrix of the global probability distribution, is the inverse of the covariance matrix of the global probability distribution, is the inverse of the covariance matrix of the local probability distribution; The loss function is: ; Wherein, L dt is the loss function, alpha is a preset first hyperparameter, beta is a preset second hyperparameter, R gp is the global prior regularization term, L kd is the knowledge distillation loss function; The knowledge distillation loss function is constructed based on a cross-entropy loss function and a KL divergence between the local diagnosis model and the global diagnosis model, and satisfies: ; wherein, is a preset third hyper-parameter, L ce is the cross-entropy loss function, is the KL divergence between the local diagnosis model and the global diagnosis model, wherein KL(·|·) represents the calculation of the KL divergence between elements, D k represents the local data set of the kth local diagnosis model, represents the output of the kth local diagnosis model for D k , represents the output of the global diagnosis model for D k .
2. The medical image-based disease diagnosing method of claim 1, wherein, a is set to 1 and β is set to 5, is set to 0.
5. 3.The medical image-based disease diagnosing method of claim 1, wherein, The global prior regularization term is constructed by taking the global posterior distribution parameter as a prior probability.
4. The medical image-based disease diagnosing method of claim 3, wherein, The global prior regularization term satisfies: ; where θ is the global diagnostic model parameter, T is the matrix transpose symbol, is the inverse of the covariance matrix of the global probability distribution, μ S is the expectation of the global probability distribution.
5. A medical image-based disease diagnosis apparatus, characterized by comprising: The device comprises: An acquisition module configured to acquire a medical image of a patient; A diagnosis module configured to perform disease diagnosis on the medical image by using a local diagnosis model obtained through training in a previous communication round, and the training process of the local diagnosis model in each communication round comprises: A1, receiving, by a server side, a data set size and a local posterior distribution parameter of a local diagnosis model uploaded by each hospital client; A2, calculating, by the server side, a global posterior distribution parameter of a global probability distribution based on Gaussian distribution multiplication according to the data set size and the local posterior distribution parameter, to update a global diagnosis model; A3, sending, by the server side, the global posterior distribution parameter to each hospital client; A4, initializing, by the hospital client, the local diagnosis model according to the global posterior distribution parameter, and performing training based on a loss function constructed by a knowledge distillation loss function and a global prior regularization term, to determine a new local posterior distribution parameter; The global posterior distribution parameter comprises an expectation and a covariance matrix of the global probability distribution, the local posterior distribution parameter comprises an expectation and a covariance matrix of the local probability distribution, and the calculation formula of the global posterior distribution parameter of the global probability distribution according to the data set size and the local posterior distribution parameter comprises: ; wherein μ S is the expectation of the global probability distribution, K is the total number of local diagnostic models, N is the total dataset size of all local diagnostic models, n k is the dataset size of the kth local diagnostic model, μ k is the expectation of the local probability distribution, is the covariance matrix of the global probability distribution, is the inverse of the covariance matrix of the global probability distribution, is the inverse of the covariance matrix of the local probability distribution; The loss function is: ; Wherein, L dt is the loss function, alpha is a preset first hyperparameter, beta is a preset second hyperparameter, R gp is the global prior regularization term, L kd is the knowledge distillation loss function; The knowledge distillation loss function is constructed based on a cross-entropy loss function and a KL divergence between the local diagnosis model and the global diagnosis model, and satisfies: ; wherein, is a preset third hyper-parameter, L ce is the cross-entropy loss function, is the KL divergence between the local diagnosis model and the global diagnosis model, wherein KL(·|·) represents the calculation of the KL divergence between elements, D k represents the local data set of the kth local diagnosis model, represents the output of the kth local diagnosis model for D k , represents the output of the global diagnosis model for D k .
6. An electronic device, comprising: A computer program product comprising a processor and a memory storing computer readable instructions which, when executed by the processor, perform the steps of the method of any of claims 1-4.
7. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by a processor, performs the steps of the method of any of claims 1-4.
Citation Information
Patent Citations
Federal learning model aggregation method based on dynamic adaptive knowledge distillation
CN116681144A
Federal learning posterior reasoning method and system based on mutual information regularization
CN119227804A