Federal learning global model correction method based on generated data adaptive screening

By training the discriminator on the client side and freezing the server parameters in the federated learning system, and combining knowledge distillation and differential privacy, the problem of model performance degradation caused by differences in client data distribution is solved, and efficient global model updates and applications are achieved under privacy protection.

CN122333533APending Publication Date: 2026-07-03湖南工商大学
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
湖南工商大学
Filing Date
2026-06-03
Publication Date
2026-07-03

Smart Images

  • Figure CN122333533A_ABST
    Figure CN122333533A_ABST
Patent Text Reader

Abstract

This invention relates to the technical fields of artificial intelligence and distributed privacy computing, specifically to a federated learning global model correction method based on adaptive filtering of generated data. The method is applied to a server, which, along with multiple clients, constitutes a federated learning system. The method includes: performing federated learning iterations with the multiple clients to obtain a target classification model; wherein the t-th iteration in the federated learning iteration is as follows: broadcasting the (t-1)-th round main classification model and target generator to the clients; the clients freeze the generator, train the classification model and discriminator, and then report the results; the server aggregates the classification model parameters and trains the generator using the multi-discriminator parameters reported by the clients; then, the generator outputs a pseudo-sample set; and weighted knowledge distillation is performed using the aggregated model as the teacher and the previous round's main model as the student to obtain the current round's main classification model. This invention can improve the model application effect of the final global model output by the federated learning system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical fields of artificial intelligence and distributed privacy computing, specifically to a federated learning global model correction method based on adaptive filtering of generated data. Background Technology

[0002] With the explosive growth of the Internet of Things (IoT) and mobile devices, distributed machine learning technologies, especially federated learning (FL), have gradually become the mainstream paradigm in privacy computing due to their ability to collaboratively train a global model without sharing raw client data. In the standard FedAvg algorithm, the server updates the global model by aggregating model parameters uploaded by each client. However, in real-world applications of federated learning, client data often exhibits non-identical distribution (Non-IID) characteristics, and due to privacy regulations, clients cannot upload their raw data to the server. Existing FedAvg algorithms directly average and aggregate parameters, which can lead to a significant performance degradation of the global model on some clients (i.e., model drift) when data distribution differences are significant.

[0003] To mitigate the impact of Non-IID, existing technologies attempt to introduce methods based on data sharing and Generative Adversarial Networks (GANs). However, data sharing requires clients to upload some "de-identified" data or public datasets to the server for auxiliary training. This directly violates the core privacy principle of federated learning, which states that "raw data should not leave the domain," and is not feasible in highly regulated fields such as healthcare and finance. GAN-based methods often face a dilemma: if the GAN is trained on the server, the lack of real data prevents the training of a high-quality generator; if the GAN is trained on the client, the generated pseudo-data must be uploaded, still posing a risk of privacy leakage and incurring significant communication overhead. Summary of the Invention

[0004] The purpose of this invention is to provide a global model correction method for federated learning based on adaptive filtering of generated data, which addresses the technical problem of poor model application performance of global models obtained based on existing technologies when there are significant differences in the distribution of client data in federated learning systems.

[0005] In a first aspect, one embodiment of the present invention provides a federated learning global model correction method based on adaptive filtering of generated data, applied to a server, wherein the server and multiple clients constitute a federated learning system, and the method includes: Federated learning iterations are performed with the multiple clients to obtain the target classification model; Wherein, the t-th iteration in the federated learning iteration is: The parameters of the main classification model and the main generator corresponding to the t-th iteration are broadcast to the multiple clients so that each client can perform classification model training and generative adversarial network training for the t-th iteration based on the corresponding local data. The parameters of the generator during the training of the generative adversarial network are frozen to the corresponding main generator parameters. The parameters of the main classification model corresponding to the t-th iteration are the parameters of the main classification model of the (t-1)-th iteration, and the parameters of the main generator corresponding to the t-th iteration are the parameters of the target generator of the (t-1)-th iteration. The system receives the sub-classification model parameters and sub-discriminator parameters of the t-th iteration reported by the multiple clients, aggregates the multiple sub-classification model parameters of the t-th iteration to obtain the initial classification model of the t-th iteration, and conducts master adversarial network training for the t-th iteration based on the multiple sub-discriminator parameters of the t-th iteration to obtain the target generator for the t-th iteration. The parameters of the discriminator during the training of the master generative adversarial network are frozen to the corresponding sub-discriminator parameters. The pseudo-sample set of the target generator in the t-th iteration is output, and the pseudo-sample set of the t-th iteration is used as the training sample. The initial classification model of the t-th iteration is used as the teacher model, and the main classification model of the (t-1)-th iteration is used as the student model. Knowledge distillation is performed to obtain the main classification model of the t-th iteration. The target classification model is the main classification model of the last iteration. The loss weight of the pseudo-samples in the pseudo-sample set in knowledge distillation is determined based on the prediction distribution of the teacher model and the prediction distribution of the student model.

[0006] In one embodiment, the discriminator during the training of the master generative adversarial network consists of multiple shadow discriminator modules, each of which corresponds one-to-one with a plurality of clients, and the parameters of the shadow discriminator modules are the slave discriminator parameters reported by the corresponding client in the corresponding iteration.

[0007] In one embodiment, the loss function value of the generator corresponding to the main generative adversarial network is obtained by weighting multiple module loss values. The multiple module loss values ​​correspond one-to-one with the multiple shadow discrimination modules. The calculation weight of the module loss value is the proportion of the local data of the corresponding client in all the local data of the multiple clients. The module loss value is used to indicate whether the corresponding shadow discrimination module correctly identifies the data output by the generator of the main generative adversarial network.

[0008] In one embodiment, the step of obtaining the loss weights of pseudo-samples in the pseudo-sample set includes: The confidence level of the teacher model's prediction distribution of the target pseudo-sample is analyzed to obtain the sample quality value, wherein the target pseudo-sample is any pseudo-sample among the multiple pseudo-samples included in the pseudo-sample set; The degree of deviation between the teacher model's predicted distribution of the target pseudo-samples and the student model's predicted distribution of the target pseudo-samples is analyzed to obtain the sample difficulty value; The loss weight of the target pseudo-sample is obtained by fusing the sample quality value and the sample difficulty value.

[0009] In one embodiment, the step of analyzing the confidence level of the teacher model's prediction distribution of the target pseudo-samples to obtain the sample quality value includes: Calculate the information entropy of the teacher model's prediction distribution of the target pseudo-samples to obtain the sample entropy value; The sample entropy value is normalized to obtain the sample quality value, wherein the sample quality value is negatively correlated with the sample entropy value.

[0010] In one embodiment, the sample difficulty value is the KL divergence between the teacher model's predicted distribution of the target pseudo-sample and the student model's predicted distribution of the target pseudo-sample.

[0011] In one embodiment, the step of fusing the sample quality value and the sample difficulty value to obtain the loss weight of the target pseudo-sample includes: The product of the sample quality value and the sample difficulty value is calculated to obtain the sample key value of the target pseudo sample; Calculate the sum of the sample key values ​​of all pseudo samples in the sample batch corresponding to the target pseudo sample to obtain the batch key value of the target pseudo sample; The loss weight of the target pseudo-sample is obtained by calculating the ratio of the sample key value of the target pseudo-sample to the total key value of its batch.

[0012] In one embodiment, the step of aggregating multiple classification model parameters from the t-th iteration to obtain the initial classification model for the t-th iteration includes: Multiple classification model parameters from the t-th iteration are fused to obtain the fused classification model parameters for the t-th iteration. The parameters of the fusion classification model in the t-th iteration are used to fill in the parameters of the preset classification model framework to obtain the initial classification model in the t-th iteration.

[0013] In one embodiment, the fusion classification model parameters of the t-th iteration are calculated based on the weighted average of multiple sub-classification model parameters of the t-th iteration. The weight of the sub-classification model parameters is the proportion of the local data of the corresponding client in the total local data of multiple clients.

[0014] In one embodiment, the server and the plurality of clients interact with parameters through a differential privacy algorithm.

[0015] Secondly, another embodiment of the present invention provides a federated learning global model correction device based on adaptive filtering of generated data, applied to a server, wherein the server and multiple clients constitute a federated learning system, and the device includes: The federated iteration module is used to perform federated learning iterations with the multiple clients to obtain the target classification model; Wherein, the t-th iteration in the federated learning iteration is: The parameters of the main classification model and the main generator corresponding to the t-th iteration are broadcast to the multiple clients so that each client can perform classification model training and generative adversarial network training for the t-th iteration based on the corresponding local data. The parameters of the generator during the training of the generative adversarial network are frozen to the corresponding main generator parameters. The parameters of the main classification model corresponding to the t-th iteration are the parameters of the main classification model of the (t-1)-th iteration, and the parameters of the main generator corresponding to the t-th iteration are the parameters of the target generator of the (t-1)-th iteration. The system receives the sub-classification model parameters and sub-discriminator parameters of the t-th iteration reported by the multiple clients, aggregates the multiple sub-classification model parameters of the t-th iteration to obtain the initial classification model of the t-th iteration, and conducts master adversarial network training for the t-th iteration based on the multiple sub-discriminator parameters of the t-th iteration to obtain the target generator for the t-th iteration. The parameters of the discriminator during the training of the master generative adversarial network are frozen to the corresponding sub-discriminator parameters. The pseudo-sample set of the target generator in the t-th iteration is output, and the pseudo-sample set of the t-th iteration is used as the training sample. The initial classification model of the t-th iteration is used as the teacher model, and the main classification model of the (t-1)-th iteration is used as the student model. Knowledge distillation is performed to obtain the main classification model of the t-th iteration. The target classification model is the main classification model of the last iteration. The loss weight of the pseudo-samples in the pseudo-sample set in knowledge distillation is determined based on the prediction distribution of the teacher model and the prediction distribution of the student model.

[0016] Thirdly, in another embodiment of the present invention, an electronic device is provided, including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method described in the first aspect.

[0017] Fourthly, in another embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the method described in the first aspect.

[0018] The present invention has the following beneficial effects: In the federated learning system, a strategy of distributed discrimination and centralized generation is implemented by configuring clients to train the discriminator of a generative adversarial network (GAN) based on local data, while restricting clients to freeze the classifier parameters sent by the server during discriminator training. Similarly, the server is configured to train the generator of the GAN based on discriminator parameters reported by multiple clients, while also restricting the server to freeze the discriminator parameters reported by clients during generator training. This avoids leakage of local client data and helps the server more accurately learn the joint data distribution of multiple clients. The final target classification model output by the server can maintain good model application performance even when there are significant differences in client data distribution. Furthermore, knowledge distillation is used to dynamically track the latest classification knowledge while retaining historically learned classification knowledge as much as possible, enabling smooth updates to the classification model parameters. Additionally, the loss weight of pseudo-samples in knowledge distillation is adaptively determined based on the predicted distribution of pseudo-samples by the teacher model and the student model, suppressing noise interference and further ensuring the effectiveness of knowledge distillation. Attached Figure Description

[0019] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating the federated learning global model correction method based on adaptive filtering of generated data provided in an embodiment of the present invention. Figure 2 This is a schematic diagram of the structure of the federated learning global model correction device based on adaptive filtering of generated data provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0021] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a federated learning global model correction method based on adaptive filtering of generated data proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0023] The following description, in conjunction with the accompanying drawings, details a specific scheme for a federated learning global model correction method based on adaptive filtering of generated data, provided by this invention.

[0024] In one embodiment, the present invention provides a federated learning global model calibration method based on adaptive filtering of generated data. This method is applied to a server, which, together with multiple clients, constitutes a federated learning system. Figure 1 As shown, the method includes: Step S1: Perform federated learning iterations with the multiple clients to obtain the target classification model.

[0025] Wherein, the t-th iteration in the federated learning iteration is: The parameters of the main classification model and the main generator corresponding to the t-th iteration are broadcast to the multiple clients so that each client can perform classification model training and generative adversarial network training for the t-th iteration based on the corresponding local data. The parameters of the generator during the training of the generative adversarial network are frozen to the corresponding main generator parameters. The parameters of the main classification model corresponding to the t-th iteration are the parameters of the main classification model of the (t-1)-th iteration, and the parameters of the main generator corresponding to the t-th iteration are the parameters of the target generator of the (t-1)-th iteration. The system receives the sub-classification model parameters and sub-discriminator parameters of the t-th iteration reported by the multiple clients, aggregates the multiple sub-classification model parameters of the t-th iteration to obtain the initial classification model of the t-th iteration, and conducts master adversarial network training for the t-th iteration based on the multiple sub-discriminator parameters of the t-th iteration to obtain the target generator for the t-th iteration. The parameters of the discriminator during the training of the master generative adversarial network are frozen to the corresponding sub-discriminator parameters. The pseudo-sample set of the target generator in the t-th iteration is output, and the pseudo-sample set of the t-th iteration is used as the training sample. The initial classification model of the t-th iteration is used as the teacher model, and the main classification model of the (t-1)-th iteration is used as the student model. Knowledge distillation is performed to obtain the main classification model of the t-th iteration. The target classification model is the main classification model of the last iteration. The loss weight of the pseudo-samples in the pseudo-sample set in knowledge distillation is determined based on the prediction distribution of the teacher model and the prediction distribution of the student model.

[0026] When the federated learning system is first started, the server first defines the network topology of the global classification model (also known as the main classification model) and the global generator model (also known as the target generator), and performs random initialization of the parameters. This invention defines the random initialization result of the model parameters of the global classification model as... And define the random initialization result of the model parameters of the global generator model as ).

[0027] In applications, when conditions permit, the server can also use a small amount of publicly available, privacy-free auxiliary datasets to warm up the initial global classification model, thereby giving the model basic feature extraction and generation capabilities.

[0028] Furthermore, considering the fluctuations in the device status of multiple clients in an actual federated learning system, it is possible to set the following: before executing the corresponding iteration, the device status of multiple clients included in the federated learning system is screened, and a batch of clients that meet the preset training conditions (hereinafter referred to as active clients) are selected to cooperate in completing the corresponding iteration rounds, so as to avoid the problem of training time consumption or abnormal lag in the training process caused by device status fluctuations.

[0029] Among them, the client that meets the preset training conditions can be: a client that is online (meaning that it has recently had normal communication interaction with the server), has a communication bandwidth greater than or equal to the minimum bandwidth threshold, and has available computing power greater than or equal to the minimum computing power threshold. The minimum bandwidth threshold and minimum computing power threshold can be adaptively set according to the actual business scenario, and the present invention does not limit them.

[0030] After selecting a group of active clients, the corresponding iteration rounds are executed. The server broadcasts the main classification model parameters and main generator parameters for the corresponding iteration to the selected active clients through the communication link.

[0031] It should be noted that, in the first iteration, the main classification model parameters broadcast to the selected active clients should be understood as the model parameters obtained by the global classification model through random initialization or preheating training. Similarly, in the first iteration, the main generator parameters broadcast to the selected active clients should be understood as the model parameters obtained by the global generator model through random initialization.

[0032] In this invention, model parameters should be understood as the structured parameters of the corresponding deep neural network (such as weight matrix, bias vector, etc.) to avoid data leakage caused by the transmission load involving original business data.

[0033] In each iteration round, the active client receives the corresponding main classification model parameters and main generator parameters issued by the server, and performs corresponding classification model training and generative adversarial network training based on the active client's private local data.

[0034] In this invention, the private local data of an active client is defined as... In the classification model training conducted on active clients, the cross-entropy loss function is used. The training loss, calculated from the classification model parameters after training on an active client locally, can be expressed as: in, The local learning rate of active clients, For federated learning iteration in the current corresponding training round, In the first At the start of each training round, the main classification model parameters are distributed by the server to active clients. The model parameters (also known as classification model parameters) are obtained after the classification model training is completed on the active client's local machine. The cross-entropy loss function used is... The gradient of the loss function is obtained by classifying private local data based on the parameters of the corresponding main classification model.

[0035] In the training of the generative adversarial network conducted by the active client, the loss function of the discriminator (which makes the discriminator recognize private local data as true and recognize generated data fabricated by the generator based on the parameters of the main generator as false) can be expressed as: In the above formula, A truth label indicating the local data of an active client. For noise prior distribution (such as Gaussian noise). The category label distribution is set to uniform distribution by the server, or obtained from category statistics uploaded by each active client in a differential privacy manner to ensure that the specific number of samples of each active client is not disclosed. For active clients in the first The loss function of the discriminator in the round of iteration, The client ID indicating the currently active client. Discriminator for active clients The model parameters (also known as discriminator parameters) are updated by active clients via gradient descent. It is the mathematical symbol for expected value. To sample from local data and its tags from active clients, These are real data samples from local data. The true labels are the corresponding ground truth labels for the real data samples. The first term in the above formula is intended to be close to 1 (so that the discriminator recognizes private local data as true) as the output probability of the discriminator for the active client's discriminator. To sample from the noise prior distribution; This indicates sampling from the category label distribution. Indicates the first At the start of each training round, the server issues global generator parameters (i.e., master generator parameters), and these global generator parameters remain fixed during the training of the discriminator on the active client (i.e., the model parameters of the generator on the active client are frozen to the master generator parameters issued by the server in the corresponding iteration). This refers to the fake data (also called generated samples) generated by the active client's generator (which can be approximated as the server's main generator) in combination with category priors. The output probability of the discriminator for the generated sample and its category is expressed in the second term of the above formula. The goal is for this output to be close to 0 (so that the discriminator identifies the generated data as fake).

[0036] Active clients update discriminator parameters via gradient descent. This allows it to identify generated samples as fake as accurately as possible, and in this process, the generator parameters... Keep it fixed.

[0037] Gradient update (after the first) Round iteration After the next local iteration): in This represents the local iteration count, with the initial state being... , For the first The model parameters of the initial state of the local iteration in a round of iteration, which are equal to... (i.e., the first) At the start of each iteration, the server broadcasts and distributes the main classification model parameters of the active clients. For the first The active client completed the first After the first local iteration, update the parameters of the obtained local classification model. For the first The client in the first Local classification model parameters during the next local iteration This represents the total number of local iterations. The model parameters after local training are: After the active client completes local training, it uploads the updated classification model parameters and discriminator parameters to the server.

[0038] In this invention, the step of aggregating multiple classification model parameters from the t-th iteration to obtain the initial classification model for the t-th iteration includes: Multiple classification model parameters from the t-th iteration are fused to obtain the fused classification model parameters for the t-th iteration. The parameters of the fusion classification model in the t-th iteration are used to fill in the parameters of the preset classification model framework to obtain the initial classification model in the t-th iteration.

[0039] The parameters of the fusion classification model in the t-th iteration are calculated by weighting multiple sub-classification model parameters in the t-th iteration. The weight of the sub-classification model parameter is the proportion of the local data of the corresponding client in all local data of multiple clients.

[0040] The above settings involve comparing the local data volume of active clients across multiple active clients to increase the influence of the classification model parameters reported by active clients with larger data volumes, while retaining the numerical influence of the classification model parameters reported by active clients with smaller data volumes, thus making the final fused classification model parameters more accurate and reliable.

[0041] For example, the parameters of the fusion classification model in the t-th iteration It can be represented as: in, In the t-th iteration, the first... The weights are calculated from the classification model parameters reported by each active client. In the t-th iteration, the first... The classification model parameters reported by each active client satisfy... .

[0042] Specifically, the discriminator during the training of the master generative adversarial network consists of multiple shadow discriminator modules, each of which corresponds one-to-one with the multiple clients, and the parameters of the shadow discriminator modules are the slave discriminator parameters reported by the corresponding client in the corresponding iteration.

[0043] By using multiple shadow discriminator modules, the discriminator obtained by each active client in the corresponding training round is completely reproduced on the server. This ensures that the discriminator during the training of the main generative adversarial network can accurately reflect the discriminator training results of different active clients, thereby ensuring the accuracy of the target generator obtained in the corresponding training round.

[0044] It should be understood that the model structure of each shadow discrimination module is consistent with the model structure of the local discriminator of the corresponding active client.

[0045] In this invention, the goal of training the main adversarial network is to enable the samples generated by the trained target generator to simultaneously deceive the discriminators of all clients (i.e., all shadow discriminator modules), thereby approximating the joint distribution of local data of all active clients.

[0046] Furthermore, the loss function value of the generator corresponding to the main generative adversarial network is obtained by weighting multiple module loss values. The multiple module loss values ​​correspond one-to-one with the multiple shadow discrimination modules. The calculation weight of the module loss value is the proportion of the local data of the corresponding client in all the local data of multiple clients. The module loss value is used to indicate whether the corresponding shadow discrimination module correctly identifies the data output by the generator of the main generative adversarial network.

[0047] For example, the loss function of the generator corresponding to the master generative adversarial network can be expressed as: The smaller the value of this loss function, the better the generated samples output by the generator corresponding to the main generative adversarial network are compared with those of the individual... The higher the probability that the shadow discrimination module (i.e., the shadow discrimination module) determines the data as real, the more likely the generator corresponding to the main generative adversarial network has successfully learned the joint distribution of local data across clients.

[0048] The gradient update of the generator corresponding to the master generative adversarial network is as follows: .

[0049] Using the updated generator From the noise distribution p(z) (randomly sampled noise) Prior distribution of categories p(c) (traversing all category labels) Sampling was performed to generate a batch of fake datasets. and the corresponding pseudo-tag set (The two combined are called a pseudo-sample set): We use pseudo-sample sets to represent the implicit global data distribution knowledge in the current federated network.

[0050] The knowledge distillation process described above aims to eliminate model drift when aggregating the classification model parameters of each active client and to suppress potential noise interference in the pseudo-sample set. The dynamic determination of the loss weight of the pseudo-samples based on the prediction distribution of the pseudo-samples by the teacher model and the prediction distribution of the pseudo-samples by the student model is to amplify the influence of valuable pseudo-samples during knowledge distillation, so as to help the student model better learn the valuable classification knowledge in the teacher model.

[0051] Specifically, the steps for obtaining the loss weights of pseudo-samples in the pseudo-sample set include: The confidence level of the teacher model's prediction distribution of the target pseudo-sample is analyzed to obtain the sample quality value, wherein the target pseudo-sample is any pseudo-sample among the multiple pseudo-samples included in the pseudo-sample set; The degree of deviation between the teacher model's predicted distribution of the target pseudo-samples and the student model's predicted distribution of the target pseudo-samples is analyzed to obtain the sample difficulty value; The loss weight of the target pseudo-sample is obtained by fusing the sample quality value and the sample difficulty value.

[0052] The higher the sample quality value, the more reliable the teacher model's prediction distribution of the target pseudo-sample (i.e., the higher the confidence level), which in turn indicates that the target pseudo-sample has a higher probability of representing the real sample. On the other hand, the higher the sample difficulty value, the greater the discrepancy between the teacher model and the student model in handling the target pseudo-sample (i.e., the greater the degree of deviation), which in turn indicates that the target pseudo-sample is more difficult for the student model to learn.

[0053] In other words, the sample quality value represents the authenticity of the target pseudo-sample, while the sample difficulty value represents the difficulty of the target pseudo-sample. The loss weight of the target pseudo-sample is determined by combining the two, so as to amplify the influence of real difficult examples in the knowledge distillation process and improve the knowledge distillation effect.

[0054] It should be understood that the loss weight of the target pseudo-sample is positively correlated with the sample quality value and also positively correlated with the sample difficulty value.

[0055] For example, assuming the target pseudo-sample is an image of a cat, the teacher network's prediction probability distribution for this image is [0.90 (cat), 0.05, 0.05]. Because the probability distribution is very concentrated, the calculated sample quality value will be very high, meaning the teacher model is very confident in its classification result for the target pseudo-sample. Therefore, it can be considered that the target pseudo-sample represents a real sample with a higher probability. Further assuming that in the later stages of model fine-tuning, the student model's parameters change to adapt to new features, causing the student model's prediction distribution for this image of a cat to become [0.40, 0.30, 0.30]. At this time, the difference between the preset distribution output by the student network and the preset distribution output by the teacher network is large, and the calculated sample difficulty value will be very high. This indicates that the student model has forgotten knowledge about the target pseudo-sample. Based on the aforementioned assumptions, it can be determined that the target pseudo-sample belongs to a high-value difficult example, and the loss weight of the target pseudo-sample needs to be increased accordingly to help the student model accurately learn the classification knowledge of such high-value difficult examples.

[0056] When the target pseudo-sample is a blurry, noisy image, the teacher network predicts the probability distribution of the image as [[0.34, 0.33, 0.33]. Because the probability distribution is very uniform, the sample quality value calculated based on this distribution will be very low (i.e., the teacher model cannot accurately classify the target pseudo-sample). This means that the classification result of the teacher model for the target pseudo-sample is highly unreliable. Therefore, it can be considered that the lower the probability that the target pseudo-sample represents the real sample, the lower the loss weight of the target pseudo-sample will be, regardless of the difference between the preset distribution of the student network output and the preset distribution of the teacher network output. This will suppress the knowledge contamination of the student model by such noisy samples.

[0057] The step of analyzing the confidence level of the teacher model's prediction distribution of the target pseudo-samples to obtain the sample quality value includes: Calculate the information entropy of the teacher model's prediction distribution of the target pseudo-samples to obtain the sample entropy value; The sample entropy value is normalized to obtain the sample quality value, wherein the sample quality value is negatively correlated with the sample entropy value.

[0058] For example, the sample quality value can be expressed as: In the above formula, This indicates that the teacher model is effective against target pseudo-samples. The predicted distribution The information entropy (i.e., sample entropy value) represents the predicted distribution of the teacher model for the target pseudo-sample. This indicates that the teacher model predicts target pseudo-samples. Belongs to the The probability of a class Indicates the sample quality value. Indicating the natural constant, A hyperparameter used to control the degree of negative correlation between sample quality values ​​and sample entropy values.

[0059] The sample difficulty value is the KL divergence between the teacher model's predicted distribution of the target pseudo-sample and the student model's predicted distribution of the target pseudo-sample.

[0060] For example, the sample difficulty value can be expressed as: in, Indicates the sample difficulty value. This indicates that the student model is effective against target pseudo-samples. The predicted distribution This represents the KL divergence value between the predicted distribution of the target pseudo-sample by the teacher model and the predicted distribution of the target pseudo-sample by the student model.

[0061] The step of fusing the sample quality value and the sample difficulty value to obtain the loss weight of the target pseudo-sample includes: The product of the sample quality value and the sample difficulty value is calculated to obtain the sample key value of the target pseudo sample; Calculate the sum of the sample key values ​​of all pseudo samples in the sample batch corresponding to the target pseudo sample to obtain the batch key value of the target pseudo sample; The loss weight of the target pseudo-sample is obtained by calculating the ratio of the sample key value of the target pseudo-sample to the total key value of its batch.

[0062] For example, the key value of the target pseudo-sample can be represented as: in, This represents the key value of the target pseudo-sample.

[0063] The total fine-tuning loss function in knowledge distillation can be expressed as: In the above formula, Used to ensure that the classification model (including teacher and student models) adapts to the data manifold reconstructed by the target generator; used to reflect the hard target cross-entropy loss; and to indicate new knowledge; while Used to reflect the adaptive distillation loss of soft targets, indicating prior knowledge; The hyperparameter is used to balance the ratio of new to old knowledge (the higher the value, the higher the proportion of old knowledge involved in fine-tuning). Represents small batches of data. This represents the number of samples in a mini-batch.

[0064] The main classification model obtained after fine-tuning and updating can be represented as: in, To fine-tune the number of iteration steps, initial state ,go through After several iterations, the final model parameters of the main classification model are: .

[0065] During the aforementioned update process, fine-tuning in the initial stage ( Since the student network is initialized as the teacher network, at this time... The model update is mainly composed of hard target cross-entropy loss. The system drives the student model to quickly adapt to the distribution characteristics of the pseudo-sample set; as updates proceed, the parameters of the student model change, leading to cognitive differences with the teacher model. As the value gradually increases, the soft-target adaptive distillation loss begins to dominate the model update. The introduced confidence constraint prevents the model from suffering catastrophic forgetting, thereby achieving a dynamic balance between adapting to new knowledge and retaining old knowledge.

[0066] In practical applications, when the actual number of iterations of federated learning reaches the preset maximum number of iterations, or when the performance of the main classification model in a certain iteration of federated learning meets the preset convergence condition in the preset validation set, the iteration is terminated, and the main classification model of the last iteration is determined as the target classification model. Then, the server sends the model parameters of the target classification model to multiple clients to complete the local deployment of the target classification model on each client.

[0067] In summary, this invention, within a federated learning system, employs a strategy of distributed discrimination and centralized generation. This involves setting up clients to train the discriminator of a generative adversarial network (GAN) based on local data, while simultaneously freezing the classifier parameters sent by the server during discriminator training. Furthermore, the server trains the generator of the GAN based on discriminator parameters reported by multiple clients, again freezing the discriminator parameters reported by clients during generator training. This approach prevents leakage of local client data and helps the server more accurately learn the joint data distribution from multiple clients. The resulting target classification model maintains good performance even when client data distributions differ significantly. Additionally, knowledge distillation dynamically tracks the latest classification knowledge while preserving historically learned knowledge, enabling smooth updates to the classification model's parameters. Moreover, the loss weight of pseudo-samples in knowledge distillation is adaptively determined based on the teacher model's and student model's predictions of pseudo-samples, suppressing noise interference and further ensuring the effectiveness of knowledge distillation.

[0068] In the above setup, the distributed adversarial structure of multiple client discriminators and a single server generator enables the server generator to approximate the joint representation of the data distribution of each client under the constraint of multiple discriminators on the client side. This solves the technical defect that the server cannot obtain a global distribution reference when there is no data. Furthermore, by constructing a pseudo-global data distribution through the server generator, the update of the classification model on the server side no longer depends solely on the aggregation result of the classifier parameters reported by the client, but is retrained under a unified data distribution reference. This makes up for the problem that parameter averaging cannot express cross-domain feature structures and suppresses the implicit forgetting phenomenon in federated iteration.

[0069] In addition, this scheme also sets up a two-factor weight calculation based on model prediction uncertainty (represented by sample quality value) and teacher-student model difference (represented by sample difficulty value) to amplify the influence of highly reliable generated samples that have a gain value to the current model when participating in model updates, and suppress the disturbance caused by generated model noise to the feature space of the classifier on the server side.

[0070] In some implementations, the server interacts with the plurality of clients using a differential privacy algorithm.

[0071] In this implementation, the use of differential privacy algorithms further enhances the security of model parameters during transmission between the server and the client.

[0072] The aforementioned differential privacy algorithms include, but are not limited to: DP-SGD (Differential Private Stochastic Gradient Descent), DP-FL (Differential Private Federated Learning), and DP-FedAvg (Differential Private Federated Averaging).

[0073] In application, the appropriate differential factor algorithm can be selected according to the actual business needs, and this invention does not limit it.

[0074] In one embodiment, the present invention also provides a federated learning global model correction device based on adaptive filtering of generated data, applied to a server, wherein the server and multiple clients constitute a federated learning system, such as... Figure 2 As shown, the device 200 includes: The federated iteration module 201 is used to perform federated learning iterations with the multiple clients to obtain the target classification model; Wherein, the t-th iteration in the federated learning iteration is: The parameters of the main classification model and the main generator corresponding to the t-th iteration are broadcast to the multiple clients so that each client can perform classification model training and generative adversarial network training for the t-th iteration based on the corresponding local data. The parameters of the generator during the training of the generative adversarial network are frozen to the corresponding main generator parameters. The parameters of the main classification model corresponding to the t-th iteration are the parameters of the main classification model of the (t-1)-th iteration, and the parameters of the main generator corresponding to the t-th iteration are the parameters of the target generator of the (t-1)-th iteration. The system receives the sub-classification model parameters and sub-discriminator parameters of the t-th iteration reported by the multiple clients, aggregates the multiple sub-classification model parameters of the t-th iteration to obtain the initial classification model of the t-th iteration, and conducts master adversarial network training for the t-th iteration based on the multiple sub-discriminator parameters of the t-th iteration to obtain the target generator for the t-th iteration. The parameters of the discriminator during the training of the master generative adversarial network are frozen to the corresponding sub-discriminator parameters. The pseudo-sample set of the target generator in the t-th iteration is output, and the pseudo-sample set of the t-th iteration is used as the training sample. The initial classification model of the t-th iteration is used as the teacher model, and the main classification model of the (t-1)-th iteration is used as the student model. Knowledge distillation is performed to obtain the main classification model of the t-th iteration. The target classification model is the main classification model of the last iteration. The loss weight of the pseudo-samples in the pseudo-sample set in knowledge distillation is determined based on the prediction distribution of the teacher model and the prediction distribution of the student model.

[0075] It should be noted that the apparatus provided in the above embodiments is only illustrative of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus for a federated learning global model correction method based on adaptive filtering of generated data provided in the above embodiments and the method embodiment for a federated learning global model correction method based on adaptive filtering of generated data belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0076] This invention also provides an electronic device. Please refer to [link to relevant documentation]. Figure 3 The electronic device may include a processor 301, a memory 302, and a program 3021 stored in the memory 302 and capable of running on the processor 301.

[0077] When program 3021 is executed by processor 301, it can achieve the following: Figure 1 Any steps in the corresponding method embodiments and the achievement of the same beneficial effects will not be repeated here.

[0078] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by hardware related to program instructions, and the program can be stored in a readable medium.

[0079] This invention also provides a readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described functions. Figure 1 Any step in the corresponding method embodiment can achieve the same technical effect, and will not be repeated here to avoid repetition.

[0080] The computer-readable storage medium of this invention can be any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0081] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0082] The program code contained on the storage medium can be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

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

[0084] This invention also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to achieve the federated learning global model correction method based on adaptive filtering of generated data provided in the above embodiments.

[0085] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0086] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

Claims

1. A federated learning global model correction method based on adaptive screening of generated data, applied to a server, the server and a plurality of clients constitute a federated learning system, characterized in that, The method includes: Federated learning iterations are performed with the multiple clients to obtain the target classification model; Wherein, the t-th iteration in the federated learning iteration is: The parameters of the main classification model and the main generator corresponding to the t-th iteration are broadcast to the multiple clients so that each client can perform classification model training and generative adversarial network training for the t-th iteration based on the corresponding local data. The parameters of the generator during the training of the generative adversarial network are frozen to the corresponding main generator parameters. The parameters of the main classification model corresponding to the t-th iteration are the parameters of the main classification model of the (t-1)-th iteration, and the parameters of the main generator corresponding to the t-th iteration are the parameters of the target generator of the (t-1)-th iteration. The system receives the sub-classification model parameters and sub-discriminator parameters for the t-th iteration reported by the multiple clients, aggregates the multiple sub-classification model parameters for the t-th iteration to obtain the initial classification model for the t-th iteration, and conducts master generative adversarial network training for the t-th iteration based on the multiple sub-discriminator parameters for the t-th iteration to obtain the target generator for the t-th iteration. The parameters of the discriminator during the master generative adversarial network training are frozen to the corresponding sub-discriminator parameters. The pseudo-sample set of the target generator in the t-th iteration is output, and the pseudo-sample set of the t-th iteration is used as the training sample. The initial classification model of the t-th iteration is used as the teacher model, and the main classification model of the (t-1)-th iteration is used as the student model. Knowledge distillation is performed to obtain the main classification model of the t-th iteration. The target classification model is the main classification model of the last iteration. The loss weight of the pseudo-samples in the pseudo-sample set in knowledge distillation is determined based on the prediction distribution of the teacher model and the prediction distribution of the student model.

2. The federated learning global model correction method based on generation data adaptive screening according to claim 1, characterized in that, The discriminator during the training of the master generative adversarial network consists of multiple shadow discriminator modules, each of which corresponds one-to-one with the multiple clients. The parameters of each shadow discriminator module are the parameters of the slave discriminator reported by the corresponding client in the corresponding iteration.

3. The federated learning global model correction method based on adaptive filtering of generated data according to claim 2, characterized in that, The loss function value of the generator corresponding to the main generative adversarial network is obtained by weighting multiple module loss values. Each module loss value corresponds one-to-one with a multiple shadow discrimination module. The calculation weight of the module loss value is the proportion of the local data of the corresponding client in all local data of multiple clients. The module loss value is used to indicate whether the corresponding shadow discrimination module correctly identifies the data output by the generator of the main generative adversarial network.

4. The federated learning global model calibration method based on adaptive filtering of generated data according to claim 1, characterized in that, The steps for obtaining the loss weights of pseudo-samples in the pseudo-sample set include: The confidence level of the teacher model's prediction distribution of the target pseudo-sample is analyzed to obtain the sample quality value, wherein the target pseudo-sample is any pseudo-sample among the multiple pseudo-samples included in the pseudo-sample set; The degree of deviation between the teacher model's predicted distribution of the target pseudo-samples and the student model's predicted distribution of the target pseudo-samples is analyzed to obtain the sample difficulty value; The loss weight of the target pseudo-sample is obtained by fusing the sample quality value and the sample difficulty value.

5. The federated learning global model calibration method based on adaptive filtering of generated data according to claim 4, characterized in that, The steps for analyzing the confidence level of the teacher model's prediction distribution of the target pseudo-samples and obtaining the sample quality value include: Calculate the information entropy of the teacher model's prediction distribution of the target pseudo-samples to obtain the sample entropy value; The sample entropy value is normalized to obtain the sample quality value, wherein the sample quality value is negatively correlated with the sample entropy value.

6. The federated learning global model calibration method based on adaptive filtering of generated data according to claim 4, characterized in that, The sample difficulty value is the KL divergence between the teacher model's predicted distribution of the target pseudo-sample and the student model's predicted distribution of the target pseudo-sample.

7. The federated learning global model correction method based on adaptive filtering of generated data according to claim 4, characterized in that, The step of fusing the sample quality value and the sample difficulty value to obtain the loss weight of the target pseudo-sample includes: The product of the sample quality value and the sample difficulty value is calculated to obtain the sample key value of the target pseudo sample; Calculate the sum of the sample key values ​​of all pseudo samples in the sample batch corresponding to the target pseudo sample to obtain the batch key value of the target pseudo sample; The loss weight of the target pseudo-sample is obtained by calculating the ratio of the sample key value of the target pseudo-sample to the total key value of its batch.

8. The federated learning global model calibration method based on adaptive filtering of generated data according to claim 1, characterized in that, The steps for aggregating multiple classification model parameters from the t-th iteration to obtain the initial classification model for the t-th iteration include: Multiple classification model parameters from the t-th iteration are fused to obtain the fused classification model parameters for the t-th iteration. The parameters of the fusion classification model in the t-th iteration are used to fill in the parameters of the preset classification model framework to obtain the initial classification model in the t-th iteration.

9. The federated learning global model correction method based on adaptive filtering of generated data according to claim 8, characterized in that, The parameters of the fusion classification model in the t-th iteration are calculated by weighting multiple sub-classification model parameters in the t-th iteration. The weight of the sub-classification model parameter is the proportion of the local data of the corresponding client in the total local data of multiple clients.

10. The federated learning global model calibration method based on adaptive filtering of generated data according to claim 1, characterized in that, The server and the multiple clients interact with each other using a differential privacy algorithm.