Method, apparatus, device and medium for sharing data in federated learning system
By updating training data based on feedback from edge devices in the federated learning system and using differentiated shared data, the problems of low model training efficiency and insufficient prediction accuracy caused by the differences in data distribution among edge devices are solved, achieving more efficient model training and prediction.
Patent Information
- Application Number
- CN202010597134.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-28
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2040-06-28
AI Technical Summary
In existing federated learning systems, the data distribution differences of edge devices lead to low model training efficiency and prediction accuracy that fails to meet business needs. Existing data sharing methods have failed to effectively solve this problem.
The first device updates the training data in a targeted manner based on feedback information from the edge devices, and distributes shared data in a differentiated manner to reduce the distribution differences of training data and improve model training efficiency and prediction accuracy.
It improves the model's prediction accuracy and training efficiency, reduces communication pressure and data transmission requirements, and achieves more efficient federated learning results.
Smart Images

Figure CN113850390B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence (AI), and in particular to a method and device for sharing data in a federated learning system, and a computer readable storage medium and a computer program product. BACKGROUND
[0002] Federated learning (FL) is a new algorithm proposed to solve the problem of data silos and privacy protection in machine learning. The algorithm provides a federated learning system. The federated learning system generally includes a center device and edge devices. Each edge device holds its own data set, and the data sets between edge devices are isolated from each other. Each edge device uses its own data set to train a model, and uploads the gradient to the center device. The center device aggregates the gradients of each edge device to update the model and reissues the updated model to each edge device.
[0003] Existing machine learning tasks generally assume that the data follows the assumption of independent and identically distributed. In federated learning, the data between different edge devices is likely to not meet this assumption. In order to solve the problem of data distribution affecting the effect of federated learning, the industry has proposed some methods for sharing data. Specifically, in the initial training stage, for each edge device participating in federated learning, a part of data is randomly sampled from a shared data set and distributed to each edge device. The edge device trains a model based on the shared data and private data.
[0004] However, the prediction accuracy and model training efficiency of the model trained based on the above method still cannot meet the business requirements. SUMMARY
[0005] The present application provides a method for sharing data in a federated learning system, which updates the training data of at least one second device according to the feedback information of the at least one second device, and performs model training based on the updated training data, which can improve the model training efficiency and model prediction accuracy and meet the business requirements. The present application also provides a device, a computer readable storage medium and a computer program product corresponding to the above method.
[0006] In a first aspect, a method for sharing data in a federated learning system is provided. The federated learning system includes a first device and at least one second device. The federated learning system can be deployed in a cloud environment, specifically, a plurality of computing devices (e.g., a central server) in the cloud environment. The federated learning system can also be deployed in an edge environment, specifically, a plurality of computing devices (e.g., an edge server) in the edge environment. The federated learning system can also be deployed in an end device (e.g., a desktop computer or other user terminal). In some implementations, the federated learning system can also be distributedly deployed in different environments, for example, the first device is deployed in a cloud environment and the at least one second device is deployed in an edge environment.
[0007] Specifically, the first device obtains feedback information of the at least one second device, and then updates training data of the at least one second device according to the feedback information of the at least one second device. In this way, the training data of the second device can be updated according to the feedback information of the second device.
[0008] Since at least part of the updated training data is shared data from the shared data set of the first device, these shared data have the same data distribution, thereby reducing the distribution difference of the training data of the at least one second device and improving the federated learning effect. Moreover, the method takes into account the differences between the second devices and distributes shared data in a differentiated manner, so that the second devices can perform targeted training according to the updated training data, thereby improving the model prediction accuracy and model training efficiency.
[0009] In some possible implementations, the first device can update the training data of the at least one second device according to target data of the at least one second device. The target data of the at least one second device is data in the shared data set of the first device that matches the feedback information of the at least one second device. Specifically, the first device can determine the target data from the shared data set according to the feedback information of the at least one second device, and then update the training data of the at least one second device according to the target data.
[0010] The training data of the second device includes at least the target data after being updated. In this way, the second device can perform targeted training according to the training data including the target data, thereby improving the model prediction accuracy and model training efficiency.
[0011] In some possible implementations, the first device can update the training data of the at least one second device according to the feedback information of the at least one second device when the feedback information of the at least one second device satisfies a preset condition. The preset condition can be at least one of the following conditions: the device is in an idle state, the transmission delay does not exceed a preset time length (indicating that the communication condition is good), the computing power is greater than a computing power threshold, and the storage capacity is greater than a storage capacity threshold.
[0012] Since the first device can determine whether to update the training data of the at least one second device according to the feedback information of the at least one second device, unnecessary data transmission can be avoided, and communication pressure can be reduced.
[0013] In some possible implementation manners, the feedback information includes configuration information of the second device or attribute information of a model trained by the second device. The configuration information can include one or more of computing power, communication state, storage capacity, and idle state. The attribute information of the model can include one or more of a model construction parameter, model performance, and model accuracy. The model construction parameter is specifically a parameter used for constructing the model, for example, can be a model gradient, a model weight, and the like. The model accuracy includes any one or more of accuracy, recall rate, and precision, and the model performance includes model training time and the like.
[0014] In some possible implementation manners, the attribute information of the model includes the model construction parameter, and the first device can construct a model copy corresponding to the model trained by the at least one second device according to the model construction parameter such as the model gradient, and then predict sample data in the shared data set by using the model copy to obtain sample data with prediction errors. Then, the first device updates the training data of the at least one second device according to the sample data with prediction errors.
[0015] In this way, the second device can perform targeted training according to the sample data with prediction errors, and improve model training accuracy. In addition, the training times can be reduced and the model training efficiency can be improved by performing targeted training through the sample data with prediction errors.
[0016] In some possible implementation manners, the configuration information includes one or more of computing power, communication state, storage capacity, and idle state, and the attribute information of the model includes one or more of model performance and model accuracy. The first device can determine the number of training data corresponding to the at least one second device according to one or more of the computing power, the communication state, the storage capacity, the idle state, the model performance, and the model accuracy. Then, the first device can update the training data of the at least one second device according to the number of training data corresponding to the at least one second device. In this way, the shared data can be sent in a targeted manner, and the model accuracy and the model training efficiency can be improved by performing targeted training through the shared data.
[0017] In some possible implementation manners, the first device can send a first identifier to the at least one second device, where the first identifier can be an identifier of the target data, and the second device can obtain data from a local platform or a third-party platform according to the first identifier, so as to update the training data. Since only the identifier of the target data needs to be sent, and the target data does not need to be sent, the amount of data that needs to be transmitted by the first device is greatly reduced, the network resources occupied by the first device are reduced, the communication pressure of the first device is reduced, and the transmission efficiency is improved.
[0018] In some possible implementation manners, the first device records a second identifier, which is specifically an identifier of data held by the at least one second device, and the first device can update the training data of the at least one second device in an incremental update manner according to the second identifier and the feedback information of the at least one second device. Since the incremental update manner is adopted, the first device does not need to send the identifier of the data held by the second device, and the amount of data that needs to be transmitted by the first device is further reduced, and the transmission efficiency is improved.
[0019] In a second aspect, the present application provides a method for sharing data in a federated learning system. The federated learning system includes a first device and at least one second device. The at least one second device can generate feedback information of the at least one second device, and then the at least one second device sends the feedback information to the first device, where the feedback information is used by the first device to update the training data of the at least one second device. The method takes into account the differences between the second devices, and shares the data in a differentiated manner, so that the second devices can perform targeted training according to the updated training data, and the model prediction accuracy and the model training efficiency are improved.
[0020] In some possible implementation manners, the at least one second device receives target data sent by the first device, where the target data is data in the shared data set of the first device that matches the feedback information of the at least one second device. In this way, the second device can perform targeted training according to the target data, and the model prediction accuracy and the model training efficiency are improved.
[0021] In some possible implementation manners, the at least one second device receives an identifier of target data sent by the first device, where the target data is data in the shared data set of the first device that matches the feedback information of the at least one second device. The at least one second device can obtain the target data according to the identifier of the target data, for example, obtain the target data from a local platform or a third-party platform. Since the first device only needs to send the identifier of the target data, the amount of data transmitted by the first device is reduced, and the communication pressure of the first device is reduced.
[0022] In some possible implementation manners, the first device records an identifier of data held by at least one second device. The target data is data in a shared data set of the first device that matches the feedback information of the at least one second device, and the data is not held by the at least one second device. In this way, the first device can update the training data of the at least one second device in an incremental manner, thereby reducing the amount of data transmitted by the first device and reducing the communication pressure of the first device.
[0023] In a third aspect, the present application provides an apparatus for sharing data in a federated learning system. The federated learning system includes a first device and at least one second device, and the apparatus includes:
[0024] a communication module configured to obtain feedback information of the at least one second device;
[0025] an updating module configured to update training data of the at least one second device according to the feedback information of the at least one second device.
[0026] In some possible implementation manners, the updating module is specifically configured to:
[0027] update the training data of the at least one second device according to target data of the at least one second device, the target data of the at least one second device being data in the shared data set of the first device that matches the feedback information of the at least one second device.
[0028] In some possible implementation manners, the updating module is specifically configured to:
[0029] when the feedback information of the at least one second device satisfies a preset condition, update the training data of the at least one second device according to the feedback information of the at least one second device.
[0030] In some possible implementation manners, the feedback information includes configuration information of the second device or attribute information of a model trained by the second device.
[0031] In some possible implementation manners, the attribute information of the model includes a model construction parameter.
[0032] The updating module is specifically configured to:
[0033] construct a model copy corresponding to the model trained by the at least one second device according to the model construction parameter;
[0034] predict sample data in the shared data set by using the model copy, and obtain sample data with prediction errors;
[0035] update the training data of the at least one second device according to the sample data with prediction errors.
[0036] In some possible implementation manners, the configuration information comprises one or more of computing power, communication state, storage capacity, and idle state, and the attribute information of the model comprises one or more of model performance and model accuracy.
[0037] The updating module is specifically configured to:
[0038] determine the quantity of training data corresponding to the at least one second device according to one or more of the computing power, the communication state, the storage capacity, the idle state, the model performance, and the model accuracy;
[0039] update the training data of the at least one second device according to the quantity of training data corresponding to the at least one second device.
[0040] In some possible implementation manners, the updating module is specifically configured to:
[0041] send a first identifier to the at least one second device, and the training data of the at least one second device after being updated comprises data obtained by the at least one second device according to the first identifier.
[0042] In some possible implementation manners, the first device records a second identifier, and the second identifier is specifically an identifier of data held by the at least one second device.
[0043] The updating module is specifically configured to:
[0044] update the training data of the at least one second device in an incremental updating manner according to the second identifier and feedback information of the at least one second device.
[0045] In a fourth aspect, the present application provides a device for sharing data in a federated learning system. The federated learning system comprises a first device and at least one second device, and the device comprises:
[0046] a generating module configured to generate feedback information of the at least one second device;
[0047] a communication module configured to send the feedback information to the first device, and the feedback information is used by the first device to update training data of the at least one second device.
[0048] In some possible implementation manners, the communication module is further configured to:
[0049] receive target data sent by the first device, and the target data is data in a shared data set of the first device that matches the feedback information of the at least one second device.
[0050] In some possible implementation manners, the communication module is further configured to:
[0051] receive an identifier of target data sent by the first device, the target data being data in the shared data set of the first device that matches the feedback information of the at least one second device;
[0052] obtain the target data according to the identifier of the target data.
[0053] In some possible implementation manners, the first device records an identifier of data held by the at least one second device;
[0054] The target data is data in the shared data set of the first device that matches the feedback information of the at least one second device and is not held by the at least one second device.
[0055] In a fifth aspect, the present application provides a device, which includes a processor and a memory. The processor and the memory are in communication with each other. The processor is configured to execute instructions stored in the memory, so that the device performs the method for sharing data in a federated learning system according to any implementation manner of the first aspect or the second aspect.
[0056] In a sixth aspect, the present application provides a computer-readable storage medium, which stores instructions. The instructions instruct a device to perform the method for sharing data in a federated learning system according to any implementation manner of the first aspect or the second aspect.
[0057] In a seventh aspect, the present application provides a computer program product including instructions, which, when executed on a device, cause the device to perform the method for sharing data in a federated learning system according to any implementation manner of the first aspect or the second aspect.
[0058] On the basis of the implementation manners of the aspects described above, the present application can be further combined to provide more implementation manners. BRIEF DESCRIPTION OF DRAWINGS
[0059] In order to more clearly illustrate the technical method of the embodiments of the present application, the drawings required to be used in the embodiments will be briefly introduced as follows.
[0060] Figure 1 A structural schematic diagram of a federated learning system provided by the embodiments of the present application;
[0061] Figure 2 An application scenario diagram of a method for sharing data in a federated learning system provided by the embodiments of the present application;
[0062] Figure 3An application scenario diagram of a method for sharing data in a federated learning system provided by an embodiment of the present application is shown in FIG. 1.
[0063] Figure 4 An interaction flow diagram of a method for sharing data in a federated learning system provided by an embodiment of the present application is shown in FIG. 2.
[0064] Figure 5 An interaction flow diagram of a method for sharing data in a federated learning system provided by an embodiment of the present application is shown in FIG. 3.
[0065] Figure 6 An interaction flow diagram of a method for sharing data in a federated learning system provided by an embodiment of the present application is shown in FIG. 4.
[0066] Figure 7 A structural schematic diagram of a method for sharing data in a federated learning system provided by an embodiment of the present application is shown in FIG. 5.
[0067] Figure 8 A structural schematic diagram of a method for sharing data in a federated learning system provided by an embodiment of the present application is shown in FIG. 6.
[0068] Figure 9 A structural schematic diagram of a device provided by an embodiment of the present application is shown in FIG. 7.
[0069] Figure 10 A structural schematic diagram of a device provided by an embodiment of the present application is shown in FIG. 8. DETAILED DESCRIPTION
[0070] The terms "first" and "second" in the embodiments of the present application are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more of the features.
[0071] First, some technical terms involved in the embodiments of the present application are introduced.
[0072] Machine learning is a technology that simulates or implements human learning behavior through a computer to acquire new knowledge or skills, or reorganize existing knowledge structure. Specifically, machine learning refers to a process of optimizing a model through sample data, so that the model has higher prediction ability. The process of optimizing a neural network model with an artificial neural network architecture through sample data is called deep learning. Due to the great progress of machine learning in speech recognition, pattern recognition and other tasks, deep learning has gradually become a popular research direction in the field of machine learning.
[0073] Whether it is traditional machine learning or deep learning, the number and quality of sample data are important factors affecting learning effect. In order to improve the diversity of sample data, thereby improving the quality of sample data, and increasing the number of sample data, a feasible solution is that different data owners share their own data to form a larger and high-quality data set. However, the data owners sharing their own data will also cause privacy security problems. In order to solve the above problems, the industry proposes a federated learning (FL) solution.
[0074] Federated learning is a machine learning among multiple participants or multiple computing nodes under the premise of ensuring information security, privacy security and legal compliance during data exchange. That is, federated learning is essentially machine learning involving multiple participants. Specifically, multiple data owners have relevant data of their own users. Considering privacy security, these data cannot be exchanged and belong to private data of the data owners. When the multiple data owners want to jointly train a machine learning model, federated learning system can be used to achieve this.
[0075] As shown in Figure 1 , the federated learning system includes a first device 102 and at least one second device 104. Figure 1 Taking an example of including multiple second devices 104. The second device 104 includes a private data set, which can be used by the second device 104 to train a model, and then report the model gradient to the first device 102. The first device 102 aggregates the model gradient reported by the at least one second device 104 to obtain a new model.
[0076] The data distribution of the private data set included in different second devices 104 is often different. Existing machine learning tasks generally assume that the data follows the assumption of independent and identical distribution. However, in federated learning, the private data set included in different second devices 104 is extremely likely to not meet this assumption. In order to solve the problem that the data distribution difference in federated learning affects the federated learning effect, the industry proposes some solutions to reduce the data distribution difference by sharing data.
[0077] Specifically, the first device 102 provides a shared data set. The shared data set can be a publicly available data set in the network, such as ImageNet, VGG face, MS MARCO, etc. It can also be a purchased data set, or a data set obtained through other means and shared with the second device 104.
[0078] The first device 102 can randomly collect data from the shared data set according to a preset ratio, for example, 5%, and distribute the data to at least one second device 104. In an example, the first device 102 can distribute 5% of data to each second device 104 participating in federated learning. For each second device 104 participating in federated learning, the 5% of data can be considered to have the same data distribution because the 5% of data is sampled from the same shared data set. The difference in data distribution of the training data (5% of shared data + private data set) of each second device 104 is obviously smaller than the difference in data distribution of different private data sets. Based on the shared data and the private data set, federated learning can achieve better learning effect, for example, can improve the accuracy of the model to a certain extent.
[0079] However, the shared data in different second devices 104 is randomly sampled from the global shared data set, and the first device 102 does not distribute the shared data in a differentiated manner according to the differences of the second devices 104, such as the differences in computing power (i.e., computing power) and storage capacity. On the one hand, this leads to an increase in the training time difference of different second devices 104, reducing the model training efficiency, and on the other hand, the models on different second devices 104 are not trained with adaptive data, resulting in that the model accuracy is still difficult to meet the business requirements.
[0080] Therefore, the embodiments of the present application provide a method for sharing data in a federated learning system. Specifically, the first device 102 obtains feedback information of at least one second device 104 participating in federated learning, and then the first device 102 updates the training data of the at least one second device 104 according to the feedback information of the at least one second device 104.
[0081] Among them, at least part of the data in the updated training data is shared data from the shared data set of the first device, and these shared data have the same data distribution. Therefore, the distribution difference of the training data of the at least one second device is reduced, and the federated learning effect is improved. Moreover, the method takes into account the differences of the second devices and distributes the shared data in a differentiated manner, so that the second devices can perform targeted training according to the updated training data, improving the model prediction accuracy and model training efficiency.
[0082] The above method can be applied to a federated learning system as shown in Figure 1 Figure 2 As shown, a federated learning system can be deployed in a cloud environment, specifically as multiple computing devices (e.g., a central server) within that environment. Alternatively, it can be deployed in an edge environment, specifically as multiple computing devices (edge computing devices) located in that environment. These edge computing devices can be servers, computing boxes, etc. A cloud environment refers to a central computing device cluster owned by a cloud service provider, used to provide computing, storage, and communication resources; an edge environment refers to an edge computing device cluster geographically close to the end devices (i.e., edge-side devices), used to provide computing, storage, and communication resources.
[0083] In some implementations, the federated learning system can also be deployed on end devices. Specifically, the first device 102 and the second device 104 in the federated learning system can be deployed on different end devices. End devices include, but are not limited to, user terminals such as desktop computers, laptops, and smartphones.
[0084] like Figure 2 As shown, the federated learning system comprises multiple parts (e.g., a first device 102 and at least one second device 104), and therefore, the various parts of the federated learning system can be deployed in a distributed manner in different environments. For example, a portion of the federated learning system can be deployed in three environments: a cloud environment, an edge environment, and an end device, or any two of these environments. In some implementations, the first device 102 can be a central server in a cloud environment, and the at least one second device 104 can be at least one edge device in an edge environment.
[0085] To make the technical solution of this application clearer, the method for sharing data in the federated learning system provided in this application will be described in detail below with reference to an interactive embodiment.
[0086] See Figure 4 The flowchart shown illustrates a method for sharing data in a federated learning system, which includes:
[0087] S402: At least one second device 104 sends feedback information to the first device 102.
[0088] Feedback information refers to information fed back by the second device 104 that can characterize the status of the second device 104.
[0089] In some implementations, the status of the second device 104 may refer to its hardware configuration, such as the configuration of its processor, memory, network interface card, etc. Based on this, the feedback information can be the configuration information of the second device 104. The configuration information may include one or more of the following: computing power, storage capacity, communication status, etc. Furthermore, the configuration information may also include an idle state, which indicates whether the aforementioned hardware resources are idle or occupied.
[0090] In some implementations, the status of the second device 104 can be a status of a model trained by the second device 104. Based on this, the feedback information can be attribute information of the model trained by the second device 104. The attribute information of the model can include model construction parameters, model precision, and / or model performance. The model construction parameters can be parameters used to construct the model, for example, can be model gradients, model weights, and the like. The model precision can include any one or more of accuracy, recall rate, and precision. The model performance can include model training time and the like.
[0091] When at least one second device 104 in the federated learning system participates in federated learning, the second device 104 reports feedback information to the first device 102. It should be noted that the second device 104 reporting feedback information to the first device 102 is only one specific implementation of the first device 102 obtaining feedback information of the second device 104. In other possible implementations of the embodiments of the present application, the first device 102 can obtain feedback information through other manners. For example, the second device 104 can also share feedback information in the blockchain network, and the first device 102 obtains the above feedback information from the blockchain network.
[0092] S404: The first device 102 obtains target data of at least one second device 104 according to the feedback information of the at least one second device 104.
[0093] The target data of the at least one second device 104 is data in the shared data set that matches the feedback information of the at least one second device. The feedback information of different second devices 104 can be different, and therefore, the data obtained by matching the feedback information can also be different, that is, the target data of different second devices 104 can be different.
[0094] For the second device 104 participating in federated learning, the first device 102 can filter data from the shared data set according to the feedback information thereof to obtain target data of the second device 104. Considering that the second device 104 can be in a poor communication state, insufficient storage capacity, insufficient computing power, or a non-idle state, or the model trained by the second device 104 already has high precision and good performance, the first device 102 can also not filter data. That is, the first device 102 can determine whether to filter target data according to the feedback information, so as to determine whether to update the training data of the second device 104 according to the target data. When the first device 102 decides to update the training data of the second device 104, the filtering operation is performed to obtain the target data.
[0095] In some implementations, the first device 102 can configure a preset condition. When the feedback information of the at least one second device 104 satisfies the preset condition, the first device 102 decides to update the training data of the second device 104 according to the target data.
[0096] For ease of understanding, a specific example is described below. In some examples, the preset condition can be at least one of the following conditions: the device is in an idle state, the transmission delay does not exceed a preset time length (indicating that the communication condition is good), the computing capability is greater than a computing capability threshold, and the storage capacity is greater than a storage capacity threshold. Based on this, when the feedback information of the at least one second device 104 satisfies the preset condition, the first device 102 can decide to update the training data of the second device 104.
[0097] Considering the differences in the idle state, communication condition, computing capability, and / or storage capacity of different second devices, the second device 104 can determine the number of data to be updated according to the feedback information after deciding to update the training data of the second device 104. Based on this, the first device 102 can obtain the target data of the second device 104 according to the number of data to be updated.
[0098] S406: The first device 102 sends the corresponding target data to the at least one second device 104.
[0099] Specifically, the first device 102 sends the corresponding target data to the at least one second device 104, thereby updating the training data of the second device 104. After the update, the training data of the second device 104 includes the target data and the private data set.
[0100] The above S404 to S406 are only one implementation of the first device 102 updating the training data of the at least one second device 104 according to the feedback information of the at least one second device 104. The first device 102 can also share data in other ways to update the training data of the at least one second device 104.
[0101] In some implementations, the first device 102 can also send an identifier of the target data to the at least one second device, and the at least one second device 104 obtains the target data according to the identifier, for example, from the second device 104 locally or from a third-party platform, to update the training data of the at least one second device 104. Since only the identifier of the target data needs to be sent, the target data does not need to be sent, which greatly reduces the amount of data that the first device 102 needs to transmit, reduces the network resource occupation of the first device 102, reduces the communication pressure of the first device 102, improves the transmission efficiency.
[0102] Further, in order to reduce the communication pressure of the second device 104, the second device 104 can pre-store part of the sample data or all of the sample data in the shared data set. Then, the first device 102 can send the identification of the target data to the at least one second device 104, and the at least one second device 104 obtains the target data from the local according to the identification, so as to update the training data of the at least one second device 104.
[0103] It should be noted that when performing federated learning, the second device 104 often needs to perform multiple rounds of iterative training. Therefore, the first device 102 can dynamically update the training data of the at least one second device 104 according to the feedback information. Correspondingly, the second device 104 performs iterative training according to the data updated in each round.
[0104] Considering that the training data of the at least one second device 104 updated by the first device 102 in the current round may have been updated before the round, the first device 102 can also record the identification of the data held by the at least one second device 104, such as the identification of the sample data from the shared data set held by the at least one second device 104. In this way, the first device 102 can update the training data of the at least one second device 104 in an incremental update manner according to the identification of the data held by the at least one second device 104, thereby avoiding repeatedly issuing the target data or the identification of the target data, and further improving the transmission efficiency.
[0105] Based on the above description, the embodiment of the present application provides a method for sharing data in a federated learning system. Specifically, the first device 102 obtains the feedback information of the at least one second device 104 participating in federated learning, and then the first device 102 updates the training data of the at least one second device 104 according to the feedback information of the at least one second device 104. The first device 102 considers the differences of the second devices 104 and issues the shared data in a differentiated manner, so that the second devices 104 can perform targeted training according to the target data, thereby improving the model accuracy and training efficiency.
[0106] In some implementations, in order to improve the model accuracy and reduce the probability of prediction error, the second device 104 can also pay more attention to the sample data that is predicted to be wrong in the current training process in the subsequent training process. That is, the second device 104 can also retrain according to the sample data that is predicted to be wrong, so that the training process can be more targeted, and the model accuracy and training efficiency can be improved.
[0107] The sample data with prediction errors is data in the shared data set. The first device 102 can create a model copy for the second device 104 participating in federated learning, the first device 102 makes predictions on the sample data in the shared data set through the model copy, obtains sample data with prediction errors, and then issues the sample data with prediction errors to the corresponding second device 104.
[0108] For ease of understanding, a specific embodiment will be described in detail below.
[0109] Referring to Figure 5 The flowchart of the method for sharing data in the federated learning system is shown. The method comprises the following steps:
[0110] S502: The first device 102 and the at least one second device 104 build an environment.
[0111] When performing federated learning, it is usually necessary to build a training environment in advance. The training environment refers to a platform for training models and testing algorithms. In a specific implementation, the first device 102 and the at least one second device 104 can build an environment through an open-source toolkit. For example, the first device 102 and the at least one second device 104 can build a federated learning environment through an open AI (open artificial intelligence) toolkit horovod, a distributed environment building tool based on tensor flow, etc.
[0112] S504: The first device 102 pre-trains a model according to a shared data set to obtain an initial model.
[0113] Specifically, the first device 102 can construct a model architecture, then initialize parameters of the model architecture, and then the first device 102 can input sample data in the shared data set into the model, optimize model parameters according to an output of the model, thereby realizing pre-training of the model. The pre-trained model can be used as an initial model, which is provided to the at least one second device 104, so that the second device 104 re-trains the initial model by using data held by the second device 104.
[0114] S506: The first device 102 receives configuration information sent by the at least one second device 104.
[0115] The configuration information of the second device 104 comprises one or more of an idle state, a communication state, a computing capability, and a storage capacity.
[0116] S508: The first device 102 sends the initial model and initial data to the at least one second device 104.
[0117] Specifically, the first device 102 can randomly sample a number of data from the shared data set as initial data, and downlink the initial model and the initial data to the second device 104 for model training. Considering that the configuration information of different devices 104 such as idle state, communication state, computing capability, and storage capacity can be different, the first device 102 can sample data of a number matching the above-mentioned configuration information as initial data.
[0118] It should be noted that the above S502 to S508 are the preprocessing process of federated learning, and the method for sharing data in the federated learning system can also not perform the above steps. For example, the first device 102 and the second device 104 can directly obtain the same pre-trained model as the initial model.
[0119] S510: The first device 102 selects all or part of the second device 104 and starts model training.
[0120] Specifically, the first device 102 can select all or part of the second device 104 according to the configuration information of the second device 104 and start model training. For example, the first device 102 can select the second device 104 in the idle state, good communication condition, strong computing capability, and large storage capacity to start model training.
[0121] S512: The first device 102 and the second device 104 respectively perform model training.
[0122] The first device 102 and the second device 104 respectively train the initial model based on the data they hold. Specifically, the first device 102 trains the initial model on the first device 102 based on the shared data set, and the second device 104 trains the model based on the private data set and the target data downlinked by the first device 102.
[0123] S514: At least one second device 104 uploads attribute information of the model trained by at least one second device 104 to the first device 102.
[0124] The attribute information of the model can include any one or more of model construction parameters, model accuracy, and model performance. The model construction parameters can be parameters used to construct the model, such as model gradient, model weight, etc. The model accuracy can include any one or more of accuracy, recall rate, and precision. The model performance can include model training time, etc.
[0125] S516: The first device 102 determines whether to update the training data of the second device 104 according to the configuration information or the model performance and the model accuracy. If yes, S518 is performed, and if no, S524 is performed.
[0126] Specifically, the first device 102 determines whether to update the training data of the second device 104 according to configuration information of the second device 104 participating in federated learning, performance and / or accuracy of the second device 104 training a model. For example, when the configuration information indicates that the second device 104 is in an idle state, has good communication status, has high computing power, has large storage capacity, or the second device 104 takes a long time to train a model and has low accuracy, the first device 102 can determine to update the training data of the second device 104.
[0127] S518: The first device 102 determines a model copy corresponding to the model trained by the second device 104 according to the model construction parameters uploaded by the second device 104.
[0128] Specifically, the first device 102 can create a corresponding model copy for the model trained by each second device 104 according to the initial model, and when receiving the model construction parameters such as model gradient or model weight uploaded by the second device 104, the first device 102 updates the model copy according to the model construction parameters, thereby obtaining the model copy corresponding to the model trained by the second device 104.
[0129] S520: The first device 102 predicts sample data in the shared data set through the model copy to obtain sample data with prediction errors.
[0130] Specifically, the first device 102 can randomly predict sample data in the shared data set through the model copy of at least one second device 104 to obtain sample data with prediction errors of the model copy of at least one second device 104. In some implementations, the first device 102 can also randomly use part of the data in the shared data set as a verification set, predict sample data in the verification set through the model copy of at least one second device 104, and filter out sample data with prediction errors.
[0131] It should be noted that the above S516 to S520 are only one implementation of the first device 102 obtaining the target data of the second device 104 according to the feedback information, and in other possible implementations of the embodiments of the present application, the target data of the second device 104 can also be obtained through other ways. For example, the first device 102 can determine the number of target data according to one or more of the feedback information such as computing power, communication status, storage capacity, idle state, model performance and model accuracy, and then randomly select data from the shared data set according to the number to obtain the target data of the second device 104.
[0132] S522: The first device 102 sends sample data with prediction errors corresponding to the second device 104 to the second device 104.
[0133] The first device 102 sends the sample data that is predicted to be wrong to the at least one second device 104 corresponding to the second device 104, to update the training data of the second device 104. The training data of the second device 104 includes the sample data that is predicted to be wrong and the private data set after the update. That is, the target data includes the sample data that is predicted to be wrong, and the first device 102 updates the training data of the second device 104 according to the target data.
[0134] S524: The first device 102 aggregates the model construction parameters uploaded by the at least one second device 104 to update the model.
[0135] The first device 102 can average (for example, weighted average) the model construction parameters (for example, model gradient) uploaded by the at least one second device 104, to realize aggregation of the model construction parameters. The first device 102 can update the model according to the trained model and the aggregated model construction parameters.
[0136] It should be noted that the execution order of S524 and S516-S522 can be set according to actual needs, for example, S524 and S516-S522 can be executed simultaneously, S524 can be executed first, and then S516-S522 can be executed, or S516-S522 can be executed in sequence.
[0137] S526: The first device 102 sends the updated model to the at least one second device 104, and then re-executes S510 based on the updated model and the data.
[0138] The first device 102 also sends the updated model to the at least one second device 104, so that the models on the first device 102 and the at least one second device 104 are all updated models. The first device 102 can re-execute S510 based on the updated model, to perform the next round of iterative training.
[0139] Based on the above description, the embodiment of the present application provides a method for sharing data in a federated learning system. In the method, the first device 102 can select the sample data that is predicted to be wrong by the model on the second device 104 according to the training effect of the second device 104, to perform model training, thereby improving the accuracy of the model trained by the second device 104. Moreover, by selecting the sample data that is predicted to be wrong and transmitting the sample data to the second device 104, unnecessary data transmission can be reduced, transmission efficiency can be improved, and communication requirements can be reduced.
[0140] Figure 5The embodiments shown are mainly to send target data to the second device 104 to update the training data of the second device 104. In some implementations, the first device 102 can also send the identification of the target data to the second device 104 to update the training data of the second device 104. Details will be described below in conjunction with specific embodiments.
[0141] Referring to Figure 6 The flowchart of the method for sharing data in the federated learning system shown comprises:
[0142] S602: The first device 102 pre-trains the model according to the shared data set to obtain an initial model.
[0143] S604: The first device 102 receives the configuration information sent by the at least one second device 104.
[0144] The specific implementation of S602 and S604 can be referred to Figure 5 The related content of S504 and S506 in the embodiments described above will not be repeated here.
[0145] S606: The first device 102 sends the initial model and part or all of the sample data in the shared data set to the at least one second device 104.
[0146] Specifically, the first device 102 sends part or all of the sample data in the shared data set to the at least one second device 104 in advance according to the configuration information of the at least one second device 104. When the configuration information of the second device 104 indicates that the storage capacity is large enough, the first device 102 can send all the sample data in the shared data set to the second device 104. When the configuration information of the second device 104 indicates that the storage capacity is small, the first device 102 can send as much sample data as possible to the second device 104.
[0147] S607: The first device 102 records the identification of the sample data sent to the at least one second device 104, and the at least one second device 104 records the identification of the shared data held by the second device 104.
[0148] S608: The first device 102 specifies the identification of the shared sample data for training according to the identification of the sample data held by the at least one second device 104, and sends the identification of the shared sample data for training to the corresponding second device 104, and the second device 104 records the identification of the shared sample data for training.
[0149] S610: The first device 102 selects all or part of the second devices 104 and starts model training.
[0150] S612: The first device 102 and the second device 104 respectively perform model training.
[0151] The second device 104 specifically obtains the shared sample data according to the identification of the shared sample data participating in the training, and then performs model training according to the shared sample data and the private data set.
[0152] S614: At least one second device 104 uploads the attribute information of the model to the first device 102.
[0153] S616: The first device 102 determines whether to update the training data of the second device 104 according to the configuration information or the model performance and model accuracy. If yes, S618 is performed, and if no, S624 is performed.
[0154] The specific implementation of S614 and S616 can be referred to the related content of S514 and S516 in the embodiment shown in Figure 5 The specific implementation of S614 and S616 can be referred to the related content of S514 and S516 in the embodiment shown in
[0155] S618: The first device 102 determines the target data of the second device 104, which is the data in the shared data set.
[0156] Specifically, the first device 102 can determine the sample data that the model on the second device 104 is prone to predict errors as the target data from the shared data set. In some implementations, the first device 102 can also randomly select a corresponding number of data from the shared data set as the target data according to one or more of the idle state, the communication state, the computing capability, the storage capacity, the model accuracy, and the model performance of the second device 104.
[0157] S620: The first device 102 updates the shared sample data downloaded to the second device 104 in an incremental update manner according to the recorded identification of the shared sample data previously downloaded to the second device 104 and the target data, and the second device 104 records the identification of the updated shared sample data.
[0158] Specifically, when the target data of the second device 104 determined by the first device 102 does not exist in the second device 104, the first device 102 downloads the non-existing target data to the corresponding second device 104, thereby realizing incremental update of the shared sample data downloaded to the second device 104. Correspondingly, the second device 104 records the identification of the updated shared sample data.
[0159] S622: The first device 102 updates the identification of the shared sample data participating in the training of the second device 104 in an incremental update manner according to the identification of the target data, and the second device 104 records the identification of the updated shared sample data participating in the training.
[0160] Specifically, the first device 102 specifies the identification of the shared sample data of the at least one second device 104 participating in the training, the first device 102 compares the identification of the target data and the identification of the shared sample data of the at least one second device 104 participating in the training, and sends the identification included in the identification of the target data but not included in the identification of the shared sample data participating in the training to the corresponding second device 104, so as to realize the incremental update of the identification of the shared sample data participating in the training. Correspondingly, the second device 104 records the updated identification of the shared sample data participating in the training.
[0161] In some implementations, the method of sharing data in the federated learning system can also not perform the step of distributing part or all of the sample data in the shared data set in S606. For example, when the at least one second device 104 receives the identification of the target data, the at least one second device 104 can also obtain the target data from a third-party platform according to the identification of the target data.
[0162] S624: The first device 102 performs gradient aggregation according to the model gradient uploaded by the at least one second device 104 to update the model.
[0163] S626: The first device 102 sends the updated model to the at least one second device 104, and then re-executes S610 based on the updated model and the data.
[0164] The specific implementation of S624 and S626 can be referred to the related content description of S524 and S526 in the embodiment shown in Figure 5 The specific implementation of S524 and S526 can be referred to the related content description of S524 and S526 in the embodiment shown in
[0165] Based on the above content description, the embodiment of the present application provides a method of sharing data in a federated learning system. The method supports pre-storing as many sample data in the shared data set as possible in the second device 104 according to the storage capacity of the second device 104, and the first device 102 records the identification of the shared sample data held by the at least one second device 104. When the training data needs to be updated, the training data of the second device 104 is updated by an incremental update manner to reduce the communication pressure of the first device 102 and the second device 104.
[0166] The above is described in combination with Figures 1 to 6 The method of sharing data in the federated learning system provided by the embodiment of the present application is described in detail, and the device and the equipment provided by the embodiment of the present application will be introduced in combination with the drawings.
[0167] Referring to Figure 7 The structure schematic diagram of the device 700 for sharing data in the federated learning system is shown, and the device 700 comprises:
[0168] The communication module 702 is configured to obtain feedback information of at least one second device.
[0169] The updating module 704 is configured to update training data of the at least one second device according to the feedback information of the at least one second device.
[0170] In some possible implementation manners, the updating module 704 is specifically configured to:
[0171] update the training data of the at least one second device according to target data of the at least one second device, the target data of the at least one second device being data in the shared data set of the first device that matches the feedback information of the at least one second device.
[0172] In some possible implementation manners, the updating module 704 is specifically configured to:
[0173] update the training data of the at least one second device according to the feedback information of the at least one second device when the feedback information of the at least one second device satisfies a preset condition.
[0174] In some possible implementation manners, the feedback information includes configuration information of the second device or attribute information of a model trained by the second device.
[0175] In some possible implementation manners, the attribute information of the model includes a model construction parameter.
[0176] The updating module 704 is specifically configured to:
[0177] construct a model copy corresponding to the model trained by the at least one second device according to the model construction parameter;
[0178] predict sample data in the shared data set by using the model copy to obtain sample data with prediction errors;
[0179] update the training data of the at least one second device according to the sample data with prediction errors.
[0180] In some possible implementation manners, the configuration information includes one or more of computing power, a communication state, a storage capacity, and an idle state, and the attribute information of the model includes one or more of model performance and model accuracy.
[0181] The updating module 704 is specifically configured to:
[0182] determine a quantity of training data corresponding to the at least one second device according to one or more of the computing power, the communication state, the storage capacity, the idle state, the model performance, and the model accuracy;
[0183] update the training data of the at least one second device according to the quantity of training data corresponding to the at least one second device.
[0184] In some possible implementation manners, the updating module 704 is specifically configured to:
[0185] send the first identifier to the at least one second device, and the training data of the at least one second device after the updating comprises data obtained by the at least one second device according to the first identifier.
[0186] In some possible implementation manners, the first device records a second identifier, and the second identifier is specifically an identifier of data held by the at least one second device.
[0187] The updating module 704 is specifically configured to:
[0188] update the training data of the at least one second device in an incremental updating manner according to the second identifier and the feedback information of the at least one second device.
[0189] The apparatus 700 for sharing data in a federated learning system according to the embodiments of the present application can correspond to performing the methods described in the embodiments of the present application, and the above and other operations and / or functions of each module / unit of the apparatus 700 for sharing data in a federated learning system are respectively implemented to realize the corresponding flow of each method in the embodiments of the present application. For brevity, the details are not described here again. Figures 4 to 6 The above-described and other operations and / or functions of each module / unit of the apparatus 700 for sharing data in a federated learning system are respectively implemented to realize the corresponding flow of each method in the embodiments of the present application. For brevity, the details are not described here again.
[0190] The embodiments of the present application further provide another apparatus for sharing data in a federated learning system. Referring to Figure 8 The apparatus 800 for sharing data in a federated learning system shown in the structural schematic diagram comprises:
[0191] The generating module 802 is configured to generate feedback information of the at least one second device.
[0192] The communication module 804 is configured to send the feedback information to the first device, and the feedback information is used by the first device to update the training data of the at least one second device.
[0193] In some possible implementation manners, the communication module 804 is further configured to:
[0194] receive target data sent by the first device, and the target data is data in the shared data set of the first device that matches the feedback information of the at least one second device.
[0195] In some possible implementation manners, the communication module 804 is further configured to:
[0196] receive an identifier of target data sent by the first device, and the target data is data in the shared data set of the first device that matches the feedback information of the at least one second device.
[0197] obtain the target data according to the identifier of the target data.
[0198] In some possible implementations, the first device records an identifier of at least one piece of data held by the second device;
[0199] The target data is the data that is centrally matched with the feedback information of at least one second device from the shared dataset of the first device, and that is not held by at least one second device.
[0200] The data sharing apparatus 800 in the federated learning system according to the embodiments of this application can correspond to the execution of the methods described in the embodiments of this application, and the above and other operations and / or functions of each module / unit of the data sharing apparatus 800 in the federated learning system are respectively for implementing Figures 4 to 6 For the sake of brevity, the corresponding processes of each method in the illustrated embodiments will not be described in detail here.
[0201] This application also provides a device. This device can be an edge device such as a laptop or desktop computer, or a computer cluster in a cloud or edge environment. Specifically, this device is used to implement, for example... Figure 7 The illustrated embodiment shows the function of the data sharing device 700 in the federated learning system.
[0202] Figure 9 A structural schematic diagram of a device 900 is provided, as follows: Figure 9 As shown, device 900 includes bus 901, processor 902, communication interface 903, and memory 904. Processor 902, memory 904, and communication interface 903 communicate with each other via bus 901.
[0203] The 901 bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 9 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0204] The processor 902 may be a central processing unit (CPU). The memory 904 may include volatile memory, such as random access memory (RAM). The memory 904 may also include non-volatile memory, such as read-only memory (ROM), flash memory, HDD, or SSD.
[0205] The communication interface 903 is used for communication with external devices. For example, it can be used to obtain feedback information indicating a second device 104, send target data to at least one second device 104, or send an identifier of the target data to at least one second device 104.
[0206] The memory 904 stores executable code, which the processor 902 executes to perform a method for sharing data in the previous federated learning system.
[0207] Specifically, in achieving Figure 7 In the case of the illustrated embodiment, and Figure 7 In the case where the modules of the data-sharing device 700 in the federated learning system described in the embodiment are implemented in software, the execution... Figure 7 The software or program code required for the update module 704 is stored in the memory 904. The communication module function is implemented through the communication interface 903. The communication interface 903 receives feedback information from at least one second device 104 and transmits it to the processor 902 via the bus 901. The processor 902 executes the program code corresponding to each module stored in the memory 904, such as the program code corresponding to the update module 704, to perform the step of updating the training data of at least one second device according to the feedback information of at least one second device.
[0208] In some implementations, processor 902 can execute the program code corresponding to update module 704 to perform the following method steps:
[0209] The training data of at least one second device is updated based on the target data of at least one second device.
[0210] In some implementations, processor 902 can execute the program code corresponding to update module 704 to perform the following method steps:
[0211] Construct at least one copy of the model corresponding to the model trained on the second device based on the model construction parameters;
[0212] The first device uses a model copy to predict sample data in a shared dataset, and obtains sample data that is predicted incorrectly.
[0213] The first device updates the training data of at least one second device based on the sample data of the prediction error.
[0214] In some implementations, processor 902 can execute the program code corresponding to update module 704 to perform the following method steps:
[0215] The quantity of the training data corresponding to the at least one second device is determined according to one or more of the computing power, the communication state, the storage capacity, the idle state, the model performance, and the model accuracy;
[0216] The training data of the at least one second device is updated according to the quantity of the training data corresponding to the at least one second device.
[0217] The embodiments of the present application also provide a device. The device can be a notebook computer, a desktop computer, or the like end-side device, or a computer cluster in a cloud environment or an edge environment. The device is specifically configured to implement the functions of the federated learning system as described in the embodiments. Figure 8 The device 800 for sharing data in the federated learning system as shown in the embodiments.
[0218] Figure 10 A structural schematic diagram of a device 1000 is provided, as shown in Figure 9 The device 1000 includes a bus 1001, a processor 1002, a communication interface 1003, and a memory 1004. The processor 1002, the memory 1004, and the communication interface 1003 communicate through the bus 1001.
[0219] Specifically, in the case of implementing the embodiments as shown in Figure 8 , and Figure 8 In the case of implementing the modules of the device 800 for sharing data in the federated learning system as described in the embodiments by software, the software or program codes required for the function of the generating module 802 in Figure 8 are stored in the memory 1004. The function of the communication module is implemented through the communication interface 1003.
[0220] The processor 1002 executes the program codes corresponding to the modules stored in the memory 1004, such as the program codes corresponding to the generating module 804, to perform the step of generating the feedback information of the at least one second device 104, and then the communication interface 1003 sends the feedback information to the first device 102, so that the first device 102 updates the training data of the second device 104 according to the feedback information of the second device 104.
[0221] Those skilled in the art can clearly understand that the application can be implemented by means of software plus necessary universal hardware, and of course can also be implemented by means of dedicated hardware including special integrated circuit, special CPU, special memory, special component, etc. Generally, any function completed by computer program can be easily implemented by corresponding hardware, and the specific hardware structure for implementing the same function can also be various, such as analog circuit, digital circuit or special circuit, etc. However, for the application, software program implementation is a better embodiment. Based on such understanding, the technical solution of the application or the part of the application which makes contribution to the prior art can be embodied in the form of software product, which is stored in readable storage medium, such as computer floppy disk, U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., and includes a plurality of instructions for making a computer device (which can be personal computer, training device or network device, etc.) execute the method described in various embodiments of the application.
[0222] In the above embodiments, the implementation can be achieved by software, hardware, firmware or any combination thereof, entirely or partially. When implemented by software, the implementation can be achieved in the form of a computer program product, entirely or partially.
[0223] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the flow or function described in the embodiments of the application is generated entirely or partially. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another, for example, the computer instructions can be transmitted from one website, computer, training device or data center to another website, computer, training device or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be stored by the computer or a data storage device such as training device, data center, etc. integrated with one or more available media sets. The available medium can be magnetic medium (such as floppy disk, hard disk, magnetic tape), optical medium (such as DVD) or semiconductor medium (such as solid state disk (SSD)) etc.
Claims
1. A method for sharing data in a federated learning system, the method comprising: The federated learning system comprises a first device and at least one second device, and the method comprises: The first device acquires feedback information of the at least one second device, the feedback information being information representing a condition of the at least one second device; The first device updates training data of the at least one second device according to the feedback information of the at least one second device; The first device updates training data of the at least one second device according to the feedback information of the at least one second device, comprising: The first device updates the training data of the at least one second device according to target data of the at least one second device, the target data of the at least one second device being data in the shared data set of the first device that matches the feedback information of the at least one second device, the training data of the at least one second device comprising the target data and a private data set of the at least one second device after being updated, the training data of the at least one second device being used to train a model on the at least one second device.
2. The method of claim 1, wherein, The first device updates the training data of the at least one second device according to the feedback information of the at least one second device, comprising: When the feedback information of the at least one second device satisfies a preset condition, the first device updates the training data of the at least one second device according to the feedback information of the at least one second device.
3. The method of claim 1, wherein, The feedback information comprises configuration information of the second device or attribute information of a model trained by the second device.
4. The method of claim 3, wherein, The attribute information of the model comprises a model construction parameter; The first device updates the training data of the at least one second device according to the feedback information of the at least one second device, comprising: The first device constructs a model copy corresponding to a model trained by the at least one second device according to the model construction parameter; The first device predicts sample data in a shared data set through the model copy and obtains sample data with prediction errors; The first device updates the training data of the at least one second device according to the sample data with prediction errors.
5. The method of claim 3, wherein, The configuration information comprises one or more of computing power, communication state, storage capacity, and idle state, and the attribute information of the model comprises one or more of model performance and model accuracy; The first device updates the training data of the at least one second device according to the feedback information of the at least one second device, comprising: The first device determines a quantity of training data corresponding to the at least one second device according to one or more of the computing power, the communication state, the storage capacity, the idle state, the model performance, and the model accuracy; The first device updates the training data of the at least one second device according to the quantity of training data corresponding to the at least one second device.
6. The method of any one of claims 1 to 5, wherein The first device updates the training data of the at least one second device according to the feedback information of the at least one second device, comprising: The first device sends a first identifier to the at least one second device, and training data of the at least one second device comprises data obtained by the at least one second device according to the first identifier after being updated.
7. The method according to any one of claims 1 to 5, characterized in that, The first device records a second identifier, and the second identifier comprises an identifier of data held by the at least one second device. The first device updates the training data of the at least one second device according to feedback information of the at least one second device, and the updating comprises: The first device updates the training data of the at least one second device by an incremental updating manner according to the second identifier and the feedback information of the at least one second device. 8.A method for sharing data in a federated learning system, the method comprising: The federated learning system comprises a first device and at least one second device, and the method comprises: The at least one second device generates feedback information of the at least one second device, and the feedback information is information representing a condition of the at least one second device. The at least one second device sends the feedback information to the first device, and the feedback information is used by the first device to determine target data of the at least one second device, so that the first device updates the training data of the at least one second device according to the target data of the at least one second device, the target data of the at least one second device is data in a shared data set of the first device that matches the feedback information of the at least one second device, the training data of the at least one second device comprises the target data and a private data set of the at least one second device after being updated, and the training data of the at least one second device is used to train a model on the at least one second device.
9. The method of claim 8, wherein, The method further comprises: The at least one second device receives target data sent by the first device, and the target data is data in a shared data set of the first device that matches the feedback information of the at least one second device.
10. The method of claim 8, wherein, The method further comprises: The at least one second device receives an identifier of target data sent by the first device, and the target data is data in a shared data set of the first device that matches the feedback information of the at least one second device. The at least one second device obtains the target data according to the identifier of the target data.
11. The method according to claim 9 or 10, characterized in that, The first device records an identifier of data held by the at least one second device. The target data is data in a shared data set of the first device that matches the feedback information of the at least one second device and is not held by the at least one second device.
12. An apparatus for sharing data in a federated learning system, the apparatus comprising: The federated learning system comprises a first device and at least one second device, and the device comprises: A communication module configured to obtain feedback information of the at least one second device, and the feedback information is information representing a condition of the at least one second device. An updating module configured to update training data of the at least one second device according to the feedback information of the at least one second device. The updating module is specifically configured to: updating training data of the at least one second device according to target data of the at least one second device, the target data of the at least one second device being data in the shared data set of the first device that matches the feedback information of the at least one second device, the training data of the at least one second device including the target data and a private data set of the at least one second device after being updated, the training data of the at least one second device being used to train a model on the at least one second device.
13. The apparatus of claim 12, wherein, The updating module is specifically configured to: updating the training data of the at least one second device according to the feedback information of the at least one second device when the feedback information of the at least one second device meets a preset condition.
14. The apparatus of claim 12, wherein, The feedback information includes configuration information of the second device or attribute information of a model trained by the second device.
15. The apparatus of claim 14, wherein, The attribute information of the model includes a model construction parameter. The updating module is specifically configured to: constructing a model copy corresponding to the model trained by the at least one second device according to the model construction parameter; predicting sample data in the shared data set through the model copy to obtain sample data with prediction errors; updating the training data of the at least one second device according to the sample data with prediction errors.
16. The apparatus of claim 14, wherein, The configuration information includes one or more of computing power, communication state, storage capacity, and idle state, and the attribute information of the model includes one or more of model performance and model accuracy. The updating module is specifically configured to: determining a quantity of training data corresponding to the at least one second device according to one or more of the computing power, the communication state, the storage capacity, the idle state, the model performance, and the model accuracy; updating the training data of the at least one second device according to the quantity of training data corresponding to the at least one second device.
17. The apparatus of any one of claims 12 to 16, wherein, The updating module is specifically configured to: sending a first identifier to the at least one second device, the training data of the at least one second device including data obtained by the at least one second device according to the first identifier after being updated.
18. The apparatus of any one of claims 12 to 16, wherein, The first device records a second identifier, and the second identifier includes an identifier of data held by the at least one second device. The updating module is specifically configured to: updating the training data of the at least one second device in an incremental updating manner according to the second identifier and the feedback information of the at least one second device.
19. An apparatus for sharing data in a federated learning system, the apparatus comprising: The federated learning system includes a first device and at least one second device, and the apparatus includes: a generating module configured to generate feedback information of the at least one second device, the feedback information being information representing a condition of the at least one second device; The communication module is configured to send the feedback information to the first device, and the feedback information is used by the first device to determine target data of the at least one second device, so that the first device updates training data of the at least one second device according to the target data of the at least one second device, the target data of the at least one second device is data in a shared data set of the first device that matches the feedback information of the at least one second device, and the training data of the at least one second device includes the target data and a private data set of the at least one second device after being updated, and the training data of the at least one second device is used to train a model on the at least one second device.
20. The apparatus of claim 19, wherein, The communication module is further configured to: receive target data sent by the first device, the target data being data in a shared data set of the first device that matches the feedback information of the at least one second device.
21. The apparatus of claim 19, wherein, The communication module is further configured to: receive an identifier of target data sent by the first device, the target data being data in a shared data set of the first device that matches the feedback information of the at least one second device; obtain the target data according to the identifier of the target data.
22. The apparatus of claim 20 or 21, wherein, The first device records an identifier of data held by the at least one second device; The target data is data in a shared data set of the first device that matches the feedback information of the at least one second device, and the at least one second device does not hold the data.
23. An apparatus, comprising: The device includes a processor and a memory; The processor is configured to execute instructions stored in the memory, so that the device performs the method of any one of claims 1 to 11.
Citation Information
Patent Citations
Federation modeling device and method based on shared data and readable storage medium
CN110443416A