Online client selection method, system, medium and device based on federated learning

By combining Shapley value and multi-armed bandit technology to measure and select high-quality clients, the problems of non-independent and identically distributed and time-fluctuated client data in federated learning are solved, and the robustness and learning performance of the model are improved.

CN118446287BActive Publication Date: 2024-09-20SHANDONG UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410902829.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2024-09-20
Estimated Expiration
2044-07-08

AI Technical Summary

Technical Problem

In federated learning, due to the non-independent and identical distribution and time fluctuation of client data, it is difficult for the server to accurately measure the client's contribution to the global model, which affects learning performance.

Method used

Combining Shapley value technology and multi-armed bandit technology, an online client selection method is designed to measure the client's contribution to the global learning goal by calculating the Shapley value of the client, and use the confidence value mechanism to select high-quality clients to participate. Federated learning.

Benefits of technology

It improves the robustness and learning performance of the model, can dynamically adapt to client data changes, selects high-quality clients to participate in the learning process, and improves the accuracy and stability of the global model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118446287B
    Figure CN118446287B
Patent Text Reader

Abstract

The present invention relates to the field of computers, and discloses an online client selection method, system, medium and device based on federated learning. The present invention combines Shapley value technology with multi-armed bandit technology, designs an online client selection method for federated learning based on client contribution, helps the server continuously select high-quality clients to participate in the federated learning process, and improves model performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers and discloses an online client selection method, system, medium and device based on federated learning. Background Art

[0002] Federated learning is aimed at a complex and heterogeneous environment. Due to the different environments and collection preferences of each device, the data used to train the models between different devices are very different in source, order of magnitude, quantity and type, and features obtained, thus forming data heterogeneity, that is, the phenomenon of non-independent and identically distributed (Non-IID) data. The non-independent and identically distributed data will affect the learning performance of federated learning and increase the learning difficulty of federated learning. Therefore, the client selection problem for non-independent and identically distributed data has become a research focus of federated learning. In a real environment, since the client is constantly collecting data, the data distribution and data volume of the client may change over time. This makes the contribution of the client to the global model performance constantly changing. The server is unknown to the distribution and fluctuation of client data. In the face of the dynamic uncertainty of client non-independent and identically distributed data, it is necessary to study how to select clients that contribute more to the learning objectives of the central server to improve the learning performance of the server. Summary of the invention

[0003] In response to the above pitfalls and improvement needs of the prior art, the present invention provides an online client selection method for robust federated learning. The main difficulty of this problem lies in how the server uses the client's local model to update and measure the contribution of the client data to the server's learning task. In reality, the client's data is often not independent and identically distributed, and fluctuates over time, which makes the correlation between the client's local data and the server's learning task also change. Therefore, the present invention combines the Shapley value technology with the multi-armed bandit technology to design an online selection method for federated learning clients based on client contribution, which helps the server continuously select high-quality clients to participate in the federated learning process and improve model performance. The technical solution is as follows:

[0004] An online client selection method based on federated learning includes the following steps:

[0005] Step 1: Initial stage, the server selects all clients, and then the server sends the current global model to the selected clients;

[0006] Step 2: The selected client receives the global model, uses local data to learn and update the model, and then uploads the local model update to the server;

[0007] Step 3: After receiving the local model update from the client, the server aggregates the local model updates to update the global model and obtain a new round of global model.

[0008] Step 4: The server uses the global validation set to update and calculate the client's Shapley value based on the client's local model to measure the client's contribution to the global learning goal.

[0009] Step 5: Update the confidence value of the client according to the Shapley value of the client, and based on the confidence value, the server selects K clients for a new round, and sends the current global model to the selected clients, repeating steps 2 to 4 until the pre-set number of learning rounds is reached or the loss value reaches the specified threshold, and the learning stops.

[0010] Preferably, in step 1, at the beginning of federated learning, the server has no knowledge of the client information. At this time, the server first selects all clients and sends the current model to the selected clients.

[0011] Preferably, the specific method of step 4 is as follows:

[0012] make express A collection of clients, Indicates The set of clients that are selected in rounds, is the characteristic function of the cooperative game model, describing Each group of union Contribution to federated learning tasks, characteristic function The definition is as follows:

[0013] ;

[0014] in, It represents the verification dataset stored by the federated learning center server that can reflect the global goal of the federated learning task. To verify the number of samples in the dataset, is the indicator function, For the Aggregation The global model obtained from the local model, Represents the global model In the data sample Based on the above feature function, the client In the The Shapley value of a wheel can be defined as:

[0015] ;

[0016] in, , , and then through normalization, we can get Shapley values ​​within the interval; Used to measure client The accuracy of the local model on the validation dataset, i.e., the client In the The quality of the training data contributed in the round.

[0017] Preferably, in step five, after step four, the Shapley value of the selected client is obtained; an online learning mechanism is designed using a multi-armed bandit mechanism to update the confidence value for each client, and the confidence value is used to help the server select high-quality clients online to enter the next round of learning.

[0018] Preferably, the specific method of step five is as follows:

[0019] make Indicates whether it is in the round Select Client i ; In the multi-armed bandit model, each arm is regarded as a client, and the reward of the arm is expressed by the corresponding Shapley value. For each client i Calculate the UCB value as follows:

[0020] ;

[0021] in Represents the client In the round interval The average Shapley value within Represents the client In the round interval The number of times selected in round In the process, the first K clients with larger current confidence values ​​are selected to participate in the next round of federated learning, and the process repeats until the learning is completed.

[0022] An online client selection system based on federated learning includes a model receiving module for global model information sent by a server to a client;

[0023] Model training module: after receiving the local model update from the client, the server aggregates the local model update to update the global model and obtain a new round of global model;

[0024] In the calculation module, the server uses the global validation set to update the client's Shapley value based on the client's local model to measure the client's contribution to the global learning goal; the client's confidence value is updated based on the client's Shapley value, and based on the confidence value, the server selects K clients for a new round and sends the current global model to the selected clients, repeating steps 2 to 4 until the pre-set number of learning rounds is reached or the loss value reaches the specified threshold, and the learning stops.

[0025] A computer device includes at least one processor and a computer-readable medium storing a computer program. When the computer program is read and executed by the processor, the method of the present application is implemented.

[0026] A computer-readable medium stores a computer program, and when the computer program is read and executed by a processor, the method of the present application is implemented.

[0027] Compared with the prior art, the present invention has the following beneficial effects:

[0028] This paper will use the Shapley value technology to measure the client's contribution to the global learning task, and based on the multi-armed bandit mechanism, design an online client selection method for robust federated learning to help the server select high-quality clients to participate in the federated learning process, thereby improving the robustness of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0030] Figure 1 The present invention discloses an overall framework of an online client selection method for robust federated learning.

[0031] Figure 2 is the accuracy test diagram of the present invention; wherein Figure 2 (a) is the result of the MNIST data set test accuracy. Figure 2 (b) shows the test accuracy results of the CIFAR10 dataset.

[0032] Figure 3 is the cumulative data correlation effect diagram of the present invention; wherein Figure 3 (a) is the result of accumulating data correlation of MNIST dataset. Figure 3 (b) shows the result of accumulating data correlation on the CIFAR10 dataset. DETAILED DESCRIPTION

[0033] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0034] The present invention provides an online client selection method for robust federated learning, such as Figure 1 As shown, the following steps are included:

[0035] Step 1: Initial stage, the server selects all clients, and then the server sends the current global model to the selected clients;

[0036] Step 2: The selected client receives the global model, uses local data to learn and update the model, and then uploads the local model update to the server;

[0037] Step 3: After receiving the local model update from the client, the server aggregates the local model updates to update the global model and obtain a new round of global model.

[0038] Step 4: The server uses the global validation set to update and calculate the client's Shapley value based on the client's local model to measure the client's contribution to the global learning goal.

[0039] Step 5: Update the confidence value of the client according to the Shapley value of the client, and based on the confidence value, the server selects K clients for a new round, and sends the current global model to the selected clients, repeating steps 2 to 4 until the pre-set number of learning rounds is reached or the loss value reaches the specified threshold, and the learning stops.

[0040] The specific method is as follows:

[0041] make express A collection of clients, Indicates The set of clients that are selected in rounds, is the characteristic function of the cooperative game model, describing Each group of union , the contribution to the federated learning task. Characteristic function Definitions such as:

[0042] ;

[0043] in, It represents the verification dataset stored by the federated learning center server that can reflect the global goal of the federated learning task. To verify the number of samples in the dataset, is the indicator function, For the Aggregation The global model obtained from the local model, Represents the global model In the data sample Based on the above feature function, the client In the The Shapley value of a wheel can be defined as:

[0044] ;

[0045] in, , , and then through normalization, we can get The Shapley value in the interval. Can be used to measure client The accuracy of the local model on the validation dataset, i.e., the client In the The quality of the training data contributed in the round.

[0046] In step 5, after step 4, the Shapley value of the selected client can be obtained. Since the client data is fluctuating, the contribution of the client to the server learning task is also uncertain. Therefore, the multi-armed bandit mechanism is used to design an online learning mechanism, update the confidence value for each client, and use the confidence value to help the server select high-quality clients online to enter the next round of learning;

[0047] The specific method is as follows:

[0048] make Indicates whether it is in the round Select Client i Based on this, we consider using the upper confidence bound (UCB) multi-armed bandit algorithm to select online clients. In the multi-armed bandit model, each arm is regarded as a client, and the reward of the arm can be expressed using the corresponding Shapley value. For each client, i, , Calculate the UCB value as follows:

[0049] ;

[0050] in Represents the client In the round interval The average Shapley value within Represents the client In the round interval The number of times is selected in . In the process, we select the top K clients with the largest current confidence values ​​to participate in the next round of federated learning, and repeat this process until the learning is completed.

[0051] Figure 2 :With the help of MNIST and CIFAR-10 datasets, the Oracle method is used as a benchmark, and the typical FedAvg algorithm and three federated learning client selection algorithms considering Shapley values, S-FedAvg, AFedSV and AFedSV+, are selected to verify the accuracy of the test set. In the experiment, the server selects 15 clients to participate in the federated learning process in each round, and the results are as follows Figure 2 As shown, Figure 2 (a) is the result of the MNIST data set test accuracy. Figure 2 (b) shows the test accuracy result of CIFAR10 dataset. Figure 2 (a) and Figure 2 As can be seen in (b), with the increase in the number of training rounds, the test accuracy of all methods on the MNIST dataset and the CIFAR10 dataset gradually increases, and the method proposed in the present invention is significantly better than the existing methods, and gradually approaches the Oracle method, and gradually converges with fewer rounds.

[0052] Figure 3 With the help of MNIST and CIFAR-10 datasets, the Oracle method is used as a benchmark, and the typical FedAvg algorithm and three federated learning client selection algorithms considering Shapley values, S-FedAvg, AFedSV, and AFedSV+, are selected to conduct experimental verification of cumulative data correlation. In the experiment, the server selects 15 clients to participate in the federated learning process in each round, and the sum of the Shapley values ​​of the selected clients in each round is accumulated. The higher the accumulated value, the higher the quality of the selected clients. The results are as follows: Figure 3 As shown, Figure 3 (a) is the result of accumulating data correlation of MNIST dataset. Figure 3 (b) shows the result of accumulating data correlation in CIFAR10 dataset. Figure 3 (a) and Figure 3 As can be seen from (b), the method proposed in the present invention can have a good cumulative data correlation value, especially in the CIFAR10 dataset, which shows that the method of the present invention can help the server select high-quality clients to participate in the federated learning process, thereby obtaining a better learning effect (see Figure 2 ), improve the model robustness.

[0053] A computer device, characterized in that it includes at least one processor and a computer-readable medium storing a computer program, wherein when the computer program is read and executed by the processor, the method described in the present application is implemented.

[0054] A computer-readable medium, characterized in that the computer-readable medium stores a computer program, and when the computer program is read and executed by a processor, the method described in the present application is implemented.

[0055] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus dynamic random access memory (Rambus DRAM, referred to as RDRAM), and interface dynamic random access memory (DRDRAM).

[0056] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An online client selection method based on federated learning, characterized in that: The following steps are involved: Step 1: Initial stage, the server selects all clients, and then the server sends the current global model to the selected clients; Step 2: The selected client receives the global model, uses local data to learn and update the model, and then uploads the local model update to the server; Step 3: After receiving the local model update from the client, the server aggregates the local model updates to update the global model and obtain a new round of global model. Step 4: The server uses the global validation set to update and calculate the client's Shapley value based on the client's local model to measure the client's contribution to the global learning goal. make represents a set of N clients, represents the set of clients selected in round t, is the characteristic function of the cooperative game model, describing Each group of union The contribution to the federated learning task, the characteristic function v is defined as follows: in, It represents the verification dataset stored by the federated learning center server that can reflect the global goal of the federated learning task. To verify the number of samples in the dataset, is the indicator function, θ t is the aggregate The global model obtained by the local model, J(x,θ t ) represents the global model θ t In the data sample Based on the above feature function, the client The Shapley value in round t can be defined as: in, By normalizing again, we can get the Shapley value in the interval [0,1]; Used to measure client The accuracy of the local model on the validation dataset, i.e., the client The quality of the training data contributed in round t; Step 5: Update the confidence value of the client according to the Shapley value of the client, and according to the confidence value, the server selects K clients for a new round, and sends the current global model to the selected clients, repeating steps 2 to 4 until the preset number of learning rounds is reached or the loss value reaches the specified threshold, and the learning stops; Let z {i,t} ∈{0,1} indicates whether client i is selected in round t; in the multi-armed bandit model, each arm is regarded as a client, and the reward of the arm is represented by the corresponding Shapley value. In round t+1, for each client Calculate the UCB value as follows: in represents the average Shapley value of client i in the round interval [1, t], λ i,t It represents the number of times client i is selected in the round interval [1, t]. In round t+1, the first K clients with larger current confidence values ​​are selected to participate in the next round of federated learning process, and the process repeats until the learning is completed.

2. The online client selection method based on federated learning according to claim 1, characterized in that: In step 1, at the beginning of federated learning, the server has no knowledge of the client information. At this time, the server first selects all clients and sends the current model to the selected clients.

3. The online client selection method based on federated learning according to claim 1, characterized in that: In step five, after step four, the Shapley value of the selected client is obtained; the online learning mechanism is designed using the multi-armed bandit mechanism to update the confidence value for each client, and the confidence value is used to help the server select high-quality clients online to enter the next round of learning.

4. A system for online client selection method based on federated learning according to any one of claims 1 to 3, characterized in that: Model receiving module, used for global model information sent from the server to the client; Model training module: after receiving the local model update from the client, the server aggregates the local model update to update the global model and obtain a new round of global model; In the calculation module, the server uses the global validation set to update the client's Shapley value based on the client's local model to measure the client's contribution to the global learning goal; the client's confidence value is updated based on the client's Shapley value, and based on the confidence value, the server selects K clients for a new round and sends the current global model to the selected clients, repeating steps 2 to 4 until the pre-set number of learning rounds is reached or the loss value reaches the specified threshold, and the learning stops.

Citation Information

Cited By

  • Federal learning dynamic client selection method based on dobby machine and fuzzy calculation

    CN119808991A