Federated learning methods, systems, storage media, and program products

By dividing federated learning into two stages and dynamically adjusting the client selection probability and group training, the performance degradation and efficiency reduction of federated learning under non-ideal data distributions are solved, and the stability and efficiency of the model under complex data distributions are achieved.

CN120163264BActive Publication Date: 2025-12-02BEIJING UNIV OF POSTS & TELECOMM +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510212627.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-12-02
Estimated Expiration
2045-02-25

AI Technical Summary

Technical Problem

Existing federated learning methods suffer from performance degradation and efficiency reduction under non-ideal data distribution conditions, especially when the amount of client data is unbalanced, which exacerbates model training instability.

Method used

Federated learning is divided into two stages. In the first stage, clients with less data are selected first for model training using negatively correlated selection probabilities. In the second stage, positively correlated selection probabilities are used to optimize clients with more data. Different degrees of fine-tuning are performed by combining client grouping.

Benefits of technology

It effectively solves the problem of model instability caused by uneven data volume, improves the stability and efficiency of the model under complex data distribution, and enhances the robustness and generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120163264B_ABST
    Figure CN120163264B_ABST
Patent Text Reader

Abstract

This invention provides a federated learning method, system, storage medium, and program product. The method includes: in each learning round of the first-stage federated learning, determining a group of clients from a client set according to a first selection probability, sending the current global model parameters to the selected clients, so that the selected clients can train the model based on the current global model parameters and local training data, iterating the global model parameters; when the current learning round is the target round, reallocating a second selection probability to each client; in each learning round of the second-stage federated learning, determining a group of clients participating in the second-stage federated learning from the client set according to the second selection probability; sending the current global model parameters to the currently selected clients, training the model until the target model converges; this method can solve the problem of performance degradation and efficiency reduction in existing federated learning under non-ideal data distribution conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine learning technology, and more particularly to a federated learning method, system, storage medium, and program product. Background Technology

[0002] Federated Learning (FL) is a privacy-preserving distributed machine learning method that enables joint modeling and optimizes model performance without requiring user data to leave their local machines. This achieves "model moves without data moving," effectively protecting data privacy and breaking down data silos. As a popular research area in machine learning, Federated Learning fully leverages the value of data without directly sharing it, demonstrating broad application prospects in fields such as healthcare, financial services, and the Internet of Things. Therefore, designing efficient and secure federated learning methods is crucial for promoting its practical application and fully realizing its potential.

[0003] Currently, existing federated learning methods include: the server randomly selects a subset from all clients and sends the current global model parameters to these clients; then, the clients train the model using their local private datasets, calculate the gradients, and send them back to the server for aggregation; repeating the above process, and after the global model on the server side reaches convergence, the parameters are redistributed to all clients participating in federated learning.

[0004] However, existing federated learning methods have limitations when dealing with the problem of non-independent and identically distributed (non-IID) client data. Specifically, current algorithms tend to focus on differences in data features while neglecting the impact of differences in data volume. Furthermore, they typically select clients for each training round with a fixed probability, failing to effectively utilize the differences in data volume among clients. In real-world scenarios, the data volume of different clients often exhibits significant imbalance. This disparity can exacerbate the instability of model training, leading to performance degradation and reduced efficiency of federated learning under non-ideal data distribution conditions. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a federated learning method, system, storage medium, and program product to eliminate or improve one or more defects existing in the prior art, and solve the problems of performance degradation and efficiency reduction of existing federated learning under non-ideal data distribution conditions.

[0006] One aspect of the present invention provides a federated learning method, the method comprising the following steps:

[0007] According to the first selection probability pre-assigned by the client, a group of clients participating in the first stage of federated learning is determined from the client set; the first selection probability corresponding to each client is negatively correlated with the amount of local data of the client, and is determined based on the inverse relationship of the amount of local data of the client; the first stage of federated learning includes at least one learning round, and before the start of each learning round, a group of clients participating in the current learning round is re-determined from the client set based on the first selection probability;

[0008] In each learning round of the first-stage federated learning, the global model parameters of the target model are sent to the currently selected client so that the selected client can train the model based on the global model parameters and local training data, iterate the model parameters deployed locally and return; aggregate the local model parameters and iterate the global model parameters.

[0009] After each learning round is completed, it is determined whether the current learning round is the target round. If the current learning round is the target round, the second selection probability is reassigned to each client. The second selection probability corresponding to each client is positively correlated with the amount of local data on the client and is determined based on the proportional relationship between the amount of local data on the client.

[0010] A set of clients participating in the second phase of federated learning is determined from the client set according to the second selection probability; the second phase of federated learning includes at least one learning round, and before the start of each learning round, a set of clients participating in the current learning round is determined again from the client set based on the second selection probability;

[0011] In each learning round of the second-stage federated learning, the current global model parameters are sent to the currently selected client so that the currently selected client can train the model based on the current global model parameters and local training data, iterating over the current global model parameters until the target model converges.

[0012] In some embodiments of the present invention, determining whether the current learning round is the target round includes:

[0013] Receive the local loss function value sent by the selected client; the local loss function value is calculated by the selected client based on a preset local loss function;

[0014] The global loss function value is calculated based on the loss function.

[0015] The global loss function value is compared with the preset transformation threshold to obtain the comparison result;

[0016] If the comparison results of a preset number of consecutive learning rounds indicate that the global loss function value is less than a preset transformation threshold, the current round is determined as the target round.

[0017] In some embodiments of the present invention, determining whether the current learning round is the target round includes:

[0018] Determine the convergence status of the target model. If the target model converges, determine the convergence round as the target round.

[0019] In some embodiments of the present invention, the current global model parameters are sent to the currently selected client so that the currently selected client can train the model based on the current global model parameters and local training data, iterating over the current global model parameters until the target model converges. The method further includes:

[0020] The first selection probability is reallocated to each client based on the inverse relationship between the amount of local data on each client.

[0021] Adjust the target rounds based on the model convergence rounds and the preset number, so that the target rounds are set to the preset number of rounds before the model convergence rounds;

[0022] The step involves determining a set of clients from the client set to participate in the first phase of federated learning, based on a first selection probability pre-assigned to each client.

[0023] In some embodiments of the present invention, before determining whether the current learning round has reached the target round, the method further includes:

[0024] When the model is a high-performance model, the number of learning epochs is increased based on the initial target epochs to obtain the target epochs; when the model is a low-performance model, the number of learning epochs is decreased based on the initial target epochs to obtain the target epochs; wherein, the initial target epochs are pre-set based on the computing resources corresponding to each client; the computing resources are positively correlated with the initial target epochs. In some embodiments of the present invention, the current global model parameters are sent to the currently selected client so that the currently selected client can perform model training based on the current global model parameters and local training data, iterating the current global model parameters until the target model converges, and further includes:

[0025] The client set is regrouped based on the amount of local data on each client, resulting in at least one client group.

[0026] The current global model parameters of the target model are sent to each client group, and the third stage of federated learning is performed within each client group to obtain the target model within each client group. The amount of data within each client group is negatively correlated with the number of federated learning rounds within the group.

[0027] In some embodiments of the present invention, after sending the current global model parameters of the target model to each group of clients, performing third-stage federated learning within each group of clients to obtain the target model within each group of clients, the method further includes:

[0028] The model parameters of the target model within the group are sent to each client in the corresponding client group, so that each client can train the target model within the group based on local data and obtain the client model corresponding to each client.

[0029] On the other hand, the present invention also provides a federated learning system, the system comprising:

[0030] Federated learning server, used for any of the above federated learning methods;

[0031] At least two clients are used to receive global model parameters of the target model sent by the federated learning server through the client selected by the federated learning server, and participate in federated learning based on the received global model parameters and local training data. In each learning round of the first stage of federated learning, the client selected based on the first selection probability participates in federated learning, trains the model based on the local training data and updates the model parameters, and returns the updated model parameters to the federated learning server for aggregation. In each learning round of the second stage of federated learning, the client selected based on the second selection probability participates in federated learning, trains the model based on the updated global model parameters aggregated by the federated learning server and local training data, until the target model converges.

[0032] On the other hand, the present invention also provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the steps of any of the above methods.

[0033] On the other hand, the present invention also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of any of the methods described above.

[0034] The beneficial effects of the present invention are at least as follows:

[0035] The federated learning method and system described in this invention can solve the problems of performance degradation and efficiency reduction in existing federated learning under non-ideal data distribution conditions. The federated learning is divided into two stages: the first stage focuses on quickly establishing the basic structure of the model, and the second stage focuses on fine-tuning optimization. In the first stage, by assigning a first selection probability negatively correlated with the amount of local data to clients, priority is given to clients with less data, ensuring that their unique features can be quickly learned by the model and preventing the model from prematurely favoring clients with larger data volumes. In the second stage, the selection probability is switched to a second selection probability positively correlated with the amount of data, making full use of the rich data provided by clients with larger data volumes to further optimize model performance. This effectively addresses the problem of non-independent and identically distributed client data, enabling the model to maintain stability and efficiency under complex data distributions. Simultaneously, this dynamic adjustment strategy balances the contradiction between data volume and feature diversity, improving the model's robustness and generalization ability.

[0036] Furthermore, by grouping the clients and placing clients with similar amounts of data in one group, the local data distribution among clients within each group is relatively balanced, thereby improving the stability of subsequent training. At the same time, federated learning fine-tuning is performed independently within each client group to varying degrees. Groups consisting of clients with less data undergo sufficient fine-tuning, while groups consisting of clients with more data undergo only a few rounds of fine-tuning. This balances the neglect of clients with less data in the later stages of global model training, ensuring that all client data is fully utilized and overcoming the problem of poor performance of local fine-tuning on clients with less data.

[0037] Additional advantages, objects, and features of the invention will be set forth in part in the description which follows, and will also become apparent in part to those skilled in the art upon studying the description, or may be learned by practice of the invention. The objects and other advantages of the invention can be realized and obtained by means of the structures specifically pointed out in the description and drawings.

[0038] Those skilled in the art will understand that the objectives and advantages achievable with the present invention are not limited to those specifically described above, and that the above and other objectives achievable with the present invention will become clearer from the following detailed description. Attached Figure Description

[0039] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, are not intended to limit the scope of the invention. In the drawings:

[0040] Figure 1 This is a flowchart illustrating a federated learning method provided in an embodiment of the present invention.

[0041] Figure 2This is a schematic diagram of the structure of a federated learning system provided in an embodiment of the present invention. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.

[0043] It should also be noted that, in order to avoid obscuring the invention with unnecessary details, only the structures and / or processing steps closely related to the solution according to the invention are shown in the accompanying drawings, while other details that are not closely related to the invention are omitted.

[0044] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.

[0045] It should also be noted that, unless otherwise specified, the term "connection" in this article can refer not only to a direct connection, but also to an indirect connection involving an intermediary.

[0046] In the following description, embodiments of the invention will be illustrated with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar parts, or the same or similar steps.

[0047] Figure 1 This is a flowchart illustrating a federated learning method according to an embodiment of the present invention. The method is executed on a federated learning server. The federated learning server includes a cloud server, a local server, an edge server, or a server running in a virtual machine or container. This embodiment does not limit the implementation method of the federated learning server.

[0048] Specifically, this application provides a federated learning method, which includes the following steps S101 to S105:

[0049] Step S101: Based on the first selection probability pre-assigned by the client, determine a group of clients from the client set to participate in the first stage of federated learning.

[0050] The first phase of federated learning includes at least one learning round. Before the start of each learning round, a new set of clients to participate in the current learning round is determined from the client set based on the first selection probability.

[0051] A client refers to a terminal that has established a communication connection with the federated learning server and uses local data and other clients connected to the federated learning server to perform federated learning. This includes mobile phones, tablets, or servers. This embodiment does not limit the implementation method of the client.

[0052] In federated learning, client-local data is usually non-independent and identically distributed, which means that the data characteristics and distribution of different clients may differ significantly. If all clients are used directly for global model training of the target model, it may lead to slow convergence, performance degradation, or instability of the target model.

[0053] Therefore, in the early stages of federated learning, the target model has not yet fully learned the overall characteristics of the data. At this time, prioritizing clients with less data allows the model to capture the unique characteristics of these clients more quickly. This helps to prevent the target model from over-relying on clients with large amounts of data and ensures that the model can learn the important information of each client fairly.

[0054] Taking a federated speech recognition system as an example, this system is used for speech-to-text tasks in multilingual environments. The clients participating in federated learning include user devices from different regions, whose speech data exhibits the following characteristics: differences in data volume—some regions (such as large cities) have a large number of users and a large data volume, while remote areas have a small number of users and a small data volume; and differences in feature distribution—users in different regions may have different accents, dialects, or language habits, leading to significant differences in acoustic features. Based on this, in the early stages of training, the model needs to quickly learn the dialect features of users in remote areas to avoid the problem of the model only adapting to the mainstream language or accent.

[0055] In some embodiments of the present invention, a first selection probability is pre-assigned to each client in the client set, and a group of clients is dynamically selected from the client set according to the first selection probability.

[0056] The probability of initial selection for each client is negatively correlated with the amount of local data on that client. It is determined by the federated learning client after collecting information on the local data volume of all clients, based on this inverse relationship between the local data volume and the probability of initial selection for each client. Specifically, the probability of initial selection for each client can be expressed by the following formula:

[0057]

[0058] In the formula, p1 represents the probability of the first selection; D k This represents the amount of local data corresponding to the k-th client; N represents the number of clients in the first group.

[0059] After determining the first selection probability for each client, before the start of each learning round of the first-stage federated learning, a set of clients is selected from the client set according to the first selection probability using a random sampling method, such as the Roulette Wheel Selection Algorithm (RWS) or Probability-Based Random Sampling (PBRS).

[0060] Step S102: In each learning round of the first stage of federated learning, the global model parameters of the target model are sent to the currently selected client so that the selected client can train the model based on the current global model parameters and local training data, iterate the model parameters deployed locally and return; aggregate the local model parameters and iterate the global model parameters.

[0061] In each learning round of the first phase of federated learning, the federated learning server sends the global model parameters of the target model to the selected client for that learning round. The selected client then trains the model for that learning round based on the received global model parameters and local training data, iterating through the global model parameters.

[0062] Taking the first phase of federated learning as an example with a total of R rounds, in the r-th round, each currently selected client updates the model based on the received global model parameters and the local training dataset. Simultaneously, each client predefines a local loss function to measure the performance of the model parameters on the local training dataset.

[0063] Where R is an integer greater than 1; r is an integer greater than 1 and less than or equal to R; the local loss function includes the cross-entropy loss function or the mean squared error (MSE) function, etc., and this embodiment does not limit the type of local loss function.

[0064] Each currently selected client minimizes the local loss function using an optimization algorithm (such as gradient descent), generates new local model parameters, calculates the local loss function value, and returns it to the federated learning server.

[0065] After receiving the local model parameters returned by all currently selected clients, the federated learning server performs a weighted average using an aggregation algorithm (such as FedAvg) to generate new global model parameters. It then calculates the global loss function value based on the local loss function values ​​returned by each selected client. The global loss function value indicates the overall performance of the model on the local client data of the selected clients.

[0066] Step S103: After each learning round is completed, determine whether the current learning round is the target round. If the current learning round is the target round, reallocate the second selection probability to each client.

[0067] To leverage richer data to fine-tune the global model and enhance its robustness in later stages of federated learning, the strategy needs to be adjusted after reaching the target number of rounds in the first phase of federated learning. This involves assigning a second selection probability to each client, giving higher probabilities to clients with relatively more local data.

[0068] The second selection probability for each client is positively correlated with the amount of local data on that client. This correlation is determined based on the proportional relationship between the amount of local data on each client and can be expressed by the following formula:

[0069]

[0070] In the formula, p2 represents the probability of the second selection; D k This represents the amount of local data corresponding to the k-th client; N represents the number of clients in the first group.

[0071] In some embodiments of the present invention, in the first stage of federated learning, after reaching the target round, the probability of federated learning is adjusted, and a second stage of federated learning is performed. The target round is represented by round R, and it is determined whether the current learning round is the target round. Specifically, this includes any one of the following cases:

[0072] The first approach, when there are significant differences in the distribution of local data across different clients, determines the training round R based on whether the global loss function value calculated by the federated learning server remains non-decreasing within a certain number of training rounds.

[0073] Specifically, determining whether the current learning round is the target round includes: receiving the local loss function value sent by the selected client; the local loss function value is calculated by the selected client based on a preset local loss function; calculating the global loss function value based on the loss function; comparing the global loss function value with a preset transformation threshold to obtain a comparison result; if the comparison result of a preset number of consecutive learning rounds indicates that the global loss function value is less than the preset transformation threshold, the current round is determined as the target round.

[0074] The second approach is to set the epoch R to the learning epoch corresponding to the convergence of the target model.

[0075] Specifically, determining whether the current learning round is the target round includes: determining the convergence status of the target model; if the target model converges, the convergence round is determined as the target round.

[0076] In practice, given the limited computing resources on the client side, to conserve computing resources and reduce training costs, the epoch R can be set before the learning epoch corresponding to the convergence of the target model. Computing resources include, but are not limited to, processor performance, memory capacity, network bandwidth, and storage capacity.

[0077] The third method is to determine the round R based on the performance requirements of the target model and the pre-set initial target round.

[0078] The initial target round is determined based on the computing resources of the client, and the computing resources are positively correlated with the initial target round.

[0079] When the client has abundant computing resources (such as high-performance processors, large-capacity memory, and high-bandwidth networks), a larger initial target epoch can be set; when the client has limited computing resources (such as low-performance devices or unstable network connections), the initial target epoch needs to be reduced to avoid training delays or failures due to insufficient client processing power, thus ensuring the efficient operation of the entire federated learning process.

[0080] In some embodiments of the present invention, the average computing resource score of each client is obtained by weighted summation and averaging of the computing resources of each client; the initial target round is determined based on the pre-established mapping relationship between the average computing resource score and the initial target round, or the initial target round is calculated based on the average computing resource score and a preset monotonically increasing function.

[0081] If the performance requirements of the target model indicate that the target model is a high-performance model, increase the number of learning epochs based on the initial target epochs; if the performance requirements of the target model indicate that the target model is a low-performance model, reduce the number of learning epochs based on the initial target epochs.

[0082] Specifically, before determining whether the current learning round has reached the target round, the process includes: if the model is a high-performance model, increasing the number of learning rounds based on the initial target round to obtain the target round; if the model is a low-performance model, decreasing the number of learning rounds based on the initial target round to obtain the target round; wherein, the initial target round is pre-set based on the computing resources corresponding to each client; the computing resources are positively correlated with the initial target round. Step S104: determine a group of clients participating in the second stage of federated learning from the client set according to the second selection probability.

[0083] The second phase of federated learning includes at least one learning round. Before the start of each learning round, a new set of clients to participate in the current learning round is determined from the client set based on a second selection probability.

[0084] Specifically, after determining the second selection probability for each client, before the start of each learning round of the second-stage federated learning, a random sampling method, such as the Roulette Wheel Selection Algorithm (RWS) or Probability-Based Random Sampling (PBRS), is used to select a client from the client set according to the second selection probability.

[0085] In step S105, in each learning round of the second-stage federated learning, the current global model parameters are sent to the currently selected client so that the currently selected client can train the model based on the current global model parameters and local training data, iterating the current global model parameters until the target model converges.

[0086] In each learning round of the second-stage federated learning process, the federated learning server sends the current global model parameters of the target model to the client selected for that learning round. The client selected for that learning round then trains the model based on the received model parameters and its local training data.

[0087] After receiving the results returned by all selected clients, the federated learning server uses an aggregation algorithm (such as the federated averaging algorithm FedAvg) to perform a weighted average of the local model parameters of the selected clients, generating new global model parameters. Based on the local loss function values ​​returned by each selected client, the server calculates the global loss function value. If the global loss function value indicates that the target model has converged, the second stage of federated learning is completed.

[0088] In practice, during the second stage of federated learning, clients with less local data are less likely to be selected to participate. Although these clients were adequately trained in the first stage of federated learning, due to the forgetting nature of deep learning models, the global model's adaptability to these client data gradually decreases as training continues, thus affecting the performance of these client-specific models.

[0089] Based on this, in some embodiments of the present invention, after completing the second stage of federated learning, the target model is adjusted by different degrees of intra-group federated fine-tuning.

[0090] By grouping clients with similar amounts of data into groups, the local data distribution among clients within each group is relatively balanced, improving the stability of subsequent training. Within each client group, federated learning fine-tuning is performed independently to varying degrees. Groups with fewer data points receive thorough fine-tuning, while groups with more data points receive only a few rounds of fine-tuning. This balances the neglect of clients with fewer data points in the later stages of global model training, ensuring that all client data is fully utilized. It also overcomes the problem of poor performance of local fine-tuning on clients with limited data.

[0091] Specifically, the current global model parameters of the target model are sent to each client group, and the third-stage federated learning is performed within each client group to obtain the target model within each client group. The process further includes: regrouping the client set based on the amount of local data on each client to obtain at least one client group; sending the current global model parameters of the target model to each client group, and performing the third-stage federated learning within each client group to obtain the target model within each client group; wherein the amount of data within each client group is negatively correlated with the number of federated learning rounds within the group.

[0092] After fine-tuning the models within each client group, the models obtained through federated learning within each client group are further fine-tuned using local client data to obtain the final personalized client model.

[0093] Specifically, the current global model parameters of the target model are sent to each client group respectively. The third stage of federated learning is performed within each client group to obtain the target model within each client group. Then, the model parameters of the target model within the group are sent to each client in the corresponding client group so that each client can train the target model within the group based on local data to obtain the client model corresponding to each client.

[0094] Furthermore, when client-side data changes, such as the addition of new data or a shift in data distribution, a new round of federated learning needs to be restarted to adapt to the new data state. In this case, the new federated learning can refer to the target round of the previous round and adjust it according to the current situation, ensuring that the target round is kept within the timeframe before the first-stage federated learning model converges. This approach not only fully utilizes historical information to optimize the training process but also effectively avoids training inefficiencies or model performance degradation caused by improperly set target rounds.

[0095] Specifically, the current global model parameters of the target model are sent to each client group, and the third-stage federated learning is performed within each client group to obtain the target model for each client group. The process also includes: reallocating the first selection probability for each client based on the inverse relationship of the amount of local data for each client; adjusting the target rounds based on the model convergence rounds and a preset number, so that the target rounds are set to a preset number of rounds before the model convergence rounds; and executing the step of determining a group of clients participating in the first-stage federated learning from the client set according to the first selection probability pre-allocated to the clients.

[0096] On the other hand, such as Figure 2 As shown, the present invention also provides a federated learning system, which includes a federated learning server and at least two clients:

[0097] A federated learning server is used to implement the federated learning method described above.

[0098] First, the federated learning server determines a group of clients to participate in the first phase of federated learning from the client set according to a pre-assigned first selection probability for each client. The first selection probability for each client is negatively correlated with the amount of local data the client has, and is determined based on this inverse relationship. The first phase of federated learning includes at least one learning round. Before the start of each learning round, a new group of clients to participate in the current learning round is determined from the client set based on the first selection probability.

[0099] In each learning round of the first-stage federated learning, the federated learning server sends the current global model parameters of the target model to the client selected in the current round, so that the first group of clients can perform the first-stage federated learning based on the current global model parameters and local training data.

[0100] At least two clients are used to receive the current global model parameters of the target model sent by the federated learning server through the client selected by the federated learning server in the current round, and participate in federated learning based on the received current global model parameters and local training data; in each learning round of the first stage of federated learning, the client selected based on the first selection probability participates in federated learning, trains the model based on the local training data, iterates the model parameters deployed locally, and returns them to the federated learning server.

[0101] Simultaneously, after each learning round in the first phase of federated learning, the federated learning server also determines whether the current learning round is the target round. If the current learning round is the target round, a second selection probability is reallocated to each client. The second selection probability for each client is positively correlated with the amount of local data on that client, and is determined based on this proportional relationship.

[0102] Next, two groups of clients are selected from the client set to participate in the second phase of federated learning according to the second selection probability. The second phase of federated learning includes at least one learning round. Before the start of each learning round, a new group of clients is selected from the client set to participate in the current learning round based on the second selection probability.

[0103] In each learning round of the second-stage federated learning, the current global model parameters are sent to the currently selected client so that the currently selected client can train the model based on the current global model parameters and local training data, iterating over the current global model parameters until the target model converges.

[0104] In each learning round of the second-stage federated learning, at least two clients participate in federated learning by being selected based on a second selection probability. The clients continue to train the model based on the updated global model parameters from the federated learning server and the local training data until the target model converges.

[0105] For relevant details, please refer to the above embodiments.

[0106] It should be noted that the federated learning system provided in the above embodiments is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed to complete all or part of the functions described above. Furthermore, the federated learning system provided in the above embodiments and the federated learning method embodiments belong to the same concept; the specific implementation process is detailed in the method embodiments and will not be repeated here.

[0107] In summary, this invention provides a federated learning method and system. The method is executed on a federated learning server. A group of clients participating in the first stage of federated learning is determined from a client set according to a pre-assigned first selection probability. The first selection probability for each client is negatively correlated with the amount of local data on that client, and is determined based on an inverse relationship between the amount of local data on each client. The current global model parameters of the target model are sent to the selected clients so that the selected clients can train the model based on the current global model parameters and their local training data. After each learning round of the first stage of federated learning, it is determined whether the current learning round is the target round. If the current learning round is the target round, a second selection probability is reassigned to each client. The second selection probability for each client is negatively correlated with the amount of local data on that client. The positive correlation is determined based on the proportional relationship between the amount of local data on each client. A group of clients participating in the second stage of federated learning is selected from the client set according to the second selection probability. The current global model parameters are sent to the currently selected clients, enabling them to build their models based on the current global model parameters and their local training data until the target model converges. This approach addresses the performance degradation and efficiency reduction issues of existing federated learning under non-ideal data distribution conditions. Federated learning is divided into two stages: the first stage focuses on quickly establishing the basic structure of the model, while the second stage focuses on fine-tuning optimization. In the first stage, by assigning a first selection probability negatively correlated with the amount of local data to clients, priority is given to clients with less data, ensuring that their unique features can be quickly learned by the model and preventing the model from prematurely favoring clients with larger data volumes. In the second stage, the selection probability is switched to a second selection probability positively correlated with the amount of data, fully utilizing the rich data provided by clients with larger data volumes to further optimize model performance. This effectively addresses the issue of non-independent and identically distributed client data, enabling the model to maintain stability and efficiency under complex data distributions. Simultaneously, this dynamic adjustment strategy balances the contradiction between data volume and feature diversity, improving the model's robustness and generalization ability.

[0108] Furthermore, by grouping the clients and placing clients with similar amounts of data in one group, the local data distribution among clients within each group is relatively balanced, thereby improving the stability of subsequent training. At the same time, federated learning fine-tuning is performed independently within each client group to varying degrees. Groups consisting of clients with less data undergo sufficient fine-tuning, while groups consisting of clients with more data undergo only a few rounds of fine-tuning. This balances the neglect of clients with less data in the later stages of global model training, ensuring that all client data is fully utilized and overcoming the problem of poor performance of local fine-tuning on clients with less data.

[0109] On the other hand, the present invention also provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the steps of any of the above-described federated learning methods.

[0110] On the other hand, the present invention also provides a computer program product, including a computer program / instructions, characterized in that the computer program / instructions, when executed by a processor, implement the steps of any of the above-mentioned federated learning methods.

[0111] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the desired tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave.

[0112] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.

[0113] In this invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.

[0114] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations of the embodiments of the present invention are possible. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A federated learning method, characterized in that, The method includes the following steps: According to the first selection probability pre-assigned by the client, a group of clients participating in the first stage of federated learning is determined from the client set; the first selection probability corresponding to each client is negatively correlated with the amount of local data of the client, and is determined based on the inverse relationship of the amount of local data of the client; the first stage of federated learning includes at least one learning round, and before the start of each learning round, a group of clients participating in the current learning round is re-determined from the client set based on the first selection probability; In each learning round of the first stage of federated learning, the global model parameters of the target model are sent to the currently selected client, so that the selected client can train the model based on the global model parameters and local training data, iterate the model parameters deployed locally and return; aggregate the local model parameters and iterate the global model parameters. After each learning round is completed, it is determined whether the current learning round is the target round. If the current learning round is the target round, a second selection probability is reassigned to each client. The second selection probability corresponding to each client is positively correlated with the amount of local data of the client and is determined based on the proportional relationship of the amount of local data of the client. A set of clients participating in the second phase of federated learning is determined from the client set according to the second selection probability; the second phase of federated learning includes at least one learning round, and before the start of each learning round, a set of clients participating in the current learning round is determined again from the client set based on the second selection probability; In each learning round of the second-stage federated learning, the current global model parameters are sent to the currently selected client so that the currently selected client can train the model based on the current global model parameters and local training data, iterating the current global model parameters until the target model converges.

2. The method according to claim 1, characterized in that, Determining whether the current learning round is the target round includes: Receive the local loss function value sent by the selected client; the local loss function value is calculated by the selected client based on a preset local loss function; The global loss function value is calculated based on the aforementioned loss function. The global loss function value is compared with a preset transformation threshold to obtain the comparison result; If the comparison results of a preset number of consecutive learning rounds indicate that the global loss function value is less than the preset transformation threshold, the current round is determined as the target round.

3. The method according to claim 1, characterized in that, Determining whether the current learning round is the target round includes: Determine the convergence status of the target model. If the target model converges, determine the convergence round of the model as the target round.

4. The method according to claim 3, characterized in that, The step of sending the current global model parameters to the currently selected client, so that the currently selected client can train the model based on the current global model parameters and local training data, iterating over the current global model parameters until the target model converges, further includes: Based on the inverse relationship between the local data volume of each client, a first selection probability is reallocated to each client; The target round is adjusted based on the model convergence round and the preset number, so that the target round is set to the preset number of rounds before the model convergence round; The step of determining a set of clients to participate in the first phase of federated learning from the client set according to the first selection probability pre-assigned by the clients is performed.

5. The method according to claim 1, characterized in that, Before determining whether the current learning round has reached the target round, the process also includes: When the model is a high-performance model, the number of learning rounds is increased based on the initial target rounds to obtain the target rounds; when the model is a low-performance model, the number of learning rounds is reduced based on the initial target rounds to obtain the target rounds; wherein, the initial target rounds are pre-set based on the computing resources corresponding to each client; the computing resources are positively correlated with the initial target rounds.

6. The method according to claim 1, characterized in that, The step of sending the current global model parameters to the currently selected client, so that the currently selected client can train the model based on the current global model parameters and local training data, iterating over the current global model parameters until the target model converges, further includes: Based on the amount of local data on the client, the client set is regrouped to obtain at least one client group; The current global model parameters of the target model are sent to each client group, and a third-stage federated learning is performed within each client group to obtain the target model within each client group; wherein, the amount of data within each client group is negatively correlated with the number of federated learning rounds within the group.

7. The method according to claim 6, characterized in that, After sending the current global model parameters of the target model to each client group, and performing third-stage federated learning within each client group to obtain the target model within each client group, the process further includes: The model parameters of the target model within the group are sent to each client in the corresponding client group, so that each client can train the target model within the group based on local data to obtain the client model corresponding to each client.

8. A federated learning system, characterized in that, The system includes: A federated learning server for executing the federated learning method as described in any one of claims 1 to 7; At least two clients are used to receive global model parameters of the target model sent by the federated learning server through a client selected by the federated learning server, and participate in federated learning based on the received global model parameters and local training data; in each learning round of the first stage of federated learning, the client selected based on a first selection probability participates in federated learning, trains the model based on the local training data and updates the model parameters, and returns the updated model parameters to the federated learning server for aggregation; in each learning round of the second stage of federated learning: the client selected based on a second selection probability participates in federated learning, trains the model based on the updated global model parameters aggregated by the federated learning server and local training data, until the target model converges.

9. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method as described in any one of claims 1 to 7.

10. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7.