Method, apparatus and electronic device for federated learning and training dataset construction

By training a personalized model for the target user using other users' datasets in a joint learning server, the problem of the inability to effectively learn the distribution of personalized user data in existing technologies is solved, and the model's adaptability and accuracy are improved without the need for target user label data.

CN114841354BActive Publication Date: 2025-12-30新奥新智科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110046497.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-14
Publication Date
2025-12-30
Estimated Expiration
2041-01-14

AI Technical Summary

Technical Problem

Existing classical joint learning paradigms are unable to effectively learn the distribution of personalized user data, leading to a decline in model performance.

Method used

By receiving the target user's personalized data distribution model through a joint learning server, and using other users' datasets for training, a weighted or unweighted training dataset is constructed. The model directly learns from the target user without needing the target user's label data.

Benefits of technology

This enables the direct training of models with personalized data distributions without relying on target user tag data, thereby improving the model's adaptability and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114841354B_ABST
    Figure CN114841354B_ABST
Patent Text Reader

Abstract

The application is suitable for the field of artificial intelligence technology, and provides a method, device and electronic equipment for federated learning and training data set construction, wherein the federated learning method comprises the following steps: receiving a target user feature distribution model established by a target user based on user personalized data distribution; sending the target user feature distribution model to other users; jointly constructing a training data set for training the target user feature distribution model by each other user, and training the target user feature distribution model, wherein the training data set comprises a weighted training set or a non-weighted training set; and returning the target user feature distribution model to the target user after the training is completed. The application realizes that the personalized data distribution of the target user in actual use can be practically obtained through training to obtain a corresponding model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence technology, and in particular relates to a method, apparatus and electronic device for joint learning and training dataset construction. Background Technology

[0002] In classic federated learning models, the federated learning server initializes a global model and distributes it to each user as their initial model. Each user trains a local model based on their own data, then uploads their local model to the federated learning server. The server aggregates the local models and distributes them back to each user as their initial model for training. This process iterates until the model converges, resulting in the global model. The advantage of this approach is that by combining data from each user, the accuracy of the global model is improved without the data leaving the user's local machine. However, this learning paradigm relies on the premise that the data distribution among users is relatively similar, and that the final learned model is based on the global data distribution.

[0003] In real-world applications, we often encounter situations where the data generated by each individual user is related but not entirely identical. In other words, each user possesses unique characteristics and a personalized data distribution, and the distribution of all user data sets cannot represent this personalized distribution. In such cases, classic federated learning paradigms cannot effectively learn the user's personalized model because the global model in classic federated learning is based on a global data distribution, not a personalized user data distribution, thus reducing model performance.

[0004] Therefore, how to solve the problem of model training for personalized user data distribution is a current technical challenge. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a method, apparatus, and electronic device for joint learning and training dataset construction, in order to solve the problem that existing joint learning methods cannot obtain training models that provide personalized user data distribution among target users.

[0006] A first aspect of the present invention provides a joint learning method for user personalized data distribution, executed by a joint learning server, comprising: receiving a target user feature distribution model established by a target user based on user personalized data distribution; sending the target user feature distribution model to other users besides the target user; training the target user feature distribution model by combining a training dataset constructed by each of the other users besides the target user for training the target user feature distribution model, wherein the training dataset includes: a weighted training set or an unweighted training set; and returning the target user feature distribution model to the target user after training is completed.

[0007] A second aspect of the present invention provides a method for constructing a training dataset, executed by a non-target user connected to a federated learning server, comprising: receiving a target user feature distribution model established by the target user based on the user's personalized data distribution from the federated learning server; constructing a training dataset for training the target user feature distribution model based on the target user feature distribution model, the training dataset including a weighted training dataset or an unweighted training dataset; and sending the training dataset to the federated learning server.

[0008] A third aspect of the present invention provides a joint learning apparatus for user personalized data distribution, disposed in a joint learning server, the joint learning apparatus comprising: a target user model receiving module, configured to receive a target user feature distribution model established by a target user based on user personalized data distribution; a target user model forwarding module, configured to send the target user feature distribution model to other users besides the target user; a joint training module, configured to train the target user feature distribution model by jointly constructing a training dataset for training the target user feature distribution model by the other users besides the target user, wherein the training dataset includes: a weighted training set or an unweighted training set; and a target user model returning module, configured to return the target user feature distribution model to the target user after training is completed.

[0009] A fourth aspect of the present invention provides a training dataset construction apparatus, disposed among a non-target user connected to a federated learning server. The training dataset construction apparatus includes: a data receiving module for receiving a target user feature distribution model established by the target user based on user-personalized data distribution from the federated learning server; a training set construction module for constructing a training dataset for training the target user feature distribution model based on the target user feature distribution model, the training dataset including a weighted training set or an unweighted training set; and a data sending module for sending the training dataset to the federated learning server.

[0010] A fifth aspect of the present invention provides an electronic device comprising: a processor; a communication module connected to the processor; and a memory storing a computer program executable on the processor, wherein the processor, when executing the computer program, performs the steps of the method described in the first / second aspect.

[0011] A sixth aspect of the present invention provides a storage medium storing a computer program that, when executed by a processor, implements the steps of the method as described in the first / second aspect.

[0012] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows: The present invention directly learns the model of the target user by combining data from other users besides the target user for a specific target user and its data distribution. In this process, no labeled data of the target user is required, only unlabeled data is needed, so that the personalized data distribution of the target user can be effectively trained to obtain the corresponding model in actual use. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 This provides a system architecture that can be applied to this invention;

[0015] Figure 2 This is a flowchart of the joint learning method for user-personalized data distribution provided in Embodiment 1 of the present invention;

[0016] Figure 3 This is a flowchart of the training dataset construction method provided in Embodiment 2 of the present invention;

[0017] Figure 4 This is a structural diagram of the joint learning device for user-personalized data distribution provided in Embodiment 3 of the present invention;

[0018] Figure 5 This is a structural diagram of the training dataset construction device provided in Embodiment 4 of the present invention. Detailed Implementation

[0019] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.

[0020] To illustrate the technical solution described in this invention, specific embodiments are described below.

[0021] Figure 1 For a system architecture in which the present invention can be applied, such as Figure 1As shown, the system architecture 01 includes a federated learning server 11 and users 121, 122, and 123. Users 121, 122, and 123 communicate with the federated server via a network, which may include any network communication link medium such as a wired network or a wireless network.

[0022] Specifically, system architecture 01 is an architecture for implementing a joint learning model, in which users 121, 122, and 123 each possess their own datasets, and the users cannot communicate with each other. In a classic joint learning model, the joint learning server distributes an initialized global model to each user 121, 122, and 123. Users 121, 122, and 123 then train this global model using their own datasets and return it to the joint learning server. The joint learning server then aggregates the trained global model and repeatedly distributes it to each user 121, 122, and 123 for training, iterating until the model converges. This typical joint learning model requires labeling the samples in the datasets of users 121, 122, and 123.

[0023] It should be understood that Figure 1 The users 121, 122, and 123 shown can be specific electronic devices, such as computers, industrial control computers, workstations, and other computing devices.

[0024] In one example, the electronic device may specifically include a processor; a communication module connected to the processor; and a memory storing a computer program that can run on the processor, wherein the processor executes the computer program to implement the steps of the joint learning method for user-personalized data distributions as provided in the following embodiments of the present invention, or to implement the steps of the training dataset construction method as provided in the following embodiments of the present invention.

[0025] The memory can be a storage medium, such as a read-only memory or a random access memory. Specifically, in Example 2, a storage medium is provided that stores a computer program, characterized in that, when executed by a processor, the computer program implements the steps of the joint learning method for user-personalized data distribution provided in the following embodiments of the present invention, or implements the steps of the training dataset construction method provided in the following embodiments of the present invention.

[0026] It should be noted that this application does not limit the specific number of users, for example, such as Figure 1 As shown, the users connected to the federated learning server can be User 1, User 2, and User 3, or any other number of users.

[0027] Figure 2This is a flowchart of the joint learning method for user-personalized data distribution provided in Embodiment 1 of the present invention.

[0028] In this embodiment, the execution entity of the joint learning method for user-personalized data distribution can be any electronic device, such as... Figure 1 The example shown is the joint learning server 01. Specifically, as... Figure 2 As shown, the joint learning method for user-personalized data distribution specifically includes steps S101-S104.

[0029] Step S101: Receive the target user feature distribution model established based on the user's personalized data distribution.

[0030] The target user refers to a user with personalized data distribution. For example, the target user can be: Figure 1 Any user connected to the federated learning server, for example, user 1.

[0031] Specifically, the target user feature distribution model can be constructed using existing algorithm models, for example, a Gaussian mixture model, etc. It should be understood that this application does not limit the method used to construct the target user feature distribution model.

[0032] Step S102: Send the target user feature distribution model to other users.

[0033] The other users refer to users participating in joint learning other than the target user, for example, combining... Figure 1 As shown, when User 1 is the target user, then User 2 and User 3 are the other users.

[0034] Step S103: Combine the training dataset constructed by various other users to train the target user feature distribution model, and train the target user feature distribution model. The training dataset includes a weighted training set or an unweighted training set.

[0035] The training datasets built by other users are generated based on the weights. It is not necessary to label the samples in the datasets owned by other users to generate labeled data. In other words, this step trains the target user feature distribution model using unlabeled data.

[0036] Step S104: After training is completed, the target user feature distribution model is returned to the target user.

[0037] The joint learning method provided above, compared to existing joint learning methods, does not require the target user's local dataset to fine-tune the global model. Instead, it directly learns the target user's model by combining the datasets of other users. In this process, no labeled data from the target user is required; only unlabeled data is needed, thus enabling model training based on the user's personalized data distribution.

[0038] The above embodiment 1 illustrates the technical solution of this application by taking the federated learning server as the execution subject. The technical solution of this application will be described below from the user side that communicates with the federated learning server.

[0039] Figure 3 This is a flowchart of the training dataset construction method provided in Embodiment 2 of the present invention. The execution entity of the training dataset construction method can be... Figure 1 Any of the non-target users shown, such as user 2 and user 3.

[0040] like Figure 3 As shown, the training dataset construction method specifically includes the following steps S201-S203:

[0041] Step S201: Receive the target user feature distribution model based on the user's personalized data distribution, which is sent by the joint learning server;

[0042] Step S202: Based on the target user feature distribution model, construct a training dataset for training the target user feature distribution model. The training dataset includes a weighted training dataset or an unweighted training dataset.

[0043] Step S203: Send the training dataset to the joint learning server.

[0044] In step S202 above, other users can construct a weighted training dataset for the target user feature distribution model based on their own locally available dataset, or construct an unweighted training dataset for the target user feature distribution model.

[0045] In Example 3, regarding step S202 above, the weighted training dataset constructed from other users for training the target user feature distribution model specifically includes steps S211-S214:

[0046] S211, calculate the local probability of each sample in the dataset owned by other users besides the target user in their own dataset. Here, assuming each sample in the dataset owned by other users is x, its corresponding local probability can be expressed as P(x).

[0047] S212, calculate the relative probability of each sample in the dataset owned by other users besides the target user in the target user feature distribution model. Similarly, if each sample in the dataset owned by other users is x, then the probability of sample x in the target user feature distribution model can be expressed as Q(x).

[0048] S213, determine the weight of each sample in the dataset of users other than the target user as the ratio of the relative probability to the local probability, and use the determined weighted sample x as the training dataset for training the feature distribution model of the target user. Specifically, in conjunction with the above steps, the weight of each sample x is W(x) = Q(x) / P(x).

[0049] S214, Output the training dataset.

[0050] This example determines the weight of each sample by calculating its probability in its own dataset and the target user feature distribution model for each sample in the datasets owned by other users, thereby obtaining a training dataset for training the target user feature distribution model.

[0051] In Example 4, regarding step S202 above, the unweighted training dataset constructed from other users for training the target user feature distribution model specifically includes steps S221-S223:

[0052] S221, calculate the relative probability of each sample in the target user's feature distribution model from the datasets owned by users other than the target user. This step S221 in this example is equivalent to S212 in the example above.

[0053] S222, Based on the uniform distribution, sample a random variable from the uniform distribution, and compare the selected random variable with the relative probability: if the relative probability is greater than the selected random variable, add the sample corresponding to the relative probability to the training dataset; if the relative probability is less than or equal to the selected random variable, discard the sample corresponding to the relative probability.

[0054] For example, following the example above, suppose we sample a random variable u from a uniform distribution U ~ (0,1), and compare the random variable u with the probability Q(x): if Q(x) > u, then add the corresponding sample x to the training dataset; if Q(x) ≤ u, then discard x.

[0055] S223: Output the training dataset.

[0056] This example calculates the probability of each sample in the target user feature distribution model from the datasets owned by other users, and then uses a random variable u sampled from a uniform distribution U ~ (0,1) to take samples with a probability greater than that random variable u as the training dataset for training the target user feature distribution model.

[0057] In terms of existing technologies, current joint learning methods first learn a classic global joint learning model, and then fine-tune this global model based on the target user's local data to obtain a model suitable for the local environment. The drawback is that it still requires the target model's local labeled data for fine-tuning. However, in many application scenarios, the target user's labeled data is difficult to obtain, making this approach challenging to use. The embodiments provided by this invention, however, are designed for specific target users and their data distributions, directly learning a model for the target user by combining data from other users. This process does not require any labeled data from the target user, only unlabeled data. Therefore, in practical use, the personalized data distribution of the target user can be effectively trained to obtain the corresponding model.

[0058] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0059] In the above Figure 2 and Figure 3 The methods shown belong to the same inventive concept. The following also provides device embodiments corresponding to each step in the above method embodiments.

[0060] Figure 4 This is a structural diagram of the joint learning device for user-personalized data distribution provided in Embodiment 3 of the present invention.

[0061] like Figure 4 As shown, the joint learning device for user personalized data distribution provided in this embodiment is set in a joint learning server. The joint learning device includes: a target user model receiving module, used to receive a target user feature distribution model established by the target user based on the user personalized data distribution; a target user model forwarding module, used to send the target user feature distribution model to other users respectively; a joint training module, used to train the target user feature distribution model by combining the training dataset constructed by various other users for training the target user feature distribution model, wherein the training dataset includes: a weighted training set or an unweighted training set; and a target user model returning module, used to return the target user feature distribution model to the target user after training is completed.

[0062] Figure 5 This is a structural diagram of the training dataset construction device provided in Embodiment 4 of the present invention.

[0063] like Figure 5 As shown, the training dataset construction device provided in this embodiment is set in a non-target user connected to a federated learning server. The training dataset construction device includes: a data receiving module, used to receive a target user feature distribution model established by the target user based on the user's personalized data distribution from the federated learning server; a training set construction module, used to construct a training dataset for training the target user feature distribution model based on the target user feature distribution model, the training dataset including a weighted training set or an unweighted training set; and a data sending module, used to send the training dataset to the federated learning server.

[0064] In some optional examples, the training set construction module specifically includes: a first probability calculation unit, used to calculate the local probability of each sample in the dataset owned by other users besides the target user in their own dataset; a second probability calculation unit, used to calculate the relative probability of each sample in the dataset owned by other users besides the target user in the target user feature distribution model; a sample weight calculation module, used to determine the weight of each sample in the dataset owned by other users besides the target user as the ratio of the relative probability to the local probability, and use the determined weighted samples as the training dataset for training the target user feature distribution model; and a training dataset output unit, used to output the training dataset.

[0065] In some optional examples, the training set construction module specifically includes: a second probability calculation unit, used to calculate the relative probability of each sample in the target user's feature distribution model from the dataset owned by other users besides the target user; a sample selection unit, used to sample a random variable from the uniform distribution according to the uniform distribution, and compare the selected random variable with the relative probability: if the relative probability is greater than the selected random variable, then the sample corresponding to the relative probability is added to the training dataset; if the relative probability is less than or equal to the selected random variable, then the sample corresponding to the relative probability is discarded; and a training dataset output unit, used to output the training dataset.

[0066] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A federated learning method for user personalized data distribution, characterized in that, The method comprises the following steps: receiving a target user feature distribution model established by a target user based on user personalized data distribution; sending the target user feature distribution model to other users except the target user; training the target user feature distribution model by combining training data sets for training the target user feature distribution model constructed by other users except the target user, wherein the training data set comprises a weighted training set or an unweighted training set; returning the target user feature distribution model to the target user after the training is completed; wherein the training data set is constructed by a non-target user connected to a federated learning server by executing a training data set construction method, and the training data set construction method comprises the following steps: receiving a target user feature distribution model established by a target user based on user personalized data distribution; constructing a training data set for training the target user feature distribution model based on the target user feature distribution model, wherein the training data set comprises a weighted training data set or an unweighted training data set; sending the training data set to the federated learning server; constructing a weighted training data set for training the target user feature distribution model by other users except the target user, which comprises the following steps: calculating the local probability of each sample in the data set owned by other users except the target user in the data set owned by the other users; calculating the relative probability of each sample in the data set owned by other users except the target user in the target user feature distribution model; determining the weight of each sample in the data set of other users except the target user as the ratio of the relative probability and the local probability, and taking the determined weighted sample x as the training data set for training the target user feature distribution model; outputting the training data set; constructing an unweighted training data set for training the target user feature distribution model by other users except the target user, which comprises the following steps: calculating the relative probability of each sample in the data set owned by other users except the target user in the target user feature distribution model; selecting a random variable from a uniform distribution according to the uniform distribution, and comparing the selected random variable with the relative probability to determine which one is larger: if the relative probability is greater than the selected random variable, the sample corresponding to the relative probability is added to the training data set; if the relative probability is less than or equal to the selected random variable, the sample corresponding to the relative probability is discarded; outputting the training data set. 2.A device for federated learning of user-individualized data distribution, disposed in a federated learning server, characterized in that, The federated learning device comprises: a target user model receiving module for receiving a target user feature distribution model established by a target user based on user personalized data distribution; a target user model forwarding module for sending the target user feature distribution model to other users except the target user, respectively. The joint training module is configured to train the target user feature distribution model by using a training data set constructed by combining training data sets of other users except the target user, wherein the training data set comprises a weighted training set or a non-weighted training set. The target user model returning module is configured to return the target user feature distribution model to the target user after the training is completed. The training data set is constructed by a training data set construction device arranged in a non-target user connected to the joint learning server, and the training data set construction device comprises: The data receiving module is configured to receive a target user feature distribution model established by the target user based on user personalized data distribution and issued by the joint learning server. The training set construction module is configured to construct a training data set for training the target user feature distribution model based on the target user feature distribution model, and the training data set comprises a weighted training set or a non-weighted training set. The data sending module is configured to send the training data set to the joint learning server. The training set construction module specifically comprises: The first probability calculation unit is configured to calculate a local probability of each sample in the data set owned by the other user except the target user in the data set owned by the other user. The second probability calculation unit is configured to calculate a relative probability of each sample in the data set owned by the other user except the target user in the target user feature distribution model. The sample weight calculation module is configured to determine a weight of each sample in the data set of the other user except the target user as a ratio of the relative probability and the local probability, and determine the weighted sample as a training data set for training the target user feature distribution model. The training data set output unit is configured to output the training data set. The training set construction module specifically further comprises: The sample selection unit is configured to select a random variable from a uniform distribution according to the uniform distribution, compare the selected random variable with the relative probability, and if the relative probability is greater than the selected random variable, add the sample corresponding to the relative probability to the training data set; if the relative probability is less than or equal to the selected random variable, discard the sample corresponding to the relative probability. The training data set output unit is configured to output the training data set.

3. An electronic device, comprising: a processor; a communication module connected to the processor; a memory having a computer program stored therein and executable on the processor, wherein the processor executes the computer program to implement the steps of the method of claim 1.

4. A storage medium storing a computer program, characterized by The computer program is executed by the processor to implement the steps of the method of claim 1.

Citation Information

Patent Citations

  • Method for establishing data analysis model

    CN111190487A

  • System for realizing data set construction processing based on federated learning and construction generation method thereof

    CN111695701A