Method and apparatus for selecting training participants based on federated learning scenarios
By dividing data based on data category and data volume in federated learning and using linear fitting methods to select training participants, the problem of high communication overhead in federated learning is solved and the training efficiency and effect are improved.
Patent Information
- Application Number
- CN202111506144.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2041-12-10
AI Technical Summary
Federated learning suffers from high communication overhead, and client data is not independent and identically distributed, resulting in low training efficiency.
By dividing the data set based on data category and data volume, the historical representation similarity of client data is calculated using a linear fitting method, the candidate participant closest to the current training round is selected, and the final training participant is determined from the candidate list.
It effectively reduces the communication overhead of the model training process and improves the training efficiency and model training effect.
Smart Images

Figure CN114492829B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information processing technology, and in particular to a method and device for selecting training participants based on a federated learning scenario. Background Art
[0002] Mobile phones, wearable devices, and IoT devices play a vital role in modern life. An increasing number of intelligent applications, such as personal health monitoring and keyboard input suggestions, are being embedded in these mobile devices. However, these applications often rely on pre-trained models that lack client-side information, making personalization difficult. Furthermore, with increasing attention being paid to data security and privacy, a learning method is needed that leverages client-side data without uploading it to a central node.
[0003] Federated learning provides a solution for data privacy protection and distributed model training. Federated learning involves a network of clients connected to a server. While protecting client data privacy, a secure and reliable global model is trained and distributed to each client in an encrypted manner. Federated learning primarily involves two steps: model training, during which model-related information is exchanged in an encrypted manner, but each client's data remains locally, protected from public view. The second step is model inference, during which the model can be applied to new data instances, allowing clients to make inferences and predictions using the shared global model.
[0004] While federated learning offers significant advantages in addressing data privacy concerns, it still faces numerous challenges, such as communication costs and the non-independent and identically distributed nature of client data. Furthermore, federated learning models typically require numerous rounds of collaborative training across clients, a process in which encrypted model transmission incurs significant communication overhead. Therefore, selecting the client for each round of global model training is crucial. Summary of the Invention
[0005] The present invention provides a method and device for selecting training participants based on a federated learning scenario, which is used to solve the defect of high communication overhead in the prior art and can effectively reduce communication costs.
[0006] In a first aspect, the present invention provides a method for selecting training participants based on a federated learning scenario, comprising: dividing the data set based on data category and data volume to obtain data for each client in the federated learning scenario; if the current training round is less than a preset maximum training round, calculating the data for each client based on a linear fitting method, and determining a list of candidate participants for the current training round in the client; obtaining a preset number of training participants for the current training round; the preset number is less than the total number of the clients; and determining the training participants for the current training round in the list of candidate participants for the current training round according to the preset number.
[0007] According to the method for selecting training participants based on a federated learning scenario provided by the present invention, the linear fitting method is used to calculate the data of each client, and a list of candidate participants for the current training round is determined in the client, including: based on the calculation of the data of each client, a historical representation similarity list of the global model of each training round in the preset training round closest to the current training round and the local model of the client is obtained; based on the linear fitting method, the data in the historical representation similarity list is calculated to obtain a list of candidate participants for the current training round.
[0008] According to the method for selecting training participants based on the federated learning scenario provided by the present invention, the method is based on calculating the data of each client to obtain a historical representation similarity list between the global model of each training round in the preset training round closest to the current training round and the local model of the client, including: calculating the first activation matrix of the global model of each training round in the preset training round closest to the current training round and the corresponding second activation matrix of the local model of the client according to the data of each client; calculating the standard orthogonal basis of the first activation matrix according to the first activation matrix, and calculating the standard orthogonal basis of the second activation matrix according to the second activation matrix; calculating the representation similarity score of the first activation matrix and the second activation matrix according to the standard orthogonal basis of the first activation matrix and the corresponding standard orthogonal basis of the second activation matrix, and the set of the representation similarity scores constitutes the historical representation similarity list between the global model of each training round in the preset training round closest to the current training round and the local model of the client.
[0009] According to the method for selecting training participants based on a federated learning scenario provided by the present invention, the data in the historical representation similarity list is calculated based on the linear fitting method to obtain a list of candidate participants for the current training round, including: calculating the data in the historical representation similarity list based on the linear fitting method to obtain a historical trend of each client data in the current training round; and taking a set of clients corresponding to client data showing an increasing historical trend in the historical trend as the list of candidate participants for the current training round.
[0010] According to the method for selecting training participants based on a federated learning scenario provided by the present invention, after determining the training participants of the current training round, it also includes: training the corresponding local model based on the data of the training participants of the current training round and uploading it to the server; updating the historical representation similarity list of the global model of each training round in the preset training round closest to the current training round and the local model of the client based on the uploaded local model, and obtaining the historical representation similarity list of the global model of each training round in the preset training round closest to the next training round and the local model of the client.
[0011] In the second aspect, the present invention also provides a device for selecting training participants based on a federated learning scenario, including: a division module, used to divide the data set based on data category and data volume, and obtain the data of each client in the federated learning scenario; a calculation module, used to train the global model based on the client data, if the current training round is less than the preset maximum training round, calculate the data of each client based on the linear fitting method, and determine the list of candidate participants for the current training round in the client; an acquisition module, used to obtain a preset number of training participants for the current training round; the preset number is less than the total number of clients; a determination module, used to determine the training participants of the current training round in the candidate participant list of the current training round according to the preset number.
[0012] According to the device for selecting training participants based on a federated learning scenario provided by the present invention, the calculation module includes: a first calculation unit, which is used to obtain a historical representation similarity list of the global model of each training round in the preset training round closest to the current training round and the local model of the client based on calculation of the data of each client; and a second calculation unit, which is used to calculate the data in the historical representation similarity list based on the linear fitting method to obtain a list of candidate participants for the current training round.
[0013] In a third aspect, the present invention also provides an electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for selecting training participants based on a federated learning scenario as described in the first aspect are implemented.
[0014] In a fourth aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for selecting training participants based on a federated learning scenario as described in the first aspect.
[0015] In a fifth aspect, an embodiment of the present invention further provides a computer program product having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the steps of the method for selecting training participants based on a federated learning scenario as described in the first aspect.
[0016] The present invention provides a method and device for selecting training participants based on a federated learning scenario. The method divides the data set based on data category and data volume to obtain data for each client in the federated learning scenario; trains the global model based on the client data, and if the current training round is less than the preset maximum training round, calculates each client data based on a linear fitting method, and determines a list of candidate participants for the current training round in the client; obtains a preset number of training participants for the current training round; the preset number is less than the total number of clients; and determines the training participants for the current training round in the list of candidate participants for the current training round based on the preset number. By using client data and a hierarchical participant selection list generation method, a list of candidate participants for the current training round is first generated, and then the final training participant is determined from the list of candidate participants. This can effectively reduce the communication overhead of the model training process, and by fully utilizing the client information, a better training participant is selected to participate in the training of this round, so that the model training can achieve better results. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 This is a flow chart of an embodiment of a method for selecting a training participant based on a federated learning scenario provided by the present invention;
[0019] Figure 2This is a flow chart of an embodiment of a method for obtaining a list of candidate participants for a current training round provided by the present invention;
[0020] Figure 3 This is a flow chart of an embodiment of a method for obtaining a history representation similarity list provided by the present invention;
[0021] Figure 4 This is a flow chart of another method embodiment of obtaining a list of candidate participants for a current training round provided by the present invention;
[0022] Figure 5 This is a schematic diagram of an application scenario provided by the present invention;
[0023] Figure 6 1 is a schematic diagram of the structural composition of an embodiment of a device for selecting a training participant based on a federated learning scenario provided by the present invention;
[0024] Figure 7 It is a structural schematic diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0025] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0026] Figure 1 This is a flow chart of an embodiment of a method for selecting training participants based on a federated learning scenario provided by the present invention. Figure 1 As shown, the method for selecting training participants based on the federated learning scenario may include the following steps:
[0027] S101, dividing the data set based on data category and data volume to obtain data for each client.
[0028] In step S101, in federated learning for classification tasks, each client may only have part of the category data among all the category data, and the amount of data owned by each client also varies greatly, so the data set is divided based on the two aspects of data category imbalance and data amount imbalance.
[0029] Taking the federated learning scenario where K clients participate in training as an example, for a total of N cFor a dataset of class data, the dataset is randomly divided into n×K parts of unequal length, where n represents the number of data randomly allocated to each client, and there is no duplicate data between clients.
[0030] S102: Train the global model based on the client data. If the current training round is less than the preset maximum training round, calculate each client data based on the linear fitting method and determine the candidate participant list of the current training round in the client.
[0031] In step S102, the maximum number of training rounds can be pre-set, such as 100 or 200 rounds, but should be greater than the number of rounds required for model convergence. If the model converges prematurely, training can be terminated immediately. The linear fitting method calculates the data of each client. Based on the calculation results of the linear fitting method on the data of each client, some clients can be selected from all clients as candidate participants for the current training round. These candidate participants for the current training round constitute the candidate participant list for the current training round.
[0032] S103, obtaining a preset number of training participants in the current training round; the preset number is smaller than the total number of clients.
[0033] S104: Determine the training participants of the current training round in the candidate participant list of the current training round according to a preset number.
[0034] In step S103 and step S104, the training participants for the current training round can be determined based on the preset number and the length of the candidate participant list, that is, the number of clients in the candidate participant list. The preset number can be greater than the number of clients in the candidate participant list, or the preset number can be equal to the number of clients in the candidate participant list, or the preset number can be less than the number of clients in the candidate participant list, and this is not limited in the embodiment of the present invention. A preset number of clients are randomly selected from all clients to participate in the training, and the training participants for the current training round are determined based on the preset number and the length of the candidate participant list. Specifically,
[0035] Compare the length of the candidate participant list with the preset number. If the length of the candidate participant list is greater than the preset number, randomly select a preset number of clients from the candidate participant list as training participants for the current training round. If the length of the candidate participant list is equal to the preset number, use all clients in the candidate participant list as training participants for the current training round. If the length of the candidate participant list is less than the preset number, use all clients in the candidate participant list as the first part of the training participants for the current training round, and calculate the difference between the preset number and the length of the candidate participant list. Select clients outside the candidate participant list whose number corresponds to the difference as the second part of the training participants for the current training round. The training participants of the current training round in the first and second parts are the final training participants for the current training round. The present invention provides a method for selecting training participants based on a federated learning scenario. The method divides the data set based on data category and data volume to obtain data for each client in the federated learning scenario. The method trains the global model based on the client data. If the current training round is less than the preset maximum training round, the method calculates the data for each client based on a linear fitting method, and determines a list of candidate participants for the current training round in the client. The method obtains a preset number of training participants for the current training round. The preset number is less than the total number of clients. The method determines the training participants for the current training round in the list of candidate participants for the current training round based on the preset number. By using the client data and a hierarchical participant selection list generation method, a list of candidate participants for the current training round is first generated, and then the final training participants are determined from the list of candidate participants. This method can effectively reduce the communication overhead of the model training process. By fully utilizing the client information, better training participants are selected to participate in the training of this round, so that the model training can achieve better results.
[0036] Figure 2 FIG. 1 is a flow chart of an embodiment of a method for obtaining a list of candidate participants for the current training round provided by the present invention. Figure 2 As shown, the method for obtaining a list of candidate participants for the current training round may include the following steps:
[0037] S201, calculating each client data to obtain a historical representation similarity list between the global model of each training round in the preset training round closest to the current training round and the local model of the client;
[0038] In step S201, the preset number of training rounds is less than the preset maximum number of training rounds. For example, if the preset maximum number of training rounds is 100, the current number of training rounds is 99, and the preset number of training rounds is 5, then calculations can be performed on each client's data to obtain a historical representation similarity list between the global model and the client's local model for the five training rounds closest to the 99th training round, i.e., a historical representation similarity list between the global model and the client's local model for training rounds 94-98.
[0039] The historical representation similarity list of the global model of each training round in the preset training round closest to the current training round and the local model of the client can be a set of representation similarity scores of the global model of each training round in the preset training round closest to the current training round and the local model of the client.
[0040] S202: Calculate the data in the history representation similarity list based on a linear fitting method to obtain a list of candidate participants for the current training round.
[0041] In step S202, the historical representation similarity list can be used as input to the calculation module, which can calculate the historical trend of each client data in the current training round using a linear fitting method. The calculation method is shown in Formula 1:
[0042]
[0043] Among them, k represents the historical trend of client data, x is the training round, y is the historical representation similarity list and the representation similarity score corresponding to x, is the mean of x, is the mean of y, is the mean of x·y, and the list of candidate participants for the current training round is determined based on the obtained representation similarity scores.
[0044] Figure 3 FIG. 1 is a flow chart of an embodiment of a method for obtaining a history representation similarity list provided by the present invention. Figure 3 As shown, the method for obtaining a history representation similarity list may include the following steps:
[0045] S301 , based on each client data, respectively calculating a first activation matrix of a global model of each training round in a preset training round closest to a current training round and a second activation matrix of a local model of the corresponding client.
[0046] In step S301, the first activation matrix and the second activation matrix are and Where n is the number of data corresponding to the client, p is the number of neurons, and the first activation matrix and the second activation matrix have the same size.
[0047] S302: Calculate an orthogonal basis of the first activation matrix according to the first activation matrix, and calculate an orthogonal basis of the second activation matrix according to the second activation matrix.
[0048] In step S302, the formulas for calculating the orthonormal basis of the first activation matrix and the corresponding second activation matrix are shown in Formula 2 and Formula 3 respectively:
[0049] Q X =X(X T X) 1 / 2 (Formula 2)
[0050] Q Y =Y(Y T Y) 1 / 2 (Formula 3)
[0051] Among them, Q X and Q Y represent the orthonormal basis of the first activation matrix and the second activation matrix respectively.
[0052] S303, based on the standard orthogonal basis of the first activation matrix and the corresponding standard orthogonal basis of the second activation matrix, calculate the representation similarity scores of the first activation matrix and the second activation matrix, and the set of representation similarity scores constitutes a historical representation similarity list of the global model of each training round in the preset training round closest to the current training round and the local model of the client.
[0053] In step S303, the calculation formula for the representation similarity score between the first activation matrix and the second activation matrix is shown in Formula 4:
[0054]
[0055] in, Represents the nuclear norm. The nuclear norm is the sum of the singular values of a matrix, and its role is to constrain low-rank. Rank can measure the correlation of matrices. In other words, the similarity score can be used to represent the correlation between the global model and the client's local model.
[0056] Figure 4 FIG. 1 is a flow chart of another method embodiment of obtaining a list of candidate participants for the current training round provided by the present invention. Figure 4 As shown, the method for preparing a candidate participant list for the current training round may include the following steps:
[0057] S401 , calculating the data in the history representation similarity list based on a linear fitting method to obtain the historical trend of each client data in the current training round.
[0058] In step S401, the detailed description of step S401 is given in step S202 and will not be repeated here.
[0059] S402: Use the set of clients corresponding to the client data showing an increasing historical trend as a candidate participant list for the current training round.
[0060] In step S402, the historical trend may include: an increasing historical trend, a decreasing historical trend, and no obvious historical trend. An increasing historical trend indicates that the client's local model is gradually approaching the global model, a decreasing historical trend indicates that the client's local model is gradually deviating from the global model, and no obvious historical trend indicates that the client's model is at the same distance from the global model.
[0061] If the calculated historical trend of the client data shows an increasing trend, the client corresponding to the data showing this trend is determined to be a candidate participant in the current training round.
[0062] The method for obtaining a list of candidate participants for the current training round provided by the present invention fully utilizes the representation similarity information of each client, thereby obtaining better candidate participants for the current training round in each global round.
[0063] In some optional embodiments, after determining the training participants of the current training round, it also includes: training the corresponding local model according to the training participants of the current training round and uploading it to the server; updating the historical representation similarity list of the global model of each training round in the preset training round closest to the current training round and the local model of the client according to the uploaded local model, and obtaining the historical representation similarity list of the global model of each training round in the preset training round closest to the next training round and the local model of the client.
[0064] The training participants of the next training round can be determined by updating the historical representation similarity list of the global model of each training round in the preset training round closest to the next training round and the local model of the client.
[0065] Figure 5 This is a schematic diagram of an application scenario provided by the present invention. Figure 5 As shown, by determining the training participants in each round to train the global model, the process of obtaining the final global model may include:
[0066] Obtain the number of clients participating in the training, the data set, and hyperparameters; divide the data set according to the non-independent synchronous distribution; initialize the global model and local model parameters; if the current training round is equal to the maximum training round, obtain the final global model and the training ends; if the current training round is less than the maximum training round, determine the list of candidate participants based on the model representation similarity trend; train the participants in the candidate participant list according to the adaptive strategy; train the local model according to the client corresponding to the training participant and upload it, and the server updates the historical representation similarity list according to the uploaded local model, and obtains the historical representation similarity list of each training round in the preset training round closest to the next training round; compare the next training round with the maximum training round as the new current training round, and start training for the new current training round.
[0067] Figure 6 This is a schematic diagram of the structure of an embodiment of a device for selecting training participants based on a federated learning scenario provided by the present invention. Figure 6 As shown, the training participant selection device based on the federated learning scenario includes:
[0068] A partitioning module 601 is used to partition the data set based on data category and data volume to obtain data for each client in the federated learning scenario;
[0069] A calculation module 602 is configured to train the global model based on the client data. If the current training round is less than the preset maximum training round, the calculation is performed on each client data using a linear fitting method to determine a list of candidate participants for the current training round on the client.
[0070] The acquisition module 603 is used to obtain a preset number of training participants in the current training round; the preset number is less than the total number of clients;
[0071] The determination module 604 is configured to determine the training participants of the current training round from the candidate participant list of the current training round according to a preset number.
[0072] Optionally, the calculation module 602 includes:
[0073] A first calculation unit is configured to obtain, based on calculations performed on each client data, a list of historical representation similarities between a global model of each training round in a preset training round closest to a current training round and a local model of the client;
[0074] The second calculation unit is used to calculate the data in the history representation similarity list based on a linear fitting method to obtain a list of candidate participants for the current training round.
[0075] Optionally, the first computing unit includes:
[0076] a first calculation subunit configured to calculate, according to each client data, a first activation matrix of a global model of each training round in the preset training rounds closest to the current training round and a second activation matrix of a local model of the corresponding client;
[0077] a second calculation subunit configured to calculate a standard orthogonal basis of the first activation matrix according to the first activation matrix and a standard orthogonal basis of the second activation matrix according to the second activation matrix;
[0078] a third calculation subunit configured to calculate a representation similarity score of the first activation matrix and the second activation matrix according to the standard orthogonal basis of the first activation matrix and the standard orthogonal basis of the corresponding second activation matrix, and a set of representation similarity scores constitutes a historical representation similarity list of the global model of each training round in the preset training rounds closest to the current training round and the local model of the client.
[0079] Optionally, the second calculation unit comprises:
[0080] a calculation subunit configured to calculate the historical representation similarity list of each client data of the current training round based on a linear fitting method to obtain a historical trend;
[0081] a determination subunit configured to take a set of clients corresponding to the client data with the increasing historical trend in the historical trend as a candidate participant list of the current training round.
[0082] Optionally, the device for selecting training participants in a federated learning scenario further comprises:
[0083] a training module configured to train the corresponding local model according to the data of the training participant of the current training round and upload the local model to the server;
[0084] an updating module configured to update the historical representation similarity list of the global model of each training round in the preset training rounds closest to the current training round and the local model of the client to obtain a historical representation similarity list of the global model of each training round in the preset training rounds closest to the next training round and the local model of the client.
[0085] Figure 7 is a structural schematic diagram of an electronic device provided by the present application. As shown in Figure 7As shown, the head-mounted device may include: a processor 701, a communications interface 702, a memory 703, and a communication bus 704, wherein the processor 701, the communications interface 702, and the memory 703 communicate with each other via the communication bus 704. The processor 701 may call the logic instructions in the memory 703 to execute a method for selecting a training participant based on a federated learning scenario, the method comprising:
[0086] The data set is divided based on data category and data volume to obtain data for each client in the federated learning scenario; the global model is trained based on the client data. If the current training round is less than the preset maximum training round, each client data is calculated based on the linear fitting method, and a list of candidate participants for the current training round is determined in the client; the preset number of training participants for the current training round is obtained; the preset number is less than the total number of clients; and the training participants for the current training round are determined in the list of candidate participants for the current training round based on the preset number.
[0087] In addition, the logic instructions in the above-mentioned memory 703 can be implemented in the form of a software function module and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0088] In another aspect, the present invention further provides a computer program product, comprising a computer program stored on a non-transitory computer-readable storage medium, wherein the computer program comprises program instructions. When the program instructions are executed by a computer, the computer is capable of performing the selection of training participants based on the federated learning scenario provided by the above methods, wherein the method comprises:
[0089] The data set is divided based on data category and data volume to obtain data for each client in the federated learning scenario; the global model is trained based on the client data. If the current training round is less than the preset maximum training round, each client data is calculated based on the linear fitting method, and a list of candidate participants for the current training round is determined in the client; the preset number of training participants for the current training round is obtained; the preset number is less than the total number of clients; and the training participants for the current training round are determined in the list of candidate participants for the current training round based on the preset number.
[0090] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for selecting a training participant based on a federated learning scenario provided by the above methods is implemented, the method comprising:
[0091] The data set is divided based on data category and data volume to obtain data for each client in the federated learning scenario; the global model is trained based on the client data. If the current training round is less than the preset maximum training round, each client data is calculated based on the linear fitting method, and a list of candidate participants for the current training round is determined in the client; the preset number of training participants for the current training round is obtained; the preset number is less than the total number of clients; and the training participants for the current training round are determined in the list of candidate participants for the current training round based on the preset number.
[0092] The device embodiments described above are merely illustrative. Modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0093] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus the necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or certain parts of the embodiment.
[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for selecting training participants based on a federated learning scenario, characterized in that: include: Divide the data set based on data category and data volume to obtain data for each client in the federated learning scenario; Training the global model based on the client data, and if the current training round is less than a preset maximum training round, calculating the data of each client based on a linear fitting method, and determining a list of candidate participants for the current training round in the client; Get the preset number of training participants for the current training round; The preset number is smaller than the total number of the clients; Determining the training participants for the current training round in the candidate participant list for the current training round according to the preset number; The calculating the data of each client based on the linear fitting method to determine a list of candidate participants for the current training round in the client includes: Based on the calculation of each client data, a historical representation similarity list between the global model of each training round in the preset training round closest to the current training round and the local model of the client is obtained; Calculating the data in the historical representation similarity list based on the linear fitting method to obtain a list of candidate participants for the current training round; The method of obtaining a historical representation similarity list between a global model of each training round in a preset training round closest to a current training round and a local model of the client based on the calculation of each client data includes: Calculating, based on each client data, a first activation matrix of a global model of each training round in a preset training round closest to a current training round and a second activation matrix of a local model of the corresponding client; Calculate the orthonormal basis of the first activation matrix according to the first activation matrix, and calculate the orthonormal basis of the second activation matrix according to the second activation matrix; Based on the standard orthogonal basis of the first activation matrix and the corresponding standard orthogonal basis of the second activation matrix, the representation similarity scores of the first activation matrix and the second activation matrix are calculated, and the set of the representation similarity scores constitutes a historical representation similarity list of the global model of each training round in the preset training round closest to the current training round and the local model of the client.
2. The method for selecting training participants based on a federated learning scenario according to claim 1, characterized in that: The calculating of the data in the historical representation similarity list based on the linear fitting method to obtain the candidate participant list for the current training round includes: Calculating the data in the history representation similarity list based on the linear fitting method to obtain the historical trend of each client data in the current training round; The set of clients corresponding to the client data showing an increasing historical trend in the historical trend is used as a candidate participant list for the current training round.
3. The method for selecting training participants based on a federated learning scenario according to claim 1, characterized in that: After determining the training participants of the current training round, the method further includes: Training the corresponding local model based on the data of the training participants in the current training round and uploading it to the server; According to the uploaded local model, the historical representation similarity list of the global model of each training round in the preset training round closest to the current training round and the local model of the client is updated to obtain the historical representation similarity list of the global model of each training round in the preset training round closest to the next training round and the local model of the client.
4. A device for selecting training participants based on a federated learning scenario, characterized in that: include: A partitioning module is used to partition the data set based on data category and data volume to obtain data for each client in the federated learning scenario; a calculation module, configured to train the global model based on the client data, and if the current training round is less than a preset maximum training round, calculate the data of each client based on a linear fitting method, and determine a list of candidate participants for the current training round in the client; An acquisition module, used to obtain a preset number of training participants in the current training round; The preset number is smaller than the total number of the clients; A determination module, configured to determine the training participants of the current training round in the candidate participant list of the current training round according to the preset number; The computing module is specifically configured to: Based on the calculation of each client data, a historical representation similarity list between the global model of each training round in the preset training round closest to the current training round and the local model of the client is obtained; Calculating the data in the historical representation similarity list based on the linear fitting method to obtain a list of candidate participants for the current training round; The computing module is specifically configured to: Calculating, based on each client data, a first activation matrix of a global model of each training round in a preset training round closest to a current training round and a second activation matrix of a local model of the corresponding client; Calculate the orthonormal basis of the first activation matrix according to the first activation matrix, and calculate the orthonormal basis of the second activation matrix according to the second activation matrix; Based on the standard orthogonal basis of the first activation matrix and the corresponding standard orthogonal basis of the second activation matrix, the representation similarity scores of the first activation matrix and the second activation matrix are calculated, and the set of the representation similarity scores constitutes a historical representation similarity list of the global model of each training round in the preset training round closest to the current training round and the local model of the client.
5. The device for selecting training participants based on a federated learning scenario according to claim 4, characterized in that: The computing module includes: A first calculation unit is configured to obtain, based on calculation of each client data, a list of historical representation similarities between a global model of each training round in a preset training round closest to a current training round and a local model of the client; The second calculation unit is configured to calculate the data in the history representation similarity list based on the linear fitting method to obtain a candidate participant list for the current training round.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method for selecting training participants based on a federated learning scenario as described in any one of claims 1 to 3 are implemented.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for selecting a training participant based on a federated learning scenario as described in any one of claims 1 to 3 are implemented.
8. A computer program product having executable instructions stored thereon, characterized in that: When the instruction is executed by the processor, the processor implements the steps of the method for selecting training participants based on the federated learning scenario as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Data processing system based on transverse federated learning
CN113077056A
Federated learning method for power grid edge computing system and related device thereof
CN113221470A