Federal generative adversarial network training method, system, device, and storage medium
Patent Information
- Application Number
- CN202611163417.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-10-09
AI Technical Summary
[0005]然而,目前的联邦生成对抗网络在标签划分型场景下,仅依赖参数聚合的全局生成器容易出现分布偏移与模式崩塌问题,严重影响生成质量
[0018]本发明实施例中,仅需获取各客户端上传的生成器的参数和判别器的参数,不需接触各客户端原始私有数据,从数据源头保障了数据隐私安全。通过将各客户端上传的本地生成器作为各教师生成器,将聚合后的全局生成器作为学生生成器,在服务器中构建了多教师单学生的知识蒸馏范式。从而可以充分利用标签划分型场景下每个客户端的固有特性。此外,通过将参数空间提升到感知特征空间,从根本上规避了参数空间中线性聚合无法保证分布线性可加的理论缺陷,使得跨客户端知识融合在语义层面上具有理论合理性。在确定语义偏离度时,仅选择本地数据中包含当前条件类别的有效教师生成器,从而有效避免了来自不同条件类别的教师生成器的干扰,使得计算得到的语义偏离度可以真实反映有效教师生成器和学生生成器之间的语义差距,从而提高了在标签划分型场景下全局生成器的生成质量。另外,通过蒸馏触发条件可以实现蒸馏过程的按需启动,从而可以降低服务器蒸馏计算开销,显著提升了训练效率。
Smart Images

Figure CN122886730A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of federated learning technology, and in particular to a method, system, device, and storage medium for training federated generative adversarial networks. Background Technology
[0002] Generative adversarial networks (GANs) are an important generative model that learns the distribution of real data and generates high-quality samples through adversarial games between generators and discriminators. They have wide applications in fields such as image generation, data augmentation, and anomaly detection.
[0003] Federated learning, as a distributed machine learning paradigm, allows multiple clients to coordinate the training of a global model without leaving their local machines, providing a feasible path for privacy protection. Combining federated learning with generative adversarial networks (GANs), resulting in federated GANs, enables distributed generative modeling without sharing the original data.
[0004] The training performance of federated generative adversarial networks (GANs) is highly dependent on the data distribution characteristics among clients. In practical deployments, the data from each client often exhibits non-independent and identically distributed characteristics, meaning that the data distributions of different clients differ significantly. Label-partitioned GANs represent an extreme case of non-independent distribution: the global set of categories is divided into several mutually exclusive subsets, and each client cannot observe data from other categories.
[0005] However, in label-split scenarios, current federated generative adversarial networks are prone to distribution shifts and pattern collapse issues due to their reliance on global generators that only aggregate parameters, which severely impact generation quality. Summary of the Invention
[0006] This invention provides a federated generative adversarial network training method, system, device, and storage medium to address the problem of severe degradation in the generation quality of the global generator in current federated generative adversarial networks under label-based scenarios.
[0007] In a first aspect, embodiments of the present invention provide a federated generative adversarial network training method, applied on a server side, comprising: Obtain the parameters of the local generator and the local discriminator uploaded by each client; The parameters of the local generator and the local discriminator uploaded by each client are aggregated to obtain the parameters of the global generator and the global discriminator after the current round of aggregation; wherein, each teacher generator is the local generator uploaded by each client, and the student generator is the aggregated global generator; The set noise and condition labels are input into the student generator and the effective teacher generator, respectively. The generated samples of the student generator and the generated samples of the effective teacher generator are mapped to the perceptual feature space, and the semantic deviation between the student generator and the effective teacher generator in the current round is calculated. If the semantic deviation of the current round meets the distillation triggering condition, then the global generator is distilled and optimized based on the effective teacher generator to update the parameters of the global generator; otherwise, the distillation optimization of the current round is skipped, and the parameters of the global generator of the current round are retained. The updated global generator parameters, or the parameters of the current round's global generator and the current round's global discriminator, are sent to each client to execute the next round of training until the set convergence criteria are met, at which point training stops.
[0008] In one possible implementation, the step of inputting the set noise and conditional labels into the student generator and the effective teacher generator, respectively, mapping the generated samples of the student generator and the generated samples of the effective teacher generator to the perceptual feature space, and calculating the semantic deviation between the student generator and the effective teacher generator in the current round includes: Based on the set condition tags, select the teacher generator that corresponds to the condition tags from each teacher generator, and use it as the effective teacher generator; The set noise and the conditional labels are input into the student generator and the effective teacher generator, respectively, to obtain the corresponding generated samples; The perceptual features of the generated samples from the student generator and the generated samples from the effective teacher generator are extracted respectively, and the semantic deviation between the student generator and the effective teacher generator in the current round is calculated.
[0009] In one possible implementation, the step of extracting the perceptual features of the generated samples from the student generator and the generated samples from the effective teacher generator, and calculating the semantic deviation between the student generator and the effective teacher generator in the current round, includes: Based on the perceptual feature extraction network, the perceptual features of the generated samples of the student generator and the generated samples of the effective teacher generator are extracted respectively; The semantic deviation of the current round is obtained by calculating the average feature distance between the perceptual features of the generated samples from the student generator and the perceptual features of the generated samples from the effective teacher generator.
[0010] In one possible implementation, after extracting the perceptual features of the generated samples from the student generator and the generated samples from the effective teacher generator based on the perceptual feature extraction network, the method further includes: The perceptual features of the generated samples from the student generator and the perceptual features of the generated samples from the effective teacher generator are respectively processed by L2 norm normalization.
[0011] In one possible implementation, if the semantic deviation of the current round meets the distillation triggering condition, then the global generator is distilled and optimized based on the effective teacher generator to update the parameters of the global generator; otherwise, the distillation optimization of the current round is skipped, and the parameters of the global generator for the current round are retained, including: Calculate the deviation threshold; If the semantic deviation of the current round is greater than the deviation threshold, and the distillation triggering condition is met, then the global generator is distilled and optimized based on the effective teacher generator to update the parameters of the global generator; If the semantic deviation is less than or equal to the deviation threshold, it is determined that the distillation triggering condition is not met. In this case, the distillation optimization of the current round is skipped, and the parameters of the global generator of the current round are retained.
[0012] In one possible implementation, the calculation of the deviation threshold includes: The semantic deviation from the previous round is smoothed by an exponential moving average to obtain the historical semantic deviation level; The deviation threshold is obtained by multiplying the historical semantic deviation level and the preset tolerance coefficient.
[0013] In one possible implementation, the distillation optimization of the global generator based on the effective teacher generator to update the parameters of the global generator includes: Freeze the parameters of the effective teacher generator and the parameters of the feature extractor used to map to the perceptual feature space, and only perform distillation optimization on the parameters of the student generator; The average feature distance between the student generator and the effective teacher generator in the perceptual feature space is used as the distillation loss. With the goal of minimizing the distillation loss, the parameters of the global generator are updated using multi-step gradient descent.
[0014] Secondly, embodiments of the present invention provide a federated generative adversarial network training system, including a server and multiple clients; Each client is configured with a local generator and a local adversarial unit, and each client performs adversarial training based on a local dataset to obtain the parameters of the local generator and the parameters of the local discriminator, and uploads the parameters of the local generator and the local discriminator of each client to the server. The server is used to optimize the parameters of the global generator based on the method described in any one of the first aspects.
[0015] Thirdly, embodiments of the present invention provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect or any possible implementation thereof.
[0016] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect or any possible implementation thereof.
[0017] Fifthly, embodiments of the present invention provide a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect or any possible implementation thereof.
[0018] In this embodiment of the invention, only the parameters of the generator and discriminator uploaded by each client need to be obtained, without accessing the original private data of each client, thus ensuring data privacy and security from the data source. By using the local generators uploaded by each client as teacher generators and the aggregated global generator as student generators, a multi-teacher, single-student knowledge distillation paradigm is constructed on the server. This fully utilizes the inherent characteristics of each client in the label-based scenario. Furthermore, by elevating the parameter space to the perceptual feature space, the theoretical defect that linear aggregation in the parameter space cannot guarantee linear additive distribution is fundamentally avoided, making cross-client knowledge fusion theoretically reasonable at the semantic level. When determining the semantic deviation, only effective teacher generators containing the current condition category in the local data are selected, thus effectively avoiding interference from teacher generators from different condition categories. This ensures that the calculated semantic deviation truly reflects the semantic gap between effective teacher generators and student generators, thereby improving the generation quality of the global generator in the label-based scenario. In addition, the distillation trigger condition enables the distillation process to be started on demand, thereby reducing the server distillation computational overhead and significantly improving training efficiency. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating the implementation of the federated generative adversarial network training method provided in this embodiment of the invention. Figure 2 This is an overall framework diagram of Fed-AFD-GAN provided in the embodiments of the present invention; Figure 3 This is a framework diagram of effective teacher screening and multi-teacher feature distillation provided in the embodiments of the present invention; Figure 4 This is a schematic diagram of the deviation-sensing distillation triggering mechanism based on EMA provided in an embodiment of the present invention; Figure 5 This is the FID convergence curve of the generative model under shallow networks provided in this embodiment of the invention; Figure 6 This is the FID convergence curve of the generative model under deep networks provided in this embodiment of the invention; Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0020] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0021] As introduced in the background section, in label-split non-independent and identically distributed scenarios, collaborative training of federated generative adversarial networks (GANs) is used to obtain high-quality global generative models that cover the global category distribution. Compared with common Non-IID (Non-Independent and Identically Distributed) data partitioning based on Dirichlet distribution, label-split methods divide the global category set into several mutually exclusive subsets, ensuring that each client only contains data of a specific category. This represents an extreme case of label distribution shift in Non-IID. In this scenario, each client only possesses partial category data. The research objective is to improve the generation stability and quality of the global generator in this scenario by aligning knowledge across clients, while ensuring data locality. This places higher demands on the training stability and distribution alignment capabilities of federated generative models.
[0022] This invention addresses a tag-based scenario where each client possesses only a mutually exclusive subset of the global category. (Define the client.) k Locally visible category set for: ; And satisfy the following formula , , ; This means that each client is an expert in a specific category and cannot observe data from other categories, leading to client drift. Therefore, our goal is to learn a global generator. G This allows it to characterize the joint distribution of global data. .
[0023] In non-IID scenarios, the distribution of each client is as follows: Significant differences exist, especially in the label-split scenario where the category support domains do not overlap, posing more complex challenges to generative modeling, as detailed below: First, from a distributional perspective, the training objective of generative models is to approximate the real data distribution, and the relationship between their parameters and output distribution is highly nonlinear. Unlike discriminative models, which primarily optimize conditional probabilities, generative models need to characterize the high-dimensional data manifold structure. In this case, linear aggregation in the parameter space (such as FedAvg) does not guarantee the linear additivity of the generated distribution, i.e.: This could lead to the aggregated global model deviating from the true mixture distribution, resulting in an inability to accurately learn the joint distribution of the data.
[0024] Second, in the label-split scenario, each client only observes a subset of categories. And satisfy Therefore, each client actually only learns the data distribution corresponding to a local category. In this case, simple parameter averaging is difficult to maintain consistency in generation among experts of different categories. Instead, it may introduce conflicting updates in the high-level semantic space, causing the aggregated global generator to deviate from any true sub-distribution, ultimately resulting in semantically mixed generation or even pattern collapse.
[0025] Third, generative adversarial networks (GANs) are inherently highly sensitive to training dynamics. In non-IID environments, the optimization objectives of the discriminator and generator differ structurally across different clients. Simple aggregation may disrupt the original adversarial balance, further exacerbating training instability.
[0026] Therefore, in label-split data distribution scenarios, generative models face significant challenges in distribution modeling, category fusion, and training stability. Simple parameter aggregation is insufficient to fully integrate local knowledge from different clients, thus necessitating knowledge alignment in a more semantically stable representation space to mitigate the impact of distribution shifts and enhance the generative capabilities of the global generator.
[0027] To address the aforementioned technical problems, this invention provides a method, system, device, and storage medium for training federated generative adversarial networks.
[0028] See Figure 1 and Figure 2 The document illustrates a flowchart of the federated generative adversarial network training method provided in an embodiment of the present invention, applied to the server side, as detailed below: S110. Obtain the parameters of the local generator and the local discriminator uploaded by each client.
[0029] In this embodiment, each client has its own category subset data. Based on ACGAN, E rounds of local adversarial training are performed to learn the data distribution representation of local class labels, and to obtain the parameters of the local generator and the local discriminator.
[0030] After local training is completed on each client, each client only uploads the parameters of its local generator without sharing the original data. Parameters of the local discriminator Collaborate with the server for updates.
[0031] ACGAN introduces class labels on top of random noise and uses these class labels as conditional inputs to the generator, enabling it to generate samples according to the specified class. Simultaneously, the discriminator, in addition to determining the authenticity of the input samples, also predicts the class to which the samples belong, thus using class-supervised information to guide the training of both the generator and the discriminator.
[0032] S120. Aggregate the parameters of the local generator and the local discriminator uploaded by each client to obtain the parameters of the global generator and the global discriminator after aggregation in the current round. In this context, each teacher generator is a local generator uploaded by each client, and the student generator is the aggregated global generator, thus forming a multi-teacher-single-student knowledge distillation paradigm.
[0033] In some embodiments, the server can aggregate the parameters of the local generator and the local discriminator uploaded by each client according to the respective aggregation weight of each client.
[0034] In this embodiment, the server can determine the aggregation weight of each client based on the number of samples in each client's local training set.
[0035] For example, if the number of samples in the local training set of each client is the same, then the aggregate weights of each client will be the same.
[0036] By performing aggregation, we can obtain the parameters of the global generator after the current round of aggregation. And the parameters of the global discriminator .
[0037] S130. Input the set noise and condition labels into the student generator and the effective teacher generator respectively, map the generated samples of the student generator and the generated samples of the effective teacher generator to the perceptual feature space, and calculate the semantic deviation between the student generator and the effective teacher generator in the current round.
[0038] In some embodiments, in label-split scenarios, each client's local generator only has reliable generation capabilities on its locally visible category set, while its output on unobserved categories lacks effective semantic constraints. If all teacher models are indiscriminately introduced during the distillation process, the generation results from teachers of unobserved categories will participate in the optimization as noise, increasing the risk of negative transfer in student models. Therefore, this invention designs a category masking mechanism, such as... Figure 3 As shown, during the distillation stage, the teacher set is explicitly filtered, retaining only valid teacher generators that have effective generative knowledge for the current condition label.
[0039] In this embodiment, the conditional label refers to the sample category information used during the ACGAN training process. Traditional generative adversarial networks (GANs) typically use only random noise as input, making it impossible to directly control the category of the generated samples. ACGAN introduces category labels on top of the random noise and uses these labels as conditional inputs to the generator, enabling it to generate samples according to the specified category. Simultaneously, the discriminator, in addition to determining the authenticity of the input samples, also predicts the category to which the samples belong, thus using category-supervised information to guide the training of both the generator and the discriminator.
[0040] For example, in the MNIST dataset, the category numbers of the digits 0 to 9 can be used as conditional labels. In the CIFAR-10 dataset, the category numbers corresponding to categories such as airplanes, cars, and birds can be used as conditional labels.
[0041] exist Figure 3 In this model, given noise z and conditional label y, the student generator generates a sample that is mapped to a normalized perceptual feature space. The client generator then acts as the teacher, generating corresponding samples.
[0042] In some embodiments, because the mean squared error (MSE) is directly used for constraints in the pixel space during the generation task, it tends to average the multimodal distribution, making it difficult to characterize high-level semantic consistency, which may lead to visual blurring. Therefore, this invention introduces the Inception network as a perceptual mapping function. The image is mapped to a high-level semantic feature space for alignment.
[0043] In this embodiment, firstly, based on the set condition labels, a teacher generator corresponding to the condition labels is selected from among the teacher generators as the effective teacher generator. Then, the set noise and condition labels are input into the student generator and the effective teacher generator respectively to obtain the corresponding generated samples. Finally, the perceptual features of the generated samples from the student generator and the generated samples from the effective teacher generator are extracted respectively, and the semantic deviation between the student generator and the effective teacher generator in the current round is calculated.
[0044] The perceptual features of the student generator's generated samples and the effective teacher generator's generated samples can be extracted using a perceptual feature extraction network. Then, the average feature distance between the perceptual features of the student generator's generated samples and the effective teacher generator's generated samples is calculated to obtain the semantic deviation of the current round.
[0045] Let x be the input sensing mapping function. The perceptual features of a sample can be represented as: To reduce the dominant effect of differences in feature amplitudes among different samples on optimization, the perceptual feature vector is subjected to... Normalization process: ; in, Representing the eigenvector Norm, This is a numerically stable term. After normalization, the magnitudes of the perceptual feature vectors are unified to similar scales, making the perceptual feature distance primarily reflect semantic differences rather than magnitude differences. This prevents the perceptual feature distance from being dominated by the magnitude of a single teacher or sample. This not only improves the gradient stability and comparability during cross-teacher model alignment but also provides a unified and unbiased metric for subsequent deviation perception mechanisms based on EMA.
[0046] Specifically, during federated generation adversarial training, the server has difficulty directly observing the immediate benefits of distillation to the global generator. To address this, a lightweight distillation benefit evaluation mechanism is introduced to characterize the semantic deviation between the "student generator" and the "effective teacher generator" in the current communication round, providing a basis for subsequent distillation triggers.
[0047] like Figure 4 As shown, the global parameters are obtained through aggregation in the t-th round. Then, the server samples a set of sizes. Evaluation criteria input: ; in, , , To evaluate the sample size, an aggregation generator was used. For students, teachers are grouped as Define the degree of semantic deviation A lightweight assessment of distillation distance: ; in, For in category The effective set of teachers with reliable generative knowledge. Since this estimate is based only on a size of... The randomized evaluation samples, whose computational cost is negligible compared to the complete distillation process, are therefore suitable as proxy signals for online distillation decisions. This statistic directly measures the average semantic deviation between "aggregated students" and "effective teachers."
[0048] The noise is sampled by the server from a standard Gaussian distribution, and the conditional labels are sampled uniformly by the server from a global set of categories. The entire process does not require access to any real data from the client.
[0049] S140. If the semantic deviation of the current round meets the distillation triggering condition, then the global generator is distilled and optimized based on the effective teacher generator to update the parameters of the global generator; otherwise, the distillation optimization of the current round is skipped, and the parameters of the global generator of the current round are retained.
[0050] In some embodiments, a deviation threshold may be calculated first. Then, if the semantic deviation of the current round is greater than the deviation threshold, it is determined that the distillation trigger condition is met, and the global generator is distilled and optimized based on the effective teacher generator to update the parameters of the global generator. If the semantic deviation is less than or equal to the deviation threshold, it is determined that the distillation trigger condition is not met, and the distillation optimization of the current round is skipped, while the parameters of the global generator for the current round are retained.
[0051] In some embodiments, due to the effects of adversarial training and random sampling There are two scenarios: normal training fluctuations and significant concept drift. To distinguish between these two scenarios, an EMA mechanism can be used to model the trend of distillation return estimation and maintain... The EMA trend term.
[0052] In this embodiment, the semantic deviation from the previous round can first be smoothed using an exponential moving average to obtain the historical semantic deviation level. Then, the deviation threshold is obtained by multiplying the historical semantic deviation level by a preset tolerance coefficient.
[0053] Specifically, such as Figure 4 As shown, ; in, Let represent the smoothed distillation return value in round t. The EMA mechanism effectively suppresses short-term random oscillations and focuses more on long-term trends, thus helping to distinguish between normal training fluctuations and systematic semantic drift caused by non-IID data distribution. Based on the smoothed trend estimate, the distillation trigger condition is defined as: ; in, This is the tolerance coefficient. The criterion is based on the principle of relative semantic deviation: if the semantic deviation of the current round is higher than its historical average, it indicates significant cross-client knowledge conflict or semantic shift, in which case distillation can bring higher marginal returns. When At that time, the server initiates feature distillation to correct the global generator; when If the distillation optimization process is skipped, the parameters of the global generator for the current round are retained.
[0054] In some embodiments, after determining that the distillation triggering condition is met, the global generator is distilled and optimized based on the effective teacher generator to update the parameters of the global generator. In this embodiment, the parameters of the effective teacher generator and the parameters of the feature extractor used to map to the perceptual feature space are first frozen, and distillation optimization is performed only on the parameters of the student generator. Then, the average feature distance between the student generator and the effective teacher generator in the perceptual feature space is used as the distillation loss. Finally, with the goal of minimizing the distillation loss, the parameters of the global generator are updated using multi-step gradient descent.
[0055] Specifically, after constructing the multi-teacher perceptual feature distillation target, the server enters the distillation optimization phase. During the distillation optimization phase, the effective teacher generator is frozen. With feature extractor Only the parameters of the student generator are updated. To avoid gradient noise from adversarial training interfering with the distillation process, this stage no longer introduces a discriminator adversarial term, but instead achieves semantic alignment by minimizing the multi-teacher distillation loss.
[0056] The server-side multi-teacher perceptual feature distillation loss is defined as: ; The distillation loss forces the student model to approximate the average semantic representation of all effective teachers in the feature space, while explicitly eliminating noise interference from unobserved class teachers through a class masking mechanism, reducing the risk of negative transfer and improving the reliability of cross-client knowledge fusion.
[0057] Server parameters for student generator Perform S-step gradient descent update. ; in, Let S be the learning rate for distillation and S be the number of update steps in the distillation phase. This process enables the global generator to approximate the "expert consensus" of an effective teacher in the perceptual feature space, thereby achieving cross-client knowledge fusion and semantic alignment without sharing the original data. Since distillation only occurs on the server side, it does not increase the local training overhead on the client side.
[0058] S150. Send the updated global generator parameters or retain the parameters of the current round's global generator and the parameters of the current round's global discriminator to each client to execute the next round of training until the set convergence criteria are met, and then stop training.
[0059] In this embodiment, the server distributes the global generator parameters (optimized by distillation or retained) and the global discriminator parameters obtained from the current round of aggregation to each client, enabling each client to perform the next round of local generative adversarial training based on these parameters. The process of acquiring client model parameters, aggregating model parameters, calculating semantic deviation, adaptive distillation judgment, and distributing global model parameters is repeated until a preset number of training rounds, training iterations, or a preset stopping condition is met.
[0060] This invention only requires obtaining the parameters of the generator and discriminator uploaded by each client, without accessing the original private data of each client, thus ensuring data privacy and security from the data source. By using the local generators uploaded by each client as teacher generators and the aggregated global generator as student generators, a multi-teacher, single-student knowledge distillation paradigm is constructed on the server. This fully utilizes the inherent characteristics of each client in label-based scenarios. Furthermore, by elevating the parameter space to a perceptual feature space, the theoretical defect that linear aggregation in the parameter space cannot guarantee linear additive distribution is fundamentally avoided, making cross-client knowledge fusion theoretically reasonable at the semantic level. When determining semantic deviation, only effective teacher generators containing the current condition category in the local data are selected, effectively avoiding interference from teacher generators from different condition categories, ensuring that the calculated semantic deviation truly reflects the semantic gap between effective teacher generators and student generators. In addition, the distillation trigger condition enables on-demand initiation of the distillation process, thereby reducing the server's distillation computational overhead and significantly improving training efficiency.
[0061] This invention constructs a Fed-AFD-GAN overall framework, which can directly utilize the local generators uploaded by each client to build a multi-teacher set that can provide local prior knowledge. It also designs an EMA-based deviation awareness mechanism to adaptively determine the distillation triggering timing and the selection of effective teachers, thereby improving training stability and generation quality in a highly heterogeneous environment while taking into account computational efficiency.
[0062] Furthermore, this invention does not directly align the generator in the parameter space. Instead, it constrains the semantic approximation relationship of the global generator to each category in the feature space through a multi-teacher perceptual feature distillation module. By perceptual feature mapping and normalization, we ensure that feature distance is no longer dominated by the magnitude of a single teacher or sample. This not only improves the gradient stability and comparability during cross-teacher model alignment but also provides a unified and unbiased metric for subsequent deviation-aware mechanisms based on EMA. Additionally, class masking and multi-teacher distillation loss force the student model to approximate the average semantic representation of all effective teachers in the feature space. Simultaneously, the class masking mechanism explicitly eliminates noise interference from unobserved category teachers, reducing the risk of negative transfer and improving the reliability of cross-client knowledge fusion.
[0063] In the label-split scenario, distillation is not equally necessary in all communication rounds. Therefore, we propose a lightweight evaluation mechanism based on distillation benefits, combined with an EMA-based deviation awareness mechanism, to characterize the degree of deviation between the global model and the client model in the feature space, thereby adaptively triggering the distillation process at appropriate communication rounds.
[0064] In addition, to verify the generation performance of the training method provided by this invention in a label-split heterogeneous scenario, the following experiments were conducted: This invention provides a complete description of the experimental setup, including the experimental environment, dataset partitioning, federated training protocol and optimization configuration, comparison algorithms, and experimental grouping. Unless otherwise specified, all comparison methods use the same backbone network, optimizer configuration, and evaluation protocol to ensure experimental fairness and reproducibility.
[0065] Regarding the experimental environment and dataset: All tests were performed in the same hardware and software environment to avoid performance drift caused by platform differences. Specific configuration: Operating system: Ubuntu 20.04 (Python 3.8, PyTorch 2.0.0, CUDA 11.8); GPU: NVIDIA RTX4090 (24GB) ×1; CPU: Intel Xeon Gold 6430 (16 vCPU); RAM: 120GB. To ensure the reproducibility of experimental results, a fixed random seed was used during both training and evaluation phases, and a fixed evaluation noise / label sequence was used during evaluation to eliminate the impact of sampling randomness. Furthermore, to reduce the overhead of repeatedly loading the Inception feature extractor during multiple evaluations, the evaluation module was implemented using a singleton cache.
[0066] The CIFAR-10 dataset, containing 32×32 color images across 10 categories, is used as the standard benchmark for generative modeling. Input images are normalized during the training phase. To simulate the challenging "category distribution shift" scenario in federated learning, a label-split configuration is employed. All global categories are divided into several mutually exclusive subsets, with each client holding only data for a specific category. This configuration characterizes an extreme heterogeneous scenario of category specialization: each client can only learn the conditional generation distribution of its local category. In this case, a global generator relying solely on FedAvg for parameter aggregation often faces the risk of insufficient category coverage and pattern collapse. Therefore, this partitioning allows for a more thorough test of the effectiveness of our proposed cross-client knowledge fusion mechanism. Although this invention focuses on the extreme label-split scenario, the proposed mechanism is independent of specific data partitioning methods and can be naturally extended to the more general Non-IID scenario based on Dirichlet distribution construction.
[0067] For federated training configurations: Each client performs alternating optimization updates under the ACGAN objective on local data and uploads the model parameters to the server. The server uses FedAvg to aggregate the generator and discriminator parameters and distributes the aggregated global model for the next round of training. Table 1 summarizes the values of the federation protocol, optimizer, and specific parameters. Except for the distillation strategy, all comparison methods share a consistent training protocol and hyperparameter configuration to ensure fairness in the comparison.
[0068] Table 1. Hyperparameters for Federated Training and Local Optimization For the comparison algorithm: To decouple the impact of model capacity (backbone network depth) and server-side collaboration mechanism (distillation scheduling strategy) on generation quality, a two-dimensional comparative design of "backbone architecture × distillation strategy" is adopted, as shown in Table 2. While maintaining consistency in local training protocol, optimizer configuration, and evaluation process, the following three comparison methods are set up: The first type of FedGAN: This method only performs client-side local ACGAN training and server-side FedAvg aggregation, without introducing any additional server-side distillation or adaptive triggering mechanisms. This strategy is used to characterize the performance baseline of pure parameter aggregation in strongly heterogeneous label-split scenarios.
[0069] The second approach, Fed-SFD-GAN (Federated Static Feature Distillation GAN), builds upon the FedGAN baseline by introducing a server-side online feature distillation module and employing a static scheduling strategy: starting from the first round of communication, a distillation update is performed every other round after aggregation. This strategy does not rely on training state feedback; that is, distillation is forcibly triggered in all candidate rounds, serving as a "strongly constrained distillation reference group" to evaluate the generation quality gain brought by continuous feature alignment.
[0070] The third type, Fed-AFD-GAN, is the framework used in this invention. With the same candidate round settings as Fed-SFD-GAN, it further introduces an EMA-based deviation-aware mechanism to control distillation triggering on demand. The server first estimates the perceptual feature deviation between the current global generator and the multi-teacher model using lightweight distillation gains, and then uses historical trends to determine distillation triggering, performing distillation updates only when the deviation significantly increases.
[0071] Table 2 Summary of Experimental Grouping and Comparison Strategies Regarding the evaluation criteria: FID (Fréchet Inception Distance) is used as the core metric for measuring the quality of the generated data. FID is determined by comparing the distribution of real samples. With the distribution of generated samples The second-order statistical differences in the Inception-V3 feature space can simultaneously reflect the realism and diversity of the generated images. The lower the FID value, the closer the generated distribution is to the real distribution, and the better the generation quality.
[0072] Compared to other metrics, FID is more sensitive to mode collapse, making it ideal for evaluating generation performance in heterogeneous label-split scenarios.
[0073] The experimental results and analysis results obtained through the experiment are as follows: First, a quantitative comparison was conducted, and the results are as follows: The quantitative performance of the generative model is mainly reflected by the FID value. Table 3 shows the optimal FID values for various strategies on shallow and deep network architectures.
[0074] Table 3. Comparison of FID performance and overhead of different methods on CIFAR-10 As shown in Table 3, regardless of whether the architecture is shallow or deep, the proposed server-side feature distillation methods (Fed-SFD-GAN and Fed-AFD-GAN) significantly outperform the FedGAN baseline that relies solely on parameter aggregation. This confirms that in the extremely heterogeneous label-split scenario, the feature alignment mechanism can effectively correct the semantic bias caused by parameter aggregation. Specifically, in the shallow architecture, Fed-SFD-GAN reduces the optimal FID value by 4.99 compared to the FedGAN baseline, improving it by approximately 7.93%. In the deep architecture, Fed-SFD-GAN also reduces the optimal FID value by 6.44 compared to the FedGAN baseline, improving it by approximately 16.47%. This indicates that continuous and strong feature constraints, i.e., full distillation in fixed rounds, are crucial for improving model performance.
[0075] The Fed-AFD-GAN adaptive distillation strategy proposed in this invention demonstrates an excellent performance-cost trade-off. In its deep architecture, Fed-AFD-GAN triggers an average of only 66 distillations (compared to 147 distillations in Fed-SFD-GAN, saving 55% of computational overhead), yet achieves an FID value of 33.96, very close to the performance of full distillation (32.67). This indicates that the EMA deviation sensing mechanism can accurately identify key feature drift moments, avoiding the large amount of redundant computation in Fed-SFD-GAN.
[0076] Secondly, training stability and convergence analysis were performed, and the results are as follows: To explore the training dynamics under different strategies, this experiment investigated the training stability and convergence speed. Figure 5 and Figure 6 The FID convergence curves of the model under different strategies are shown.
[0077] In both sets of experiments, the orange dashed lines indicate that FedGAN exhibits a slower convergence speed and shows an oscillating or rebounding trend in the later stages of training. This reflects that in the label-split scenario, simple parameter aggregation is insufficient to maintain the gradient consistency of the generator. The red solid line shows that the FID value of Fed-SFD-GAN decreases most rapidly and smoothly, always remaining at the lowest level, indicating that distillation plays a stabilizing role, and the continuous strong constraints effectively suppress model drift. In Figure 5, due to the weaker model capabilities, shallow networks like Fed-AFD-GAN lag slightly behind Fed-SFD-GAN, but still significantly outperform the FedGAN baseline model, and the curve is much smoother than that of the FedGAN baseline model, demonstrating that dynamic distillation can achieve near-fixed-round distillation results with very few distillation cycles. Figure 6In the diagram, the brown dashed line indicates that the curves of Fed-AFD-GAN and Fed-SFD-GAN fit very closely, especially in the later stages of training, where they almost overlap. This is because Fed-AFD-GAN only triggers distillation when needed, and only performs FedGAN baseline training when the model is stable.
[0078] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0079] The following are system embodiments of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.
[0080] The federated generative adversarial network training system provided in this embodiment of the invention, for ease of explanation, only shows the parts related to this embodiment of the invention, which are described in detail below: A federated generative adversarial network training system, comprising a server and multiple clients; Each client is configured with a local generator and a local adversarial unit, and each client performs adversarial training based on the local dataset to obtain the parameters of the local generator and the local discriminator. The parameters of the local generator and the local discriminator of each client are then uploaded to the server. The server is used to optimize the parameters of the global generator based on any of the methods in the first aspect.
[0081] Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. For example... Figure 7 As shown, the electronic device 7 of this embodiment includes a processor 70 and a memory 71. The memory 71 stores a computer program 72. When the processor 70 executes the computer program 72, it implements the steps in the various method embodiments described above. Alternatively, when the processor 70 executes the computer program 72, it implements the functions of each module / unit in the various system embodiments described above.
[0082] For example, computer program 72 may be divided into one or more modules / units, which are stored in memory 71 and executed by processor 70 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of computer program 72 in electronic device 7.
[0083] Electronic device 7 may include, but is not limited to, processor 70 and memory 71. Those skilled in the art will understand that... Figure 7This is merely an example of electronic device 7 and does not constitute a limitation on electronic device 7. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 7 may also include input / output devices, network access devices, buses, etc.
[0084] The processor 70 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0085] The memory 71 can be an internal storage unit of the electronic device 7, such as a hard disk or RAM. The memory 71 can also be an external storage device of the electronic device 7, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 71 can include both internal and external storage units of the electronic device 7. The memory 71 is used to store the computer program 72 and other programs and data required by the electronic device 7. The memory 71 can also be used to temporarily store data that has been output or will be output.
[0086] For the sake of simplicity and clarity, only the above-described functional modules / units are used as examples. In practical applications, the functions described above can be assigned to different functional modules / units as needed. These modules / units can be implemented in hardware, software, or a combination of both.
[0087] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the methods described in the above-described method embodiments.
[0088] This invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the methods described in the above-described method embodiments.
[0089] Computer programs include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0090] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not detailed or described in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Unless otherwise specified or in conflict with logic, the terminology and / or descriptions between different embodiments are consistent and can be referenced interchangeably. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships.
[0091] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for training federated generative adversarial networks, characterized in that, Applied to the server side, including: Obtain the parameters of the local generator and the local discriminator uploaded by each client; The parameters of the local generator and the local discriminator uploaded by each client are aggregated to obtain the parameters of the global generator and the global discriminator after the current round of aggregation; wherein, each teacher generator is the local generator uploaded by each client, and the student generator is the aggregated global generator; The set noise and condition labels are input into the student generator and the effective teacher generator, respectively. The generated samples of the student generator and the generated samples of the effective teacher generator are mapped to the perceptual feature space, and the semantic deviation between the student generator and the effective teacher generator in the current round is calculated. If the semantic deviation of the current round meets the distillation triggering condition, then the global generator is distilled and optimized based on the effective teacher generator to update the parameters of the global generator; otherwise, the distillation optimization of the current round is skipped, and the parameters of the global generator of the current round are retained. The updated global generator parameters, or the parameters of the current round's global generator and the current round's global discriminator, are sent to each client to execute the next round of training until the set convergence criteria are met, at which point training stops.
2. The federated generative adversarial network training method according to claim 1, characterized in that, The process involves inputting the set noise and conditional labels into the student generator and the effective teacher generator, respectively; mapping the generated samples from the student generator and the effective teacher generator to the perceptual feature space; and calculating the semantic deviation between the student generator and the effective teacher generator in the current round, including: Based on the set condition tags, select the teacher generator that corresponds to the condition tags from each teacher generator, and use it as the effective teacher generator; The set noise and the conditional labels are input into the student generator and the effective teacher generator, respectively, to obtain the corresponding generated samples; The perceptual features of the generated samples from the student generator and the generated samples from the effective teacher generator are extracted respectively, and the semantic deviation between the student generator and the effective teacher generator in the current round is calculated.
3. The federated generative adversarial network training method according to claim 2, characterized in that, The step of extracting the perceptual features of the generated samples from the student generator and the generated samples from the effective teacher generator, and calculating the semantic deviation between the student generator and the effective teacher generator in the current round, includes: Based on the perceptual feature extraction network, the perceptual features of the generated samples of the student generator and the generated samples of the effective teacher generator are extracted respectively; The semantic deviation of the current round is obtained by calculating the average feature distance between the perceptual features of the generated samples from the student generator and the perceptual features of the generated samples from the effective teacher generator.
4. The federated generative adversarial network training method according to claim 3, characterized in that, After extracting the perceptual features of the generated samples from the student generator and the generated samples from the effective teacher generator using the perceptual feature extraction network, the method further includes: The perceptual features of the generated samples from the student generator and the perceptual features of the generated samples from the effective teacher generator are respectively processed by L2 norm normalization.
5. The federated generative adversarial network training method according to claim 1, characterized in that, If the semantic deviation of the current round meets the distillation triggering condition, then the global generator is distilled and optimized based on the effective teacher generator to update the parameters of the global generator; Otherwise, skip the distillation optimization for the current round and retain the parameters of the global generator for the current round, including: Calculate the deviation threshold; If the semantic deviation of the current round is greater than the deviation threshold, and the distillation triggering condition is met, then the global generator is distilled and optimized based on the effective teacher generator to update the parameters of the global generator; If the semantic deviation is less than or equal to the deviation threshold, it is determined that the distillation triggering condition is not met. In this case, the distillation optimization of the current round is skipped, and the parameters of the global generator of the current round are retained.
6. The federated generative adversarial network training method according to claim 5, characterized in that, The calculation of the deviation threshold includes: The semantic deviation from the previous round is smoothed by an exponential moving average to obtain the historical semantic deviation level; The deviation threshold is obtained by multiplying the historical semantic deviation level and the preset tolerance coefficient.
7. The federated generative adversarial network training method according to claim 5, characterized in that, The process of distilling and optimizing the global generator based on the effective teacher generator to update the parameters of the global generator includes: Freeze the parameters of the effective teacher generator and the parameters of the feature extractor used to map to the perceptual feature space, and only perform distillation optimization on the parameters of the student generator; The average feature distance between the student generator and the effective teacher generator in the perceptual feature space is used as the distillation loss. With the goal of minimizing the distillation loss, the parameters of the global generator are updated using multi-step gradient descent.
8. A federated generative adversarial network training system, characterized in that, Includes a server and multiple clients; Each client is configured with a local generator and a local adversarial unit, and each client performs adversarial training based on a local dataset to obtain the parameters of the local generator and the parameters of the local discriminator, and uploads the parameters of the local generator and the local discriminator of each client to the server. The server is used to optimize the parameters of the global generator based on the method described in any one of claims 1-7.
9. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.