Model training method and device, instant pushing method and device, medium and equipment
By employing a federated learning approach, each participant trains its local model and merges the changing values, thus solving the model training problem in edge intelligence scenarios and achieving efficient model training while protecting data privacy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DOUYIN VISION CO LTD
- Filing Date
- 2023-05-12
- Publication Date
- 2026-06-05
AI Technical Summary
Existing horizontal and vertical federated learning methods cannot solve the modeling problem in edge intelligence business scenarios, and cannot achieve model training while ensuring data privacy.
By using a federated learning approach, each participant trains its own local model, acquires and merges the change values from multiple participants, and adjusts the parameters based on the local model to achieve the training of a hybrid federated learning model, which is suitable for edge intelligence scenarios.
While ensuring the data privacy of all participants, model training was achieved in both horizontal and vertical federated data distribution scenarios, improving the training efficiency, generalization, and applicability of the model and meeting the business needs of edge intelligence scenarios.
Smart Images

Figure CN116614384B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computers, and more specifically, to a model training method and apparatus, a real-time push method and apparatus, a medium, and a device. Background Technology
[0002] To address data security and privacy concerns in Artificial Intelligence (AI) modeling, numerous solutions exist, such as horizontal federated learning and vertical federated learning. These models allow for the creation of AI models without requiring data to leave the database, thus protecting the privacy of local data for each participant. However, horizontal and vertical federated learning address relatively fixed data scenarios and cannot solve modeling problems in edge intelligence business scenarios. Summary of the Invention
[0003] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] In a first aspect, this disclosure provides a model training method based on federated learning, applied to a first participant, the method comprising:
[0005] The first model is trained once based on the local training data of the first participant, and the first change value between the parameter values of the first model obtained after this round of training and the parameter values of the first model obtained after the previous round of training is determined, wherein each round of training includes multiple iterative training.
[0006] Obtain the second change value corresponding to the second model sent by multiple second participants respectively, wherein the feature dimensions of the training data of each second participant are the same but the samples are different, and the samples in the training data of the first participant and the second participant are the same but the feature dimensions are different.
[0007] The target change value is determined based on the first change value and multiple second change values;
[0008] The parameters of the first model and the second model are adjusted according to the target change value, and the parameter-adjusted second model is sent to each of the second participants.
[0009] Secondly, this disclosure provides an instant push method, including:
[0010] The server receives candidate push content and a first push parameter corresponding to the candidate push content, wherein the candidate push content and the first push parameter corresponding to the candidate push content are determined by the server based on the feature values of the sample features it possesses and the server's push model.
[0011] Based on the feature values of the sample features and the client's push model, the second push parameters corresponding to the candidate push content are determined, wherein the client's push model is the second model in the model trained based on the federated learning model training method described in the first aspect, and the server's push model is the first model in the model trained based on the federated learning model training method described in the first aspect.
[0012] The target push parameters are determined based on the first push parameters and the second push parameters of the candidate push content, and the push is performed in real time based on the target push parameters.
[0013] Thirdly, this disclosure provides a model training device based on federated learning, applied to a first participant, the device comprising:
[0014] The first training module is used to train the first model in one round based on the training data of the first participant, and to determine the first change value between the parameter values of the first model obtained after this round of training and the parameter values of the first model obtained after the previous round of training, wherein each round of training includes multiple iterative training.
[0015] The acquisition module is used to acquire the second change value corresponding to the second model sent by multiple second participants respectively, wherein the feature dimensions of the training data of each second participant are the same but the samples are different, and the samples in the training data of the first participant and the second participant are the same but the feature dimensions are different.
[0016] The first determining module is used to determine a target change value based on the first change value and a plurality of second change values;
[0017] The second training module is used to adjust the parameters of the first model and the second model according to the target change value, and send the parameter-adjusted second model to each of the second participants so that the second participants can train the parameter-adjusted second model.
[0018] Fourthly, this disclosure provides an instant push device, the device comprising:
[0019] The receiving module is used to receive candidate push content and a first push parameter corresponding to the candidate push content sent by the server, wherein the candidate push content and the first push parameter corresponding to the candidate push content are determined by the server based on the feature values of the sample features it possesses and the server's push model;
[0020] The second determining module is used to determine the second push parameters corresponding to the candidate push content based on the feature values of the sample features and the push model of the client, wherein the push model of the client is the second model in the model trained based on the federated learning model training method described in the first aspect, and the push model of the server is the first model in the model trained based on the federated learning model training method described in the first aspect.
[0021] The push module is used to determine the target push parameters based on the first push parameters and the second push parameters of the candidate push content, and to perform real-time push based on the target push parameters.
[0022] Fifthly, this disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first or second aspect.
[0023] Sixthly, this disclosure provides an electronic device, comprising:
[0024] A storage device on which computer programs are stored;
[0025] A processing device for executing the computer program in the storage device to implement the steps of the method described in the first or second aspect.
[0026] In the above technical solution, local models can be trained by the first and second participants based on their local training data. Specifically, the first participant trains the first model using its local training data, and the second participant trains the second model using its local training data. This ensures the data privacy of each participant while enabling the training of the hybrid federated learning model. Furthermore, for the global second model corresponding to multiple second participants, the change values corresponding to each round can be sent to the first participant. The first participant then merges these change values from multiple second participants and combines them with the change values from its local model to comprehensively train the hybrid federated learning model. This enables model training in data distribution scenarios involving both horizontal and vertical federation, meeting business needs such as edge intelligence scenarios.
[0027] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0028] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings:
[0029] Figure 1 A schematic diagram of horizontal federated learning is shown.
[0030] Figure 2 A schematic diagram of vertical federated learning is shown.
[0031] Figure 3 This diagram illustrates the data distribution in an edge intelligence scenario.
[0032] Figure 4 A flowchart of a federated learning-based model training method according to an embodiment of the present disclosure is shown.
[0033] Figure 5 A schematic diagram of a hybrid federated learning model obtained from a federated learning-based model training method according to an embodiment of the present disclosure is shown.
[0034] Figure 6 A flowchart illustrating an exemplary implementation of determining a target change value based on a first change value and a plurality of second change values, according to one embodiment of the present disclosure, is shown.
[0035] Figure 7 This is a flowchart of an instant push method provided according to one embodiment of the present disclosure.
[0036] Figure 8 A block diagram of a federated learning-based model training apparatus according to an embodiment of the present disclosure is shown.
[0037] Figure 9 A schematic diagram of the structure of an electronic device suitable for implementing embodiments of the present disclosure is shown. Detailed Implementation
[0038] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0039] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0040] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0041] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0042] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0043] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0044] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0045] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0046] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0047] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0048] Meanwhile, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0049] In related technologies, horizontal federated learning can only achieve model training in the following scenarios, namely, the training data have the same feature dimensions but different samples. Figure 1 The diagram illustrates horizontal federated learning, where the W1 direction represents the dimension of the samples and the W2 direction represents the dimension of the features. Participants A and B have overlapping features but different samples. Vertical federated learning can only train models in scenarios where the training data of each participant contains the same samples but different feature dimensions. Figure 2 The diagram illustrates a vertical federated learning scenario where participant A and participant B have different features but share overlapping samples.
[0050] Neither horizontal nor vertical federated learning can train models in edge intelligence scenarios. In edge intelligence scenarios, each client may have the same feature dimensions but different samples, while the server has samples from all clients, but the feature dimensions of the server are different from those of each client. Figure 3 This diagram illustrates the data distribution in an edge intelligence scenario. For example... Figure 3 As shown, Participant A and Participant B generally represent clients containing user privacy data, while Participant C generally represents a server. Participant C contains non-privacy data that Participant A and Participant B can upload to the server. Participant A and Participant B have the same feature dimensions but different samples, and Participant C has the full sample data of Participant A and Participant B, but the feature dimensions of Participant C are different from those of Participant A and Participant B.
[0051] In edge intelligence scenarios, many services employ a push notification model on the server side to determine whether a particular push notification should be sent. This push notification content can include, but is not limited to, news messages, images, audio, and video. The data used to build this model is primarily distributed across both ends, with some data on the client side, such as data characterizing user actions. Figure 3 The data consists of two parts: one part is data on the feature dimensions corresponding to participants A and B, and the other part is data on the server side, which may contain the content features of the push notification, such as data on the feature dimension corresponding to participant C.
[0052] Figure 4 The diagram shows a flowchart of a federated learning-based model training method according to one embodiment of this disclosure. This method can be applied to a first participant, which may be the aforementioned server, such as... Figure 4 As shown, the method may include:
[0053] In step 11, the first model is trained once based on the local training data of the first participant, and the first change value between the parameter values of the first model obtained after this round of training and the parameter values of the first model obtained after the previous round of training is determined, wherein each round of training includes multiple iterative training.
[0054] In this step, the first participant can train the first model based on its local training data. For example, the first participant's local training data includes training content and corresponding labels. The labels are generated and sent to the first participant in response to the push result of the training content in the second participant when the training content is pushed to the second participant.
[0055] In this embodiment, to achieve model training in an edge intelligence scenario, each participant needs to extract the training data required for model training. Generally, some non-private data obtained through event tracking is collected in advance on the client side. This non-private data is sent to the server for model training. For example, in this disclosure, when training content is pushed to the clients corresponding to each second participant, it is used to indicate whether the training content has been pushed to the terminal of that second participant. For instance, a Python API can be called within the algorithm package to report the non-private data used for model training from the client to the server through the `pitaya_feature_engineering` event tracking. When the second participant sends the tags to the first participant, encryption can be performed based on the RSA algorithm commonly used in federated learning to further ensure data security.
[0056] Accordingly, in this step, the first participant can obtain the tags of whether the corresponding training content is pushed to the second participant through the data points, and then train based on the training content and tags. For example, the features of the training content are used as the model input and the tags are used as the target output of the model. The first model is trained iteratively multiple times. The number of iterations k in each round of training can be set based on the actual application scenario. This disclosure does not limit this.
[0057] After this round of training, the current parameter values of the first model can be obtained, that is, the parameter values of the first model after this k-iteration training. These values are then compared with the parameter values of the first model obtained after the previous round of training to obtain the first change value, as follows:
[0058]
[0059] in, This represents the first change value of the first participant after the t-th round of training;
[0060] This represents the parameter values of the first model of the first participant after k iterations of training in round t;
[0061] This represents the parameter values of the first model of the first participant at the beginning of the t-th round of training, i.e., the values obtained after the previous round of training.
[0062] In step 12, the second change values corresponding to the second models sent by multiple second participants are obtained. The feature dimensions of the training data of each second participant are the same but the samples are different. The samples in the training data of the first participant and the second participant are the same but the feature dimensions are different.
[0063] The second participant can be Figure 3 The multiple clients shown all correspond to the same second model. These multiple clients can be each client communicating with the server, or a selected subset of clients.
[0064] In one possible embodiment, the second change value of the second model is determined in the following manner:
[0065] Each of the second participants trains the second model once based on its local training data to obtain the trained second model.
[0066] In this step, the training data samples for different second participants are different to protect the data privacy of different participants. For each second participant, the second model can be trained based on the local training data of that second participant, that is, the feature values and labels of the local sample features.
[0067] Following the example above, each round of training for the second participant includes multiple iterative training sessions. For example, for each second participant, k iterative training sessions are conducted in the current round of training based on its local training data to update and adjust the parameters in the second model based on the local training data, thereby obtaining the second model after this round of training.
[0068] For each of the second participants, the difference between the parameter values of the trained second model corresponding to the second participant and the parameter values of the second model after the previous round of training is determined as the second change value of the second model corresponding to the second parameter participant.
[0069] Subsequently, for each second participant, the second change value can be determined in the following way:
[0070]
[0071] in, This represents the second change value of the i-th second participant in the t-th round of training;
[0072] This represents the parameter values of the second model of the i-th second participant after k iterations of training in round t;
[0073] This represents the parameter values of the second model of the i-th second participant after 0 iterations of training in round t, i.e., the values obtained after the previous round of training.
[0074] Therefore, through the above technical solution, multiple second participants can be trained on the same second model based on their local training data using a horizontal federated learning approach. During the training process, it is only necessary to combine the change values of each second participant in this round of training. While ensuring the data privacy of each second participant, multiple second participants can train the same model, thereby improving the training efficiency, generalization and applicability of the model.
[0075] In step 13, the target change value is determined based on the first change value and multiple second change values.
[0076] In this context, the first participant can determine the combined change value of the hybrid federated learning model by combining the first change value corresponding to its local first model with the second change values received from multiple second participants. For example, ... Figure 5 As shown, the hybrid federated learning model includes the first model A1 and the second model A2, as follows: Figure 5 The diagram shows four second participants F1-F4 and a first participant C1. The second participants F1-F4 can upload the change values of the second model A2 corresponding to this round of training to the first participant C1. The first participant C1 then determines the target change value based on the change values of its local first model A1 and the change values uploaded by the second participants F1-F4.
[0077] In step 14, the parameters of the first model and the second model are adjusted according to the target change value, and the parameter-adjusted second model is sent to each second participant.
[0078] After determining the target change value, the model parameters can be adjusted using gradient adjustment methods commonly used in the field to obtain the model obtained after this round of training. In this embodiment, the first model of the first participant and the second model corresponding to multiple participants can be updated simultaneously to adapt to the data distribution scenario in the application's intelligent scenario.
[0079] After this round of training, the first model with adjusted parameters can be trained again based on the local training data of the first participant. The second model with adjusted parameters can then be sent to each of the second participants. Multiple second participants can then train again based on their local training data. The training method is the same for each round, so it will not be described in detail here.
[0080] As an example, training can end after reaching a predetermined number of training rounds to obtain a first and second model that have been trained, or training can end after the first and second models have reached a predetermined convergence criterion. This can be set based on the actual application scenario.
[0081] Therefore, in the above technical solution, local models can be trained by the first and second participants based on their local training data. Specifically, the first participant trains the first model using its local training data, and the second participant trains the second model using its local training data. This ensures the data privacy of each participant while enabling the training of the hybrid federated learning model. Furthermore, for the global second model corresponding to multiple second participants, the change values corresponding to each round can be sent to the first participant. The first participant then fuses these change values from multiple second participants and combines them with the change values from its local model to comprehensively train the hybrid federated learning model. This enables model training in data distribution scenarios involving both horizontal and vertical federation, meeting business needs such as edge intelligence scenarios.
[0082] In related technologies, in horizontal federated learning models, each participant typically adjusts the parameters of its local federated model based on the loss value corresponding to its training data. These parameters are then uploaded to a central node, which fuses them to determine the target parameters of the federated model and distributes them to each participant for the next round of training. In this embodiment, the first participant can fuse the losses of multiple second participants. Since the first and second participants each build their local models, the loss of the hybrid federated learning model can include the sum of the losses of the second models corresponding to the multiple second participants and the loss of the first model corresponding to the first participant, such as F(X1,X2;Y)=f f (x1;y)+f c (x2; y), where F(X1, X2; Y) represents the loss of the hybrid federated learning model, X1 represents the feature dimension of the second participant, X2 represents the feature dimension of the first participant, and Y represents the label. f (x1; y) is used to represent the loss of the second participant, f c (x2; y) represents the loss of the first participant. The loss of the second participant can be expressed as... N is the number of second participants, f i (x) represents the loss of the i-th second participant.
[0083] Based on the above-mentioned loss fusion approach, this disclosure provides the following embodiments to fuse the gradients corresponding to the loss.
[0084] In one possible embodiment, an exemplary implementation of determining the target change value based on the first change value and a plurality of second change values in step 13 is as follows: Figure 6 As shown, this step may include:
[0085] In step 131, multiple second change values are fused to obtain the fused change value corresponding to the second model.
[0086] As an example, when fusing multiple second change values to obtain the fused change value corresponding to the second model, the multiple second change values can be averaged to obtain the average value as the fused change value.
[0087] As another embodiment, fusing multiple second change values to obtain the fused change value corresponding to the second model may include:
[0088] The weight of each second participant is determined based on the amount of training data they provide. Specifically, the amount of training data from each second participant can be sent to the first participant, allowing the first participant to determine its weight based on the amount of training data from each second participant. For example, the weight of a second participant can be determined as the ratio of its training data to the total training data from all second participants. This ensures that second participants with more local training data have a greater impact on the training process of the second model, aligning with real-world training scenarios.
[0089] Then, the fusion change value is obtained by weighted summation based on the second change value corresponding to the second participant and the weight corresponding to the second participant.
[0090] Accordingly, the sum of the products of the second change value and the corresponding weight of each second participant is used as the fusion change value, so as to further determine a more accurate fusion change value by combining the amount of training data in each second participant.
[0091] In step 132, the adjustment values of the parameters in the second model are calculated based on the fusion change value.
[0092] For example, calculating the adjustment value of the parameter in the second model based on the fusion change value may include:
[0093] Substitute the fusion change value into the second model, calculate the value of the parameter after the second model is adjusted based on the fusion change value, and determine the value as the adjustment value.
[0094] In this embodiment, the fusion change value can be substituted into the second model. Then, the parameter value obtained after adjusting the parameters based on the fusion change value can be determined according to the formula of the parameters in the second model. That is, the adjustment value of the parameters in the second model in response to the fusion change value. For example, this can be implemented through the following logic: in, Used to represent the adjustment value of the parameter in the t-th round of the second model. η is used to represent the fusion change value in round t. t η is used to represent the parameters of the t-th iteration in the second model. t These are parameters with fixed values in the second model.
[0095] In step 133, the update change value corresponding to the parameters of the second model is determined based on the adjustment value and the parameter values of the second model obtained after the previous training.
[0096] The adjustment value represents the theoretical value of the parameters in the second model calculated by integrating the changes from multiple second participants after this round of training. Based on this theoretical value and the parameter values of the second model obtained after the previous round of training, the corresponding change value for this round of training, i.e., the updated change value, can be obtained. For example, the difference between the adjustment value and the parameter values of the second model obtained after the previous round of training can be used as the updated change value.
[0097] In step 134, the sum of the first change value and the updated change value is determined as the target change value.
[0098] Therefore, the change values of multiple second participants after this round of training can be fused in the first participant to determine the parameter values of the second model after this round of training. Furthermore, the updated change value of the parameters of the second model after fusing the change values corresponding to multiple second participants can be determined, thereby realizing the fusion of the first change value and the updated change value. In the process of determining the target change value, the loss of the first model and the second model can be fused, improving the accuracy of the target change value, ensuring the accuracy and effectiveness of subsequent parameter updates of the first model and the second model, and improving the training efficiency of the model.
[0099] Figure 7 The diagram shows a flowchart of an instant push method according to one embodiment of the present disclosure. For example, this method can be applied to a client, such as... Figure 7 As shown, the method may include:
[0100] In step 71, the server receives candidate push content and the first push parameter corresponding to the candidate push content. The candidate push content and the first push parameter corresponding to the candidate push content are determined by the server based on the feature values of the sample features it possesses and the server's push model.
[0101] The server's push model is a model trained using the federated learning-based model training method disclosed herein, as described in the first model above. Based on this push model, candidate push content can be inferred, and the first push parameter can be the push probability corresponding to the candidate push content output by the push model. The server can then send the determined candidate push content and the corresponding first push parameter to the client.
[0102] The sample characteristics of the server may include at least one of the following: the primary vertical category of the content, the popularity of the content on the client, the basic profile of the content, the arrival click rate of the push within the most recent first preset time period (e.g., the past week), the time interval between the most recent click of the push and the current time, whether the content is active on the current day, and the activity rate of the content within the most recent second preset time period (e.g., the past week) (e.g., the number of active days of the content in the past week), etc.
[0103] In step 72, the second push parameter corresponding to the candidate push content is determined based on the feature values of the sample features and the push model of the client.
[0104] The client's push model is a model trained using the federated learning-based model training method disclosed herein, as described in the second model above. The second push parameter can be the push model output used to represent the push probability of content delivery.
[0105] The sample characteristics of the client may include at least one of the following: current time, acceleration (reflecting whether the user of the client is moving), gyroscope sensing information (reflecting whether the user of the client is moving or stationary), distance of the user from the screen, whether headphones are plugged in, whether the user is playing audio, current battery level, and current network status, etc.
[0106] In step 73, the target push parameters are determined based on the first push parameters and the second push parameters of the candidate push content, and the push is performed in real time based on the target push parameters.
[0107] One approach is to use the average of the first and second push parameters of the candidate push content as the target push parameter. Alternatively, weights can be assigned to the push models of the client and server, and then the first and second push parameters can be weighted and averaged based on their respective weights to obtain the target push parameter.
[0108] As mentioned above, the first push parameter is based on server-side sample features, such as the features of the push content, and can be used to represent the probability that the candidate push content will be pushed. The second push parameter is based on client-side sample features, such as the user features corresponding to the client, and can be used to represent the probability that the push content will be pushed to that client. As an example, when the target push parameter is greater than a preset threshold, it can be determined that the candidate push content will be pushed immediately. The candidate push content can be sent to the client along with the first push parameter, or it can be sent to the client when it is determined that an immediate push will be performed based on the candidate push content.
[0109] Therefore, through the above technical solution, inference can be performed on the client and server sides based on different push models to obtain the target push parameters corresponding to the push content. By combining the model inference results of the client and the model inference results of the server, appropriate content can be pushed to the client user in real time.
[0110] Based on the same inventive communication described above, this disclosure also provides a model training device based on federated learning, such as... Figure 8 As shown, the device 10, applied to the first participant, includes:
[0111] A first training module 100 is used to train a first model in one round based on the local training data of the first participant, and determine a first change value between the parameter values of the first model obtained after this round of training and the parameter values of the first model obtained after the previous round of training, wherein each round of training includes multiple iterations of training; an acquisition module 200 is used to acquire second change values corresponding to the second models sent by multiple second participants, wherein the feature dimensions of the training data of each second participant are the same but the samples are different, and the samples in the training data of the first participant and the second participants are the same but the feature dimensions are different; a first determination module 300 is used to determine a target change value based on the first change value and multiple second change values; a second training module 400 is used to adjust the parameters of the first model and the second model according to the target change value, and send the parameter-adjusted second model to each second participant so that the second participant can train the parameter-adjusted second model.
[0112] Optionally, the first determining module includes: a first processing submodule, configured to fuse multiple second change values to obtain a fused change value corresponding to the second model; a second processing submodule, configured to calculate an adjustment value for the parameters in the second model based on the fused change value; a first determining submodule, configured to determine an updated change value corresponding to the parameters of the second model based on the adjustment value and the parameter values of the second model obtained after the previous training round; and a second determining submodule, configured to determine the sum of the first change value and the updated change value as the target change value.
[0113] Optionally, the second processing submodule is further configured to: substitute the fusion change value into the second model, calculate the value of the parameter after the second model is adjusted based on the fusion change value, and determine the value as the adjustment value.
[0114] Optionally, the first processing submodule includes: a third determining submodule, configured to determine the weight corresponding to the second participant based on the amount of training data for each second participant; and a fourth determining submodule, configured to perform a weighted summation based on the second change value corresponding to the second participant and the weight corresponding to the second participant to obtain the fused change value.
[0115] Optionally, the second change value of the second model is determined in the following way: each of the second participants trains the second model for one round based on the training data of the second participant to obtain the trained second model; for each of the second participants, the difference between the value of the parameter of the trained second model corresponding to the second participant and the value of the parameter of the second model after the previous round of training is determined as the second change value of the second model corresponding to the second parameter party.
[0116] Optionally, the training data in the first participant's local area includes training content and tags corresponding to the training content. The tags are generated and sent to the first participant in response to the push result of the training content in the second participant when the training content is pushed to the second participant.
[0117] This disclosure also provides an instant push device, comprising: a receiving module, configured to receive candidate push content and a first push parameter corresponding to the candidate push content sent by a server, wherein the candidate push content and the first push parameter corresponding to the candidate push content are determined by the server based on the feature values of its sample features and the server's push model; a second determining module, configured to determine a second push parameter corresponding to the candidate push content based on the feature values of its sample features and the client's push model, wherein the client's push model is a second model in the model trained based on the federated learning-based model training method described above, and the server's push model is a first model in the model trained based on the federated learning-based model training method described above; and a push module, configured to determine a target push parameter based on the first push parameter and the second push parameter of the candidate push content, and perform instant push based on the target push parameter.
[0118] Optionally, the sample features of the client include at least one of the following: current time, acceleration, gyroscope sensing information, distance between the user and the screen, whether headphones are plugged in, whether the user is playing audio, current battery level, and current network status.
[0119] Optionally, the sample features of the server include at least one of the following: the primary vertical category of the content, the popularity of the content on the client, the basic profile of the content, the arrival click rate of the push within the most recent first preset time period, the time interval between the most recent click of the push and the current time, whether the content is active on the current day, and the activity rate of the content within the most recent second preset time period.
[0120] The following is for reference. Figure 9 This diagram illustrates a structural schematic of an electronic device 600 suitable for implementing embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 9 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0121] like Figure 9 As shown, electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. Processing device 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0122] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 9 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0123] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined in the methods of embodiments of this disclosure.
[0124] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0125] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0126] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0127] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the following to occur: A first model is trained once based on training data local to the first participant, and a first change value is determined between the parameter values of the first model obtained after this round of training and the parameter values of the first model obtained after the previous round of training, wherein each round of training includes multiple iterative training iterations; second change values corresponding to second models sent by multiple second participants are obtained, wherein the feature dimensions of the training data of each second participant are the same but the samples are different, and the samples in the training data of the first participant and the second participants are the same but the feature dimensions are different; a target change value is determined based on the first change value and multiple second change values; the parameters of the first model and the second model are adjusted according to the target change value, and the parameter-adjusted second model is sent to each second participant.
[0128] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0129] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0130] The modules described in the embodiments of this disclosure can be implemented in software or in hardware. The names of the modules do not necessarily limit the module itself; for example, the first training module can also be described as "a module that performs one round of training on the first model based on the local training data of the first participant, and determines a first change value between the parameter values of the first model obtained after this round of training and the parameter values of the first model obtained after the previous round of training."
[0131] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0132] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0133] According to one or more embodiments of this disclosure, Example 1 provides a model training method based on federated learning, applied to a first participant. The method includes: training a first model in one round based on local training data of the first participant, and determining a first change value between the parameter values of the first model obtained after this round of training and the parameter values of the first model obtained after the previous round of training, wherein each round of training includes multiple iterations; obtaining second change values corresponding to second models sent by multiple second participants, wherein the feature dimensions of the training data of each second participant are the same but the samples are different, and the samples in the training data of the first participant and the second participants are the same but the feature dimensions are different; determining a target change value based on the first change value and multiple second change values; adjusting the parameters of the first model and the second model according to the target change value, and sending the parameter-adjusted second model to each second participant.
[0134] According to one or more embodiments of this disclosure, Example 2 provides the method of Example 1, wherein determining the target change value based on the first change value and a plurality of second change values includes: fusing the plurality of second change values to obtain a fused change value corresponding to the second model; calculating an adjustment value for the parameters in the second model based on the fused change value; determining an updated change value corresponding to the parameters of the second model based on the adjustment value and the value of the parameters of the second model obtained after the previous training round; and determining the sum of the first change value and the updated change value as the target change value.
[0135] According to one or more embodiments of this disclosure, Example 3 provides the method of Example 2, wherein calculating the adjustment value of the parameter in the second model based on the fusion change value includes: substituting the fusion change value into the second model, calculating the value of the parameter after the second model is adjusted based on the fusion change value, and determining the value as the adjustment value.
[0136] According to one or more embodiments of this disclosure, Example 4 provides the method of Example 2, wherein fusing multiple second change values to obtain a fused change value corresponding to the second model includes: determining the weight corresponding to the second participant based on the amount of training data for each second participant; and performing a weighted summation based on the second change value corresponding to the second participant and the weight corresponding to the second participant to obtain the fused change value.
[0137] According to one or more embodiments of this disclosure, Example 5 provides the method of Example 1, wherein the second change value of the second model is determined by: each of the second participants performing one round of training on the second model based on the training data of the second participant to obtain the trained second model; for each of the second participants, the difference between the value of the parameter of the trained second model corresponding to the second participant and the value of the parameter of the second model after the previous round of training of the second participant is determined as the second change value of the second model corresponding to the second parameter party.
[0138] According to one or more embodiments of this disclosure, Example 6 provides the method of Example 1, wherein the training data local to the first participant includes training content and labels corresponding to the training content, the labels being generated and sent to the first participant in response to the push result of the training content in the second participant when the training content is pushed to the second participant.
[0139] According to one or more embodiments of this disclosure, Example 7 provides an instant push method, comprising: receiving candidate push content and a first push parameter corresponding to the candidate push content sent by a server, wherein the candidate push content and the first push parameter corresponding to the candidate push content are determined by the server based on the feature values of its sample features and the server's push model; determining a second push parameter corresponding to the candidate push content based on the feature values of its sample features and the client's push model, wherein the client's push model is a second model in a model trained based on the federated learning model training method described in any one of Examples 1-6, and the server's push model is a first model in a model trained based on the federated learning model training method described in any one of Examples 1-6; determining a target push parameter based on the first push parameter and the second push parameter of the candidate push content, and performing instant push based on the target push parameter.
[0140] According to one or more embodiments of this disclosure, Example 8 provides the method of Example 7, wherein the sample features of the client include at least one of the following: current time, acceleration, gyroscope sensing information, distance of the user from the screen, whether headphones are plugged in, whether the user is playing audio, current battery level, and current network status.
[0141] According to one or more embodiments of this disclosure, Example 9 provides the method of Example 7, wherein the sample features of the server include at least one of the following: the first-level vertical category of the content, the popularity of the content on the client, the basic profile of the content, the arrival click rate of the push within the most recent first preset time period, the time interval between the most recent click of the push and the current time, whether the content is active on the current day, and the activity rate of the content within the most recent second preset time period.
[0142] According to one or more embodiments of this disclosure, Example 10 provides a federated learning-based model training apparatus applied to a first participant. The apparatus includes: a first training module, configured to perform one round of training on a first model based on local training data of the first participant, and determine a first change value between the parameter values of the first model obtained after this round of training and the parameter values of the first model obtained after the previous round of training, wherein each round of training includes multiple iterative training.
[0143] The acquisition module is used to acquire second change values corresponding to the second models sent by multiple second participants, wherein the feature dimensions of the training data of each second participant are the same but the samples are different, and the samples in the training data of the first participant and the second participant are the same but the feature dimensions are different; the first determination module is used to determine a target change value based on the first change value and multiple second change values; the second training module is used to adjust the parameters of the first model and the second model according to the target change value, and send the parameter-adjusted second model to each second participant so that the second participant can train the parameter-adjusted second model.
[0144] According to one or more embodiments of this disclosure, Example 11 provides an instant push device, comprising: a receiving module, configured to receive candidate push content and a first push parameter corresponding to the candidate push content sent by a server, wherein the candidate push content and the first push parameter corresponding to the candidate push content are determined by the server based on the feature values of its sample features and the server's push model; a second determining module, configured to determine a second push parameter corresponding to the candidate push content based on the feature values of its sample features and the client's push model, wherein the client's push model is a second model in a model trained based on the federated learning-based model training method described in any one of Examples 1-6, and the server's push model is a first model in a model trained based on the federated learning-based model training method described in any one of Examples 1-6; and a push module, configured to determine a target push parameter based on the first push parameter and the second push parameter of the candidate push content, and perform instant push based on the target push parameter.
[0145] According to one or more embodiments of the present disclosure, Example 12 provides a computer-readable medium having a computer program stored thereon that, when executed by a processing device, implements the steps of the method described in any one of Examples 1-9.
[0146] According to one or more embodiments of this disclosure, Example 13 provides an electronic device including: a storage device having a computer program stored thereon; and a processing device for executing the computer program in the storage device to implement the steps of the method described in any one of Examples 1-9.
[0147] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0148] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0149] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative forms of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.
Claims
1. A model training method based on federated learning, characterized in that, Applied to the first participant, the method includes: The first model is trained once based on the local training data of the first participant, and the first change value between the parameter values of the first model obtained after this round of training and the parameter values of the first model obtained after the previous round of training is determined, wherein each round of training includes multiple iterative training. Obtain the second change value corresponding to the second model sent by multiple second participants respectively, wherein the feature dimensions of the training data of each second participant are the same but the samples are different, the samples in the training data of the first participant and the second participant are the same but the feature dimensions are different, and the second model is obtained by each second participant based on the local training data of the second participant. The target change value is determined based on the first change value and multiple second change values; The parameters of the first model and the second model are adjusted according to the target change value, and the parameter-adjusted second model is sent to each of the second participants; The step of determining the target change value based on the first change value and a plurality of second change values includes: Multiple second change values are fused to obtain the fused change value corresponding to the second model; Based on the fusion change value, calculate the adjustment value of the parameters in the second model; Based on the adjustment value and the parameter values of the second model obtained after the previous training, determine the update change value corresponding to the parameters of the second model; The sum of the first change value and the updated change value is determined as the target change value.
2. The method according to claim 1, characterized in that, The step of calculating the adjustment values of the parameters in the second model based on the fusion change value includes: Substitute the fusion change value into the second model, calculate the value of the parameter after the second model is adjusted based on the fusion change value, and determine the value as the adjustment value.
3. The method according to claim 1, characterized in that, The step of fusing multiple second change values to obtain the fused change value corresponding to the second model includes: The weight of each second participant is determined based on the amount of training data for each second participant. The fusion change value is obtained by weighted summation based on the second change value corresponding to the second participant and the weight corresponding to the second participant.
4. The method according to claim 1, characterized in that, The second change value of the second model is determined in the following way: Each of the second participants trains the second model once based on the training data on the second participant's local machine, and obtains the trained second model. For each of the second participants, the difference between the parameter values of the trained second model corresponding to the second participant and the parameter values of the second model after the previous round of training is determined as the second change value of the second model corresponding to the second parameter participant.
5. The method according to claim 1, characterized in that, The training data in the local area of the first participant includes training content and the corresponding tags of the training content. The tags are generated and sent to the first participant in response to the push result of the training content in the second participant when the training content is pushed to the second participant.
6. A method for instant push notifications, characterized in that, include: The server receives candidate push content and a first push parameter corresponding to the candidate push content, wherein the candidate push content and the first push parameter corresponding to the candidate push content are determined by the server based on the feature values of the sample features it possesses and the server's push model. Based on the feature values of the sample features and the client's push model, the second push parameters corresponding to the candidate push content are determined, wherein the client's push model is the second model in the model trained by the federated learning-based model training method according to any one of claims 1-5, and the server's push model is the first model in the model trained by the federated learning-based model training method according to any one of claims 1-5. The target push parameters are determined based on the first push parameters and the second push parameters of the candidate push content, and the push is performed in real time based on the target push parameters.
7. The method according to claim 6, characterized in that, The client's sample features include at least one of the following: Current time, acceleration, gyroscope sensor information, user distance from screen, whether headphones are plugged in, whether the user is playing audio, current battery level, and current network status.
8. The method according to claim 6, characterized in that, The server's sample characteristics include at least one of the following: The content's primary vertical category, its popularity on the client, its basic profile, the reach and click-through rate of push notifications within the most recent first preset time period, the time interval between the most recent click and the current time, whether the content is active on the current day, and the activity rate of the content within the most recent second preset time period.
9. A model training device based on federated learning, characterized in that, Applied to the first participant, the device includes: The first training module is used to train the first model in one round based on the training data of the first participant, and to determine the first change value between the parameter values of the first model obtained after this round of training and the parameter values of the first model obtained after the previous round of training, wherein each round of training includes multiple iterative training. The acquisition module is used to acquire the second change value corresponding to the second model sent by multiple second participants respectively. The feature dimensions of the training data of each second participant are the same but the samples are different. The samples in the training data of the first participant and the second participant are the same but the feature dimensions are different. The second model is obtained by each second participant based on the local training data of the second participant. The first determining module is used to determine a target change value based on the first change value and a plurality of second change values; The second training module is used to adjust the parameters of the first model and the second model according to the target change value, and send the parameter-adjusted second model to each of the second participants so that the second participants can train the parameter-adjusted second model. The first determining module includes: a first processing submodule, used to fuse multiple second change values to obtain a fused change value corresponding to the second model; a second processing submodule, used to calculate the adjustment value of the parameters in the second model based on the fused change value; a first determining submodule, used to determine the updated change value corresponding to the parameters of the second model based on the adjustment value and the parameter values of the second model obtained after the previous training round; and a second determining submodule, used to determine the sum of the first change value and the updated change value as the target change value.
10. An instant push device, characterized in that, include: The receiving module is used to receive candidate push content and a first push parameter corresponding to the candidate push content sent by the server, wherein the candidate push content and the first push parameter corresponding to the candidate push content are determined by the server based on the feature values of the sample features it possesses and the server's push model; The second determining module is used to determine the second push parameters corresponding to the candidate push content based on the feature values of the sample features and the push model of the client, wherein the push model of the client is the second model in the model trained by the federated learning-based model training method according to any one of claims 1-5, and the push model of the server is the first model in the model trained by the federated learning-based model training method according to any one of claims 1-5. The push module is used to determine the target push parameters based on the first push parameters and the second push parameters of the candidate push content, and to perform real-time push based on the target push parameters.
11. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processing device, it implements the steps of the method described in any one of claims 1-8.
12. An electronic device, characterized in that, include: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method according to any one of claims 1-8.