A federated learning model training method and device, equipment and medium

By storing multiple sets of hyperparameter values ​​and their probability values ​​on the server, and optimizing the hyperparameter configuration using the FedEx algorithm and generative model, the problem of poor model quality caused by random selection of hyperparameters is solved, and efficient training and accurate prediction of the joint learning model in complex scenarios are achieved.

CN116739111BActive Publication Date: 2026-03-27新奥新智科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-25
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In existing technologies, randomly selected hyperparameter values ​​affect model runtime and predictive ability, resulting in poor model quality, especially in complex industrial scenarios where it is difficult to optimize hyperparameter configuration.

Method used

By storing multiple sets of hyperparameter values ​​and their probability values ​​in the server, the hyperparameter configuration is optimized using the FedEx algorithm and generative model. The probability values ​​are updated based on the training loss value. The optimal hyperparameter values ​​are selected for model training, and replacement and updates are performed after each round of training.

Benefits of technology

It improves the training effect and prediction ability of the joint learning model, optimizes the hyperparameter configuration, and ensures the efficient operation and accuracy of the model in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116739111B_ABST
    Figure CN116739111B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a joint learning model training method and device, equipment and medium. In the embodiment of the application, the server updates the probability value corresponding to each group of hyperparameter values according to the Fedex algorithm and the total loss value; and generates a group of candidate hyperparameter values and the probability value corresponding to the group of candidate hyperparameter values according to each group of hyperparameter values and the updated probability value of each group of hyperparameter values; and replaces the group of hyperparameter values with the minimum probability value currently saved by using the group of candidate hyperparameter values, thereby optimizing the hyperparameter values. In the embodiment of the application, a hyperparameter is not directly randomly selected as the hyperparameter for joint learning, and a new candidate hyperparameter value is generated according to the training effect of different hyperparameters to replace the existing hyperparameter value, so that the optimal hyperparameter can be selected, and the training effect and prediction ability of the model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device and medium for training a joint learning model. Background Technology

[0002] Complex industrial scenarios present greater challenges than other internet scenarios. In the detection of user gas flue problems, the variable human and environmental factors create many difficulties for the adjustment of hyperparameters in joint learning.

[0003] In related technologies, a common approach is to randomly select a set of hyperparameters from a database corresponding to hyperparameter values, and then use this set of hyperparameters to configure the untrained model. Furthermore, the hyperparameter values ​​are not adjusted during model training, resulting in the final trained model retaining these randomly selected hyperparameter values. In joint learning, the setting of model hyperparameter values ​​directly affects the final training results. Randomly selected hyperparameter values ​​may affect the model's runtime and predictive ability, leading to poor-quality trained models. Summary of the Invention

[0004] This application provides a joint learning model training method, apparatus, device, and medium to solve the problem that randomly selected hyperparameter values ​​in the prior art may affect the model's running time and predictive ability, resulting in poor quality of the trained model.

[0005] This application provides a joint learning model training method applied to a server, the method comprising:

[0006] For each round of training, perform the following operations:

[0007] Based on the probability values ​​corresponding to each set of hyperparameter values ​​currently saved, a set of target hyperparameter values ​​is determined, and each sub-model is trained using this set of target hyperparameter values. A total loss value is determined based on each sub-loss value corresponding to each sub-model. If the total loss value is greater than a preset threshold, the probability values ​​corresponding to each set of hyperparameter values ​​are updated according to the FedEx algorithm and the total loss value. Each set of hyperparameter values ​​and the updated probability values ​​are input into the generative model to obtain a set of candidate hyperparameter values ​​output by the generative model. This set of candidate hyperparameter values ​​is used to replace the set of hyperparameter values ​​with the smallest probability value currently saved. The above operations are then re-executed for the probability values ​​corresponding to each set of currently saved hyperparameter values ​​after the replacement.

[0008] Furthermore, if the current training is the first round of training, before determining a set of target hyperparameter values ​​based on the probability values ​​corresponding to each set of currently saved hyperparameter values, the method further includes:

[0009] A preset number of hyperparameter values ​​are randomly selected from the hyperparameter value database, and the preset number of hyperparameter values ​​are determined as each currently saved hyperparameter value.

[0010] Obtain the pre-saved initial probability value, and determine the initial probability value as the probability value corresponding to each set of hyperparameter values.

[0011] Furthermore, updating the probability values ​​corresponding to each set of hyperparameter values ​​based on the FedEx algorithm and the total loss value includes:

[0012] The hyperparameter values, the probability values ​​corresponding to each set of hyperparameter values, and the total loss value are input into the program built based on the FedEx algorithm.

[0013] Obtain each set of hyperparameter values ​​output by the program and the updated probability value corresponding to each set of hyperparameter values.

[0014] Furthermore, the generative model is a model designed based on the Bayesian algorithm.

[0015] Furthermore, the step of replacing the set of hyperparameter values ​​with the one that has the lowest probability value using this set of hyperparameter values ​​includes:

[0016] Based on the probability value corresponding to each group of hyperparameter values, sort the hyperparameter values ​​to determine the hyperparameter value queue;

[0017] Delete the last group of hyperparameter values ​​from the hyperparameter value queue and add the candidate hyperparameter values ​​to the hyperparameter value queue.

[0018] Furthermore, the method also includes:

[0019] For each training round, if the number of training rounds of the joint learning model reaches a preset threshold, then the joint learning model is determined to be trained successfully, and the set of target hyperparameter values ​​is determined as the optimal hyperparameter values ​​of the joint learning model; or, if the total loss value corresponding to the training round does not exceed the preset threshold, and the number of times the total loss value does not exceed the preset threshold reaches a preset threshold, then the joint learning model is determined to be trained successfully, and the set of target hyperparameter values ​​is determined as the optimal hyperparameter values ​​of the joint learning model.

[0020] This application embodiment also provides a joint learning model training device applied to a server, the device comprising:

[0021] The determination module is used to determine a set of target hyperparameter values ​​based on the probability values ​​corresponding to each set of currently saved hyperparameter values, and to train each sub-model using this set of target hyperparameter values;

[0022] The processing module is used to determine the total loss value based on each sub-loss value corresponding to each sub-model; if the total loss value is greater than a preset threshold, the probability value corresponding to each set of hyperparameter values ​​is updated according to the FedEx algorithm and the total loss value.

[0023] The hyperparameter value optimization module is used to input each set of hyperparameter values ​​and the updated probability values ​​of each set of hyperparameter values ​​into the generative model, obtain a set of candidate hyperparameter values ​​output by the generative model; replace the set of hyperparameter values ​​with the smallest probability value currently saved with the set of candidate hyperparameter values; and re-execute the above operation for the probability value corresponding to each set of hyperparameter values ​​currently saved after replacement.

[0024] Furthermore, the determining module is also used to, if the current training is the first round of training, randomly select a preset number of hyperparameter values ​​from the hyperparameter value database, and determine the preset number of hyperparameter values ​​as each set of hyperparameter values ​​currently saved; obtain a pre-saved initial probability value, and determine the initial probability value as the probability value corresponding to each set of hyperparameter values.

[0025] This application also provides an electronic device, which includes a processor for executing a computer program stored in a memory to implement the steps of the joint learning model training method as described above.

[0026] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the joint learning model training methods described above.

[0027] In this embodiment, for each training round, the server performs the following operations: Based on the probability values ​​corresponding to each currently saved set of hyperparameter values, a set of target hyperparameter values ​​is determined, and each sub-model is trained using this set of target hyperparameter values; a total loss value is determined based on each sub-loss value corresponding to each sub-model; if the total loss value is greater than a preset threshold, the probability values ​​corresponding to each set of hyperparameter values ​​are updated according to the FedEx algorithm and the total loss value; each set of hyperparameter values ​​and the updated probability values ​​are input into the generative model to obtain a set of candidate hyperparameter values ​​and their corresponding probability values ​​output by the generative model; the set of candidate hyperparameter values ​​is used to replace the set of hyperparameter values ​​with the smallest probability value currently saved; and the above operations are re-executed for the replaced probability values ​​corresponding to each set of currently saved hyperparameter values. Attached Figure Description

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

[0029] Figure 1 This is a schematic diagram illustrating the training process of a joint learning model provided in an embodiment of this application;

[0030] Figure 2 The hyperparameter tuning process based on the Flora algorithm is provided for existing technologies;

[0031] Figure 3 A schematic diagram of joint learning provided for embodiments of this application;

[0032] Figure 4 The hyperparameter value replacement process provided in the embodiments of this application;

[0033] Figure 5 The hyperparameter tuning process provided in the embodiments of this application;

[0034] Figure 6 A schematic diagram of a joint learning model training device provided in an embodiment of this application;

[0035] Figure 7 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0037] To improve the training effect and prediction ability of joint learning models, embodiments of this application provide a joint learning model training method, apparatus, device and medium.

[0038] In this embodiment, for each training round, the following operations are performed: A set of target hyperparameter values ​​is determined based on the probability values ​​corresponding to each currently saved set of hyperparameter values, and each sub-model is trained using this set of target hyperparameter values; a total loss value is determined based on each sub-loss value corresponding to each sub-model; if the total loss value is greater than a preset threshold, the probability values ​​corresponding to each set of hyperparameter values ​​are updated according to the FedEx algorithm and the total loss value; each set of hyperparameter values ​​and the updated probability values ​​are input into the generative model to obtain a set of candidate hyperparameter values ​​and the probability values ​​corresponding to this set of candidate hyperparameter values ​​output by the generative model; the set of candidate hyperparameter values ​​is used to replace the set of hyperparameter values ​​with the smallest probability value currently saved; and the above operations are re-executed for the probability values ​​corresponding to each currently saved set of hyperparameter values ​​after the replacement.

[0039] Example 1:

[0040] Figure 1 This application provides a schematic diagram of a joint learning model training process, which includes:

[0041] For each round of training, perform the following operations:

[0042] S101: Based on the probability values ​​corresponding to each set of hyperparameter values ​​currently saved, determine a set of target hyperparameter values, and train each sub-model using this set of target hyperparameter values.

[0043] This application provides a joint learning model training method applied to a server.

[0044] Joint learning is a machine learning paradigm where multiple client-side sub-models are trained together under the coordination of a server, while maintaining the decentralization and distribution of training data. For example, in a scenario of detecting gas flue problems, where company personnel take photos of gas stoves and flues one by one, joint learning can train a model by combining relevant photos from different regions. The resulting joint model, along with handheld terminal devices, can perform intelligent real-time detection tasks by replacing manual labor with algorithms.

[0045] In the joint learning process, hyperparameters need to be configured for the model. Once configured, the corresponding values ​​of the hyperparameters are not modified during training. However, the selection of hyperparameter values ​​directly affects the accuracy of the joint model obtained through joint learning. Therefore, to improve the optimal hyperparameter values, in this embodiment, the server stores multiple sets of hyperparameter values ​​and the probability values ​​corresponding to each set. The server can sample based on the probability values ​​corresponding to each set of hyperparameters to determine a target set of hyperparameter values.

[0046] The server sends the set of target hyperparameter values ​​to each sub-model in the joint learning process, so that each sub-model can configure its local hyperparameters using the set of target hyperparameter values ​​and then train the model after configuration.

[0047] S102: Determine the total loss value based on each sub-loss value corresponding to each sub-model; if the total loss value is greater than a preset threshold, update the probability value corresponding to each set of hyperparameter values ​​according to the Fedex algorithm and the total loss value.

[0048] In this embodiment, after each sub-model is trained using the target parameter values, each sub-model sends the trained sub-loss value to the server. The server determines the total loss value for joint learning based on each sub-loss value. If the total loss value is greater than a preset threshold, the probability values ​​corresponding to each set of hyperparameter values ​​can be updated according to the FedEx algorithm and the total loss value.

[0049] Specifically, in this embodiment, the server calculates the sum of each sub-loss value and determines the sum as the total loss value. If the server determines that the total loss value is greater than a preset threshold, the server calls the process corresponding to the FedEx algorithm and updates the probability value corresponding to each set of hyperparameter values ​​using the FedEx algorithm and the total loss value.

[0050] Specifically, the server configures the hyperparameter values ​​as x and the probability values ​​as y, fits a surrogate function (e.g., a Gaussian process model) to (x, y), evaluates the point set using the acquisition function, and derives new candidate hyperparameter values.

[0051] S103: Input each set of hyperparameter values ​​and the updated probability values ​​of each set of hyperparameter values ​​into the generative model to obtain a set of candidate hyperparameter values ​​output by the generative model; replace the set of hyperparameter values ​​with the smallest probability value currently saved with the set of candidate hyperparameter values; and re-execute the above operation for the probability values ​​corresponding to each set of hyperparameter values ​​currently saved after replacement.

[0052] In complex scenarios, the obstacle to joint learning lies in the increased complexity of the learning problems, where time, computational costs, and learning performance are all critical. Therefore, traditional hyperparameter tuning algorithms are difficult to apply to joint learning, and existing algorithms are not yet perfect. For example, the FedEx-based hyperparameter tuning algorithm selects multiple sets of hyperparameter values ​​at once, without being able to obtain other sets midway. This results in a final hyperparameter configuration that is not guaranteed to be optimal, but merely the best value among the multiple selected values. While the Flora algorithm in related technologies outperforms the FedEx algorithm in terms of performance, it sacrifices significant time / computational costs for communication costs, failing to meet the hyperparameter tuning requirements of complex joint learning scenarios.

[0053] Figure 2 The hyperparameter tuning process based on the Flora algorithm provided for existing technologies, such as Figure 2 As shown, the process includes:

[0054] S201: The server initializes N sets of hyperparameter values ​​and corresponding probability values.

[0055] S202: Sample N sets of hyperparameter values ​​based on probability values.

[0056] S203: Distribute a set of sampled hyperparameter values ​​to each sub-model for training.

[0057] S204: Each sub-model uploads its training results to the server.

[0058] S205: The server updates the hyperparameters according to the set and evaluates them. If the evaluation passes, the training ends; if the evaluation fails, S206 is executed.

[0059] S206: The server updates the probability values ​​corresponding to the hyperparameter values ​​based on the training results and executes S202.

[0060] Based on this, in this embodiment, after the server updates the probability values ​​corresponding to each set of hyperparameter values, the server inputs each set of hyperparameter values ​​and the updated probability values ​​into the generative model. The generative model then generates a new set of candidate hyperparameter values ​​based on the new set of hyperparameter values ​​and their updated probability values. The server uses this set of candidate hyperparameter values ​​to replace the set of hyperparameter values ​​with the lowest currently stored probability value, and re-executes the above operation for the probability values ​​corresponding to each of the currently stored hyperparameter values ​​after the replacement.

[0061] Figure 3 A schematic diagram of joint learning provided for embodiments of this application, as shown below. Figure 3 As shown, the server uses the FedEx algorithm to determine candidate hyperparameter values ​​and replaces the hyperparameter value with the one that has the lowest probability with the candidate hyperparameter value. The server selects one set of hyperparameter values ​​from multiple sets as the target hyperparameter value and distributes the target hyperparameter value to each sub-model (Client1, Client2, ..., Clientn). Each sub-model is trained based on local samples and sends the training results (validate) to the server.

[0062] In this embodiment, the direct random selection of a hyperparameter as the hyperparameter for joint learning is avoided. Instead, the optimal hyperparameter is selected based on the training effect of different hyperparameters, thereby improving the training effect and prediction ability of the model.

[0063] Example 2:

[0064] To select the optimal hyperparameter values, based on the above embodiments, in this embodiment, if the current training is the first round of training, before determining a set of target hyperparameter values ​​according to the probability values ​​corresponding to each set of currently saved hyperparameter values, the method further includes:

[0065] A preset number of hyperparameter values ​​are randomly selected from the hyperparameter value database, and the preset number of hyperparameter values ​​are determined as each currently saved hyperparameter value.

[0066] Obtain the pre-saved initial probability value, and determine the initial probability value as the probability value corresponding to each set of hyperparameter values.

[0067] In this embodiment of the application, before starting training, the server randomly selects a preset number of hyperparameter values ​​from the hyperparameter value database and determines the preset group of hyperparameter values ​​as each group of hyperparameters currently saved.

[0068] Specifically, in the embodiments of this application, if the current training is the first round of training, the server randomly selects a preset number of hyperparameter values ​​from the hyperparameter value database. The electronic device obtains the saved initial probability values ​​and determines these initial probability values ​​as the probability values ​​corresponding to each group of hyperparameter values. Generally, the sum of the initial probability values ​​corresponding to each group of hyperparameter values ​​is 1.

[0069] Example 3:

[0070] To update the probability values ​​for each set of hyperparameter values, based on the above embodiments, in this embodiment, updating the probability values ​​corresponding to each set of hyperparameter values ​​according to the FedEx algorithm and the total loss value includes:

[0071] The hyperparameter values, the probability values ​​corresponding to each set of hyperparameter values, and the total loss value are input into the program built based on the FedEx algorithm.

[0072] Obtain each set of hyperparameter values ​​output by the program and the updated probability value corresponding to each set of hyperparameter values.

[0073] In this embodiment of the application, the server can update the probability value corresponding to each set of hyperparameter values ​​using a program built based on the FedEx algorithm.

[0074] Specifically, the server stores a program built based on the FedEx algorithm. The server inputs each set of hyperparameter values, the probability value corresponding to each set of hyperparameter values, and the total loss value into the program, and obtains the output of each set of hyperparameter values ​​and the updated probability value corresponding to each set of hyperparameter values.

[0075] In order to improve the training effect and prediction ability of the joint learning model, based on the above embodiments, in this embodiment of the application, the generative model is a model designed based on the Bayesian algorithm.

[0076] In this embodiment of the application, when the server obtains a new set of candidate hyperparameter values ​​based on the generative model, the generative model can be a model designed based on the Bayesian algorithm.

[0077] Furthermore, in the embodiments of this application, the generated model can also be a model designed using particle swarm optimization, genetic algorithm, or evolutionary algorithm.

[0078] Example 4:

[0079] To improve the training performance and prediction capability of the joint learning model, based on the above embodiments, in this embodiment, replacing the set of hyperparameter values ​​with the one that has the lowest probability value using this set of hyperparameter values ​​includes:

[0080] Based on the probability value corresponding to each group of hyperparameter values, sort the hyperparameter values ​​to determine the hyperparameter value queue;

[0081] Delete the last group of hyperparameter values ​​from the hyperparameter value queue and add the candidate hyperparameter values ​​to the hyperparameter value queue.

[0082] In this embodiment of the application, when the server replaces the set of hyperparameter values ​​with the lowest probability value using the set of hyperparameter values, the server sorts each set of hyperparameter values ​​according to the probability value corresponding to each set of hyperparameter values ​​to determine the hyperparameter value queue.

[0083] The server then removes the last set of hyperparameter values ​​from the hyperparameter value queue and adds the candidate hyperparameter value to the hyperparameter value queue.

[0084] Specifically, in this embodiment, the server sorts each group of hyperparameter values ​​according to the probability value corresponding to each group of hyperparameter values ​​to determine a hyperparameter value queue. Furthermore, the server stores the probability value corresponding to each order in the hyperparameter value queue. The server adds a candidate hyperparameter value to the first order and determines the probability value corresponding to the first order as the probability value corresponding to the candidate hyperparameter value. The server deletes the last group of hyperparameter values ​​from the hyperparameter value queue and shifts the other hyperparameter values ​​in the queue in order.

[0085] Figure 4 The hyperparameter value replacement process provided in the embodiments of this application is as follows: Figure 4As shown, the server sorts each group of hyperparameter values ​​according to the probability value corresponding to each group of hyperparameter values ​​to determine the hyperparameter value queue. The server adds the candidate hyperparameter values ​​to the first order, moves the other hyperparameter values ​​in the hyperparameter value queue in order, and deletes the last group of hyperparameter values ​​in the hyperparameter value queue.

[0086] Example 5:

[0087] To improve efficiency, based on the above embodiments, the method in this application embodiment further includes:

[0088] For each training round, if the number of training rounds of the joint learning model reaches a preset threshold, then the joint learning model is determined to be trained successfully, and the set of target hyperparameter values ​​is determined as the optimal hyperparameter values ​​of the joint learning model; or, if the total loss value corresponding to the training round does not exceed the preset threshold, and the number of times the total loss value does not exceed the preset threshold reaches a preset threshold, then the joint learning model is determined to be trained successfully, and the set of target hyperparameter values ​​is determined as the optimal hyperparameter values ​​of the joint learning model.

[0089] In the embodiments of this application, when the joint learning model is being trained, if the number of training rounds of the joint learning model reaches a preset threshold for each round of training, the joint learning model is determined to be trained and the set of target hyperparameter values ​​is determined as the optimal hyperparameter values ​​of the joint learning model.

[0090] Alternatively, in this embodiment, for each training round, if the total loss value corresponding to that round of training does not exceed a preset threshold, and the number of times the total loss value does not exceed the preset threshold reaches a preset number threshold, then the joint learning model training is determined to be complete, and the set of target hyperparameter values ​​is determined as the optimal hyperparameter values ​​of the joint learning model.

[0091] Figure 5 The hyperparameter tuning process provided in the embodiments of this application, such as Figure 5 As shown, the process includes:

[0092] S501: The server initializes N sets of hyperparameter values ​​and corresponding probability values.

[0093] S502: Sample N sets of hyperparameter values ​​based on probability values.

[0094] S503: Distribute a set of sampled hyperparameter values ​​to each sub-model for training.

[0095] S504: Each sub-model uploads its training results to the server.

[0096] S505: The server updates the hyperparameters according to the set and evaluates them. If the evaluation passes, the training ends; if the evaluation fails, S506 is executed.

[0097] S506: The server updates the probability values ​​corresponding to the hyperparameter values ​​based on the training results.

[0098] S507: The server determines candidate hyperparameter values ​​based on the generated model, updates N sets of hyperparameter values ​​using the candidate hyperparameter values, and executes S502 accordingly.

[0099] Example 6:

[0100] Figure 6 A schematic diagram of a joint learning model training device provided in this application embodiment is shown. The device includes:

[0101] The determination module 601 is used to determine a set of target hyperparameter values ​​based on the probability values ​​corresponding to each set of hyperparameter values ​​currently saved, and to train each sub-model using the set of target hyperparameter values.

[0102] The processing module 603 is used to determine the total loss value based on each sub-loss value corresponding to each sub-model; if the total loss value is greater than a preset threshold, the probability value corresponding to each set of hyperparameter values ​​is updated according to the FedEx algorithm and the total loss value.

[0103] The hyperparameter value optimization module 602 is used to input each set of hyperparameter values ​​and the updated probability values ​​of each set of hyperparameter values ​​into the generative model, obtain a set of candidate hyperparameter values ​​output by the generative model; replace the set of hyperparameter values ​​with the smallest probability value currently saved with the set of candidate hyperparameter values; and re-execute the above operation for the probability value corresponding to each set of hyperparameter values ​​currently saved after replacement.

[0104] In one possible implementation, the determining module 601 is further configured to, if the current training is the first round of training, randomly select a preset number of hyperparameter values ​​from the hyperparameter value database, and determine the preset number of hyperparameter values ​​as each set of currently saved hyperparameter values; obtain a pre-saved initial probability value, and determine the initial probability value as the probability value corresponding to each set of hyperparameter values.

[0105] In one possible implementation, the processing module 603 is specifically used to input each set of hyperparameter values, the probability value corresponding to each set of hyperparameter values, and the total loss value into a program built based on the FedEx algorithm; and to obtain each set of hyperparameter values ​​and the updated probability value corresponding to each set of hyperparameter values ​​output by the program.

[0106] In one possible implementation, the generative model is a model designed based on a Bayesian algorithm.

[0107] In one possible implementation, the hyperparameter value optimization module 602 is used to sort each group of hyperparameter values ​​according to the probability value corresponding to each group of hyperparameter values ​​to determine a hyperparameter value queue; delete the last group of hyperparameter values ​​in the hyperparameter value queue, and add the candidate hyperparameter values ​​to the hyperparameter value queue.

[0108] In one possible implementation, the processing module 603 is further configured to, for each training round, determine that the joint learning model is trained successfully if the number of training rounds of the joint learning model reaches a preset threshold, and determine the set of target hyperparameter values ​​as the optimal hyperparameter values ​​of the joint learning model; or, determine that the joint learning model is trained successfully if the total loss value corresponding to the training round does not exceed the preset threshold, and the number of times the total loss value does not exceed the preset threshold reaches a preset number threshold, and determine the set of target hyperparameter values ​​as the optimal hyperparameter values ​​of the joint learning model.

[0109] Example 7:

[0110] Based on the above embodiments, this application also provides an electronic device. Figure 7 This application provides a schematic diagram of an electronic device structure, such as... Figure 7 As shown, it includes: processor 71, communication interface 72, memory 73 and communication bus 74, wherein processor 71, communication interface 72 and memory 73 communicate with each other through communication bus 74;

[0111] The memory 73 stores a computer program, which, when executed by the processor 71, causes the processor 71 to perform the following steps:

[0112] For each round of training, perform the following operations:

[0113] Based on the probability values ​​corresponding to each set of hyperparameter values ​​currently saved, a set of target hyperparameter values ​​is determined, and each sub-model is trained using this set of target hyperparameter values. A total loss value is determined based on each sub-loss value corresponding to each sub-model. If the total loss value is greater than a preset threshold, the probability values ​​corresponding to each set of hyperparameter values ​​are updated according to the FedEx algorithm and the total loss value. Each set of hyperparameter values ​​and the updated probability values ​​are input into the generative model to obtain a set of candidate hyperparameter values ​​output by the generative model. This set of candidate hyperparameter values ​​is used to replace the set of hyperparameter values ​​with the smallest probability value currently saved. The above operations are then re-executed for the probability values ​​corresponding to each set of currently saved hyperparameter values ​​after the replacement.

[0114] In one possible implementation, the processor is further configured to:

[0115] A preset number of hyperparameter values ​​are randomly selected from the hyperparameter value database, and the preset number of hyperparameter values ​​are determined as each currently saved hyperparameter value.

[0116] Obtain the pre-saved initial probability value, and determine the initial probability value as the probability value corresponding to each set of hyperparameter values.

[0117] In one possible implementation, the processor is further configured to:

[0118] The hyperparameter values, the probability values ​​corresponding to each set of hyperparameter values, and the total loss value are input into the program built based on the FedEx algorithm.

[0119] Obtain each set of hyperparameter values ​​output by the program and the updated probability value corresponding to each set of hyperparameter values.

[0120] In one possible implementation, the processor is further configured to:

[0121] Based on the probability value corresponding to each group of hyperparameter values, sort the hyperparameter values ​​to determine the hyperparameter value queue;

[0122] Delete the last group of hyperparameter values ​​from the hyperparameter value queue and add the candidate hyperparameter values ​​to the hyperparameter value queue.

[0123] In one possible implementation, the processor is further configured to:

[0124] For each training round, if the number of training rounds of the joint learning model reaches a preset threshold, then the joint learning model is determined to be trained successfully, and the set of target hyperparameter values ​​is determined as the optimal hyperparameter values ​​of the joint learning model; or, if the total loss value corresponding to the training round does not exceed the preset threshold, and the number of times the total loss value does not exceed the preset threshold reaches a preset threshold, then the joint learning model is determined to be trained successfully, and the set of target hyperparameter values ​​is determined as the optimal hyperparameter values ​​of the joint learning model.

[0125] Since the principle of the above-mentioned electronic device in solving the problem is similar to that of the joint learning model training method, the implementation of the above-mentioned electronic device can be found in the embodiments of the method, and the repeated parts will not be described again.

[0126] The communication bus mentioned in the above-mentioned electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not indicate that there is only one bus or one type of bus. Communication interface 72 is used for communication between the above-mentioned electronic device and other devices. The memory can include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory can also be at least one storage device located remotely from the aforementioned processor.

[0127] The processors mentioned above can be general-purpose processors, including central processing units, network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits, field-programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0128] Example 8:

[0129] Based on the above embodiments, this invention also provides a computer-readable storage medium storing a computer program executable by a processor. When the program runs on the processor, it causes the processor to perform the following steps:

[0130] For each round of training, perform the following operations:

[0131] Based on the probability values ​​corresponding to each set of hyperparameter values ​​currently saved, a set of target hyperparameter values ​​is determined, and each sub-model is trained using this set of target hyperparameter values. A total loss value is determined based on each sub-loss value corresponding to each sub-model. If the total loss value is greater than a preset threshold, the probability values ​​corresponding to each set of hyperparameter values ​​are updated according to the FedEx algorithm and the total loss value. Each set of hyperparameter values ​​and the updated probability values ​​are input into the generative model to obtain a set of candidate hyperparameter values ​​output by the generative model. This set of candidate hyperparameter values ​​is used to replace the set of hyperparameter values ​​with the smallest probability value currently saved. The above operations are then re-executed for the probability values ​​corresponding to each set of currently saved hyperparameter values ​​after the replacement.

[0132] In one possible implementation, if the current training is the first round of training, before determining a set of target hyperparameter values ​​based on the probability values ​​corresponding to each set of currently saved hyperparameter values, the method further includes:

[0133] A preset number of hyperparameter values ​​are randomly selected from the hyperparameter value database, and the preset number of hyperparameter values ​​are determined as each currently saved hyperparameter value.

[0134] Obtain the pre-saved initial probability value, and determine the initial probability value as the probability value corresponding to each set of hyperparameter values.

[0135] In one possible implementation, updating the probability values ​​corresponding to each set of hyperparameter values ​​based on the FedEx algorithm and the total loss value includes:

[0136] The hyperparameter values, the probability values ​​corresponding to each set of hyperparameter values, and the total loss value are input into the program built based on the FedEx algorithm.

[0137] Obtain each set of hyperparameter values ​​output by the program and the updated probability value corresponding to each set of hyperparameter values.

[0138] In one possible implementation, the generative model is a model designed based on a Bayesian algorithm.

[0139] In one possible implementation, replacing the set of hyperparameter values ​​with the one that has the lowest probability value using this set of hyperparameter values ​​includes:

[0140] Based on the probability value corresponding to each group of hyperparameter values, sort the hyperparameter values ​​to determine the hyperparameter value queue;

[0141] Delete the last group of hyperparameter values ​​from the hyperparameter value queue and add the candidate hyperparameter values ​​to the hyperparameter value queue.

[0142] In one possible implementation, the method further includes:

[0143] For each training round, if the number of training rounds of the joint learning model reaches a preset threshold, then the joint learning model is determined to be trained successfully, and the set of target hyperparameter values ​​is determined as the optimal hyperparameter values ​​of the joint learning model; or, if the total loss value corresponding to the training round does not exceed the preset threshold, and the number of times the total loss value does not exceed the preset threshold reaches a preset threshold, then the joint learning model is determined to be trained successfully, and the set of target hyperparameter values ​​is determined as the optimal hyperparameter values ​​of the joint learning model.

[0144] Since the principle of the computer-readable storage medium in solving the problem is similar to that of the joint learning model training method, the implementation of the computer-readable storage medium can be found in the embodiments of the method, and repeated details will not be repeated.

[0145] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0146] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0147] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0148] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0149] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A joint learning model training method, applied to a server, characterized in that, The method comprises: In the user gas chimney problem detection scene, the enterprise personnel take pictures one by one on site, and the content is gas stove and gas chimney, and the model is trained jointly by using relevant pictures in different regions; For each round of training, the following operations are performed: The server determines a set of target hyperparameter values according to the probability values corresponding to each set of hyperparameter values currently saved, distributes the target hyperparameter values to each submodel, and makes each submodel adopt the set of target hyperparameter values and train according to local samples, and sends the training result to the server; determine the total loss value according to each sub loss value corresponding to each sub model; if the total loss value is greater than the preset threshold, update the probability value corresponding to each set of hyperparameter values according to the Fedex algorithm and the total loss value; input each set of hyperparameter values and the probability value of each set of hyperparameter values after updating into the generation model, and the generation model generates a set of new candidate hyperparameter values according to the each set of hyperparameter values and the probability value of each set of hyperparameter values after updating; replace the set of hyperparameter values with the smallest probability value currently saved by using the set of candidate hyperparameter values; and re execute the above operation for the probability value corresponding to each set of hyperparameter values currently saved after replacement. If the total loss value corresponding to this round of training does not exceed the preset threshold, and the number of times that the total loss value does not exceed the preset threshold reaches the preset number threshold, it is determined that the joint learning model training is completed, and the set of target hyperparameter values is determined as the optimal hyperparameter value of the joint learning model.

2. The method of claim 1, wherein, If the current training is the first round of training, before determining a set of target hyperparameter values according to the probability value corresponding to each set of hyperparameter values currently saved, the method further comprises: Randomly select a preset number of sets of hyperparameter values from the hyperparameter value database, and determine the preset number of sets of hyperparameter values as the each set of hyperparameter values currently saved; Obtain the initial probability value saved in advance, and determine the initial probability value as the probability value corresponding to each set of hyperparameter values.

3. The method of claim 1, wherein, The updating of the probability value corresponding to each set of hyperparameter values according to the Fedex algorithm and the total loss value comprises: Input the each set of hyperparameter values, the probability value corresponding to each set of hyperparameter values, and the total loss value into the program constructed based on the Fedex algorithm; Obtain each set of hyperparameter values and the updated probability value corresponding to each set of hyperparameter values output by the program.

4. The method of claim 1, wherein, The generation model is a model designed based on the Bayesian algorithm.

5. The method of claim 1, wherein, The replacement of the set of hyperparameter values with the smallest probability value currently saved by using the set of candidate hyperparameter values comprises: Sort each set of hyperparameter values according to the probability value corresponding to each set of hyperparameter values, and determine a hyperparameter value queue; Delete the last set of hyperparameter values in the hyperparameter value queue, and add the candidate hyperparameter values to the hyperparameter value queue.

6. The method of claim 1, wherein, The method further comprises: For each round of training, if the number of training rounds of the joint learning model reaches the preset number threshold, it is determined that the joint learning model training is completed, and the set of target hyperparameter values is determined as the optimal hyperparameter value of the joint learning model. 7.A device for training a federated learning model, applied to a server, the device comprising: The device comprises: In the user gas chimney problem detection scene, pictures are taken by enterprise personnel one by one, the content is gas stove and gas chimney, and the model is trained by combining relevant pictures in different regions; For each round of training, the following operations are performed: The determination module is configured to determine a set of target hyperparameter values based on the probability values corresponding to each set of hyperparameter values currently saved by the server, distribute the target hyperparameter values to each sub-model, and cause each sub-model to adopt the set of target hyperparameter values and perform training based on local samples, and send the training results to the server; The processing module is configured to determine a total loss value based on each sub-loss value corresponding to each sub-model; if the total loss value is greater than a preset threshold, the probability values corresponding to each set of hyperparameter values are updated based on the Fedex algorithm and the total loss value; The hyperparameter value optimization module is configured to input each set of hyperparameter values and the updated probability values of each set of hyperparameter values into a generation model, and the generation model generates a new set of candidate hyperparameter values based on the each set of hyperparameter values and the updated probability values of each set of hyperparameter values; the set of candidate hyperparameter values is used to replace the set of hyperparameter values with the smallest probability value currently saved; and the above operations are re-performed for the probability values corresponding to each set of hyperparameter values currently saved after replacement. If the total loss value corresponding to the round of training does not exceed the preset threshold, and the number of times that the total loss value does not exceed the preset threshold reaches a preset number threshold, it is determined that the joint learning model training is completed, and the set of target hyperparameter values is determined as the optimal hyperparameter value of the joint learning model.

8. The apparatus of claim 7, wherein, The determination module is further configured to, if the current training is the first round of training, randomly select a preset number of sets of hyperparameter values from the hyperparameter value database, determine the preset number of sets of hyperparameter values as the each set of hyperparameter values currently saved, obtain the initial probability values saved in advance, and determine the initial probability values as the probability values corresponding to each set of hyperparameter values.

9. An electronic device, comprising: The electronic device includes a processor configured to implement the steps of the joint learning model training method of any one of claims 1-6 when executing a computer program stored in a memory.

10. A computer-readable storage medium, characterized in that, It stores a computer program, and the computer program is executed by a processor to implement the steps of the joint learning model training method of any one of claims 1-6.

Citation Information

Patent Citations

  • Network structure searching method and device and electronic device

    CN110569973A

  • Hyperparameter learning, intelligent recommendation, keyword and multimedia recommendation method and device

    CN114329167A