A federated learning method and device based on alternating training, equipment and medium

By using a federated learning method based on alternating training, the privacy protection approach is dynamically adjusted, solving the dilemma of balancing existing static single protection methods. This achieves a flexible balance in sensitive data scenarios and improves the usability of federated learning.

CN123180283APending Publication Date: 2026-11-27PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611398695.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-09
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing federated learning privacy protection schemes employ a static and singular privacy protection method throughout all training rounds, which cannot be flexibly adjusted according to the differentiated needs of training tasks. This makes it difficult to balance the strength of privacy protection, model accuracy, and system overhead, resulting in resource waste or privacy leakage risks.

Method used

A federated learning method based on alternating training is adopted. By acquiring task constraint information, the target privacy protection level is determined, and an alternating training strategy is selected according to the level. The round type and protection parameters of different privacy protection methods are dynamically configured to generate an alternating scheduling plan, enabling flexible adjustment between rounds.

Benefits of technology

While meeting the target privacy protection level, it reduces the loss of model accuracy caused by noise and the system overhead of encryption processing, achieving a flexible balance between privacy protection strength, model accuracy and system overhead, and improving the usability of federated learning in sensitive data scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123180283A_ABST
    Figure CN123180283A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, and discloses a federated learning method, device and equipment based on alternating training and a medium. The method comprises the following steps: analyzing privacy protection requirements in task constraint information, and determining a target privacy protection level; selecting a target alternating training strategy in combination with model precision requirements; alternately configuring a round type and protection parameters for each training round, and generating an alternating scheduling plan; a client performs local training and privacy protection processing according to the round type, a server aggregates model update parameters and updates a global model, and an iterative training outputs a target global model. In the application, in view of the problems that an existing federated learning privacy protection mode is static and single, and it is difficult to balance the privacy protection strength, model precision and system overhead, differential privacy rounds, homomorphic encryption rounds and synthetic data rounds are alternately configured between training rounds, the application can be applied to the financial field and the medical field, precision loss is reduced and system overhead is reduced under the premise of meeting the target privacy protection level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a federated learning method, apparatus, device, and medium based on alternating training. Background Technology

[0002] Federated Learning (FL) is a distributed machine learning approach that collaboratively trains a global model without the participating parties sharing their local raw data. Due to its characteristic of "the model moves while the data remains stationary," it has gained widespread attention and application in the financial and medical fields, where data security is paramount. For example, in finance, multiple banks can jointly train a credit risk identification model without exchanging customer transaction details; in healthcare, multiple medical institutions can jointly train a disease screening assistance model without sharing patient medical records and medical images. During the training process of federated learning, clients only upload locally trained model update parameters to the server. The server aggregates the model update parameters uploaded by each client and updates the global model, thereby reducing the possibility of raw data leakage to a certain extent.

[0003] However, related research shows that the model update parameters uploaded by the client still carry information related to the local training data. Attackers can recover the local training data from the model update parameters through privacy reconstruction attacks such as deep gradient leakage attacks and gradient inversion attacks. They can also reconstruct batches of training data from the client through methods such as attacking curious individuals by abandoning honesty or hijacking federation attacks. This poses a privacy risk to sensitive data such as transaction records and account information in the financial field, as well as medical records and medical images in the medical field. To address this, related technologies typically incorporate privacy protection methods in federated learning: one approach uses differential privacy, which adds noise to the model's updated parameters for protection, but this noise can interfere with the model's optimization direction, leading to a loss of model accuracy; another approach uses homomorphic encryption, which supports aggregation calculations of model updated parameters in ciphertext without introducing noise, but suffers from increased communication overhead due to ciphertext expansion and extended computation time due to ciphertext operations; combining differential privacy and homomorphic encryption in the same training round results in both the accuracy loss caused by noise and the system overhead caused by encryption; in addition, another approach introduces synthetic data to replace some real data in training to reduce privacy risks, but relying solely on synthetic data for training makes it difficult to fully learn the distribution of real data, affecting model quality.

[0004] It is evident that existing federated learning privacy protection schemes typically employ a static and singular privacy protection approach throughout all training rounds. This approach cannot be flexibly adjusted based on the differentiated needs of the training task in terms of privacy protection requirements, model accuracy requirements, and system overhead constraints. Consequently, it is difficult to balance the strength of privacy protection, model accuracy, and system overhead. This results in technical problems such as over-protection leading to resource waste and performance degradation, or insufficient protection leading to privacy leakage risks. Summary of the Invention

[0005] This invention provides a federated learning method, apparatus, device, and medium based on alternating training to solve the technical problem that existing federated learning methods, which employ static and single privacy protection methods, make it difficult to balance privacy protection strength, model accuracy, and system overhead.

[0006] Firstly, a federated learning method based on alternating training is provided, including: Obtain task constraint information, parse the privacy protection requirements in the task constraint information, and determine the target privacy protection level; Based on the target privacy protection level and the model accuracy requirements in the task constraint information, a target alternating training strategy is selected from the preset candidate alternating training strategies. Based on the target alternating training strategy, the round type and protection parameters corresponding to different privacy protection methods are configured for each training round, and an alternating scheduling plan is generated. According to the alternating scheduling plan, the current round type and protection parameters are sent to the client, so that the client can perform local training and privacy protection processing to obtain model update parameters; Receive the model update parameters uploaded by the client, perform aggregation processing on the model update parameters according to the round type, and update the global model to obtain the global model for the current round; The global model of the current round is sent to the client to execute the next training round. The process is repeated until the training termination condition is met, and the target global model is output.

[0007] Secondly, a federated learning device based on alternating training is provided, comprising: The level determination module is used to obtain task constraint information, parse the privacy protection requirements in the task constraint information, and determine the target privacy protection level; The strategy selection module is used to select a target alternating training strategy from preset candidate alternating training strategies based on the target privacy protection level and the model accuracy requirements in the task constraint information. The scheduling generation module is used to generate an alternating scheduling plan by configuring the round type and protection parameters corresponding to different privacy protection methods for each training round according to the target alternating training strategy. The alternating training module is used to send the round type and protection parameters of the current round to the client according to the alternating scheduling plan, so that the client can perform local training and privacy protection processing to obtain model update parameters; The model aggregation module is used to receive the model update parameters uploaded by the client, perform aggregation processing on the model update parameters according to the round type, and update the global model to obtain the global model of the current round. The iterative output module is used to send the global model of the current round to the client to execute the next training round, iterate until the training termination condition is met, and output the target global model.

[0008] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described federated learning method based on alternating training.

[0009] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the above-described federated learning method based on alternating training.

[0010] The above-described solution based on the federated learning method, apparatus, device, and medium using alternating training includes: acquiring task constraint information; parsing the privacy protection requirements in the task constraint information to determine the target privacy protection level; selecting a target alternating training strategy from a set of candidate alternating training strategies based on the target privacy protection level and the model accuracy requirements in the task constraint information; configuring the round type and protection parameters corresponding to different privacy protection methods for each training round according to the target alternating training strategy, and generating an alternating scheduling plan; sending the round type and protection parameters of the current round to the client according to the alternating scheduling plan, enabling the client to perform local training and privacy protection processing to obtain model update parameters; receiving the model update parameters uploaded by the client, performing aggregation processing on the model update parameters according to the round type, and updating the global model to obtain the global model of the current round; sending the global model of the current round to the client to execute the next training round, iterating until the training termination condition is met, and outputting the target global model. In this invention, the static and singular privacy protection method used in existing federated learning is difficult to balance privacy protection strength, model accuracy, and system overhead. The target privacy protection level can be determined based on task constraints, and an alternating training strategy can be selected accordingly to generate an alternating scheduling plan. This allows each training round to alternately execute local training, privacy protection processing, and aggregation processing according to different round types such as differential privacy rounds, homomorphic encryption rounds, and synthetic data rounds. The alternation ratio is dynamically adjusted based on the training status. This invention can be applied to business scenarios such as fintech and healthcare. While meeting the target privacy protection level, it reduces the loss of model accuracy caused by noise introduction and lowers the communication and computational overhead of encryption processing. It achieves a flexible balance between privacy protection strength, model accuracy, and system overhead, improving the usability of federated learning in sensitive data scenarios. Attached Figure Description

[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention 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.

[0012] Figure 1 This is a schematic diagram of an application environment for a federated learning method based on alternating training, according to an embodiment of the present invention. Figure 2 This is a flowchart illustrating a federated learning method based on alternating training in one embodiment of the present invention. Figure 3 yes Figure 2 A detailed implementation flow diagram of step S10 Figure 1 ; Figure 4 yes Figure 2 A detailed implementation flow diagram of step S20 Figure 2 ; Figure 5 yes Figure 2 A detailed implementation flow diagram of step S30 Figure 3 ; Figure 6 yes Figure 2 A detailed implementation flow diagram of step S40 Figure 4 ; Figure 7 yes Figure 2 A detailed implementation flow diagram of step S50 Figure 5 ; Figure 8 yes Figure 2 A detailed implementation flow diagram of step S60 Figure 6 ; Figure 9 This is a schematic diagram of a federated learning device based on alternating training in one embodiment of the present invention; Figure 10 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 11 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation

[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0014] The federated learning method based on alternating training provided in this invention can be applied to, for example... Figure 1In this application environment, the client communicates with the server via a network. The server can obtain input conditions, i.e., task constraint information, from the client. This task constraint information includes information describing the training task constraints, such as privacy protection requirements, model accuracy requirements, and system overhead constraints. In this invention, addressing the problem that existing federated learning uses a static, single privacy protection method, which struggles to balance privacy protection strength, model accuracy, and system overhead, the target privacy protection level can be determined based on the task constraint information. Accordingly, a target alternating training strategy is selected and an alternating scheduling plan is generated. This allows each training round to alternately execute local training, privacy protection processing, and aggregation processing according to different round types, such as differential privacy rounds, homomorphic encryption rounds, and synthetic data rounds. The alternation ratio is dynamically adjusted based on the training status. This approach can be applied to business scenarios such as fintech and healthcare. While meeting the target privacy protection level, it reduces model accuracy loss caused by noise introduction and lowers communication and computational overhead from encryption processing. It achieves a flexible balance between privacy protection strength, model accuracy, and system overhead, improving the usability of federated learning in sensitive data scenarios. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will be described in detail below through specific embodiments.

[0015] Please see Figure 2 As shown, Figure 2 A flowchart illustrating a federated learning method based on alternating training, provided in an embodiment of the present invention, includes the following steps S10-S60: S10: Obtain task constraint information, parse the privacy protection requirements in the task constraint information, and determine the target privacy protection level.

[0016] Specifically, Federated Learning (FL) refers to a machine learning approach where multiple clients collaboratively train a global model under the coordination of a server, while retaining the original data locally. Clients are the participating devices that hold local data and perform local training, such as the business servers of banks in the financial sector or the data workstations of hospitals in the medical field. The server is the coordinating device responsible for distributing the global model and aggregating the model update parameters uploaded by each client. Model update parameters are the parameter information obtained by the clients after training based on their local data, used to update the global model, such as the model's gradient or parameter changes. Task constraint information describes the constraints that must be met for this federated learning training task, including privacy protection requirements, model accuracy requirements, and system overhead constraints. Privacy protection requirements describe the privacy protection capabilities required for the training task, such as what types of privacy reconstruction attacks need to be defended against. Model accuracy requirements describe the accuracy metrics that the global model needs to achieve after training. System overhead constraints describe the budgeted range of communication and computing resources that can be used during the training process.

[0017] After obtaining the task constraint information, the privacy protection requirements within the task constraint information are parsed and mapped to a quantifiable and executable target privacy protection level. Here, the privacy protection level refers to a level of privacy protection strength based on the effectiveness of defense against privacy reconstruction attacks, and the target privacy protection level is the level of privacy protection strength that the current training task needs to achieve. For example, in the medical field, medical images and medical records involve sensitive patient information, and the privacy protection requirements of the corresponding training task typically cover various privacy reconstruction attacks, resulting in a higher target privacy protection level. In the financial field, the privacy protection requirements of some marketing assistance model training tasks based on de-identified statistical features are relatively lenient, resulting in a relatively lower target privacy protection level. By unifying the parsing of privacy protection requirements in different forms into a target privacy protection level, a comparable and executable quantitative basis is provided for subsequent steps.

[0018] Combination Figure 3 As shown, step S10 specifically includes: S101: Configure multiple sets of noise parameters for differential privacy and multiple sets of encryption ratios for homomorphic encryption respectively to obtain a set of protection parameter configurations.

[0019] Multiple sets of noise parameters for differential privacy and multiple sets of encryption ratios for homomorphic encryption are configured to obtain a set of protection parameter configurations. Differential privacy (DP) refers to a privacy protection method that adds controlled noise to data or model update parameters, making it difficult for attackers to infer information about any single data point from the output. The noise parameter characterizes the strength of the noise added in differential privacy, and can be represented by the noise standard deviation σ or the privacy budget ε (epsilon). The smaller the privacy budget ε or the larger the noise standard deviation σ, the higher the noise strength and the stronger the privacy protection. Homomorphic encryption (HE) refers to an encryption method that supports direct computation on ciphertext, and the decrypted result is consistent with the result obtained by performing the corresponding computation on plaintext. The encryption ratio refers to the proportion of encrypted parameter components in the model update parameters, which can be denoted as η. The larger the encryption ratio η, the more encrypted parameter components are, and the stronger the privacy protection. For example, multiple sets of noise parameters with noise intensity ranging from weak to strong can be configured, and multiple sets of encryption ratios with values ​​ranging from low to high up to full encryption can be configured. The noise parameters and encryption ratios of each set are summarized to obtain a set of protection parameter configurations covering different protection intensity levels, which can be used as input for subsequent simulation tests.

[0020] S102: Perform simulation tests of privacy reconstruction attacks under each group of configurations in the protection parameter configuration set, and count the attack success rate; wherein, the privacy reconstruction attacks include deep gradient leakage attacks, gradient inversion attacks, attacks where the curious party abandons honesty, and hijacking federation attacks.

[0021] Simulation tests of privacy reconstruction attacks were performed under various configurations within the protection parameter configuration set, and the attack success rate was statistically analyzed. Privacy reconstruction attacks refer to attacks where the attacker recovers or reconstructs local training data based on model update parameters uploaded by the client. This embodiment uses four representative privacy reconstruction attacks for simulation tests: Deep Leakage from Gradients (DLG) – By iteratively optimizing virtual samples, the gradients generated by the virtual samples approximate the real gradients uploaded by the client, thereby recovering the training data; Gradient Inversion Attack – Based on Deep Leakage from Gradients (DLG), this attack introduces prior constraints, enabling the recovery of training images from shared gradients with high fidelity; Curious Abandons Honesty (CAH) – An untrusted server constructs a specially designed global model and distributes it to the client, reconstructing the training data from the model update parameters by inducing client training; and Robbing the Fed (RTF) – By implanting specific parameter structures into the global model, this attack reconstructs batch training data from the client. During simulation testing, a federated learning simulation environment similar to the actual task can be built. For example, in the financial field, simulated transaction data samples can be used, and in the medical field, publicly available medical image data samples can be used to construct test datasets. Under each set of protection parameter configurations, the local training and model update parameter upload process of the client can be simulated. The four privacy reconstruction attacks mentioned above can be launched respectively, and the percentage of samples that successfully recover training data for each attack can be counted to obtain the attack success rate for each attack under each configuration. The success of the attack can be determined based on the similarity index between the recovered data and the original data. If the similarity exceeds the judgment threshold, the attack is considered successful.

[0022] S103: The minimum configuration with an attack success rate lower than a preset threshold is designated as the privacy protection level for defending against the corresponding privacy reconstruction attack.

[0023] The minimum configuration with an attack success rate below a preset threshold is designated as the privacy protection level for defending against the corresponding privacy reconstruction attack. The preset threshold is a pre-set upper limit for the attack success rate used to determine if an attack has been effectively defended; for example, the preset threshold can be set to 0.5%. Specifically, for each privacy reconstruction attack, the configuration corresponding to the minimum noise intensity that causes the attack success rate to fall below the preset threshold is found among multiple sets of noise parameters, and the configuration corresponding to the minimum encryption ratio that causes the attack success rate to fall below the preset threshold is found among multiple sets of encryption ratios. The found minimum configuration is designated as the privacy protection level for defending against that privacy reconstruction attack. Understandably, the minimum configuration required to defend against different privacy reconstruction attacks varies. For example, the noise parameters and encryption ratios required to defend against deep gradient leakage attacks are relatively lenient, while the noise parameters and encryption ratios required to defend against hijacking federation attacks are relatively strict. Therefore, corresponding privacy protection levels are designated for deep gradient leakage attacks, gradient inversion attacks, attacks where curious individuals abandon honesty, and hijacking federation attacks. This calibration method, which uses the attack and defense effect as a unified metric, allows differential privacy based on noise parameters and homomorphic encryption based on encryption ratios to be compared and configured within the same level system.

[0024] S104: Determine the infimum and supremum based on the most stringent level for defending against all attacks and the most lenient level for defending against any attack.

[0025] Based on the most stringent level for defending against all attacks and the most lenient level for defending against any single attack, the infimum and superfimum are determined. The infimum level refers to the privacy protection level corresponding to the most stringent parameter configuration required to simultaneously defend against all four privacy reconstruction attacks: deep gradient leakage attacks, gradient inversion attacks, "curious party abandons honesty" attacks, and hijacking federation attacks. The superfimum level refers to the privacy protection level corresponding to the most lenient parameter configuration required to defend against any one of these four privacy reconstruction attacks. Furthermore, between the infimum and superfimum levels, several standard levels can be set according to commonly used differential privacy strengths to obtain a privacy protection level sequence arranged from lenient to stringent, in order to match different levels of privacy protection requirements.

[0026] S105: Based on the privacy protection requirements, determine the target privacy protection level by matching from the specified privacy protection levels.

[0027] Based on privacy protection requirements, a target privacy protection level is determined by matching against a set of categorized privacy protection levels. Specifically, the privacy protection requirements specify the types of privacy reconstruction attacks that need to be defended against or the required protection strength, and these are matched against the categorized privacy protection levels: when the privacy protection requirements specify the need to defend against all known privacy reconstruction attacks, the lowerfimum level is determined as the target privacy protection level; when the privacy protection requirements only specify the need to defend against a specific type of attack, the privacy protection level corresponding to that attack is determined as the target privacy protection level. For example, in the medical field, when multiple hospitals jointly train a medical image lesion recognition model, the lesion images are closely related to the patient's identity, and the privacy protection requirements are typically to defend against all privacy reconstruction attacks, including hijacking federation attacks. In this case, the lowerfimum level is matched as the target privacy protection level. In the financial field, when multiple institutions jointly train a marketing response prediction model based on historical transaction features, the privacy protection requirements can be to defend against deep gradient leakage attacks. In this case, the privacy protection level corresponding to deep gradient leakage attacks is matched as the target privacy protection level. Through the above steps S101 to S105, the subjectively described privacy protection requirements are transformed into target privacy protection levels with empirical evidence, providing a unified quantitative basis for the subsequent selection of target alternating training strategies.

[0028] S20: Based on the target privacy protection level and the model accuracy requirements in the task constraint information, select a target alternating training strategy from the preset candidate alternating training strategies.

[0029] Specifically, after determining the target privacy protection level, the method for organizing privacy protection processing between training rounds is further determined based on the model accuracy requirements of the training task. This involves selecting the target alternating training strategy from a pre-set set of candidate alternating training strategies. The candidate alternating training strategies refer to a pre-defined set of strategies that alternately use different privacy protection methods at the training round granularity. These include privacy mechanism alternating strategies, synthetic data and differential privacy alternating strategies, and synthetic data and homomorphic encryption alternating strategies. The privacy mechanism alternating strategy refers to alternating the use of differential privacy and homomorphic encryption in consecutive training rounds. Synthetic data refers to training data artificially generated by the generative model that does not directly correspond to any real samples. The synthetic data and differential privacy alternating strategy refers to alternating the use of local real data with differential privacy protection in training rounds with synthetic data training rounds. The synthetic data and homomorphic encryption alternating strategy refers to alternating the use of local real data with homomorphic encryption protection in training rounds with synthetic data training rounds.

[0030] Understandably, different candidate alternating training strategies each have their own emphasis on privacy protection strength, model accuracy, and system overhead, and are adapted to the constraints of the training task. By using the target privacy protection level and model accuracy requirements as the selection criteria, the trade-off judgment that originally relied on human experience can be transformed into an automatically executed selection logic, improving the efficiency of strategy configuration and its adaptability to different tasks.

[0031] Combination Figure 4 As shown, step S20 specifically includes: S201: Extract model accuracy requirements and system overhead constraints from the task constraint information, and obtain preset candidate alternating training strategies; wherein, the candidate alternating training strategies include privacy mechanism alternating strategy, synthetic data and differential privacy alternating strategy, and synthetic data and homomorphic encryption alternating strategy.

[0032] The model accuracy requirements and system overhead constraints are extracted from the task constraint information, and pre-defined candidate alternating training strategies are obtained. The model accuracy requirement can be characterized by the accuracy metric that the target global model needs to achieve on the validation dataset, such as a classification accuracy no lower than a pre-defined accuracy value. System overhead constraints include communication overhead constraints and computational overhead constraints. Communication overhead constraints can be characterized by the upper limit of the amount of data allowed to be transmitted during training, and computational overhead constraints can be characterized by the upper limit of the computation time allowed during training. The pre-defined candidate alternating training strategies include a privacy mechanism alternating strategy, a synthetic data and differential privacy alternating strategy, and a synthetic data and homomorphic encryption alternating strategy, each corresponding to different round organization methods: the privacy mechanism alternating strategy trains all rounds based on local real data, balancing accuracy and overhead through alternating rounds of differential privacy and homomorphic encryption; the synthetic data and differential privacy alternating strategy uses noise protection in the real data rounds, with zero encryption processing overhead and low overall system overhead; the synthetic data and homomorphic encryption alternating strategy uses encryption protection in the real data rounds, without introducing noise in the real data rounds, achieving high levels of privacy protection and model accuracy, but with relatively increased communication overhead.

[0033] S202: When both the target privacy protection level and the model accuracy requirement are higher than the predetermined value, the privacy mechanism alternation strategy is selected.

[0034] When both the target privacy protection level and model accuracy requirements exceed predetermined values, an alternating privacy mechanism strategy is selected. The predetermined values ​​are pre-set thresholds used to distinguish between high and low requirements. For the target privacy protection level, the predetermined value can be set to a specific level in the privacy protection level sequence, such as the level that defends against attacks from curious individuals who abandon honesty. For the model accuracy requirements, the predetermined value can be set to a specified accuracy metric. Understandably, the alternating privacy mechanism strategy uses homomorphic encryption in some training rounds. Homomorphic encryption does not introduce noise into the model's parameter updates, thus providing strong privacy protection while reducing accuracy loss. Differential privacy is used in the remaining training rounds, avoiding the cumulative overhead of encryption across all training rounds. Therefore, this strategy is suitable for training tasks with both high privacy protection strength and high model accuracy requirements, and can maintain model accuracy well under strong protection. For example, in the financial sector, when multiple banking institutions jointly train a transaction anti-fraud identification model, the transaction data is highly sensitive, and the accuracy of fraud identification is directly related to fund security. The target privacy protection level and model accuracy requirements are both higher than predetermined values. In this case, an alternating privacy mechanism strategy is chosen. In the medical field, when multiple hospitals jointly train a disease diagnosis assistance model, the privacy protection requirements for medical record data and the accuracy requirements for diagnosis assistance are also high. An alternating privacy mechanism strategy is also chosen.

[0035] S203: When only the target privacy protection level is higher than the predetermined value, select the synthetic data and differential privacy alternation strategy.

[0036] When only the target privacy protection level is higher than a predetermined value (i.e., the target privacy protection level is higher than the corresponding predetermined value while the model accuracy requirement is not higher than the corresponding predetermined value), a strategy of alternating between synthetic data and differential privacy is selected. Understandably, in this strategy, the model update parameters in the synthetic data round can be transmitted without encryption, and the computational cost of noise addition processing in the differential privacy round is also relatively small. Therefore, this strategy has low communication and computational overhead, making it suitable for training tasks that are more sensitive to computational costs and where model accuracy requirements can be appropriately relaxed. Simultaneously, alternating between synthetic data rounds and differential privacy rounds reduces the number of rounds in which local real data participates in training, supporting privacy protection strength from both data source and parameter protection perspectives. For example, in the financial field, the training task of a marketing auxiliary model for customer segmentation has high requirements for customer data privacy protection but relatively relaxed requirements for model accuracy. In this case, the strategy of alternating between synthetic data and differential privacy is selected to complete training with lower system overhead. In the medical field, this strategy can also be used for auxiliary models used for analyzing patient visit trends.

[0037] S204: When the selected strategy does not meet the target privacy protection level, select the synthetic data and homomorphic encryption alternation strategy.

[0038] When the selected strategy fails to meet the target privacy protection level, an alternating strategy of synthetic data and homomorphic encryption is chosen. Specifically, based on the protection parameter range corresponding to each privacy protection level specified in step S10, it can be verified whether the currently selected strategy can achieve the target privacy protection level within its configurable noise parameter or encryption ratio range. For example, if the alternating strategy of synthetic data and differential privacy requires increasing the noise parameter to the point that the resulting accuracy loss exceeds an acceptable range in order to achieve the target privacy protection level, it is determined that the strategy fails to meet the target privacy protection level. In this case, the target alternating training strategy is replaced with the alternating strategy of synthetic data and homomorphic encryption. Understandably, the alternating strategy of synthetic data and homomorphic encryption uses homomorphic encryption protection in the training rounds with local real data, providing a high level of privacy protection without relying on noise intensity. At the same time, the synthetic data rounds are transmitted in plaintext, making the overall system overhead of this strategy lower than that of performing encryption in all training rounds, thereby controlling system overhead while meeting the target privacy protection level. For example, in the medical field, joint modeling tasks based on rare disease medical records face scarce samples and stringent privacy protection requirements. When the alternating strategy of synthetic data and differential privacy cannot achieve the target privacy protection level within an acceptable noise range, the alternating strategy of synthetic data and homomorphic encryption is selected for training. Through the selection logic constituted by the above steps S201 to S204, the process of determining the target alternating training strategy is realized, with the target privacy protection level as a prerequisite, the model accuracy requirement as a distinguishing condition, and the strategy verification as a fallback condition.

[0039] S30: Based on the target alternating training strategy, configure the round type and protection parameters corresponding to different privacy protection methods for each training round, and generate an alternating scheduling plan.

[0040] Specifically, once the target alternating training strategy is determined, it needs to be implemented as a specific configuration for each training epoch, i.e., generating an alternating scheduling plan. The epoch type refers to the category of privacy protection methods used in each training epoch, including differential privacy epochs, homomorphic encryption epochs, and synthetic data epochs: Differential privacy epochs refer to training epochs where the client trains based on local real data and adds noise protection to the model update parameters according to the noise parameters; homomorphic encryption epochs refer to training epochs where the client trains based on local real data and performs encryption protection on the model update parameters according to the encryption ratio; synthetic data epochs refer to training epochs where the client trains based on synthetic data and the model update parameters are transmitted in plaintext. Protection parameters refer to the parameters required for privacy protection processing in each training epoch, including the noise parameters of the differential privacy epoch and the encryption ratio of the homomorphic encryption epoch. The alternating scheduling plan records the epoch type and corresponding protection parameters for each training epoch. It orchestrates different privacy protection methods at the training epoch granularity and serves as the basis for the federated learning system to execute alternating training.

[0041] Combination Figure 5 As shown, step S30 specifically includes: S301: Determine the alternation ratio of different round types in the training rounds according to the target alternation training strategy, and obtain the alternation ratio parameter.

[0042] The alternation ratio parameter is obtained by determining the alternation ratio of different round types in the training rounds based on the target alternation training strategy. This alternation ratio parameter characterizes the proportional relationship between each round type in the training rounds. For example, when the target alternation training strategy is a privacy mechanism alternation strategy, the alternation ratio parameter is the ratio between homomorphic encryption rounds and differential privacy rounds, for example, set to one homomorphic encryption round and three differential privacy rounds in every four training rounds, i.e., a ratio of 1:3; when the target alternation training strategy is a synthetic data and differential privacy alternation strategy, the alternation ratio parameter is the ratio between differential privacy rounds and synthetic data rounds, for example, set to 1:1; when the target alternation training strategy is a synthetic data and homomorphic encryption alternation strategy, the alternation ratio parameter is the ratio between homomorphic encryption rounds and synthetic data rounds. Understandably, the alternation ratio parameter is a modulating parameter that adjusts the relationship between privacy protection strength, model accuracy, and system overhead: increasing the proportion of homomorphic encryption rounds reduces noise introduction and improves model accuracy, but communication and computational overhead increase accordingly; increasing the proportion of differential privacy rounds reduces system overhead, but increases accuracy loss due to noise; increasing the proportion of synthetic data rounds reduces communication overhead and exposure to real data, but decreases the model's learning sufficiency of the real data distribution. Therefore, determining the alternation ratio parameter based on the target privacy protection level, model accuracy requirements, and system overhead constraints allows us to find a more balanced configuration point between model accuracy and system overhead along the Pareto Front composed of different alternation ratios, while satisfying privacy protection requirements. For example, in the anti-fraud identification model training task in the financial field, to maintain high accuracy, the proportion of homomorphic encryption rounds can be appropriately increased within the allowable range of system overhead constraints; in the medical field, when the communication resources of the participating primary healthcare institutions are limited, the proportion of differential privacy rounds or synthetic data rounds can be appropriately increased to control communication overhead.

[0043] S302: Alternately assign round types to each training round according to the alternating ratio parameter to obtain a round type sequence; wherein, the round types include differential privacy rounds, homomorphic encryption rounds, and synthetic data rounds.

[0044] The training rounds are alternately assigned round types according to an alternation ratio parameter, resulting in a round type sequence. This round type sequence refers to the sequence formed by arranging the round types of each round in chronological order. For example, assuming a total of one hundred training rounds, when the alternation ratio parameter is 1:3 (homomorphic encryption rounds to differential privacy rounds), the rounds can be cyclically assigned in the following order: differential privacy rounds, differential privacy rounds, differential privacy rounds, homomorphic encryption rounds. That is, rounds 1-3 are differential privacy rounds, round 4 is homomorphic encryption rounds, rounds 5-7 are differential privacy rounds, round 8 is homomorphic encryption rounds, and so on until round 100. When the alternation ratio parameter is 1:1 (differential privacy rounds to synthetic data rounds), the rounds can be alternately assigned in the following manner: odd-numbered rounds are differential privacy rounds, and even-numbered rounds are synthetic data rounds. Furthermore, the arrangement of round types in the sequence can adopt a uniform periodicity or a non-uniform arrangement based on the characteristics of the training phase. For example, in the early stage of training, the density of synthetic data rounds can be appropriately increased to achieve the initial convergence of the global model with lower overhead; in the later stage of training, the density of homomorphic encrypted rounds can be appropriately increased to refine the parameters of the global model without introducing noise, which is beneficial to the final accuracy improvement.

[0045] S303: Configure noise parameters for the differential privacy wheel in the round type sequence and configure encryption ratio for the homomorphic encryption wheel to obtain protection parameters.

[0046] The protection parameters are obtained by configuring noise parameters for the differential privacy rounds in the round-type sequence and encryption ratios for the homomorphic encryption rounds. Specifically, based on the correspondence between the privacy protection level and parameter configuration as defined in step S10, parameter values ​​matching the target privacy protection level are selected: noise parameters characterized by the noise standard deviation σ or privacy budget ε are configured for each differential privacy round in the round-type sequence, and encryption ratio η is configured for each homomorphic encryption round. For example, in medical image modeling tasks in the medical field, when the target privacy protection level is the lowerfimum level, stronger noise parameters corresponding to the lowerfimum level are configured for the differential privacy rounds, and higher encryption ratios corresponding to the lowerfimum level are configured for the homomorphic encryption rounds; in marketing-assisted modeling tasks in the financial field where privacy protection requirements are relatively lenient, when the target privacy protection level is the level corresponding to defense against deep gradient leakage attacks, relatively weaker noise parameters and relatively lower encryption ratios are configured to reduce accuracy loss and lower system overhead.

[0047] S304: Set the model update transmission mode of the synthetic data round in the round type sequence to plaintext transmission.

[0048] The model update transmission method for the synthetic data round in the round type sequence is set to plaintext transmission. Plaintext transmission means that the model update parameters are uploaded directly to the server in plaintext form without noise addition or encryption. Understandably, the synthetic data used in the synthetic data round is artificially generated data that does not directly correspond to any real samples. The model update parameters trained based on the synthetic data do not carry the privacy information of the local real data. Therefore, there is no need to perform noise addition or encryption; they can be transmitted directly in plaintext without incurring additional privacy protection overhead or introducing accuracy interference caused by noise. By setting the synthetic data round to plaintext transmission, the synthetic data round becomes a round type with lower system overhead in the alternating scheduling plan, providing room for reducing overall system overhead.

[0049] S305: Associate the round type sequence and the protection parameters according to the training round to generate an alternating scheduling plan.

[0050] The round type sequence and protection parameters are associated with each training round to generate an alternating scheduling plan. Specifically, using the round number as an index, the round type of each training round, along with the corresponding noise parameters, encryption ratio, or plaintext transmission settings, are associated and stored to form an alternating scheduling plan covering all training rounds. For example, one scheduling record in the alternating scheduling plan can be represented as: round number 4, round type homomorphic encryption round, protection parameter encryption ratio η; another scheduling record can be represented as: round number 5, round type synthetic data round, transmission method plaintext transmission. The generated alternating scheduling plan is stored on the server side before being distributed, serving as a unified basis for coordinating the client and server to execute alternating training in subsequent training rounds.

[0051] S40: According to the alternating scheduling plan, the round type and protection parameters of the current round are sent to the client, so that the client can perform local training and privacy protection processing to obtain model update parameters.

[0052] Specifically, after the alternating scheduling plan is generated, federated learning enters the alternating training phase, which is executed round by round according to the plan. In each training round, the server sends the round type and privacy protection parameters to the client according to the alternating scheduling plan. The client determines the source of training data and the privacy protection processing method to be used in this round based on the received round type, and completes the model training and corresponding privacy protection processing locally to obtain the model update parameters. Here, local training refers to the process of the client training the global model sent by the server based on local data; privacy protection processing refers to the noise addition, encryption, and other processing performed by the client on the model update parameters according to the round type before uploading the model update parameters. By having the server uniformly send the round type and protection parameters according to the alternating scheduling plan, each client performs consistent privacy protection processing within the same training round, ensuring the coordinated execution of the alternating scheduling plan throughout the federated learning system.

[0053] Combination Figure 6 As shown, step S40 specifically includes: S401: Before the start of each training round, read the scheduling record of the current round in the alternating scheduling plan, and broadcast the round type and protection parameters of the current round to the client.

[0054] Before each training round begins, the server reads the scheduling record for the current round from the alternating scheduling plan and broadcasts the round type and protection parameters to the clients. Specifically, before each training round begins, the server reads the corresponding scheduling record from the alternating scheduling plan using the round number as an index, and broadcasts the round type and protection parameters to each client participating in this round of training. This coordinates the clients and server to execute the local training, encryption, decryption, and aggregation processes corresponding to the round type. For example, when the current round in the alternating scheduling plan is a differential privacy round, the broadcast content includes the round type as differential privacy round and the corresponding noise parameters; when the current round is a homomorphic encryption round, the broadcast content includes the round type as homomorphic encryption round and the corresponding encryption ratio η; when the current round is a synthetic data round, the broadcast content includes the round type as synthetic data round and plaintext transmission settings. After receiving the broadcast, each client executes the processing flow for this round according to the same round type.

[0055] S402: In the differential privacy round, the client is controlled to train the model update parameters based on local real data and add noise according to the protection parameters.

[0056] In the differential privacy round, the client trains the model update parameters based on local real data and adds noise according to the protection parameters. Local real data refers to real business data held locally by the client, such as transaction records and credit records stored locally by banks in the financial sector, or medical records and medical images stored locally by hospitals in the medical field. Specifically, the client uses the global model distributed by the server as the initial model, performs local training based on local real data, and obtains the model update parameters. Then, the model update parameters are pruned, limiting their values ​​to a preset range to control the impact of individual samples on the model update parameters. Next, noise of appropriate intensity is added to the pruned model update parameters according to the broadcast noise parameters; for example, Gaussian noise is generated according to the noise standard deviation σ and superimposed on each parameter component to obtain the noise-added model update parameters, which are then uploaded to the server. Through this noise-adding process, even if an attacker obtains the uploaded model update parameters, it is difficult for them to recover local real data such as transaction records and medical records through privacy reconstruction attacks such as deep gradient leakage attacks and gradient inversion attacks.

[0057] S403: In the homomorphic encryption round, the client is controlled to filter sensitive parameters in the model update parameters according to the gradient magnitude and perform selective homomorphic encryption.

[0058] In the homomorphic encryption round, the client controls the selection of sensitive parameters from the model update parameters based on their gradient magnitude and performs selective homomorphic encryption. Gradient magnitude refers to the absolute value of the gradient of each parameter component in the model update parameters; sensitive parameters are those with larger gradient magnitudes and a higher degree of information carrying over the local real data; Selective Homomorphic Encryption (S-HE) refers to an encryption method that only performs homomorphic encryption on the selected sensitive parameters, while keeping the remaining parameter components in plaintext. Specifically, after the client trains the model update parameters based on local real data, it sorts the parameter components according to their gradient magnitudes, selecting the parameter components with the top η gradient magnitudes as sensitive parameters, where η is the encryption ratio for broadcast. Then, the sensitive parameters are encrypted using a homomorphic encryption algorithm to obtain ciphertext parameters, while the remaining parameter components remain in plaintext. The ciphertext and plaintext parameters are then uploaded to the server as the model update parameters for this round. Understandably, compared to encrypting all parameter components, selective homomorphic encryption protects highly sensitive parameters while reducing communication overhead caused by ciphertext expansion and computational overhead caused by ciphertext operations. Furthermore, since homomorphic encryption rounds do not introduce noise into model parameter updates, the training contribution of each round is unaffected by noise, which is beneficial for maintaining the overall model accuracy. For example, in the financial field, parameter components closely related to fraud features in anti-fraud identification models have large gradient magnitudes and are selected as sensitive parameters for encryption protection; similarly, in the medical field, parameter components closely related to lesion features in lesion identification models are also protected in ciphertext form.

[0059] S404: In the synthetic data round, the client is controlled to generate synthetic data through a diffusion model trained with differential privacy, and the model update parameters are trained to obtain the model update parameters.

[0060] In the synthetic data round, the client generates synthetic data using a diffusion model trained with differential privacy and trains the model to obtain update parameters. The diffusion model is a generative model that generates new data by progressively adding noise to the data and learning an inverse denoising process. The differentially privacy-trained diffusion model incorporates a differential privacy mechanism during its training process, ensuring differential privacy protection. The generated synthetic data does not carry privacy information traceable to a single real sample, avoiding new privacy leakage channels caused by the introduction of synthetic data. Specifically, the client pre-trains the diffusion model with differential privacy on local real data. In the synthetic data round, the client uses this diffusion model to generate synthetic data with a distribution similar to the local real data. For example, in the financial field, it generates simulated transaction samples with real transaction statistical characteristics; in the medical field, it generates simulated image samples with lesion morphology characteristics. Subsequently, the client performs local training on the global model distributed by the server based on the synthetic data, obtains the model update parameters, and uploads them directly according to the plaintext transmission method set in the alternating scheduling plan. Understandably, the model update parameters in the synthetic data round do not require noise addition or encryption processing, and the communication and computational overhead of this round is low. At the same time, the synthetic data continues the distribution information of the real data, enabling the global model to still obtain effective training contributions in low-overhead rounds.

[0061] S50: Receive the model update parameters uploaded by the client, perform aggregation processing on the model update parameters according to the round type, and update the global model to obtain the global model for the current round.

[0062] Specifically, after each client completes local training and privacy protection processing for its current round, it uploads the model update parameters to the server, which then performs aggregation processing. Aggregation processing refers to the server's process of merging the model update parameters uploaded by multiple clients into a global update result. Understandably, the form of the model update parameters differs depending on the round type: the model update parameters uploaded in differential privacy rounds and synthetic data rounds are in plaintext form, while those uploaded in homomorphic encryption rounds contain both ciphertext and plaintext parameters. Therefore, the server needs to determine the appropriate aggregation method based on the round type and update the global model after aggregation to obtain the global model for the current round. Through aggregation processing adapted to the round type, the server completes the global model update without accessing the plaintext content of sensitive parameters.

[0063] Combination Figure 7 As shown, step S50 specifically includes: S501: The server receives the model update parameters uploaded by the client and determines the aggregation method according to the round type of the current round.

[0064] The server receives model update parameters uploaded by the client and determines the aggregation method based on the current round type. Specifically, the server identifies the round type based on the scheduling record of the current round in the alternating scheduling plan: when the round type is a differential privacy round or a synthetic data round, a weighted aggregation method in plaintext form is used; when the round type is a homomorphic encryption round, a combination of ciphertext and plaintext aggregation is used. By identifying the round type before executing the aggregation, the aggregation process on the server side is consistent with the privacy protection processing on the client side, avoiding mismatches between the aggregation method and the parameter form.

[0065] S502: In the differential privacy round and the synthetic data round, weighted aggregation is performed on the plaintext model update to obtain the plaintext aggregation result.

[0066] In the differential privacy round and the synthetic data round, weighted aggregation is performed on the plaintext model updates to obtain the plaintext aggregation result. Weighted aggregation refers to a method of aggregation in which the model update parameters of each client are weighted and summed according to the aggregation weights set for each client. The aggregation weights are determined based on the number of samples each client participated in during this training round; clients with more samples have larger aggregation weights. For example, in the financial field, multiple banks participating in joint training hold different sample sizes; weighting by sample size allows the global model update to more fully reflect the data distribution information carried by institutions with larger sample sizes. In the medical field, model update parameters uploaded by multiple hospitals are similarly weighted and aggregated according to the number of case samples each hospital participated in training. Understandably, for the differential privacy round, noise has been added to the model update parameters uploaded by each client. During the weighted aggregation process, the noise from different clients is superimposed and averaged. The interference of noise on the aggregation result decreases as the number of participating clients increases, thus maintaining the availability of the aggregation result while protecting the data of individual clients. For the synthetic data round, the plaintext model update parameters can be directly weighted and aggregated, and the aggregation process does not incur encryption or decryption overhead.

[0067] S503: In the homomorphic encryption round, ciphertext aggregation is performed on the ciphertext parameters and plaintext aggregation is performed on the plaintext parameters to obtain a mixed aggregation result.

[0068] In the homomorphic encryption round, ciphertext aggregation is performed on ciphertext parameters, and plaintext aggregation is performed on plaintext parameters to obtain a hybrid aggregation result. Ciphertext aggregation refers to a weighted summation method that utilizes the property of homomorphic encryption supporting ciphertext operations to directly perform weighted summation on the ciphertext parameters uploaded by each client without decryption. Specifically, the server aligns the model update parameters uploaded by each client according to their position, performs ciphertext aggregation on the ciphertext portions that are sensitive parameters, obtaining a ciphertext aggregated portion; performs the same weighted aggregation as in step S502 on the remaining plaintext parameters, obtaining a plaintext aggregated portion; and combines the ciphertext aggregated portion and the plaintext aggregated portion to form the hybrid aggregation result. Understandably, throughout the entire ciphertext aggregation process, the server does not possess the decryption key and cannot obtain the plaintext content of sensitive parameters. Therefore, even if the server has a spying intent, it is difficult to initiate privacy inferences based on sensitive parameters, preventing privacy reconstruction attacks from the server side, such as the "when curious, abandon honesty" attack and hijacking federation attack.

[0069] S504: Send the ciphertext aggregation portion of the hybrid aggregation result to the client for decryption to obtain the decrypted aggregation result.

[0070] The encrypted aggregate portion of the hybrid aggregation result is sent to the client for decryption, yielding the decrypted aggregation result. Specifically, the decryption key for homomorphic encryption is held by the client. The server sends the encrypted aggregate portion to the client, which uses the decryption key to decrypt it, obtaining the plaintext aggregate value corresponding to the sensitive parameters. This plaintext aggregate value, together with the plaintext aggregate portion from the hybrid aggregation result, constitutes the decrypted aggregation result. Understandably, the sent encrypted aggregate portion is the result of aggregating model update parameters from multiple clients. Each client, after decryption, only obtains the aggregate value and cannot separate the model update parameters uploaded by other clients, thus maintaining privacy isolation between clients. For example, in the financial field, any participating bank institution decrypts the aggregate value of its model updates, unable to infer the transaction data characteristics of other institutions; similarly, in the medical field, any participating hospital cannot reconstruct the medical record data of other hospitals from the aggregate value.

[0071] S505: Update the global model based on the plaintext aggregation result or the decrypted aggregation result to obtain the global model for the current round.

[0072] The global model is updated based on the plaintext aggregation result or the decrypted aggregation result to obtain the global model for the current round. Specifically, in the differential privacy round and the synthetic data round, the plaintext aggregation result is used as the global update quantity; in the homomorphic encryption round, the decrypted aggregation result is used as the global update quantity. The global update quantity is then added to the corresponding parameters of the global model according to a preset update step size to complete the update of the global model and obtain the global model for the current round. The global model for the current round integrates the training contributions of each client under the corresponding privacy protection method in this round, serving as the model basis for subsequent training rounds.

[0073] S60: Send the global model of the current round to the client to execute the next training round, iterate until the training termination condition is met, and output the target global model.

[0074] Specifically, after completing the aggregation processing and global model update for the current round, federated learning enters the next training round cycle. The server distributes the global model for the current round to the client, which then uses it as the basis for local training in the next round. Simultaneously, the server performs statistical evaluation of the model accuracy and system overhead of the completed training rounds, and dynamically adjusts the alternation ratio of different round types in the alternation scheduling plan based on the evaluation results, enabling the alternation configuration to adapt to changes in training progress and actual training effects. This process is executed iteratively until the training termination condition is met, at which point the final global model is output as the target global model.

[0075] Combination Figure 8 As shown, step S60 specifically includes: S601: The global model of the current round is sent to the client as the initial local training model for the next training round.

[0076] The global model for the current training round is distributed to the client as the initial local training model for the next training round. The initial local training model refers to the initial model used by the client when starting local training in a training round. By distributing the updated global model round by round, each client continues training on a unified model basis. This allows the global model to absorb the distribution information of local data from each client round by round, and the training effect accumulates as the round progresses.

[0077] S602: Calculate the model accuracy and system overhead of the completed training rounds to obtain the training status evaluation results.

[0078] The training state evaluation results are obtained by statistically analyzing the model accuracy and system overhead of the completed training rounds. Specifically, model accuracy can be obtained by evaluating the global model in the current round on the validation dataset, for example, by statistically analyzing the changes in the classification accuracy or loss value of the global model on the validation dataset. System overhead includes the cumulative communication and computational overhead of the completed training rounds. Communication overhead can be obtained by statistically analyzing the data transmission volume generated by uploading model update parameters and distributing the global model, while computational overhead can be obtained by statistically analyzing the time consumed by local training, noise addition, encryption, and decryption processes in each round. The training state evaluation results are obtained by summarizing the changes in model accuracy and the cumulative system overhead. For example, in a joint modeling task in the financial field, the training state evaluation results can reflect the accuracy improvement trend of the transaction anti-fraud identification model and the communication and computational resource consumption of each participating institution; in the medical field, the training state evaluation results can reflect the accuracy changes of the lesion identification model on the validation image dataset and the resource consumption of each participating hospital.

[0079] S603: Adjust the alternation ratio of different round types according to the training status evaluation results, and update the alternation scheduling plan.

[0080] The alternation ratio of different round types is adjusted based on the training status evaluation results, and the alternation scheduling plan is updated. Specifically, when the training status evaluation results indicate that the improvement in model accuracy is lower than expected, the proportion of round types such as homomorphic encryption rounds, which are trained on local real data and do not introduce noise, can be increased in subsequent training rounds to enhance the global model's learning of the real data distribution. When the training status evaluation results indicate that the cumulative system overhead is close to the system overhead constraint, the proportion of synthetic data rounds or differential privacy rounds can be increased and the proportion of homomorphic encryption rounds can be decreased in subsequent training rounds to control subsequent communication and computational overhead. Understandably, during the adjustment process, the protection parameters of each round type are always kept within the range corresponding to the target privacy protection level, that is, the dynamic adjustment of the alternation ratio is based on the premise of not reducing the established privacy protection strength. The adjusted alternation ratio is then remapped to the round type and protection parameters of subsequent training rounds to complete the update of the alternation scheduling plan. For example, in image modeling tasks in the medical field, when it is found that the improvement of model accuracy slows down during the middle of training while the communication budget is still sufficient, the proportion of homomorphic encryption rounds can be increased to refine the model; in the financial field, when the computing resources of some participating institutions are close to the constraint limit, the proportion of synthetic data rounds can be increased to reduce their load.

[0081] S604: Iteratively execute subsequent training rounds based on the updated alternating scheduling plan until the training termination condition is met.

[0082] The updated alternating scheduling plan is used to iteratively execute subsequent training rounds until the training termination condition is met. The training termination condition may include at least one of the following: the number of completed training rounds reaches the preset total number of rounds; the global model's accuracy on the validation dataset in the current round meets the model accuracy requirements in the task constraints; the change in the global model's accuracy over several consecutive training rounds is less than a preset range, i.e., the training tends to converge. During iterative execution, each training round determines its round type and protection parameters according to the updated alternating scheduling plan, and repeats the local training and privacy protection processing in step S40 and the aggregation processing and global model update in step S50.

[0083] S605: When the training termination condition is met, the global model of the last training round is determined as the target global model and output.

[0084] When the training termination condition is met, the global model from the last training epoch is determined as the target global model and output. The target global model is the final output model of this federated learning training task. For example, in the financial field, the output target global model can be deployed in the business systems of participating banking institutions for business processing such as transaction fraud detection and credit risk assessment; in the medical field, the output target global model can be deployed in the auxiliary analysis systems of participating hospitals for auxiliary analysis such as lesion identification and disease risk prediction in medical images. Throughout the training process, the local real data of each participant is retained locally. The uploaded model update parameters are protected by differential privacy noise protection, selective homomorphic encryption ciphertext protection, or synthetic data source protection mechanisms, depending on the epoch type. This ensures that federated learning meets the target privacy protection level requirements while completing model training, and keeps model accuracy loss and system overhead within the limits allowed by the task constraints.

[0085] As can be seen, the federated learning method based on alternating training provided in this invention expands the trade-off between privacy protection strength, model accuracy, and system overhead from a fixed single-point configuration to a configuration space that can be flexibly adjusted through alternating ratios by alternately configuring different privacy protection methods in training rounds. This transforms the passive selection of privacy protection configuration from a fixed combination to an active control based on task requirements. It can adapt to the differentiated requirements of privacy protection level, model accuracy, and resource budget according to different business scenarios such as the financial and medical fields. Under the premise of meeting the target privacy protection level, it reduces model accuracy loss and lowers system overhead, thereby improving the practicality and adaptability of the federated learning system.

[0086] 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.

[0087] In one embodiment, a federated learning device based on alternating training is provided, which corresponds one-to-one with the federated learning method based on alternating training described in the above embodiments. For example... Figure 9 As shown, the federated learning device based on alternating training includes: a level determination module 100, a policy selection module 200, a schedule generation module 300, an alternating training module 400, a model aggregation module 500, and an iterative output module 600.

[0088] Detailed descriptions of each functional module are as follows: The level determination module 100 is used to obtain task constraint information, parse the privacy protection requirements in the task constraint information, and determine the target privacy protection level; The strategy selection module 200 is used to select a target alternating training strategy from preset candidate alternating training strategies based on the target privacy protection level and the model accuracy requirements in the task constraint information. The scheduling generation module 300 is used to generate an alternating scheduling plan by configuring the round type and protection parameters corresponding to different privacy protection methods for each training round according to the target alternating training strategy. The alternating training module 400 is used to send the round type and protection parameters of the current round to the client according to the alternating scheduling plan, so that the client can perform local training and privacy protection processing to obtain model update parameters; The model aggregation module 500 is used to receive the model update parameters uploaded by the client, perform aggregation processing on the model update parameters according to the round type, and update the global model to obtain the global model of the current round. The iterative output module 600 is used to send the global model of the current round to the client to execute the next training round, iterate until the training termination condition is met, and output the target global model.

[0089] In one embodiment, the level determination module 100 is specifically used for: By configuring multiple sets of noise parameters for differential privacy and multiple sets of encryption ratios for homomorphic encryption, a set of protection parameter configurations is obtained. Simulation tests of privacy reconstruction attacks were performed under each set of configurations in the protection parameter configuration set, and the attack success rate was statistically analyzed; wherein, the privacy reconstruction attacks include deep gradient leakage attacks, gradient inversion attacks, attacks where the curious party abandons honesty, and hijacking federation attacks; The minimum configuration with an attack success rate below a preset threshold is designated as the privacy protection level for defending against the corresponding privacy reconstruction attack. The infimum and supremacy are determined based on the most stringent level for defending against all attacks and the most lenient level for defending against any attack. Based on the stated privacy protection requirements, a target privacy protection level is determined by matching from the specified privacy protection levels.

[0090] In one embodiment, the strategy selection module 200 is specifically used for: The model accuracy requirements and system overhead constraints are extracted from the task constraint information, and preset candidate alternating training strategies are obtained; wherein, the candidate alternating training strategies include privacy mechanism alternating strategy, synthetic data and differential privacy alternating strategy, and synthetic data and homomorphic encryption alternating strategy; When both the target privacy protection level and the model accuracy requirement are higher than the predetermined value, the privacy mechanism alternation strategy is selected. When only the target privacy protection level is higher than the predetermined value, the synthetic data and differential privacy alternation strategy is selected; When the selected strategy does not meet the target privacy protection level, the strategy of alternating between synthetic data and homomorphic encryption is selected.

[0091] In one embodiment, the scheduling generation module 300 is specifically used for: Based on the target alternating training strategy, the alternation ratio of different round types in the training rounds is determined, and the alternation ratio parameter is obtained; The training rounds are alternately assigned round types according to the alternating ratio parameter to obtain a round type sequence; wherein, the round types include differential privacy rounds, homomorphic encryption rounds, and synthetic data rounds; By configuring noise parameters for the differential privacy rounds in the round type sequence and encryption ratios for the homomorphic encryption rounds, protection parameters are obtained. Set the model update transmission mode of the synthetic data round in the round type sequence to plaintext transmission; The round type sequence and the protection parameters are associated according to the corresponding training rounds to generate an alternating scheduling plan.

[0092] In one embodiment, the alternating training module 400 is specifically used for: Before the start of each training round, read the scheduling record of the current round in the alternating scheduling plan and broadcast the round type and protection parameters of the current round to the client; In the differential privacy round, the client is controlled to train the model update parameters based on local real data and add noise according to the protection parameters; In the homomorphic encryption round, the client is controlled to filter sensitive parameters in the model update parameters according to the gradient magnitude and perform selective homomorphic encryption; In the synthetic data round, the client is controlled to generate synthetic data through a diffusion model trained with differential privacy, and the model update parameters are trained to obtain the model update parameters.

[0093] In one embodiment, the model aggregation module 500 is specifically used for: The server receives the model update parameters uploaded by the client and determines the aggregation method based on the round type of the current round. In the differential privacy round and the synthetic data round, weighted aggregation is performed on the plaintext model updates to obtain the plaintext aggregation result; In the homomorphic encryption round, ciphertext aggregation is performed on the ciphertext parameters and plaintext aggregation is performed on the plaintext parameters to obtain a hybrid aggregation result; The encrypted aggregated portion of the hybrid aggregation result is sent to the client for decryption to obtain the decrypted aggregation result. The global model is updated based on the plaintext aggregation result or the decrypted aggregation result to obtain the global model for the current round.

[0094] In one embodiment, the iterative output module 600 is specifically used for: The global model for the current round is sent to the client as the initial local training model for the next training round. The model accuracy and system overhead of the completed training rounds are statistically analyzed to obtain the training status evaluation results; Adjust the alternation ratio of different round types based on the training status evaluation results, and update the alternation scheduling plan; The subsequent training rounds are executed iteratively based on the updated alternating scheduling plan until the training termination condition is met. When the training termination condition is met, the global model of the last training round is determined as the target global model and output.

[0095] Specific limitations regarding the alternating training-based federated learning apparatus can be found in the limitations of the alternating training-based federated learning method above, and will not be repeated here. Each module in the aforementioned alternating training-based federated learning apparatus can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0096] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements server-side functions or steps based on an alternating training federated learning method.

[0097] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 11 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements client-side functions or steps of a federated learning method based on alternating training.

[0098] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed, can perform the steps provided in the above embodiments.

[0099] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0100] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0101] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0102] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.

[0103] 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 federated learning method based on alternating training, characterized in that, include: Obtain task constraint information, parse the privacy protection requirements in the task constraint information, and determine the target privacy protection level; Based on the target privacy protection level and the model accuracy requirements in the task constraint information, a target alternating training strategy is selected from the preset candidate alternating training strategies. Based on the target alternating training strategy, the round type and protection parameters corresponding to different privacy protection methods are configured for each training round, and an alternating scheduling plan is generated. According to the alternating scheduling plan, the current round type and protection parameters are sent to the client, so that the client can perform local training and privacy protection processing to obtain model update parameters; Receive the model update parameters uploaded by the client, perform aggregation processing on the model update parameters according to the round type, and update the global model to obtain the global model for the current round; The global model of the current round is sent to the client to execute the next training round. The process is repeated until the training termination condition is met, and the target global model is output.

2. The federated learning method based on alternating training according to claim 1, characterized in that, The process of obtaining task constraint information, parsing the privacy protection requirements in the task constraint information, and determining the target privacy protection level includes: By configuring multiple sets of noise parameters for differential privacy and multiple sets of encryption ratios for homomorphic encryption, a set of protection parameter configurations is obtained. Simulation tests of privacy reconstruction attacks were performed under each set of configurations in the protection parameter configuration set, and the attack success rate was statistically analyzed; wherein, the privacy reconstruction attacks include deep gradient leakage attacks, gradient inversion attacks, attacks where the curious party abandons honesty, and hijacking federation attacks; The minimum configuration with an attack success rate below a preset threshold is designated as the privacy protection level for defending against the corresponding privacy reconstruction attack. The infimum and supremacy are determined based on the most stringent level for defending against all attacks and the most lenient level for defending against any attack. Based on the stated privacy protection requirements, a target privacy protection level is determined by matching from the specified privacy protection levels.

3. The federated learning method based on alternating training according to claim 1, characterized in that, The step of selecting a target alternating training strategy from preset candidate alternating training strategies based on the target privacy protection level and the model accuracy requirements in the task constraint information includes: The model accuracy requirements and system overhead constraints are extracted from the task constraint information, and preset candidate alternating training strategies are obtained; wherein, the candidate alternating training strategies include privacy mechanism alternating strategy, synthetic data and differential privacy alternating strategy, and synthetic data and homomorphic encryption alternating strategy; When both the target privacy protection level and the model accuracy requirement are higher than the predetermined value, the privacy mechanism alternation strategy is selected. When only the target privacy protection level is higher than the predetermined value, the synthetic data and differential privacy alternation strategy is selected; When the selected strategy does not meet the target privacy protection level, the strategy of alternating between synthetic data and homomorphic encryption is selected.

4. The federated learning method based on alternating training according to claim 1, characterized in that, The step of configuring different privacy protection methods for each training round according to the target alternating training strategy, and generating an alternating scheduling plan, includes: Based on the target alternating training strategy, the alternation ratio of different round types in the training rounds is determined, and the alternation ratio parameter is obtained; The training rounds are alternately assigned round types according to the alternating ratio parameter to obtain a round type sequence; wherein, the round types include differential privacy rounds, homomorphic encryption rounds, and synthetic data rounds; By configuring noise parameters for the differential privacy rounds in the round type sequence and encryption ratios for the homomorphic encryption rounds, protection parameters are obtained. Set the model update transmission mode of the synthetic data round in the round type sequence to plaintext transmission; The round type sequence and the protection parameters are associated according to the corresponding training rounds to generate an alternating scheduling plan.

5. The federated learning method based on alternating training according to claim 4, characterized in that, The step involves sending the round type and protection parameters of the current round to the client according to the alternating scheduling plan, enabling the client to perform local training and privacy protection processing to obtain model update parameters, including: Before the start of each training round, read the scheduling record of the current round in the alternating scheduling plan and broadcast the round type and protection parameters of the current round to the client; In the differential privacy round, the client is controlled to train the model update parameters based on local real data and add noise according to the protection parameters; In the homomorphic encryption round, the client is controlled to filter sensitive parameters in the model update parameters according to the gradient magnitude and perform selective homomorphic encryption; In the synthetic data round, the client is controlled to generate synthetic data through a diffusion model trained with differential privacy, and the model update parameters are trained to obtain the model update parameters.

6. The federated learning method based on alternating training according to claim 4, characterized in that, The process of receiving the model update parameters uploaded by the client, performing aggregation processing on the model update parameters according to the round type, and updating the global model to obtain the global model for the current round includes: The server receives the model update parameters uploaded by the client and determines the aggregation method based on the round type of the current round. In the differential privacy round and the synthetic data round, weighted aggregation is performed on the plaintext model updates to obtain the plaintext aggregation result; In the homomorphic encryption round, ciphertext aggregation is performed on the ciphertext parameters and plaintext aggregation is performed on the plaintext parameters to obtain a hybrid aggregation result; The encrypted aggregated portion of the hybrid aggregation result is sent to the client for decryption to obtain the decrypted aggregation result. The global model is updated based on the plaintext aggregation result or the decrypted aggregation result to obtain the global model for the current round.

7. The federated learning method based on alternating training according to claim 1, characterized in that, The step of sending the global model of the current round to the client to execute the next training round, iterating until the training termination condition is met, and outputting the target global model includes: The global model for the current round is sent to the client as the initial local training model for the next training round. The model accuracy and system overhead of the completed training rounds are statistically analyzed to obtain the training status evaluation results; Adjust the alternation ratio of different round types based on the training status evaluation results, and update the alternation scheduling plan; The subsequent training rounds are executed iteratively based on the updated alternating scheduling plan until the training termination condition is met. When the training termination condition is met, the global model of the last training round is determined as the target global model and output.

8. A federated learning device based on alternating training, characterized in that, include: The level determination module is used to obtain task constraint information, parse the privacy protection requirements in the task constraint information, and determine the target privacy protection level; The strategy selection module is used to select a target alternating training strategy from preset candidate alternating training strategies based on the target privacy protection level and the model accuracy requirements in the task constraint information. The scheduling generation module is used to generate an alternating scheduling plan by configuring the round type and protection parameters corresponding to different privacy protection methods for each training round according to the target alternating training strategy. The alternating training module is used to send the round type and protection parameters of the current round to the client according to the alternating scheduling plan, so that the client can perform local training and privacy protection processing to obtain model update parameters; The model aggregation module is used to receive the model update parameters uploaded by the client, perform aggregation processing on the model update parameters according to the round type, and update the global model to obtain the global model of the current round. The iterative output module is used to send the global model of the current round to the client to execute the next training round, iterate until the training termination condition is met, and output the target global model.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the federated learning method based on alternating training as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the federated learning method based on alternating training as described in any one of claims 1 to 7.