Diffusion model-based anti-noise federated learning medical image classification method

Through the combination of diffusion model and federated learning, the noise and privacy protection problems in medical image classification are solved, high-precision and robust disease diagnosis are achieved, adapting to data heterogeneity and label noise, and improving the classification performance and stability of the model.

CN120279307APending Publication Date: 2025-07-08UNIV OF CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510334177.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

There are noise problems and challenges in medical image classification and data privacy protection. Existing federated learning methods are not effective when dealing with heterogeneous data and label noise, making it difficult to achieve high-precision and reliable disease diagnosis.

Method used

The diffusion model is used for image denoising and feature extraction, combined with the privacy protection mechanism of federated learning, the noise client is identified through the Gaussian hybrid model, and the knowledge distillation and cross-entropy loss function are trained to improve the robustness and classification accuracy of the model.

Benefits of technology

Effectively remove noise, improve the accuracy and robustness of medical image classification, while protecting data privacy, adapting to data heterogeneity and label noise, and improving the generalization ability and reliability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120279307A_ABST
    Figure CN120279307A_ABST
Patent Text Reader

Abstract

The invention relates to an anti-noise federated learning medical image classification method based on a diffusion model. The method comprises the steps of obtaining a to-be-classified fuzzy medical image; inputting the to-be-classified fuzzy medical image into a pre-trained diffusion model to obtain a to-be-classified clear medical image; the clear medical images are input into a medical image classification model, and the medical image classification model is obtained by inputting historical clear medical images into a federated learning-based classifier training framework; wherein the training of the classifier comprises the following steps: S1, carrying out local training on a global model at clients, and calculating an average loss value of each client on each category; s2, dividing the clients into clean clients and noise clients according to the average loss value; and S3, respectively training the clean client and the noise client, aggregating local models trained by the clients, updating a global model, returning to the step S1, carrying out the next round of training until convergence, and obtaining a medical image classification model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of federated learning, and particularly to an anti-noise federated learning medical image classification method based on a diffusion model. Background Art

[0002] Medical image classification, as an important part of modern medical diagnosis, relies on high-precision image analysis technology to assist clinicians in the early detection and diagnosis of diseases. However, in practical applications, medical image classification faces many challenges. First of all, medical images themselves often have noise problems, such as image blurring, insufficient contrast or artifact interference. These factors will reduce the clarity and recognizability of the images, and thus affect the accuracy of the classification model. In addition, the quality of labeled data also directly affects the classification performance. Since the annotation of medical images usually relies on the diagnosis of professional doctors, in actual operation, mislabeling or inconsistency may occur during the annotation process, resulting in label noise. This kind of noise not only increases the difficulty of model training, but also reduces the reliability of the model in practical applications.

[0003] At the same time, with the enhancement of data privacy protection awareness, medical image data, due to its high sensitivity, is usually difficult to be directly shared and merged among different institutions. This limitation not only hinders the construction of a large-scale unified data set, but also brings additional challenges to the development of an automatic disease classification model based on deep learning. In order to achieve cross-institutional collaborative model training without violating data privacy, federated learning (FL) technology has emerged. FL trains models locally on each decentralized data source and only shares model parameters or gradients, thus avoiding the direct transmission of raw data and effectively protecting data privacy.

[0004] In response to the above challenges, federated noisy learning, as an emerging research direction, aims to effectively address the noise problems in data and labels under the federated learning framework, especially in the context of task heterogeneity, and improve the performance of multi-label medical image classification. Federated noisy learning enhances the model's resistance to data noise and label noise by introducing noise-robust mechanisms, thus achieving more stable and reliable classification results in practical applications.

[0005] Currently, some representative methods have been proposed in the field of federated noisy learning, such as FedCorr, FedLA, and FedLSR, etc. These methods have tried to solve the noise problems existing in federated learning to varying degrees, but there are still certain limitations.

[0006] (1) When FedCorr processes highly heterogeneous data, the effectiveness of the correction mechanism may be reduced due to the large differences in tasks among clients, which in turn affects the overall performance of the model.

[0007] (2) FedLA (Federated Label Aggregation): FedLA may face the problem of inconsistent label spaces in practical applications. Especially when the disease categories of concern among different institutions vary greatly, the label aggregation process may not accurately reflect the true needs of each client, thus affecting the classification effect of the model.

[0008] (3) FedLSR (Federated Label Smoothing Regularization): When facing highly heterogeneous and noisy datasets, FedLSR may not be able to fully exert its advantages because the effect of label smoothing varies under the data distributions and label noise levels of different clients.

[0009] In response to the above, the present invention designs an anti-noise federated learning medical image classification method based on a diffusion model. Summary of the Invention

[0010] The object of the present invention is to provide an anti-noise federated learning medical image classification method based on a diffusion model. By combining the feature enhancement ability of the diffusion model and the privacy protection mechanism of federated learning, denoising and anti-noise learning are combined to effectively address the data noise and label noise problems in medical images. At the same time, it solves the challenges of data privacy and collaborative training in distributed computing, providing a robust medical image classification solution.

[0011] To achieve the above object, the present invention provides the following solution:

[0012] An anti-noise federated learning medical image classification method based on a diffusion model, comprising:

[0013] Obtain the blurred medical image to be classified;

[0014] Input the blurred medical image to be classified into a pre-trained diffusion model to obtain a clear medical image to be classified, wherein the pre-trained diffusion model is obtained by training the diffusion model with original medical images;

[0015] Input the clear medical image into a medical image classification model, wherein the medical image classification model is obtained by inputting historical clear medical images into a classifier training framework based on federated learning;

[0016] Among them, the training of the classifier includes:

[0017] S1. Locally train the global model on the client side and calculate the average loss value of each client for each category;

[0018] S2. Divide the clients into clean clients and noisy clients according to the average loss value;

[0019] S3. Train the clean clients and the noisy clients separately, aggregate the local models trained by the clean clients and the noisy clients, update the global model, return to step S1, and perform the next round of training until convergence to obtain the medical image classification model.

[0020] Optionally, training the diffusion model with the original medical images includes:

[0021] Adding Gaussian noise to the original medical images at each time step to generate pure noise images;

[0022] Gradually removing the noise from the pure noise images, restoring and enhancing the key features in the images to obtain the original medical images, where the training objective is to minimize the difference between the predicted noise and the true noise.

[0023] Optionally, locally training the global model on the client side includes:

[0024] The client locally trains the global model using the cross-entropy loss function combined with the logical adjustment method;

[0025] The cross-entropy loss function combined with the logical adjustment method is:

[0026]

[0027] where π represents the class prior distribution of the local data, is the cross-entropy loss function, and f(·) is the output of the classifier.

[0028] Optionally, dividing the clients into clean clients and noisy clients according to the average loss value includes:

[0029] Normalize the average loss value of each category, form a vector of the normalized average loss values to obtain a loss vector, where for the missing categories of the client, replace the average loss value with the minimum loss value of the missing categories among all clients;

[0030] According to the loss vector, use the Gaussian mixture model to divide the clients into the clean clients and the noisy clients.

[0031] Optionally, training the clean clients and the noisy clients separately includes:

[0032] Train the clean client based on the clean label using the cross-entropy loss function;

[0033] Train the noisy client based on the soft label using a loss function introduced based on knowledge distillation.

[0034] Optionally, training the clean client based on the clean label using the cross-entropy loss function is as follows:

[0035]

[0036] where y p is the prediction result of the local model, is the clean label, and L clean is the cross-entropy loss function of the clean client.

[0037] Optionally, training the noisy client based on the soft label using a loss function introduced based on knowledge distillation is as follows:

[0038]

[0039]

[0040] where L noise is the loss function based on knowledge distillation, KL represents the Kullback-Leibler divergence, λ is the trade-off coefficient, y G is the soft label output by the global model, T is the temperature parameter, and f G (x) represents the raw logits or scores generated by the model for each class.

[0041] Optionally, aggregating the local models trained by the clean client and the noisy client includes:

[0042] Calculate the Euclidean distance between the weights of the local models of each client and the weights of the local models of all the clean clients, and normalize the Euclidean distance;

[0043] Calculate the aggregation weights of each client according to the normalized Euclidean distance;

[0044] Perform a weighted average of the local models according to the aggregation weights to update the global model.

[0045] The beneficial effects of the present invention are:

[0046] 1. The present invention utilizes the unique advantages of diffusion models to improve the anti-noise ability in medical image classification. By gradually introducing noise and learning how to denoise, it can better capture noise patterns, thereby generating clearer feature representations in noisy data. Compared with other generative models, diffusion models have the ability to adaptively denoise, so they can effectively improve the performance of the final model on noisy data.

[0047] 2. The present invention proposes a method for identifying noisy clients based on Gaussian mixture models. Through normalized average loss and unsupervised learning, it can effectively distinguish clean clients from noisy clients, ensuring that the global model still has high robustness and reliability under the conditions of data heterogeneity and class imbalance.

[0048] 3. The present invention trains noisy clients through knowledge distillation combined with cross-entropy and KL divergence, reduces the interference of noisy labels, and improves the classification accuracy of the model in the case of non-independent and identically distributed (Non-IID) data and label noise.

[0049] 4. The present invention introduces federated learning for collaborative training. By retaining noisy clients, it helps to improve the diversity and robustness of the model, enhances the model's ability to handle uncertainty and noise interference, balances its impact on the model, and enhances the generalization ability of the model.

[0050] 5. The present invention can achieve distributed collaborative training while protecting data privacy, avoid directly sharing original medical images, meet the privacy protection requirements of sensitive data, and significantly improve the reliability and practicality of medical image classification.

[0051] In summary, through the organic combination of diffusion models and federated learning, the present invention realizes medical image denoising and feature enhancement. At the same time, on the premise of protecting data privacy, it effectively addresses the problems of data heterogeneity and label noise. Finally, the proposed method greatly improves the performance and stability of medical image classification, providing reliable technical support for disease diagnosis and treatment in precision medicine. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0053] Figure 1 FIG. is a flowchart of a method for anti-noise federated learning medical image classification based on diffusion models according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0054] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0055] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0056] This embodiment provides a method for classifying medical images in anti-noise federated learning based on a diffusion model, including:

[0057] Obtain the fuzzy medical image to be classified;

[0058] Input the fuzzy medical image to be classified into a pre-trained diffusion model to obtain a clear medical image to be classified, where the pre-trained diffusion model is obtained by training the diffusion model with the original medical images;

[0059] Input the clear medical image into a medical image classification model, where the medical image classification model is obtained by inputting historical clear medical images into a classifier training framework based on federated learning;

[0060] Among them, the training of the classifier includes:

[0061] S1. Locally train the global model, that is, the classifier, on the client, and calculate the average loss value of each client for each category;

[0062] S2. Divide the clients into clean clients and noisy clients according to the average loss value;

[0063] S3. Train the clean clients and noisy clients respectively, aggregate the local models trained by the clean clients and noisy clients, update the global model, return to step S1, and perform the next round of training until convergence to obtain a medical image classification model.

[0064] Further, training the diffusion model with the original medical images includes:

[0065] Add Gaussian noise to the original medical image at each time step to generate a pure noise image;

[0066] Gradually remove the noise from the pure noise image, restore and enhance the key features in the image to obtain the original medical image, where the training objective is to minimize the difference between the predicted noise and the true noise.

[0067] Specifically, medical image denoising and feature extraction include: using a diffusion model (such as the Denoising Diffusion Probabilistic Model, DDPM) to process noise and extract features from medical images, and output high-quality feature-enhanced images. These images no longer require additional feature extraction operations and can be directly used for the training of classification models, effectively improving the accuracy and robustness of classification.

[0068] Forward diffusion process: Gradually add Gaussian noise to the original medical image to generate a series of intermediate states until a pure noise image close to the standard normal distribution is obtained. Through this process, a progressive transformation of the data distribution to the noise distribution is constructed.

[0069] Reverse denoising process: Starting from the pure noise image, gradually remove the noise and restore and enhance the key features in the image. This process is parameterized by a neural network, and clear images are gradually generated using the mean and covariance predicted by the model.

[0070] Feature extraction and enhancement: During the denoising process, the diffusion model can automatically learn the important features in the image data distribution, making the key features more obvious in the generated image, and finally generating clear and feature-prominent images, providing high-quality inputs for subsequent classification tasks.

[0071] Specifically, local training of the global model on the client side includes:

[0072] The client uses the cross-entropy loss function combined with a logical adjustment method to locally train the global model;

[0073] The cross-entropy loss function combined with the logical adjustment method is:

[0074]

[0075] where π represents the class prior distribution of local data, is the cross-entropy loss function, and f(·) is the output of the classifier.

[0076] Specifically, before the client performs local training based on the warm-up model: Use the warm-up model of federated learning (such as the Federated Averaging method) to perform weighted averaging on the local model weights of each client to initially generate a global model, which serves as the basis for subsequent client training. By aggregating the local model parameters of each client, global weights are generated to ensure that the model in the initial stage has a certain degree of global consistency.

[0077] Local model training: Each client performs local training based on the preheated model, and uses the Logic Adjustment (LA) method to balance the influence of data class distribution, ensuring that the model can effectively handle heterogeneous data from different clients.

[0078] Furthermore, according to the average loss value, the clients are divided into clean clients and noisy clients, including:

[0079] Normalize the average loss value of each category, form a vector with the normalized average loss values, and obtain the loss vector. Among them, for the missing categories of the client, replace the average loss value with the minimum loss value of the missing categories among all clients.

[0080] According to the loss vector, use the Gaussian mixture model to divide the clients into clean clients and noisy clients.

[0081] Specifically, after completing the local model training, calculate the average loss value of each client on different data categories, and normalize the loss value to eliminate the difference in learning difficulty between categories. Use the Gaussian mixture model (GMM) to cluster the clients and divide them into "clean clients" and "noisy clients". Clean clients have lower normalized loss values, while noisy clients have higher losses. This process ensures the effective identification and filtering of noisy clients under the premise of privacy protection, reducing their interference to the global model training.

[0082] Furthermore, train the clean clients and noisy clients separately, including:

[0083] Train the clean clients based on the clean labels using the cross-entropy loss function.

[0084] Train the noisy clients based on the soft labels using the loss function introduced based on knowledge distillation.

[0085] Specifically, according to the noisy client identification results, divide the clients into two categories: clean clients and noisy clients, and adopt different training strategies respectively. For clean clients, based on the clean labels, use the basic cross-entropy (CE) loss function to train the local model. For noisy clients, introduce the knowledge distillation mechanism, and guide the local model training through the soft labels generated by the global model. The specific steps are as follows: first calculate the output probability distribution of the global model (softened through the temperature parameter). Then use the Kullback-Leibler Divergence (KL divergence) to measure the difference between the local prediction and the global soft label, and combine the cross-entropy loss to construct the overall loss function. Gradually reduce the dependence on the noisy labels through the Gaussian-type trade-off coefficient.

[0086] Furthermore, the clean client is trained based on the clean label using the cross-entropy loss function as follows:

[0087]

[0088] where y p is the prediction result of the local model, is the clean label, and L clean is the cross-entropy loss function of the clean client.

[0089] Furthermore, the noisy client is trained based on the soft label using a loss function introduced based on knowledge distillation as follows:

[0090]

[0091]

[0092] where L noise is the loss function based on knowledge distillation, KL represents the Kullback-Leibler divergence, λ is the trade-off coefficient, y G is the soft label output by the global model, T is the temperature parameter, and f G (x) represents the raw logits or scores generated by the model for each class.

[0093] Further, aggregating the local models trained by the clean client and the noisy client includes:

[0094] Calculating the Euclidean distance between the local model weights of each client and the local model weights of all clean clients, and normalizing the Euclidean distance;

[0095] Calculating the aggregation weights for each client according to the normalized Euclidean distance;

[0096] Performing a weighted average of the local models according to the aggregation weights to update the global model.

[0097] Specifically, using the distance-aware strategy, calculating the Euclidean distance between each client model and the clean client model, normalizing the distance, and adjusting the weights of the noisy clients. A higher aggregation weight is assigned to the clean clients, while the weights of the noisy clients gradually decrease as the distance increases, ensuring the reliability of the global model.

[0098] Based on the aggregation weights of each client, performing a weighted average of the local models to update the global model parameters. Distributing the updated global model to each client and entering the next round of training. After each round of training, dynamically adjusting the weights of the noisy clients through the above process, gradually enhancing the robustness and classification ability of the global model. This process continues for multiple rounds until the model converges and achieves the desired classification performance.

[0099] Combining the high-quality medical image input after denoising by the diffusion model and the federated learning anti-noise strategy, the constructed final model can achieve high-precision and robust medical image classification in a noisy environment.

[0100] The present invention will be further described below with reference to the accompanying drawings:

[0101] One way to implement the anti-noise federated learning medical image classification method based on the diffusion model described in the present invention is as follows. As Figure 1 shown, its main deployment and usage process includes: using the diffusion model for denoising and feature extraction of medical images, identifying and filtering noisy clients, and optimizing the global model training based on the noise-robust federated learning mechanism.

[0102] The first stage: Using the diffusion model for denoising and feature extraction of medical images:

[0103] In the medical image classification task, the original images are often affected by noise, blur, etc., which affect the performance of the classifier. The purpose of this stage is to denoise the medical images through the diffusion model (such as the Denoising Diffusion Probabilistic Model, DDPM), and use the capabilities of the diffusion model itself to extract and highlight the key features in the images, providing high-quality data for the subsequent classifier training.

[0104] (a) Forward diffusion process. The diffusion model constructs a progressive process from the data distribution to the noise distribution by gradually adding noise to the image. Let the original medical image be x0. In each time step t of the forward diffusion process, Gaussian noise is gradually added to the image to form a series of intermediate states x1, x2,..., x T . The forward diffusion process is defined as:

[0105]

[0106] β t is the noise variance at time step t, usually set to a linear or cosine schedule. represents a multivariate Gaussian distribution with mean μ and covariance ∑. By iterating the forward process multiple times, a pure noise image x T is finally obtained, which is approximately a standard normal distribution.

[0107] (b) Reverse denoising and feature highlighting process. The goal of the reverse process is to gradually remove the noise from the pure noise image x T , restore and highlight the key features in the image, and finally obtain a clear and feature-obvious image x0. This process is parameterized by a trained neural network and is expressed as:

[0108]

[0109] μ θ (x t , t) and ∑ θ (x t , t) are the mean and covariance respectively, predicted by the neural network based on the current image x t and the time step t.

[0110] The training objective is to minimize the difference between the predicted noise and the true noise, and the specific loss function is defined as:

[0111]

[0112] β t is the weight factor at time step t. ∈ is the noise added in the forward process at time step t. ∈ θ (x t , t) is the noise predicted by the model. The parameters θ are optimized through backpropagation, and the model gradually learns how to effectively remove noise and highlight the key features in the image during the denoising process, thereby generating a high-quality feature-enhanced image x0.

[0113] (c) Feature extraction and highlighting. During the reverse denoising process, the diffusion model not only restores the clarity of the image but also makes the key features more prominent in the generated image by learning the important features in the data distribution. The specific steps are as follows:

[0114] ① Input pure noise image: Use the pure noise image x T as the input to start the reverse diffusion process.

[0115] ② Gradual denoising and feature enhancement: At each time step t, use the trained diffusion model to remove part of the noise and simultaneously enhance the key features in the image.

[0116] x t-1 = μ θ (x t , t)+ ∑ θ (x t , t)· ∈ θ (x t , t)

[0117] In this way, the model automatically extracts and highlights the important features in the image while denoising, making the finally generated image x0 have a higher signal-to-noise ratio and a more obvious feature structure.

[0118] ③ Output feature-enhanced image: The finally obtained denoised and feature-prominent image x0 can be directly used for subsequent classifier training, such as convolutional neural network (CNN), support vector machine (SVM), etc., without additional feature extraction steps.

[0119] Through the above process, the diffusion model not only realizes the denoising of medical images, but also effectively extracts and highlights the key features in the images, generates a high-quality feature-enhanced image x0, provides optimized data input for the subsequent classifier training, and improves the accuracy and robustness of medical image classification.

[0120] The second stage: Identify noisy clients. In the second stage, it aims to effectively identify and filter out noisy clients to improve the performance and reliability of the global model. The specific steps are as follows:

[0121] a) Warm up the global model: First, perform local training on the clients, that is, each client trains based on its own data. Train the warm-up model for T1 rounds through the Federated Averaging (FedAvg) method. Through the warm-up model, the weights of the global model can be closer to the ideal initialization state, thus improving the effect of subsequent training. The global model weights w g are obtained by weighted averaging the local model weights w of each client i as follows:

[0122]

[0123] where K represents the number of clients participating in the aggregation, and N i is the number of samples of the i-th client.

[0124] b) Local model training: Based on the warm-up model, each client performs local training. During the training process, the standard cross-entropy loss function is combined with the Logic Adjust (LA) method. The purpose is to make the local model treat each class equally rather than being biased. That is:

[0125]

[0126] where π represents the class prior distribution of the local data. The Logic Adjust (LA) method is a strategy used to optimize the model aggregation process in federated learning. Its core goal is to dynamically adjust the aggregation weights or screening mechanism by analyzing the logical characteristics of the client models, such as parameter distribution, prediction logic consistency, etc., to improve the robustness and performance of the global model. Such an adjustment can make the classes with fewer samples receive more attention during model training, reduce the bias caused by class imbalance, ensure that the model can treat each class fairly, and improve the overall classification performance.

[0127] c) Calculate the average loss per class. After completing the local training, calculate the average loss value of each client for each class Since in clinical practice, the in-class samples of medical imaging data are usually independently and identically distributed (IID), by focusing on each category separately, the IID assumption can be effectively satisfied, and then the abnormal clients containing noisy samples can be identified. For each client i and each category c, calculate the average value of all loss values of this client on this category. The formula is as follows:

[0128]

[0129] where n is the number of loss values of this client on category c, is the k-th loss value.

[0130] d) Handling Missing Values and Normalization In a heterogeneous data environment, some clients may lack data for specific categories. For the missing category c, according to the "small loss trick" of Han et al. (2018), is replaced with the minimum loss value of this category among all clients:

[0131]

[0132] Then, in order to eliminate the differences in learning difficulty between different categories, the loss values of each category are normalized:

[0133]

[0134] This normalization step ensures that each category contributes equally in the subsequent noisy client identification process and avoids some categories from dominating the results.

[0135] e) Noisy Client Detection The normalized average loss values of each client on all categories are combined into a vector Based on these loss vectors, an unsupervised learning is carried out using the Gaussian Mixture Model (GMM), and K clients are divided into two subsets: S e (clean clients) corresponding to the Gaussian distribution with a smaller norm mean vector; S n (noisy clients) corresponding to the Gaussian distribution with a larger norm mean vector. This process only requires uploading the average loss value of each client, ensuring privacy protection.

[0136] Through the above steps, the second stage can not only effectively identify and filter noisy clients, but also ensure the robustness and accuracy of the global model in the presence of data heterogeneity and class imbalance.

[0137] The Third Stage: Noise-Robust Federated Learning Specific Implementation Steps. After completing the noisy client detection, the goal of the third stage is to implement noise-robust federated learning. The specific steps are as follows:

[0138] a) Client Classification. Detect and classify clients. Based on the previous noise detection results, all clients are divided into Clean Clients and Noisy Clients.

[0139] b) Local Training includes training for clean clients and training for noisy clients:

[0140] ① Training for clean clients. The loss function uses the most basic Cross-Entropy (CE):

[0141]

[0142] where y p is the prediction result of the local model, and is the clean label. The training process is based on the clean label (the clean label is the label corresponding to the data on the clean client), and the local model, i.e., the local model, is trained using the cross-entropy loss.

[0143] ② Training for noisy clients. First, calculate the soft label output by the global model:

[0144]

[0145] where T is the temperature parameter, which is set to T = 0.8 in this embodiment. The total training loss introduces a loss function based on knowledge distillation:

[0146]

[0147] where KL represents the Kullback-Leibler divergence, and λ is the trade-off coefficient, which increases from 0 to λ using a Gaussian upshift curve max = 0.8. The training process uses the above loss function to train the local model through the knowledge distillation method, gradually reducing the dependence on the noisy label and enhancing the robustness of the model to noise.

[0148] c) Model Aggregation.

[0149] ① Calculate the distance metric. For the local model of each client, calculate the distance between it and the nearest one among all clean client models (used to measure the similarity between each client model and the clean client model). For each client i, calculate the Euclidean distance between its model weight w i and the nearest model w c in the clean client set S j to measure the similarity between each client model and the clean client model:

[0150]

[0151] Normalize the distance to the interval [0, 1]:

[0152]

[0153] ② Calculate the aggregation weights. Based on the distance-aware method, assign a higher aggregation weight to clean clients, while the weight of noisy clients gradually decreases as the distance increases. Calculate the aggregation weight for each client:

[0154]

[0155] where N i represents the data volume of the i-th client, and N j represents the data volume of the j-th client. The expression of d(j) is the same as that of d(i), and the expression of D(i) is obtained by dividing d(i) by the maximum value among all d(i) of clients i. max j j in d(j) may iterate over all clients, so the denominator is the maximum value of all d(j) of clients. ③ Update the global model. Use the calculated weights to perform weighted averaging on the local models and update the global model weights. The global model weight w g is obtained by weighted averaging the local model weights w i of each client, and the formula is as follows:

[0156]

[0157] For clean clients, since D(i) = 0, their aggregation weights remain unchanged. For noisy clients, their aggregation weights are scaled proportionally within the interval [0, 1], and the weights gradually decrease as the distance between models increases.

[0158] 4) Global model update and distribution. Take the aggregated global model w g as the new global model. Distribute the updated global model to all clients and enter the next training round.

[0159] Through the above steps, the third stage realizes the training and aggregation of a federated learning model that is robust to noise. This method effectively distinguishes and processes clean and noisy clients, and uses knowledge distillation and distance-aware aggregation strategies to improve the robustness of the global model in the presence of noisy data.

[0160] Next, conduct experiments on the method of this embodiment. Experimental settings:

[0161] Parameter settings: ρ: represents the system noise level, that is, the proportion of noisy clients among all clients. ρ = 0.4 means that 40% of the clients are noisy clients. τ: represents the minimum noise level of noisy clients. For a noisy client, its noise level is randomly sampled from the uniform distribution U(τ, 1), which means that the label noise of noisy clients is at least τ. τ = 0.5 means that at least 50% of the labels of noisy clients are incorrect.

[0162] In actual federated learning, the data of different clients may come from diverse sources, and the noise levels of the labels will also vary. By setting multiple groups of different ρ and τ, the experiment can simulate this heterogeneity and reflect the changes in the proportion and degree of noisy clients. In terms of evaluating the robustness of the algorithm, this setting can test the performance of the proposed method under different degrees of label noise, especially whether it can effectively identify and handle noise while maintaining the performance of the model.

[0163] Dataset: ICH dataset: RSNA Intracranial Hemorrhage dataset [1] , which contains more than 800,000 CT images and consists of 67,969 brain CT slices for diagnosing five subtypes of intracranial hemorrhage (ICH). The dataset is randomly divided into a training set and a test set in a ratio of 7:3.

[0164] Experimental settings: In the data preprocessing stage, the data was normalized, and image augmentation was performed by random horizontal flipping and random cropping (padding is 4). The SGD local optimizer with a momentum of 0.5 was used, the batch size of the dataset was 10, and all experiments used 5 local training rounds. The same hyperparameter settings were always used on the same dataset. Table 1 shows the best test accuracy on the ICH dataset.

[0165] Table 1

[0166]

[0167] The embodiments described above are only descriptions of the preferred embodiments of the present invention and do not limit the scope of the present invention. Without departing from the design spirit of the present invention, various deformations and improvements made by those of ordinary skill in the art to the technical solutions of the present invention shall fall within the protection scope determined by the claims of the present invention.

Claims

1. A method for classifying medical images in anti-noise federated learning based on a diffusion model, characterized in that, Including: Obtain the fuzzy medical image to be classified; Input the fuzzy medical image to be classified into a pre-trained diffusion model to obtain a clear medical image to be classified, where the pre-trained diffusion model is obtained by training a diffusion model with original medical images; Input the clear medical image into a medical image classification model, where the medical image classification model is obtained by inputting historical clear medical images into a classifier training framework based on federated learning; Among them, training the classifier includes: S1. Locally train the global model on the client side and calculate the average loss value of each client for each category; S2. Divide the clients into clean clients and noisy clients according to the average loss value; S3. Train the clean clients and the noisy clients respectively, aggregate the local models trained by the clean clients and the noisy clients, update the global model, return to step S1, and perform the next round of training until convergence to obtain the medical image classification model.

2. The anti-noise federated learning medical image classification method based on the diffusion model according to claim 1, wherein Training the diffusion model with the original medical images includes: Add Gaussian noise to the original medical image at each time step to generate a pure noise image; Gradually remove the noise from the pure noise image, restore and enhance the key features in the image to obtain the original medical image, where the training objective is to minimize the difference between the predicted noise and the true noise.

3. The anti-noise federated learning medical image classification method based on a diffusion model according to claim 1, wherein Locally training the global model on the client side includes: The client locally trains the global model using the cross-entropy loss function combined with a logical adjustment method; The cross-entropy loss function combined with the logical adjustment method is: where π represents the class prior distribution of local data, is the cross-entropy loss function, and f(·) is the output of the classifier.

4. The anti-noise federated learning medical image classification method based on the diffusion model according to claim 1, wherein Dividing the clients into clean clients and noisy clients according to the average loss value includes: Normalize the average loss value of each category, form a vector with the normalized average loss values to obtain a loss vector, where for the missing categories of the client, replace the average loss value with the minimum loss value of the missing categories among all clients; Divide the clients into the clean clients and the noisy clients using a Gaussian mixture model according to the loss vector.

5. The anti-noise federated learning medical image classification method based on a diffusion model according to claim 1, wherein Training the clean clients and the noisy clients respectively includes: Training the clean clients based on clean labels using the cross-entropy loss function; Training the noisy clients based on soft labels using a loss function introducing knowledge distillation.

6. The anti-noise federated learning medical image classification method based on the diffusion model according to claim 5, characterized in that, Training the clean clients based on clean labels using the cross-entropy loss function is: where y p is the prediction result of the local model, is the clean label, and L clean is the cross-entropy loss function of the clean client.

7. The anti-noise federated learning medical image classification method based on a diffusion model according to claim 6, characterized in that, Training the noisy clients based on soft labels using a loss function introducing knowledge distillation is: Among them, L noise is the loss function based on knowledge distillation, KL represents the Kullback-Leibler divergence, λ is the trade-off coefficient, y G is the soft label output by the global model, T is the temperature parameter, f G (x) represents the original logits or scores generated by the model for each class.

8. The anti-noise federated learning medical image classification method based on a diffusion model according to claim 1, characterized in that Aggregating the local models trained by the clean clients and the noisy clients includes: Calculate the Euclidean distance between the local model weights of each client and the local model weights of all clean clients, and normalize the Euclidean distance; Calculate the aggregation weight of each client according to the normalized Euclidean distance; perform a weighted average on the local models according to the aggregation weight to update the global model.